From fcaec358f688bba6760cc44421b35e6b3d90a853 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 7 Oct 2006 00:21:12 +0000 Subject: First working version (3D Monster Maze playable!) --- arm9/source/main.c | 125 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 79 insertions(+), 46 deletions(-) (limited to 'arm9/source/main.c') diff --git a/arm9/source/main.c b/arm9/source/main.c index a2b0565..43c8993 100644 --- a/arm9/source/main.c +++ b/arm9/source/main.c @@ -26,12 +26,32 @@ #include "framebuffer.h" #include "gui.h" +#include "keyboard.h" +#include "z80.h" +#include "zx81.h" #include "splashimg_bin.h" -#include "zx81_bin.h" +#include "rom_font_bin.h" /* ---------------------------------------- STATIC DATA */ +static const char *main_menu[]= + { + "Reset ZX81", + "Sticky Keys On", + "Sticky Keys Off", + "Define Joystick", + "Cancel", + NULL + }; + +typedef enum +{ + MenuReset, + MenuStickyOn, + MenuStickyOff, + MenuDefineJoystick +} MenuOpt; /* ---------------------------------------- DISPLAY FUNCS @@ -87,8 +107,7 @@ static void Splash(void) */ int main(int argc, char *argv[]) { - int ch; - uint8 *ch_data; + Z80 *z80; powerON(POWER_ALL_2D); @@ -99,51 +118,14 @@ int main(int argc, char *argv[]) vramSetBankA(VRAM_A_MAIN_BG_0x6000000); vramSetBankB(VRAM_B_MAIN_BG_0x6020000); - BG0_CR = BG_COLOR_256|BG_MAP_BASE(31)|BG_TILE_BASE(0); + BG0_CR = BG_COLOR_256|BG_MAP_BASE(0)|BG_TILE_BASE(1); BG0_X0 = 0; BG0_Y0 = 0; BG_PALETTE[0] = RGB15(31,31,31); BG_PALETTE[1] = RGB15(0,0,0); - ch_data = (uint8*)BG_TILE_RAM(0); - - for(ch=0;ch<64;ch++) - { - int r; - - for(r=0;r<8;r++) - { - int b; - int rd; - - rd=zx81_bin[0x1e00+ch*8+r]; - for(b=7;b>=0;b--) - { - if (rd&(1<