Advertisement
luckytyphlosion

3dsvc factory bootstrap code

Jan 27th, 2017
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. ld hl, de06
  2. ld bc, d53e
  3. ld de, 5062
  4. ld a, [hli]
  5. nop
  6. cp d
  7. jr z, fb
  8. nop
  9. add a
  10. nop
  11. add [hl]
  12. inc hl
  13. ld [bc], a
  14. inc bc
  15. dec e
  16. jr nz, f1
  17. ret
  18.  
  19. ld a, $10
  20. ld [wMonDataLocation], a
  21. ld hl, wPartyMonNicks
  22. ld de, wcf91
  23. ld a, 1
  24. ld c, a
  25. ld [wMoveMonType], a
  26. call .CombineLowerNybblesIntoBytes
  27. ld a, $5
  28. ld [de], a ; wWhichPokemon
  29. ld [wPartyCount], a
  30. call AddPartyMon
  31. ld d, h
  32. lb bc, wPartyMon6Moves & $ff, 4
  33. call .CombineLowerNybblesIntoBytes_BAsLowByteForE
  34. inc hl
  35. lb bc, wPartyMon6DVs & $ff, 2
  36. call .CombineLowerNybblesIntoBytes_BAsLowByteForE
  37. lb bc, wPartyMon6OTID & $ff, 2
  38. call .CombineLowerNybblesIntoBytes_BAsLowByteForE
  39. ld l, wPartyMonNicknames + NAME_LENGTH * 2
  40. ld c, 3
  41. call .CombineLowerNybblesIntoBytes
  42. ld e, (wPartyMonNicknames + NAME_LENGTH * 3) & $ff
  43. ld l, (wPartyMonNicknames + NAME_LENGTH * 5) & $ff
  44. call CopyString
  45. ld e, (wPartyMonNicknames + NAME_LENGTH * 4) & $ff
  46. ld l, (wPartyMonOT + NAME_LENGTH * 5) & $ff
  47. call CopyString
  48. .loop
  49. call MoveMon
  50. jr nc, .loop
  51. jpba SaveSAVToSRAM
  52.  
  53. .CombineLowerNybblesIntoBytes_BAsLowByteForE:
  54. ld e, b
  55.  
  56. .CombineLowerNybblesIntoBytes:
  57. ld a, [hli]
  58. add a
  59. ld b, a
  60. ld a, [hli]
  61. add b
  62. ld [de], a
  63. inc de
  64. dec c
  65. jr nz, .CombineLowerNybblesIntoBytes
  66. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement