diff --git a/src/console.c b/src/console.c index dba4848..ab86fcf 100644 --- a/src/console.c +++ b/src/console.c @@ -2326,13 +2326,6 @@ static void onConsoleRamCommand(Console* console, const char* param) static const struct{s32 addr; const char* info;} Layout[] = { - {offsetof(tic_ram, vram.screen), "SCREEN"}, - {offsetof(tic_ram, vram.palette), "PALETTE"}, - {offsetof(tic_ram, vram.mapping), "PALETTE MAP"}, - {offsetof(tic_ram, vram.vars.colors), "BORDER"}, - {offsetof(tic_ram, vram.vars.offset), "SCREEN OFFSET"}, - {offsetof(tic_ram, vram.vars.cursor), "MOUSE CURSOR"}, - {offsetof(tic_ram, vram.reserved), "..."}, {offsetof(tic_ram, tiles), "TILES"}, {offsetof(tic_ram, sprites), "SPRITES"}, {offsetof(tic_ram, map), "MAP"}, @@ -2346,15 +2339,43 @@ static void onConsoleRamCommand(Console* console, const char* param) {offsetof(tic_ram, music.patterns.data), "MUSIC PATTERNS"}, {offsetof(tic_ram, music.tracks.data), "MUSIC TRACKS"}, {offsetof(tic_ram, sound_state), "SOUND STATE"}, - {TIC_RAM_SIZE, "..."}, + {offsetof(tic_ram, free), "..."}, + {TIC_RAM_SIZE, ""}, }; - enum{Last = COUNT_OF(Layout)-1}; - - for(s32 i = 0; i < Last; i++) + for(s32 i = 0; i < COUNT_OF(Layout)-1; i++) printRamInfo(console, Layout[i].addr, Layout[i].info, Layout[i+1].addr-Layout[i].addr); - printRamInfo(console, Layout[Last].addr, Layout[Last].info, 0); + printTable(console, "\n+-------+-------------------+-------+"); + + printLine(console); + commandDone(console); +} + +static void onConsoleVRamCommand(Console* console, const char* param) +{ + printLine(console); + + printTable(console, "\n+-----------------------------------+" \ + "\n| 16K VRAM LAYOUT |" \ + "\n+-------+-------------------+-------+" \ + "\n| ADDR | INFO | SIZE |" \ + "\n+-------+-------------------+-------+"); + + static const struct{s32 addr; const char* info;} Layout[] = + { + {offsetof(tic_ram, vram.screen), "SCREEN"}, + {offsetof(tic_ram, vram.palette), "PALETTE"}, + {offsetof(tic_ram, vram.mapping), "PALETTE MAP"}, + {offsetof(tic_ram, vram.vars.colors), "BORDER"}, + {offsetof(tic_ram, vram.vars.offset), "SCREEN OFFSET"}, + {offsetof(tic_ram, vram.vars.cursor), "MOUSE CURSOR"}, + {offsetof(tic_ram, vram.reserved), "..."}, + {TIC_VRAM_SIZE, ""}, + }; + + for(s32 i = 0; i < COUNT_OF(Layout)-1; i++) + printRamInfo(console, Layout[i].addr, Layout[i].info, Layout[i+1].addr-Layout[i].addr); printTable(console, "\n+-------+-------------------+-------+"); @@ -2375,7 +2396,8 @@ static const struct #if defined(CAN_OPEN_URL) {"wiki", NULL, "open github wiki page", onConsoleWikiCommand}, #endif - {"ram", NULL, "show memory info", onConsoleRamCommand}, + {"ram", NULL, "show 80K RAM layout", onConsoleRamCommand}, + {"vram", NULL, "show 16K VRAM layout", onConsoleVRamCommand}, {"exit", "quit", "exit the application", onConsoleExitCommand}, {"new", NULL, "create new cart", onConsoleNewCommand}, {"load", NULL, "load cart", onConsoleLoadCommand}, diff --git a/src/surf.c b/src/surf.c index 84500fb..639f3bb 100644 --- a/src/surf.c +++ b/src/surf.c @@ -30,7 +30,7 @@ #define MAIN_OFFSET 4 #define MENU_HEIGHT 10 -#define MAX_CARTS 256 +#define MAX_CARTS 512 #define ANIM 10 #define COVER_WIDTH 140 #define COVER_HEIGHT 116 diff --git a/src/tic.h b/src/tic.h index 9267a5e..6d91e1f 100644 --- a/src/tic.h +++ b/src/tic.h @@ -52,7 +52,7 @@ #define TIC_COPYRIGHT "http://" TIC_HOST " (C) 2017" #define TIC_VRAM_SIZE (16*1024) //16K -#define TIC_RAM_SIZE (80*1024) //80K +#define TIC_RAM_SIZE (TIC_VRAM_SIZE+80*1024) //16K+80K #define TIC_FONT_WIDTH 6 #define TIC_FONT_HEIGHT 6 #define TIC_ALTFONT_WIDTH 4 @@ -457,9 +457,11 @@ typedef union tic_sfx sfx; tic_music music; tic_sound_state sound_state; + u8 free[16*1024]; }; u8 data[TIC_RAM_SIZE]; + } tic_ram; typedef enum