diff --git a/bin/GWRAM.dbg.po b/bin/GWRAM.dbg.po index 1b8a956..c8d2c7b 100644 Binary files a/bin/GWRAM.dbg.po and b/bin/GWRAM.dbg.po differ diff --git a/bin/GWRAM.po b/bin/GWRAM.po index 1f7d532..46fc65c 100644 Binary files a/bin/GWRAM.po and b/bin/GWRAM.po differ diff --git a/main.c b/main.c index 862b771..5034880 100644 --- a/main.c +++ b/main.c @@ -17,14 +17,16 @@ int main(void) // Set RAMWorks bank to 0 __asm__("lda #0"); __asm__("sta $C073"); + return EXIT_SUCCESS; case APPLE_IIGS: - ram2gs_main(); + ram2gs_main(); + return EXIT_SUCCESS; default: // If not on IIe or IIgs, show an error message and quit cputsxy(0, 8, " THIS PROGRAM REQUIRES APPLE IIE OR IIGS"); cputsxy(0, 10, " PRESS ANY KEY TO QUIT."); cgetc(); // Wait for key clrscr(); // Clear screen before quitting + return EXIT_SUCCESS; } - return EXIT_SUCCESS; } diff --git a/ram2e.c b/ram2e.c index c0bf4de..97b5c7a 100644 --- a/ram2e.c +++ b/ram2e.c @@ -346,6 +346,7 @@ int ram2e_main(void) gwcputsxy(1, 8, "RAM2E settings reset successfully."); goto end; } + continue; } default: reset_count = 0; continue; } diff --git a/ram2gs.c b/ram2gs.c index b6eee2f..ca1d0a0 100644 --- a/ram2gs.c +++ b/ram2gs.c @@ -113,6 +113,7 @@ int ram2gs_main(void) gwcputsxy(1, 8, "RAM2GS settings reset successfully."); goto end; } + continue; } default: reset_count = 0; continue; } diff --git a/ramtest.c b/ramtest.c new file mode 100644 index 0000000..e4ec7a2 --- /dev/null +++ b/ramtest.c @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include + +#include "util.h" +#include "gwconio.h" +#include "ramtestpat.c" + +#define TEST_SIZE 8*1024*1024 + +char test_run() { + // Put copy stub in low RAM + for (uint32_t a = 0; a < TEST_SIZE) { + wr(a, getpat(a)); + } + + for (uint32_t a = 0; a < TEST_SIZE) { + char d = rd(a); + if (d != getpat(a)) { return -1; } + } + + return 0; +} + +static inline char getpat(uint32_t a) { + return ramtestpat[a % RAMTESTPAT_SIZE]; +} + +static char rd(uint32_t a) { + uint16_t al = a & 0xFFFF; + if (al < 0x0200) { return rd_zplc(a); } + else if (al < 0xC000) { return rd_mid(a); } + else if (al < 0xD000) { return rd_lc2(a); } + else { return rd_zplc(a); } +} + +static char rd_zplc(uint32_t a) { + +} + +static char rd_mid(uint32_t a) { + +} + +static char rd_lc2(uint32_t a) { + +} + +static char wr(uint32_t a, char d) { + uint16_t al = a & 0xFFFF; + if (al < 0x0200) { wr_zplc(a, d); } + else if (al < 0xC000) { wr_mid(a, d); } + else if (al < 0xD000) { wr_lc2(a, d); } + else { wr_zplc(a, d); } +} + +static char rd_zplc(uint32_t a) { + +} + +static char rd_mid(uint32_t a) { + +} + +static char rd_lc2(uint32_t a) { + +} +