mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-26 07:38:06 +11:00
Compare commits
No commits in common. "67f689260f9e5af493a7c1bc000ca0ce6e279258" and "6c1b1f2b79827b1e0d6b7498ab3d3085256cb9b0" have entirely different histories.
67f689260f
...
6c1b1f2b79
@ -147,6 +147,6 @@ kbdGetC:
|
||||
.db 0xfd, 0x0d, '"' ,'W' ,'R', 'M', 'H', 0, 0
|
||||
.db 0xfb, '?', 0, 'V', 'Q', 'L', 'G', 0, 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 0xbf, 0, 0, 0, 0, 0, KBD_KEY_2ND, 0, 0x7f
|
||||
|
@ -2,30 +2,9 @@
|
||||
;
|
||||
; 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
|
||||
; 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 ***
|
||||
; fnt/mgm
|
||||
;
|
||||
@ -62,15 +41,11 @@ lcdInit:
|
||||
; Clear screen
|
||||
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
|
||||
ld a, LCD_CMD_ENABLE
|
||||
call lcdCmd
|
||||
|
||||
; Hack to get LCD to work. According to WikiTI, we're not sure why TIOS
|
||||
; Hack to get LCD to work. According to WikiTI, we're to sure why TIOS
|
||||
; sends these, but it sends it, and it is required to make the LCD
|
||||
; work. So...
|
||||
ld a, 0x17
|
||||
@ -107,7 +82,7 @@ lcdWait:
|
||||
lcdCmd:
|
||||
out (LCD_PORT_CMD), a
|
||||
jr lcdWait
|
||||
|
||||
|
||||
; Send data A to LCD
|
||||
lcdData:
|
||||
out (LCD_PORT_DATA), a
|
||||
@ -152,7 +127,7 @@ lcdSendGlyph:
|
||||
call lcdSetRow
|
||||
ld a, (LCD_CURCOL)
|
||||
call lcdSetCol
|
||||
|
||||
|
||||
; let's increase (and wrap) col now
|
||||
inc a
|
||||
ld (LCD_CURCOL), a
|
||||
@ -176,26 +151,15 @@ lcdSendGlyph:
|
||||
lcdLinefeed:
|
||||
push af
|
||||
ld a, (LCD_CURROW)
|
||||
call .addFntH
|
||||
add a, FNT_HEIGHT+1
|
||||
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
|
||||
ld (LCD_CURCOL), a
|
||||
pop af
|
||||
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
|
||||
; The LCD will then be set back at row A, column 0
|
||||
; B is not preserved by this routine
|
||||
lcdClrX:
|
||||
push af
|
||||
|
Loading…
Reference in New Issue
Block a user