summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-09-14 13:10:31 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-09-14 13:10:31 -0400
commitb986033a11f423a0b0b7696fc3f25c2a996b78aa (patch)
tree49d9d40f98fa9dc8ee39f9b3e2b6a41907657364
parent387bb7be2149599ba5ae7420fe3760e7f5e2656f (diff)
Extract あそびかた "How to Play" graphics
-rw-r--r--gfx/how_to_play/how_to_play.pngbin0 -> 1425 bytes
-rw-r--r--gfx/how_to_play/how_to_play_safari.pngbin0 -> 1551 bytes
-rw-r--r--gfx/how_to_play/how_to_play_sgb.pngbin0 -> 375 bytes
-rw-r--r--gfx/how_to_play/oak_mouth_sgb.pngbin0 -> 91 bytes
-rw-r--r--source/bank_00.asm84
-rw-r--r--source/bank_05.asm2
-rw-r--r--source/bank_56.asm10
-rw-r--r--source/bank_78.asm7
8 files changed, 95 insertions, 8 deletions
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
--- /dev/null
+++ b/gfx/how_to_play/how_to_play.png
Binary files 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
--- /dev/null
+++ b/gfx/how_to_play/how_to_play_safari.png
Binary files 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
--- /dev/null
+++ b/gfx/how_to_play/how_to_play_sgb.png
Binary files 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
--- /dev/null
+++ b/gfx/how_to_play/oak_mouth_sgb.png
Binary files 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::