Skip to content

Commit 27a845d

Browse files
committed
Don't load DFS by default
DFS was an add-on to the original hardware and isn't really useful with the bot. Loading it by default raises PAGE by 2816 bytes. Even in the best case of MODE7 and rocket mode, that's a 10% reduction in the available RAM to BBC BASIC. In MODE2 and with the GXR loaded it's a whopping 35% reduction. Support enabling DFS via an emoji, which is probably only really useful as a way to allow easily running programs written for older versions of the bot which assume the value of PAGE or the screen contents.
1 parent af6da0f commit 27a845d

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

client.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,18 @@ var clientID = "Cli0";
111111
var IBP = 0x02E1; // input pointer
112112
var OBP = 0x02D8; // output pointer
113113

114-
var page = ( c.flags.includes("gxr.rom") ) ? "1c00" : "1900";
115-
var end = parseInt(page,16) + tokenised.length;
114+
var page = 0xE00;
115+
if (c.flags.includes("gxr.rom")) page += 0x300;
116+
if (c.useDFS) page += 0xB00;
117+
var end = page + tokenised.length;
116118
var endLow = (end & 0xff).toString(16);
117119
var endHigh = ((end >>> 8) & 0xff).toString(16);
118120

119121
// beebjit debug commands
120122
var commands = "'"+
121123
["breakat 725000",
122124
"c",
123-
"loadmem ../tmp/tweet.bas "+page, // paste tokenised program into PAGE
125+
"loadmem ../tmp/tweet.bas "+page.toString(16), // paste tokenised program into PAGE
124126
"loadmem ../tmp/keys.bin "+keyboardBuffer, // 0x03E0 OS 1.2
125127
"writem 02e1 e4", // Advance pointer 4 bytes
126128
"writem 0000 "+endLow, // LOWMEM
@@ -140,6 +142,7 @@ var clientID = "Cli0";
140142
}
141143

142144
let beebjit_cmd = "cd beebjit && ./beebjit -fast -headless -frames-dir ../tmp/ " + c.flags + " -commands " + commands;
145+
if (!c.useDFS) beebjit_cmd += " -no-dfs";
143146
await exec(beebjit_cmd );
144147
console.log(beebjit_cmd);
145148
} else // JSbeeb

docs/user guide.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ Bot execution modes
2727
| 🎬 | 3 hours* | No | 3 sec video |
2828
| 🚀 | 3 hours* | No | screen shot |
2929

30-
3130
\* The bot runs 3 hours equivalent 6502 execution in just a few seconds thanks to Beebjit!
3231

32+
Other emojis commands
33+
34+
* 🖬 or 💾 loads the DFS ROM. By default the bot doesn't do this - DFS was an add-on to the original hardware and isn't very useful with the bot. This is mostly provided as a way to allow easily running programs written for older versions of the bot which always loaded the DFS ROM. |
35+
36+
3337
### Unexpected behavior with 🎬 mode animations
3438

3539
We use the beebjit `-fast` parameter to achive very fast emulation in the accelerated modes, the only downside being some unexpected 'relativistic' effects if your code relies on external timers. In this mode CPU time is accelerated several thousandfold and decoupled from timing of BBC Micro peripherals and timers which remain emulated in real-time. This means flashing colours in the palette, and `*FX 19` or `INKEY` based timing will not work well!

parser.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ var one_hour = 2000000*60*60;
6464
compressed: false,
6565
input: "",
6666
mode: 1,
67-
isBASIC: true
67+
isBASIC: true,
68+
useDFS: false
6869
}
6970

7071

@@ -107,6 +108,11 @@ var one_hour = 2000000*60*60;
107108
c.mode = 0;
108109
return c;
109110

111+
case "🖬":
112+
case "💾": // Not really period appropriate, but probably the more common "floppy disk" emoji.
113+
c.useDFS = true;
114+
break;
115+
110116
default:
111117
c.input += graphemes[i];
112118
var g = graphemes[i].codePointAt(0);

test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function Tests(since_id){
3333
*/
3434
{
3535
name: "CHARACTERS",
36-
text: "10 PRINT“&gt;&amp;&lt;&amp;lt;”'SPC39\"|\"\n20 VDU 23,1,0;0;0;0;\n", // Tests twitter HTML escapes for <,&,> and OS X auto ""
36+
text: "💾10 PRINT“&gt;&amp;&lt;&amp;lt;”'SPC39\"|\"\n20 VDU 23,1,0;0;0;0;\n", // Tests twitter HTML escapes for <,&,> and OS X auto ""
3737
mediaType: "image/png",
3838
checksum: "c3f630a42cc39990a6e38c574a93f6c79b3c5a8a"
3939
},
@@ -67,21 +67,21 @@ function Tests(since_id){
6767
},
6868
{
6969
name: "YOUONLYRUNONCE", // Check that an explicit RUN suppresses an implicit one.
70-
text: '1PRINT"HELLO":!-512=&B000B\nRUN',
70+
text: '🖬1PRINT"HELLO":!-512=&B000B\nRUN',
7171
mediaType: "image/png",
7272
checksum: "28222f638d2c0b97e7e03d0e54561ab7364bd445"
7373
},
7474
{
7575
name: "NOLINENOS", // Test no line numbers -> tokeniser.
76-
text: "P.\"HELLO\";\nV.279;0;0;0;0;32\nP.\"WORLD\"",
76+
text: "💾P.\"HELLO\";\nV.279;0;0;0;0;32\nP.\"WORLD\"",
7777
mediaType: "image/png",
7878
checksum: "5c3db47017774d43ad27c9916af332d471e273e6"
7979
},
8080
{
8181
name: "TOKENS", // Test tokens -> tokeniser.
8282
text: "\xf1~\u0190\n\xef279;0;0;0;0;\n",
8383
mediaType: "image/png",
84-
checksum: "27760d3701f31e398df07429364ef0ebcc8b2434"
84+
checksum: "649072777ed9938fddaed9a57c27f07f2945c0fb"
8585
},
8686
/* FIXME: @-mentions are not currently removed for mastodon
8787
{
@@ -103,7 +103,7 @@ function Tests(since_id){
103103
},
104104
{
105105
name: "TOKENISE_LONG", // Test tokenisation handles a long input
106-
text: "0PRINT" + (":PRINT".repeat(125)),
106+
text: "💾0PRINT" + (":PRINT".repeat(125)),
107107
mediaType: "image/gif",
108108
checksum: "b1099ab5729e3fdabb1aa12c05aae77f18e6ee83"
109109
},

0 commit comments

Comments
 (0)