Replace enums with simple defs, replace kb routine with asm

calypsi uses "int" as the type for enums, also replace the basic
keyboard routine for key reading with an assembly written one
This commit is contained in:
hkz 2025-08-20 20:57:26 +02:00
commit 5d739383aa
9 changed files with 103 additions and 73 deletions

View file

@ -61,7 +61,7 @@ uint8_t add_random_tile(void) {
return 0; // Return 0 if we were not able to place the tile, else we return (offset + 1) to indicate where the tile was placed
}
int8_t step_game(step_direction dir) {
int8_t step_game(uint8_t dir) {
int8_t done = 0;
uint8_t start_offset;
int8_t column_step;
@ -75,22 +75,22 @@ int8_t step_game(step_direction dir) {
*/
switch(dir) {
case STEP_UP:
case GAME_STEP_UP:
start_offset = GRID_SIDE - 1;
column_step = GRID_SIDE;
row_step = -1;
break;
case STEP_DOWN:
case GAME_STEP_DOWN:
start_offset = (GRID_SIDE * GRID_SIDE) - 1;
column_step = -GRID_SIDE;
row_step = -1;
break;
case STEP_LEFT:
case GAME_STEP_LEFT:
start_offset = 0;
column_step = 1;
row_step = GRID_SIDE;
break;
case STEP_RIGHT:
case GAME_STEP_RIGHT:
start_offset = GRID_SIDE - 1;
column_step = -1;
row_step = GRID_SIDE;