Jump to content
IGNORED

Games patched to run on hybrid PAL/NTSC computers


adam242

Recommended Posts

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?

  • Like 3
Link to comment
Share on other sites

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 by Level42
Link to comment
Share on other sites

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.

 

 

 

  • Like 1
Link to comment
Share on other sites

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 by +Adam+
  • Like 3
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...