Advertisement
GoGoJJTech

D/N Music v3

Oct 19th, 2014
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. 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.
  2.  
  3. .text
  4. .align 2
  5. .thumb
  6. .thumb_func
  7. .global gameboyplayerbackgroundroutine
  8. main:
  9. add r3, r2, #0x4
  10. ldr r2, ramtable
  11. push {r0,r2-r7}
  12. ldr r0, DNS
  13. ldr r0, [r0]
  14. cmp r0, #0x0
  15. beq noDNS
  16. mov r1, #0x0
  17. ldr r0, hour
  18. ldrb r0, [r0]
  19. add r1, r0, #0x0
  20. pop {r0,r2-r7}
  21. cmp r1, #0x4
  22. blt gbp
  23. cmp r1, #0x14
  24. bge gbp
  25. ldr r1, normaltable
  26. b exit
  27. noDNS: pop {r0,r2-r7}
  28. ldr r1, normaltable
  29. b exit
  30. gbp: ldr r1, gbptable
  31. exit: lsr r0, r0, #0xD
  32. add r0, r0, r1
  33. mov pc, r3
  34. .align
  35. ramtable: .word 0x084A329C
  36. normaltable: .word 0x08B43D00
  37. gbptable: .word 0x08B44D00
  38. hour: .word 0x3005542
  39. DNS: .word 0x300553C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement