diff --git a/basic.js b/basic.js index e73bea7..d7b2408 100644 --- a/basic.js +++ b/basic.js @@ -412,7 +412,15 @@ this.basic = (function() { 0xC060: function() { return env.tty.getButtonState ? env.tty.getButtonState(3) : 0; }, 0xC061: function() { return env.tty.getButtonState ? env.tty.getButtonState(0) : 0; }, 0xC062: function() { return env.tty.getButtonState ? env.tty.getButtonState(1) : 0; }, - 0xC063: function() { return env.tty.getButtonState ? env.tty.getButtonState(2) : 0; } + 0xC063: function() { return env.tty.getButtonState ? env.tty.getButtonState(2) : 0; }, + + // Graphics State + 0xC01A: function() { return (env.display && !env.display.getState().graphics) * 128; }, + 0xC01B: function() { return (env.display && !env.display.getState().full) * 128; }, + 0xC01C: function() { return (env.display && !env.display.getState().page1) * 128; }, + 0xC01D: function() { return (env.display && !env.display.getState().lores) * 128; }, + 0xC01E: function() { return (env.tty.isAltCharset && env.tty.isAltCharset()) * 128; }, + 0xC01F: function() { return (env.tty.isFirmwareActive && env.tty.isFirmwareActive()) * 128; } }; poke_table = { diff --git a/index.js b/index.js index dff3f40..c4de80f 100644 --- a/index.js +++ b/index.js @@ -58,6 +58,9 @@ window.addEventListener('DOMContentLoaded', function() { hires2.show(false); tty.splitScreen(0); } + }, + getState: function() { + return Object.assign({}, this.state); } }; var pdl = [0, 0, 0, 0]; diff --git a/reference.html b/reference.html index b993f49..e2965bc 100644 --- a/reference.html +++ b/reference.html @@ -304,6 +304,14 @@ can be literals (unquoted strings), strings, or numbers
PEEK(230)
— Hi-Res plotting page (32 = page 1, 64 = page 2)
PEEK(49152)
— Read Keyboard
PEEK(49168)
— Clear Keyboard strobe
+
+ PEEK(49178)
— See if text mode (> 127) or graphics mode (< 128)
+ PEEK(49179)
— See if mixed mode (> 127) or full mode (< 128)
+ PEEK(49180)
— See if page2 (> 127) or page1 (< 128)
+ PEEK(49181)
— See if hires mode (> 127) or lores mode (< 128)
+ PEEK(49182)
— See if mousetext mode (> 127)
+ PEEK(49188)
— See if 80-column mode (> 127)
+
PEEK(49200)
— Click Speaker (no-op)
PEEK(49248)
— Read Paddle Button #3 — Use the PageDown key
PEEK(49249)
— Read Paddle Button #0 — Use the Home key
diff --git a/samples/sample.unittests.txt b/samples/sample.unittests.txt
index 50bb95f..f15838d 100644
--- a/samples/sample.unittests.txt
+++ b/samples/sample.unittests.txt
@@ -403,9 +403,8 @@
7001 IF NOT LR THEN PRINT "