vxo
ROM Hacker
- 65
- Posts
- 7
- Years
- he/him
- California
- Seen Nov 12, 2024
Yes, you have to remove it. Check the readme.
Your Readme.md doesn't specify how to remove the "broken" patch.
Yes, you have to remove it. Check the readme.
Oh Sorry my mistake, I will add that ASAP.Your Readme.md doesn't specify how to remove the "broken" patch.
Out of curiousity, could this be ported to Emerald? I know Shiny Quagsire seems to have started on the Emerald port but didn't seem to finish it according ot his GitHub code page.
How to make compatible with Navenatox's Dynamic OW Palettes System
Instructions:
Insert Navenatox Pallete Fix.asm to free space
Go to rtc.asm, and at line 436 replace 805FECC with 8(offset you inserted the fix)
then insert Put 00B5 0148 0047 0000 [Reverse Address+1] 0000 10BC at 0x4B0
open npcfilter folder and open command window: then write make bpre fname=../yourrom.gba offset=XXXXXX
then open npchook.asm, change the offset to where you inserted npcfilter stuff, reversed +1, and insert data at 0x83598
open mapfilter folder, open command window, then write make bpre fname=../yourrom.gba offset=XXXXXX
then open npchook1.asm, change the offset to where you inserted the second thing, reversed +1, and insert the data at 0x598CC
Also null out the eight bytes from 0x59A28 to 0x59A2F with 00's
and at 0x59A12, put 00 00
and youre done
Ignore the .bin files in the ASM folder, those were my offsets.
Great tutorial. Works perfectly, many thanks!
Have you (or anyone else) managed to get the battle BG day/night effects working? I've tried inserting and end up with messed up palettes so something isn't right. :laugh-squinted:
In battlebghook.asm change the offset where battlebg.asm is inserted make it reversed and +1. (It's a THUMB instruction)
Yeah that's what I've tried (standard Thumb asm insertion)
For ex:
Inserted Battlebgcode.asm to 0xB01480
Inserted Battlebghook to 0xf290 (in this case - 00 49 08 47 81 14 B0 08)
The result I end up with is this.
https://imgur.com/a/iSDk3li
I can adjust the time and can see subtle changes which makes me believe it's interacting with the RTC correctly. it just seems like the palette is being 'pushed' incorrectly or from an incorrect location?
Ik how to apply this DNS to battles, but the method is quite complicated as it requires to hand make all the palettes for each and every battle bg. I will update this post and patch once i get my pc repaired ;) and no simply inserting that asm and repointing it wont work like Delta said..
.text
.align 2
.thumb
.thumb_func
.global CustomBattleBGhack
CheckTime:
ldr r5, .Hour
ldrb r5, [r5]
cmp r5, #0x13 *7PM, Change it if you want. This is how it appears in Gen 4
bge Night
cmp r5, #0x11 *5PM,Change it if you want. This is how it appears in Gen 4
bge Evening
cmp r5, #0x4 *4AM, Change it if you want. This is how it appears in Gen 4
bge Day
Night:
ldr r5, .NightBGTable
b Push
Evening:
ldr r5, .EveningBGTable
b Push
Day:
ldr r5, .BGTable
Push:
push {r5}
push {r1}
bl LoadVar
CheckVar:
cmp r1, #0x0
beq Return
CheckWater:
cmp r0, #0x4
bne SetBG
AddBG:
add r1, #0x1 *Change 0x1 to the distance between Cave Backgrounds, though they have to be consistent across all BGs, so having them 1 away from the original one is probably the easiest thing to do.
SetBG:
mov r0, r1
Return:
pop {r1}
ldr r5, .Return
lsl r4, r0, #0x2
add r4, r4, r0
bx r5
LoadVar:
push {r0, r2}
ldr r0, .Variable
bl Decrypt
ldrh r0, [r0]
mov r1, r0
pop {r0, r2}
bl CheckVar
Decrypt:
ldr r2, .Decrypt
bx r2
.align 2
.Hour: .word 0x03005542
.NightBGTable: .word 0x08NNNNNN *Change to location of Night Background Table
.EveningBGTable: .word 0x08EEEEEE *Change to location of Evening Background Table
.BGTable: .word 0x08DDDDDD *Change to location of Day Background Table
.Return: .word 0x0800F271
.Variable: .word 0x00004039 *Change to variable you want
.Decrypt: .word 0x0806E455
.text
.align 2
.thumb
.thumb_func
.global CustomBattleBGhack
CheckTime:
ldr r5, .Hour
ldrb r5, [r5]
cmp r5, #0x13 *7PM, Change it if you want. This is how it appears in Gen 4
bge Night
cmp r5, #0x11 *5PM,Change it if you want. This is how it appears in Gen 4
bge Evening
cmp r5, #0x4 *4AM, Change it if you want. This is how it appears in Gen 4
bge Day
Night:
ldr r5, .NightBGTable
b Push
Evening:
ldr r5, .EveningBGTable
b Push
Day:
ldr r5, .BGTable
Push:
push {r5}
push {r1}
bl LoadVar
CheckVar:
cmp r1, #0x0
beq Return
CheckWater:
cmp r0, #0x4
bne SetBG
AddBG:
add r1, #0x1 *Change 0x1 to the distance between Cave Backgrounds, though they have to be consistent across all BGs, so having them 1 away from the original one is probably the easiest thing to do.
SetBG:
mov r0, r1
Return:
pop {r1}
ldr r5, .Return
lsl r4, r0, #0x2
add r4, r4, r0
bx r5
LoadVar:
push {r0, r2}
ldr r0, .Variable
bl Decrypt
ldrh r0, [r0]
mov r1, r0
pop {r0, r2}
bl CheckVar
Decrypt:
ldr r2, .Decrypt
bx r2
.align 2
.Hour: .word 0x03005542
.NightBGTable: .word 0x08NNNNNN *Change to location of Night Background Table
.EveningBGTable: .word 0x08EEEEEE *Change to location of Evening Background Table
.BGTable: .word 0x08DDDDDD *Change to location of Day Background Table
.Return: .word 0x0800F2BD
.Variable: .word 0x00004039 *Change to variable you want
.Decrypt: .word 0x0806E455
How to make compatible with Navenatox's Dynamic OW Palettes System
Instructions:
Insert Navenatox Pallete Fix.asm to free space
Go to rtc.asm, and at line 436 replace 805FECC with 8(offset you inserted the fix)
then insert Put 00B5 0148 0047 0000 [Reverse Address+1] 0000 10BC at 0x4B0
open npcfilter folder and open command window: then write make bpre fname=../yourrom.gba offset=XXXXXX
then open npchook.asm, change the offset to where you inserted npcfilter stuff, reversed +1, and insert data at 0x83598
open mapfilter folder, open command window, then write make bpre fname=../yourrom.gba offset=XXXXXX
then open npchook1.asm, change the offset to where you inserted the second thing, reversed +1, and insert the data at 0x598CC
Also null out the eight bytes from 0x59A28 to 0x59A2F with 00's
and at 0x59A12, put 00 00
and youre done
Ignore the .bin files in the ASM folder, those were my offsets.
Make a patch for it please. The background of primedialga is really buggyI've currently written a routine to swap the Day, Afternoon and Night palettes for battle backgrounds.
To insert it you will need to delete the BattleBGHack by Karatekid and replace it with these routines instead.
They also have the added functionality of allowing you to differentiate between water and land when you set a background to the variable. For example if you set the background to 'Volcano Cave', when surfing, instead of bringing up the Volcano Cave base it will bring up your Volcano Lava base, provided you have positioned it immediately after the other battle background in the table.
Routines:
Spoiler:Routine 1:
Insert 01 BC 00 47 00 00 ZZ+1 YY XX 08 at 00F29A, where XX YY ZZ is the location you have inserted this routine in free space.Code:.text .align 2 .thumb .thumb_func .global CustomBattleBGhack CheckTime: ldr r5, .Hour ldrb r5, [r5] cmp r5, #0x13 *7PM, Change it if you want. This is how it appears in Gen 4 bge Night cmp r5, #0x11 *5PM,Change it if you want. This is how it appears in Gen 4 bge Evening cmp r5, #0x4 *4AM, Change it if you want. This is how it appears in Gen 4 bge Day Night: ldr r5, .NightBGTable b Push Evening: ldr r5, .EveningBGTable b Push Day: ldr r5, .BGTable Push: push {r5} push {r1} bl LoadVar CheckVar: cmp r1, #0x0 beq Return CheckWater: cmp r0, #0x4 bne SetBG AddBG: add r1, #0x1 *Change 0x1 to the distance between Cave Backgrounds, though they have to be consistent across all BGs, so having them 1 away from the original one is probably the easiest thing to do. SetBG: mov r0, r1 Return: pop {r1} ldr r5, .Return lsl r4, r0, #0x2 add r4, r4, r0 bx r5 LoadVar: push {r0, r2} ldr r0, .Variable bl Decrypt ldrh r0, [r0] mov r1, r0 pop {r0, r2} bl CheckVar Decrypt: ldr r2, .Decrypt bx r2 .align 2 .Hour: .word 0x03005542 .NightBGTable: .word 0x08NNNNNN *Change to location of Night Background Table .EveningBGTable: .word 0x08EEEEEE *Change to location of Evening Background Table .BGTable: .word 0x08DDDDDD *Change to location of Day Background Table .Return: .word 0x0800F271 .Variable: .word 0x00004039 *Change to variable you want .Decrypt: .word 0x0806E455
Routine 2:
Insert 30 BC 01 BC 00 47 ZZ+1 YY XX 08 at 00F2DA, where XX YY ZZ is the location you have inserted this routine in free space.Code:.text .align 2 .thumb .thumb_func .global CustomBattleBGhack CheckTime: ldr r5, .Hour ldrb r5, [r5] cmp r5, #0x13 *7PM, Change it if you want. This is how it appears in Gen 4 bge Night cmp r5, #0x11 *5PM,Change it if you want. This is how it appears in Gen 4 bge Evening cmp r5, #0x4 *4AM, Change it if you want. This is how it appears in Gen 4 bge Day Night: ldr r5, .NightBGTable b Push Evening: ldr r5, .EveningBGTable b Push Day: ldr r5, .BGTable Push: push {r5} push {r1} bl LoadVar CheckVar: cmp r1, #0x0 beq Return CheckWater: cmp r0, #0x4 bne SetBG AddBG: add r1, #0x1 *Change 0x1 to the distance between Cave Backgrounds, though they have to be consistent across all BGs, so having them 1 away from the original one is probably the easiest thing to do. SetBG: mov r0, r1 Return: pop {r1} ldr r5, .Return lsl r4, r0, #0x2 add r4, r4, r0 bx r5 LoadVar: push {r0, r2} ldr r0, .Variable bl Decrypt ldrh r0, [r0] mov r1, r0 pop {r0, r2} bl CheckVar Decrypt: ldr r2, .Decrypt bx r2 .align 2 .Hour: .word 0x03005542 .NightBGTable: .word 0x08NNNNNN *Change to location of Night Background Table .EveningBGTable: .word 0x08EEEEEE *Change to location of Evening Background Table .BGTable: .word 0x08DDDDDD *Change to location of Day Background Table .Return: .word 0x0800F2BD .Variable: .word 0x00004039 *Change to variable you want .Decrypt: .word 0x0806E455
Effectively this loads a new battle background table based on the time of the day, so to actually make it work you will need to copy your battle background table twice, and then manually change the palettes and their respective pointers in that table to make it work.
I have made the following outdoor battle backgrounds with all three palettes, however they will also require you to be using the same tile sets and raws that I am, so I might just release them in a patch elsewhere.
0x0 Grass
0x1 Forest
0x2 Sand
0x4 Sea
0x5 Pond
0x6 Craggy / Mountain
0x9 Normal
If you are already using your own Battle Backgrounds, the only option you really have is to copy the palette entries and manually change the colours yourself and repoint everything, having done this for the past two days I was averaging about 30 minutes to 60 minutes to get 1 Background's Afternoon and Night Palettes completed (already having the colours I wanted), so it's a tedious process to say the least.