Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Old routine didn't check if you had DNS or not, it just assumed. So if you didn't have DNS, the hour would be "0" and it'd always be night music. This new routine corrects that and an error with reading R1.
- .text
- .align 2
- .thumb
- .thumb_func
- .global gameboyplayerbackgroundroutine
- main:
- add r3, r2, #0x4
- ldr r2, ramtable
- push {r0,r2-r7}
- ldr r0, DNS
- ldr r0, [r0]
- cmp r0, #0x0
- beq noDNS
- mov r1, #0x0
- ldr r0, hour
- ldrb r0, [r0]
- add r1, r0, #0x0
- pop {r0,r2-r7}
- cmp r1, #0x4
- blt gbp
- cmp r1, #0x14
- bge gbp
- ldr r1, normaltable
- b exit
- noDNS: pop {r0,r2-r7}
- ldr r1, normaltable
- b exit
- gbp: ldr r1, gbptable
- exit: lsr r0, r0, #0xD
- add r0, r0, r1
- mov pc, r3
- .align
- ramtable: .word 0x084A329C
- normaltable: .word 0x08B43D00
- gbptable: .word 0x08B44D00
- hour: .word 0x3005542
- DNS: .word 0x300553C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement