mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 23:04:04 +09:00
minor fixups
This commit is contained in:
@@ -905,7 +905,9 @@ if no arg text were given (e.g. "10 NEXT"), args will have zero length
|
|||||||
// print out prompt text
|
// print out prompt text
|
||||||
print("? "); var rh = sys.read().trim();
|
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 (troValue.arrFull !== undefined) { // assign to existing array
|
||||||
if (isNaN(rh) && !Array.isArray(rh)) throw lang.illegalType(lnum, rh);
|
if (isNaN(rh) && !Array.isArray(rh)) throw lang.illegalType(lnum, rh);
|
||||||
|
|||||||
@@ -31,10 +31,14 @@ data class AdapterConfig(
|
|||||||
val paletteShader: String = DRAW_SHADER_FRAG
|
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
|
* 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 {
|
GlassTty(config.textRows, config.textCols), PeriBase {
|
||||||
|
|
||||||
override fun getVM(): VM {
|
override fun getVM(): VM {
|
||||||
@@ -152,7 +156,7 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig) :
|
|||||||
faketex = Texture(pm)
|
faketex = Texture(pm)
|
||||||
pm.dispose()
|
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
|
// when in text mode, and that's undesired behaviour
|
||||||
// -1 is preferred because it points to the colour CLEAR, and it's constant.
|
// -1 is preferred because it points to the colour CLEAR, and it's constant.
|
||||||
spriteAndTextArea.fillWith(-1)
|
spriteAndTextArea.fillWith(-1)
|
||||||
|
|||||||
@@ -168,17 +168,23 @@ FI
|
|||||||
Palette stored in following pattern: 0b rrrr gggg, 0b bbbb aaaa, ....
|
Palette stored in following pattern: 0b rrrr gggg, 0b bbbb aaaa, ....
|
||||||
Palette number 255 is always full transparent (bits being all zero)
|
Palette number 255 is always full transparent (bits being all zero)
|
||||||
|
|
||||||
Optional Sprite Card
|
Optional Sprite Card (VRAM Bank 1 (256 kB))
|
||||||
16 bytes
|
250880 bytes
|
||||||
Reserved
|
Secondary framebuffer
|
||||||
65520 bytes:
|
533 bytes: Sprite attribute table
|
||||||
(0th sprite is always the GUI cursor, thus 251 sprites)
|
(41 sprites total, of which 1 is GUI cursor)
|
||||||
2 bytes
|
12 bytes - signed fixed point
|
||||||
Ob hv000pxy yyyyyyyy (p: 0 for above-text, 1 for below-text, h: horizontal flip, v: vertical flip, x: show/hide, y: y-position)
|
X-position
|
||||||
2 bytes
|
Y-position
|
||||||
0b rr0000xx xxxxxxxx (r: rotation, x: x-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
|
256 bytes
|
||||||
16x16 texture for the sprite
|
16x16 texture for the sprite
|
||||||
|
235 bytes:
|
||||||
|
unused
|
||||||
|
|
||||||
MMIO
|
MMIO
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user