Gemdos error handling with Steem3.2

All 680x0 related coding posts in this section please.

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

rockyone
Captain Atari
Captain Atari
Posts: 412
Joined: Thu Jan 20, 2011 8:47 pm
Location: France
Contact:

Gemdos error handling with Steem3.2

Postby rockyone » Fri May 11, 2018 8:27 am

Gemdos returned error -64 (file pointer to invalid segment),.
Normal because the file size was incorrect in the file header.
After correcting this error, why does Fread always send me an error if I do not restart the emulator? (Whatever file I'm trying to read)

Code: Select all

    moveq.l   #0,d0
    addq.l   #6,a3         ; 2(a3)
    bsr.s   read_4byte      ; size file
    sub.l   #38400,d0
 
    move.l   d0,seek_offset   
    move.w  #0, seek_mode   
    bsr   fseek            
    bmi   error   

    move.w   #1,seek_mode
    move.l   #38400,count_byte

    bsr   fread
    bmi   error



rockyone
Captain Atari
Captain Atari
Posts: 412
Joined: Thu Jan 20, 2011 8:47 pm
Location: France
Contact:

Re: Gemdos error handling with Steem3.2

Postby rockyone » Fri May 11, 2018 12:13 pm

After the first -64 error returned by Fseek (Gemdos $42), sometimes Fread (gemdos $3F) returns 0 in D0, but the loaded bytes do not match what is requested. And without reset, nothing good

Well, I'm giving up this loading mode which will be slow for this file.
Also, I do not know how to use the Fseek function (Gemdos $42) correctly with mode 2 and a negative displacement offset. Is there a bug ???
And I did not solve the previous problem

FedePede04
Atari God
Atari God
Posts: 1014
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Gemdos error handling with Steem3.2

Postby FedePede04 » Fri May 11, 2018 1:08 pm

rockyone wrote:After the first -64 error returned by Fseek (Gemdos $42), sometimes Fread (gemdos $3F) returns 0 in D0, but the loaded bytes do not match what is requested. And without reset, nothing good

Well, I'm giving up this loading mode which will be slow for this file.
Also, I do not know how to use the Fseek function (Gemdos $42) correctly with mode 2 and a negative displacement offset. Is there a bug ???
And I did not solve the previous problem


hi i am not the greatest expert in using fseek fread ect, but i could take a look.
so it would help if you posted the whole disk routine. it would be easier to see if you did an error.
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

rockyone
Captain Atari
Captain Atari
Posts: 412
Joined: Thu Jan 20, 2011 8:47 pm
Location: France
Contact:

Re: Gemdos error handling with Steem3.2

Postby rockyone » Fri May 11, 2018 4:56 pm

here is the first test, the palette is not good.
After adding low resolution at medium resolution, he tripled the decoding time of medium resolution images. (I may be able to separate them)

It is not good to use the file size specified in the BMP header because it is not always correct and can cause the -64 error with Fseek.

Otherwise, I stopped the reading test at the end of the file, (I still have errors in return from Gemdos), and I think that this mode of reading would slow the conversion even further.
But I have not seen any fast 24-bit conversion on the ST

BMP.zip


it would not be any more complicated to decode 32 bit BMPs :wink:
You do not have the required permissions to view the files attached to this post.

FedePede04
Atari God
Atari God
Posts: 1014
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Gemdos error handling with Steem3.2

Postby FedePede04 » Fri May 11, 2018 9:29 pm

rockyone wrote:here is the first test, the palette is not good.
After adding low resolution at medium resolution, he tripled the decoding time of medium resolution images. (I may be able to separate them)

It is not good to use the file size specified in the BMP header because it is not always correct and can cause the -64 error with Fseek.

Otherwise, I stopped the reading test at the end of the file, (I still have errors in return from Gemdos), and I think that this mode of reading would slow the conversion even further.
But I have not seen any fast 24-bit conversion on the ST

BMP.zip

it would not be any more complicated to decode 32 bit BMPs :wink:


Hi
I had a look at you code, but i could not see anything wrong with it, it look very nice and clean...
I hope that an other can help you :D

btw only thing that i find weird is

Code: Select all

fread:      
      move.l   64(sp),a3          ; read buffer
      pea      (a3)      <------ are you sure it should not be that address of a3 'Pea a3' now it the contents of a3...
      move.l   seek_offset,-(sp)
      move.w   fhandle,-(sp)
      move.w   #$3f,-(sp)    
      trap   #1
      add.l   #12,sp
      Tst.l      d0
      rts
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

rockyone
Captain Atari
Captain Atari
Posts: 412
Joined: Thu Jan 20, 2011 8:47 pm
Location: France
Contact:

Re: Gemdos error handling with Steem3.2

Postby rockyone » Fri May 11, 2018 11:42 pm

Pea (a3) is ok, but with Pea A3 you enter the datas on the address

I realized that this version worked even after a crash of the second version that reads the file at the end
So I still looked at my mistake.

In fact, I replaced the Seek_offset variable in Fread with another, and it was not initialized before the first Fread.
Tthere are errors that annoy me :twisted: :twisted: :twisted:

The strange thing is that it has sometimes worked. :!:
I'll see that next week


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 1 guest