-
Notifications
You must be signed in to change notification settings - Fork 0
Customising the Filesystem
The virtual filesystem is defined in prompt/index.html as a JavaScript array called fs. Everything — drives, directories, and files — lives in this one structure. No server or database required.
Open prompt/index.html and search for:
var fs = [{Everything between that line and the closing }]; is the filesystem.
Link files open a URL in a new tab when executed.
Find the directory you want to add to and add a new entry to its files array:
{ name: 'GITHUB.COM', link: 'https://github.com/yourname' }Example — adding a new emulator to C:\EMULATORS\DOS:
{
name: 'DOS',
directories: [
...,
{ name: 'QUAKE', directories: [], files: [{ name: 'quake.exe', link: 'https://archive.org/details/quake106' }] },
],
files: [...]
}The user can then cd\emulators\dos\quake and type quake to launch it.
Batch files run a sequence of commands when executed. Commands are separated by \n.
{ name: 'HELLO.BAT', data: 'echo off\nsetcol 2e\necho Hello, world!\nsetcol 07\necho on' }Supported batch commands: echo, echo off/on, cls, cd, dir, setcol, and any filename that exists in the current directory.
Example — a batch file that navigates and lists a directory:
{ name: 'GAMES.BAT', data: 'cls\ncd\\GAMES\ndir/w/o\n' }Add an entry to the directories array of the parent directory:
{
name: 'MUSIC',
directories: [],
files: [
{ name: 'SPOTIFY.COM', link: 'https://open.spotify.com/...' },
{ name: 'BANDCAMP.COM', link: 'https://yourname.bandcamp.com' }
]
}Console systems use a two-level structure: a system directory containing a GAMES\ subdirectory. This is the same pattern used by all the built-in console entries (2600, NES, INTV, etc.).
{
name: 'SYSTEM',
directories: [
{
name: 'GAMES',
directories: [],
files: [
{ name: 'menu.bat', data: 'echo off\ncls\necho ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\necho º SYSTEM GAMES º\necho ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ\necho º º\necho º 1. GAME1 First Game Title º\necho º 2. GAME2 Second Game Title º\necho º º\necho ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ\necho º 0. BACK System Menu º\necho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n' },
{ name: '0.bat', data: 'cd ..\nmenu\n' },
{ name: '1.bat', data: 'game1\n' },
{ name: '2.bat', data: 'game2\n' },
{ name: 'game1.bat', link: 'https://example.com/game1' },
{ name: 'game2.bat', link: 'https://example.com/game2' }
]
}
],
files: [
{ name: 'launch.exe', link: 'https://example.com/emulator' },
{ name: 'menu.bat', data: 'echo off\ncls\necho ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\necho º SYSTEM º\necho ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ\necho º º\necho º 1. LAUNCH Launch Emulator º\necho º 2. GAMES Browse Game Titles º\necho º º\necho ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ\necho º 0. BACK Parent Menu º\necho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n' },
{ name: '1.bat', data: 'launch\n' },
{ name: '2.bat', data: 'cd games\nmenu\n' },
{ name: '0.bat', data: 'cd ..\nmenu\n' }
]
}The user navigates like this:
menu → system menu (Launch / Browse Games / Back)
2 → cd games && menu
1 → runs game1.bat (opens link)
0 → cd .. && menu (back to system menu)
Menus use the CP437 box-drawing character set. The content area inside the box is exactly 45 characters wide.
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ← top border
º CENTERED HEADER º ← 45 chars between º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ ← separator
º º ← blank row
º 1. CMDNAME Title padded to 28 chars º ← entry row
º º ← blank row
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ ← separator
º 0. BACK Go Back º ← back row
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ← bottom border
Entry row layout (45 chars total inside the º borders):
| Segment | Width | Example |
|---|---|---|
| Number prefix | 7 | 1. |
| Command name (padded) | 10 | DOOM19S |
| Title (padded) | 28 | Doom v1.9 |
Single-digit: N. (7 chars) · Double-digit: NN. (7 chars)
Apostrophes in titles must be escaped as \' inside JS single-quoted data strings:
{ name: 'menu.bat', data: '...echo º 2. KRAZYCH K.C.\'s Krazy Chase! º\n...' }Directories can be nested to any depth. Each directory object has its own directories array.
Example — a C:\GAMES tree with genre subdirectories:
{
name: 'GAMES',
directories: [
{
name: 'ACTION',
directories: [
{
name: 'FPS',
directories: [],
files: [
{ name: 'doom.exe', link: 'https://archive.org/details/The_Ultimate_Doom' },
{ name: 'quake.exe', link: 'https://archive.org/details/quake106.html' }
]
}
],
files: [
{ name: 'sw.bat', data: 'cls\ncd\\GAMES\\ACTION\ndir/w/o\n' }
]
}
],
files: [
{ name: 'sw.bat', data: 'cls\ncd\\GAMES\ndir/w/o\n' }
]
}Navigate using absolute paths:
cd\games\action\fps
doom
Tip: Files can only be executed from the directory they live in — there is no PATH support.
Because cd works inside batch scripts, a .BAT can navigate and run a file in one step:
{ name: 'doom.bat', data: 'cd\\games\\action\\fps\ndoom\n' }Place it anywhere convenient and the user can type doom from any directory.
| Syntax | Behaviour |
|---|---|
cd\\games\\action |
Absolute — always goes to C:\GAMES\ACTION
|
cd action |
Relative — only works if ACTION is a child of the current dir |
cd .. |
Goes up one level |
Always use absolute paths (starting with \\) in .BAT files to avoid broken navigation.
AUTOEXEC.BAT runs automatically on load. It's defined in the root files array:
files: [
{ name: 'autoexec.bat', data: 'c:\ncd lgr\ncls\ndir/w/o\n' },
...
]To boot into a different directory:
{ name: 'autoexec.bat', data: 'c:\ncd emulators\\dos\ncls\ndir/w/o\n' }Use setcol in AUTOEXEC.BAT to set colors on boot. The argument is two hex digits: background then foreground.
{ name: 'autoexec.bat', data: 'echo off\nsetcol 17\nc:\ncd lgr\ncls\ndir/w/o\n' }| Code | Background | Foreground |
|---|---|---|
07 |
Black | Light Gray (default) |
17 |
Dark Blue | Light Gray |
2e |
Dark Green | Yellow |
4e |
Dark Red | Yellow |
0a |
Black | Green |
0f |
Black | White |
See the Font System page for the full 16-color palette reference.