Galaxian - is patch for PAL console available?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
krzysiobal
Posts: 645
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland

Galaxian - is patch for PAL console available?

Post by krzysiobal » Fri Jan 10, 2020 1:33 pm

Due to different vblank time, scroll split happens in wrong moment and this game is unplayable on PAL NES. And because this cartidge was only released in Japan, there is no European equivalent of this title, maybe except Galaga, which is different game.

Anyone know any patch to force Galaxian into PAL mode?
Image

lidnariq
Posts: 9022
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Galaxian - is patch for PAL console available?

Post by lidnariq » Fri Jan 10, 2020 1:50 pm

I made a fully annotated disassembly of Galaxian a bunch of years ago. http://www.romhacking.net/documents/617/

You'll want to increase the LDY #190 that my disassembly put on line 783 ... should be address $E2A9.

Code: Select all

        LDY #190
loop17: DEC l_crud              ; 5
        DEC l_crud              ; 5
        DEC l_crud              ; 5
        DEC l_crud              ; 5
        DEC l_crud              ; 5
        DEC l_crud              ; 5
        DEC l_crud              ; 5 42cy/loop
        DEY                     ; 2
        BEQ skp003              ; 2
        JMP loop17              ; 3 spin 7979cy exactly (~70 scanlines)
There's only enough leeway in increasing to LDY #0 for an additional 30 scanlines at PAL timing, so you may have to change the string of "DEC zpg" to something that's a higher ratio of cycles to bytes. (e.g. an actual loop instead of just cycle-expensive) This was the wrong delay. The preceding one (loop16) was what was adjusted.
Last edited by lidnariq on Fri Jan 10, 2020 2:07 pm, edited 3 times in total.

krzysiobal
Posts: 645
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland

Re: Galaxian - is patch for PAL console available?

Post by krzysiobal » Fri Jan 10, 2020 2:03 pm

Thank you! I needed to add extra 50 scanline delay to compensate longer PAL Vblank time.
I changed

Code: Select all

;~5169clocks (45.5 scanlines)
A0 EB    |     LDY #235
         | loop16:
C6 E0    |     DEC l_crud
C6 E0    |     DEC l_crud        
C6 E0    |     DEC l_crud        
88       |     DEY             
F0 03    |     BEQ skp001        
4c 88 e2 |     JMP loop16        
into

Code: Select all

;~10278 clock (90 scanlines)
A2 08    |     ldx #$08
A0 E5    |     ldy #$e5
         | loop:
88       |     dey
D0 FD    |     bne loop
CA       |     dex
D0 FA    |     bne loop
EA       |     nop
EA       |     nop
EA       |     nop
EA       |     nop
and it works!
Attachments
Galaxian (E) [hack for PAL NES].ips
(35 Bytes) Downloaded 22 times

NewRisingSun
Posts: 1123
Joined: Thu May 19, 2005 11:30 am

Re: Galaxian - is patch for PAL console available?

Post by NewRisingSun » Fri Jan 10, 2020 2:12 pm

Please always specify whether you are working on the rev0 or rev1 ROM file.

lidnariq
Posts: 9022
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Galaxian - is patch for PAL console available?

Post by lidnariq » Fri Jan 10, 2020 2:25 pm

My disassembly is of what NoIntro labels without a revision, sha1sum(8kPRG+8kCHR) = 44bc6c4e8b3f6c635281b4c05382e8f316d8269e

User avatar
MrNorbert1994
Posts: 765
Joined: Tue May 06, 2014 1:50 pm
Location: Szeged, Hungary
Contact:

Re: Galaxian - is patch for PAL console available?

Post by MrNorbert1994 » Tue Feb 11, 2020 10:44 am

I tried this on console, (I attached the IPS to the old overdumped version of the game) and sometimes around Level 5-6 the game resets itself.

lidnariq
Posts: 9022
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Galaxian - is patch for PAL console available?

Post by lidnariq » Tue Feb 11, 2020 1:05 pm

Galaxian will reset itself if NMI reenters, and the entire code runs in the NMI. It's conceivable that the 2A07 being just a little slower per scanline means there isn't enough time after loop17 to process all moving "chargers" before the next NMI.

It might be sufficient to shorten loop17 as well as Krzysiobal's above lengthening loop16. Hopefully.

lidnariq
Posts: 9022
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Galaxian - is patch for PAL console available?

Post by lidnariq » Tue Feb 11, 2020 8:01 pm

I made a slightly more aggressive patch - loop16 has only been extended to 9929 cycles (350 cycles shorter), and loop17 shortened to 7291 cycles (688 cycles shorter). I then played with PAL timing and tested as far as wave 8 without it rebooting.

Do try this and let me know if these 9 scanlines' worth of difference are enough to fix things and doesn't cause any graphical artifacts. (I mean, I didn't see any, but I'm just using Mesen)

This patch is still against the same 24KB overdumped iNES release of "no revision" Galaxian.
Attachments
Galaxian-lidnariqs-PAL-support-patch.ips
(60 Bytes) Downloaded 5 times

User avatar
MrNorbert1994
Posts: 765
Joined: Tue May 06, 2014 1:50 pm
Location: Szeged, Hungary
Contact:

Re: Galaxian - is patch for PAL console available?

Post by MrNorbert1994 » Wed Feb 12, 2020 2:48 am

I made it to Level 20 (I even used two player mode just for the kick of it), and I can confirm that this patch works now without resets. :)

Post Reply