sgb_packets.asm 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. ATTR_BLK: MACRO
  2. ; This is a command macro.
  3. ; Use ATTR_BLK_DATA for data sets.
  4. db ($4 << 3) + ((\1 * 6) / 16 + 1)
  5. db \1
  6. ENDM
  7. ATTR_BLK_DATA: MACRO
  8. db \1 ; which regions are affected
  9. db \2 + (\3 << 2) + (\4 << 4) ; palette for each region
  10. db \5, \6, \7, \8 ; x1, y1, x2, y2
  11. ENDM
  12. PAL_SET: MACRO
  13. db ($a << 3) + 1
  14. dw \1, \2, \3, \4
  15. ds 7
  16. ENDM
  17. PAL_TRN: MACRO
  18. db ($b<< 3) + 1
  19. ds 15
  20. ENDM
  21. MLT_REQ: MACRO
  22. db ($11 << 3) + 1
  23. db \1 - 1
  24. ds 14
  25. ENDM
  26. CHR_TRN: MACRO
  27. db ($13 << 3) + 1
  28. db \1 + (\2 << 1)
  29. ds 14
  30. ENDM
  31. PCT_TRN: MACRO
  32. db ($14 << 3) + 1
  33. ds 15
  34. ENDM
  35. MASK_EN: MACRO
  36. db ($17 << 3) + 1
  37. db \1
  38. ds 14
  39. ENDM
  40. DATA_SND: MACRO
  41. db ($f << 3) + 1
  42. dw \1 ; address
  43. db \2 ; bank
  44. db \3 ; length (1-11)
  45. ENDM
  46. BlkPacket_WholeScreen:
  47. ATTR_BLK 1
  48. ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,17
  49. ds 8
  50. db $03,$00,$00,$13,$11,$00,$00
  51. BlkPacket_Battle:
  52. ATTR_BLK 5
  53. ATTR_BLK_DATA %111, 2,2,0, 00,12, 19,17 ; message box: pal 2
  54. ATTR_BLK_DATA %011, 1,1,0, 01,00, 10,03 ; enemy HP bar: pal 1
  55. ATTR_BLK_DATA %011, 0,0,0, 10,07, 19,10 ; player HP bar: pal 0
  56. ATTR_BLK_DATA %011, 2,2,0, 00,04, 08,11 ; player mon: pal 2
  57. ATTR_BLK_DATA %011, 3,3,0, 11,00, 19,06 ; enemy mon : pal 3
  58. db $03,$00,$00,$13,$0b,$00
  59. db $03,$00,$0c,$13,$11,$02
  60. db $03,$01,$00,$0a,$03,$01
  61. db $03,$0a,$08,$13,$0a,$00
  62. db $03,$00,$04,$08,$0b,$02
  63. db $03,$0b,$00,$13,$07,$03
  64. db $00
  65. BlkPacket_StatusScreen:
  66. ATTR_BLK 1
  67. ATTR_BLK_DATA %111, 1,1,0, 01,00, 07,06 ; mon: pal 1, HP bar: pal 0
  68. ds 8
  69. db $02,$00,$00,$11,$00,$03
  70. db $01,$00,$07,$06,$01,$03
  71. db $01,$07,$13,$11,$00,$03
  72. db $08,$00,$13,$06,$00,$00
  73. BlkPacket_Pokedex:
  74. ATTR_BLK 1
  75. ATTR_BLK_DATA %111, 1,1,0, 01,01, 08,08 ; mon: pal 1, everything else: pal 0
  76. ds 8
  77. db $02,$00,$00,$11,$00,$01
  78. db $00,$01,$13,$00,$03,$01
  79. db $01,$08,$08,$01,$03,$01
  80. db $09,$08,$11,$00,$03,$09
  81. db $01,$13,$11,$00,$00
  82. BlkPacket_Slots:
  83. ATTR_BLK 5
  84. ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,11 ; "3" rows and top of screen: pal 1
  85. ATTR_BLK_DATA %011, 2,2,0, 00,04, 19,09 ; "2" rows: pal 2
  86. ATTR_BLK_DATA %010, 3,3,0, 00,06, 19,07 ; "1" row: pal 3
  87. ATTR_BLK_DATA %011, 0,0,0, 04,04, 15,09 ; slot reels: pal 0
  88. ATTR_BLK_DATA %011, 0,0,0, 00,12, 19,17 ; message box: pal 0
  89. db $03,$00,$00,$13,$0b,$01
  90. db $03,$00,$04,$13,$09,$02
  91. db $03,$00,$06,$13,$07,$03
  92. db $03,$04,$04,$0f,$09,$00
  93. db $03,$00,$0c,$13,$11,$00
  94. db $00
  95. BlkPacket_Titlescreen:
  96. ATTR_BLK 3
  97. ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,07 ; pokemon logo: pal 0
  98. ATTR_BLK_DATA %010, 1,1,0, 00,08, 19,09 ; version text: pal 1
  99. ATTR_BLK_DATA %011, 2,2,0, 00,10, 19,17 ; player, mon, copyright text: pal 2
  100. ds 12
  101. db $03,$00,$00,$13,$07,$00
  102. db $03,$00,$08,$13,$09,$01
  103. db $03,$00,$0a,$13,$11,$02
  104. db $00
  105. BlkPacket_NidorinoIntro:
  106. ATTR_BLK 3
  107. ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,03 ; upper black bar: pal 1
  108. ATTR_BLK_DATA %011, 0,0,0, 00,04, 19,13 ; letterbox: pal 0
  109. ATTR_BLK_DATA %011, 1,1,0, 00,14, 19,17 ; lower black bar: pal 1
  110. ds 12
  111. db $03,$00,$00,$13,$03,$01
  112. db $03,$00,$04,$13,$0d,$00
  113. db $03,$00,$0e,$13,$11,$01
  114. db $00
  115. BlkPacket_PartyMenu:
  116. ATTR_BLK 7
  117. ATTR_BLK_DATA %110, 0,0,1, 01,00, 02,12 ; mon sprites: pal 0, everything else: pal 1
  118. ATTR_BLK_DATA %010, 0,0,0, 05,01, 11,01 ; HP bar 0: pal set dynamically
  119. ATTR_BLK_DATA %010, 0,0,0, 05,03, 11,03 ; HP bar 1: pal set dynamically
  120. ATTR_BLK_DATA %010, 0,0,0, 05,05, 11,05 ; HP bar 2: pal set dynamically
  121. ATTR_BLK_DATA %010, 0,0,0, 05,07, 11,07 ; HP bar 3: pal set dynamically
  122. ATTR_BLK_DATA %010, 0,0,0, 05,09, 11,09 ; HP bar 4: pal set dynamically
  123. ATTR_BLK_DATA %010, 0,0,0, 05,11, 11,11 ; HP bar 5: pal set dynamically
  124. ds 4
  125. db $02,$00,$00,$11,$01,$03
  126. db $01,$00,$02,$0c,$00,$03
  127. db $01,$0d,$02,$11,$01,$03
  128. db $03,$00,$13,$11,$01,$03
  129. db $0c,$00,$12,$01,$00,$03
  130. db $0c,$02,$12,$03,$00,$03
  131. db $0c,$04,$12,$05,$00,$03
  132. db $0c,$06,$12,$07,$00,$03
  133. db $0c,$08,$12,$09,$00,$03
  134. db $0c,$0a,$12,$0b,$00,$00
  135. BlkPacket_TrainerCard:
  136. ATTR_BLK 10
  137. ATTR_BLK_DATA %010, 0,0,0, 03,12, 04,13 ; Boulder Badge
  138. ATTR_BLK_DATA %010, 1,1,0, 07,12, 08,13 ; Cascade Badge
  139. ATTR_BLK_DATA %010, 3,3,0, 11,12, 12,13 ; Thunder Badge
  140. ATTR_BLK_DATA %010, 2,2,0, 16,11, 17,12 ; Rainbow Badge
  141. ATTR_BLK_DATA %010, 1,1,0, 14,13, 15,14 ; Rainbow Badge
  142. ATTR_BLK_DATA %010, 3,3,0, 16,13, 17,14 ; Rainbow Badge
  143. ATTR_BLK_DATA %010, 2,2,0, 03,15, 04,16 ; Soul Badge
  144. ATTR_BLK_DATA %010, 3,3,0, 07,15, 08,16 ; Marsh Badge
  145. ATTR_BLK_DATA %010, 2,2,0, 11,15, 12,16 ; Volcano Badge
  146. ATTR_BLK_DATA %010, 1,1,0, 15,15, 16,16 ; Earth Badge
  147. ds 2
  148. db $03,$03,$0c,$04,$0d,$00
  149. db $03,$07,$0c,$08,$0d,$01
  150. db $03,$0b,$0c,$0c,$0d,$03
  151. db $03,$10,$0b,$11,$0c,$02
  152. db $03,$0e,$0d,$0f,$0e,$01
  153. db $03,$10,$0d,$11,$0e,$03
  154. db $03,$03,$0f,$04,$10,$02
  155. db $03,$07,$0f,$08,$10,$03
  156. db $03,$0b,$0f,$0c,$10,$02
  157. db $03,$0f,$0f,$10,$10,$01
  158. db $00
  159. BlkPacket_GameFreakIntro:
  160. ATTR_BLK 3
  161. ATTR_BLK_DATA %111, 1,1,0, 05,11, 07,13 ; falling stars (left): pal 1, GameFreak logo: pal 0
  162. ATTR_BLK_DATA %010, 2,2,0, 08,11, 09,13 ; falling stars (middle): pal 2
  163. ATTR_BLK_DATA %011, 3,3,0, 12,11, 14,13 ; falling stars (right): pal 3
  164. ds 12
  165. db $03,$00,$00,$13,$0a,$00
  166. db $03,$00,$0b,$04,$0d,$00
  167. db $03,$05,$0b,$07,$0d,$01
  168. db $03,$08,$0b,$13,$0d,$00
  169. db $03,$00,$0e,$13,$11,$00
  170. db $03,$08,$0b,$09,$0d,$02
  171. db $03,$0c,$0b,$0e,$0d,$03
  172. db $00
  173. PalPacket_Empty: PAL_SET 0, 0, 0, 0
  174. PalPacket_PartyMenu: PAL_SET PAL_MEWMON, PAL_GREENBAR, PAL_YELLOWBAR, PAL_REDBAR
  175. PalPacket_Black: PAL_SET PAL_BLACK, PAL_BLACK, PAL_BLACK, PAL_BLACK
  176. PalPacket_TownMap: PAL_SET PAL_TOWNMAP, 0, 0, 0
  177. PalPacket_Pokedex: PAL_SET PAL_BROWNMON, 0, 0, 0
  178. PalPacket_Slots: PAL_SET PAL_SLOTS1, PAL_SLOTS2, PAL_SLOTS3, PAL_SLOTS4
  179. PalPacket_Titlescreen: PAL_SET PAL_LOGO2, PAL_LOGO1, PAL_MEWMON, PAL_PURPLEMON
  180. PalPacket_TrainerCard: PAL_SET PAL_MEWMON, PAL_BADGE, PAL_REDMON, PAL_YELLOWMON
  181. PalPacket_Generic: PAL_SET PAL_MEWMON, 0, 0, 0
  182. PalPacket_NidorinoIntro: PAL_SET PAL_PURPLEMON, PAL_BLACK, 0, 0
  183. PalPacket_GameFreakIntro: PAL_SET PAL_GAMEFREAK, PAL_REDMON, PAL_VIRIDIAN, PAL_BLUEMON
  184. PalTrnPacket: PAL_TRN
  185. MltReq1Packet: MLT_REQ 1
  186. MltReq2Packet: MLT_REQ 2
  187. ChrTrnPacket: CHR_TRN 0, 0
  188. PctTrnPacket: PCT_TRN
  189. MaskEnFreezePacket: MASK_EN 1
  190. MaskEnCancelPacket: MASK_EN 0
  191. ; These are DATA_SND packets containing SNES code.
  192. ; This set of packets is found in several Japanese SGB-compatible titles.
  193. ; It appears to be part of NCL's SGB devkit.
  194. DataSnd_72548: DATA_SND $85d, $0, 11
  195. db $8C ; cpx #$8c (2)
  196. db $D0, $F4 ; bne -$0c
  197. db $60 ; rts
  198. ds 7
  199. DataSnd_72558: DATA_SND $852, $0, 11
  200. db $A9, $E7 ; lda #$e7
  201. db $9F, $01, $C0, $7E ; sta $7ec001, x
  202. db $E8 ; inx
  203. db $E8 ; inx
  204. db $E8 ; inx
  205. db $E8 ; inx
  206. db $E0 ; cpx #$8c (1)
  207. DataSnd_72568: DATA_SND $847, $0, 11
  208. db $C4 ; cmp #$c4 (2)
  209. db $D0, $16 ; bne +$16
  210. db $A5 ; lda dp
  211. db $CB ; wai
  212. db $C9, $05 ; cmp #$05
  213. db $D0, $10 ; bne +$10
  214. db $A2, $28 ; ldx #$28
  215. DataSnd_72578: DATA_SND $83c, $0, 11
  216. db $F0, $12 ; beq +$12
  217. db $A5 ; lda dp
  218. db $C9, $C9 ; cmp #$c9
  219. db $C8 ; iny
  220. db $D0, $1C ; bne +$1c
  221. db $A5 ; lda dp
  222. db $CA ; dex
  223. db $C9 ; cmp #$c4 (1)
  224. DataSnd_72588: DATA_SND $831, $0, 11
  225. dbw $0C, $CAA5 ; tsb $caa5
  226. db $C9, $7E ; cmp #$7e
  227. db $D0, $06 ; bne +$06
  228. db $A5 ; lda dp
  229. db $CB ; wai
  230. db $C9, $7E ; cmp #$7e
  231. DataSnd_72598: DATA_SND $826, $0, 11
  232. db $39 ; bne +$39 (2)
  233. dbw $CD, $C48 ; cmp $c48
  234. db $D0, $34 ; bne +$34
  235. db $A5 ; lda dp
  236. db $C9, $C9 ; cmp #$c9
  237. db $80, $D0 ; bra -$30
  238. DataSnd_725a8: DATA_SND $81b, $0, 11
  239. db $EA ; nop
  240. db $EA ; nop
  241. db $EA ; nop
  242. db $EA ; nop
  243. db $EA ; nop
  244. ; $820:
  245. db $A9,$01 ; lda #01
  246. dbw $CD,$C4F ; cmp $c4f
  247. db $D0 ; bne +$39 (1)
  248. DataSnd_725b8: DATA_SND $810, $0, 11
  249. dbw $4C, $820 ; jmp $820
  250. db $EA ; nop
  251. db $EA ; nop
  252. db $EA ; nop
  253. db $EA ; nop
  254. db $EA ; nop
  255. db $60 ; rts
  256. db $EA ; nop
  257. db $EA ; nop