moulinaie Posted October 24, 2019 Share Posted October 24, 2019 Hello, I have a demo program called TINTIN that displays a little animation in the center of the screen until you press a key. The program reads a data file, loads every frame as new char definitions, at end of file, it goes back to the beginning and again and again. On real hardware, no problem as you can see on this animation (TINTIN and his dog are constantly running and the LED of the CF7+ is blinking, showing that data is read. TINTIN and MILOU running But with Classic99, you just see the first step of TINTIN, then nothing moves. But the program is not frozen as pressing a key returns correctly to XBasic. What is the problem...? I have attached a ZIP file with the sources and the DSK1 folder for CLASSIC99. OLD DSK1.TINTIN RUN (then press a key to stop) Guillaume. seven_mlc.zip 2 Quote Link to comment Share on other sites More sharing options...
matthew180 Posted October 25, 2019 Share Posted October 25, 2019 Are you running the latest Classic99? Also, Classic99 has a debugger. If you open the debug window and run your program, there are file errors. There is something going on trying to re-read the VIDEO file. This is where things seem to go badly: DSR opcode >2 on PAB >1CC7, filename DSK1.VIDEO Seek past end of file VIDEO Failed reading max 240 bytes DSK1.VIDEO on drive type FIAD Setting file error 5 on file buffer 18 Releasing file buffer 18 Can't read from VIDEO as file is not opened for read. Full log: DSR opcode >5 on PAB >096E, filename DSK1.TINTIN Loading to VDP >0971 DSK1.TINTIN on drive type FIAD Detected .\DSK1\TINTIN as a TIFILES file loading 0x857 bytes DSR opcode >0 on PAB >368D, filename DSK1.NEWFLO Opening DSK1.NEWFLO on drive type FIAD PAB requested file type is DF0 Allocating file buffer 0 Detected .\DSK1\NEWFLO as a V9T9 file .\DSK1\NEWFLO read 19 records Restore set record number to 0 DSR opcode >2 on PAB >368D, filename DSK1.NEWFLO Read 0x50 bytes drive 1 file NEWFLO (Fixed record 0) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 1) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 2) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 3) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 4) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 5) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 6) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 7) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 8) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 9) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 10) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 11) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 12) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 13) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 14) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 15) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 16) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 17) to >3694 Read 0x50 bytes drive 1 file NEWFLO (Fixed record 18) to >3694 DSR opcode >1 on PAB >368D, filename DSK1.NEWFLO Closing DSK1.NEWFLO on drive type FIAD Releasing file buffer 18 DSR opcode >5 on PAB >366B, filename DSK1.MLC1 Loading to VDP >1B4D DSK1.MLC1 on drive type FIAD Detected .\DSK1\MLC1 as a V9T9 file loading 0x1B10 bytes Loading to VDP >1B4D DSK1.MLC2 on drive type FIAD Detected .\DSK1\MLC2 as a V9T9 file loading 0x492 bytes ** This is where the scrolling text is happening, followed by repeating errors on the VIDEO file access. *** DSR opcode >0 on PAB >1CC7, filename DSK1.VIDEO Opening DSK1.VIDEO on drive type FIAD PAB requested file type is IF240 Allocating file buffer 0 Detected .\DSK1\VIDEO as a V9T9 file .\DSK1\VIDEO read 5 records Restore set record number to 0 DSR opcode >4 on PAB >1CC7, filename DSK1.VIDEO Restoring record 0 DSK1.VIDEO on drive type FIAD Restore set record number to 0 DSR opcode >2 on PAB >1CC7, filename DSK1.VIDEO Read 0xF0 bytes drive 1 file VIDEO (Fixed record 0) to >0600 Read 0xF0 bytes drive 1 file VIDEO (Fixed record 1) to >0600 Read 0xF0 bytes drive 1 file VIDEO (Fixed record 2) to >0600 Read 0xF0 bytes drive 1 file VIDEO (Fixed record 3) to >0600 Read 0xF0 bytes drive 1 file VIDEO (Fixed record 4) to >0600 DSR opcode >4 on PAB >1CC7, filename DSK1.VIDEO Restoring record 5 DSK1.VIDEO on drive type FIAD Restore set record number to 0 DSR opcode >2 on PAB >1CC7, filename DSK1.VIDEO Seek past end of file VIDEO Failed reading max 240 bytes DSK1.VIDEO on drive type FIAD Setting file error 5 on file buffer 18 Releasing file buffer 18 Can't read from VIDEO as file is not opened for read. Setting file error 3 on file buffer 2680 Can't read from VIDEO as file is not opened for read. Setting file error 3 on file buffer 2681 Can't read from VIDEO as file is not opened for read. Setting file error 3 on file buffer 2682 Can't read from VIDEO as file is not opened for read. Setting file error 3 on file buffer 2683 DSR opcode >4 on PAB >1CC7, filename DSK1.VIDEO Can't restore VIDEO as file is not opened for read. Setting file error 3 on file buffer 2684 DSR opcode >2 on PAB >1CC7, filename DSK1.VIDEO Can't read from VIDEO as file is not opened for read. Setting file error 3 on file buffer 2685 Quote Link to comment Share on other sites More sharing options...
Tursi Posted October 25, 2019 Share Posted October 25, 2019 (edited) 5 hours ago, matthew180 said: Restoring record 5 DSK1.VIDEO on drive type FIAD Restore set record number to 0 DSR opcode >2 on PAB >1CC7, filename DSK1.VIDEO Seek past end of file VIDEO Thanks for posting a log. My first suspicion is in the above section - it looks like the restore didn't clear the end of file flag. I wouldn't expect a read after restore to record 0 to cause read past EOF. I'll check that in the code. (Everything after that is just the source program not catching the error...) Although it's not clear to me why a restore of record 5 is going to 0, I need to see if that's a debug bug. Is that a correct understanding of the code flow? You read 5 records and then restore the file pointer back to 0? And that runs well enough from a real floppy disk? Edited October 25, 2019 by Tursi Quote Link to comment Share on other sites More sharing options...
moulinaie Posted October 25, 2019 Author Share Posted October 25, 2019 6 hours ago, matthew180 said: Are you running the latest Classic99? Also, Classic99 has a debugger. If you open the debug window and run your program, there are file errors. There is something going on trying to re-read the VIDEO file. This is where things seem to go badly: DSR opcode >2 on PAB >1CC7, filename DSK1.VIDEO Seek past end of file VIDEO Failed reading max 240 bytes DSK1.VIDEO on drive type FIAD Setting file error 5 on file buffer 18 Releasing file buffer 18 Can't read from VIDEO as file is not opened for read. Full log: DSR opcode >0 on PAB >1CC7, filename DSK1.VIDEO Opening DSK1.VIDEO on drive type FIAD PAB requested file type is IF240 Allocating file buffer 0 Detected .\DSK1\VIDEO as a V9T9 file .\DSK1\VIDEO read 5 records Restore set record number to 0 DSR opcode >4 on PAB >1CC7, filename DSK1.VIDEO Restoring record 0 DSK1.VIDEO on drive type FIAD Restore set record number to 0 DSR opcode >2 on PAB >1CC7, filename DSK1.VIDEO Read 0xF0 bytes drive 1 file VIDEO (Fixed record 0) to >0600 Read 0xF0 bytes drive 1 file VIDEO (Fixed record 1) to >0600 Read 0xF0 bytes drive 1 file VIDEO (Fixed record 2) to >0600 Read 0xF0 bytes drive 1 file VIDEO (Fixed record 3) to >0600 Read 0xF0 bytes drive 1 file VIDEO (Fixed record 4) to >0600 DSR opcode >4 on PAB >1CC7, filename DSK1.VIDEO Restoring record 5 DSK1.VIDEO on drive type FIAD Restore set record number to 0 DSR opcode >2 on PAB >1CC7, filename DSK1.VIDEO Seek past end of file VIDEO Failed reading max 240 bytes DSK1.VIDEO on drive type FIAD Thanks a lot Matthew ! I didn't think of looking at the LOG in the debugger...! Well, we'are approaching the solution. Guillaume. Quote Link to comment Share on other sites More sharing options...
moulinaie Posted October 25, 2019 Author Share Posted October 25, 2019 34 minutes ago, Tursi said: Thanks for posting a log. My first suspicion is in the above section - it looks like the restore didn't clear the end of file flag. I wouldn't expect a read after restore to record 0 to cause read past EOF. I'll check that in the code. (Everything after that is just the source program not catching the error...) Although it's not clear to me why a restore of record 5 is going to 0, I need to see if that's a debug bug. Is that a correct understanding of the code flow? You read 5 records and then restore the file pointer back to 0? And that runs well enough from a real floppy disk? Hi Tursi, The file is opened with FLAGS sequential, internal, fixed, input and lenght of 240 bytes. This is correct : the program reads five records of 240 bytes each and then restore the postition to the beginning of the file. And so on. It runs well on a CF7+ (I do not have a real floppy unit). Guillaume. Quote Link to comment Share on other sites More sharing options...
Tursi Posted October 25, 2019 Share Posted October 25, 2019 (edited) Yeah, that's what I was curious about. The seeks would probably kill it. Anyway, yeah. The problem was my implementation of RESTORE didn't reset the record number in your PAB, the real one does. One line fix in Classic99. (My concern about the 5->0 was just the way the debug comes out, so I clarified that). I'll post an updated version in a few minutes. Edited October 25, 2019 by Tursi 1 Quote Link to comment Share on other sites More sharing options...
moulinaie Posted October 25, 2019 Author Share Posted October 25, 2019 1 hour ago, Tursi said: Yeah, that's what I was curious about. The seeks would probably kill it. Anyway, yeah. The problem was my implementation of RESTORE didn't reset the record number in your PAB, the real one does. One line fix in Classic99. (My concern about the 5->0 was just the way the debug comes out, so I clarified that). I'll post an updated version in a few minutes. I tested it, now it works ! (what a reactivity!) Thanks a lot, Guillaume. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.