mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-26 21:28:05 +11:00
Compare commits
2 Commits
afc2327770
...
2f1e635b9d
Author | SHA1 | Date | |
---|---|---|---|
|
2f1e635b9d | ||
|
b2d71cb1ee |
4
blk/551
4
blk/551
@ -1,7 +1,7 @@
|
|||||||
TI-84+ LCD driver
|
TI-84+ LCD driver
|
||||||
|
|
||||||
Implement (emit) on TI-84+ (for now)'s LCD screen. Load with
|
Implement (emit) on TI-84+ (for now)'s LCD screen. The low
|
||||||
"555 LOAD".
|
level part are blocks 555-557 and high level ones are 558-560.
|
||||||
|
|
||||||
The screen is 96x64 pixels. The 64 rows are addressed directly
|
The screen is 96x64 pixels. The 64 rows are addressed directly
|
||||||
with CMD_ROW but columns are addressed in chunks of 6 or 8 bits
|
with CMD_ROW but columns are addressed in chunks of 6 or 8 bits
|
||||||
|
4
blk/552
4
blk/552
@ -12,5 +12,5 @@ that line will go up 8 pixels, wrapping itself to the bottom of
|
|||||||
the screen.
|
the screen.
|
||||||
|
|
||||||
The principle is this: The active line is always the bottom
|
The principle is this: The active line is always the bottom
|
||||||
one. Therefore, when active row is 0, Z is FNT_HEIGHT+1, when
|
one. Therefore, when active row is 0, Z is FNTH+1, when row is
|
||||||
row is 1, Z is (FNT_HEIGHT+1)*2, When row is 8, Z is 0. (cont.)
|
1, Z is (FNTH+1)*2, When row is 8, Z is 0. (cont.)
|
||||||
|
10
blk/553
10
blk/553
@ -8,9 +8,9 @@ only 16 characters per line, which is hardly usable.
|
|||||||
|
|
||||||
This is why we have this buffering system. How it works is that
|
This is why we have this buffering system. How it works is that
|
||||||
we're always in 8-bit mode and we hold the whole area (8 pixels
|
we're always in 8-bit mode and we hold the whole area (8 pixels
|
||||||
wide by FNT_HEIGHT high) in memory. When we want to put a glyph
|
wide by FNTH high) in memory. When we want to put a glyph to
|
||||||
to screen, we first read the contents of that area, then add
|
screen, we first read the contents of that area, then add our
|
||||||
our new glyph, offsetted and masked, to that buffer, then push
|
new glyph, offsetted and masked, to that buffer, then push the
|
||||||
the buffer back to the LCD. If the glyph is split, move to the
|
buffer back to the LCD. If the glyph is split, move to the next
|
||||||
next area and finish the job.
|
area and finish the job.
|
||||||
(cont.)
|
(cont.)
|
||||||
|
10
blk/555
10
blk/555
@ -1,15 +1,13 @@
|
|||||||
( Required config: TI_MEM )
|
( Required config: LCD_MEM )
|
||||||
: TI_MEM+ [ TI_MEM LITN ] @ + ;
|
: _mem+ [ LCD_MEM LITN ] @ + ;
|
||||||
TI_MEM : TI_MEM [ LITN ] ;
|
|
||||||
: LCD_PORT_CMD 0x10 ; : LCD_PORT_DATA 0x11 ;
|
|
||||||
: FNTW 3 ; : FNTH 5 ;
|
: FNTW 3 ; : FNTH 5 ;
|
||||||
( Wait until the lcd is ready to receive a command. It's a bit
|
( Wait until the lcd is ready to receive a command. It's a bit
|
||||||
weird to implement a waiting routine in asm, but the forth
|
weird to implement a waiting routine in asm, but the forth
|
||||||
version is a bit heavy and we don't want to wait longer than
|
version is a bit heavy and we don't want to wait longer than
|
||||||
we have to. )
|
we have to. )
|
||||||
CODE LCDWAIT
|
CODE _wait
|
||||||
BEGIN,
|
BEGIN,
|
||||||
0x10 INAn,
|
0x10 ( CMD ) INAn,
|
||||||
RLA, ( When 7th bit is clr, we can send a new cmd )
|
RLA, ( When 7th bit is clr, we can send a new cmd )
|
||||||
JRC, AGAIN,
|
JRC, AGAIN,
|
||||||
;CODE
|
;CODE
|
||||||
|
13
blk/556
13
blk/556
@ -1,8 +1,13 @@
|
|||||||
( Current Y position on the LCD, that is, where we're going to
|
( Current Y position on the LCD, that is, where we're going to
|
||||||
spit our next glyph. )
|
spit our next glyph. )
|
||||||
: LCD_CURY 0 TI_MEM+ ;
|
: LCD_CURY 0 _mem+ ;
|
||||||
: LCD_CURX 1 TI_MEM+ ;
|
: LCD_CURX 1 _mem+ ;
|
||||||
( two pixel buffers that are 8 pixels wide (1b) by FNT_HEIGHT
|
( two pixel buffers that are 8 pixels wide (1b) by FNTH
|
||||||
pixels high. This is where we compose our resulting pixels
|
pixels high. This is where we compose our resulting pixels
|
||||||
blocks when spitting a glyph. )
|
blocks when spitting a glyph. )
|
||||||
: LCD_BUF 2 TI_MEM+ ;
|
: LCD_BUF 2 _mem+ ;
|
||||||
|
: _cmd 0x10 ( CMD ) PC! _wait ;
|
||||||
|
: _data! 0x11 ( DATA ) PC! _wait ;
|
||||||
|
: _data@ 0x11 ( DATA ) PC@ _wait ;
|
||||||
|
: LCDOFF 0x02 ( CMD_DISABLE ) _cmd ;
|
||||||
|
: LCDON 0x03 ( CMD_ENABLE ) _cmd ;
|
||||||
|
13
blk/557
13
blk/557
@ -1,12 +1,9 @@
|
|||||||
: _cmd LCD_PORT_CMD PC! LCDWAIT ;
|
|
||||||
: _data! LCD_PORT_DATA PC! LCDWAIT ;
|
|
||||||
: _data@ LCD_PORT_DATA PC@ LCDWAIT ;
|
|
||||||
: LCDOFF 0x02 ( CMD_DISABLE ) _cmd ;
|
|
||||||
: LCDON 0x03 ( CMD_ENABLE ) _cmd ;
|
|
||||||
: _yinc 0x07 _cmd ; : _xinc 0x05 _cmd ;
|
: _yinc 0x07 _cmd ; : _xinc 0x05 _cmd ;
|
||||||
: _col! ( col -- ) 0x20 ( CMD_COL ) + _cmd ;
|
: _zoff! ( off -- ) 0x40 + _cmd ;
|
||||||
: _row! ( row -- ) 0x80 ( CMD_ROW ) + _cmd ;
|
: _col! ( col -- ) 0x20 + _cmd ;
|
||||||
|
: _row! ( row -- ) 0x80 + _cmd ;
|
||||||
: LCD$
|
: LCD$
|
||||||
H@ TI_MEM ! FNTH 2 * 2+ ALLOT
|
H@ [ LCD_MEM LITN ] ! FNTH 2 * 2+ ALLOT
|
||||||
LCDON 0x01 ( 8-bit mode ) _cmd
|
LCDON 0x01 ( 8-bit mode ) _cmd
|
||||||
|
FNTH 1+ _zoff!
|
||||||
;
|
;
|
||||||
|
3
blk/558
3
blk/558
@ -10,4 +10,5 @@
|
|||||||
( Changes the current line and go back to leftmost column )
|
( Changes the current line and go back to leftmost column )
|
||||||
: _lf
|
: _lf
|
||||||
LCD_CURY C@ FNTH 1+ + DUP 63 > IF DROP 0 THEN
|
LCD_CURY C@ FNTH 1+ + DUP 63 > IF DROP 0 THEN
|
||||||
DUP _clrln LCD_CURY C! 0 LCD_CURX C! ;
|
DUP _clrln DUP FNTH 1+ _zoff!
|
||||||
|
LCD_CURY C! 0 LCD_CURX C! ;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
0x8000 CONSTANT RAMSTART
|
0x8000 CONSTANT RAMSTART
|
||||||
0xb000 CONSTANT RS_ADDR
|
0xb000 CONSTANT RS_ADDR
|
||||||
RAMSTART 0x70 + CONSTANT TI_MEM
|
RAMSTART 0x70 + CONSTANT LCD_MEM
|
||||||
212 LOAD ( z80 assembler )
|
212 LOAD ( z80 assembler )
|
||||||
262 LOAD ( xcomp )
|
262 LOAD ( xcomp )
|
||||||
522 LOAD ( font compiler )
|
522 LOAD ( font compiler )
|
||||||
@ -12,15 +12,15 @@ RAMSTART 0x70 + CONSTANT TI_MEM
|
|||||||
CURRENT @ XCURRENT !
|
CURRENT @ XCURRENT !
|
||||||
|
|
||||||
282 LOAD ( boot.z80 )
|
282 LOAD ( boot.z80 )
|
||||||
555 LOAD ( ti.z80 )
|
|
||||||
393 LOAD ( icore low )
|
393 LOAD ( icore low )
|
||||||
|
555 557 LOADR ( ti low )
|
||||||
415 LOAD ( icore high )
|
415 LOAD ( icore high )
|
||||||
(entry) ~FNT CPFNT3x5
|
(entry) ~FNT CPFNT3x5
|
||||||
(entry) _
|
(entry) _
|
||||||
( Update LATEST )
|
( Update LATEST )
|
||||||
PC ORG @ 8 + !
|
PC ORG @ 8 + !
|
||||||
422 437 XPACKR ( core )
|
422 437 XPACKR ( core )
|
||||||
556 560 XPACKR ( ti )
|
558 560 XPACKR ( ti high )
|
||||||
438 446 XPACKR ( print fmt )
|
438 446 XPACKR ( print fmt )
|
||||||
," : _ LCD$ LIT< Hello (print) LIT< World! (print) BYE ; _ "
|
," : _ LCD$ LIT< Hello (print) LIT< World! (print) BYE ; _ "
|
||||||
ORG @ 256 /MOD 2 PC! 2 PC!
|
ORG @ 256 /MOD 2 PC! 2 PC!
|
||||||
|
Loading…
Reference in New Issue
Block a user