Primary Zelda Hacking
April 21, 2014, 09:54:22 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Current Zelda Oracles Hacking Suite beta version: 0.05
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General GameBoy Hacking / General GameBoy Talk / Re: ASM request: LA DX gba color adjust from Oracle games on: February 25, 2011, 11:50:57 PM
That's not what I'm trying to do Sad

The Oracle games apply a mathematical formula to the palette values as they're being written to the GBC's palette registers when they detect that they're running on a gba so the colors look correct on the darker screen. I do not care about the gba detection part, I'm looking to take the mathematical formula it applies and put it in Link's Awakening. If you run the oracle games in a debugger you'll see what I'm talking about, the code branches off into a separate section of code when it writes to FF68-FF6B depending on the value in FF96 (the address where the game stores the gba detection flag after the initial boot).

ie. You change the palette values at 0x5c008 in Oracle of Ages to 28 32 BE 13 00 31 00 00, when you run the game with the gba detect flag set those values become 30 53 FF 2B 00 52 00 00 in vram.
2  General GameBoy Hacking / General GameBoy Talk / Re: ASM request: LA DX gba color adjust from Oracle games on: February 20, 2011, 10:30:29 AM
Yes I know, lol sorry if I'm frustrating you, I know about calls, jmp, replacing code, ret, etc the piece i was missing was bank 0 which is what I was trying to get at but didn't know the name for. When I said have it run, i meant a location that I can legally put code into and call it from the loop that writes to the palette registers and not some space like where the tiles are stored or whatever. Thanks, I'm gonna play around with it and see what i can come up with in the morning.


Edit:
The code resides in bank 21 for Link's Awakening and bank 3f for the Oracle games (which makes sense given the address I mentioned earlier, 0xfc067). Lin, do you think you can take a look at this?

I'm not to the point in asm where stuff like this makes sense to me, but I have a feeling it's much simpler than how it looks:

RO3F:4067
Code:
ldi a,(hl)
ld c,a
and a,e0
ld b,a
ld a,(hl)
and a,03
or b
swap a
ld b,a
ldd a,(hl)
and a,7c
rrca
rrca
push hl
ld hl,de60
rst 10
ld a,b
ld b,(hl)
ld hl,de21
rst 10
ldd a,(hl)
or b
ld b,a
ld a,c
and a,1f
ld c,(hl)
ld hl,de00
rst 10
ld a,(hl)
or c
pop hl
ld c,h
res 7,l
ld h,df
ldi (hl),a
ld a,b
ldi (hl),a
set 7,l
ld h,c
ret
3  General GameBoy Hacking / General GameBoy Talk / Re: ASM request: LA DX gba color adjust from Oracle games on: February 20, 2011, 12:21:40 AM
Right, but where can I find unused space that I can put my code into? That's the part I'm stuck at, I don't know the gameboy rom format well enough to tell what is just junk that I can put my own code in and have it run.
4  General GameBoy Hacking / General GameBoy Talk / Re: ASM request: LA DX gba color adjust from Oracle games on: February 19, 2011, 10:27:17 PM
So you don't know where to find unused space in the rom and be able to jump to that address either? Sad
5  General GameBoy Hacking / General GameBoy Talk / Re: ASM request: LA DX gba color adjust from Oracle games on: February 19, 2011, 08:18:15 PM
I'm not sure what you mean, FF68-FF6B are the hardware addresses where the palette information is written to so it can be drawn on screen. The Oracle games make changes to these values just before they're written to those addresses and that's what I'm trying to replicate in LADX, but the code currently there is too short to overwrite with the code from the Oracle games. FF96 is the address in the Oracle games stores the value that determines if it should enable gba features after boot, it's just useful for tracing the code to determine where it branches off.
6  General GameBoy Hacking / General GameBoy Talk / ASM request: LA DX gba color adjust from Oracle games on: February 19, 2011, 10:49:58 AM
I apologize if I made any errors, I'm working off notes I made a year ago when I gave up.

Ok, first some back story: the Oracle games adjust the palettes on the fly when the game detects it's running on a gba (initializes b as 01 on boot?) since their screens show colors darker than on the original gbc screen. There is a gbc emulator for NDS (Lameboy) that doesn't support the bit that tells the game it's gba but it can be hacked to do so (rom offsets below). I prefer using the gba colors since they look better to me on the NDS's screen.

I'm still very new to gameboy rom hacking, it's possible I -could- do this on my own, but the problem is I'm not familiar enough with how gbc roms are structured so I don't know how to find a large enough unused section to inject the code into or really what calculations the code is doing to modify the palette as it's read. Anyway, I would like to add the asm that adjusts the palettes in the Oracle games to Link's Awakening so I can use it on Lameboy. I know the location of the code that does it (0xfc067), I was able to find it by putting access breakpoints in bgb's debugger on FF68-FF6B write and FF96 read, write.


tl;dr
Asm N00b needs help injecting longer code into Link's Awakening to adjust the palette as it's read into memory. Would be eternally grateful for the hack done on either the 1.1 or 1.2 version of the Link's Awakening DX rom.


For those interested:
Palette change + Advance Shop open (Ages/Seasons)
0x15c: 02 -> 00

Advance Shop open, Palette change disabled (Ages/Seasons)
0x15c: 02 -> 00
0xfc03e: 20 -> 18

Advance Shop open, Use detect gba code for palette change
0x12536: D0 -> 00 (Ages)
OR
0x12198: D0 -> 00 (Seasons)
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!