tschak909 Posted December 21, 2023 Share Posted December 21, 2023 I've converted Centipede to be High Score Enabled, but there's a slight issue where the disk reads and writes fail. Is this because of re-vectored VVBLKI which is clobbering POKEY state? I've attached a disk image here: Centipede.atr And the relevant source code is here: https://github.com/FujiNetWIFI/fujinet-high-scores/tree/main/atari-game-ports/centipede I've also attached a listing from the assembly: Centipede.lst -Thom 1 Quote Link to comment Share on other sites More sharing options...
+DjayBee Posted December 21, 2023 Share Posted December 21, 2023 EDIT: Jump to second half of posting. The re-vectored VVBLKI jumps into the original SYSVBV. It also checks right at its beginning the value of $81. If it is !=#$00 then it jumps directly into SYSVBV. Save the value in $81, set it to 1, read or write the sector(s) and restore $81 to its original value. Then you will know if the VVBLKI is your problem. Below is the start of the re-vectored VVBLKI: A9A9: D8 CLD A9AA: A9 00 LDA #$00 A9AC: 8D 08 D2 STA AUDCTL A9AF: A9 03 LDA #$03 A9B1: 8D 0F D2 STA SKCTL A9B4: 8D 32 02 STA SSKCTL A9B7: A5 81 LDA $81 ; check $81 A9B9: D0 07 BNE $A9C2 ; !=0? A9BB: A5 90 LDA $90 A9BD: F0 06 BEQ $A9C5 A9BF: 4C CC A9 JMP $A9CC A9C2: 4C 73 AA JMP $AA73 -- AA73: 4C 5F E4 JMP SYSVBV ; original VVBLKI ======================================== 2nd half: After I posted, my view fell to the writes to SKCTL and SSKCTL. These are the serial control register and its page 2 shadow. If the VBI manipulates these during SIO, it will certainly fail. Therefore changing $81 takes effect too late in the VBI. Try this instead: LDA RTCLOK+2 wait1: CMP RTCLOK+2 BEQ wait1 ; wait for end of current/next VBI LDA VVBLKI PHA LDA VVBLKI+1 PHA LDA SYSVBV+1 STA VVBLKI LDA SYSVBV+2 STA VVBLKI+1 ; do your I/O LDA RTCLOK+2 wait2: CMP RTCLOK+2 BEQ wait2 ; wait for end of current/next VBI PLA STA VVBLKI+1 PLA STA VVBLKI Quote Link to comment Share on other sites More sharing options...
tschak909 Posted December 21, 2023 Author Share Posted December 21, 2023 14 minutes ago, DjayBee said: The re-vectored VVBLKI jumps into the original SYSVBV. It also checks right at its beginning the value of $81. If it is !=#$00 then it jumps directly into SYSVBV. Save the value in $81, set it to 1, read or write the sector(s) and restore $81 to its original value. Then you will know if the VVBLKI is your problem. Below is the start of the re-vectored VVBLKI: A9A9: D8 CLD A9AA: A9 00 LDA #$00 A9AC: 8D 08 D2 STA AUDCTL A9AF: A9 03 LDA #$03 A9B1: 8D 0F D2 STA SKCTL A9B4: 8D 32 02 STA SSKCTL A9B7: A5 81 LDA $81 ; check $81 A9B9: D0 07 BNE $A9C2 ; !=0? A9BB: A5 90 LDA $90 A9BD: F0 06 BEQ $A9C5 A9BF: 4C CC A9 JMP $A9CC A9C2: 4C 73 AA JMP $AA73 -- AA73: 4C 5F E4 JMP SYSVBV ; original VVBLKI That is indeed part of it, the reads no longer hang, but they also don't load the table in. 😕 Quote Link to comment Share on other sites More sharing options...
+DjayBee Posted December 21, 2023 Share Posted December 21, 2023 Please post a new ATR. Then I will trace it in the debugger. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted December 21, 2023 Author Share Posted December 21, 2023 Latest one. This is weird. Centipede.atr Quote Link to comment Share on other sites More sharing options...
+DjayBee Posted December 21, 2023 Share Posted December 21, 2023 Two errors: 1. Either you were faster than my edit or you missed "EDIT: Jump to second half of posting." in above posting. 2. With my shortened disk I/O routine you must JSR DSKINV instead of JSR SIOV because otherwise the DCB will not be populated completely. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted December 21, 2023 Author Share Posted December 21, 2023 4 minutes ago, DjayBee said: Two errors: 1. Either you were faster than my edit or you missed "EDIT: Jump to second half of posting." in above posting. 2. With my shortened disk I/O routine you must JSR DSKINV instead of JSR SIOV because otherwise the DCB will not be populated completely. 1. I was, sorry. 2. I changed it back to use SIOV (and populated DSTATS and DBYT) as part of trying to debug. Yes, with your changes above, it does indeed work. Thank you so much. -Thom 1 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.