mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-24 01:58:06 +11:00
ti84: WIP
This commit is contained in:
parent
24e588019b
commit
114e753b64
17
blk/555
17
blk/555
@ -1,16 +1 @@
|
|||||||
( Required config: TI_MEM )
|
1 3 LOADR+
|
||||||
: TI_MEM+ [ TI_MEM LITN ] + ;
|
|
||||||
: LCD_PORT_CMD 0x10 ;
|
|
||||||
: LCD_PORT_DATA 0x11 ;
|
|
||||||
: FNT_WIDTH 3 ;
|
|
||||||
: FNT_HEIGHT 5 ;
|
|
||||||
( Current Y position on the LCD, that is, where we're going to
|
|
||||||
spit our next glyph. )
|
|
||||||
: LCD_CURY 0 TI_MEM+ ;
|
|
||||||
: LCD_CURX 1 TI_MEM+ ;
|
|
||||||
( two pixel buffers that are 8 pixels wide (1b) by FNT_HEIGHT
|
|
||||||
pixels high. This is where we compose our resulting pixels
|
|
||||||
blocks when spitting a glyph. )
|
|
||||||
: LCD_BUF 2 TI_MEM+ ;
|
|
||||||
|
|
||||||
1 2 LOADR+
|
|
||||||
|
25
blk/556
25
blk/556
@ -1,11 +1,14 @@
|
|||||||
: _wait ( Wait until the lcd is ready to receive a command )
|
( Required config: TI_MEM )
|
||||||
( When 7th bit is cleared, we can send a new command )
|
: TI_MEM+ [ TI_MEM LITN ] @ + ;
|
||||||
BEGIN LCD_PORT_CMD PC@ 0x80 AND NOT UNTIL ;
|
: LCD_PORT_CMD 0x10 ;
|
||||||
: _cmd LCD_PORT_CMD PC! _wait ;
|
: LCD_PORT_DATA 0x11 ;
|
||||||
: _data! LCD_PORT_DATA PC! _wait ;
|
: FNTW 3 ;
|
||||||
: _data@ LCD_PORT_DATA PC@ _wait ;
|
: FNTH 5 ;
|
||||||
: LCDOFF 0x02 ( CMD_DISABLE ) _cmd ;
|
( Current Y position on the LCD, that is, where we're going to
|
||||||
: _col! ( col -- )
|
spit our next glyph. )
|
||||||
0x20 ( CMD_COL ) + _cmd ;
|
: LCD_CURY 0 TI_MEM+ ;
|
||||||
: _row! ( row -- )
|
: LCD_CURX 1 TI_MEM+ ;
|
||||||
0x80 ( CMD_ROW ) + _cmd ;
|
( two pixel buffers that are 8 pixels wide (1b) by FNT_HEIGHT
|
||||||
|
pixels high. This is where we compose our resulting pixels
|
||||||
|
blocks when spitting a glyph. )
|
||||||
|
: LCD_BUF 2 TI_MEM+ ;
|
||||||
|
16
blk/557
16
blk/557
@ -1,3 +1,13 @@
|
|||||||
( Load a "glyph line" from buffer, left part being in MSB and
|
|
||||||
right part being in LSB. )
|
: _wait ( Wait until the lcd is ready to receive a command )
|
||||||
: _gl@
|
( When 7th bit is cleared, we can send a new command )
|
||||||
|
BEGIN LCD_PORT_CMD PC@ 0x80 AND NOT UNTIL ;
|
||||||
|
: _cmd LCD_PORT_CMD PC! _wait ;
|
||||||
|
: _data! LCD_PORT_DATA PC! _wait ;
|
||||||
|
: _data@ LCD_PORT_DATA PC@ _wait ;
|
||||||
|
: LCDOFF 0x02 ( CMD_DISABLE ) _cmd ;
|
||||||
|
: _col! ( col -- )
|
||||||
|
0x20 ( CMD_COL ) + _cmd ;
|
||||||
|
: _row! ( row -- )
|
||||||
|
0x80 ( CMD_ROW ) + _cmd ;
|
||||||
|
: LCD$ H@ TI_MEM ! FNTH 2 * 2+ ALLOT ;
|
||||||
|
17
blk/558
17
blk/558
@ -1,5 +1,16 @@
|
|||||||
: _glyph> ( a -- )
|
: _glyph> ( a -- )
|
||||||
LCD_CURY C@ _row! LCD_CURX C@ 8 /MOD _col! ( a coff )
|
LCD_CURY C@ _row! LCD_CURX C@ 8 /MOD _col! ( a coff )
|
||||||
0x05 ( XINC ) _cmd _data@ DROP
|
0x05 ( XINC ) _cmd _data@ DROP SWAP
|
||||||
FNT_HEIGHT 0 DO LOOP
|
FNTH 0 DO ( coff a )
|
||||||
|
C@+ 2 PICK 8 -^ LSHIFT
|
||||||
|
_data@ 8 LSHIFT OR
|
||||||
|
LCD_BUF I + 2DUP FNTH + C!
|
||||||
|
SWAP 8 RSHIFT DUP 42 PC! SWAP C!
|
||||||
|
LOOP 2DROP
|
||||||
|
LCD_CURY C@ _row!
|
||||||
|
FNTH 0 DO LCD_BUF I + C@ _data! LOOP
|
||||||
|
LCD_CURY C@ _row! LCD_CURX C@ 8 / 1+ _col!
|
||||||
|
FNTH 0 DO LCD_BUF FNTH + I + C@ _data! LOOP
|
||||||
|
LCD_CURX C@ FNTW + 1+
|
||||||
|
DUP [ 96 FNTW - LITN ] > IF DROP 0 THEN
|
||||||
|
LCD_CURX C! ;
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
TARGET = os.bin
|
TARGET = stage1.bin
|
||||||
BASEDIR = ../..
|
BASEDIR = ../..
|
||||||
ZASM = $(BASEDIR)/emul/zasm/zasm
|
FDIR = $(BASEDIR)/forth
|
||||||
KERNEL = $(BASEDIR)/kernel
|
EDIR = $(BASEDIR)/emul
|
||||||
APPS = $(BASEDIR)/apps
|
STAGE2 = $(EDIR)/stage2
|
||||||
EMUL = $(BASEDIR)/emul/hw/ti/ti84
|
EMUL = $(BASEDIR)/emul/hw/ti/ti84
|
||||||
MKTIUPGRADE = mktiupgrade
|
MKTIUPGRADE = mktiupgrade
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
$(TARGET): glue.asm
|
$(TARGET): xcomp.fs $(STAGE2)
|
||||||
$(ZASM) $(KERNEL) $(APPS) < glue.asm > $@
|
cat xcomp.fs | $(STAGE2) > $@
|
||||||
|
|
||||||
$(EMUL):
|
$(EMUL):
|
||||||
$(MAKE) -C ${@:%/ti84=%}
|
$(MAKE) -C ${@:%/ti84=%}
|
||||||
|
20
recipes/ti84/xcomp.fs
Normal file
20
recipes/ti84/xcomp.fs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
0x8000 CONSTANT RAMSTART
|
||||||
|
0xb000 CONSTANT RS_ADDR
|
||||||
|
RAMSTART 0x70 + CONSTANT TI_MEM
|
||||||
|
212 LOAD ( z80 assembler )
|
||||||
|
262 LOAD ( xcomp )
|
||||||
|
: CODE XCODE ;
|
||||||
|
: IMMEDIATE XIMM ;
|
||||||
|
: (entry) (xentry) ;
|
||||||
|
: : [ ' X: , ] ;
|
||||||
|
|
||||||
|
CURRENT @ XCURRENT !
|
||||||
|
|
||||||
|
282 LOAD ( boot.z80 )
|
||||||
|
393 LOAD ( icore )
|
||||||
|
(entry) _
|
||||||
|
( Update LATEST )
|
||||||
|
PC ORG @ 8 + !
|
||||||
|
," 42 42 PC! BYE "
|
||||||
|
ORG @ 256 /MOD 2 PC! 2 PC!
|
||||||
|
H@ 256 /MOD 2 PC! 2 PC!
|
Loading…
Reference in New Issue
Block a user