Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. arm7takeover:
  2. ldr r1,=0x4004040 //
  3. mov r0,0 //
  4. str r0,[r1] @\
  5. ldr r1,=0x4004044 //
  6. mov r0,0 //
  7. str r0,[r1] @
  8. ldr r1,=0x4004048 //
  9. mov r0,0 //
  10. str r0,[r1] @ disable wram A+B
  11. ldr r1,=0x4004054 //
  12. mov r0,0 //
  13. str r0,[r1] @
  14. ldr r1,=0x4004058 //
  15. mov r0,0 //
  16. str r0,[r1] @/
  17. ldr r1,=0x400405c //
  18. ldr r0,=0x00403000 //
  19. str r0,[r1] @-map wram C at 3000000h
  20. mov r10,#6 @chunk 6 (last chunk on ARM7 side@ chunks are 7,0,1,2,3,4,5,6)
  21.  
  22. wram_chunk_loop:
  23. ldr r8,=0x400404c @\
  24. add r8,r10 @ memorize old mapping
  25. ldrb r9,[r8] @memorize old @ and map to ARM9
  26. mov r0,#0x80 @
  27. strb r0,[r8] @map as 1st arm9 slot @/
  28. mov r1,#0x3000000 @\
  29. ldr r0,[nop] @
  30.  
  31. fill_loop: @ fill chunk with NOPs
  32. str r0,[r1],#4 @
  33. tst r1,#0x8000 @
  34. beq fill_loop @/
  35. ldr r4,=ldr_bx_dd_arm7_re_entry @\
  36. ldmia r4!,{r0-r3} @ cast hook at chunk end
  37. ldr r4,=0x3007ff0 @
  38. stmia r4!,{r0-r3} @/
  39. strb r9,[r8] @restore old @-map back to ARM7
  40. sub r10,#1 @\
  41. and r10,#7 @ next chunk
  42. cmp r10,#6 @
  43. bne wram_chunk_loop @/
  44. bx lr
  45. @---
  46. nop:
  47. nop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement