Fixing the UMC Chips with the Wrong Pulse Wave Duty Cycles

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

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

Re: Fixing the UMC Chips with the Wrong Pulse Wave Duty Cycl

Post by krzysiobal »

I've just did it using my patched GameGenie cartridge, basing on the code injection that I presented before.

Code: Select all

RnW ADDRESS     DATA      STATE
--------------------------------
1   xxxx        *           IDLE
0   aaaa        V           IDLE ;aaaa = $4000/$4004
1   xxxx + 1    $8d         STA1_1 ;sta $8000
1   xxxx + 2    $00         STA1_2
1   xxxx + 3    $80         STA1_3
0   *           A           STA1_4
1   xxxx + 4    $A9         LDA1_1 ;lda #V', where V' = V with bits 7 and 6 swapped
1   xxxx + 5    V'          LDA1_2 
1   xxxx + 6    $8D         STA2_1 ;sta aaaa
1   xxxx + 7    LO(aaaa)    STA2_2
1   xxxx + 8    HI(aaaa)    STA3_3
0   aaaa        V'          STA2_4
1   xxxx + 9    $A9         LDA2_1 ;lda #A
1   xxxx + 10   A           LDA2_2
1   xxxx + 11   $4C         JMP_1 ;jmp xxxx+1
1   xxxx + 12   LO(xxxx+1)  JMP_2
1   xxxx + 13   HI(xxxx+1)  JMP_3
1   xxxx + 1    *           IDLE
It needs 15 CPU cycles and somewhere to save the current value of accumulator:
*using fake write to $8000 to find out the value of accumulator (as shown above)
*or alternatively using stack (which wastes less resources of FPGA).

It works OK, Legend of Zelda and SMB1 are the games that I can hear the difference.
https://www.youtube.com/watch?v=Ma4ftQIuKbc

Sorry, but couln't resist showing this tower structure:
Image

Maybe should I also add real game genie and 60-72 pin converter.
User avatar
Fisher
Posts: 1173
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Fixing the UMC Chips with the Wrong Pulse Wave Duty Cycl

Post by Fisher »

interesting.
Is it a custom GameGenie ROM?
Could you share?

Great tower!
Reminds when I was trying to play that flawed Sonic 3 cartridge I have with a MegaKey + Sonic & Knuckles + a GameGenie lol!
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Fixing the UMC Chips with the Wrong Pulse Wave Duty Cycl

Post by lidnariq »

krzysiobal wrote:*using fake write to $8000 to find out the value
I'm confused. You already had to detect that a write happened to $4000/4004; why don't you take note of the value at that time?
of accumulator (as shown above)
I guess in practice games just don't use X or Y ?
krzysiobal
Posts: 891
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland

Re: Fixing the UMC Chips with the Wrong Pulse Wave Duty Cycl

Post by krzysiobal »

I am doing fake write to $8000 to know find out value of accumulator that has to be restored later.
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Fixing the UMC Chips with the Wrong Pulse Wave Duty Cycl

Post by lidnariq »

Oh, of course. Rather that detecting which of X/Y/A had the "wrong" value and reusing that register, you just always save A. Got it.
Post Reply