It is currently Thu Nov 15, 2018 7:29 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun Sep 02, 2018 8:12 am 
Offline

Joined: Sun Jun 12, 2011 12:06 pm
Posts: 421
Location: Poland
I've just did it using my patched GameGenie cartridge, basing on the code injection that I presented before.

Code:
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.


Top
 Profile  
 
PostPosted: Sun Sep 02, 2018 10:02 am 
Offline
User avatar

Joined: Sat Jul 04, 2015 9:58 am
Posts: 828
Location: -29.794229 -55.795374
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!


Top
 Profile  
 
PostPosted: Sun Sep 02, 2018 10:26 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7714
Location: Seattle
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?
Quote:
of accumulator (as shown above)
I guess in practice games just don't use X or Y ?


Top
 Profile  
 
PostPosted: Sun Sep 02, 2018 10:33 am 
Offline

Joined: Sun Jun 12, 2011 12:06 pm
Posts: 421
Location: Poland
I am doing fake write to $8000 to know find out value of accumulator that has to be restored later.


Top
 Profile  
 
PostPosted: Sun Sep 02, 2018 11:32 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7714
Location: Seattle
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group