mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-02 20:20:55 +11:00
Compare commits
3 Commits
6c1b1f2b79
...
67f689260f
Author | SHA1 | Date | |
---|---|---|---|
|
67f689260f | ||
|
6a70a0e5e6 | ||
|
b27a71cb88 |
@ -147,6 +147,6 @@ kbdGetC:
|
|||||||
.db 0xfd, 0x0d, '"' ,'W' ,'R', 'M', 'H', 0, 0
|
.db 0xfd, 0x0d, '"' ,'W' ,'R', 'M', 'H', 0, 0
|
||||||
.db 0xfb, '?', 0, 'V', 'Q', 'L', 'G', 0, 0
|
.db 0xfb, '?', 0, 'V', 'Q', 'L', 'G', 0, 0
|
||||||
.db 0xf7, ':', 'Z', 'U', 'P', 'K', 'F', 'C', 0
|
.db 0xf7, ':', 'Z', 'U', 'P', 'K', 'F', 'C', 0
|
||||||
.db 0xef, '_', 'Y', 'T', 'O', 'J', 'E', 'B', 0
|
.db 0xef, ' ', 'Y', 'T', 'O', 'J', 'E', 'B', 0
|
||||||
.db 0xdf, 0, 'X', 'S', 'N', 'I', 'D', 'A', KBD_KEY_ALPHA
|
.db 0xdf, 0, 'X', 'S', 'N', 'I', 'D', 'A', KBD_KEY_ALPHA
|
||||||
.db 0xbf, 0, 0, 0, 0, 0, KBD_KEY_2ND, 0, 0x7f
|
.db 0xbf, 0, 0, 0, 0, 0, KBD_KEY_2ND, 0, 0x7f
|
||||||
|
@ -2,9 +2,30 @@
|
|||||||
;
|
;
|
||||||
; Implement PutC on TI-84+ (for now)'s LCD screen.
|
; Implement PutC on TI-84+ (for now)'s LCD screen.
|
||||||
;
|
;
|
||||||
|
; 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 (there are two modes).
|
||||||
|
;
|
||||||
|
; In 6-bit mode, there are 16 visible columns. In 8-bit mode, there are 12.
|
||||||
|
;
|
||||||
; Note that "X-increment" and "Y-increment" work in the opposite way than what
|
; Note that "X-increment" and "Y-increment" work in the opposite way than what
|
||||||
; most people expect. Y moves left and right, X moves up and down.
|
; most people expect. Y moves left and right, X moves up and down.
|
||||||
;
|
;
|
||||||
|
; *** Z-Offset ***
|
||||||
|
;
|
||||||
|
; This LCD has a "Z-Offset" parameter, allowing to offset rows on the
|
||||||
|
; screen however we wish. This is handy because it allows us to scroll more
|
||||||
|
; efficiently. Instead of having to copy the LCD ram around at each linefeed
|
||||||
|
; (or instead of having to maintain an in-memory buffer), we can use this
|
||||||
|
; feature.
|
||||||
|
;
|
||||||
|
; The Z-Offet goes upwards, with wrapping. For example, if we have an 8 pixels
|
||||||
|
; high line at row 0 and if our offset is 8, that line will go up 8 pixels,
|
||||||
|
; wrapping itself to the bottom of the screen.
|
||||||
|
;
|
||||||
|
; The principle is this: The active line is always the bottom one. Therefore,
|
||||||
|
; when active row is 0, Z is FNT_HEIGHT+1, when row is 1, Z is (FNT_HEIGHT+1)*2,
|
||||||
|
; When row is 8, Z is 0.
|
||||||
|
;
|
||||||
; *** Requirements ***
|
; *** Requirements ***
|
||||||
; fnt/mgm
|
; fnt/mgm
|
||||||
;
|
;
|
||||||
@ -41,11 +62,15 @@ lcdInit:
|
|||||||
; Clear screen
|
; Clear screen
|
||||||
call lcdClrScr
|
call lcdClrScr
|
||||||
|
|
||||||
|
; We begin with a Z offset of FNT_HEIGHT+1
|
||||||
|
ld a, LCD_CMD_ZOFFSET+FNT_HEIGHT+1
|
||||||
|
call lcdCmd
|
||||||
|
|
||||||
; Enable the LCD
|
; Enable the LCD
|
||||||
ld a, LCD_CMD_ENABLE
|
ld a, LCD_CMD_ENABLE
|
||||||
call lcdCmd
|
call lcdCmd
|
||||||
|
|
||||||
; Hack to get LCD to work. According to WikiTI, we're to sure why TIOS
|
; Hack to get LCD to work. According to WikiTI, we're not sure why TIOS
|
||||||
; sends these, but it sends it, and it is required to make the LCD
|
; sends these, but it sends it, and it is required to make the LCD
|
||||||
; work. So...
|
; work. So...
|
||||||
ld a, 0x17
|
ld a, 0x17
|
||||||
@ -82,7 +107,7 @@ lcdWait:
|
|||||||
lcdCmd:
|
lcdCmd:
|
||||||
out (LCD_PORT_CMD), a
|
out (LCD_PORT_CMD), a
|
||||||
jr lcdWait
|
jr lcdWait
|
||||||
|
|
||||||
; Send data A to LCD
|
; Send data A to LCD
|
||||||
lcdData:
|
lcdData:
|
||||||
out (LCD_PORT_DATA), a
|
out (LCD_PORT_DATA), a
|
||||||
@ -127,7 +152,7 @@ lcdSendGlyph:
|
|||||||
call lcdSetRow
|
call lcdSetRow
|
||||||
ld a, (LCD_CURCOL)
|
ld a, (LCD_CURCOL)
|
||||||
call lcdSetCol
|
call lcdSetCol
|
||||||
|
|
||||||
; let's increase (and wrap) col now
|
; let's increase (and wrap) col now
|
||||||
inc a
|
inc a
|
||||||
ld (LCD_CURCOL), a
|
ld (LCD_CURCOL), a
|
||||||
@ -151,15 +176,26 @@ lcdSendGlyph:
|
|||||||
lcdLinefeed:
|
lcdLinefeed:
|
||||||
push af
|
push af
|
||||||
ld a, (LCD_CURROW)
|
ld a, (LCD_CURROW)
|
||||||
add a, FNT_HEIGHT+1
|
call .addFntH
|
||||||
ld (LCD_CURROW), a
|
ld (LCD_CURROW), a
|
||||||
|
call lcdClrLn
|
||||||
|
; Now, lets set Z offset which is CURROW+FNT_HEIGHT+1
|
||||||
|
call .addFntH
|
||||||
|
add a, LCD_CMD_ZOFFSET
|
||||||
|
call lcdCmd
|
||||||
xor a
|
xor a
|
||||||
ld (LCD_CURCOL), a
|
ld (LCD_CURCOL), a
|
||||||
pop af
|
pop af
|
||||||
ret
|
ret
|
||||||
|
.addFntH:
|
||||||
|
add a, FNT_HEIGHT+1
|
||||||
|
cp 64
|
||||||
|
ret c ; A < 64? no wrap
|
||||||
|
; we have to wrap around
|
||||||
|
xor a
|
||||||
|
ret
|
||||||
|
|
||||||
; Clears B rows starting at row A
|
; Clears B rows starting at row A
|
||||||
; The LCD will then be set back at row A, column 0
|
|
||||||
; B is not preserved by this routine
|
; B is not preserved by this routine
|
||||||
lcdClrX:
|
lcdClrX:
|
||||||
push af
|
push af
|
||||||
|
Loading…
Reference in New Issue
Block a user