summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2020-09-15 00:04:05 +0200
committermid-kid <esteve.varela@gmail.com>2020-09-15 00:04:05 +0200
commit74519ad9329de9492ef919f42c60f8e1d3ecc03f (patch)
treee394362f43c39be5e918a9786fb0e53a804deab7
parent884f8a986c893b8840661a60260b6be7f101c36c (diff)
parenteb2470a0e94d0393328f40354ee410d0cbf58a16 (diff)
Merge branch 'master' of github.com:mid-kid/pokepicross
-rw-r--r--gfx/how_to_play/how_to_play.attrmapbin0 -> 1024 bytes
-rw-r--r--gfx/how_to_play/how_to_play.pngbin1425 -> 1459 bytes
-rw-r--r--gfx/how_to_play/how_to_play.tilemapbin0 -> 1024 bytes
-rw-r--r--gfx/how_to_play/safari.attrmapbin0 -> 1024 bytes
-rw-r--r--gfx/how_to_play/safari.png (renamed from gfx/how_to_play/how_to_play_safari.png)bin1551 -> 1551 bytes
-rw-r--r--gfx/how_to_play/safari.tilemapbin0 -> 1024 bytes
-rw-r--r--gfx/how_to_play/safari.tilemap_attrmap.xorbin0 -> 850 bytes
-rw-r--r--gfx/menus/cancel_ok_no_yes.pngbin0 -> 456 bytes
-rw-r--r--gfx/safari_zone_album/picture_frames.pngbin0 -> 267 bytes
-rw-r--r--gfx/safari_zone_album/picture_frames_light.pngbin0 -> 251 bytes
-rw-r--r--gfx/unknown/unknown_6c_4000.pngbin0 -> 1047 bytes
-rw-r--r--gfx/unused/mario_wario.pngbin0 -> 3457 bytes
-rw-r--r--gfx/unused/marios_picross.pngbin0 -> 1445 bytes
-rw-r--r--gfx/unused/marios_picross_final.pngbin0 -> 886 bytes
-rw-r--r--gfx/unused/picross_2.pngbin0 -> 1868 bytes
-rw-r--r--gfx/unused/warios_picross.pngbin0 -> 1325 bytes
-rw-r--r--gfx/unused/warios_picross_final.pngbin0 -> 946 bytes
-rw-r--r--include/charmap.inc4
-rw-r--r--shim.sym14
-rw-r--r--source/bank_00.asm73
-rw-r--r--source/bank_57.asm5
-rw-r--r--source/bank_5e.asm4
-rw-r--r--source/bank_5f.asm10
-rw-r--r--source/bank_65.asm7
-rw-r--r--source/bank_6c.asm5
-rw-r--r--source/bank_6d.asm4
-rw-r--r--source/bank_70.asm7
-rw-r--r--source/bank_78.asm2
-rw-r--r--source/bank_79.asm5
-rw-r--r--source/bank_7c.asm5
-rw-r--r--source/bank_7e.asm11
-rw-r--r--source/bank_7f.asm11
-rw-r--r--tools/dump_decompress.py2
-rw-r--r--tools/xor_compress.py33
34 files changed, 180 insertions, 22 deletions
diff --git a/gfx/how_to_play/how_to_play.attrmap b/gfx/how_to_play/how_to_play.attrmap
new file mode 100644
index 0000000..56d1d73
--- /dev/null
+++ b/gfx/how_to_play/how_to_play.attrmap
Binary files differ
diff --git a/gfx/how_to_play/how_to_play.png b/gfx/how_to_play/how_to_play.png
index 9b39ce1..fe8f64c 100644
--- a/gfx/how_to_play/how_to_play.png
+++ b/gfx/how_to_play/how_to_play.png
Binary files differ
diff --git a/gfx/how_to_play/how_to_play.tilemap b/gfx/how_to_play/how_to_play.tilemap
new file mode 100644
index 0000000..36cb2df
--- /dev/null
+++ b/gfx/how_to_play/how_to_play.tilemap
Binary files differ
diff --git a/gfx/how_to_play/safari.attrmap b/gfx/how_to_play/safari.attrmap
new file mode 100644
index 0000000..9c70a58
--- /dev/null
+++ b/gfx/how_to_play/safari.attrmap
Binary files differ
diff --git a/gfx/how_to_play/how_to_play_safari.png b/gfx/how_to_play/safari.png
index 4c0664a..4c0664a 100644
--- a/gfx/how_to_play/how_to_play_safari.png
+++ b/gfx/how_to_play/safari.png
Binary files differ
diff --git a/gfx/how_to_play/safari.tilemap b/gfx/how_to_play/safari.tilemap
new file mode 100644
index 0000000..c7b7865
--- /dev/null
+++ b/gfx/how_to_play/safari.tilemap
Binary files differ
diff --git a/gfx/how_to_play/safari.tilemap_attrmap.xor b/gfx/how_to_play/safari.tilemap_attrmap.xor
new file mode 100644
index 0000000..2621f8e
--- /dev/null
+++ b/gfx/how_to_play/safari.tilemap_attrmap.xor
Binary files differ
diff --git a/gfx/menus/cancel_ok_no_yes.png b/gfx/menus/cancel_ok_no_yes.png
new file mode 100644
index 0000000..c41692c
--- /dev/null
+++ b/gfx/menus/cancel_ok_no_yes.png
Binary files differ
diff --git a/gfx/safari_zone_album/picture_frames.png b/gfx/safari_zone_album/picture_frames.png
new file mode 100644
index 0000000..9a5727c
--- /dev/null
+++ b/gfx/safari_zone_album/picture_frames.png
Binary files differ
diff --git a/gfx/safari_zone_album/picture_frames_light.png b/gfx/safari_zone_album/picture_frames_light.png
new file mode 100644
index 0000000..9c110f5
--- /dev/null
+++ b/gfx/safari_zone_album/picture_frames_light.png
Binary files differ
diff --git a/gfx/unknown/unknown_6c_4000.png b/gfx/unknown/unknown_6c_4000.png
new file mode 100644
index 0000000..ce7a5db
--- /dev/null
+++ b/gfx/unknown/unknown_6c_4000.png
Binary files differ
diff --git a/gfx/unused/mario_wario.png b/gfx/unused/mario_wario.png
new file mode 100644
index 0000000..c37ac63
--- /dev/null
+++ b/gfx/unused/mario_wario.png
Binary files differ
diff --git a/gfx/unused/marios_picross.png b/gfx/unused/marios_picross.png
new file mode 100644
index 0000000..b8ef682
--- /dev/null
+++ b/gfx/unused/marios_picross.png
Binary files differ
diff --git a/gfx/unused/marios_picross_final.png b/gfx/unused/marios_picross_final.png
new file mode 100644
index 0000000..4aa6df2
--- /dev/null
+++ b/gfx/unused/marios_picross_final.png
Binary files differ
diff --git a/gfx/unused/picross_2.png b/gfx/unused/picross_2.png
new file mode 100644
index 0000000..4b59a63
--- /dev/null
+++ b/gfx/unused/picross_2.png
Binary files differ
diff --git a/gfx/unused/warios_picross.png b/gfx/unused/warios_picross.png
new file mode 100644
index 0000000..2819b9a
--- /dev/null
+++ b/gfx/unused/warios_picross.png
Binary files differ
diff --git a/gfx/unused/warios_picross_final.png b/gfx/unused/warios_picross_final.png
new file mode 100644
index 0000000..9fd4d8d
--- /dev/null
+++ b/gfx/unused/warios_picross_final.png
Binary files differ
diff --git a/include/charmap.inc b/include/charmap.inc
index ee1cf1d..72b2490 100644
--- a/include/charmap.inc
+++ b/include/charmap.inc
@@ -322,3 +322,7 @@ charmap "~", 240
TX_LF EQU -2 ; Line feed
TX_END EQU -1 ; End of message
+
+pushc
+newcharmap ascii
+popc
diff --git a/shim.sym b/shim.sym
index d194ebd..feb81f5 100644
--- a/shim.sym
+++ b/shim.sym
@@ -1,6 +1,14 @@
-00:04c5 lcd
-00:0531 timer
-00:0533 joypad
+00:13f0 lcd_function_1
+00:142e lcd_function_2
+00:144b lcd_function_3
+00:1466 lcd_function_4
+00:1481 lcd_function_5
+00:1496 lcd_function_6
+00:1545 lcd_function_7
+00:1719 lcd_function_8
+00:173c lcd_function_9
+00:162f lcd_function_a
+00:1776 lcd_function_b
00:0df5 function_00_0df5
00:0ecf function_00_0ecf
diff --git a/source/bank_00.asm b/source/bank_00.asm
index 961107b..05c1d18 100644
--- a/source/bank_00.asm
+++ b/source/bank_00.asm
@@ -484,6 +484,79 @@ function_00_0458::
pop af
ret
+unknown_00_0475:: ; ???
+ db 8,8,8,8, 8,8,8,8, 8,8,8,8, 8,8,8,8
+ db 8,8,8,0, 8,8,8,0, 8,8,8,0, 8,8,8,0
+ db 8,0,8,0, 8,0,8,0, 8,0,8,0, 8,0,8,0
+ db 8,0,0,8, 0,0,8,0, 0,8,0,0, 8,0,0,8
+ db 0,8,0,0, 0,8,0,0, 0,8,0,0, 0,8,0,0
+
+lcd::
+ push af
+ push bc
+ push de
+ push hl
+
+ ld hl, .return
+ push hl
+
+ ld a, [w_c340]
+ sla a
+ ld c, a
+ ld b, 0
+ ld hl, .pointers
+ add hl, bc
+ ld c, [hl]
+ inc hl
+ ld b, [hl]
+ push bc
+ pop hl
+ jp hl
+
+.return:
+ ld hl, w_c343
+ inc [hl]
+ ld hl, rSTAT
+.hblank_enter
+ ld a, STATF_LCD
+ and [hl]
+ jr nz, .hblank_enter
+
+ pop hl
+ pop de
+ pop bc
+ pop af
+rept 40
+ nop
+endr
+ reti
+
+.pointers:
+ const_def
+ const_dw LCD_FUNCTION_0, lcd_function_0
+ const_dw LCD_FUNCTION_1, lcd_function_1
+ const_dw LCD_FUNCTION_2, lcd_function_2
+ const_dw LCD_FUNCTION_3, lcd_function_3
+ const_dw LCD_FUNCTION_4, lcd_function_4
+ const_dw LCD_FUNCTION_5, lcd_function_5
+ const_dw LCD_FUNCTION_6, lcd_function_6
+ const_dw LCD_FUNCTION_7, lcd_function_7
+ const_dw LCD_FUNCTION_8, lcd_function_8
+ const_dw LCD_FUNCTION_9, lcd_function_9
+ const_dw LCD_FUNCTION_A, lcd_function_a
+ const_dw LCD_FUNCTION_B, lcd_function_b
+
+lcd_function_0::
+ ret ; unused
+
+timer::
+ reti
+
+ reti ; unused
+
+joypad::
+ reti
+
SECTION "vwf_draw_char", ROM0[$0723]
vwf_char_draw::
ld a, [w_vwf_char_start_x]
diff --git a/source/bank_57.asm b/source/bank_57.asm
index 85ce178..93cc7f9 100644
--- a/source/bank_57.asm
+++ b/source/bank_57.asm
@@ -2,3 +2,8 @@ SECTION "gfx_text_chars_light", ROMX[$4000], BANK[$57]
gfx_text_chars_light::
INCBIN "gfx/fonts/text_chars_light.bin"
.end::
+
+SECTION "tilemap_how_to_play", ROMX[$7c00], BANK[$57]
+tilemap_how_to_play::
+INCBIN "gfx/how_to_play/how_to_play.tilemap"
+.end::
diff --git a/source/bank_5e.asm b/source/bank_5e.asm
new file mode 100644
index 0000000..a0d0d1e
--- /dev/null
+++ b/source/bank_5e.asm
@@ -0,0 +1,4 @@
+SECTION "compressed_tilemap_attrmap_how_to_play_safari", ROMX[$7c00], BANK[$5e]
+compressed_tilemap_attrmap_how_to_play_safari::
+INCBIN "gfx/how_to_play/safari.tilemap_attrmap.xor"
+.end::
diff --git a/source/bank_5f.asm b/source/bank_5f.asm
new file mode 100644
index 0000000..39e9a7e
--- /dev/null
+++ b/source/bank_5f.asm
@@ -0,0 +1,10 @@
+SECTION "unused_gfx_picross_2", ROMX[$4000], BANK[$5f]
+unused_gfx_picross_2::
+INCBIN "gfx/unused/mario_wario.bin"
+.end::
+
+SECTION "unused_gfx_picross_2_finals", ROMX[$6c00], BANK[$5f]
+unused_gfx_picross_2_finals::
+INCBIN "gfx/unused/marios_picross_final.bin"
+INCBIN "gfx/unused/warios_picross_final.bin"
+.end::
diff --git a/source/bank_65.asm b/source/bank_65.asm
index 1aa9d0d..f3e15a6 100644
--- a/source/bank_65.asm
+++ b/source/bank_65.asm
@@ -1,4 +1,9 @@
-SECTION "gfx_font_2", ROMX[$7000], BANK[$65]
+SECTION "bank65", ROMX[$4000], BANK[$65]
+
+gfx_album_picture_frames::
+INCBIN "gfx/safari_zone_album/picture_frames.bin"
+.end::
+
gfx_font_2::
INCBIN "gfx/fonts/font_2.bin"
.end::
diff --git a/source/bank_6c.asm b/source/bank_6c.asm
index 205b1d6..da55e0e 100644
--- a/source/bank_6c.asm
+++ b/source/bank_6c.asm
@@ -1,3 +1,8 @@
+SECTION "gfx_unknown_6c_4000", ROMX[$4000], BANK[$6c]
+gfx_unknown_6c_4000::
+INCBIN "gfx/unknown/unknown_6c_4000.bin"
+.end::
+
SECTION "compressed_tilemap_attrmap_pokedex_pic", ROMX[$7c00], BANK[$6c]
compressed_tilemap_attrmap_pokedex_pic::
INCBIN "gfx/pokedex/pokedex_pic.tilemap_attrmap.xor"
diff --git a/source/bank_6d.asm b/source/bank_6d.asm
new file mode 100644
index 0000000..a797818
--- /dev/null
+++ b/source/bank_6d.asm
@@ -0,0 +1,4 @@
+SECTION "gfx_album_picture_frames_light", ROMX[$4000], BANK[$6d]
+gfx_album_picture_frames_light::
+INCBIN "gfx/safari_zone_album/picture_frames_light.bin"
+.end::
diff --git a/source/bank_70.asm b/source/bank_70.asm
index bb21991..5b83df2 100644
--- a/source/bank_70.asm
+++ b/source/bank_70.asm
@@ -1,3 +1,10 @@
+SECTION "unused_gfx_picross_2_levels", ROMX[$4000], BANK[$70]
+unused_gfx_picross_2_levels::
+INCBIN "gfx/unused/picross_2.bin"
+INCBIN "gfx/unused/marios_picross.bin"
+INCBIN "gfx/unused/warios_picross.bin"
+.end::
+
SECTION "gfx_lv_2_lake_zone", ROMX[$64c0], BANK[$70]
gfx_lv_2_lake_zone::
INCBIN "gfx/safari_map/lv_2_lake_zone.bin"
diff --git a/source/bank_78.asm b/source/bank_78.asm
index 079ea83..38358ae 100644
--- a/source/bank_78.asm
+++ b/source/bank_78.asm
@@ -13,5 +13,5 @@ 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"
+INCBIN "gfx/how_to_play/safari.bin"
.end::
diff --git a/source/bank_79.asm b/source/bank_79.asm
index a541b0d..a475765 100644
--- a/source/bank_79.asm
+++ b/source/bank_79.asm
@@ -1,3 +1,8 @@
+SECTION "gfx_cancel_ok_no_yes", ROMX[$4000], BANK[$79]
+gfx_cancel_ok_no_yes::
+INCBIN "gfx/menus/cancel_ok_no_yes.bin"
+.end::
+
SECTION "compressed_tilemap_attrmap_town_map", ROMX[$5800], BANK[$79]
compressed_tilemap_attrmap_town_map::
INCBIN "gfx/town_map/town_map.tilemap_attrmap.xor"
diff --git a/source/bank_7c.asm b/source/bank_7c.asm
index 230ae4c..66c200b 100644
--- a/source/bank_7c.asm
+++ b/source/bank_7c.asm
@@ -3,6 +3,11 @@ gfx_alphabets::
INCBIN "gfx/fonts/alphabets.bin"
.end::
+SECTION "attrmap_how_to_play", ROMX[$5c00], BANK[$7c]
+attrmap_how_to_play::
+INCBIN "gfx/how_to_play/how_to_play.attrmap"
+.end::
+
SECTION "compressed_tilemap_attrmap_album_pic", ROMX[$7000], BANK[$7c]
compressed_tilemap_attrmap_album_pic::
INCBIN "gfx/safari_zone_album/album_pic.tilemap_attrmap.xor"
diff --git a/source/bank_7e.asm b/source/bank_7e.asm
new file mode 100644
index 0000000..aacb3e5
--- /dev/null
+++ b/source/bank_7e.asm
@@ -0,0 +1,11 @@
+INCLUDE "charmap.inc"
+
+SECTION "ASCII credits 1", ROMX[$4010], BANK[$7e]
+
+pushc
+setcharmap ascii
+ db "DSEQLITE", 0
+ db $01
+ db "CRTS(C) mcmxcvi by Toshiyuki Ueno", 0
+ db "toshi-u@tau.bekkoame.or.jp", 0
+popc
diff --git a/source/bank_7f.asm b/source/bank_7f.asm
new file mode 100644
index 0000000..b07a270
--- /dev/null
+++ b/source/bank_7f.asm
@@ -0,0 +1,11 @@
+INCLUDE "charmap.inc"
+
+SECTION "ASCII credits 2", ROMX[$4010], BANK[$7f]
+
+pushc
+setcharmap ascii
+ db "DSEQLITE", 0
+ db $01
+ db "CRTS(C) mcmxcvi by Toshiyuki Ueno", 0
+ db "toshi-u@tau.bekkoame.or.jp", 0
+popc
diff --git a/tools/dump_decompress.py b/tools/dump_decompress.py
index 2776c2b..0fcc897 100644
--- a/tools/dump_decompress.py
+++ b/tools/dump_decompress.py
@@ -10,7 +10,7 @@ bank_addr = argv[1].split(':')
bank = int(bank_addr[0], 16)
addr = int(bank_addr[1], 16)
length = int(argv[2], 16)
-offset = bank * 0x4000 + addr - (0x4000 if bank else 0)
+offset = bank * 0x4000 + (addr & 0x3fff)
output = []
i = offset
diff --git a/tools/xor_compress.py b/tools/xor_compress.py
index 30418db..6deb2aa 100644
--- a/tools/xor_compress.py
+++ b/tools/xor_compress.py
@@ -1,46 +1,47 @@
#!/usr/bin/env python3
-# Usage: ./xor_compress.py [source.bin] [dest.bin.xor]
+# Usage: ./xor_compress.py sources.bin... > dest.bin.xor
import sys
-with (open(sys.argv[1], 'rb') if len(sys.argv) > 1 else sys.stdin) as f:
- data = f.read()
+data = bytearray()
+for filename in sys.argv[1:]:
+ with open(filename, 'rb') as f:
+ data.extend(f.read())
n = len(data)
-output = []
-v = 0
+output = bytearray()
+v = 0x00
i = 0
while i < n:
- val = data[i]
+ byte = data[i]
i += 1
- if data[i] == v: #>=0x80
+ if data[i] == v:
# Alternating (>= 0x80)
# Run stops at 0x81 bytes or when the values stop alternating
size = 1
- while i < n and size < 0x81 and data[i] == (v if size % 2 else val):
+ while i < n and size < 0x81 and data[i] == (v if size % 2 else byte):
size += 1
i += 1
output.append(size + 0x7e)
- output.append(v ^ val)
+ output.append(v ^ byte)
if size % 2:
- v = val
+ v = byte
else:
# Sequential (< 0x80)
# Run stops at 0x80 bytes or when the value two ahead is equal to v
- buffer = [v ^ val]
+ buffer = [v ^ byte]
while i < n:
- v = val
+ v = byte
if len(buffer) > 0x7f or (i + 1 < n and data[i + 1] == v):
break
- val = data[i]
- buffer.append(v ^ val)
+ byte = data[i]
+ buffer.append(v ^ byte)
i += 1
output.append(len(buffer) - 1)
output.extend(buffer)
-with (open(sys.argv[2], 'wb') if len(sys.argv) > 2 else sys.stdout) as f:
- f.write(bytes(output))
+sys.stdout.buffer.write(output)