Dwedit's Board

Enjoy the board

You are not logged in.


Welcome, fellow visitors from other websites!
Whenever you download a file, I'd appreciate it if you posted a nice "Thank You" message, then tell me which site you came from. Thanks.
- Dwedit

#1 2021-06-02 8:04:17 am

Registered: 2021-06-02
Posts: 2

How to change button mapping in Goomba source code?

^ This rom hack for GB Tetris was recently released which allows for HOLD functionality by pressing select on the Game Boy. Because in most modern Tetris hold is mapped to the L button, I was looking at the Goomba source code to determine if I could modify it to create an instance of goomba.gba where the GBA L button maps to the GB select input.

I started looking at the C/assembly, and I have familiarity with C and x86 but not ARM so I've begun looking into that, but I wanted to ask if anyone had pointers or suggestions for where to start in the source code. And I also wanted to ask those who have more development experience with Goomba whether this sounds more like an easy change or a more involved change. I did see lots of uses around joycfg and joy0, so I don't want to potentially break another aspect of the code. The existing functionality to swap A and B does give me hope though.

Last edited by TSpinTriple (2021-06-02 8:14:25 am)


#2 2021-06-02 9:31:30 am

From: Chicago
Registered: 2004-12-12
Posts: 1,010

Re: How to change button mapping in Goomba source code?

In "timeout.s" there is code that reads the real joypad (REG_P1), then eventually writes to the variable XGBjoypad.

In "io.s", there is a function "refreshNESjoypads" that applies logic such as rapid fire or button swapping to XGBjoypad, then stores to joy0state.

I think you'd need to check for the L button, then treat that as the Select button.  After the variable is read into r1, it would be something like 'TST r1,#0x200' then 'ORRNE r1,#0x04'.

"We are merely sprites that dance at the beck and call of our button pressing overlord."


#3 2021-06-02 11:12:01 am

Registered: 2021-06-02
Posts: 2

Re: How to change button mapping in Goomba source code?

That worked perfectly. L now triggers gb select in addition to what it does with it's hotkeys. Thank you for your help!


Registered users online in this topic: 0, guests: 1
[Bot] CCBot

Board footer

Powered by FluxBB
Modified by Visman