aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/tasks.json2
-rw-r--r--src/.gitignore1
-rw-r--r--src/demo.c74
-rw-r--r--src/engine/TODO/entity.c41
-rw-r--r--src/engine/TODO/entity.h24
-rw-r--r--src/engine/TODO/player_controller.h4
-rw-r--r--src/engine/TODO/sprite_controller.h6
-rw-r--r--src/engine/camera.c34
-rw-r--r--src/engine/camera.h6
-rw-r--r--src/engine/draw_screen.c27
-rw-r--r--src/engine/draw_screen.h2
-rw-r--r--src/engine/engine.c1
-rw-r--r--src/engine/entity.c46
-rw-r--r--src/engine/entity.h57
-rw-r--r--src/engine/maths.c19
-rw-r--r--src/engine/maths.h7
-rw-r--r--src/engine/player_controller.c167
-rw-r--r--src/engine/player_controller.h7
-rw-r--r--src/engine/sprite_controller.c22
-rw-r--r--src/engine/sprite_controller.h106
-rw-r--r--src/makefile7
-rw-r--r--src/ppusim/input.c1
-rw-r--r--src/ppusim/sim.c11
-rw-r--r--test/bin/exportingPalettes.md4
-rw-r--r--test/bin/test_file_read.c13
-rw-r--r--test/bin/tilemap.pip512
26 files changed, 1046 insertions, 155 deletions
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 53a235e..8404cfa 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -54,7 +54,7 @@
"args": [ "" ],
},
"command": "make",
- "args": [ "compile_commands" ],
+ "args": [ "compile_commands.json" ],
"type": "shell"
},
{
diff --git a/src/.gitignore b/src/.gitignore
index d8325cf..504b995 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -4,3 +4,4 @@ main.bin
main
main.exe
static/
+*.bin
diff --git a/src/demo.c b/src/demo.c
index baaf73d..95347cb 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -1,12 +1,18 @@
#include <math.h>
#include "demo.h"
-#include "entity.h"
#include "input.h"
+#include "entity.h"
#include "ppu/ppu.h"
-#define HH_DEMO_BALL_COUNT 1
-hh_s_ppu_loc_fam_entry g_hh_demo_balls[HH_DEMO_BALL_COUNT];
+#include "engine/maths.h"
+#include "engine/camera.h"
+#include "engine/entity.h"
+#include "engine/draw_screen.h"
+#include "engine/player_controller.h"
+#include "engine/sprite_controller.h"
+
+
hh_s_entity_player g_hh_player_1 = {
.pos_x = 31000, // 0b0000 0001 0011 0110
@@ -32,64 +38,26 @@ uint8_t g_hh_data_send[3];
int g_hh_tile_x;
int g_hh_tile_y;
-void hh_demo_setup() {
- // load sprites
- hh_ppu_update_sprite(0, HH_DBG_SPRITE_BALL);
- hh_ppu_update_sprite(1, HH_DBG_SPRITE_CHECKERBOARD);
-
- // background pattern
- hh_ppu_update_color(0, 1, (hh_ppu_rgb_color_t){0x4, 0x4, 0x4});
- for (unsigned i = 0; i < HH_PPU_BG_CANVAS_TILES_H * HH_PPU_BG_CANVAS_TILES_V; i++) {
- hh_ppu_update_background(i, (hh_s_ppu_loc_bam_entry){
- .horizontal_flip = false,
- .vertical_flip = false,
- .palette_index = 0,
- .tilemap_index = 1,
- });
- }
+typedef struct {
+ vec2 pos;
+ uint8_t idx;
+}hh_s_tiles;
- // cool colors
- hh_ppu_update_color(1, 1, (hh_ppu_rgb_color_t){0xf, 0x0, 0xf});
- hh_ppu_update_color(2, 1, (hh_ppu_rgb_color_t){0xf, 0xf, 0xf});
- hh_ppu_update_color(3, 1, (hh_ppu_rgb_color_t){0xf, 0x0, 0x0});
- hh_ppu_update_color(4, 1, (hh_ppu_rgb_color_t){0x0, 0xf, 0xf});
- hh_ppu_update_color(5, 1, (hh_ppu_rgb_color_t){0x0, 0x0, 0xf});
-
- // balls
- for (unsigned i = 0; i < HH_DEMO_BALL_COUNT; i++) {
- g_hh_demo_balls[i].horizontal_flip = false;
- g_hh_demo_balls[i].vertical_flip = false;
- g_hh_demo_balls[i].palette_index = i + 1;
- g_hh_demo_balls[i].tilemap_index = 0;
- }
-}
-
-void hh_demo_loop(unsigned long frame) {
- hh_player_movement();
- // input testing (no hitbox stuff)
- // g_hh_player_1.pos_x += ((-1 * g_hh_controller_p1.dpad_left) + (1 * g_hh_controller_p1.dpad_right)) * g_hh_player_1.speed; // -1 = L || 1 == R
- // g_hh_player_1.pos_y += ((-1 * g_hh_controller_p1.dpad_up) + (1 * g_hh_controller_p1.dpad_down)) * g_hh_player_1.speed; // -1 = D || 1 == U
+hh_entity hh_g_player, hh_g_player_new;
+void hh_demo_setup() {
- // adjust map size
- g_hh_pos_x = g_hh_player_1.pos_x / 100;
- g_hh_pos_y = g_hh_player_1.pos_y / 100;
+ hh_setup_palettes();
+ hh_setup_screen();
+}
+void hh_demo_loop(unsigned long frame) {
+ // hh_player_movement();
- // update player sprite on ppu
- g_hh_demo_balls[0].position_x = g_hh_pos_x;
- g_hh_demo_balls[0].position_y = g_hh_pos_y;
- hh_ppu_update_foreground(0, g_hh_demo_balls[0]);
+ hh_player_actions();
- // set background pattern position
- hh_ppu_update_aux((hh_s_ppu_loc_aux){
- .bg_shift_x = (frame / 2) % HH_PPU_SPRITE_WIDTH,
- .bg_shift_y = (frame / 8) % HH_PPU_SPRITE_HEIGHT,
- .fg_fetch = 0,
- .sysreset = 0,
- });
}
// void sendData(uint8_t address, uint16_t data) {
diff --git a/src/engine/TODO/entity.c b/src/engine/TODO/entity.c
deleted file mode 100644
index fa550d5..0000000
--- a/src/engine/TODO/entity.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <stdbool.h>
-
-#include "hh_entity.h"
-#include "maths.h"
-
-/*
- PLAYER: (pos on X)
- ,___,
- | |
- | X |
- |___|
-
-*/
-
-bool hh_collision(vec2* pos1, vec2* pos2){
- if (pos2->x == CLAMP(pos2->x,pos1->x,pos1->x+1.0f)){// hit x
- return true;
- }
-
- if (pos2->y == CLAMP(pos2->y,pos1->y,pos1->y+0.99f)){// hit y
- return true;
- }
- return false;
-}
-
-void hh_solve_collision(vec2* pos_environment, hh_entity* entity){
- if (entity->vec.x > 0.0f){
- entity->pos.x = MIN(entity->pos.x,pos_environment->x-1.0f);
- entity->vec.x = 0.0f;
- } else if (entity->vec.x < 0.0f){
- entity->pos.x = MAX(entity->pos.x,pos_environment->x+1.0f);
- entity->vec.x = 0.0f;
- } else if (entity->vec.y > 0.0f){
- entity->pos.x = MIN(entity->pos.x,pos_environment->x-1.0f);
- entity->vec.x = 0.0f;
- } else if (entity->vec.y < 0.0f){
- entity->pos.x = MAX(entity->pos.x,pos_environment->x+1.0f);
- entity->vec.x = 0.0f;
- }
-}
-
diff --git a/src/engine/TODO/entity.h b/src/engine/TODO/entity.h
deleted file mode 100644
index fdbeb8a..0000000
--- a/src/engine/TODO/entity.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-
-#include "maths.h"
-
-typedef struct {
- vec2 pos, vec;
- bool is_grounded;
- int8_t hp;
- //armor/block?
-}hh_entity;
-
-/// @brief detect for collision enity and eviroment
-/// @param pos1 position of environment tile to be checked
-/// @param pos2 position entity
-/// @return true if collision between enity and environment
-bool hh_collision(vec2* pos1, vec2* pos2);
-
-/// @brief solve collisions
-/// @param environment position
-/// @param entity position
-/// @return solved new entity position
-void hh_solve_collision(vec2* pos_environment, hh_entity* entity);
diff --git a/src/engine/TODO/player_controller.h b/src/engine/TODO/player_controller.h
deleted file mode 100644
index 1e9b86c..0000000
--- a/src/engine/TODO/player_controller.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "maths.h"
-#include "hh_entity.h"
-
-// inputs
diff --git a/src/engine/TODO/sprite_controller.h b/src/engine/TODO/sprite_controller.h
deleted file mode 100644
index c1fadff..0000000
--- a/src/engine/TODO/sprite_controller.h
+++ /dev/null
@@ -1,6 +0,0 @@
-// handles sprites
-
-// Bg sprites
-
-
-// Fg or entity sprites
diff --git a/src/engine/camera.c b/src/engine/camera.c
new file mode 100644
index 0000000..e756bd4
--- /dev/null
+++ b/src/engine/camera.c
@@ -0,0 +1,34 @@
+#include "engine/camera.h"
+
+#include "ppu/consts.h"
+
+
+vec_cor hh_update_camera(vec_cen new, vec2 min, vec2 max){
+
+ //TODO: change floating point math to fix point math
+ //TODO: fix buggy y-axis ??
+
+ // new = vec_cen2cor(new,(vec2){.x=max.x/2,.y=max.y/2});
+ new = vec_cen2cor((vec2){.x=new.x+(HH_PPU_SPRITE_WIDTH/2),.y=(new.y+(HH_PPU_SPRITE_HEIGHT/2))*2},(vec2){.x=max.x/2,.y=max.y/2});
+ // new.x = new.x << HH_MATH_FIXED_POINT;
+ // new.y = new.y << HH_MATH_FIXED_POINT;
+ static vec_cor old;
+ // old.x = old.x << HH_MATH_FIXED_POINT;
+ // old.y = old.y << HH_MATH_FIXED_POINT;
+
+ // int16_t some = 0;
+ // some = some <<= HH_MATH_FIXED_POINT-1;
+
+ new.x = (int)((float)new.x*0.1f + (float)old.x*0.9f);
+ new.y = (int)((float)new.y*0.1f + (float)old.y*0.9f);
+
+ // old.x = old.x >> HH_MATH_FIXED_POINT;
+ // old.y = old.y >> HH_MATH_FIXED_POINT;
+
+
+ old.x = CLAMP(new.x,min.x,max.x);
+ old.y = CLAMP(new.y,min.y,max.y);
+
+ return old;
+}
+
diff --git a/src/engine/camera.h b/src/engine/camera.h
new file mode 100644
index 0000000..b3ffb52
--- /dev/null
+++ b/src/engine/camera.h
@@ -0,0 +1,6 @@
+#pragma once
+
+#include "engine/maths.h"
+
+vec_cor hh_update_camera(vec_cor new, vec2 min, vec2 max);
+
diff --git a/src/engine/draw_screen.c b/src/engine/draw_screen.c
index acf5b41..c4f3389 100644
--- a/src/engine/draw_screen.c
+++ b/src/engine/draw_screen.c
@@ -1,21 +1,22 @@
-#include "draw_screen.h"
+#include "engine/draw_screen.h"
+#include "engine/sprite_controller.h"
uint8_t hh_world_to_tile(vec2 pos){
- FILE* level = fopen("../test/bin/test_map.bin", "rb"); /* open binary file */
+ FILE* level = fopen("../test/bin/level1_test.bin", "rb"); /* open binary file */
if (!level) { /* check if file opened successfully */
fprintf(stderr, "Error: Failed to open file.\n");
return 0;
}
- int index = (pos.y + pos.x);
+ int index = ((pos.y/16)*40 + pos.x/16);//TODO: remove magic number(s)
fseek(level, (index * sizeof(int)) + sizeof(int), SEEK_SET);
- int* tile = (int*)malloc(sizeof(int));
- fread(tile, sizeof(int), 1, level); // read 1 tile from binary
+ int tile;// = (int*)malloc(sizeof(int));
+ fread(&tile, sizeof(int), 1, level); // read 1 tile from binary
fclose(level);
- int val = *tile;
- free(tile);
- return val;
+ // int val = tile;
+ // free(tile);
+ return tile;
}
@@ -25,8 +26,8 @@ void hh_draw_screen(vec_cor viewport){
if (viewport.x == previousViewport.x && viewport.y == previousViewport.y) return;
hh_ppu_update_aux((hh_s_ppu_loc_aux){
- .bg_shift_x = viewport.x*HH_PPU_SPRITE_WIDTH,
- .bg_shift_y = viewport.y*HH_PPU_SPRITE_HEIGHT,
+ .bg_shift_x = viewport.x,
+ .bg_shift_y = viewport.y,
.fg_fetch = 0,
.sysreset = 0,
});
@@ -37,8 +38,8 @@ void hh_draw_screen(vec_cor viewport){
void hh_setup_screen(){
//(HH_map_size_X*HH_map_size_Y)
- int size = 3200; // max X = 40 en max Y = 80
- FILE* level = fopen("../test/bin/test_map.bin", "rb"); /* open binary file */
+ int size = 2400; // max X = 40 en max Y = 80
+ FILE* level = fopen("../test/bin/level1_test.bin", "rb"); /* open binary file */
if (!level) { /* check if file opened successfully */
fprintf(stderr, "Error: Failed to open file.\n");
return;
@@ -53,7 +54,7 @@ void hh_setup_screen(){
hh_ppu_update_background(BAM_index, (hh_s_ppu_loc_bam_entry){
.horizontal_flip = false,
.vertical_flip = false,
- .palette_index = tile[BAM_index]+1,
+ .palette_index = hh_get_palette(tile[BAM_index]),
.tilemap_index = tile[BAM_index],
});
}
diff --git a/src/engine/draw_screen.h b/src/engine/draw_screen.h
index 8d7df47..b181108 100644
--- a/src/engine/draw_screen.h
+++ b/src/engine/draw_screen.h
@@ -2,7 +2,7 @@
// every function call for drawing the screen goes here.
-#include "../engine/maths.h"
+#include "engine/maths.h"
#include "ppu/ppu.h"
#include <stdio.h>
diff --git a/src/engine/engine.c b/src/engine/engine.c
index f3410a4..799ee7c 100644
--- a/src/engine/engine.c
+++ b/src/engine/engine.c
@@ -1,3 +1,4 @@
#include "engine/draw_screen.h"
#include "engine/level.h"
#include "engine/maths.h"
+#include "engine/sprite_controller.h"
diff --git a/src/engine/entity.c b/src/engine/entity.c
new file mode 100644
index 0000000..153e7e1
--- /dev/null
+++ b/src/engine/entity.c
@@ -0,0 +1,46 @@
+#include <stdbool.h>
+
+#include "engine/entity.h"
+#include "engine/maths.h"
+
+/*
+ PLAYER: (pos on X)
+ ,___,
+ | |
+ | X |
+ |___|
+
+*/
+
+bool hh_collision(vec_cor pos1, vec2 pos2){
+ if (pos2.x == CLAMP(pos2.x, pos1.x, pos1.x+16)){// hit x
+ return true;
+ }
+
+ if (pos2.y == CLAMP(pos2.y, pos1.y, pos1.y+16)){// hit y
+ return true;
+ }
+ return false;
+}
+
+void hh_solve_collision(vec2 pos_environment, hh_entity* entity){
+ if (!hh_collision(pos_environment,entity->pos))
+ return;
+
+ printf("BONK!/n");
+ // if (entity->vel.y > 0){
+ // entity->pos.y = MAX(entity->pos.y,pos_environment.y);
+ // entity->vel.y = 0;
+ // } else {
+ // entity->pos.y = MIN(entity->pos.y,pos_environment.y);
+ // entity->vel.y = 0;
+ // }
+ // if (entity->vel.x <= 0){
+ // entity->pos.x = MIN(entity->pos.x,pos_environment.x-16);
+ // entity->vel.x = 0;
+ // } else {
+ // entity->pos.x = MAX(entity->pos.x,pos_environment.x+16);
+ // entity->vel.x = 0;
+ // }
+}
+
diff --git a/src/engine/entity.h b/src/engine/entity.h
new file mode 100644
index 0000000..f45dae2
--- /dev/null
+++ b/src/engine/entity.h
@@ -0,0 +1,57 @@
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include "ppu/types.h"
+
+#include "engine/maths.h"
+
+typedef uint8_t hh_idx_t;
+
+typedef enum {
+ fire, ice, poison
+}hh_e_damage_t;
+
+typedef struct {
+ hh_s_ppu_loc_fam_entry fam; //screen
+ hh_idx_t frame0;
+ hh_idx_t palette;
+
+}hh_s_rendering;
+
+typedef struct {
+ int8_t hp;
+ int8_t dmg;
+ hh_e_damage_t dmg_type;
+ int8_t speed_x, speed_y;
+
+} hh_s_atributes;
+
+
+typedef struct {
+ vec2 pos, vel, vec;
+ bool is_grounded;
+ int8_t hp;
+ int8_t speed;
+ hh_s_rendering render;
+ //armor/block?
+}hh_entity;
+
+typedef struct {
+ hh_entity p;
+ hh_s_atributes atr;
+}hh_s_player;
+
+
+/// @brief detect for collision enity and eviroment
+/// @param pos1 position of environment tile to be checked
+/// @param pos2 position entity
+/// @return true if collision between enity and environment
+bool hh_collision(vec2 pos1, vec2 pos2);
+
+/// @brief solve collisions
+/// @param environment position
+/// @param entity position
+/// @return solved new entity position
+void hh_solve_collision(vec2 pos_environment, hh_entity* entity);
diff --git a/src/engine/maths.c b/src/engine/maths.c
new file mode 100644
index 0000000..475bba2
--- /dev/null
+++ b/src/engine/maths.c
@@ -0,0 +1,19 @@
+#include "engine/maths.h"
+
+vec2 vec_add(vec2 a, vec2 b){
+ return (vec2){a.x + b.x, a.y + b.y};
+}
+
+vec_cor vec_cen2cor(vec_cen in, vec2 halfDistance){
+ return (vec_cor){
+ .x = in.x - halfDistance.x,
+ .y = in.y - halfDistance.y,
+ };
+}
+
+vec_cen vec_cor2cen(vec_cor in, vec2 halfDistance){
+ return (vec_cen){
+ .x = in.x + halfDistance.x,
+ .y = in.y + halfDistance.y,
+ };
+}
diff --git a/src/engine/maths.h b/src/engine/maths.h
index c7f1b44..bef287e 100644
--- a/src/engine/maths.h
+++ b/src/engine/maths.h
@@ -3,12 +3,17 @@
// #include <math.h>
typedef struct {
- uint32_t x,y;
+ int32_t x,y;
} vec2;
typedef vec2 vec_cen;//centered
typedef vec2 vec_cor;//left upper corner
+vec2 vec_add(vec2 a, vec2 b);
+
+vec_cor vec_cen2cor(vec_cen in, vec2 halfDistance);
+vec_cor vec_cor2cen(vec_cen in, vec2 halfDistance);
+
//fixed point at decimal 7lsb (world positions in pixels (with fixed decimal point))
#define HH_MATH_FIXED_POINT 7
diff --git a/src/engine/player_controller.c b/src/engine/player_controller.c
new file mode 100644
index 0000000..6735620
--- /dev/null
+++ b/src/engine/player_controller.c
@@ -0,0 +1,167 @@
+#include "ppu/types.h"
+#include "engine/camera.h"
+#include "engine/draw_screen.h"
+#include "engine/sprite_controller.h"
+#include "engine/player_controller.h"
+
+#include "demo.h"
+#include <stdio.h>
+
+#include "input.h"
+
+void hh_player_actions() {
+ static hh_entity player={
+ .hp = 4,
+ .speed = 6,
+ .is_grounded = false,
+ .pos = (vec2){32,32},
+ .vel = (vec2){0,0},
+ .vec = (vec2){0,0},
+ .render = {
+ .frame0 = 20,
+ .palette = 7,
+ .fam = (hh_s_ppu_loc_fam_entry){
+ .horizontal_flip = false,
+ .vertical_flip = false,
+ .palette_index = 7,
+ .tilemap_index = 2,
+ }
+ }
+ }, player_new = {0};
+
+ // hh_input_read();
+ player.vel = (vec2){.x = (-1 * g_hh_controller_p1.dpad_left) + (1 * g_hh_controller_p1.dpad_right),
+ .y = (-1 * g_hh_controller_p1.dpad_up) + (1 * g_hh_controller_p1.dpad_down) };
+ // const int8_t maa = 3;
+ // const int8_t mbb = -3;
+ // if (g_hh_controller_p1.dpad_up)
+ //
+ // if (g_hh_controller_p1.dpad_down)
+ //
+ // if (g_hh_controller_p1.dpad_left) {
+ // player.vel.x += mbb;
+ // // g_hh_demo_balls[0].horizontal_flip = true;
+ // }
+ // if (g_hh_controller_p1.dpad_right) {
+ // player.vel.x += maa;
+ // // g_hh_demo_balls[0].horizontal_flip = true;
+ // }
+ // if (g_hh_controller_p1.button_primary /*&& player.is_grounded*/) //JUMP
+ // player.vel.y += -6;
+ // // // if (g_hh_controller_p1.button_secondary)
+
+ // player.render.fam.palette_index = 7;
+ // player.render.fam.tilemap_index = 7;
+
+ // printf("%x ",player.render.fam.palette_index);
+
+ // player.vel.y += 1; //gravity
+
+
+ //END OF VECTOR CHANGES
+ // player.vel.y = CLAMP(player.vel.y,-32,32);
+ // player.vel.x = CLAMP(player.vel.x,-32,32);
+
+ player_new.pos = (vec2){
+ .x = player.pos.x + player.vel.x,
+ .y = player.pos.y + player.vel.y,
+ };
+
+
+
+ // const uint8_t empty = 0;
+ // hh_s_tiles tiles[9];
+ // const vec2 tile_offset[9] = {
+ // (vec2){-16,-16},(vec2){0,-16},(vec2){+16,-16},
+ // (vec2){-16,0}, (vec2){0,0}, (vec2){+16,0},
+ // (vec2){-16,+16},(vec2){0,+16},(vec2){+16,+16},
+ // };
+ // for (int i = 0; i < 9; i++) {
+ // vec2 temp_pos = vec_add(player.pos, tile_offset[i]);
+ // temp_pos =(vec2){
+ // .x = temp_pos.x,
+ // .y = temp_pos.y,
+ // };
+ // hh_s_tiles tile = {
+ // .pos = temp_pos,
+ // .idx = hh_world_to_tile(temp_pos)
+ // };
+ // if(hh_colidable(tile.idx)) {
+ // tiles[i]=tile;
+ // // printf(" collidable near!");
+ // } else {
+ // tiles[i].idx = 0;
+ // }
+ // }
+ /*
+ 012
+ 345
+ 678
+ */
+ // for (int i = 0; i < 9; i++)
+ // {
+ // if (tiles[i].idx != 0){
+ // hh_solve_collision(tiles[i].pos, &player);
+ // }
+ // }
+
+ player_new.is_grounded = false;
+
+ // solves x collision
+ if (player.vel.x <= 0) {
+ if (hh_colidable(hh_world_to_tile((vec2){.x=player_new.pos.x + 0, .y=player.pos.y + 0})) ||
+ hh_colidable(hh_world_to_tile((vec2){.x=player_new.pos.x + 0, .y=player.pos.y + 15}))) {
+ player_new.pos.x = (player_new.pos.x & ~15) + 16,
+ player_new.vel.x = 0;
+ }
+ } else {
+ if (hh_colidable(hh_world_to_tile((vec2){.x=player_new.pos.x + 16, .y=player.pos.y + 0})) ||
+ hh_colidable(hh_world_to_tile((vec2){.x=player_new.pos.x + 16, .y=player.pos.y + 15}))) {
+ player_new.pos.x = player_new.pos.x & ~15, // <-- magic comma, NOT TOUCHY
+ player_new.vel.x = 0;
+ }
+ }
+
+ //solves y collision
+ if (player.vel.y <= 0) {
+ if (hh_colidable(hh_world_to_tile((vec2){.x=player_new.pos.x + 0, .y=player_new.pos.y + 0})) ||
+ hh_colidable(hh_world_to_tile((vec2){.x=player_new.pos.x + 0, .y=player_new.pos.y + 15}))) {
+ player_new.pos.y = (player_new.pos.y & ~15) + 16,
+ player_new.vel.y = 0;
+ }
+ } else {
+ if (hh_colidable(hh_world_to_tile((vec2){.x=player_new.pos.x + 0, .y=player_new.pos.y + 16})) ||
+ hh_colidable(hh_world_to_tile((vec2){.x=player_new.pos.x + 16, .y=player_new.pos.y + 15}))) {
+ player_new.pos.y = player_new.pos.y & ~15,
+ player_new.vel.y = 0;
+ player_new.is_grounded = true;
+ }
+ }
+
+ player = player_new;
+
+ vec_cor cam_pos;//value in tiles
+ // cam_pos = (vec2){0,0};
+ cam_pos = hh_update_camera(player.pos,(vec2){0,0},(vec2){.x=20*16,.y=30*16});//TODO: remove magic number(s)
+ // printf("%i, %i:%i, %i\n",player.pos.x,player.pos.y,cam_pos.x,cam_pos.y);
+ hh_draw_screen(cam_pos);
+ // update player sprite on ppu
+ player.render.fam.position_x = (player.pos.x-cam_pos.x);
+ player.render.fam.position_y = (player.pos.y-cam_pos.y);
+
+
+ player.render.fam.tilemap_index = 2;//TODO: these two lines should be redundant
+ player.render.fam.palette_index = 7;
+ hh_ppu_update_foreground(0, player.render.fam);
+
+
+ hh_s_ppu_loc_fam_entry sprite = {
+ .position_x = 16,
+ .position_y = 16,
+ .palette_index = 7,
+ .tilemap_index = 2,
+ };
+ hh_ppu_update_foreground(1, sprite);
+
+}
+
diff --git a/src/engine/player_controller.h b/src/engine/player_controller.h
new file mode 100644
index 0000000..400c18e
--- /dev/null
+++ b/src/engine/player_controller.h
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "engine/maths.h"
+#include "engine/entity.h"
+// inputs
+
+void hh_player_actions();
diff --git a/src/engine/sprite_controller.c b/src/engine/sprite_controller.c
new file mode 100644
index 0000000..5d93cf8
--- /dev/null
+++ b/src/engine/sprite_controller.c
@@ -0,0 +1,22 @@
+#include <stdint.h>
+
+#include "engine/sprite_controller.h"
+#include "ppu/types.h"
+#include "ppu/consts.h"
+#include "ppu/ppu.h"
+
+uint8_t hh_get_palette(uint8_t tile_idx) {
+ return hh_g_sprite_palette[tile_idx];
+}
+
+void hh_setup_palettes(){
+ for (int idx = 0; idx < HH_PPU_PALETTE_COUNT; idx++) {
+ for (int col = 0; col < HH_PPU_PALETTE_COLOR_COUNT; col++) {
+ hh_ppu_update_color(idx,col,hh_g_palette[idx][col]);
+ }
+ }
+}
+
+bool hh_colidable(uint8_t tile_idx){
+ return (hh_get_palette(tile_idx) != 0);
+}
diff --git a/src/engine/sprite_controller.h b/src/engine/sprite_controller.h
new file mode 100644
index 0000000..001a459
--- /dev/null
+++ b/src/engine/sprite_controller.h
@@ -0,0 +1,106 @@
+#pragma once
+#include <stdint.h>
+
+#include "ppu/types.h"
+
+// handles sprites
+
+// Bg sprites
+
+// Fg or entity sprites
+
+//TODO: pack data inside of sprite_palette LUT
+//HH_PPU_PALETTE_COUNT
+#define HH_SPRITE_COUNT 40
+#define HH_PAL_IDX_SKY 0
+#define HH_PAL_IDX_BRICK 1
+const static uint8_t hh_g_sprite_palette[HH_SPRITE_COUNT] = {
+ 0,1,1,1,1,1,1,1,1,1, //1+9
+ 1,1,1,1,1,1,1,1,1,1, //6+4
+ 1,1,1,1,1,1,1,1,1, //9
+ 7,7,7,2,7,7,1,2,7
+ //other palettes here:
+};
+
+
+const static hh_ppu_loc_palette_table_t hh_g_palette = {
+ {//palette info here
+ {0x1,0x2,0x3},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {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}},
+ {//slime
+ {0x1,0x2,0x3},
+ {0x1,0x3,0x2},
+ {0x4,0x8,0x3},
+ {0x7,0xa,0x4},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0}},
+ {
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0}},
+ {
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0}},
+ {
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0}},
+ {
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0},
+ {0x0,0x0,0x0}},
+ {
+ {0x0,0xf,0xf},
+ {0xf,0xf,0xf},
+ {0xf,0x0,0xf},
+ {0xf,0xf,0x0},
+ {0xf,0x0,0x0},
+ {0x0,0xf,0x0},
+ {0x0,0x0,0xf},
+ {0x0,0x0,0x0}}
+};
+
+void hh_setup_palettes();
+
+/** @brief return palette index that belongs to tilemap index */
+uint8_t hh_get_palette(uint8_t tile_idx);
+
+bool hh_colidable(uint8_t tile_idx);
diff --git a/src/makefile b/src/makefile
index 96f3108..d7d9087 100644
--- a/src/makefile
+++ b/src/makefile
@@ -32,7 +32,12 @@ LOCAL_SRCS += main.c \
ppu/ppu.c \
demo.c \
engine/engine.c \
- engine/draw_screen.c
+ engine/sprite_controller.c \
+ engine/player_controller.c \
+ engine/draw_screen.c \
+ engine/camera.c \
+ engine/maths.c \
+ engine/entity.c
CFLAGS += $(SHARED_FLAGS)
LFLAGS += $(SHARED_FLAGS)
diff --git a/src/ppusim/input.c b/src/ppusim/input.c
index 08bc382..5323fb1 100644
--- a/src/ppusim/input.c
+++ b/src/ppusim/input.c
@@ -12,4 +12,5 @@ void hh_input_read() {
g_hh_controller_p1.dpad_down = kb[SDL_SCANCODE_S];
g_hh_controller_p1.dpad_left = kb[SDL_SCANCODE_A];
g_hh_controller_p1.dpad_right = kb[SDL_SCANCODE_D];
+ g_hh_controller_p1.button_primary = kb[SDL_SCANCODE_SPACE];
}
diff --git a/src/ppusim/sim.c b/src/ppusim/sim.c
index 1fceb82..a5fec45 100644
--- a/src/ppusim/sim.c
+++ b/src/ppusim/sim.c
@@ -29,20 +29,21 @@ void hh_ppu_init() {
}
void hh_ppu_load_tilemap() {
- char* filename = "tiles.bin";
+ char* filename = "../test/bin/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)/HH_PPU_VRAM_TMM_SPRITE_SIZE;
+ int _size = ftell(fp)/sprite_size;
fseek(fp, 0, 0);//goto start of file
for (int i = 0; i < _size; i++) {
- uint8_t data[HH_PPU_VRAM_TMM_SPRITE_SIZE];
+ uint8_t data[sprite_size];
- fread(data,HH_PPU_VRAM_TMM_SPRITE_SIZE,1,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;
diff --git a/test/bin/exportingPalettes.md b/test/bin/exportingPalettes.md
new file mode 100644
index 0000000..be4a354
--- /dev/null
+++ b/test/bin/exportingPalettes.md
@@ -0,0 +1,4 @@
+```sh
+cat test.src|head -n 46 | awk '{printf "%02x: {0x%x,0x%x,0x%x}\n",NR,$1/2,$2/2,$3/2 }' > hex_palettes
+```
+
diff --git a/test/bin/test_file_read.c b/test/bin/test_file_read.c
index b3357ce..df93395 100644
--- a/test/bin/test_file_read.c
+++ b/test/bin/test_file_read.c
@@ -16,19 +16,22 @@ void printData(uint8_t* in) {
}
void hh_ppu_load_tilemap() {
- char* filename = "tiles.bin";
+
+
+ char* filename = "slime.bin";
FILE* fp = fopen(filename,"rb");
if (!fp){
return;//error
}
+ int sprite_size = (16 * 16);
fseek(fp, 0, SEEK_END);
- int _size = ftell(fp)/HH_PPU_VRAM_TMM_SPRITE_SIZE;
- fseek(fp, 0, 0);
+ int _size = ftell(fp)/sprite_size;
+ rewind(fp);
// printf("%i",_size);
for (int i = 0; i < _size; i++) {
- uint8_t data[HH_PPU_VRAM_TMM_SPRITE_SIZE];
- fread(data,HH_PPU_VRAM_TMM_SPRITE_SIZE,1,fp);
+ uint8_t data[sprite_size];
+ fread(data,1,sprite_size,fp);
printData(data);
}
diff --git a/test/bin/tilemap.pip b/test/bin/tilemap.pip
new file mode 100644
index 0000000..c0c646e
--- /dev/null
+++ b/test/bin/tilemap.pip
@@ -0,0 +1,512 @@
+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