From b986033a11f423a0b0b7696fc3f25c2a996b78aa Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 14 Sep 2020 13:10:31 -0400 Subject: =?UTF-8?q?Extract=20=E3=81=82=E3=81=9D=E3=81=B3=E3=81=8B=E3=81=9F?= =?UTF-8?q?=20"How=20to=20Play"=20graphics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gfx/how_to_play/how_to_play.png | Bin 0 -> 1425 bytes gfx/how_to_play/how_to_play_safari.png | Bin 0 -> 1551 bytes gfx/how_to_play/how_to_play_sgb.png | Bin 0 -> 375 bytes gfx/how_to_play/oak_mouth_sgb.png | Bin 0 -> 91 bytes source/bank_00.asm | 84 ++++++++++++++++++++++++++++++--- source/bank_05.asm | 2 +- source/bank_56.asm | 10 ++++ source/bank_78.asm | 7 ++- 8 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 gfx/how_to_play/how_to_play.png create mode 100644 gfx/how_to_play/how_to_play_safari.png create mode 100644 gfx/how_to_play/how_to_play_sgb.png create mode 100644 gfx/how_to_play/oak_mouth_sgb.png create mode 100644 source/bank_56.asm diff --git a/gfx/how_to_play/how_to_play.png b/gfx/how_to_play/how_to_play.png new file mode 100644 index 0000000..9b39ce1 Binary files /dev/null and b/gfx/how_to_play/how_to_play.png differ diff --git a/gfx/how_to_play/how_to_play_safari.png b/gfx/how_to_play/how_to_play_safari.png new file mode 100644 index 0000000..4c0664a Binary files /dev/null and b/gfx/how_to_play/how_to_play_safari.png differ diff --git a/gfx/how_to_play/how_to_play_sgb.png b/gfx/how_to_play/how_to_play_sgb.png new file mode 100644 index 0000000..e3b34a6 Binary files /dev/null and b/gfx/how_to_play/how_to_play_sgb.png differ diff --git a/gfx/how_to_play/oak_mouth_sgb.png b/gfx/how_to_play/oak_mouth_sgb.png new file mode 100644 index 0000000..a0d5851 Binary files /dev/null and b/gfx/how_to_play/oak_mouth_sgb.png differ diff --git a/source/bank_00.asm b/source/bank_00.asm index 1e7cc35..961107b 100644 --- a/source/bank_00.asm +++ b/source/bank_00.asm @@ -146,7 +146,7 @@ _start:: push af ld hl, _RAM ld bc, $2000 - 1 - call clear_mem + call mem_clear pop af ld [w_c358], a pop af @@ -276,7 +276,7 @@ function_00_0295:: push af ld hl, _RAM ld bc, $2000 - call clear_mem + call mem_clear pop af ld [w_c344], a pop af @@ -1174,21 +1174,93 @@ function_00_0d91:: pop af ret -SECTION "clear_mem", ROM0[$0f38] +SECTION "mem_clear", ROM0[$0f38] ; Zeroes out RAM ; Parameters: ; hl - dest ; bc - length -clear_mem:: +mem_clear:: xor a ld [hl+], a dec bc ld a, c or b - jr nz, clear_mem + jr nz, mem_clear + ret + +SECTION "copy functions", ROM0[$0f69] + +; Parameters: +; a - bank +; hl - source +; de - dest +; bc - length +mem_copy:: + 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 + +.loop + ld a, [hl+] + ld [de], a + inc de + dec bc + ld a, c + or b + jr nz, .loop + + pop af + ld [w_bank_rom], a + ld [rROMB0], a + ret + +; Parameters: +; a - bank +; hl - source +; de - dest +; bc - length +mem_mask:: + 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 + + srl b + rr c +.loop + push bc + ld a, [hl+] + ld b, a + or [hl] + xor $ff + ld c, a + ld a, [de] + and c + or b + ld [de], a + inc de + ld a, [de] + and c + or [hl] + ld [de], a + inc de + inc hl + pop bc + dec bc + ld a, c + or b + jr nz, .loop + + pop af + ld [w_bank_rom], a + ld [rROMB0], a ret -SECTION "vram_copy", ROM0[$0fbd] ; Parameters: ; a - bank ; hl - source diff --git a/source/bank_05.asm b/source/bank_05.asm index ed838ba..1496d3b 100644 --- a/source/bank_05.asm +++ b/source/bank_05.asm @@ -38,7 +38,7 @@ function_05_4028: call function_00_1bd5 ld hl, _VRAM ld bc, $1000 - call clear_mem + call mem_clear ld a, $00 call function_00_1bd5 .jr_005_4048 diff --git a/source/bank_56.asm b/source/bank_56.asm new file mode 100644 index 0000000..956e705 --- /dev/null +++ b/source/bank_56.asm @@ -0,0 +1,10 @@ +SECTION "gfx_how_to_play", ROMX[$4000], BANK[$56] +gfx_how_to_play:: +INCBIN "gfx/how_to_play/how_to_play.bin" +.end:: + +SECTION "gfx_how_to_play_sgb", ROMX[$7800], BANK[$56] +gfx_how_to_play_sgb:: +INCBIN "gfx/how_to_play/oak_mouth_sgb.bin" +INCBIN "gfx/how_to_play/how_to_play_sgb.bin" +.end:: diff --git a/source/bank_78.asm b/source/bank_78.asm index bb0b341..079ea83 100644 --- a/source/bank_78.asm +++ b/source/bank_78.asm @@ -1,4 +1,5 @@ -SECTION "gfx_lv_10_hanada_cave", ROMX[$4000], BANK[$78] +SECTION "bank78", ROMX[$4000], BANK[$78] + gfx_lv_10_hanada_cave:: INCBIN "gfx/town_map/lv_10_hanada_cave.bin" .end:: @@ -10,3 +11,7 @@ INCBIN "gfx/town_map/lv_10_hanada_cave_sgb.bin" gfx_lv_10_hanada_cave_duplicate:: INCBIN "gfx/town_map/lv_10_hanada_cave_unused.bin" .end:: + +gfx_how_to_play_safari:: +INCBIN "gfx/how_to_play/how_to_play_safari.bin" +.end:: -- cgit v1.2.3