aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/manifest2header.awk13
-rwxr-xr-xscripts/tiled.mk.awk16
-rwxr-xr-xscripts/tilemap2png47
-rwxr-xr-xscripts/tilemap2tiled42
-rwxr-xr-xscripts/tilepack22
-rw-r--r--src/engine/animator.c28
-rw-r--r--src/engine/animator.h2
-rw-r--r--src/engine/level_const.c6
-rw-r--r--src/engine/player_controller.c2
-rw-r--r--src/engine/sprite_controller.h29
-rw-r--r--src/engine/title_screen.c6
-rw-r--r--src/game_loop/gameplay.c9
-rw-r--r--src/game_loop/shop.c40
-rw-r--r--src/game_loop/shop.h6
-rw-r--r--src/makefile14
-rw-r--r--src/ppu/consts.h6
-rw-r--r--src/ppu/ppu.c24
-rw-r--r--src/ppu/ppu.h3
-rw-r--r--src/ppusim/sim.c33
-rw-r--r--src/ppusim/sim.h4
-rw-r--r--src/static/.gitignore9
-rw-r--r--src/static/Source.cpp42
-rw-r--r--src/static/air.hex17
-rw-r--r--src/static/background/bricks.hex457
-rw-r--r--src/static/background/crates.hex39
-rw-r--r--src/static/background/shop_stall.hex202
-rw-r--r--src/static/epic.py41
-rw-r--r--src/static/foreground/bullet.hex58
-rw-r--r--src/static/foreground/gozer.hex39
-rw-r--r--src/static/makefile50
-rw-r--r--src/static/shop.hex331
-rw-r--r--src/static/slime.hex24
-rw-r--r--src/static/world.h1
-rw-r--r--src/static/world.hex514
-rw-r--r--src/stm32/setup.c4
-rw-r--r--src/tilemap.h7
36 files changed, 2102 insertions, 85 deletions
diff --git a/scripts/manifest2header.awk b/scripts/manifest2header.awk
new file mode 100755
index 0000000..15cd682
--- /dev/null
+++ b/scripts/manifest2header.awk
@@ -0,0 +1,13 @@
+#!/bin/awk -f
+BEGIN {
+ offset = 0
+ print "#pragma once"
+}
+1 {
+ print "#define HH_TM_"toupper($1)"_OFFSET "offset
+ print "#define HH_TM_"toupper($1)"_SIZE "$2
+ offset += $2
+}
+END {
+ print "#define HH_TM_SIZE "offset
+}
diff --git a/scripts/tiled.mk.awk b/scripts/tiled.mk.awk
new file mode 100755
index 0000000..7728cf3
--- /dev/null
+++ b/scripts/tiled.mk.awk
@@ -0,0 +1,16 @@
+#!/bin/awk -f
+BEGIN {
+ targets=""
+ print "tiled_dir:\n\tmkdir -p tiled"
+}
+1 {
+ for (i = 0; i < $2; i++) {
+ target = sprintf("tiled/%s_%02d.png", $1,i)
+ printf target" "
+ targets = targets" "target
+ }
+ printf "&: %s.bin\n",$1
+ printf "\t$(TILEMAP2TILED) $<\n\n"
+}
+END { print "tiled: tiled_dir"targets }
+
diff --git a/scripts/tilemap2png b/scripts/tilemap2png
new file mode 100755
index 0000000..e37bfab
--- /dev/null
+++ b/scripts/tilemap2png
@@ -0,0 +1,47 @@
+#!/bin/python3
+# read packed tilemap file from stdin and output png on stdout
+
+import sys
+import io
+import struct
+from PIL import Image
+
+color_map = (
+ (0x00, 0x00, 0x00),
+ (0x24, 0x24, 0x24),
+ (0x49, 0x49, 0x49),
+ (0x6d, 0x6d, 0x6d),
+ (0x92, 0x92, 0x92),
+ (0xb6, 0xb6, 0xb6),
+ (0xda, 0xda, 0xda),
+ (0xff, 0xff, 0xff),
+)
+
+buf = []
+for byte in sys.stdin.buffer.read():
+ buf.append(byte)
+
+size_horizontal = 16 * 16
+size_vertical = ((len(buf) // 104) // 16 + 1) * 16
+img = Image.new('RGB', (size_horizontal, size_vertical))
+
+i = 0
+sprite_idx = 0
+for x in range(0, len(buf), 2):
+ word = 0x0000
+ word |= buf[x]
+ word |= buf[x+1] << 8
+
+ for p in range(5):
+ img.putpixel(((i % 16) + (16 * (sprite_idx % 16)), (i // 16) + (16 * (sprite_idx // 16))), color_map[(word >> (p * 3)) & 0b111])
+ i += 1
+ if i > 0xff:
+ i = 0
+ sprite_idx += 1
+ break
+
+with io.BytesIO() as out:
+ img.save(out, format="PNG")
+ sys.stdout.buffer.write(out.getvalue())
+ sys.stdout.buffer.flush()
+
diff --git a/scripts/tilemap2tiled b/scripts/tilemap2tiled
new file mode 100755
index 0000000..905f801
--- /dev/null
+++ b/scripts/tilemap2tiled
@@ -0,0 +1,42 @@
+#!/bin/python3
+# read packed tilemap file from argv[1] and output pngs
+
+import sys
+import io
+import struct
+from PIL import Image
+
+color_map = (
+ (0x00, 0x00, 0x00),
+ (0x24, 0x24, 0x24),
+ (0x49, 0x49, 0x49),
+ (0x6d, 0x6d, 0x6d),
+ (0x92, 0x92, 0x92),
+ (0xb6, 0xb6, 0xb6),
+ (0xda, 0xda, 0xda),
+ (0xff, 0xff, 0xff),
+)
+
+img = Image.new('RGB', (16, 16))
+
+buf = ""
+with open(sys.argv[1], "rb") as f:
+ buf = f.read()
+
+i = 0
+sprite_idx = 0
+for x in range(0, len(buf), 2):
+ word = 0x0000
+ word |= buf[x]
+ word |= buf[x+1] << 8
+
+ for p in range(5):
+ img.putpixel((i % 16, i // 16), color_map[(word >> (p * 3)) & 0b111])
+ i += 1
+ if i > 0xff:
+ i = 0
+ img.save(f"tiled/{sys.argv[1].replace('.bin','')}_{str(sprite_idx).zfill(2)}.png", format="PNG")
+ img = Image.new('RGB', (16, 16))
+ sprite_idx += 1
+ break
+
diff --git a/scripts/tilepack b/scripts/tilepack
new file mode 100755
index 0000000..a07cbb6
--- /dev/null
+++ b/scripts/tilepack
@@ -0,0 +1,22 @@
+#!/bin/python3
+# read bytes from input and pack into ppu format
+# each input sprite is 256 bytes
+
+import sys
+import struct
+
+i = 0
+word = 0x0000
+for byte in sys.stdin.buffer.read():
+ pixel_idx = i % 5
+ word |= (byte & 0b111) << 3 * pixel_idx
+
+ if pixel_idx == 4 or i == 0xff:
+ sys.stdout.buffer.write(struct.pack('<H', word))
+ word = 0x0000
+
+ i += 1
+ if i > 0xff: i = 0
+
+sys.stdout.buffer.flush()
+
diff --git a/src/engine/animator.c b/src/engine/animator.c
index 1af8dde..3d46ea0 100644
--- a/src/engine/animator.c
+++ b/src/engine/animator.c
@@ -23,33 +23,19 @@ void hh_animate(hh_s_rendering* in, uint16_t start, uint16_t end, uint8_t step)
}
}
-//TODO: if entity not inside of screen, don't update idx
-uint16_t hh_update_sprite(uint16_t idx, hh_entity* in, vec_cor cam) {
+//TODO: if entity not inside of screen, don't update idx (problems with old idx not being overwritten anymore)
+void hh_update_sprite(uint16_t *idx, hh_entity* in, vec_cor cam) {
hh_animate_hit(&in->render, in->is_hit);
hh_s_ppu_loc_fam_entry temp = in->render.fam;
for (int y = 0; y < CEILI(in->size.y,16); y++) {
temp.position_y = CLAMP(in->pos.y - cam.y + y*HH_PPU_SPRITE_HEIGHT, -16, HH_PPU_SCREEN_HEIGHT);
for (int x = 0; x < CEILI(in->size.x,16); x++) {
temp.position_x = CLAMP(in->pos.x - cam.x + x*HH_PPU_SPRITE_WIDTH, -16, HH_PPU_SCREEN_WIDTH);
- hh_ppu_update_foreground(++idx, temp);
- temp.tilemap_index++;
+ // if (temp.position_x != -16 && temp.position_y != -16) {// removes redundant sprites
+ hh_ppu_update_foreground(++*idx, temp);
+ temp.tilemap_index++;
+ // hh_animate(&in->render, start+counter,end+counter,4);
+ // }
}
}
- return idx;
}
-
-
-// void hh_update_sprite(hh_entity* in, vec_cor cam) {
-// hh_animate_hit(&in->render, in->is_hit);
-// // uint16_t idx = in->render.ppu_foreground_index;
-// uint16_t idx = 0;
-// hh_s_ppu_loc_fam_entry temp = in->render.fam;
-// for (int y = 0; y < CEILI(in->size.y,16); y++) {
-// temp.position_y = CLAMP(in->pos.y - cam.y + y*HH_PPU_SPRITE_HEIGHT, -16, HH_PPU_SCREEN_HEIGHT);
-// for (int x = 0; x < CEILI(in->size.x,16); x++) {
-// temp.position_x = CLAMP(in->pos.x - cam.x + x*HH_PPU_SPRITE_WIDTH, -16, HH_PPU_SCREEN_WIDTH);
-// hh_ppu_update_foreground(idx++, temp);
-// temp.tilemap_index++;
-// }
-// }
-// }
diff --git a/src/engine/animator.h b/src/engine/animator.h
index 10fa321..2f6e00d 100644
--- a/src/engine/animator.h
+++ b/src/engine/animator.h
@@ -11,4 +11,4 @@ void hh_animate_hit(hh_s_rendering*, bool hit);
void hh_animate(hh_s_rendering*, uint16_t start, uint16_t end, uint8_t step);
/** @brief passively updates sprite*/
-uint16_t hh_update_sprite(uint16_t idx, hh_entity* in, vec_cor cam);
+void hh_update_sprite(uint16_t* idx, hh_entity* in, vec_cor cam);
diff --git a/src/engine/level_const.c b/src/engine/level_const.c
index 896d0e0..642a474 100644
--- a/src/engine/level_const.c
+++ b/src/engine/level_const.c
@@ -7,16 +7,16 @@ hh_g_all_levels hh_init_game_levels(){
levels.current_level=0;
levels.level[0].size.x=40;
- levels.level[0].size.y=100;
+ levels.level[0].size.y=15;
levels.level[0].hh_level_completed=false;
levels.level[1].size.x=100;
levels.level[1].size.y=28;
levels.level[1].hh_level_completed=false;
- FILE *fp = fopen("../test/bin/level1_test.bin", "rb");
+ FILE *fp = fopen("static/shop_new.bin", "rb");
if (fp == NULL) {
- printf("level1_test.bin not found!\n");
+ printf("shop_new.bin not found!\n");
return levels;
}
fseek(fp, 0, SEEK_END);
diff --git a/src/engine/player_controller.c b/src/engine/player_controller.c
index 83c5966..6400b02 100644
--- a/src/engine/player_controller.c
+++ b/src/engine/player_controller.c
@@ -5,6 +5,8 @@
#include "engine/player_controller.h"
#include "input.h"
+#include "static/tilemap.h"
+
#include "engine/animator.h"
#include "engine/bullet.h"
void hh_player_actions(hh_entity* player){
diff --git a/src/engine/sprite_controller.h b/src/engine/sprite_controller.h
index fc6d3d3..d89b068 100644
--- a/src/engine/sprite_controller.h
+++ b/src/engine/sprite_controller.h
@@ -12,9 +12,10 @@
//TODO: pack data inside of sprite_palette LUT
//HH_PPU_PALETTE_COUNT
#define HH_SPRITE_COUNT 80
-#define HH_PAL_IDX_SKY 512
+#define HH_PAL_IDX_SKY 0
#define HH_PAL_IDX_BRICK 1
const static uint8_t hh_g_sprite_palette[HH_SPRITE_COUNT] = {
+ //TODO: FIGURE OUT HOW TO DEAL WITH DYNAMIC PALLETS
//TODO: make a buffer of 16 no-collider sprites (instead of the current 1)
0,1,1,1,1,1,1,1,1,1, //1+9
1,1,1,1,1,1,1,1,1,1, //6+4
@@ -47,13 +48,13 @@ const static hh_ppu_loc_palette_table_t hh_g_palette = {
{0x0,0x0,0x0}},
{//Bricks
{0x1,0x2,0x3},//01
- {0xd,0x8,0xa},//24
{0x0,0x0,0x1},//25
{0x1,0x1,0x1},//26
{0x1,0x1,0x2},//27
{0x2,0x2,0x3},//28
{0x3,0x4,0x5},//29
- {0x5,0x1,0x7}},
+ {0x5,0x1,0x7},
+ {0xd,0x8,0xa}},//24
{//slime
{0x1,0x2,0x3},
{0x1,0x3,0x2},
@@ -69,19 +70,19 @@ const static hh_ppu_loc_palette_table_t hh_g_palette = {
{0x4,0x2,0x5},
{0x7,0x3,0x7},
{0xe,0xe,0xe},
- {0xe,0xe,0xe}, //elemental
- {0x0,0x0,0x0},
- {0x0,0x0,0x0}},
- {
- {0x0,0x0,0x0},
- {0x0,0x0,0x0},
- {0x0,0x0,0x0},
- {0x0,0x0,0x0},
- {0x0,0x0,0x0},
+ {0x7,0x2,0x3}, //elemental
+ {0xc,0x5,0x3},
+ {0xe,0xc,0x7}},
+ {//crates
+ {0x5,0x7,0x7},
+ {0x3,0x1,0x2},
+ {0x6,0x2,0x2},
+ {0x7,0x4,0x4},
+ {0xa,0x7,0x5},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0}},
- {//elemental
+ {
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
@@ -112,7 +113,9 @@ const static hh_ppu_loc_palette_table_t hh_g_palette = {
void hh_setup_palettes();
+//TODO: UPDATE THIS FUNCTION
/** @brief return palette index that belongs to tilemap index */
uint8_t hh_get_palette(uint8_t tile_idx);
+//TODO: UPDATE THIS FUNCTION
bool hh_colidable(uint8_t tile_idx);
diff --git a/src/engine/title_screen.c b/src/engine/title_screen.c
index 9c7ed48..1e9e586 100644
--- a/src/engine/title_screen.c
+++ b/src/engine/title_screen.c
@@ -2,6 +2,8 @@
#include "ppu/types.h"
#include "ppu/consts.h"
+#include "static/tilemap.h"
+
#include "engine/draw_screen.h"
#include "engine/entity.h"
@@ -12,7 +14,7 @@ void hh_init_title_screen(){
//send data
uint8_t idx = 0;
- const uint8_t tilemap_offset = 59;
+ const uint8_t tilemap_offset = HH_TM_TITLE_SCREEN_ICON_OFFSET;
int tiles_h = HH_PPU_BG_CANVAS_TILES_H;
int vp_h = HH_PPU_SCREEN_WIDTH/HH_PPU_SPRITE_WIDTH; //screen_h in tiles
int vert_offset = tiles_h*3;
@@ -45,7 +47,7 @@ void hh_init_title_screen(){
}
- const uint8_t letters_offset = 66;
+ const uint8_t letters_offset = HH_TM_TITLE_SCREEN_LETTERES_LARGE_OFFSET;
const int _size_hooded = 7, _size_v = 2;
// char* hh = "hooded";
diff --git a/src/game_loop/gameplay.c b/src/game_loop/gameplay.c
index da029f3..2950870 100644
--- a/src/game_loop/gameplay.c
+++ b/src/game_loop/gameplay.c
@@ -1,5 +1,6 @@
#include "gameplay.h"
#include "engine/entity.h"
+#include "static/tilemap.h"
// player struct
@@ -16,13 +17,13 @@ void hh_gameplay(hh_g_all_levels* game, hh_e_game_state* hh_game_state){
.size = (vec2){32,32},
.vel = (vec2){0,0},
.render = {
- .frame0 = 3,
+ .frame0 = HH_TM_GOZER_OFFSET,
.palette = 3,
.fam = (hh_s_ppu_loc_fam_entry){
.horizontal_flip = false,
.vertical_flip = false,
.palette_index = 3,
- .tilemap_index = 80,
+ .tilemap_index = HH_TM_GOZER_OFFSET,
}
}
};
@@ -38,13 +39,13 @@ void hh_gameplay(hh_g_all_levels* game, hh_e_game_state* hh_game_state){
.vel = (vec2){0,0},
// .vec = (vec2){0,0},
.render = {
- .frame0 = 1,
+ .frame0 = HH_TM_SLIME_OFFSET,
.palette = 7,
.fam = (hh_s_ppu_loc_fam_entry){
.horizontal_flip = false,
.vertical_flip = false,
.palette_index = 7,
- .tilemap_index = 1,
+ .tilemap_index = HH_TM_SLIME_OFFSET,
}
}
};
diff --git a/src/game_loop/shop.c b/src/game_loop/shop.c
index ea75d46..eb41248 100644
--- a/src/game_loop/shop.c
+++ b/src/game_loop/shop.c
@@ -6,6 +6,7 @@ void hh_shop(hh_e_game_state* hh_game_state){
static hh_e_shop_states hh_e_shop = hh_e_shop_show;
static hh_e_upgrades upgrades[HH_SHOP_UPG_DISPLAY] = {0};
static uint8_t selected = 0;
+ static bool pressed_LR = false;
switch (hh_e_shop)
{
@@ -13,26 +14,32 @@ void hh_shop(hh_e_game_state* hh_game_state){
hh_clear_screen();
hh_clear_sprite();
// TODO: make function to show shop
+ // hh_setup_screen();
//hh_setup_shop();
hh_shop_init(&upgrades);
selected = HH_SHOP_UPG_DISPLAY/2;
- // hh_shop_display(selected, &upgrades);
+ hh_shop_display(selected, &upgrades);
hh_e_shop = hh_e_shop_main;
break;
case hh_e_shop_main:
if(g_hh_controller_p1.dpad_left || g_hh_controller_p1.dpad_right){
- hh_shift_selected(&selected,(g_hh_controller_p1.dpad_right?1:0),0,HH_SHOP_UPG_DISPLAY);
- // hh_shop_display(selected, &upgrades);
+ if (!pressed_LR) {
+ hh_shift_selected(&selected,(g_hh_controller_p1.dpad_right?1:0),0,HH_SHOP_UPG_DISPLAY-1);
+ hh_shop_display(selected, &upgrades);
+ }
+ pressed_LR = true;
+ } else {
+ pressed_LR = false;
+ }
+ if(g_hh_controller_p1.button_primary){
+ //apply selected upgrade
+ hh_e_shop = hh_e_shop_end;
}
- // if(g_hh_controller_p1.button_primary){
- // //apply selected upgrade
- // hh_e_shop = hh_e_shop_end;
- // }
if(g_hh_controller_p1.button_secondary){//Quick exit
hh_e_shop = hh_e_shop_end;
}
break;
- case hh_e_shop_end:
+ case hh_e_shop_end: // delay?
hh_e_shop = hh_e_shop_show;
*hh_game_state = hh_e_state_gameplay;
break;
@@ -42,6 +49,10 @@ void hh_shop(hh_e_game_state* hh_game_state){
}
}
+uint8_t hh_shop_translate_upgrades(hh_e_upgrades upg) {
+ return upg+10;
+}
+
void hh_shop_init(hh_e_upgrades* in) {
for (int i = 0; i < HH_SHOP_UPG_DISPLAY; i++) {
in[i] = i%HH_SHOP_UPG_COUNT;
@@ -57,20 +68,19 @@ void hh_shop_display(uint8_t selected, hh_e_upgrades* upgrades) {
hh_ppu_update_foreground(i+16,
(hh_s_ppu_loc_fam_entry){
.horizontal_flip = false, .vertical_flip = false,
- .position_x = i*space+start.x, .position_y = start.y + (i==selected?up:0),
+ .position_x = i*space+start.x, .position_y = start.y + (i==selected?-up:0),
.palette_index = 7,
- .tilemap_index = 8
+ .tilemap_index = hh_shop_translate_upgrades(upgrades[i])
});
}
}
-void hh_shift_selected(uint8_t* pos, bool dir, uint8_t min, uint8_t max) {
+void hh_shift_selected(uint8_t *pos, bool dir, uint8_t min, uint8_t max) {
if (dir) {
- pos = CLAMP(++pos,min,max);
+ *pos = MIN(*pos+1,max);
} else {
- if (pos > 0) {
- pos--;
- }
+ *pos = MAX(*pos-1,min);
}
+ // printf("b: %d sel: %d\n",dir, *pos);
}
diff --git a/src/game_loop/shop.h b/src/game_loop/shop.h
index b0ad5e4..642bcc3 100644
--- a/src/game_loop/shop.h
+++ b/src/game_loop/shop.h
@@ -15,12 +15,14 @@ typedef enum {
} hh_e_shop_states;
/** @brief amount of upgrade types */
-#define HH_SHOP_UPG_COUNT 2
+#define HH_SHOP_UPG_COUNT 5
/** @brief count of visible upgrades in shop */
-#define HH_SHOP_UPG_DISPLAY 4
+#define HH_SHOP_UPG_DISPLAY 5
/** @brief all possible upgrades */
typedef enum {
hh_e_upg_jump,
+ hh_e_upg_speed,
+ hh_e_upg_damage,
hh_e_upg_heal,
hh_e_upg_max_health,
} hh_e_upgrades;
diff --git a/src/makefile b/src/makefile
index fdd8ab5..a7af89e 100644
--- a/src/makefile
+++ b/src/makefile
@@ -83,7 +83,15 @@ $(TARGET).bin: $(TARGET).elf
PHONY += flash
flash: $(TARGET).bin
- st-flash --reset write $(TARGET).bin 0x08000000
+ st-flash --reset write $< 0x08000000
+
+# see definition of g_hh_tilemap_rom in stm32/setup.c
+PHONY += rom
+rom: static/tilemap.bin
+ st-flash --reset write $< 0x08033000
+
+static/tilemap.bin static/tilemap.h &:
+ $(MAKE) -C static all
%-ds.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
@@ -104,4 +112,8 @@ PHONY += clean
clean:
$(RM) $(TARGET).bin $(TARGET).elf $(OBJS)
+PHONY += distclean
+distclean: clean
+ $(MAKE) -C static clean
+
.PHONY: $(PHONY)
diff --git a/src/ppu/consts.h b/src/ppu/consts.h
index a27b7b7..d7caf5e 100644
--- a/src/ppu/consts.h
+++ b/src/ppu/consts.h
@@ -55,3 +55,9 @@
#define HH_PPU_VRAM_AUX_OFFSET ((hh_ppu_addr_t) 0xde00)
/** @brief auxiliary memory size in words */
#define HH_PPU_VRAM_AUX_SIZE ((hh_ppu_addr_t) 0x0002)
+
+/** @brief sprite size in bytes */
+#define HH_PPU_BYTE_SPRITE_SIZE (HH_PPU_VRAM_TMM_SPRITE_SIZE * sizeof(hh_ppu_data_t))
+/** @brief sprite size in 32-bit words (for stm) */
+#define HH_PPU_NATIVE_SPRITE_SIZE (HH_PPU_BYTE_SPRITE_SIZE / sizeof(uint32_t))
+
diff --git a/src/ppu/ppu.c b/src/ppu/ppu.c
index df14b9f..1f46b16 100644
--- a/src/ppu/ppu.c
+++ b/src/ppu/ppu.c
@@ -3,6 +3,7 @@
#include "ppu/consts.h"
#include "ppu/internals.h"
#include "ppu/ppu.h"
+#include "tilemap.h"
void hh_ppu_update_foreground(unsigned index, hh_s_ppu_loc_fam_entry e) {
hh_s_ppu_vram_data s = hh_ppu_2nat_fam(e);
@@ -46,3 +47,26 @@ void hh_ppu_update_color(unsigned palette_index, unsigned color_index, hh_ppu_rg
hh_ppu_vram_write(c);
free(c.data);
}
+
+void hh_ppu_load_tilemap() {
+ for (size_t sprite_idx = 0; sprite_idx < HH_TM_SIZE; sprite_idx++) {
+ for (size_t word_idx = 0; word_idx < HH_PPU_NATIVE_SPRITE_SIZE; word_idx++) {
+ uint32_t native_word = g_hh_tilemap_rom[word_idx + sprite_idx * HH_PPU_NATIVE_SPRITE_SIZE];
+ uint32_t native_word_bytes[4] = { // TODO: check endianness of stm32
+ (native_word >> 24) & 0xff,
+ (native_word >> 16) & 0xff,
+ (native_word >> 8) & 0xff,
+ (native_word >> 0) & 0xff,
+ };
+ uint16_t ppu_words[2] = {
+ (native_word_bytes[2] << 8) | (native_word_bytes[3] << 0),
+ (native_word_bytes[0] << 8) | (native_word_bytes[1] << 0),
+ };
+ hh_ppu_vram_write((hh_s_ppu_vram_data) {
+ .data = ppu_words,
+ .offset = HH_PPU_VRAM_TMM_OFFSET + sprite_idx * HH_PPU_VRAM_TMM_SPRITE_SIZE + word_idx * 2,
+ .size = 2,
+ });
+ }
+ }
+}
diff --git a/src/ppu/ppu.h b/src/ppu/ppu.h
index 75d97c1..46b58af 100644
--- a/src/ppu/ppu.h
+++ b/src/ppu/ppu.h
@@ -23,3 +23,6 @@ void hh_ppu_update_palette_table(hh_ppu_loc_palette_table_t table);
void hh_ppu_update_palette(unsigned palette_index, hh_ppu_loc_palette_data_t palette);
/** @brief update single color in palette */
void hh_ppu_update_color(unsigned palette_index, unsigned color_index, hh_ppu_rgb_color_t color);
+
+/** @brief copy g_hh_tilemap_rom into PPU vram */
+void hh_ppu_load_tilemap();
diff --git a/src/ppusim/sim.c b/src/ppusim/sim.c
index 8b67acc..0f8d687 100644
--- a/src/ppusim/sim.c
+++ b/src/ppusim/sim.c
@@ -10,9 +10,11 @@
#include "ppusim/mem.h"
#include "ppusim/sim.h"
#include "ppusim/work.h"
+#include "tilemap.h"
SDL_Window *g_hh_window = NULL;
SDL_Renderer *g_hh_renderer = NULL;
+uint32_t* g_hh_tilemap_rom = NULL;
void hh_ppu_init() {
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS);
@@ -25,38 +27,27 @@ void hh_ppu_init() {
g_hh_ppusim_vram = malloc(sizeof(hh_ppu_data_t) * 0xffff);
memset(g_hh_ppusim_vram, 0x0000, 0xffff);
+ hh_ppusim_load_tilemap();
+
hh_ppu_load_tilemap();
}
-void hh_ppu_load_tilemap() {
- //TODO: remove magic file name here
- char* filename = "static/tiles.bin";
- FILE* fp = fopen(filename,"rb");
- if (!fp){
- fprintf(stderr,"Error: Failed to load tiles.");
- return;//error
- }
- int sprite_size = (HH_PPU_SPRITE_WIDTH * HH_PPU_SPRITE_HEIGHT);
- fseek(fp, 0, SEEK_END);//goto EOF
- int _size = ftell(fp)/sprite_size;
- fseek(fp, 0, 0);//goto start of file
+void hh_ppusim_load_tilemap() {
+ FILE* fp = fopen("static/tilemap.bin", "rb");
- for (int i = 0; i < _size; i++) {
- uint8_t data[sprite_size];
+ fseek(fp, 0, SEEK_END);
+ size_t file_size = ftell(fp);
+ rewind(fp);
- fread(data,sizeof(uint8_t),sprite_size,fp);
-
- hh_s_ppu_vram_data sprite = hh_ppu_2nat_sprite(data);
- sprite.offset = i*HH_PPU_VRAM_TMM_SPRITE_SIZE;
- hh_ppu_vram_write(sprite);
- free(sprite.data);
- }
+ g_hh_tilemap_rom = malloc(file_size);
+ fread(g_hh_tilemap_rom, file_size, 1, fp);
fclose(fp);
}
void hh_ppu_deinit() {
free(g_hh_ppusim_threads);
free(g_hh_ppusim_vram);
+ free(g_hh_tilemap_rom);
SDL_DestroyRenderer(g_hh_renderer);
SDL_DestroyWindow(g_hh_window);
diff --git a/src/ppusim/sim.h b/src/ppusim/sim.h
index 4d1d718..218d61d 100644
--- a/src/ppusim/sim.h
+++ b/src/ppusim/sim.h
@@ -5,5 +5,5 @@
/** @brief max framerate for PPUSIM */
#define HH_PPUSIM_FRAMERATE 60
-/** @brief pump tilemap from rom to ppu ram */
-void hh_ppu_load_tilemap(); //ppu sim?
+/** @brief load static/tilemap.bin into memory */
+void hh_ppusim_load_tilemap();
diff --git a/src/static/.gitignore b/src/static/.gitignore
new file mode 100644
index 0000000..6111050
--- /dev/null
+++ b/src/static/.gitignore
@@ -0,0 +1,9 @@
+**/*.bin
+**/*.meta
+manifest.txt
+tilemap.h
+tiled/*
+tiled.mk
+*.tsx
+*.csv
+*.out
diff --git a/src/static/Source.cpp b/src/static/Source.cpp
new file mode 100644
index 0000000..0bba7c6
--- /dev/null
+++ b/src/static/Source.cpp
@@ -0,0 +1,42 @@
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <vector>
+
+int main(int argc, char** argv) {
+
+ std::ifstream f;
+ f.open("out.csv"); /* open file with filename as argument */
+ if (!f.is_open()) { /* validate file open for reading */
+ std::cerr << "error: file open failed '" << argv[1] << "'.\n";
+ return 0;
+ }
+
+
+ std::string line, val; /* string for line & value */
+ std::vector<std::vector<int>> array; /* vector of vector<int> */
+
+ while (std::getline(f, line)) { /* read each line */
+ std::vector<int> v; /* row vector v */
+ std::stringstream s(line); /* stringstream line */
+ while (getline(s, val, ',')) /* get each value (',' delimited) */
+ v.push_back(std::stoi(val)); /* add to row vector */
+ array.push_back(v); /* add row vector to array */
+ }
+
+ std::vector<int> flat_array; /* create 1D vector */
+ for (auto& row : array) { /* iterate over rows */
+ for (auto& val : row) /* iterate over vals */
+ flat_array.push_back(val); /* add to 1D vector */
+ }
+
+ int* array1d = flat_array.data(); /* get pointer to data */
+ int size = flat_array.size(); /* get size of 1D array */
+
+ std::ofstream out_file("out.bin", std::ios::binary); /* create binary file */
+ out_file.write((char*)&size, sizeof(size)); /* write size of 1D array to file */
+ out_file.write((char*)array1d, size * sizeof(int)); /* write 1D array to file */
+ out_file.close(); /* close file */
+
+ return 0;
+}
diff --git a/src/static/air.hex b/src/static/air.hex
new file mode 100644
index 0000000..5160cd6
--- /dev/null
+++ b/src/static/air.hex
@@ -0,0 +1,17 @@
+00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
diff --git a/src/static/background/bricks.hex b/src/static/background/bricks.hex
new file mode 100644
index 0000000..717b91d
--- /dev/null
+++ b/src/static/background/bricks.hex
@@ -0,0 +1,457 @@
+;indices: 7
+;25 3a 5e
+;09 0a 14
+;10 14 1f
+;15 1d 28
+;20 2e 37
+;39 4a 50
+;57 72 77
+
+000000: 06 06 06 06 06 05 06 06 06 06 06 05 06 06 06 06
+000010: 06 05 05 05 05 03 05 05 05 05 05 03 05 05 05 05
+000020: 06 05 04 04 04 03 05 05 05 05 05 03 05 05 05 05
+000030: 06 04 04 04 04 02 02 02 02 02 02 02 02 02 02 02
+000040: 06 04 04 04 04 02 02 03 03 03 03 03 03 02 03 03
+000050: 05 04 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+000060: 05 04 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+000070: 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02 02
+000080: 06 06 04 04 04 04 04 02 02 02 03 03 03 03 02 02
+000090: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0000a0: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03 02
+0000b0: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+0000c0: 00 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03
+0000d0: 00 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03
+0000e0: 00 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03
+0000f0: 06 06 06 05 05 05 02 02 02 02 02 02 02 02 02 02
+000100: 06 06 06 05 06 06 06 06 06 06 06 05 06 06 06 06
+000110: 05 05 05 03 05 05 05 05 05 05 05 03 05 05 05 05
+000120: 05 05 05 03 05 05 05 05 05 05 05 03 05 05 05 05
+000130: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000140: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+000150: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+000160: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+000170: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000180: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+000190: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0001a0: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0001b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0001c0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+0001d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+0001e0: 02 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+0001f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000200: 06 06 06 05 06 06 06 06 06 06 05 06 06 06 06 06
+000210: 05 05 05 03 05 05 05 05 05 05 03 05 05 05 05 06
+000220: 05 05 05 03 05 05 05 05 05 05 03 04 04 05 05 06
+000230: 02 02 02 02 02 02 02 02 02 02 02 04 04 04 04 06
+000240: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 06
+000250: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 05
+000260: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 05
+000270: 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 05
+000280: 03 03 03 03 03 03 03 02 04 04 04 04 04 05 05 00
+000290: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+0002a0: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+0002b0: 02 02 02 02 02 02 02 02 02 02 02 05 05 06 06 06
+0002c0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 06
+0002d0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 06
+0002e0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 05
+0002f0: 02 02 02 02 02 02 02 02 02 02 02 02 03 03 03 05
+000300: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+000310: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+000320: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 02 02
+000330: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+000340: 00 05 04 04 04 03 02 03 03 03 03 03 03 02 03 03
+000350: 00 05 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+000360: 00 04 04 04 04 02 03 03 03 03 03 02 02 02 02 03
+000370: 06 06 05 05 02 02 02 02 02 02 02 02 02 02 02 02
+000380: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+000390: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0003a0: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03 02
+0003b0: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+0003c0: 00 05 05 04 04 04 04 03 02 03 03 03 03 03 03 03
+0003d0: 00 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03
+0003e0: 00 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03
+0003f0: 00 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02
+000400: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+000410: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+000420: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+000430: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000440: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+000450: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+000460: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+000470: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000480: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+000490: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0004a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+0004b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0004c0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+0004d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+0004e0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+0004f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000500: 03 03 03 02 03 03 03 03 03 03 03 02 04 04 05 00
+000510: 03 03 03 02 03 03 03 03 03 03 03 02 04 04 05 00
+000520: 03 03 02 02 03 03 03 03 03 03 03 02 04 04 04 00
+000530: 02 02 02 02 02 02 02 02 02 02 02 02 02 06 06 06
+000540: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 06
+000550: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 05
+000560: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 05
+000570: 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 05
+000580: 03 03 03 03 03 03 03 02 04 04 04 04 04 05 05 00
+000590: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+0005a0: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+0005b0: 02 02 02 02 02 02 02 02 02 02 02 03 03 06 06 06
+0005c0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 06
+0005d0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 05
+0005e0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 05
+0005f0: 02 02 02 02 02 02 02 02 02 02 02 02 03 03 03 05
+000600: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+000610: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+000620: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 02 02
+000630: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+000640: 00 05 04 04 04 03 02 03 03 03 03 03 03 02 03 03
+000650: 00 05 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+000660: 00 04 04 04 04 02 03 03 03 03 03 02 02 02 02 03
+000670: 06 06 05 05 02 02 02 02 02 02 02 02 02 02 02 02
+000680: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+000690: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0006a0: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03 02
+0006b0: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+0006c0: 00 05 05 04 04 04 04 04 04 04 04 02 02 02 02 04
+0006d0: 00 05 05 04 04 04 04 04 04 04 04 04 02 04 04 04
+0006e0: 00 06 05 05 05 04 04 04 04 04 04 04 03 04 04 04
+0006f0: 00 06 06 06 05 05 05 05 05 05 05 05 03 05 05 05
+000700: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+000710: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+000720: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+000730: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000740: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+000750: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+000760: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+000770: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000780: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+000790: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0007a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+0007b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0007c0: 04 04 04 04 04 04 04 04 03 03 03 04 04 04 04 04
+0007d0: 04 04 04 04 04 04 04 04 04 03 03 04 04 04 04 04
+0007e0: 04 04 04 04 04 04 04 04 04 03 04 04 04 04 04 04
+0007f0: 05 05 05 05 05 05 05 05 05 03 05 05 05 05 05 05
+000800: 03 03 03 02 03 03 03 03 03 03 03 02 04 04 05 00
+000810: 03 03 03 02 03 03 03 03 03 03 03 02 04 04 05 00
+000820: 03 03 02 02 03 03 03 03 03 03 03 02 04 04 04 00
+000830: 02 02 02 02 02 02 02 02 02 02 02 02 02 06 06 06
+000840: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 06
+000850: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 05
+000860: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 05
+000870: 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 05
+000880: 03 03 03 03 03 03 03 02 04 04 04 04 04 05 05 00
+000890: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+0008a0: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+0008b0: 02 02 02 02 02 02 03 03 03 03 03 03 03 06 06 06
+0008c0: 04 04 03 03 03 04 04 04 04 04 04 04 04 04 05 06
+0008d0: 04 04 04 03 03 04 04 04 04 04 04 04 04 05 05 05
+0008e0: 04 04 04 03 04 04 04 04 04 04 04 05 05 05 05 06
+0008f0: 05 05 05 03 05 05 05 05 05 05 05 05 05 06 06 06
+000900: 06 06 06 06 06 05 06 06 06 06 06 05 06 06 06 06
+000910: 06 05 05 05 05 03 05 05 05 05 05 03 05 05 05 05
+000920: 06 05 04 04 04 03 05 05 05 05 05 03 05 05 05 05
+000930: 06 04 04 04 04 02 02 02 02 02 02 02 02 02 02 02
+000940: 06 04 04 04 04 02 02 03 03 03 03 03 03 02 03 03
+000950: 05 04 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+000960: 05 04 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+000970: 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02 02
+000980: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+000990: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0009a0: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03 02
+0009b0: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+0009c0: 00 05 05 04 04 04 04 04 04 04 04 02 02 02 02 04
+0009d0: 00 05 05 04 04 04 04 04 04 04 04 04 02 04 04 04
+0009e0: 00 06 05 05 05 04 04 04 04 04 04 04 03 04 04 04
+0009f0: 00 06 06 06 05 05 05 05 05 05 05 05 03 05 05 05
+000a00: 06 06 06 05 06 06 06 06 06 06 06 05 06 06 06 06
+000a10: 05 05 05 03 05 05 05 05 05 05 05 03 05 05 05 05
+000a20: 05 05 05 03 05 05 05 05 05 05 05 03 05 05 05 05
+000a30: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000a40: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+000a50: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+000a60: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+000a70: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000a80: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+000a90: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+000aa0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+000ab0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000ac0: 04 04 04 04 04 04 04 04 03 03 03 04 04 04 04 04
+000ad0: 04 04 04 04 04 04 04 04 04 03 03 04 04 04 04 04
+000ae0: 04 04 04 04 04 04 04 04 04 03 04 04 04 04 04 04
+000af0: 05 05 05 05 05 05 05 05 05 03 05 05 05 05 05 05
+000b00: 06 06 06 05 06 06 06 06 06 06 05 06 06 06 06 06
+000b10: 05 05 05 03 05 05 05 05 05 05 03 05 05 05 05 06
+000b20: 05 05 05 03 05 05 05 05 05 05 03 04 04 05 05 06
+000b30: 02 02 02 02 02 02 02 02 02 02 02 04 04 04 04 06
+000b40: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 06
+000b50: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 05
+000b60: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 05
+000b70: 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 05
+000b80: 03 03 03 03 03 03 03 02 04 04 04 04 04 05 05 00
+000b90: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+000ba0: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+000bb0: 02 02 02 02 02 02 03 03 03 03 03 03 03 06 06 06
+000bc0: 04 04 03 03 03 04 04 04 04 04 04 04 04 04 05 06
+000bd0: 04 04 04 03 03 04 04 04 04 04 04 04 04 05 05 05
+000be0: 04 04 04 03 04 04 04 04 04 04 04 05 05 05 05 06
+000bf0: 05 05 05 03 05 05 05 05 05 05 05 05 05 06 06 06
+000c00: 06 06 06 06 06 05 06 06 06 06 05 06 06 06 06 06
+000c10: 06 05 05 05 05 03 05 05 05 05 03 05 05 05 05 06
+000c20: 06 05 04 04 04 03 05 05 05 05 03 04 04 05 05 06
+000c30: 06 04 04 04 04 02 02 02 02 02 02 04 04 04 04 06
+000c40: 06 04 04 04 04 02 02 03 03 03 02 04 04 04 04 06
+000c50: 05 04 04 04 04 02 03 03 03 03 02 04 04 04 04 05
+000c60: 05 04 04 04 04 02 03 03 03 03 02 04 04 04 04 05
+000c70: 03 03 03 03 03 02 02 02 02 02 02 03 03 03 03 05
+000c80: 06 06 04 04 04 04 04 02 04 04 04 04 04 05 05 00
+000c90: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+000ca0: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+000cb0: 05 03 03 03 03 03 02 02 02 02 02 05 05 06 06 06
+000cc0: 00 05 04 04 04 04 04 04 03 02 04 04 04 04 04 06
+000cd0: 00 05 04 04 04 04 04 04 03 02 04 04 04 04 04 06
+000ce0: 00 05 04 04 04 04 04 04 03 02 04 04 04 04 04 05
+000cf0: 06 06 06 05 05 05 02 02 02 02 02 02 03 03 03 05
+000d00: 06 04 04 04 04 04 04 02 03 03 03 02 04 04 05 00
+000d10: 05 04 04 04 04 04 04 02 03 03 03 02 04 04 05 00
+000d20: 05 04 04 04 04 04 04 02 03 03 03 02 04 04 04 00
+000d30: 05 03 03 03 03 03 02 02 02 02 02 02 02 06 06 06
+000d40: 00 05 04 04 04 03 02 03 03 02 04 04 04 04 04 06
+000d50: 00 05 04 04 04 02 03 03 03 02 04 04 04 04 04 05
+000d60: 00 04 04 04 04 02 03 03 03 02 03 04 04 04 04 05
+000d70: 06 06 05 05 02 02 02 02 02 02 02 03 03 03 03 05
+000d80: 06 04 04 04 04 04 04 02 04 04 04 04 04 05 05 00
+000d90: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+000da0: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+000db0: 05 03 03 03 03 03 02 02 02 02 02 03 03 06 06 06
+000dc0: 00 05 05 04 04 04 03 03 03 03 03 04 04 04 04 06
+000dd0: 00 05 04 04 04 04 03 03 03 03 04 04 04 04 04 05
+000de0: 00 05 04 04 04 03 03 03 03 03 04 04 04 04 04 05
+000df0: 00 05 03 03 03 03 03 02 02 02 02 02 03 03 03 05
+000e00: 06 04 04 04 04 04 04 02 03 03 03 02 04 04 05 00
+000e10: 05 04 04 04 04 04 04 02 03 03 03 02 04 04 05 00
+000e20: 05 04 04 04 04 04 04 02 03 03 03 02 04 04 04 00
+000e30: 05 03 03 03 03 03 02 02 02 02 02 02 02 06 06 06
+000e40: 00 05 04 04 04 03 02 03 03 02 04 04 04 04 04 06
+000e50: 00 05 04 04 04 02 03 03 03 02 04 04 04 04 04 05
+000e60: 00 04 04 04 04 02 03 03 03 02 04 04 04 04 04 05
+000e70: 06 06 05 05 02 02 02 02 02 02 02 03 03 03 03 05
+000e80: 06 04 04 04 04 04 04 02 04 04 04 04 04 05 05 00
+000e90: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+000ea0: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+000eb0: 05 03 03 03 03 03 02 02 03 03 03 03 03 06 06 06
+000ec0: 00 05 05 04 04 04 04 04 04 04 04 04 04 04 05 06
+000ed0: 00 05 05 04 04 04 04 04 04 04 04 04 04 05 05 05
+000ee0: 00 06 05 05 05 04 04 04 04 04 04 05 05 05 05 06
+000ef0: 00 06 06 06 05 05 05 05 05 05 05 05 05 06 06 06
+000f00: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+000f10: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+000f20: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+000f30: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000f40: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+000f50: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+000f60: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+000f70: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000f80: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+000f90: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+000fa0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+000fb0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000fc0: 02 02 02 03 03 03 03 03 03 02 03 03 03 04 04 04
+000fd0: 03 02 03 03 03 03 03 03 03 02 03 03 04 04 04 04
+000fe0: 03 02 03 03 03 03 03 03 02 02 02 03 04 04 04 04
+000ff0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001000: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+001010: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+001020: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+001030: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001040: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+001050: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+001060: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+001070: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001080: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+001090: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0010a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+0010b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0010c0: 02 02 02 04 04 03 03 03 03 02 03 03 03 03 03 03
+0010d0: 04 02 04 04 04 04 03 03 03 02 03 03 03 03 03 03
+0010e0: 04 02 04 04 04 04 03 03 02 02 02 03 03 03 03 03
+0010f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001100: 03 03 02 02 02 03 03 03 03 03 03 02 02 05 05 05
+001110: 03 03 03 02 03 03 03 03 03 03 03 02 03 05 05 05
+001120: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 05 05
+001130: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001140: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+001150: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+001160: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+001170: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001180: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+001190: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0011a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+0011b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0011c0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+0011d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+0011e0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+0011f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001200: 06 05 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+001210: 05 05 05 02 03 03 03 03 03 03 03 02 03 03 03 03
+001220: 05 05 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+001230: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001240: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+001250: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+001260: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+001270: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001280: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+001290: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0012a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+0012b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0012c0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+0012d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+0012e0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+0012f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001300: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001310: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001320: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001330: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001340: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001350: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001360: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001370: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001380: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001390: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0013a0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0013b0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0013c0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0013d0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0013e0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0013f0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001400: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+001410: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+001420: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+001430: 02 02 02 02 02 02 02 02 02 02 02 02 02 01 01 01
+001440: 03 03 03 03 02 02 03 03 02 02 02 02 02 01 02 02
+001450: 03 03 03 03 03 02 02 02 02 02 02 02 02 01 02 02
+001460: 03 03 03 03 03 01 02 02 02 02 02 02 01 01 01 02
+001470: 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01
+001480: 02 03 03 03 02 02 02 01 02 02 02 02 02 02 01 01
+001490: 03 03 03 03 02 02 02 01 02 02 02 02 02 02 02 01
+0014a0: 03 03 03 03 02 02 01 01 01 01 02 02 02 02 01 01
+0014b0: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+0014c0: 02 02 02 03 03 02 02 02 02 01 02 02 02 01 01 01
+0014d0: 03 02 03 03 03 02 02 02 02 01 02 02 01 01 01 01
+0014e0: 03 02 03 03 03 03 02 02 01 01 01 02 01 01 01 01
+0014f0: 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01
+001500: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+001510: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+001520: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+001530: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001540: 02 02 02 02 01 01 02 02 02 02 02 02 02 01 02 02
+001550: 02 02 02 02 02 01 02 02 02 02 02 02 02 01 02 02
+001560: 02 02 02 02 02 01 02 02 02 02 02 02 01 01 01 02
+001570: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001580: 01 02 02 02 02 02 02 01 02 02 02 02 02 02 01 01
+001590: 01 02 02 02 02 02 02 01 02 02 02 02 02 02 02 01
+0015a0: 01 02 02 02 01 01 01 01 01 01 02 02 02 02 02 01
+0015b0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0015c0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0015d0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0015e0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0015f0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001600: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+001610: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+001620: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+001630: 01 01 01 01 02 02 02 02 02 02 02 02 02 02 02 02
+001640: 02 02 02 02 01 01 03 03 03 03 03 03 03 02 03 03
+001650: 02 02 02 02 02 01 02 02 03 03 03 03 03 02 03 03
+001660: 02 02 02 02 02 01 02 02 02 03 03 03 02 02 02 03
+001670: 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02 02
+001680: 01 02 02 02 02 02 02 01 02 02 03 03 03 03 02 02
+001690: 02 02 02 02 02 02 02 01 02 02 02 03 03 03 03 02
+0016a0: 02 02 02 02 02 02 01 01 01 01 02 03 03 03 03 02
+0016b0: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+0016c0: 01 01 01 02 02 02 02 02 02 01 02 03 03 03 03 03
+0016d0: 01 01 02 02 02 02 02 02 02 01 02 03 03 03 03 03
+0016e0: 01 01 02 02 02 02 02 02 01 01 01 03 03 03 03 03
+0016f0: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+001700: 03 03 02 02 02 02 02 02 02 02 02 01 01 01 01 01
+001710: 03 03 03 02 03 02 02 02 02 02 02 01 01 01 01 01
+001720: 03 03 03 02 03 02 02 02 02 02 01 01 01 01 01 01
+001730: 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01
+001740: 03 03 03 03 02 01 02 02 02 02 02 02 01 01 01 01
+001750: 03 03 03 03 02 01 02 02 02 02 02 02 01 01 01 01
+001760: 03 03 03 03 02 01 02 02 02 02 02 01 01 01 01 01
+001770: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+001780: 02 03 03 03 02 02 02 01 02 02 02 01 01 01 01 01
+001790: 03 03 03 03 02 02 02 01 02 02 02 01 01 01 01 01
+0017a0: 03 03 03 03 02 02 01 01 01 01 02 01 01 01 01 01
+0017b0: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+0017c0: 02 02 02 03 02 02 02 02 02 01 02 02 01 01 01 01
+0017d0: 03 02 03 03 03 02 02 02 02 01 02 02 02 01 01 01
+0017e0: 03 02 03 03 02 02 02 02 01 01 01 02 02 01 01 01
+0017f0: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+001800: 01 01 01 01 01 02 02 02 02 02 02 02 02 03 03 03
+001810: 01 01 01 01 02 02 02 02 02 02 02 02 03 03 03 03
+001820: 01 01 01 01 02 02 02 02 02 02 02 02 02 03 03 03
+001830: 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02 02
+001840: 01 01 01 01 01 02 02 02 02 02 03 03 03 02 03 03
+001850: 01 01 01 01 01 02 02 02 02 02 03 03 03 02 03 03
+001860: 01 01 01 01 01 01 02 02 02 02 03 03 02 02 02 03
+001870: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+001880: 01 01 01 01 02 02 02 01 02 02 02 03 03 03 02 02
+001890: 01 01 01 01 02 02 02 01 02 02 02 03 03 03 03 02
+0018a0: 01 01 01 01 01 02 01 01 01 01 02 03 03 03 03 02
+0018b0: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+0018c0: 01 01 01 01 01 02 02 02 02 01 02 03 03 03 03 03
+0018d0: 01 01 01 01 02 02 02 02 02 01 02 03 03 03 03 03
+0018e0: 01 01 01 01 02 02 02 02 01 01 02 03 03 03 03 03
+0018f0: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+001900: 03 03 02 02 01 02 02 02 02 02 02 01 01 02 01 01
+001910: 03 03 03 02 02 02 02 02 02 02 02 01 02 02 02 01
+001920: 03 03 03 02 02 02 02 02 02 02 01 01 01 02 02 02
+001930: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+001940: 03 03 03 03 01 01 02 02 02 02 02 02 02 01 02 02
+001950: 03 03 03 03 02 01 02 02 02 02 02 02 02 01 02 02
+001960: 03 03 03 03 03 01 02 02 02 02 02 02 01 01 01 02
+001970: 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01
+001980: 02 03 03 03 03 03 02 01 02 02 02 02 02 02 01 01
+001990: 03 03 03 03 03 03 03 02 02 02 02 02 02 02 02 01
+0019a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+0019b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0019c0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+0019d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+0019e0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+0019f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001a00: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001a10: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001a20: 02 01 01 01 01 01 01 01 01 01 01 01 01 01 02 02
+001a30: 01 01 01 01 01 01 01 01 02 02 02 02 01 01 01 01
+001a40: 02 02 02 02 01 01 02 02 02 02 02 02 02 01 02 02
+001a50: 02 02 02 02 02 01 02 02 02 02 02 02 02 01 02 02
+001a60: 02 02 02 02 02 01 02 02 02 02 02 02 01 01 01 02
+001a70: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+001a80: 01 02 02 02 02 02 02 01 02 02 02 02 02 02 01 01
+001a90: 02 02 02 02 02 02 02 01 02 02 02 02 02 02 02 01
+001aa0: 03 03 02 02 02 02 01 01 01 01 02 02 02 02 02 01
+001ab0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001ac0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+001ad0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+001ae0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+001af0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001b00: 01 01 01 01 01 02 02 02 02 02 02 02 02 03 03 03
+001b10: 02 02 02 01 02 02 02 02 02 02 02 02 03 03 03 03
+001b20: 02 02 02 01 02 02 02 02 02 02 01 02 02 03 03 03
+001b30: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+001b40: 02 02 02 02 01 01 02 02 02 02 02 03 03 02 03 03
+001b50: 02 02 02 02 02 01 02 02 02 02 02 03 03 02 03 03
+001b60: 02 02 02 02 02 01 02 02 02 02 02 03 02 02 02 03
+001b70: 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02 02
+001b80: 01 02 02 02 02 02 02 01 02 02 03 03 03 03 02 02
+001b90: 02 02 02 02 02 02 02 01 02 03 03 03 03 03 03 02
+001ba0: 02 02 02 02 02 02 01 02 02 02 03 03 03 03 03 02
+001bb0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+001bc0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+001bd0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+001be0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+001bf0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 \ No newline at end of file
diff --git a/src/static/background/crates.hex b/src/static/background/crates.hex
new file mode 100644
index 0000000..3d8b332
--- /dev/null
+++ b/src/static/background/crates.hex
@@ -0,0 +1,39 @@
+;indices: 5
+;57 72 77
+;34 1c 27
+;60 2c 2c
+;7a 48 41
+;ad 77 57
+
+000000: 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+000010: 03 04 04 04 04 04 04 04 04 04 04 04 04 04 04 03
+000020: 03 03 03 04 01 01 01 01 01 01 01 01 04 03 03 03
+000030: 03 03 02 03 04 01 01 01 01 01 01 04 03 02 03 03
+000040: 03 03 01 02 03 04 01 01 01 01 04 03 02 01 03 03
+000050: 03 03 01 01 02 03 04 01 01 04 03 02 01 01 03 03
+000060: 03 03 01 01 01 02 03 04 04 03 02 01 01 01 03 03
+000070: 03 03 01 01 01 01 02 03 03 02 01 01 01 01 03 03
+000080: 03 03 01 01 01 01 04 03 03 04 01 01 01 01 03 03
+000090: 03 03 01 01 01 04 03 02 02 03 04 01 01 01 03 03
+0000a0: 03 03 01 01 04 03 02 01 01 02 03 04 01 01 03 03
+0000b0: 03 03 01 04 03 02 01 01 01 01 02 03 04 01 03 03
+0000c0: 03 03 04 03 02 01 01 01 01 01 01 02 03 04 03 03
+0000d0: 03 03 03 02 01 01 01 01 01 01 01 01 02 03 03 03
+0000e0: 03 02 02 02 02 02 02 02 02 02 02 02 02 02 02 03
+0000f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000100: 01 01 01 02 01 01 01 01 01 01 01 01 02 01 01 01
+000110: 01 03 03 01 03 03 03 03 03 03 03 03 01 03 03 01
+000120: 01 03 00 01 03 03 03 03 03 03 03 03 01 00 03 01
+000130: 01 03 03 01 04 04 04 04 04 04 04 04 01 03 03 01
+000140: 01 03 03 01 02 02 01 02 02 01 02 02 01 03 03 01
+000150: 01 03 03 01 02 02 01 02 02 01 02 02 01 03 03 01
+000160: 01 03 03 01 02 02 01 02 02 01 02 02 01 03 03 01
+000170: 01 03 03 01 02 02 01 02 02 01 02 02 01 03 03 01
+000180: 01 03 03 01 02 02 01 02 02 01 02 02 01 03 03 01
+000190: 01 03 03 01 02 02 01 02 02 01 02 02 01 03 03 01
+0001a0: 01 03 03 01 02 02 01 02 02 01 02 02 01 03 03 01
+0001b0: 01 03 03 01 02 02 01 02 02 01 02 02 01 03 03 01
+0001c0: 01 03 03 01 04 04 04 04 04 04 04 04 01 03 03 01
+0001d0: 01 03 00 01 03 03 03 03 03 03 03 03 01 00 03 01
+0001e0: 01 03 03 01 03 03 03 03 03 03 03 03 01 03 03 01
+0001f0: 01 01 01 02 01 01 01 01 01 01 01 01 02 01 01 01 \ No newline at end of file
diff --git a/src/static/background/shop_stall.hex b/src/static/background/shop_stall.hex
new file mode 100644
index 0000000..e156bd1
--- /dev/null
+++ b/src/static/background/shop_stall.hex
@@ -0,0 +1,202 @@
+;indices: 8
+;17 20 38
+;09 0a 14
+;60 2c 2c
+;7a 48 41
+;c0 94 73
+;d7 b5 94
+;39 4a 50
+;81 97 96
+
+000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
+0000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 05
+000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0001b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0001c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0001e0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0001f0: 05 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+0002a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+0002b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+0002c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+0002d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+0002e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+0002f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04
+000300: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000310: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000320: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000330: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000340: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000350: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000360: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000370: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000380: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000390: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0003a0: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0003b0: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0003c0: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0003d0: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0003e0: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0003f0: 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000400: 05 01 04 05 05 05 05 05 05 05 05 05 05 05 05 05
+000410: 04 01 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+000420: 04 01 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000430: 04 01 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000440: 04 01 02 02 02 02 02 02 02 02 02 02 03 03 03 03
+000450: 04 01 02 02 02 02 03 03 03 03 03 03 03 03 03 03
+000460: 04 01 02 02 03 03 03 03 03 03 03 03 03 03 03 03
+000470: 04 01 02 03 03 03 03 03 03 03 03 03 03 03 03 03
+000480: 04 01 02 03 03 03 03 03 03 03 03 03 03 03 03 03
+000490: 04 01 02 03 03 03 03 03 03 03 03 03 03 03 03 03
+0004a0: 04 01 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0004b0: 04 01 02 03 03 03 03 03 03 03 03 03 03 03 03 03
+0004c0: 04 01 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0004d0: 04 01 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0004e0: 04 01 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0004f0: 04 01 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+000500: 00 00 00 00 00 00 00 00 00 01 01 01 01 01 01 01
+000510: 00 00 00 00 00 00 00 00 01 04 04 04 04 04 04 04
+000520: 00 00 00 00 00 00 00 00 01 04 04 04 04 04 04 04
+000530: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+000540: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+000550: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+000560: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+000570: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+000580: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+000590: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+0005a0: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+0005b0: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+0005c0: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+0005d0: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+0005e0: 00 00 00 00 00 00 00 00 01 03 03 03 03 03 03 03
+0005f0: 00 00 00 00 00 00 00 00 00 01 01 01 01 01 01 01
+000600: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000610: 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+000620: 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+000630: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+000640: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+000650: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+000660: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+000670: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+000680: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+000690: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0006a0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0006b0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0006c0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0006d0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0006e0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+0006f0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000700: 05 05 05 05 05 05 05 05 05 05 05 05 05 04 01 05
+000710: 04 04 04 04 04 04 04 04 04 04 04 04 04 04 01 04
+000720: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 01 04
+000730: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 01 04
+000740: 03 03 03 03 02 02 02 02 02 02 02 02 02 02 01 04
+000750: 03 03 03 03 03 03 03 03 03 03 02 02 02 02 01 04
+000760: 03 03 03 03 03 03 03 03 03 03 03 03 02 02 01 04
+000770: 03 03 03 03 03 03 03 03 03 03 03 03 03 02 01 04
+000780: 03 03 03 03 03 03 03 03 03 03 03 03 03 02 01 04
+000790: 03 03 03 03 03 03 03 03 03 03 03 03 03 02 01 04
+0007a0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 01 04
+0007b0: 03 03 03 03 03 03 03 03 03 03 03 03 03 02 01 04
+0007c0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 01 04
+0007d0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 01 04
+0007e0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 01 04
+0007f0: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 01 04
+000800: 01 01 01 01 01 01 01 00 00 00 00 00 00 00 00 00
+000810: 04 04 04 04 04 04 04 01 00 00 00 00 00 00 00 00
+000820: 04 04 04 04 04 04 04 01 00 00 00 00 00 00 00 00
+000830: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+000840: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+000850: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+000860: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+000870: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+000880: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+000890: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+0008a0: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+0008b0: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+0008c0: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+0008d0: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+0008e0: 03 03 03 03 03 03 03 01 00 00 00 00 00 00 00 00
+0008f0: 01 01 01 01 01 01 01 00 00 00 00 00 00 00 00 00
+000900: 01 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000910: 01 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000920: 01 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000930: 01 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000940: 01 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000950: 01 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000960: 01 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
+000970: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000980: 01 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000990: 01 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009a0: 01 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009b0: 01 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009c0: 01 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009d0: 01 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009e0: 01 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
+0009f0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000a00: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a10: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a20: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a30: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a40: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a50: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a60: 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
+000a70: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000a80: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a90: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000aa0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000ab0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000ac0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000ad0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000ae0: 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
+000af0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000b00: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000b10: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000b20: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000b30: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 07 01
+000b40: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000b50: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 07 01
+000b60: 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 01
+000b70: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000b80: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000b90: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000ba0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000bb0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 07 01
+000bc0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000bd0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 07 01
+000be0: 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 01
+000bf0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 \ No newline at end of file
diff --git a/src/static/epic.py b/src/static/epic.py
new file mode 100644
index 0000000..9f697ef
--- /dev/null
+++ b/src/static/epic.py
@@ -0,0 +1,41 @@
+#!/bin/python3
+import re
+
+# Read in the first file and extract the id and image filename for each tile
+tile_info = {}
+with open('stuff1.tsx', 'r') as f:
+ for line in f:
+ id_match = re.match(r'<tile id="(\d+)">', line.strip())
+ if id_match:
+ tile_id = int(id_match.group(1))
+ else:
+ image_match = re.search(r'source=".*?/(\w+_\d+\.png)"', line.strip())
+ if image_match:
+ image_filename = image_match.group(1)
+ tile_info[tile_id] = image_filename
+
+# Read in the second file and extract the size for each tile
+tile_sizes = {}
+with open('tilemap.h', 'r') as f:
+ for line in f:
+ size_match = re.match(r'#define HH_TM_(\w+)_OFFSET (\d+)', line.strip(), re.IGNORECASE)
+ if size_match:
+ tile_type = size_match.group(1).lower()
+ size = int(size_match.group(2))
+ tile_sizes[tile_type] = size
+
+# Read in the third file, update the values, and write to the output file
+with open('map.csv', 'r') as input_file, open('out.csv', 'w') as output_file:
+ for line in input_file:
+# #OK
+ tile_ids = [int(tile_id) for tile_id in line.strip().split(',')]
+ updated_tile_ids = []
+ for tile_id in tile_ids:
+ image_filename = re.match(r'(\w+)_(\d+)\.png', tile_info[tile_id])
+ tile_type = image_filename.group(1).lower()
+ offset = int(image_filename.group(2))
+ size = tile_sizes[tile_type]
+ updated_tile_id = offset + size
+ updated_tile_ids.append(str(updated_tile_id))
+ output_file.write(','.join(updated_tile_ids) + '\n')
+
diff --git a/src/static/foreground/bullet.hex b/src/static/foreground/bullet.hex
new file mode 100644
index 0000000..88f5b75
--- /dev/null
+++ b/src/static/foreground/bullet.hex
@@ -0,0 +1,58 @@
+;indices: 8
+;17 20 38
+;00 00 00
+;00 00 00
+;00 00 00
+;00 00 00
+;75 24 38
+;cf 57 3c
+;e8 c1 70
+
+000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000050: 00 00 00 00 00 00 00 00 00 05 00 05 05 05 00 00
+000060: 00 00 00 00 00 00 00 05 05 06 05 06 06 07 05 00
+000070: 00 00 00 00 00 00 05 06 05 05 06 06 07 07 07 05
+000080: 00 00 00 00 00 05 06 05 05 06 06 07 07 07 07 05
+000090: 00 00 00 00 00 00 05 05 06 05 06 06 06 07 05 00
+0000a0: 00 00 00 00 00 00 00 00 05 00 05 05 05 05 00 00
+0000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000150: 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 00
+000160: 00 00 00 00 00 00 05 06 05 00 00 00 00 00 00 00
+000170: 00 00 00 00 00 00 05 05 06 05 00 00 00 00 00 00
+000180: 00 00 00 00 00 05 06 05 05 05 00 00 00 00 00 00
+000190: 00 00 00 00 00 00 05 06 05 06 05 00 00 00 00 00
+0001a0: 00 00 00 00 00 05 06 06 06 05 00 00 00 00 00 00
+0001b0: 00 00 00 00 00 05 06 07 06 06 05 00 00 00 00 00
+0001c0: 00 00 00 00 00 05 06 07 07 06 05 00 00 00 00 00
+0001d0: 00 00 00 00 00 05 07 07 07 07 05 00 00 00 00 00
+0001e0: 00 00 00 00 00 00 05 07 07 05 00 00 00 00 00 00
+0001f0: 00 00 00 00 00 00 00 05 05 00 00 00 00 00 00 00
+000200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000270: 00 00 00 00 00 00 05 00 00 05 00 00 00 00 00 00
+000280: 00 00 00 00 00 00 00 05 05 06 05 00 00 00 00 00
+000290: 00 00 00 00 00 00 05 06 05 05 05 05 05 00 00 00
+0002a0: 00 00 00 00 00 00 00 05 05 06 06 05 06 05 00 00
+0002b0: 00 00 00 00 00 00 00 00 06 06 06 06 06 05 05 00
+0002c0: 00 00 00 00 00 00 00 00 00 05 06 06 06 07 07 05
+0002d0: 00 00 00 00 00 00 00 00 00 00 05 06 07 07 07 05
+0002e0: 00 00 00 00 00 00 00 00 00 00 00 05 05 07 07 05
+0002f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 05 05 00 \ No newline at end of file
diff --git a/src/static/foreground/gozer.hex b/src/static/foreground/gozer.hex
new file mode 100644
index 0000000..70a6b7f
--- /dev/null
+++ b/src/static/foreground/gozer.hex
@@ -0,0 +1,39 @@
+;indices: 5
+;17 20 38
+;10 14 1f
+;40 27 51
+;7a 36 7b
+;eb ed e9
+
+000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000020: 00 00 00 00 00 00 01 01 01 01 01 00 00 00 00 00
+000030: 00 00 00 00 01 01 03 03 03 03 03 01 01 00 00 00
+000040: 00 00 00 01 03 03 03 03 03 03 03 03 03 01 00 00
+000050: 00 00 01 03 03 03 03 03 03 03 03 03 03 03 01 00
+000060: 00 01 03 03 03 03 03 03 02 02 02 02 02 02 03 01
+000070: 00 01 03 03 03 03 03 02 01 01 01 01 02 02 02 01
+000080: 01 03 03 02 03 03 02 01 01 01 01 01 01 01 01 01
+000090: 01 03 03 02 03 01 01 01 01 01 01 01 01 01 01 01
+0000a0: 03 03 02 03 03 01 01 01 01 01 04 01 01 04 01 01
+0000b0: 03 02 02 02 03 01 01 01 01 01 04 01 01 04 01 01
+0000c0: 02 01 00 01 02 01 01 01 01 01 04 01 01 04 01 00
+0000d0: 02 00 00 00 01 02 01 01 01 01 01 01 01 01 01 00
+0000e0: 00 00 00 00 01 02 01 01 01 01 01 01 01 01 00 00
+0000f0: 00 00 00 00 00 01 01 02 01 01 01 01 01 00 00 00
+000100: 00 00 00 00 00 00 00 01 02 02 02 01 00 00 00 00
+000110: 00 00 00 00 00 00 01 03 01 01 01 00 00 00 00 00
+000120: 00 00 00 00 00 00 01 03 03 03 01 00 00 00 00 00
+000130: 00 00 00 00 00 01 03 03 03 03 03 02 00 00 00 00
+000140: 00 00 00 00 00 01 03 03 03 03 03 02 00 00 01 01
+000150: 00 00 00 00 01 03 03 03 03 03 03 02 00 00 01 01
+000160: 00 00 00 00 01 03 03 03 03 03 03 03 02 00 00 00
+000170: 00 00 00 00 01 03 01 01 03 03 03 03 02 00 00 00
+000180: 00 00 00 00 01 02 01 01 03 03 03 03 03 01 00 00
+000190: 00 00 00 01 02 01 02 02 02 03 03 02 02 01 00 00
+0001a0: 00 00 00 01 02 02 01 02 02 02 02 02 02 01 00 00
+0001b0: 00 00 01 02 02 02 01 01 01 01 01 01 01 02 01 00
+0001c0: 00 00 01 02 02 01 01 01 02 02 01 01 02 02 01 00
+0001d0: 00 00 00 01 01 00 01 01 01 01 01 01 01 00 00 01
+0001e0: 00 00 00 00 00 00 01 01 00 00 01 01 00 00 00 00
+0001f0: 00 00 00 00 00 00 01 01 00 00 01 01 00 00 00 00 \ No newline at end of file
diff --git a/src/static/makefile b/src/static/makefile
new file mode 100644
index 0000000..9c75bca
--- /dev/null
+++ b/src/static/makefile
@@ -0,0 +1,50 @@
+XXD := xxd
+TILEPACK := ../../scripts/tilepack
+MANIFEST2HEADER := ../../scripts/manifest2header.awk
+TILEDMK := ../../scripts/tiled.mk.awk
+TILEMAP2TILED := ../../scripts/tilemap2tiled
+
+INPUT += air.hex \
+ background/bricks.hex \
+ background/crates.hex \
+ background/shop_stall.hex \
+ background/shop.hex \
+ background/title_screen_icon.hex \
+ foreground/title_screen_letteres_large.hex\
+ foreground/bullet.hex \
+ foreground/gozer.hex \
+ foreground/slime.hex \
+ foreground/font.hex
+ # world.hex
+USER_META += world.h
+
+OUT_BIN := $(patsubst %.hex,%.bin, $(INPUT))
+OUT_META := $(patsubst %.hex,%.meta, $(INPUT))
+
+.PHONY: all clean
+
+all: tilemap.bin tilemap.h
+
+%.bin: %.hex
+ sed 's/;.*//g' $< | $(XXD) -r | $(TILEPACK) > $@
+
+%.meta: %.bin
+ wc -c $< | tr '.' ' ' | awk '1 { print $$2" "$$1 / 104 }' > $@
+
+manifest.txt: $(OUT_BIN) $(OUT_META)
+ cat $(OUT_META) > $@
+
+tilemap.bin: manifest.txt $(OUT_BIN)
+ awk '1 { print $$1".bin" }' $< | xargs cat > $@
+
+tilemap.h: manifest.txt
+ $(MANIFEST2HEADER) $< > $@
+ cat $(USER_META) >> $@
+
+tiled.mk: manifest.txt
+ $(TILEDMK) < $< > $@
+
+include tiled.mk
+
+clean:
+ $(RM) -r $(OUT_BIN) $(OUT_META) manifest.txt tilemap.h tilemap.bin tiled.mk tiled
diff --git a/src/static/shop.hex b/src/static/shop.hex
new file mode 100644
index 0000000..8c08feb
--- /dev/null
+++ b/src/static/shop.hex
@@ -0,0 +1,331 @@
+;indices: 9
+;75 24 38
+;a5 30 30
+;cf 57 3c
+;1e 1d 39
+;40 27 51
+;7a 36 7b
+;10 14 1f
+;eb ed e9
+;17 20 38
+
+000000: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000010: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+000020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000030: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000040: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000050: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000060: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000070: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000080: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000090: 06 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01
+0000a0: 06 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01
+0000b0: 06 06 01 00 00 00 00 00 00 00 00 00 00 00 01 06
+0000c0: 06 06 06 01 00 00 00 00 00 00 00 00 00 01 06 06
+0000d0: 06 06 06 06 01 01 00 00 00 00 00 01 01 06 06 06
+0000e0: 06 06 06 06 06 06 01 01 01 01 01 06 06 06 06 06
+0000f0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000100: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000110: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000120: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000130: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000140: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000150: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000160: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000170: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000180: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000190: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0001a0: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0001b0: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0001c0: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0001d0: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0001e0: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0001f0: 07 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000200: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000210: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000220: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000230: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000240: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000250: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000260: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000270: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000280: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000290: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0002a0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0002b0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0002c0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0002d0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0002e0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0002f0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000300: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000310: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000320: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+000330: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+000340: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+000350: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+000360: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+000370: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+000380: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+000390: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+0003a0: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+0003b0: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+0003c0: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+0003d0: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+0003e0: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+0003f0: 06 06 06 06 06 06 06 07 07 06 06 06 06 06 06 06
+000400: 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
+000410: 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
+000420: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000430: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000440: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000450: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000460: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000470: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000480: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000490: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0004a0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0004b0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0004c0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0004d0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0004e0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+0004f0: 06 06 06 06 06 06 06 06 06 06 06 07 07 06 06 06
+000500: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000510: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000520: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000530: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000540: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000550: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000560: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000570: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000580: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000590: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0005a0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0005b0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0005c0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0005d0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0005e0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+0005f0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000600: 01 01 01 01 01 01 01 01 06 06 06 06 06 06 06 06
+000610: 01 01 01 01 01 01 01 01 06 06 06 06 06 06 06 06
+000620: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+000630: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+000640: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+000650: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+000660: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+000670: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+000680: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+000690: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+0006a0: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+0006b0: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+0006c0: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+0006d0: 06 06 06 06 06 06 01 01 06 06 06 06 06 06 06 06
+0006e0: 01 01 01 01 01 01 01 01 06 06 06 06 06 06 06 06
+0006f0: 01 01 01 01 01 01 01 01 06 06 06 06 06 06 06 06
+000700: 06 06 06 06 06 06 06 01 06 06 06 06 06 06 01 01
+000710: 06 06 06 06 06 06 01 06 06 06 06 06 06 06 01 01
+000720: 06 06 06 06 06 01 06 06 06 06 06 06 06 01 01 01
+000730: 06 06 06 06 01 06 06 06 06 06 06 06 01 06 01 01
+000740: 06 06 06 01 06 06 06 06 06 06 06 01 06 06 01 01
+000750: 06 06 01 06 06 06 06 06 06 06 01 06 06 06 01 01
+000760: 06 01 06 06 06 06 06 06 06 01 06 06 06 06 01 01
+000770: 01 06 06 06 06 06 06 06 01 06 06 06 06 06 01 01
+000780: 06 06 06 06 06 06 06 01 06 06 06 06 06 06 01 01
+000790: 06 06 06 06 06 06 01 06 06 06 06 06 06 06 01 01
+0007a0: 06 06 06 06 06 01 06 06 06 06 06 06 06 01 01 01
+0007b0: 06 06 06 06 01 06 06 06 06 06 06 06 01 06 01 01
+0007c0: 06 06 06 01 06 06 06 06 06 06 06 01 06 06 01 01
+0007d0: 06 06 01 06 06 06 06 06 06 06 01 06 06 06 01 01
+0007e0: 06 01 06 06 06 06 06 06 06 01 06 06 06 06 01 01
+0007f0: 01 06 06 06 06 06 06 06 01 06 06 06 06 06 01 01
+000800: 06 06 06 06 06 06 06 01 06 06 06 06 06 06 06 01
+000810: 06 06 06 06 06 06 01 06 06 06 06 06 06 06 01 06
+000820: 06 06 06 06 06 01 06 06 06 06 06 06 06 01 06 06
+000830: 06 06 06 06 01 06 06 06 06 06 06 06 01 06 06 06
+000840: 06 06 06 01 06 06 06 06 06 06 06 01 06 06 06 06
+000850: 06 06 01 06 06 06 06 06 06 06 01 06 06 06 06 06
+000860: 06 01 06 06 06 06 06 06 06 01 06 06 06 06 06 06
+000870: 01 06 06 06 06 06 06 06 01 06 06 06 06 06 06 06
+000880: 06 06 06 06 06 06 06 01 06 06 06 06 06 06 06 01
+000890: 06 06 06 06 06 06 01 06 06 06 06 06 06 06 01 06
+0008a0: 06 06 06 06 06 01 06 06 06 06 06 06 06 01 06 06
+0008b0: 06 06 06 06 01 06 06 06 06 06 06 06 01 06 06 06
+0008c0: 06 06 06 01 06 06 06 06 06 06 06 01 06 06 06 06
+0008d0: 06 06 01 06 06 06 06 06 06 06 01 06 06 06 06 06
+0008e0: 06 01 06 06 06 06 06 06 06 01 06 06 06 06 06 06
+0008f0: 01 06 06 06 06 06 06 06 01 06 06 06 06 06 06 06
+000900: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000910: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000920: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000930: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000940: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000950: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000960: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000970: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000980: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000990: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009a0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009b0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009c0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009d0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009e0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0009f0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a00: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a10: 06 06 06 01 01 06 06 06 06 06 06 06 06 06 06 06
+000a20: 06 06 01 01 01 01 06 06 06 06 06 06 06 06 06 06
+000a30: 06 01 01 01 01 01 01 06 06 06 06 06 06 06 06 06
+000a40: 06 01 01 01 01 01 01 06 06 06 06 06 06 06 06 06
+000a50: 06 06 01 01 01 01 06 06 06 06 06 06 06 06 06 06
+000a60: 06 06 06 01 01 06 06 06 06 06 06 06 06 06 06 06
+000a70: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000a80: 06 06 06 06 06 06 06 06 06 06 01 01 06 06 06 06
+000a90: 06 06 06 06 06 06 06 06 06 01 01 01 01 06 06 06
+000aa0: 06 06 06 06 06 06 06 06 01 01 01 01 01 01 06 06
+000ab0: 06 06 06 06 06 06 06 06 01 01 01 01 01 01 06 06
+000ac0: 06 06 06 06 06 06 06 06 06 01 01 01 01 06 06 06
+000ad0: 06 06 06 06 06 06 06 06 06 06 01 01 06 06 06 06
+000ae0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000af0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b00: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b10: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b20: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b30: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b40: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b50: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b60: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b70: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b80: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000b90: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000ba0: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000bb0: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000bc0: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000bd0: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000be0: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000bf0: 06 01 01 06 06 06 06 06 06 06 06 06 06 06 06 06
+000c00: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000c10: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000c20: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000c30: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000c40: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000c50: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000c60: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+000c70: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000c80: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000c90: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000ca0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000cb0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000cc0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000cd0: 06 06 06 06 06 06 01 01 01 01 06 06 06 06 06 01
+000ce0: 06 06 06 06 06 01 01 01 01 01 06 06 06 06 06 01
+000cf0: 06 06 06 06 01 01 01 01 01 01 06 06 06 06 06 01
+000d00: 06 06 06 06 01 01 01 01 01 01 06 06 06 06 06 01
+000d10: 06 06 06 06 01 01 01 01 01 06 06 06 06 06 06 01
+000d20: 06 06 06 06 01 01 01 01 06 06 06 06 06 06 06 01
+000d30: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000d40: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000d50: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000d60: 06 06 06 06 06 06 01 01 01 01 06 06 06 06 06 01
+000d70: 06 06 06 06 06 01 01 01 01 01 06 06 06 06 06 01
+000d80: 06 06 06 06 01 01 01 01 01 01 06 06 06 06 06 01
+000d90: 06 06 06 06 01 01 01 01 01 01 06 06 06 06 06 01
+000da0: 06 06 06 06 01 01 01 01 01 06 06 06 06 06 06 01
+000db0: 06 06 06 06 01 01 01 01 06 06 06 06 06 06 06 01
+000dc0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000dd0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000de0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000df0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 01
+000e00: 06 06 06 06 01 01 01 01 01 01 06 06 06 06 06 06
+000e10: 06 06 06 06 01 01 01 01 01 06 06 06 06 06 06 06
+000e20: 06 06 06 06 01 01 01 01 06 06 06 06 06 06 06 06
+000e30: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000e40: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000e50: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000e60: 06 06 06 06 06 06 01 01 01 01 06 06 06 06 06 06
+000e70: 06 06 06 06 06 01 01 01 01 01 06 06 06 06 06 06
+000e80: 06 06 06 06 01 01 01 01 01 01 06 06 06 06 06 06
+000e90: 06 06 06 06 01 01 01 01 01 01 06 06 06 06 06 06
+000ea0: 06 06 06 06 01 01 01 01 01 06 06 06 06 06 06 06
+000eb0: 06 06 06 06 01 01 01 01 06 06 06 06 06 06 06 06
+000ec0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000ed0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000ee0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000ef0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000f00: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000f10: 06 07 07 06 07 06 07 07 07 07 06 06 06 06 06 06
+000f20: 06 07 07 06 07 06 06 07 07 06 06 06 06 06 06 06
+000f30: 06 07 07 07 07 06 06 07 07 06 06 07 07 07 07 06
+000f40: 06 07 07 06 07 06 06 07 07 06 06 06 06 06 06 06
+000f50: 06 07 07 06 07 06 07 07 07 07 06 06 06 06 06 06
+000f60: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000f70: 06 07 07 07 07 07 07 07 07 07 07 07 07 07 07 06
+000f80: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000f90: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+000fa0: 06 07 07 07 07 06 07 07 07 07 06 07 07 07 07 06
+000fb0: 06 07 06 06 06 06 07 07 06 06 06 07 07 06 07 06
+000fc0: 06 07 07 07 07 06 07 07 06 06 06 07 07 06 07 06
+000fd0: 06 06 06 07 07 06 07 07 06 06 06 07 07 06 07 06
+000fe0: 06 07 07 07 07 06 07 07 07 07 06 07 07 07 07 06
+000ff0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001000: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001010: 07 07 07 07 06 07 07 07 07 06 07 07 07 07 06 07
+001020: 07 06 06 06 06 07 07 06 06 06 07 07 06 07 06 07
+001030: 07 07 07 07 06 07 07 06 06 06 07 07 06 07 06 07
+001040: 06 06 07 07 06 07 07 06 06 06 07 07 06 07 06 07
+001050: 07 07 07 07 06 07 07 07 07 06 07 07 07 07 06 07
+001060: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001070: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001080: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001090: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0010a0: 07 07 07 07 06 07 07 07 07 06 07 07 06 06 06 06
+0010b0: 07 07 06 07 06 07 07 06 06 06 07 07 06 06 06 06
+0010c0: 07 07 07 06 06 07 07 07 07 06 06 06 06 06 06 07
+0010d0: 07 07 06 07 06 07 07 06 06 06 07 07 06 06 07 06
+0010e0: 07 07 06 07 06 07 07 07 07 06 07 07 06 06 07 07
+0010f0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001100: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001110: 07 07 07 06 07 07 07 07 06 07 07 06 06 06 06 06
+001120: 07 06 07 06 07 07 06 06 06 07 07 06 06 06 06 07
+001130: 07 07 06 06 07 07 07 07 06 06 06 06 06 06 07 07
+001140: 07 06 07 06 07 07 06 06 06 07 07 06 06 07 06 07
+001150: 07 06 07 06 07 07 07 07 06 07 07 06 06 07 07 07
+001160: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001170: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001180: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001190: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0011a0: 06 07 07 07 06 06 06 06 06 07 07 06 06 06 06 07
+0011b0: 07 06 07 07 06 06 06 06 07 07 07 06 06 06 06 06
+0011c0: 06 07 07 06 06 06 06 07 07 07 06 06 06 07 07 07
+0011d0: 07 07 06 06 06 06 07 07 07 06 06 06 07 07 06 06
+0011e0: 07 06 06 06 06 07 07 07 06 06 06 06 07 07 07 06
+0011f0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001200: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001210: 07 07 07 06 06 07 07 07 07 07 06 06 06 06 07 07
+001220: 07 07 06 06 06 06 06 07 07 07 06 06 06 07 06 07
+001230: 07 06 06 06 06 06 07 07 07 06 06 06 07 07 07 07
+001240: 07 06 06 06 06 07 07 07 06 06 06 07 06 07 07 06
+001250: 06 06 06 06 07 07 07 06 06 06 06 07 07 07 06 06
+001260: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001270: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001280: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001290: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0012a0: 07 07 06 06 06 06 07 07 07 06 06 06 07 06 06 07
+0012b0: 07 07 06 06 07 06 06 07 07 06 06 07 06 06 07 07
+0012c0: 07 06 06 06 06 07 07 07 06 06 06 06 07 07 07 06
+0012d0: 06 06 06 07 06 07 07 06 06 06 06 07 07 07 06 06
+0012e0: 06 06 06 07 07 07 06 06 06 06 07 07 07 06 06 06
+0012f0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001300: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001310: 07 06 06 06 06 07 07 07 06 06 06 06 06 06 06 06
+001320: 07 06 06 06 07 06 07 07 06 06 06 06 06 06 06 06
+001330: 06 06 06 06 07 07 07 06 06 06 06 06 06 06 06 06
+001340: 06 06 06 07 07 07 06 06 06 06 06 06 06 06 06 06
+001350: 06 06 07 07 07 06 06 06 06 06 06 06 06 06 06 06
+001360: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001370: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001380: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+001390: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06
+0013a0: 06 06 06 07 07 07 07 06 06 06 06 06 06 06 06 06
+0013b0: 06 06 07 07 06 06 06 06 06 06 06 06 06 06 06 06
+0013c0: 06 06 07 07 07 06 06 06 06 06 06 06 06 06 06 06
+0013d0: 06 06 06 07 07 06 06 06 06 06 06 06 06 06 06 06
+0013e0: 06 07 07 07 06 06 06 06 06 06 06 06 06 06 06 06
+0013f0: 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 \ No newline at end of file
diff --git a/src/static/slime.hex b/src/static/slime.hex
new file mode 100644
index 0000000..ce20533
--- /dev/null
+++ b/src/static/slime.hex
@@ -0,0 +1,24 @@
+;slime sprite
+;indices: 4
+;23 32 56
+;25 51 45
+;70 130 50
+;117 167 67
+
+00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+40: 00 00 00 00 01 01 01 01 01 01 00 00 00 00 00 00
+50: 00 00 00 01 03 03 03 03 03 03 01 00 00 00 00 00
+60: 00 00 01 03 03 03 03 03 03 03 03 01 00 00 00 00
+70: 00 01 03 03 03 03 03 03 03 01 02 03 01 00 00 00
+80: 01 03 03 03 01 02 03 03 03 01 01 03 03 01 00 00
+90: 01 03 03 03 01 01 03 03 03 03 03 03 03 03 01 00
+a0: 01 03 03 03 03 03 03 03 02 03 03 03 03 03 02 01
+b0: 01 02 03 03 03 03 03 03 03 03 03 03 03 02 02 01
+c0: 00 01 02 03 03 03 03 03 03 03 03 02 02 02 02 01
+d0: 00 00 01 02 02 03 03 03 02 02 02 02 02 02 01 00
+e0: 00 00 00 01 02 02 02 02 02 02 02 02 02 01 00 00
+f0: 00 00 00 00 01 01 01 01 01 01 01 01 01 00 00 00
+
diff --git a/src/static/world.h b/src/static/world.h
new file mode 100644
index 0000000..081b157
--- /dev/null
+++ b/src/static/world.h
@@ -0,0 +1 @@
+#define HH_TM_WORLD_DUMMY_OFFSET (HH_TM_WORLD_OFFSET + 5)
diff --git a/src/static/world.hex b/src/static/world.hex
new file mode 100644
index 0000000..446f3dd
--- /dev/null
+++ b/src/static/world.hex
@@ -0,0 +1,514 @@
+;TODO split up file
+;Tilemap (all current tiles)
+0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0100: 06 06 06 06 06 05 06 06 06 06 06 05 06 06 06 06
+0110: 06 05 05 05 05 03 05 05 05 05 05 03 05 05 05 05
+0120: 06 05 04 04 04 03 05 05 05 05 05 03 05 05 05 05
+0130: 06 04 04 04 04 02 02 02 02 02 02 02 02 02 02 02
+0140: 06 04 04 04 04 02 02 03 03 03 03 03 03 02 03 03
+0150: 05 04 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+0160: 05 04 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+0170: 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02 02
+0180: 06 06 04 04 04 04 04 02 02 02 03 03 03 03 02 02
+0190: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+01a0: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03 02
+01b0: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+01c0: 00 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03
+01d0: 00 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03
+01e0: 00 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03
+01f0: 06 06 06 05 05 05 02 02 02 02 02 02 02 02 02 02
+0200: 06 06 06 05 06 06 06 06 06 06 06 05 06 06 06 06
+0210: 05 05 05 03 05 05 05 05 05 05 05 03 05 05 05 05
+0220: 05 05 05 03 05 05 05 05 05 05 05 03 05 05 05 05
+0230: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0240: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+0250: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+0260: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+0270: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0280: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0290: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+02a0: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+02b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+02c0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+02d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+02e0: 02 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+02f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0300: 06 06 06 05 06 06 06 06 06 06 05 06 06 06 06 06
+0310: 05 05 05 03 05 05 05 05 05 05 03 05 05 05 05 06
+0320: 05 05 05 03 05 05 05 05 05 05 03 04 04 05 05 06
+0330: 02 02 02 02 02 02 02 02 02 02 02 04 04 04 04 06
+0340: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 06
+0350: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 05
+0360: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 05
+0370: 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 05
+0380: 03 03 03 03 03 03 03 02 04 04 04 04 04 05 05 00
+0390: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+03a0: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+03b0: 02 02 02 02 02 02 02 02 02 02 02 05 05 06 06 06
+03c0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 06
+03d0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 06
+03e0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 05
+03f0: 02 02 02 02 02 02 02 02 02 02 02 02 03 03 03 05
+0400: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0410: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0420: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 02 02
+0430: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+0440: 00 05 04 04 04 03 02 03 03 03 03 03 03 02 03 03
+0450: 00 05 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+0460: 00 04 04 04 04 02 03 03 03 03 03 02 02 02 02 03
+0470: 06 06 05 05 02 02 02 02 02 02 02 02 02 02 02 02
+0480: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0490: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+04a0: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03 02
+04b0: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+04c0: 00 05 05 04 04 04 04 03 02 03 03 03 03 03 03 03
+04d0: 00 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03
+04e0: 00 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03
+04f0: 00 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02
+0500: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+0510: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+0520: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+0530: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0540: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+0550: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+0560: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+0570: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0580: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+0590: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+05a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+05b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+05c0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+05d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+05e0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+05f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0600: 03 03 03 02 03 03 03 03 03 03 03 02 04 04 05 00
+0610: 03 03 03 02 03 03 03 03 03 03 03 02 04 04 05 00
+0620: 03 03 02 02 03 03 03 03 03 03 03 02 04 04 04 00
+0630: 02 02 02 02 02 02 02 02 02 02 02 02 02 06 06 06
+0640: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 06
+0650: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 05
+0660: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 05
+0670: 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 05
+0680: 03 03 03 03 03 03 03 02 04 04 04 04 04 05 05 00
+0690: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+06a0: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+06b0: 02 02 02 02 02 02 02 02 02 02 02 03 03 06 06 06
+06c0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 06
+06d0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 05
+06e0: 03 02 03 03 03 03 03 03 03 02 04 04 04 04 04 05
+06f0: 02 02 02 02 02 02 02 02 02 02 02 02 03 03 03 05
+0700: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0710: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0720: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 02 02
+0730: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+0740: 00 05 04 04 04 03 02 03 03 03 03 03 03 02 03 03
+0750: 00 05 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+0760: 00 04 04 04 04 02 03 03 03 03 03 02 02 02 02 03
+0770: 06 06 05 05 02 02 02 02 02 02 02 02 02 02 02 02
+0780: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0790: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+07a0: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03 02
+07b0: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+07c0: 00 05 05 04 04 04 04 04 04 04 04 02 02 02 02 04
+07d0: 00 05 05 04 04 04 04 04 04 04 04 04 02 04 04 04
+07e0: 00 06 05 05 05 04 04 04 04 04 04 04 03 04 04 04
+07f0: 00 06 06 06 05 05 05 05 05 05 05 05 03 05 05 05
+0800: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+0810: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+0820: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+0830: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0840: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+0850: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+0860: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+0870: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0880: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+0890: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+08a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+08b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+08c0: 04 04 04 04 04 04 04 04 03 03 03 04 04 04 04 04
+08d0: 04 04 04 04 04 04 04 04 04 03 03 04 04 04 04 04
+08e0: 04 04 04 04 04 04 04 04 04 03 04 04 04 04 04 04
+08f0: 05 05 05 05 05 05 05 05 05 03 05 05 05 05 05 05
+0900: 03 03 03 02 03 03 03 03 03 03 03 02 04 04 05 00
+0910: 03 03 03 02 03 03 03 03 03 03 03 02 04 04 05 00
+0920: 03 03 02 02 03 03 03 03 03 03 03 02 04 04 04 00
+0930: 02 02 02 02 02 02 02 02 02 02 02 02 02 06 06 06
+0940: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 06
+0950: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 05
+0960: 03 03 03 03 03 02 03 03 03 02 04 04 04 04 04 05
+0970: 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 05
+0980: 03 03 03 03 03 03 03 02 04 04 04 04 04 05 05 00
+0990: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+09a0: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+09b0: 02 02 02 02 02 02 03 03 03 03 03 03 03 06 06 06
+09c0: 04 04 03 03 03 04 04 04 04 04 04 04 04 04 05 06
+09d0: 04 04 04 03 03 04 04 04 04 04 04 04 04 05 05 05
+09e0: 04 04 04 03 04 04 04 04 04 04 04 05 05 05 05 06
+09f0: 05 05 05 03 05 05 05 05 05 05 05 05 05 06 06 06
+0a00: 06 06 06 06 06 05 06 06 06 06 06 05 06 06 06 06
+0a10: 06 05 05 05 05 03 05 05 05 05 05 03 05 05 05 05
+0a20: 06 05 04 04 04 03 05 05 05 05 05 03 05 05 05 05
+0a30: 06 04 04 04 04 02 02 02 02 02 02 02 02 02 02 02
+0a40: 06 04 04 04 04 02 02 03 03 03 03 03 03 02 03 03
+0a50: 05 04 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+0a60: 05 04 04 04 04 02 03 03 03 03 03 03 03 02 03 03
+0a70: 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02 02
+0a80: 06 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0a90: 05 04 04 04 04 04 04 02 03 03 03 03 03 03 03 02
+0aa0: 05 04 04 04 04 04 04 02 02 03 03 03 03 03 03 02
+0ab0: 05 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02
+0ac0: 00 05 05 04 04 04 04 04 04 04 04 02 02 02 02 04
+0ad0: 00 05 05 04 04 04 04 04 04 04 04 04 02 04 04 04
+0ae0: 00 06 05 05 05 04 04 04 04 04 04 04 03 04 04 04
+0af0: 00 06 06 06 05 05 05 05 05 05 05 05 03 05 05 05
+0b00: 06 06 06 05 06 06 06 06 06 06 06 05 06 06 06 06
+0b10: 05 05 05 03 05 05 05 05 05 05 05 03 05 05 05 05
+0b20: 05 05 05 03 05 05 05 05 05 05 05 03 05 05 05 05
+0b30: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0b40: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+0b50: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+0b60: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+0b70: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0b80: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+0b90: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+0ba0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+0bb0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+0bc0: 04 04 04 04 04 04 04 04 03 03 03 04 04 04 04 04
+0bd0: 04 04 04 04 04 04 04 04 04 03 03 04 04 04 04 04
+0be0: 04 04 04 04 04 04 04 04 04 03 04 04 04 04 04 04
+0bf0: 05 05 05 05 05 05 05 05 05 03 05 05 05 05 05 05
+0c00: 06 06 06 05 06 06 06 06 06 06 05 06 06 06 06 06
+0c10: 05 05 05 03 05 05 05 05 05 05 03 05 05 05 05 06
+0c20: 05 05 05 03 05 05 05 05 05 05 03 04 04 05 05 06
+0c30: 02 02 02 02 02 02 02 02 02 02 02 04 04 04 04 06
+0c40: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 06
+0c50: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 05
+0c60: 03 03 03 03 03 02 03 03 03 03 02 04 04 04 04 05
+0c70: 02 02 02 02 02 02 02 02 02 02 02 03 03 03 03 05
+0c80: 03 03 03 03 03 03 03 02 04 04 04 04 04 05 05 00
+0c90: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+0ca0: 03 03 03 03 03 03 03 02 04 04 04 04 04 04 05 00
+0cb0: 02 02 02 02 02 02 03 03 03 03 03 03 03 06 06 06
+0cc0: 04 04 03 03 03 04 04 04 04 04 04 04 04 04 05 06
+0cd0: 04 04 04 03 03 04 04 04 04 04 04 04 04 05 05 05
+0ce0: 04 04 04 03 04 04 04 04 04 04 04 05 05 05 05 06
+0cf0: 05 05 05 03 05 05 05 05 05 05 05 05 05 06 06 06
+0d00: 06 06 06 06 06 05 06 06 06 06 05 06 06 06 06 06
+0d10: 06 05 05 05 05 03 05 05 05 05 03 05 05 05 05 06
+0d20: 06 05 04 04 04 03 05 05 05 05 03 04 04 05 05 06
+0d30: 06 04 04 04 04 02 02 02 02 02 02 04 04 04 04 06
+0d40: 06 04 04 04 04 02 02 03 03 03 02 04 04 04 04 06
+0d50: 05 04 04 04 04 02 03 03 03 03 02 04 04 04 04 05
+0d60: 05 04 04 04 04 02 03 03 03 03 02 04 04 04 04 05
+0d70: 03 03 03 03 03 02 02 02 02 02 02 03 03 03 03 05
+0d80: 06 06 04 04 04 04 04 02 04 04 04 04 04 05 05 00
+0d90: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+0da0: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+0db0: 05 03 03 03 03 03 02 02 02 02 02 05 05 06 06 06
+0dc0: 00 05 04 04 04 04 04 04 03 02 04 04 04 04 04 06
+0dd0: 00 05 04 04 04 04 04 04 03 02 04 04 04 04 04 06
+0de0: 00 05 04 04 04 04 04 04 03 02 04 04 04 04 04 05
+0df0: 06 06 06 05 05 05 02 02 02 02 02 02 03 03 03 05
+0e00: 06 04 04 04 04 04 04 02 03 03 03 02 04 04 05 00
+0e10: 05 04 04 04 04 04 04 02 03 03 03 02 04 04 05 00
+0e20: 05 04 04 04 04 04 04 02 03 03 03 02 04 04 04 00
+0e30: 05 03 03 03 03 03 02 02 02 02 02 02 02 06 06 06
+0e40: 00 05 04 04 04 03 02 03 03 02 04 04 04 04 04 06
+0e50: 00 05 04 04 04 02 03 03 03 02 04 04 04 04 04 05
+0e60: 00 04 04 04 04 02 03 03 03 02 03 04 04 04 04 05
+0e70: 06 06 05 05 02 02 02 02 02 02 02 03 03 03 03 05
+0e80: 06 04 04 04 04 04 04 02 04 04 04 04 04 05 05 00
+0e90: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+0ea0: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+0eb0: 05 03 03 03 03 03 02 02 02 02 02 03 03 06 06 06
+0ec0: 00 05 05 04 04 04 03 03 03 03 03 04 04 04 04 06
+0ed0: 00 05 04 04 04 04 03 03 03 03 04 04 04 04 04 05
+0ee0: 00 05 04 04 04 03 03 03 03 03 04 04 04 04 04 05
+0ef0: 00 05 03 03 03 03 03 02 02 02 02 02 03 03 03 05
+0f00: 06 04 04 04 04 04 04 02 03 03 03 02 04 04 05 00
+0f10: 05 04 04 04 04 04 04 02 03 03 03 02 04 04 05 00
+0f20: 05 04 04 04 04 04 04 02 03 03 03 02 04 04 04 00
+0f30: 05 03 03 03 03 03 02 02 02 02 02 02 02 06 06 06
+0f40: 00 05 04 04 04 03 02 03 03 02 04 04 04 04 04 06
+0f50: 00 05 04 04 04 02 03 03 03 02 04 04 04 04 04 05
+0f60: 00 04 04 04 04 02 03 03 03 02 04 04 04 04 04 05
+0f70: 06 06 05 05 02 02 02 02 02 02 02 03 03 03 03 05
+0f80: 06 04 04 04 04 04 04 02 04 04 04 04 04 05 05 00
+0f90: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+0fa0: 05 04 04 04 04 04 04 02 04 04 04 04 04 04 05 00
+0fb0: 05 03 03 03 03 03 02 02 03 03 03 03 03 06 06 06
+0fc0: 00 05 05 04 04 04 04 04 04 04 04 04 04 04 05 06
+0fd0: 00 05 05 04 04 04 04 04 04 04 04 04 04 05 05 05
+0fe0: 00 06 05 05 05 04 04 04 04 04 04 05 05 05 05 06
+0ff0: 00 06 06 06 05 05 05 05 05 05 05 05 05 06 06 06
+1000: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+1010: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+1020: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+1030: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1040: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+1050: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+1060: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+1070: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1080: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+1090: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+10a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+10b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+10c0: 02 02 02 03 03 03 03 03 03 02 03 03 03 04 04 04
+10d0: 03 02 03 03 03 03 03 03 03 02 03 03 04 04 04 04
+10e0: 03 02 03 03 03 03 03 03 02 02 02 03 04 04 04 04
+10f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1100: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+1110: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+1120: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+1130: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1140: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+1150: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+1160: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+1170: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1180: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+1190: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+11a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+11b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+11c0: 02 02 02 04 04 03 03 03 03 02 03 03 03 03 03 03
+11d0: 04 02 04 04 04 04 03 03 03 02 03 03 03 03 03 03
+11e0: 04 02 04 04 04 04 03 03 02 02 02 03 03 03 03 03
+11f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1200: 03 03 02 02 02 03 03 03 03 03 03 02 02 05 05 05
+1210: 03 03 03 02 03 03 03 03 03 03 03 02 03 05 05 05
+1220: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 05 05
+1230: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1240: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+1250: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+1260: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+1270: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1280: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+1290: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+12a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+12b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+12c0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+12d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+12e0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+12f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1300: 06 05 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+1310: 05 05 05 02 03 03 03 03 03 03 03 02 03 03 03 03
+1320: 05 05 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+1330: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1340: 03 03 03 03 02 02 03 03 03 03 03 03 03 02 03 03
+1350: 03 03 03 03 03 02 03 03 03 03 03 03 03 02 03 03
+1360: 03 03 03 03 03 02 03 03 03 03 03 03 02 02 02 03
+1370: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1380: 02 03 03 03 03 03 03 02 03 03 03 03 03 03 02 02
+1390: 03 03 03 03 03 03 03 02 03 03 03 03 03 03 03 02
+13a0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+13b0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+13c0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+13d0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+13e0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+13f0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1400: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1410: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1420: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1430: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1440: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1450: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1460: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1470: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1480: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1490: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+14a0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+14b0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+14c0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+14d0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+14e0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+14f0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1500: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+1510: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+1520: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+1530: 02 02 02 02 02 02 02 02 02 02 02 02 02 01 01 01
+1540: 03 03 03 03 02 02 03 03 02 02 02 02 02 01 02 02
+1550: 03 03 03 03 03 02 02 02 02 02 02 02 02 01 02 02
+1560: 03 03 03 03 03 01 02 02 02 02 02 02 01 01 01 02
+1570: 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01
+1580: 02 03 03 03 02 02 02 01 02 02 02 02 02 02 01 01
+1590: 03 03 03 03 02 02 02 01 02 02 02 02 02 02 02 01
+15a0: 03 03 03 03 02 02 01 01 01 01 02 02 02 02 01 01
+15b0: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+15c0: 02 02 02 03 03 02 02 02 02 01 02 02 02 01 01 01
+15d0: 03 02 03 03 03 02 02 02 02 01 02 02 01 01 01 01
+15e0: 03 02 03 03 03 03 02 02 01 01 01 02 01 01 01 01
+15f0: 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01
+1600: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+1610: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+1620: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+1630: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1640: 02 02 02 02 01 01 02 02 02 02 02 02 02 01 02 02
+1650: 02 02 02 02 02 01 02 02 02 02 02 02 02 01 02 02
+1660: 02 02 02 02 02 01 02 02 02 02 02 02 01 01 01 02
+1670: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1680: 01 02 02 02 02 02 02 01 02 02 02 02 02 02 01 01
+1690: 01 02 02 02 02 02 02 01 02 02 02 02 02 02 02 01
+16a0: 01 02 02 02 01 01 01 01 01 01 02 02 02 02 02 01
+16b0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+16c0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+16d0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+16e0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+16f0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1700: 03 03 02 02 02 03 03 03 03 03 03 02 02 03 03 03
+1710: 03 03 03 02 03 03 03 03 03 03 03 02 03 03 03 03
+1720: 03 03 03 02 03 03 03 03 03 03 02 02 02 03 03 03
+1730: 01 01 01 01 02 02 02 02 02 02 02 02 02 02 02 02
+1740: 02 02 02 02 01 01 03 03 03 03 03 03 03 02 03 03
+1750: 02 02 02 02 02 01 02 02 03 03 03 03 03 02 03 03
+1760: 02 02 02 02 02 01 02 02 02 03 03 03 02 02 02 03
+1770: 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02 02
+1780: 01 02 02 02 02 02 02 01 02 02 03 03 03 03 02 02
+1790: 02 02 02 02 02 02 02 01 02 02 02 03 03 03 03 02
+17a0: 02 02 02 02 02 02 01 01 01 01 02 03 03 03 03 02
+17b0: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+17c0: 01 01 01 02 02 02 02 02 02 01 02 03 03 03 03 03
+17d0: 01 01 02 02 02 02 02 02 02 01 02 03 03 03 03 03
+17e0: 01 01 02 02 02 02 02 02 01 01 01 03 03 03 03 03
+17f0: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+1800: 03 03 02 02 02 02 02 02 02 02 02 01 01 01 01 01
+1810: 03 03 03 02 03 02 02 02 02 02 02 01 01 01 01 01
+1820: 03 03 03 02 03 02 02 02 02 02 01 01 01 01 01 01
+1830: 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01
+1840: 03 03 03 03 02 01 02 02 02 02 02 02 01 01 01 01
+1850: 03 03 03 03 02 01 02 02 02 02 02 02 01 01 01 01
+1860: 03 03 03 03 02 01 02 02 02 02 02 01 01 01 01 01
+1870: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+1880: 02 03 03 03 02 02 02 01 02 02 02 01 01 01 01 01
+1890: 03 03 03 03 02 02 02 01 02 02 02 01 01 01 01 01
+18a0: 03 03 03 03 02 02 01 01 01 01 02 01 01 01 01 01
+18b0: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+18c0: 02 02 02 03 02 02 02 02 02 01 02 02 01 01 01 01
+18d0: 03 02 03 03 03 02 02 02 02 01 02 02 02 01 01 01
+18e0: 03 02 03 03 02 02 02 02 01 01 01 02 02 01 01 01
+18f0: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+1900: 01 01 01 01 01 02 02 02 02 02 02 02 02 03 03 03
+1910: 01 01 01 01 02 02 02 02 02 02 02 02 03 03 03 03
+1920: 01 01 01 01 02 02 02 02 02 02 02 02 02 03 03 03
+1930: 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02 02
+1940: 01 01 01 01 01 02 02 02 02 02 03 03 03 02 03 03
+1950: 01 01 01 01 01 02 02 02 02 02 03 03 03 02 03 03
+1960: 01 01 01 01 01 01 02 02 02 02 03 03 02 02 02 03
+1970: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+1980: 01 01 01 01 02 02 02 01 02 02 02 03 03 03 02 02
+1990: 01 01 01 01 02 02 02 01 02 02 02 03 03 03 03 02
+19a0: 01 01 01 01 01 02 01 01 01 01 02 03 03 03 03 02
+19b0: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+19c0: 01 01 01 01 01 02 02 02 02 01 02 03 03 03 03 03
+19d0: 01 01 01 01 02 02 02 02 02 01 02 03 03 03 03 03
+19e0: 01 01 01 01 02 02 02 02 01 01 02 03 03 03 03 03
+19f0: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+1a00: 03 03 02 02 01 02 02 02 02 02 02 01 01 02 01 01
+1a10: 03 03 03 02 02 02 02 02 02 02 02 01 02 02 02 01
+1a20: 03 03 03 02 02 02 02 02 02 02 01 01 01 02 02 02
+1a30: 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01
+1a40: 03 03 03 03 01 01 02 02 02 02 02 02 02 01 02 02
+1a50: 03 03 03 03 02 01 02 02 02 02 02 02 02 01 02 02
+1a60: 03 03 03 03 03 01 02 02 02 02 02 02 01 01 01 02
+1a70: 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01
+1a80: 02 03 03 03 03 03 02 01 02 02 02 02 02 02 01 01
+1a90: 03 03 03 03 03 03 03 02 02 02 02 02 02 02 02 01
+1aa0: 03 03 03 03 03 03 02 02 02 02 03 03 03 03 03 02
+1ab0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1ac0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+1ad0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+1ae0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+1af0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1b00: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1b10: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1b20: 02 01 01 01 01 01 01 01 01 01 01 01 01 01 02 02
+1b30: 01 01 01 01 01 01 01 01 02 02 02 02 01 01 01 01
+1b40: 02 02 02 02 01 01 02 02 02 02 02 02 02 01 02 02
+1b50: 02 02 02 02 02 01 02 02 02 02 02 02 02 01 02 02
+1b60: 02 02 02 02 02 01 02 02 02 02 02 02 01 01 01 02
+1b70: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+1b80: 01 02 02 02 02 02 02 01 02 02 02 02 02 02 01 01
+1b90: 02 02 02 02 02 02 02 01 02 02 02 02 02 02 02 01
+1ba0: 03 03 02 02 02 02 01 01 01 01 02 02 02 02 02 01
+1bb0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1bc0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+1bd0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+1be0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+1bf0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1c00: 01 01 01 01 01 02 02 02 02 02 02 02 02 03 03 03
+1c10: 02 02 02 01 02 02 02 02 02 02 02 02 03 03 03 03
+1c20: 02 02 02 01 02 02 02 02 02 02 01 02 02 03 03 03
+1c30: 01 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02
+1c40: 02 02 02 02 01 01 02 02 02 02 02 03 03 02 03 03
+1c50: 02 02 02 02 02 01 02 02 02 02 02 03 03 02 03 03
+1c60: 02 02 02 02 02 01 02 02 02 02 02 03 02 02 02 03
+1c70: 01 01 01 01 01 01 01 01 01 01 02 02 02 02 02 02
+1c80: 01 02 02 02 02 02 02 01 02 02 03 03 03 03 02 02
+1c90: 02 02 02 02 02 02 02 01 02 03 03 03 03 03 03 02
+1ca0: 02 02 02 02 02 02 01 02 02 02 03 03 03 03 03 02
+1cb0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1cc0: 02 02 02 03 03 03 03 03 03 02 03 03 03 03 03 03
+1cd0: 03 02 03 03 03 03 03 03 03 02 03 03 03 03 03 03
+1ce0: 03 02 03 03 03 03 03 03 02 02 02 03 03 03 03 03
+1cf0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+1d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1d10: 00 00 01 01 01 01 01 00 00 00 01 01 01 00 00 00
+1d20: 00 00 00 00 01 00 00 00 00 01 00 00 00 01 00 00
+1d30: 00 00 00 00 01 00 00 00 00 01 00 00 00 01 00 00
+1d40: 00 00 00 00 01 00 00 00 00 01 00 00 00 01 00 00
+1d50: 00 00 00 00 01 00 00 00 00 01 00 00 00 01 00 00
+1d60: 00 00 00 00 01 00 00 00 00 00 01 01 01 00 00 00
+1d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1d80: 00 00 01 01 01 01 00 00 00 00 01 01 01 00 00 00
+1d90: 00 00 01 00 00 00 01 00 00 01 00 00 00 01 00 00
+1da0: 00 00 01 00 00 00 01 00 00 01 00 00 00 01 00 00
+1db0: 00 00 01 00 00 00 01 00 00 01 00 00 00 01 00 00
+1dc0: 00 00 01 00 00 00 01 00 00 01 00 00 00 01 00 00
+1dd0: 00 00 01 01 01 01 00 00 00 00 01 01 01 00 00 00
+1de0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1df0: 00 00 01 01 01 01 01 01 01 01 01 01 01 01 01 00
+1e00: 00 00 00 00 00 00 00 01 01 01 00 00 00 00 00 00
+1e10: 00 00 00 00 00 00 01 01 01 01 01 00 00 00 00 00
+1e20: 00 00 00 00 00 01 01 01 01 01 01 01 00 00 00 00
+1e30: 00 00 00 00 00 01 01 01 01 01 01 01 00 00 00 00
+1e40: 00 00 00 00 00 01 01 01 01 01 01 01 00 00 00 00
+1e50: 00 00 00 00 00 01 01 01 01 01 01 01 00 00 00 00
+1e60: 00 00 00 00 00 01 01 01 01 01 01 01 00 00 00 00
+1e70: 00 00 00 00 00 00 01 01 01 01 01 00 00 00 00 00
+1e80: 00 00 00 00 00 00 01 01 01 01 01 00 00 00 00 00
+1e90: 00 00 00 00 00 00 00 01 01 01 00 00 00 00 00 00
+1ea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1eb0: 00 00 00 00 00 00 00 01 01 01 00 00 00 00 00 00
+1ec0: 00 00 00 00 00 00 01 01 01 01 01 00 00 00 00 00
+1ed0: 00 00 00 00 00 00 01 01 01 01 01 00 00 00 00 00
+1ee0: 00 00 00 00 00 00 01 01 01 01 01 00 00 00 00 00
+1ef0: 00 00 00 00 00 00 00 01 01 01 00 00 00 00 00 00
+1f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1f30: 00 00 00 00 00 01 01 01 01 01 01 00 00 00 00 00
+1f40: 00 00 00 00 00 01 00 00 00 00 01 00 00 00 00 00
+1f50: 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00
+1f60: 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00
+1f70: 00 00 00 00 00 00 00 00 00 01 01 00 00 00 00 00
+1f80: 00 00 00 00 00 00 00 00 01 01 00 00 00 00 00 00
+1f90: 00 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00
+1fa0: 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00
+1fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1fe0: 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00
+1ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
diff --git a/src/stm32/setup.c b/src/stm32/setup.c
index 2c3552b..2102347 100644
--- a/src/stm32/setup.c
+++ b/src/stm32/setup.c
@@ -8,6 +8,10 @@
#include "main.h"
#include "setup.h"
#include "ppu/ppu.h"
+#include "tilemap.h"
+
+// hex(0x0803_ffff - 0xd000 + 1) (stm32f091rc rm0091 table 5, flash memory organization)
+uint32_t* g_hh_tilemap_rom = 0x08033000;
UART_HandleTypeDef huart2 = {
.Instance = USART2,
diff --git a/src/tilemap.h b/src/tilemap.h
new file mode 100644
index 0000000..2f8b709
--- /dev/null
+++ b/src/tilemap.h
@@ -0,0 +1,7 @@
+#pragma once
+#include <stdint.h>
+
+#include "static/tilemap.h"
+
+extern uint32_t* g_hh_tilemap_rom;
+