Scott Adams adventures screen colors

Discussion, Reviews & High-scores

Moderator: Moderators

Post Reply
User avatar
buzbard
Vic 20 Devotee
Posts: 213
Joined: Sun Jul 03, 2005 9:10 am

Scott Adams adventures screen colors

Post by buzbard »

After playing some Scott Adams adventures I was wishing for a way to change the screen colors from the standard White/Cyan.

So, I whipped up a simple IRQ routine that lives @ $1388/5000 to do just that.

Plug in your Scott Adams cartridge (or attach a ROM in VICE) then:

LOAD"SA-COLORS.PRG",8,1
SYS5000
SYS32592

Then press F1/F3 to cycle through the border colors and press F3/F5 to cycle through the background colors.

Unfortunately I can't do anything about the text colors, they are set in the ROM.
Last edited by buzbard on Sun Jun 12, 2016 10:48 am, edited 1 time in total.
Ray..
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Re: Scott Adams adventures screen colors

Post by ral-clan »

This sound useful. I know on a real VIC-20 with 1701 monitor I have trouble reading the light green text against the white background.
Image Music I've made with 1980s electronics, synths and other retro-instruments: http://theovoids.bandcamp.com
User avatar
Muzz73
Vic 20 Hobbyist
Posts: 141
Joined: Thu May 03, 2012 12:12 pm
Location: Farmersville, CA,
Occupation: Consultant

Re: Scott Adams adventures screen colors

Post by Muzz73 »

Very cool! Going to have to try this soon!

Thanks for posting this!
BCNU,
Louis
User avatar
buzbard
Vic 20 Devotee
Posts: 213
Joined: Sun Jul 03, 2005 9:10 am

Re: Scott Adams adventures screen colors

Post by buzbard »

ral-clan wrote:This sound useful. I know on a real VIC-20 with 1701 monitor I have trouble reading the light green text against the white background.
That's exactly why I made this. I thought it would be easier than editing the ROM, and this way it can easily be used on real hardware, and the colors can be changed at any time in the game. :)
Muzz73 wrote:Very cool! Going to have to try this soon!

Thanks for posting this!
You're very welcome.
Ray..
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: Scott Adams adventures screen colors

Post by eslapion »

buzbard wrote:Plug in your Scott Adams cartridge (or attach a ROM in VICE) then:

LOAD"SA-COLORS.PRG",8,1
SYS5000
SYS32592

Then press F1/F3 to cycle through the border colors and press F3/F5 to cycle through the background colors.

Unfortunately I can't do anything about the text colors, they are set in the ROM.
Or plug in your Behr-Bonz cartridge and choose your favorite Scott Adams game...
Last edited by eslapion on Mon Jun 13, 2016 5:59 pm, edited 1 time in total.
Be normal.
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Scott Adams adventures screen colors

Post by orion70 »

Thank you for the color add-on buzbard! Too bad it won't change text color, as a white on blue combo would have been the most readable one. Also, as a side note, I don't like multiple colors for text, except maybe for the Infocom status bar. Scott Adams games in their YOHO 40-column adaptation are a great alternative of course :) .
User avatar
buzbard
Vic 20 Devotee
Posts: 213
Joined: Sun Jul 03, 2005 9:10 am

Re: Scott Adams adventures screen colors

Post by buzbard »

Sorry guys, I had a major brain-fart, this program can't exist in the cassette buffer! I don't know what I was thinking.

All Scott Adams games save to tape, can you say "major crash!"? :oops:

So, I moved it to address 5000/$1388, which shouldn't get slaughtered by any of the games.

Edited the first post.

Sorry again for any inconvenience.
Ray..
User avatar
mrr19121970
Vic 20 Nerd
Posts: 873
Joined: Tue Jan 19, 2016 9:22 am
Location: Germany
Occupation: IT service manager

Re: Scott Adams adventures screen colors

Post by mrr19121970 »

Why can't the text colour be changed ?

Surely once drawn to screen then you are free to read and write to colour memory ? Monochrome is fine??
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: Scott Adams adventures screen colors

Post by eslapion »

mrr19121970 wrote:Why can't the text colour be changed ?

Surely once drawn to screen then you are free to read and write to colour memory ? Monochrome is fine??
You can probably add a routine to buzbard's program that will fill the color RAM with a text color of your choosing. However, as you play the game, the game software changes the color of the new text sent to screen.

You would have to press a key to reactivate the screen color fill again and again as you play.

Unless you patiently sift through the Scott Adams games code to remove or replace the text color codes.
Last edited by eslapion on Wed Jun 22, 2016 12:59 pm, edited 1 time in total.
Be normal.
User avatar
buzbard
Vic 20 Devotee
Posts: 213
Joined: Sun Jul 03, 2005 9:10 am

Re: Scott Adams adventures screen colors

Post by buzbard »

eslapion wrote:You can probably add a routine to buzbard's program that will fill the color RAM with a text color of your choosing.
Good idea! Here ya go: sa-colors2.prg
In this new version:

SYS5000
F1 = Cycle border color
F3 = Cycle background color
F5 = Cycle text color

Using the IRQ to fill color RAM every time really slows the system down. But then it occurred to me that I could just use the CHROUT vector and reset the foreground color every time a character is printed to the screen. Which works a lot better.
Ray..
User avatar
mrr19121970
Vic 20 Nerd
Posts: 873
Joined: Tue Jan 19, 2016 9:22 am
Location: Germany
Occupation: IT service manager

Re: Scott Adams adventures screen colors

Post by mrr19121970 »

Excellent.
User avatar
buzbard
Vic 20 Devotee
Posts: 213
Joined: Sun Jul 03, 2005 9:10 am

Re: Scott Adams adventures screen colors

Post by buzbard »

I've cleaned up the source code and added comments.
Here's the DASM source in case someone wants to improve/modify it:

Code: Select all

;VIC20 wedge for changing screen/border colors while playing
;      Scott Adams adventure games.
;
; SYS5000 before starting game (SYS32592)
;  Press: F1 to cycle border color (+)
;  Press: F3 to cycle background color (+)
;  Press: F5 to cycle foreground colors (+)
;
               processor 6502

temp           equ $00 ; used to remix new background and border colors
last_key       equ $01 ; last key pressed to avoid key repeating
bg_color       equ $02 ; background color
bd_color       equ $03 ; border color
fg_color       equ $04 ; foreground color

key_F1         equ $27 ; keyboard matrix F1 key
key_F3         equ $2f ; keyboard matrix F3 key
key_F5         equ $37 ; keyboard matrix F5 key

SFDX           equ $CB  ;Matrix Coordinate of Current Key Pressed

COLOR          equ $286  ;Foreground Text (default lt.blue)
GDCOL          equ $287  ;Cursor: original color at this screen location
VICCRF         equ $900f ;Screen background/inverse/border colors
                           ;(BBBBxxxx) Background color
                           ;(xxxxIxxx) Inverse color bit (0=swap bg/fg colors)
                           ;(xxxxxBBB) Border color
LINSTART       equ $ea7e ;Set start of line .X ($D1/D2)
COLORAM        equ $eab2 ;Calculate pointer to line color RAM ($F3/F4)

CINV           equ $314  ;Vector to IRQ Interrupt Routine ($EA31)
IBSOUT         equ $326  ;Vector to KERNAL CHROUT Routine ($F1CA) ($F27A)
USRCMD         equ $32E  ;Vector to User-Defined Command ($FE66)
USRCMDS        equ $334  ;8 Free bytes for User Vectors or Other Data

               org $1388      ;SYS5000

start          lda CINV       ; Copy system IRQ vector to unused vector
               cmp #<wedge    ; If the system IRQ has already been
               beq quit       ;   changed then don't do it again.
               sta USRCMD
               lda CINV+1
               sta USRCMD+1

               lda COLOR      ; Get the current foreground color
               sta fg_color   ;   and store it in a safe place

               lda VICCRF     ; Get the current screen colors
               tay            ;   and save a copy
               and #%11110000 ; Extract the background color
               lsr            ; divide it by 16
               lsr
               lsr
               lsr
               sta bg_color   ; save the background color in a safe place
               tya
               and #%00000111 ; Extract the current border color
               sta bd_color   ; save the border color in a safe place

               sei
               lda #<wedge    ; Reroute the system IRQ
               sta CINV       ;   routine to our new wedge
               lda #>wedge    ;   routine below.
               sta CINV+1
               cli

               lda IBSOUT     ; Copy the system CHROUT vector
               sta USRCMDS    ;   to an unused vector in page 3
               lda IBSOUT+1
               sta USRCMDS+1

               lda #<fwedge   ; Rerout the system CHROUT
               sta IBSOUT     ;   routine to our new fwedge
               lda #>fwedge   ;   routine below
               sta IBSOUT+1

quit           rts

wedge          lda SFDX       ; Get the current keypress
               cmp last_key   ;   if it's the same as last time
               beq resume     ;   ignore it so we don't repeat.

               sta last_key   ; Save the keypress so we don't repeat
               cmp #key_F1    ; Border +
               beq bdr_inc
               cmp #key_F3    ; Background +
               beq bkg_inc
               cmp #key_F5    ; foreground +
               beq frg_inc

resume         jmp (USRCMD)   ; Return to system IRQ routines

bdr_inc        inc bd_color   ; F1
               byte $0c       ; NOOP (Absolute - 3 cyles)
bkg_inc        inc bg_color   ; F3

setcolors      lda bg_color   ; Get the new background color and
               and #$0f       ;   make sure it's 0 to 15
               sta bg_color
               asl            ; Multiply by 16
               asl
               asl
               asl
               sta temp       ; Temp save the new background color

               lda bd_color   ; Get the new border color and
               and #$07       ;   make sure it's 0 to 7
               sta bd_color
               ora temp       ; Add the new background color
               ora #$08       ; Turn off inverse text color
               sta VICCRF     ; Display our new screen colors
               bvc resume

frg_inc        inc fg_color   ; Increase new foreground color
               lda fg_color   ; Get new foreground color
               and #$07       ; make sure it's 0 to 7
               sta fg_color

               lda $d6        ; Get the current screen line pointer
               pha            ;   and save it
               ldx #$16
n_row          jsr LINSTART   ; Set the screen line pointer
               jsr COLORAM    ; Calculate pointer to current screen line color RAM
               lda fg_color
               ldy #$15
n_column       sta ($f3),y    ; Fill the line with our new color
               dey
               bpl n_column
               dex
               bpl n_row      ; next line
               sta COLOR      ; Set new foreground color
               sta GDCOL      ; Set new forgeround color at cursor position
               pla
               tax
               jsr LINSTART   ; Restore the current screen line pointer
               bvc resume

fwedge         pha            ; Save whatever is in .A
               lda fg_color   ; load our desired foreground color
               sta GDCOL      ; over-ride print color from game
               sta COLOR
               pla            ; restore .A
               jmp (USRCMDS)  ; continue with CHROUT routine
Ray..
Post Reply