diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | shim.sym | 112 | ||||
-rw-r--r-- | source/bank_00.asm | 21 | ||||
-rw-r--r-- | source/bank_02.asm | 18 | ||||
-rw-r--r-- | source/bank_05.asm | 1605 | ||||
-rwxr-xr-x | tools/dump_data.py | 18 |
6 files changed, 1774 insertions, 2 deletions
@@ -44,7 +44,7 @@ $(dir_build)/%.o: $(dir_build)/%.asm | $(gfx) $$(dir $$@) $(dir_build)/%.o: %.asm | $(gfx) $$(dir $$@) $(RGBASM) $(RGBASMFLAGS) -i $(dir_build)/ -i include/ -M $(@:.o=.d) -o $@ $< -$(dir_build)/%.bin: RGBGFXFLAGS = +RGBGFXFLAGS := $(dir_build)/%.bin: %.png | $$(dir $$@) $(RGBGFX) $(RGBGFXFLAGS) -o $@ $< @@ -6,20 +6,96 @@ 00:0ecf function_00_0ecf 00:0f20 function_00_0f20 00:103c function_00_103c +00:1094 function_00_1094 +00:10fb function_00_10fb 00:114e function_00_114e 00:11f1 function_00_11f1 +00:17fb function_00_17fb +00:1bd5 function_00_1bd5 00:1caa function_00_1caa 00:1cfa function_00_1cfa 00:1d59 function_00_1d59 00:1de7 function_00_1de7 +00:208c function_00_208c 00:2312 function_00_2312 00:26c1 function_00_26c1 +02:4147 function_02_4147 +02:4f6d function_02_4f6d +02:5560 function_02_5560 +02:56c0 function_02_56c0 +02:5790 function_02_5790 +02:57b9 wait_press_a_blink +02:58fe function_02_58fe +02:5a82 function_02_5a82 +02:5b67 function_02_5b67 +02:5b77 function_02_5b77 +02:5b98 function_02_5b98 +02:6880 string_02_6880 +02:68ca string_02_68ca +02:68e2 string_02_68e2 +02:68fe string_02_68fe +02:693e string_02_693e +02:6960 string_02_6960 +02:69ae string_02_69ae +02:69e6 string_02_69e6 +02:6a06 string_02_6a06 +02:6a44 string_02_6a44 +02:6a5e string_02_6a5e +02:6aa4 string_02_6aa4 +02:6ac4 string_02_6ac4 +02:6afc string_02_6afc +02:6b1c string_02_6b1c +02:6b7e string_02_6b7e +02:6bca string_02_6bca +02:6be4 string_02_6be4 +02:6c18 string_02_6c18 +02:6c58 string_02_6c58 +02:6cba string_02_6cba +02:6d10 string_02_6d10 +02:6d74 string_02_6d74 +02:6d90 string_02_6d90 +02:6dde string_02_6dde +02:6e1e string_02_6e1e +02:6e42 string_02_6e42 +02:6e60 string_02_6e60 +02:6ed0 string_02_6ed0 +02:6ee4 string_02_6ee4 +02:6f32 string_02_6f32 +02:6f96 string_02_6f96 +02:6fe2 string_02_6fe2 +02:702c string_02_702c +02:708c string_02_708c +02:70c2 string_02_70c2 +02:710e string_02_710e +02:7142 string_02_7142 +02:71be string_02_71be + 03:48cc data_00_48cc 04:43ec function_04_43ec -05:420f text_scroll_char_print +05:5f2f function_05_5f2f + +06:4964 function_06_4964 + +08:42b8 function_08_42b8 + +09:5a50 function_09_5a50 + +22:47e2 function_22_47e2 +22:61e8 function_22_61e8 + +27:4bf4 function_27_4bf4 + +29:4461 function_29_4461 +29:4ef5 function_29_4ef5 +29:5579 function_29_5579 +29:5de4 function_29_5de4 +29:5e90 function_29_5e90 +29:7421 function_29_7421 + +3c:4377 function_3c_4377 00:a03e s_a03e 00:a040 s_a040 @@ -78,6 +154,7 @@ 00:c340 w_c340 00:c341 w_vblank_ran ; db 00:c342 w_c342 +00:c343 w_c343 00:c344 w_c344 00:c345 w_c345 00:c357 w_c357 @@ -105,24 +182,57 @@ 00:cd6d w_cd6d 00:cd6e w_cd6e 00:cd73 w_cd73 +00:cdb0 w_cdb0 +00:cdaf w_cdaf +00:cdac w_cdac +00:cdad w_cdad +00:cdb1 w_cdb1 ; dw +00:cdb3 w_cdb3 00:cdcc w_cdcc 00:cdce w_cdce 00:cdd0 w_cdd0 +00:cdd1 w_cdd1 +00:cdd2 w_cdd2_jumptable_index ; db +00:cdd6 w_cdd6 +00:cdd7 w_cdd7 +00:cdf8 w_text_delay_timer ; db 00:cdfc w_cdfc +00:cdfd w_cdfd ; ds ?? +00:cde0 w_cde0 +00:ce00 w_ce00 00:ff80 h_oam_dma 00:fffe h_stack_bottom +01:d521 w_d521 +01:d52e w_d52e +01:d535 w_d535 +01:d536 w_d536 +01:d537 w_d537 +01:d538 w_d538 ; dw 01:d548 w_text_cur_string ; dw 01:d546 w_text_cur_x ; db 01:d547 w_text_cur_y ; db +01:d54a w_d54a +01:d54b w_d54b +01:d54c w_d54c ; dw +01:d550 w_d550 01:d55e w_textbox_x ; db +01:d55f w_textbox_y ; db 01:d560 w_textbox_width ; db 01:d561 w_textbox_height ; db 01:d568 w_d568 +01:d60f w_d60f 01:d61b w_d61b +01:d62d w_d62d +01:d630 w_d630 +01:d641 w_tutorial_scene ; db +01:d642 w_d642 +01:d647 w_d647 01:d6b5 w_d6b5 +01:d6c9 w_d6c9 +01:d6ca w_d6ca 01:df3f w_df3f ; ds 3 01:df47 w_df47 01:df62 w_df62 diff --git a/source/bank_00.asm b/source/bank_00.asm index f0a68b2..0f31041 100644 --- a/source/bank_00.asm +++ b/source/bank_00.asm @@ -1030,6 +1030,27 @@ vwf_char_draw:: db $00, $00, $68, $01, $d0, $02, $38, $04, $a0, $05, $08, $07, $70, $08, $d8, $09, $40, $0b, $a8, $0c, $fa, $57, $c3, $a7, $c8, $f0, $00, $f6, $30, $e0, $00, $f0, $4d, $3e, $01, $e0, $4d, $10, $6f +SECTION "farcall_a_hl", ROM0[$0d36] +farcall_a_hl:: + ld [w_bank_temp], a + ld a, [w_bank_rom] + push af + ld a, [w_bank_temp] + ld [w_bank_rom], a + ld [rROMB0], a + ld de, .return + push de + ld a, [w_bank_rom] + ld e, a + push de + jp hl + +.return + pop af + ld [w_bank_rom], a + ld [rROMB0], a + ret + SECTION "function_00_0d58, etc", ROM0[$0d58] function_00_0d58:: push hl diff --git a/source/bank_02.asm b/source/bank_02.asm index 54935ae..1e5d8d3 100644 --- a/source/bank_02.asm +++ b/source/bank_02.asm @@ -145,3 +145,21 @@ text_char_draw:: call vwf_char_draw pop af jp farcall_ret + +SECTION "text_delay", ROMX[$5b7a], BANK[$02] +text_delay:: + ld a, [w_c343] + bit 4, a + jr nz, .no_blink + ld a, [w_text_cur_x] + sub 3 + ld b, a + ld a, [w_text_cur_y] + inc a + ld c, a + ld a, $e9 + call function_00_208c +.no_blink + ld hl, w_text_delay_timer + dec [hl] + jp farcall_ret diff --git a/source/bank_05.asm b/source/bank_05.asm new file mode 100644 index 0000000..237eb88 --- /dev/null +++ b/source/bank_05.asm @@ -0,0 +1,1605 @@ +INCLUDE "hardware.inc" +INCLUDE "macros.inc" + +SECTION "tutorial", ROMX[$4000], BANK[$05] + +tutorial:: + ld a, [w_cdd2_jumptable_index] + rst jumptable + dw function_05_400a + dw function_05_401b + dw function_05_4028 + +function_05_400a: + xor a + ld [w_d535], a + ld a, $00 + ld [w_d550], a + ld a, 2 + ld [w_cdd2_jumptable_index], a + jp farcall_ret + +function_05_401b: + ld a, $01 + ld [w_d550], a + ld a, 2 + ld [w_cdd2_jumptable_index], a + jp farcall_ret + +function_05_4028: + xor a + ld [w_cdd2_jumptable_index], a + ld a, [w_c357] + and a + jr z, .jr_005_4048 + ld a, $01 + call function_00_1bd5 + call function_00_1bd5 + ld hl, _VRAM + ld bc, $1000 + call clear_mem + ld a, $00 + call function_00_1bd5 +.jr_005_4048 + + ld a, 13 + ld [w_textbox_x], a + ld [w_text_cur_x], a + ld a, 95 + ld [w_textbox_y], a + ld [w_text_cur_y], a + ld a, 147 + ld [w_textbox_width], a + ld a, 141 + ld [w_textbox_height], a + ld a, LOW(string_02_6880) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6880) + ld [w_text_cur_string + 1], a + ld a, $01 + ld [w_d6ca], a + ld a, [w_d61b] + push af + xor a + ld [w_d61b], a + xor a + ld [w_d647], a + ld [w_tutorial_scene], a + ld [w_d642], a + +.loop + call function_00_1094 + xor a + ld [w_c325], a + ld [w_c326], a + ld [w_c329], a + ld [w_c32c], a + rst vblank_wait + xor a + ld [w_c327], a + ld [w_c32a], a + ld [w_c32d], a + ld a, $01 + ld [w_c325], a + + ld a, [w_c326] + bit 3, a + jp nz, .done + + ld a, [w_d550] + and a + jr z, .jr_005_40b8 + + ld a, [w_c326] + and a + jp nz, .done + +.jr_005_40b8 + ld a, [w_c329] + ld [w_d6c9], a + farcall function_09_5a50 + farcall tutorial_scene + farcall function_29_4461 + ld a, [w_d647] + and a + jp nz, .done + jp .loop + +.done + xor a + ld [w_c325], a + ld [w_c326], a + ld [w_c329], a + ld [w_c32c], a + rst vblank_wait + xor a + ld [w_c327], a + ld [w_c32a], a + ld [w_c32d], a + ld a, $01 + ld [w_c325], a + ld a, $01 + ld c, $00 + call function_00_0d91 + call function_00_0d58 + ld c, $00 + ld a, $01 + call function_00_0d91 + ld bc, $003c + call function_00_10fb + ld a, $05 + call function_00_0d91 + farcall function_02_4f6d + call function_00_1de7 + call function_00_0ecf + farcall function_29_5e90 + pop af + ld [w_d61b], a + ld a, $00 + ld [w_d550], a + ld a, [w_d630] + ld [w_cdd2_jumptable_index], a + ld a, [w_d62d] + ld [w_cdd1], a + jp farcall_ret + +tutorial_scene:: + ld a, [w_tutorial_scene] + rst jumptable + dw tutorial_scene_00 + dw tutorial_scene_01 + dw tutorial_scene_02 + dw tutorial_scene_03 + dw tutorial_scene_04 + dw tutorial_scene_05 + dw tutorial_scene_06 + dw tutorial_scene_07 + dw tutorial_scene_08 + dw tutorial_scene_09 + dw tutorial_scene_10 + dw tutorial_scene_11 + dw tutorial_scene_12 + dw tutorial_scene_13 + dw tutorial_scene_14 + dw tutorial_scene_15 + dw tutorial_scene_16 + dw tutorial_scene_17 + dw tutorial_scene_18 + dw tutorial_scene_19 + dw tutorial_scene_20 + dw tutorial_scene_21 + dw tutorial_scene_22 + dw tutorial_scene_23 + dw tutorial_scene_24 + dw tutorial_scene_25 + dw tutorial_scene_26 + dw tutorial_scene_27 + dw tutorial_scene_28 + dw tutorial_scene_29 + dw tutorial_scene_30 + dw tutorial_scene_31 + dw tutorial_scene_32 + dw tutorial_scene_33 + dw tutorial_scene_34 + dw tutorial_scene_35 + dw tutorial_scene_36 + dw tutorial_scene_37 + dw tutorial_scene_38 + dw tutorial_scene_39 + dw tutorial_scene_40 + dw tutorial_scene_41 + dw tutorial_scene_42 + dw tutorial_scene_43 + dw tutorial_scene_44 + dw tutorial_scene_45 + dw tutorial_scene_46 + dw tutorial_scene_47 + dw tutorial_scene_48 + dw tutorial_scene_49 + dw tutorial_scene_50 + dw tutorial_scene_51 + dw tutorial_scene_52 + dw tutorial_scene_53 + dw tutorial_scene_54 + dw tutorial_scene_55 + dw tutorial_scene_56 + dw tutorial_scene_57 + dw tutorial_scene_58 + dw tutorial_scene_59 + dw tutorial_scene_60 + +tutorial_scene_00: + ld a, [w_cdd2_jumptable_index] + cp 4 + jr nz, .not_done + ld hl, w_tutorial_scene + inc [hl] +.not_done + jp farcall_ret + +tutorial_scene_01: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_68ca) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_68ca) + ld [w_text_cur_string + 1], a + + xor a + ld [w_cdb0], a + ld [w_cdaf], a + ld a, $39 + ld [w_cdac], a + ld a, $0e + ld [w_cdad], a + ld a, LOW(tutorial_data_42c8) + ld [w_cdb1 + 0], a + ld a, HIGH(tutorial_data_42c8) + ld [w_cdb1 + 1], a + ld a, $05 + ld [w_cdb3], a + ld a, 60 + ld [w_text_delay_timer], a + farcall function_02_5b67 + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_data_42c8: + db $08, $00, $00, $e5, $08, $00, $00, $e6, $08, $00, $00, $e7, $08, $00, $00, $e6 , $00 + +tutorial_scene_02: + ld a, $00 + call function_00_17fb + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_03: + ld a, $00 + call function_00_17fb + farcall function_29_5de4 + farcall text_delay + jp nz, farcall_ret + + ld a, LOW(string_02_68e2) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_68e2) + ld [w_text_cur_string + 1], a + + xor a + ld [w_cdb0], a + ld [w_cdaf], a + ld a, $16 + ld [w_cdac], a + ld a, $31 + ld [w_cdad], a + ld a, LOW(tutorial_data_42c8) + ld [w_cdb1 + 0], a + ld a, HIGH(tutorial_data_42c8) + ld [w_cdb1 + 1], a + ld a, $05 + ld [w_cdb3], a + ld a, 60 + ld [w_text_delay_timer], a + farcall function_02_5b67 + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_04: + ld a, $00 + call function_00_17fb + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_05: + ld a, $00 + call function_00_17fb + farcall function_29_5de4 + farcall text_delay + jp nz, farcall_ret + + ld a, LOW(string_02_68fe) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_68fe) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_06: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_693e) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_693e) + ld [w_text_cur_string + 1], a + ld a, 10 + ld [w_text_delay_timer], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_07: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_08: + farcall function_29_5de4 + farcall text_delay + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_09: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + xor a + ld [w_d54a], a + ld [w_d54b], a + ld a, LOW(.data) + ld [w_d54c + 0], a + ld a, HIGH(.data) + ld [w_d54c + 1], a + farcall function_02_5b67 + ld a, $00 + ld [w_d6ca], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +.data: + db $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $40, $40, $40, $40, $10, $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $40, $40, $40, $40, $10, $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $40, $40, $40, $40, $10, $10, $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $40, $40, $40, $40, $20, $00, $00, $01, $80, $80, $01, $80, $01, $80, $01, $00, $00, $00, $00, $00, $00, $ff + +tutorial_scene_10: + farcall function_29_5de4 + farcall text_delay + farcall function_05_5f2f + jp nz, farcall_ret + + ld a, $01 + ld [w_d6ca], a + farcall function_06_4964 + farcall function_29_4ef5 + ld a, 10 + ld [w_text_delay_timer], a + farcall function_02_5b67 + + ld a, LOW(string_02_6960) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6960) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_11: + farcall function_06_4964 + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_06_4964 + farcall function_02_5b98 + + ld a, LOW(string_02_69ae) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_69ae) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_12: + farcall function_06_4964 + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + call function_00_1085 + farcall function_06_4964 + farcall function_02_5b98 + farcall function_02_5560 + farcall function_02_5a82 + + ld a, LOW(string_02_69e6) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_69e6) + ld [w_text_cur_string + 1], a + + xor a + ld [w_cdb0], a + ld [w_cdaf], a + ld a, $39 + ld [w_cdac], a + ld a, $0e + ld [w_cdad], a + ld a, LOW(tutorial_data_42c8) + ld [w_cdb1 + 0], a + ld a, HIGH(tutorial_data_42c8) + ld [w_cdb1 + 1], a + ld a, $05 + ld [w_cdb3], a + ld a, 60 + ld [w_text_delay_timer], a + farcall function_02_5b67 + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_13: + ld a, $00 + call function_00_17fb + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_14: + ld a, $00 + call function_00_17fb + farcall function_29_5de4 + farcall text_delay + jp nz, farcall_ret + + ld a, LOW(string_02_6a06) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6a06) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_15: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_6a44) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6a44) + ld [w_text_cur_string + 1], a + + xor a + ld [w_cdb0], a + ld [w_cdaf], a + ld a, $39 + ld [w_cdac], a + ld a, $0e + ld [w_cdad], a + ld a, LOW(tutorial_data_497d) + ld [w_cdb1 + 0], a + ld a, HIGH(tutorial_data_497d) + ld [w_cdb1 + 1], a + ld a, $05 + ld [w_cdb3], a + ld a, 60 + ld [w_text_delay_timer], a + farcall function_02_5b67 + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_data_497d: + db $08, $00, $00, $df, $08, $00, $00, $e0, $08, $00, $00, $e1, $08, $00, $00, $e0, $00 + +tutorial_scene_16: + farcall function_29_5de4 + farcall function_02_56c0 + ld a, $00 + call function_00_17fb + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_17: + farcall function_29_5de4 + ld a, $00 + call function_00_17fb + farcall text_delay + jp nz, farcall_ret + + ld a, LOW(string_02_6a5e) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6a5e) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_18: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + xor a + ld [w_d54a], a + ld [w_d54b], a + ld a, LOW(.data) + ld [w_d54c + 0], a + ld a, HIGH(.data) + ld [w_d54c + 1], a + ld a, $00 + ld [w_cdd6], a + ld a, $00 + ld [w_cdd7], a + farcall function_02_5b67 + ld a, $00 + ld [w_d6ca], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +.data: + db $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $ff + +tutorial_scene_19: + farcall function_29_5de4 + farcall text_delay + farcall function_05_5f2f + jp nz, farcall_ret + + ld a, $01 + ld [w_d6ca], a + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + farcall function_02_5a82 + + xor a + ld [w_cdb0], a + ld [w_cdaf], a + ld a, $16 + ld [w_cdac], a + ld a, $31 + ld [w_cdad], a + ld a, LOW(tutorial_data_42c8) + ld [w_cdb1 + 0], a + ld a, HIGH(tutorial_data_42c8) + ld [w_cdb1 + 1], a + ld a, $05 + ld [w_cdb3], a + ld a, 60 + ld [w_text_delay_timer], a + + ld a, LOW(string_02_6aa4) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6aa4) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_20: + farcall function_29_5de4 + farcall function_02_56c0 + ld a, $00 + call function_00_17fb + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_21: + farcall function_29_5de4 + ld a, $00 + call function_00_17fb + farcall text_delay + jp nz, farcall_ret + + ld a, LOW(string_02_6ac4) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6ac4) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_22: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + ld a, LOW(string_02_6afc) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6afc) + ld [w_text_cur_string + 1], a + + call function_00_1085 + farcall function_02_5b98 + + xor a + ld [w_cdb0], a + ld [w_cdaf], a + ld a, $16 + ld [w_cdac], a + ld a, $37 + ld [w_cdad], a + ld a, LOW(tutorial_data_4c91) + ld [w_cdb1 + 0], a + ld a, HIGH(tutorial_data_4c91) + ld [w_cdb1 + 1], a + ld a, $05 + ld [w_cdb3], a + ld a, 60 + ld [w_text_delay_timer], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_data_4c91: + db $08, $00, $00, $e2, $08, $00, $00, $e3, $08, $00, $00, $e4, $08, $00, $00, $e3, $00 + +tutorial_scene_23: + farcall function_29_5de4 + farcall function_02_56c0 + ld a, $00 + call function_00_17fb + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_24: + farcall function_29_5de4 + ld a, $00 + call function_00_17fb + farcall text_delay + jp nz, farcall_ret + + ld a, LOW(string_02_6b1c) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6b1c) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_25: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + xor a + ld [w_d54a], a + ld [w_d54b], a + ld a, LOW(.data) + ld [w_d54c + 0], a + ld a, HIGH(.data) + ld [w_d54c + 1], a + ld a, $00 + ld [w_cdd6], a + ld a, $01 + ld [w_cdd7], a + farcall function_02_5b67 + ld a, $00 + ld [w_d6ca], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +.data: + db $00, $00, $01, $10, $01, $10, $01, $10, $10, $01, $00, $00, $ff + +tutorial_scene_26: + farcall function_29_5de4 + farcall text_delay + farcall function_05_5f2f + jp nz, farcall_ret + + ld a, $01 + ld [w_d6ca], a + call function_00_1085 + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + ld hl, w_tutorial_scene + inc [hl] + + ld a, LOW(string_02_6b7e) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6b7e) + ld [w_text_cur_string + 1], a + + call function_00_1085 + farcall function_02_5b98 + jp farcall_ret + +tutorial_scene_27: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, $00 + ld [w_d521], a + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_28: + farcall function_29_5de4 + farcall text_delay + farcall function_02_58fe + + ld hl, w_cdfd + ld a, [hl+] + or [hl] + inc hl + or [hl] + inc hl + or [hl] + jp nz, farcall_ret + + ld a, $02 + ld [w_ce00], a + farcall function_3c_4377 + + ld a, LOW(string_02_6bca) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6bca) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_29: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + ld hl, w_tutorial_scene + inc [hl] + + ld a, LOW(string_02_6be4) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6be4) + ld [w_text_cur_string + 1], a + + call function_00_1085 + farcall function_02_5b98 + farcall function_27_4bf4 + farcall function_02_5790 + jp farcall_ret + +tutorial_scene_30: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + xor a + ld [w_d6ca], a + xor a + ld [w_d54a], a + ld [w_d54b], a + ld a, LOW(.data) + ld [w_d54c + 0], a + ld a, HIGH(.data) + ld [w_d54c + 1], a + ld a, $03 + ld [w_cdd6], a + ld a, $01 + ld [w_cdd7], a + farcall function_02_5b67 + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +.data: + db $00, $00, $01, $00, $00, $00, $00, $ff + +tutorial_scene_31: + farcall function_29_5de4 + farcall text_delay + farcall function_05_5f2f + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_32: + farcall function_29_5de4 + farcall text_delay + ld a, [$cde0] + and a + jp nz, farcall_ret + + call function_00_1085 + + ld a, LOW(string_02_6c18) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6c18) + ld [w_text_cur_string + 1], a + + ld a, $01 + ld [w_d6ca], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_33: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + ld hl, w_tutorial_scene + inc [hl] + + ld a, LOW(string_02_6c58) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6c58) + ld [w_text_cur_string + 1], a + + call function_00_1085 + farcall function_02_5b98 + jp farcall_ret + +tutorial_scene_34: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, $00 + ld [w_d6ca], a + xor a + ld [w_d54a], a + ld [w_d54b], a + ld a, LOW(.data) + ld [w_d54c + 0], a + ld a, HIGH(.data) + ld [w_d54c + 1], a + ld a, $03 + ld [w_cdd6], a + ld a, $01 + ld [w_cdd7], a + farcall function_02_5b67 + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +.data: + db $00, $00, $02, $00, $00, $00, $00, $ff + +tutorial_scene_35: + farcall function_29_5de4 + farcall text_delay + farcall function_05_5f2f + jp nz, farcall_ret + + ld a, [w_cde0] + and a + jp nz, farcall_ret + + ld a, $01 + ld [w_d6ca], a + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + farcall function_02_5a82 + farcall function_29_7421 + + ld a, LOW(string_02_6cba) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6cba) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_36: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, $01 + ld [w_d60f], a + farcall function_29_5579 + ld a, $02 + ld [w_cdd2_jumptable_index], a + xor a + ld [w_d54a], a + ld [w_d54b], a + ld a, LOW(.data) + ld [w_d54c + 0], a + ld a, HIGH(.data) + ld [w_d54c + 1], a + + ld hl, w_tutorial_scene + inc [hl] + + xor a + ld [w_c326], a + ld [w_c329], a + ld [w_c32c], a + ld [w_c327], a + ld [w_c32a], a + ld [w_c32d], a + ld a, $ff + ld [w_c330], a + jp farcall_ret + +.data: + db $20, $00, $00, $ff + +tutorial_scene_37: + farcall function_29_5de4 + farcall text_delay + farcall function_05_5f2f + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_6d10) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6d10) + ld [w_text_cur_string + 1], a + + ld a, $01 + ld [w_c329], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + + +tutorial_scene_38: + farcall function_29_5de4 + ld hl, w_d538 + ld a, $01 + ld [hl+], a + ld [hl], a + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + ld a, $01 + ld [w_c329], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_39: + farcall function_29_5de4 + farcall text_delay + ld a, [w_d536] + cp $3f + jp c, farcall_ret + + ld a, LOW(string_02_6d74) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6d74) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_40: + farcall function_29_5de4 + ld hl, w_d538 + ld a, $01 + ld [hl+], a + ld [hl], a + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + ld a, $01 + ld [w_c329], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_41: + farcall function_29_5de4 + farcall text_delay + ld a, [w_d537] + cp $3f + jp c, farcall_ret + + ld a, LOW(string_02_6d90) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6d90) + ld [w_text_cur_string + 1], a + + call function_00_1085 + farcall function_02_5b98 + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_42: + farcall function_29_5de4 + farcall function_09_5a50 + farcall function_08_42b8 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + farcall function_22_61e8 + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_6dde) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6dde) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_43: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + farcall function_02_5a82 + + ld a, LOW(string_02_6e1e) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6e1e) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_44: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + xor a + ld [w_d54a], a + ld [w_d54b], a + ld a, LOW(.data) + ld [w_d54c + 0], a + ld a, HIGH(.data) + ld [w_d54c + 1], a + farcall function_02_5b67 + xor a + ld [w_cdd6], a + ld [w_cdd7], a + ld a, $00 + ld [w_d6ca], a + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +.data: + db $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $40, $40, $40, $40, $10, $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $40, $40, $40, $40, $10, $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $40, $40, $40, $40, $10, $10, $00, $00, $01, $80, $01, $80, $01, $80, $01, $80, $01, $00, $00, $40, $40, $40, $40, $20, $00, $00, $01, $80, $80, $01, $80, $01, $80, $00, $00, $00, $00, $00, $00, $ff + +tutorial_scene_45: + farcall function_29_5de4 + farcall text_delay + farcall function_05_5f2f + jp nz, farcall_ret + + ld a, $01 + ld [w_d6ca], a + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + ld a, LOW(string_02_6e42) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6e42) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_46: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + ld a, $04 + ld [w_c326], a + farcall function_22_47e2 + ld a, $00 + ld [w_c326], a + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_6e60) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6e60) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_47: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_6ed0) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6ed0) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_48: + ld a, $04 + ld [w_c329], a + ld [w_c326], a + ld [w_c32c], a + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + xor a + ld [w_c326], a + ld [w_c329], a + ld [w_c32c], a + ld [w_c327], a + ld [w_c32a], a + ld [w_c32d], a + ld a, $ff + ld [w_c330], a + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall function_02_4147 + farcall function_22_47e2 + call function_00_1085 + farcall function_02_5b98 + farcall function_02_5a82 + + ld a, LOW(string_02_6ee4) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6ee4) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_49: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_6f32) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6f32) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_50: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_6f96) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6f96) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_51: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_6fe2) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_6fe2) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_52: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + + ld a, 120 + ld [w_text_delay_timer], a + xor a + ld [w_cdb0], a + ld [w_cdaf], a + ld a, $0c + ld [w_cdac], a + ld a, $27 + ld [w_cdad], a + + ld a, LOW(tutorial_data_5b4e) + ld [w_cdb1 + 0], a + ld a, HIGH(tutorial_data_5b4e) + ld [w_cdb1 + 1], a + ld a, $05 + ld [w_cdb3], a + jp farcall_ret + +tutorial_data_5b4e: + db $08, $00, $00, $ee, $08, $00, $00, $ef, $08, $00, $00, $f0, $08, $00, $00, $ef, $00 + +tutorial_scene_53: + ld a, $00 + call function_00_17fb + farcall text_delay + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_702c) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_702c) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_54: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld hl, w_tutorial_scene + inc [hl] + + ld c, $17 + ld a, $02 + call function_00_0d91 + ld a, $01 + ld [w_d52e], a + farcall function_27_4bf4 + + ld a, 120 + ld [w_text_delay_timer], a + xor a + ld [w_cdb0], a + ld [w_cdaf], a + ld a, $0c + ld [w_cdac], a + ld a, $27 + ld [w_cdad], a + ld a, LOW(tutorial_data_5b4e) + ld [w_cdb1 + 0], a + ld a, HIGH(tutorial_data_5b4e) + ld [w_cdb1 + 1], a + ld a, $05 + ld [w_cdb3], a + jp farcall_ret + +tutorial_scene_55: + ld a, $00 + call function_00_17fb + farcall text_delay + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_708c) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_708c) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_56: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_70c2) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_70c2) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_57: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_710e) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_710e) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_58: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_7142) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_7142) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_59: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + + ld a, LOW(string_02_71be) + ld [w_text_cur_string + 0], a + ld a, HIGH(string_02_71be) + ld [w_text_cur_string + 1], a + + ld hl, w_tutorial_scene + inc [hl] + jp farcall_ret + +tutorial_scene_60: + farcall function_29_5de4 + farcall function_02_56c0 + farcall far_text_char_print + jp nz, farcall_ret + + ld a, BANK(function_02_5b77) + ld hl, function_02_5b77 + farcall wait_press_a_blink + + call function_00_1085 + farcall function_02_5b98 + farcall function_02_5a82 + ld a, $01 + ld [w_d647], a + jp farcall_ret diff --git a/tools/dump_data.py b/tools/dump_data.py new file mode 100755 index 0000000..52e5993 --- /dev/null +++ b/tools/dump_data.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +from sys import argv + +file = open("DMGAKVJ0.1", "rb").read() + +bank = int(argv[1], 16) +addr = int(argv[2], 16) +len = int(argv[3], 16) + +offset = addr +if bank > 0: + offset += 0x4000 * (bank - 1) + +print(" db ", end="") +for x in range(len): + print("$%02x, " % file[offset + x], end="") +print() |