From a3b16f394aae46dfd18f5952f16803867bc1f400 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 15 Sep 2006 00:30:18 +0000 Subject: Works enough to run Manic Miner. Slowly. --- source/spec.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 17 deletions(-) (limited to 'source/spec.c') diff --git a/source/spec.c b/source/spec.c index 7137834..10a5d0a 100644 --- a/source/spec.c +++ b/source/spec.c @@ -114,9 +114,49 @@ static struct */ static Z80Byte matrix[8]; +static struct +{ + int row; + int bit; +} key_matrix[]= + { + {3,0x01}, {3,0x02}, {3,0x04}, {3,0x08}, {3,0x10}, /* 1 - 5 */ + {4,0x10}, {4,0x08}, {4,0x04}, {4,0x02}, {4,0x01}, /* 6 - 0 */ + {2,0x01}, {2,0x02}, {2,0x04}, {2,0x08}, {2,0x10}, /* Q - T */ + {5,0x10}, {5,0x08}, {5,0x04}, {5,0x02}, {5,0x01}, /* Y - P */ + {1,0x01}, {1,0x02}, {1,0x04}, {1,0x08}, {1,0x10}, /* A - G */ + {6,0x10}, {6,0x08}, {6,0x04}, {6,0x02}, {6,0x01}, /* H - NL */ + {0,0x01}, {0,0x02}, {0,0x04}, {0,0x08}, {0,0x10}, /* CAPS - V */ + {7,0x10}, {7,0x08}, {7,0x04}, {7,0x02}, {7,0x01} /* B - SPACE */ + }; + +static int debug_matrix = FALSE; + /* ---------------------------------------- PRIVATE FUNCTIONS */ +static void FillBox(int x, int y, int w, int h, int colour) +{ + int f; + uint16 *base; + + colour|=0x8000; + + base=vram+x+y*256; + + while(h--) + { + for(f=0;f