Skip to content

Don't load DFS by default #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: mastodon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,18 @@ var clientID = "Cli0";
var IBP = 0x02E1; // input pointer
var OBP = 0x02D8; // output pointer

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

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

let beebjit_cmd = "cd beebjit && ./beebjit -fast -headless -frames-dir ../tmp/ " + c.flags + " -commands " + commands;
if (!c.useDFS) beebjit_cmd += " -no-dfs";
await exec(beebjit_cmd );
console.log(beebjit_cmd);
} else // JSbeeb
Expand Down
5 changes: 5 additions & 0 deletions docs/user guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Bot execution modes

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

Other emojis commands

* 🖬 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. |


### Unexpected behavior with 🎬 mode animations

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!
Expand Down
8 changes: 7 additions & 1 deletion parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ var one_hour = 2000000*60*60;
compressed: false,
input: "",
mode: 1,
isBASIC: true
isBASIC: true,
useDFS: false
}


Expand Down Expand Up @@ -107,6 +108,11 @@ var one_hour = 2000000*60*60;
c.mode = 0;
return c;

case "🖬":
case "💾": // Not really period appropriate, but probably the more common "floppy disk" emoji.
c.useDFS = true;
break;

default:
c.input += graphemes[i];
var g = graphemes[i].codePointAt(0);
Expand Down
10 changes: 5 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Tests(since_id){
*/
{
name: "CHARACTERS",
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 ""
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 ""
mediaType: "image/png",
checksum: "c3f630a42cc39990a6e38c574a93f6c79b3c5a8a"
},
Expand Down Expand Up @@ -67,21 +67,21 @@ function Tests(since_id){
},
{
name: "YOUONLYRUNONCE", // Check that an explicit RUN suppresses an implicit one.
text: '1PRINT"HELLO":!-512=&B000B\nRUN',
text: '🖬1PRINT"HELLO":!-512=&B000B\nRUN',
mediaType: "image/png",
checksum: "28222f638d2c0b97e7e03d0e54561ab7364bd445"
},
{
name: "NOLINENOS", // Test no line numbers -> tokeniser.
text: "P.\"HELLO\";\nV.279;0;0;0;0;32\nP.\"WORLD\"",
text: "💾P.\"HELLO\";\nV.279;0;0;0;0;32\nP.\"WORLD\"",
mediaType: "image/png",
checksum: "5c3db47017774d43ad27c9916af332d471e273e6"
},
{
name: "TOKENS", // Test tokens -> tokeniser.
text: "\xf1~\u0190\n\xef279;0;0;0;0;\n",
mediaType: "image/png",
checksum: "27760d3701f31e398df07429364ef0ebcc8b2434"
checksum: "649072777ed9938fddaed9a57c27f07f2945c0fb"
},
/* FIXME: @-mentions are not currently removed for mastodon
{
Expand All @@ -103,7 +103,7 @@ function Tests(since_id){
},
{
name: "TOKENISE_LONG", // Test tokenisation handles a long input
text: "0PRINT" + (":PRINT".repeat(125)),
text: "💾0PRINT" + (":PRINT".repeat(125)),
mediaType: "image/gif",
checksum: "b1099ab5729e3fdabb1aa12c05aae77f18e6ee83"
},
Expand Down