MemoryMap - jedimatt42/fcmd GitHub Wiki
Memory Maps
VDP Memory Map
In 80x30 F18A mode, Force Command utilizes extended color attributes, and some fast scroll code for the F18A.
Address | Size in bytes | Description |
---|---|---|
0x0000 | 0x0960 | Image table |
0x0960 | 0x00A0 | /free space-------/ |
0x0A00 | 0x0100 | Sprite table |
0x0800 | 0x0800 | Sprite patterns |
0x1000 | 0x0800 | Pattern table |
0x1800 | 0x0960 | Color attributes |
0x2160 | varies | /free stack ------/ |
0x3FF8 | 0x0008 | Nanopeb stats |
0x4000 | 0x0034 | Fast scroll routine |
Note: sprite pattern overlaps with sprite table, and image table. You can use the tail end of the sprite pattern without conflict. Table entries 20 - 39 and 60 - 255 may be used.
Depending on your disk devices, there may be VDP stack allocations from 0x4000 downward.
In 40 Column mode:
Address | Size in bytes | Description |
---|---|---|
0x0000 | 0x03C0 | Image table |
0x03C0 | 0x0440 | /free space-------/ |
0x0800 | 0x0800 | Pattern table |
0x1000 | varies | /free stack ------/ |
0x3FF8 | 0x0008 | Nanopeb stats |
0x4000 | 0x0034 | Fast scroll routine |
9938/58 80x26.5 mode:
Address | Size in bytes | Description |
---|---|---|
0x0000 | 0x0870 | Image table |
0x0870 | 0x0790 | /free space-------/ |
0x1000 | 0x0800 | Pattern table |
0x1800 | varies | /free stack ------/ |
0x3FF8 | 0x0008 | Nanopeb stats |
0x4000 | 0x0034 | Fast scroll routine |
IO Buffers
- lvl2 IO buffer and IO buffer merge -> IO buffer
- IO Buffer holds 17 sectors or 0x1100 bytes.
- locations are common for 40 and 80 column modes.
Address | Size in bytes | Description |
---|---|---|
0x2160 | 0x010A | PAB |
0x2300 | 0x0100 | IO name buffer |
0x2400 | 0x1100 | IO Buffer |
0x3500 | 0x0100 | redo buffer |
0x3600 | varies | /free stack ------/ |
Note: VDP RAM redo buffer is only used if no SAMS is present
CPU RAM Memory Map
Force Command resides in Cartridge ROM space and the RAM usage varies if SAMS is present.
32K Systems:
Address | Size in bytes | Description |
---|---|---|
0x2000 | 0x0400 | System global variables |
0x2400+ | varies | Environment Variables |
-0x3FFF | varies | System stack |
0xA000 | 90(temporary) | command line edit buffer |
0xA000 | varies | executable space |
If SAMS is available, then a 4K page is used at 0xA000 for command history. This is paged out when executables are loaded. Also when SAMS is available, executables are loaded into SAMS pages sequentially. Additional SAMS pages may be allocated by the executable.
SAMS page map:
Page | Address | Purpose |
---|---|---|
0 | 0x2000 | Force Command runtime data |
1 | 0x3000 | Force Command stack |
2,3 | 0xB000-0xCFFF | command history |
4 | 0xA000 | command line edit buffer |
4-9 | 0xA000-0xFFFF | ED file buffer |
4+ | 0xA000 | executable space |
The command line editor, and ED command free their pages when not active. The command line editor is not active between pressing ENTER and prompting again for another command.
Note, when the LOAD, FG99, or XB commands are used to run a legacy EA5 program, the standard SAMS mapping is set.
EA5 SAMS map:
Page | Address |
---|---|
2 | 0x2000 |
3 | 0x3000 |
10 | 0xA000 |
11 | 0xB000 |
12 | 0xC000 |
13 | 0xD000 |
14 | 0xE000 |
15 | 0xF000 |