CHARACTER GENERATOR
Refering back to the `key` character to display it on the screen, first put the `key` data
in the computer by entering the `Monitor` type .M 3200 3208 then press `Return` you will see a row of 8 two character value numbers. Starting with the left 1st value number
type over each one with the `key` value numbers starting with the top one (`0F`).
After entering all the 8 (`key`) value numbers please remember to press `Return` after the 8th value number.
You must have in your program the `Character Generator` routine below to get all your design characters to be displayed.
The `Character Generator` generates characters starting at address `3200` which displays the code number `40` the next code number(`41`) at address `3208` the next code number (`42`) at address ` 3210` and so on.
Please note again a `character` takes up 8 addresses.
Clear the screen then type in the `Character Generator` routine and the `Key` program below.
Character Generator:-
.A 40B0 LDA $D018
.A 40B3 AND#$F0
.A 40B5 STA$D018
.A 40B8 LDA$D018
.A 40BB ORA#$0C
.A 40BD STA$D018
.A 40C0 LDA$DC0E
.A 40C3 AND#$FE
.A 40C5 STA$DC0E
.A 40C8 LDA$01
.A 40CA AND#$FB
.A 40CC STA$01
.A 40CE LDX#$00
.A 40D0 LDA$D000,X
.A 40D3 STA$3000,X
.A 40D6 LDA$D100,X
.A 40D9 STA$3100,X
.A 40DC INX
.A 40DD BNE$40D0
.A 40DF LDA$01
.A 40E1 ORA#$04
.A 40E3 STA$01
.A 40E5 LDA$DC0E
.A 40E8 ORA#$01
.A 40EA STA$DC0E
.A 40ED RTS
Key program:-
Clear the screen and type:-
.A 4000 JSR$40B0 [call to address 40B0 (character generator)]
.A 4003 JMP$4020 [ jump to address 4020 (program main loop)]
Clear the screen and type:-
.A 4020 JSR$E544 [call rom routine to clear the screen]
.A 4023 LDA#$40 [ load `A` with code value number `40`(`key character`]
.A 4025 STA$0400 [store value of `A` into address 0400 (top left of screen)]
.A 4028 JMP$4023 [jump to address 4023 to keep program running]
Please do not enter in the `Monitor` after the commands the `brackets [ ]`and the `information`.The information is there only for reference.
Clear the screen type .X and press `Return` to return to `basic`.Type SYS16384 to run the `key` program, you will see a `key` at the top left hand corner of the screen.
Press `Stop/Restore` to return to `basic`.
Should you want to display your own design `characters` in your future programs, you must put in your program the `Character Generator` routine and call the routine at the start of your program also enter the `data` for all of your `characters` at the approx. addresses and part of your program that prints the characters on screen.