diff options
Diffstat (limited to 'source/main.c')
-rw-r--r-- | source/main.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/source/main.c b/source/main.c index 29f4448..aed05f5 100644 --- a/source/main.c +++ b/source/main.c @@ -93,6 +93,7 @@ static void Splash(void) int y; int res=FALSE; + ZX81SuspendDisplay(); ZX81DisplayString("10 print '%the zx81 is ace%'\n20 goto 10"); FB_Clear(); @@ -159,6 +160,8 @@ static void Splash(void) { swiWaitForVBlank(); } + + ZX81ResumeDisplay(); } @@ -173,6 +176,8 @@ static void MapJoypad(void) SK_DisplayKeyboard(BG_GFX_SUB); + ZX81SuspendDisplay(); + ZX81DisplayString("press the joypad button you want\n" "to define and then the ZX81 key\n" "you want to use.\n\n" @@ -217,6 +222,8 @@ static void MapJoypad(void) swiWaitForVBlank(); } + + ZX81ResumeDisplay(); } @@ -228,26 +235,34 @@ int main(int argc, char *argv[]) powerON(POWER_ALL_2D); - /* Set up main text screen and load the ROM character data + /* Set up main screen for ZX81 and load the ROM character data */ - videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE); + videoSetMode(MODE_3_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG3_ACTIVE); - vramSetBankA(VRAM_A_MAIN_BG_0x6000000); - vramSetBankB(VRAM_B_MAIN_BG_0x6020000); + vramSetBankA(VRAM_A_MAIN_BG_0x06000000); + vramSetBankB(VRAM_B_MAIN_BG_0x06020000); - BG0_CR = BG_COLOR_256|BG_MAP_BASE(0)|BG_TILE_BASE(1); + BG0_CR = BG_COLOR_256 | BG_MAP_BASE(0) | BG_TILE_BASE(1) | BG_PRIORITY(0); BG0_X0 = 0; BG0_Y0 = 0; BG_PALETTE[0] = RGB15(31,31,31); BG_PALETTE[1] = RGB15(0,0,0); + BG3_CR = BG_BMP16_256x256 | BG_BMP_BASE(2) | BG_PRIORITY(1); + BG3_XDX = 0x100; + BG3_XDY = 0; + BG3_YDX = 0; + BG3_YDY = 0x100; + BG3_CX = 0; + BG3_CY = 0; + dmaCopy(rom_font_bin,(void *)BG_TILE_RAM(1),rom_font_bin_size); /* Set up the sub-screen for rotation (basically for use as a framebuffer) */ videoSetModeSub(MODE_5_2D | DISPLAY_BG2_ACTIVE); - vramSetBankC(VRAM_C_SUB_BG_0x6200000); + vramSetBankC(VRAM_C_SUB_BG_0x06200000); SUB_BG2_CR = BG_BMP16_256x256; SUB_BG2_XDX = 0x100; @@ -282,7 +297,7 @@ int main(int argc, char *argv[]) GUI_Alert(TRUE,"Failed to initialise\nthe Z80 CPU emulation!"); } - ZX81Init((uint16*)SCREEN_BASE_BLOCK(0), z80); + ZX81Init((uint16*)BG_MAP_RAM(0), (uint16*)BG_BMP_RAM(2), z80); Splash(); |