It is currently Thu Oct 19, 2017 9:38 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Mon Jan 19, 2015 7:41 pm 
Offline
User avatar

Joined: Fri Nov 08, 2013 7:56 pm
Posts: 33
I'm trying to get the Family Trainer games to work on my power pak with my power pad, but I can't seem to get the power pad to respond for any of them. Would a person need to hack the rom to enable it, is it a mapper issue, or is something else completely?

Call me crazy, but I love the power pad. Even my 10 and 11 year old love playing on it too when I bring it out every now and than. So I would love to expand my Power Pad library with some Family Trainer games, and am hoping it's an "easy fix".


Top
 Profile  
 
PostPosted: Mon Jan 19, 2015 7:45 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6280
Location: Seattle
The Family Trainer games use a different pad than the US Power Pad. (q.v. http://problemkaputt.de/everynes.htm#controllersmats )

i.e. ROM hacking is necessary.


Top
 Profile  
 
PostPosted: Tue Jan 20, 2015 2:44 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6280
Location: Seattle
This isn't too bad.

Looking at "Family Trainer - Fuuun! Takeshi Shiro 2 (J)", I used bisqwit's nescom clever-disasm to get out a nice disassembly with this configuration:
Code:
JumpTable $01EE $01EF 2 14 JumpTable01EE 0

CertainlyCode $4E56 Delay703Cy

CertainlyCode $01CE DeadCode01CE
CertainlyCode $2FA4 DeadCode2FA4
CertainlyCode $5043 DeadCode5043
CertainlyCode $5057 DeadCode5057
CertainlyCode $5076 DeadCode5076
CertainlyCode $508B DeadCode508B

CertainlyCode $36CC CopiedToRam36CC

DataTable $3863 $3864 2 128 DataTable3863


That indicates that the Family Trainer mat is read using the code from $CD98 through $CDC6 and $CE56 through $CE68, storing it ultimately in the lower nybble of RAM $25, $26, and $27. Replacing that with something that will read the Power Pad is straightforward, but I just want to post this information for now. I'll come back in a bit to finish the patch.


Top
 Profile  
 
PostPosted: Tue Jan 20, 2015 7:34 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6280
Location: Seattle
Hm. This may have been a poor choice; the original crashes for me in emulators. Anyway, if one of them catches your eye, name it and I'll try hacking it. It looks straight-forward.


Top
 Profile  
 
PostPosted: Wed Jan 21, 2015 2:36 pm 
Offline
User avatar

Joined: Fri Nov 08, 2013 7:56 pm
Posts: 33
lidnariq wrote:
Hm. This may have been a poor choice; the original crashes for me in emulators. Anyway, if one of them catches your eye, name it and I'll try hacking it. It looks straight-forward.

Jogging Race is the one I was mostly looking to play. I saw Arino play it on Game Center CX and thought it looked like it could be a lot of fun.


Top
 Profile  
 
PostPosted: Wed Jan 21, 2015 4:14 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6280
Location: Seattle
Fortunately, this one needs an even simpler clever-disasm configuration:
Code:
JumpTableRoutineWithAppendix $799E


The mat-reading code is at $FA2C - $FA42 and interleaved with code from $CE27-$CE36. It stores the mat's output in RAM $0418-$041A, in the 0x1E bits.

Here's my mat-reading code (assembled with xa65, which I discovered assembles little patches more readily). There's a small 133 byte region unused at the end of PRG for Jogging Race, which I coopt:
Code:
   * = $FF75
   ;; 4017.D4, right-to-left:
d4ram:
        .db  0, 0, 0, 0, 1, 2, 0, 0 ; which memory location
d4bit: 
        .db  0, 0, 0, 0, 2, 2, 4, 2 ; which bit to set

        ;; 4017.D3:
d3ram: 
        .db  1, 2, 2, 1, 2, 1, 0, 0
d3bit:
        .db  4, 4, 8, 8,16,16,16, 8

ReadPowerPad:   
   ldx #1
   stx $4016
   dex
   stx $4016

   stx $0418
   stx $0419
   stx $041A

   ldy #7
LoopRead:   
   lda $4017
   pha
   and #$10
   beq NotD4
   ldx d4ram,y
   lda d4bit,y
   ora $0418,x
   sta $0418,x
NotD4:   
   pla
   and #8
   beq NotD3
   ldx d3ram,y
   lda d3bit,y
   ora $0418,x
   sta $0418,x
NotD3:   

   dey
   bpl LoopRead

   jmp $CE39
Maybe someone better at 6502 golf might be able to fit this into less than 96 bytes? Or maybe just be more clever about it at all.

Change four other bytes to use my new routine and skip the original one, and we have this:

Edit: removed bad patch, see two later.


Last edited by lidnariq on Thu Jan 22, 2015 7:32 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: Thu Jan 22, 2015 6:40 pm 
Offline
User avatar

Joined: Fri Nov 08, 2013 7:56 pm
Posts: 33
I gave it a try and here's what I found. Just a quick summary of the game first, all running is on the middle row of buttons. Running on the middle two buttons runs in the middle lane in the game. The left two buttons run on the top lane, and the two right buttons is on the bottom lane. The top and bottom rows are for pushing opponents in the lanes next to you.

Top Game Mode Selection: The top game recognizes the power pad, and it works, but if I try to run in the middle lane, the character shifts between the middle and top lanes. If I run on the left or right buttons, it runs in the middle lane.
Bottom Game Mode Selection: Once this game starts, the character does the push animation alternating between the two directions. None of the inputs seem to work. This does the same as the original version.


Top
 Profile  
 
PostPosted: Thu Jan 22, 2015 7:24 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6280
Location: Seattle
Shoulda figured I'd've made a braino when I did that. It's not 0=pressed, it's 1=pressed. Makes the code simpler, at least.
Code:
$ sha1sum *.nes
44faecce9db7391d886ae22289ef7d2545d25b6c  Family Trainer - Jogging Race (J).nes
ff3c93ebdd28003b8ab2da59ee331ebe11c906e7  FTJR.nes
$ md5sum *.nes
83971232ca97fe4d465b0af91a6888d6  Family Trainer - Jogging Race (J).nes
3f34b376601e0b90dc154699aa0af2f8  FTJR.nes
$ crc32 *.nes
179ea3d3   Family Trainer - Jogging Race (J).nes
6c8c4a98


Attachments:
FTJR-use-powerpad-instead-of-family-trainer-mat.ips [122 Bytes]
Downloaded 60 times
FTJR-use-powerpad-instead-of-family-trainer-mat.bsdiff [299 Bytes]
Downloaded 58 times
Top
 Profile  
 
PostPosted: Fri Jan 23, 2015 8:20 pm 
Offline
User avatar

Joined: Fri Nov 08, 2013 7:56 pm
Posts: 33
lidnariq wrote:
Shoulda figured I'd've made a braino when I did that. It's not 0=pressed, it's 1=pressed. Makes the code simpler, at least.
Code:
$ sha1sum *.nes
44faecce9db7391d886ae22289ef7d2545d25b6c  Family Trainer - Jogging Race (J).nes
ff3c93ebdd28003b8ab2da59ee331ebe11c906e7  FTJR.nes
$ md5sum *.nes
83971232ca97fe4d465b0af91a6888d6  Family Trainer - Jogging Race (J).nes
3f34b376601e0b90dc154699aa0af2f8  FTJR.nes
$ crc32 *.nes
179ea3d3   Family Trainer - Jogging Race (J).nes
6c8c4a98

That worked. Thanks for the hack, it works perfectly.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 6 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