adam242 Posted December 4, 2015 Share Posted December 4, 2015 I have modified three of my favorite games to run properly on my hybrid PAL ANTIC / NTSC GTIA computer. Software that checks $D014 for PAL/NTSC determination does not work properly, if at all, on machines like this - "NTSC-50" I've heard them called. So all I did was bypass the check. Or more accurately, force it to think it's on a PAL machine. I used a sector editor to find any instance of "AD 14 D0" (LDA $D014) in the code and replace it with A9 00 EA (LDA #$00, and a place-holding NOP). I know there is a more elegant way of doing this, by monitoring VCOUNT, but I am not that good of a coder. Yet. Little Princess demo now runs fine, skipping the "you must have PAL!" message, and Yoomp! and Pac-Man Arcade run at the correct speed. I mean no disrepect to the the original programmers. Hardly. I admire your work. I just wanted do be able to enjoy it on my modded machine. Would it be a serious breach of etiquette to post my modified code? 3 Quote Link to comment Share on other sites More sharing options...
Level42 Posted December 5, 2015 Share Posted December 5, 2015 (edited) Uh......Yoomp automatically checks If its running on NTSC or PAL and should load the correct version If you use the ATR. There are two different versions on XEX format. Maybe you have an older/wrong version ? Yoomp.atari.pl Edited December 5, 2015 by Level42 Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 5, 2015 Share Posted December 5, 2015 As said it's better to use the VCOUNT method as the installed Antic makes all the difference. But it's somewhat more than a couple of lines of code in that case. A better method for XEX file types would be to tack the check on the end of the file then have it patch the program (which has already been loaded). It can be a chore finding somewhere to put that couple of dozen required bytes of code without stomping on something else. Probably the best place would be the stack around $180-$1BF (any lower might erase some loaders), the printer buffer or even inside the IOCB area - at 16 bytes each using #1 through #5 gives 80 bytes to play with. The code itself, possibly could be made more compact than this but as an example: lda #0 sta nmien ; disable VBlank waitvc1 bit vcount bmi waitvc1 ; skip if already near end of frame waitvc2 bit vcount bpl waitvc2 ; wait until Vcount goes >127 ldx #12 skip1 sta wsync dex bne skip1 ; skip 12 scanlines so Vcount should still be >128 on PAL but wrapped around from 0 on NTSC bit vcount bmi itspal ldx #14 itspal inx ; X will be 1 for PAL, 15 for NTSC, same values as GTIA register returns stx checkpal+1 lda #$a9 sta checkpal lda #$ea sta checkpal+2 ; this patches a LDA $D014 instruction with hardcoded LDA # and NOP for Pal or NTSC lda #$40 sta nmien rts About 46 bytes for that example. 1 Quote Link to comment Share on other sites More sharing options...
+Adam+ Posted December 5, 2015 Share Posted December 5, 2015 (edited) Uh......Yoomp automatically checks If its running on NTSC or PAL and should load the correct version If you use the ATR. Adam242 talks about very specific Atari machine - NTSC system with purposely replaced ANTIC (PAL version). In such situation usual way (checking system version of GTIA) doesn't work. Edited December 5, 2015 by +Adam+ 3 Quote Link to comment Share on other sites More sharing options...
adam242 Posted December 5, 2015 Author Share Posted December 5, 2015 Adam242 talks about very specific Atari machine - NTSC system with purposely replaced ANTIC (PAL version). In such situation usual way (checking system version of GTIA) doesn't work. Exactly. My machine still 'looks like' NTSC because of the GTIA, but needs to detect as PAL for things to work right. As said it's better to use the VCOUNT method as the installed Antic makes all the difference. But it's somewhat more than a couple of lines of code in that case. A better method for XEX file types would be to tack the check on the end of the file then have it patch the program (which has already been loaded). It can be a chore finding somewhere to put that couple of dozen required bytes of code without stomping on something else. Probably the best place would be the stack around $180-$1BF (any lower might erase some loaders), the printer buffer or even inside the IOCB area - at 16 bytes each using #1 through #5 gives 80 bytes to play with. The code itself, possibly could be made more compact than this but as an example: lda #0 sta nmien ; disable VBlank waitvc1 bit vcount bmi waitvc1 ; skip if already near end of frame waitvc2 bit vcount bpl waitvc2 ; wait until Vcount goes >127 ldx #12 skip1 sta wsync dex bne skip1 ; skip 12 scanlines so Vcount should still be >128 on PAL but wrapped around from 0 on NTSC bit vcount bmi itspal ldx #14 itspal inx ; X will be 1 for PAL, 15 for NTSC, same values as GTIA register returns stx checkpal+1 lda #$a9 sta checkpal lda #$ea sta checkpal+2 ; this patches a LDA $D014 instruction with hardcoded LDA # and NOP for Pal or NTSC lda #$40 sta nmien rts About 46 bytes for that example. Thanks for this. I may try to make something like this work. Yoomp! had three such checks, Pac-Man Arcade had six. 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.