X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=megaed-sv%2Fmain.c;h=a0741b6d18873a368db11ec78841c85466263113;hb=refs%2Fheads%2Fmaster;hp=24a2528fb7645f321f4c6d1ffb59e10aff34a26c;hpb=6b0c90a9a3cfcf259291b4d14565f46e00c18f20;p=megadrive.git diff --git a/megaed-sv/main.c b/megaed-sv/main.c index 24a2528..a0741b6 100644 --- a/megaed-sv/main.c +++ b/megaed-sv/main.c @@ -215,6 +215,17 @@ static noinline int printf(const char *fmt, ...) return d; // wrong.. } +static u8 gethex(char c) +{ + if ('0' <= c && c <= '9') + return c - '0'; + if ('a' <= c && c <= 'f') + return c - 'a' + 10; + if ('A' <= c && c <= 'F') + return c - 'A' + 10; + return 0; +} + static const char *exc_names[] = { NULL, NULL, @@ -511,11 +522,17 @@ static int do_run(OsRoutine *ed, u8 b3, int tas_sync) case 'M': mapper = MTYPE_10M; break; + case 'n': + // raw numer: hex XX: mtype | x; + // x: bits [4-7]: SRAM_ON, SRAM_3M_ON, SNAP_SAVE_ON, MKEY + mapper = gethex(ed->usbReadByte()) << 4; + mapper |= gethex(ed->usbReadByte()); + break; default: return -1; } - printf("starting mapper %x..\n", mapper); + printf("syncing and starting mapper %x..\n", mapper); while (read16(GFX_CTRL_PORT) & 2) ; @@ -584,9 +601,8 @@ int main() /* note: relying on ED menu's font setup here.. */ printf("\n"); - printf("version: %02x, hvc: %04x %04x, zbus: %d\n", - read8(0xa10001), start_hvc, read16(GFX_CTRL_PORT), - read8(0xa11100) & 1); + printf("version: %02x, hvc: %04x %04x\n", + read8(0xa10001), start_hvc, read16(0xc00008)); printf("ED os/fw: %d/%d\n\n", ed->osGetOsVersion(), ed->osGetFirmVersion());