diff --git a/examples/pgztest/foenixmgr.ini b/examples/pgztest/foenixmgr.ini index c4e107a..c6ab319 100644 --- a/examples/pgztest/foenixmgr.ini +++ b/examples/pgztest/foenixmgr.ini @@ -1,6 +1,7 @@ [DEFAULT] -port=COM3 +port=/dev/ttyUSB1 labels=sample.lbl flash_address=380000 chunk_size=1024 -cpu=65816 +cpu=65c02 +data_rate=6000000 \ No newline at end of file diff --git a/examples/pgztest/pgztest.c b/examples/pgztest/pgztest.c index ef08bf1..e240c27 100644 --- a/examples/pgztest/pgztest.c +++ b/examples/pgztest/pgztest.c @@ -3,6 +3,6 @@ int main(void) { reset(); - //print("F256 LIVES!"); + print("F256 LIVES!"); return 0; } diff --git a/examples/pgztest/run.sh b/examples/pgztest/run.sh index d89e9ed..1c15024 100755 --- a/examples/pgztest/run.sh +++ b/examples/pgztest/run.sh @@ -1,2 +1,5 @@ #!/bin/bash -python ../../FoenixMgr/FoenixMgr/fnxmgr.py --port /dev/ttyUSB1 --run-pgz pgztest.pgz +#python ../../FoenixMgr/FoenixMgr/fnxmgr.py --boot FLASH +python ../../FoenixMgr/FoenixMgr/fnxmgr.py --run-pgz pgztest.pgz +#python ../../FoenixMgr/FoenixMgr/fnxmgr.py --dump 2000 --count 200 +#python ../../FoenixMgr/FoenixMgr/fnxmgr.py --copy pgztest.pgz diff --git a/f256lib/f256.c b/f256lib/f256.c index 05bf9fc..a86988e 100644 --- a/f256lib/f256.c +++ b/f256lib/f256.c @@ -29,16 +29,16 @@ static byte _row = 0; static byte _col = 0; -// Clear screen, do not change text attributes. +// Clear screen, does not change text attributes. void cls(void) { int i; - char *vram = (byte *)TEXT_MATRIX; - byte mmu; + byte *vram = (byte *)TEXT_MATRIX; + byte mmu; mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. POKE(MMU_IO_CTRL, 2); // Swap I/O page 2 into bank 6. - for (i = 0; i < _MAX_COL*_MAX_ROW; i++) *vram++ = 32; + for (i = 0; i < _MAX_COL * _MAX_ROW; i++) *vram++ = 32; POKE(MMU_IO_CTRL, mmu); // Restore MMU state. @@ -51,7 +51,7 @@ void gotoxy(byte x, byte y) { byte mmu; mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. - POKE(MMU_IO_CTRL, 2); // Swap I/O page 2 into bank 6. + POKE(MMU_IO_CTRL, 0); // Swap I/O page 0 into bank 6. _col = x; POKE(CURSOR_X_LOW, _col); // Set cursor X position. @@ -69,7 +69,7 @@ void gotoxy(byte x, byte y) { void print(char *message) { int x = 0; int i = 0; - char *vram = (byte *)TEXT_MATRIX + _col * _row; + byte *vram = (byte *)TEXT_MATRIX + _col * _row; byte mmu; mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. @@ -106,8 +106,7 @@ void print(char *message) { POKE(MMU_IO_CTRL, mmu); // Restore MMU state. - POKE(CURSOR_X_LOW, _col); - POKE(CURSOR_Y_LOW, _row); + gotoxy(_col, _row); } @@ -118,11 +117,16 @@ void reset(void) { mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. POKE(MMU_IO_CTRL, 2); // Swap I/O page 2 into bank 6. + // If we set 0xD000 to 0x01 and 0xD001 to 0x00, that will put us into text mode at 80 × 60. + POKE(VKY_MSTR_CTRL_0, 1); + POKE(VKY_MSTR_CTRL_1, 0); + _MAX_COL = 80; _MAX_ROW = 60; + POKE(MMU_IO_CTRL, 0); // Swap I/O page 0 into bank 6. POKE(CURSOR_SETTINGS, 9); // Disable cursor flash. - POKE(CURSOR_CHARACTER, '_'); // Set cursor shape. + POKE(CURSOR_CHARACTER, '_'); // Set cursor shape. (199 = Checkerboard) POKE(MMU_IO_CTRL, mmu); // Restore MMU state.