Slam Dunk GB:Notes
Jump to navigation
Jump to search
================================================== ================================================== ______________________________ | | | SLAM DUNK | | Gakeppuchi no Kesshou League | |______________________________| v1.0: Original version typed up By Sawakita ========================= = ASM MAP = ========================= This game has an interesting organization: each bank (except Bank0, obviously) starts with a table of "2Bytes pointers", that point to that bank's routines. There's a routine that manages this organizational method, located at 0x0530: 00000530 F5 push af ;preserve registers 00000531 C5 push bc 00000532 E5 push hl 00000533 FA A6 C0 ld a,($C0A6) ;preserve old bank 00000536 F5 push af 00000537 7A ld a,d ;load new bank 00000538 EA A6 C0 ld ($C0A6),a 0000053B EA 00 21 ld ($2100),a 0000053E CD 4C 05 call $054C 0000054C 21 00 40 ld hl,$4000 ;new bank's beginning 0000054F 16 00 ld d,$00 ;de = e [routine_ID] 00000551 19 add hl,de ;get the 00000552 19 add hl,de ;new routine's 00000553 19 add hl,de ;offset 00000554 F0 91 ld a,($FF00+91) 00000556 E9 jp (hl) [...] 00000541 F1 pop af 00000542 EA A6 C0 ld ($C0A6),a ;restore old bank 00000545 EA 00 21 ld ($2100),a 00000548 E1 pop hl ;restore registers 00000549 C1 pop bc 0000054A F1 pop af 0000054B C9 ret ------- BANK 00 ------- 02e5: VBLANK 0530: change bank [d:bank, e:routine_ID, ff91=value (optional)] 054c: jp bank's routine 0622: LCD control 06bb: write(00) 'bc' bytes starting 'hl' Example: bc=00a0, hl=ff8f; reset 0xff8f to 0xfffd 06bd: write 'd', 'bc' times at 'hl' 06c5: if LCDC(bit7)=0 then write(ff) 'bc' bytes starting 'hl' else (???) end if 06c9: same as 06c5, but write(00) 0729: write bc bytes from hl in de 0868: win Y&X (RAM saves) 0ead: (d307)=e4 ;bg pal 0ed9: ff8f=00; ff91=00; call 0d_02(=0d_401b); 0ee7: ff90=00; ff91=00; call 0d_02(=0d_401b); 2484: (c1a4)-->l (c1a5)-->h tile arrangement handler [*] ------- BANK 01 ------- 643a[02]: call 0c_12 ------- BANK 02 ------- 4563[03]: load jap tiles in 9000 (ROM 8747) (800 bytes) load other tiles in 8f00 (ROM 8f47) (100 bytes) ------- BANK 05 (various tile_arrange) ------- [09]: tile_arrange 1st border (menu) [30] tile_arrange common border (menu) ------- BANK 0c ------- 57c9[12]: ------- BANK 0d ------- 401b[02]: [RAM c600,c60a,c65f,c603] [03] ------- BANK 0f ------- 74bf[04]: black screen(?) 73e0[05]: 7627[0f]: ========================= = RAM MAP = ========================= c0a0 = c0a1 = c0a2 = c0a6 = ROMbank c0ad = c0af = c0b1 = c0b2 = c0b3 = c126 = c127 = c200 = c240 = scroll Y c241 = scroll X c242 = win Y c243 = win X c600 = c601 = c603 = c60a = c60b = c60c = c60d = c60e = c60f = c610 = c611 = c612 = c613 = c614 = c633 = c634 = c635 = c636 = c643 = c644 = c645 = c646 = c64f = c650 = c651 = c652 = c65f = c660 = c661 = c662 = c663 = c664 = c665 = c666 = c667 = c668 = c669 = c66a = c66b = c6c3 = d307 = bg pal d308 = obj pal 0 d309 = obj pal 1 ========================= TILE ARRANGEMENT HANDLER: starts at 0x248d (a=0); ========================= 0e: 4 more Bytes bc = 1st Ptr (then, hl=bc) de = 2nd Ptr GoTo 2d08 ================================================== ==================================================