implement colour codes and updating colour RAM
This commit is contained in:
1 parent
6e4ba6ce18
commit
07f1a649c5
2 files changed
+29
-4
No files matched your search
@@ -27,17 +27,21 @@ blink_cursor:
|
|||||||
dec cursor_blink_countdown
|
dec cursor_blink_countdown
|
||||||
bpl no_blink_cursor
|
bpl no_blink_cursor
|
||||||
|
|
||||||
;; XXX - Save character colour also!
|
|
||||||
|
|
||||||
;; Check if cursor was visible or not, and toggle
|
;; Check if cursor was visible or not, and toggle
|
||||||
lda cursor_is_visible
|
lda cursor_is_visible
|
||||||
bne undraw_cursor
|
bne undraw_cursor
|
||||||
draw_cursor:
|
draw_cursor:
|
||||||
ldy current_screen_x
|
ldy current_screen_x
|
||||||
lda (current_screen_line_ptr),y
|
lda (current_screen_line_ptr),y
|
||||||
sta cursor_saved_character
|
sta cursor_saved_character
|
||||||
eor #$80
|
eor #$80
|
||||||
sta (current_screen_line_ptr),y
|
sta (current_screen_line_ptr),y
|
||||||
|
;; Also set cursor colour
|
||||||
|
lda (current_screen_line_colour_ptr),y
|
||||||
|
sta colour_under_cursor
|
||||||
|
lda text_colour
|
||||||
|
sta (current_screen_line_colour_ptr),y
|
||||||
|
|
||||||
lda #1
|
lda #1
|
||||||
sta cursor_is_visible
|
sta cursor_is_visible
|
||||||
jmp reset_blink_timer
|
jmp reset_blink_timer
|
||||||
@@ -46,6 +50,9 @@ undraw_cursor:
|
|||||||
lda cursor_saved_character
|
lda cursor_saved_character
|
||||||
ldy current_screen_x
|
ldy current_screen_x
|
||||||
sta (current_screen_line_ptr),y
|
sta (current_screen_line_ptr),y
|
||||||
|
lda colour_under_cursor
|
||||||
|
sta (current_screen_line_colour_ptr),y
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta cursor_is_visible
|
sta cursor_is_visible
|
||||||
;; Fall through
|
;; Fall through
|
||||||
|
|||||||
+19
-1
@@ -37,6 +37,18 @@ not_0a:
|
|||||||
jmp screen_advance_to_next_line
|
jmp screen_advance_to_next_line
|
||||||
not_0d:
|
not_0d:
|
||||||
|
|
||||||
|
;; Check for quote mode
|
||||||
|
|
||||||
|
;; Check for colours
|
||||||
|
ldx #$f
|
||||||
|
colour_check_loop:
|
||||||
|
cmp colour_codes,x
|
||||||
|
bne +
|
||||||
|
stx text_colour
|
||||||
|
jmp chrout_done
|
||||||
|
* dex
|
||||||
|
bpl colour_check_loop
|
||||||
|
|
||||||
;; Check for cursor movement keys
|
;; Check for cursor movement keys
|
||||||
cmp #$11
|
cmp #$11
|
||||||
bne not_11
|
bne not_11
|
||||||
@@ -121,7 +133,9 @@ chrout_l1:
|
|||||||
ldy current_screen_x
|
ldy current_screen_x
|
||||||
sta (current_screen_line_ptr),y
|
sta (current_screen_line_ptr),y
|
||||||
|
|
||||||
;; XXX - Update colour RAM also
|
;; Set colour
|
||||||
|
lda text_colour
|
||||||
|
sta (current_screen_line_colour_ptr),y
|
||||||
|
|
||||||
;; Advance the column, and scroll screen down if we need
|
;; Advance the column, and scroll screen down if we need
|
||||||
;; to insert a 2nd line in this logical line.
|
;; to insert a 2nd line in this logical line.
|
||||||
@@ -333,3 +347,7 @@ advance_screen_pointer_40_bytes:
|
|||||||
|
|
||||||
jmp update_colour_line_pointer
|
jmp update_colour_line_pointer
|
||||||
|
|
||||||
|
colour_codes:
|
||||||
|
;; CHR$ codes for the 16 colours
|
||||||
|
.byte 144,5,28,159,156,30,31,158
|
||||||
|
.byte 129,149,150,151,152,153,154,155
|
||||||
Reference in new issue
Block a user