1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-02 22:30:55 +11:00

Compare commits

..

No commits in common. "67f689260f9e5af493a7c1bc000ca0ce6e279258" and "6c1b1f2b79827b1e0d6b7498ab3d3085256cb9b0" have entirely different histories.

2 changed files with 7 additions and 43 deletions

View File

@ -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

View File

@ -2,30 +2,9 @@
; ;
; 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
; ;
@ -62,15 +41,11 @@ 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 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 ; sends these, but it sends it, and it is required to make the LCD
; work. So... ; work. So...
ld a, 0x17 ld a, 0x17
@ -107,7 +82,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
@ -152,7 +127,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
@ -176,26 +151,15 @@ lcdSendGlyph:
lcdLinefeed: lcdLinefeed:
push af push af
ld a, (LCD_CURROW) ld a, (LCD_CURROW)
call .addFntH add a, FNT_HEIGHT+1
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