浏览代码

Adjust Grid subsystem

Rename ROWS to LINES (it's what VE uses). Also, don't use COLS and
LINES as immediates in the Grid subsystem: we expect those words to
be available at runtime.
master
Virgil Dupras 3 年前
父节点
当前提交
e0bcf3473e
共有 7 个文件被更改,包括 11 次插入15 次删除
  1. +3
    -0
      arch/z80/sms/blk/608
  2. +0
    -2
      arch/z80/sms/xcomp.fs
  3. +0
    -2
      arch/z80/sms/xcompkbd.fs
  4. +0
    -2
      arch/z80/sms/xcompsdc.fs
  5. +5
    -5
      blk/402
  6. +1
    -2
      blk/403
  7. +2
    -2
      doc/protocol.txt

+ 3
- 0
arch/z80/sms/blk/608 查看文件

@@ -6,3 +6,6 @@
( sprite, inverted colors ) 0x3f _data 15 _zero
0x4000 _ctl 0x5e 0 DO ~FNT I 7 * + _sfont LOOP
( bit 6, enable display, bit 7, ?? ) 0x81c0 _ctl ;

: COLS 32 ;
: LINES 24 ;

+ 0
- 2
arch/z80/sms/xcomp.fs 查看文件

@@ -7,8 +7,6 @@ RS_ADDR 0x80 - CONSTANT SYSVARS
0xbf CONSTANT VDP_CTLPORT
0xbe CONSTANT VDP_DATAPORT
SYSVARS 0x70 + CONSTANT GRID_MEM
32 CONSTANT COLS
24 CONSTANT ROWS
SYSVARS 0x72 + CONSTANT CPORT_MEM
0x3f CONSTANT CPORT_CTL
0xdc CONSTANT CPORT_D1


+ 0
- 2
arch/z80/sms/xcompkbd.fs 查看文件

@@ -8,8 +8,6 @@ RS_ADDR 0x80 - CONSTANT SYSVARS
0xbf CONSTANT VDP_CTLPORT
0xbe CONSTANT VDP_DATAPORT
SYSVARS 0x70 + CONSTANT GRID_MEM
32 CONSTANT COLS
24 CONSTANT ROWS
SYSVARS 0x72 + CONSTANT CPORT_MEM
0x3f CONSTANT CPORT_CTL
0xdc CONSTANT CPORT_D1


+ 0
- 2
arch/z80/sms/xcompsdc.fs 查看文件

@@ -9,8 +9,6 @@ RS_ADDR 0x80 - CONSTANT SYSVARS
0xbf CONSTANT VDP_CTLPORT
0xbe CONSTANT VDP_DATAPORT
SYSVARS 0x70 + CONSTANT GRID_MEM
32 CONSTANT COLS
24 CONSTANT ROWS
SYSVARS 0x72 + CONSTANT CPORT_MEM
0x3f CONSTANT CPORT_CTL
0xdc CONSTANT CPORT_D1


+ 5
- 5
blk/402 查看文件

@@ -1,10 +1,10 @@
: XYPOS [ GRID_MEM LITN ] ;
: AT-XY ( x y -- ) [ ROWS LITN ] * +
[ COLS ROWS * LITN ] MOD XYPOS ! ;
: _cl* COLS LINES * ;
: AT-XY ( x y -- ) LINES * + _cl* MOD XYPOS ! ;
: _lf
XYPOS @ BEGIN ( pos )
0 ( blank ) SWAP TUCK CELL!
1+ DUP [ COLS LITN ] MOD NOT UNTIL
[ COLS ROWS * LITN ] MOD XYPOS ! ;
1+ DUP COLS MOD NOT UNTIL
_cl* MOD XYPOS ! ;
: _bs 0 ( blank ) XYPOS @ TUCK CELL! ( pos ) 1-
[ COLS ROWS * LITN ] MOD XYPOS ! ;
_cl* MOD XYPOS ! ;

+ 1
- 2
blk/403 查看文件

@@ -3,5 +3,4 @@
DUP 0x0d = IF DROP _lf EXIT THEN
0x20 - DUP 0< IF DROP EXIT THEN
XYPOS @ CELL!
XYPOS @ 1+ DUP [ COLS ROWS * LITN ]
= IF DROP 0 THEN XYPOS ! ;
XYPOS @ 1+ _cl* MOD XYPOS ! ;

+ 2
- 2
doc/protocol.txt 查看文件

@@ -43,11 +43,11 @@ A grid is a device that shows as a grid of ASCII characters and
allows random access to it.

COLS -- n Number of columns in the device
ROWS -- n Number of rows in the device
LINES -- n Number of lines in the device
CELL! g pos -- Set glyph at pos

"pos" is a simple number (y * cols) + x. For example, if we
have 40 columns per row, the position (x, y) (12, 10) is 412.
have 40 columns per line, the position (x, y) (12, 10) is 412.

A glyph is ASCII-0x20. If the resulting glyph number exceeds the
number of glyphs in the font, it's up to CELL! to ignore it.


正在加载...
取消
保存