DEV Community

Qiwen Yu
Qiwen Yu

Posted on • Edited on

6502- Lab4(Option 4): Screen Colour Selector Part A

Introduction

In this blog, I will create a subroutine which displays on the character display a list of colours available on the bitmapped display, one colour per line, with one of the colours names highlighted in reverse video (white on black). The user may use the up/down arrow keys to change the highlighted row. Return the user's selection as a number in the accumulator (A) register when they press Enter.
Using this subroutine, get a colour from the user, then fill the bitmap display with this colour, and allow the user to select a different colour.

Thoughts and Steps

-> Define values and variables.
-> Retrieve the keyboard action for UP and DOWN key.
-> Check the color value. Comparing to the first color(#$00) and the last color(#$0a).
-> Display color string on the screen.
-> Allow user to change the hightlight on the specific color.
-> Paint the bit-mapped screen using the selected colour.

Define Variables

define COLOUR  $10
define COLOUR_INDEX $11
define POINTER  $40
define POINTER_H $41
define UP_KEY  $80
define DOWN_KEY $82
define SCINIT  $ff81 ; for screen initializing and clearing
define CHROUT  $ffd2 ; for displaying the output

Enter fullscreen mode Exit fullscreen mode

Top comments (0)