diff --git a/assets/basic.js b/assets/basic.js index d836ace..2371f64 100644 --- a/assets/basic.js +++ b/assets/basic.js @@ -905,7 +905,9 @@ if no arg text were given (e.g. "10 NEXT"), args will have zero length // print out prompt text print("? "); var rh = sys.read().trim(); - if (!isNaN(rh)) rh = rh*1 // if string we got can be cast to number, do it + // if string we got can be cast to number, do it + // NOTE: empty string will be cast to 0, which corresponds to GW-BASIC + if (!isNaN(rh)) rh = rh*1 if (troValue.arrFull !== undefined) { // assign to existing array if (isNaN(rh) && !Array.isArray(rh)) throw lang.illegalType(lnum, rh); diff --git a/src/net/torvald/tsvm/peripheral/GraphicsAdapter.kt b/src/net/torvald/tsvm/peripheral/GraphicsAdapter.kt index 894875a..e934236 100644 --- a/src/net/torvald/tsvm/peripheral/GraphicsAdapter.kt +++ b/src/net/torvald/tsvm/peripheral/GraphicsAdapter.kt @@ -31,10 +31,14 @@ data class AdapterConfig( val paletteShader: String = DRAW_SHADER_FRAG ) +data class SuperGraphicsAddonConfig( + val hasSecondBank: Boolean = false +) + /** * NOTE: if TTY size is greater than 80*32, SEGFAULT will occur because text buffer is fixed in size */ -open class GraphicsAdapter(val vm: VM, val config: AdapterConfig) : +open class GraphicsAdapter(val vm: VM, val config: AdapterConfig, val sgr: SuperGraphicsAddonConfig = SuperGraphicsAddonConfig()) : GlassTty(config.textRows, config.textCols), PeriBase { override fun getVM(): VM { @@ -152,7 +156,7 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig) : faketex = Texture(pm) pm.dispose() - // initialise with NONZERO value; value zero corresponds with opaque black, and it will paint the whole screen black + // initialise with NONZERO value; value zero corresponds to opaque black, and it will paint the whole screen black // when in text mode, and that's undesired behaviour // -1 is preferred because it points to the colour CLEAR, and it's constant. spriteAndTextArea.fillWith(-1) diff --git a/terranmon.txt b/terranmon.txt index 666fbd2..1929501 100644 --- a/terranmon.txt +++ b/terranmon.txt @@ -168,17 +168,23 @@ FI Palette stored in following pattern: 0b rrrr gggg, 0b bbbb aaaa, .... Palette number 255 is always full transparent (bits being all zero) -Optional Sprite Card -16 bytes - Reserved -65520 bytes: - (0th sprite is always the GUI cursor, thus 251 sprites) - 2 bytes - Ob hv000pxy yyyyyyyy (p: 0 for above-text, 1 for below-text, h: horizontal flip, v: vertical flip, x: show/hide, y: y-position) - 2 bytes - 0b rr0000xx xxxxxxxx (r: rotation, x: x-position) +Optional Sprite Card (VRAM Bank 1 (256 kB)) +250880 bytes + Secondary framebuffer +533 bytes: Sprite attribute table + (41 sprites total, of which 1 is GUI cursor) + 12 bytes - signed fixed point + X-position + Y-position + Transform matrix A..D + 1 bytes + 0b 0000 00vp + (p: 0 for above-all, 1 for below-text, v: show/hide) +10496 bytes: Sprite table 256 bytes 16x16 texture for the sprite +235 bytes: + unused MMIO