News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: What assembler to use for GBC assembly hacking?  (Read 2791 times)

Spikeman

  • Hero Member
  • *****
  • Posts: 1063
  • *unce unce unce*
    • View Profile
    • None at the moment, check out my Last.fm page instead?
What assembler to use for GBC assembly hacking?
« on: March 21, 2012, 05:05:51 pm »
Hey all, I'm hoping to foray into some assembly hacking for the GBC, but I'm not sure what tools to use. My only experience with assembly hacking is for GBA/NDS, where armips is the weapon of choice. I'm looking for an assembler that can assemble code directly into the ROM, similar to how armips handles things. Does such a tool exist? If not, can someone detail how they do this sort of thing?

Thanks. :)
Open Source Hacking Projects: Guru Logic Champ, Telefang 2, (Want more? Check out my GitHub!)

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: What assembler to use for GBC assembly hacking?
« Reply #1 on: March 21, 2012, 05:15:48 pm »
I have absolutely no experience with GBC hacking nor bass, but I guess you could set up a Z80 architecture for byuu's bass.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6846
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: What assembler to use for GBC assembly hacking?
« Reply #2 on: March 21, 2012, 07:46:27 pm »
I've used WLA-dx.

To insert stuff, a basic start to the asm code is

Code: [Select]
.MEMORYMAP        ;CPU mapping
DEFAULTSLOT 1
SLOT 0 START $0000 SIZE $4000    ;0-3FFF fixed bank
SLOT 1 START $4000 SIZE $4000    ;4000-7FFF swappable bank
.ENDME

.ROMBANKSIZE $4000         ;sets up for a 128KB ROM (8 banks at 16KB each)
.ROMBANKS 8

.BACKGROUND "file.gb"   ;to patch an existing file

.bank 0 slot 0   ;informs the game we are inserting to ROM bank 0,
                       and assume in CPU slot 0 (which we defined above as $0-3FFF)
.org $0A3F    ;CPU address to insert to

To assemble, I use a batch file.
Code: [Select]
wla-gb -o source.asm game.o
wlalink -r game.txt game.gb
pause

Where game.txt is like
Code: [Select]
[objects]
game.o
« Last Edit: March 21, 2012, 08:02:55 pm by KingMike »
"My watch says 30 chickens" Google, 2018

Spikeman

  • Hero Member
  • *****
  • Posts: 1063
  • *unce unce unce*
    • View Profile
    • None at the moment, check out my Last.fm page instead?
Re: What assembler to use for GBC assembly hacking?
« Reply #3 on: March 21, 2012, 08:59:50 pm »
Thanks guys. It doesn't look like bass supports z80, but WLA-dx is exactly what I'm looking for. (Any reason this isn't in the utilities section?)
Open Source Hacking Projects: Guru Logic Champ, Telefang 2, (Want more? Check out my GitHub!)