Hi Just a quick Question...
In Assembly I can set the character color like...---> lda #153 then jsr $FFD2
so... in text mode like screen 0 how do I set the background color ?
As jsr $FF29 does nothing for me in screen 0 ...
just so I can change the background color lol... ? even though it might be a simple answer for someone....
(I'm trying not to use basic~)
Quick Question (I Think) Background color in ASM
- ahenry3068
- Posts: 1145
- Joined: Tue Apr 04, 2023 9:57 pm
Re: Quick Question (I Think) Background color in ASM
On the C64 & C128 this was not possible as there was not a "per character" background color. On the x16 a new control code now exists CHR$(1). This Swaps Foreground for Background. So to set background. LDA (desBGcolorcode), jsr $FFD2, LDA #1 jsr $FFD2, LDA, DesiredForeGroundCode jsr $FFD2schristis wrote: ↑Sat Nov 30, 2024 11:20 am Hi Just a quick Question...
In Assembly I can set the character color like...---> lda #153 then jsr $FFD2
so... in text mode like screen 0 how do I set the background color ?
As jsr $FF29 does nothing for me in screen 0 ...
just so I can change the background color lol... ? even though it might be a simple answer for someone....
(I'm trying not to use basic~)
A little extra work but you get there.
Re: Quick Question (I Think) Background color in ASM
Ummm.. The entire background color sorry, not just the background of the text....
on the C64 it was actually a memory location to change the border and background... With the X16 we have the VERA... soooo...What register in the Vera (If any) to change the entire background ?
or is the trick to fill the screen with chr($1) ? in reverse ???..
this was easy on the C64... if that was a location? What would be the assembly equivalent of ' COLOR 1,0 '
on the C64 it was actually a memory location to change the border and background... With the X16 we have the VERA... soooo...What register in the Vera (If any) to change the entire background ?
or is the trick to fill the screen with chr($1) ? in reverse ???..
this was easy on the C64... if that was a location? What would be the assembly equivalent of ' COLOR 1,0 '
- ahenry3068
- Posts: 1145
- Joined: Tue Apr 04, 2023 9:57 pm
Re: Quick Question (I Think) Background color in ASM
Exactly what I said. If you do a CLS the current background color is used. But background color in the video memory is on a "per character basis). There is a COLOR.BYTE that is used for the printed attribute but there currently isn't a documented API for it other than the CHROUT color codes. To Clear do what you wantschristis wrote: ↑Sat Nov 30, 2024 1:17 pm Ummm.. The entire background color sorry, not just the background of the text....
on the C64 it was actually a memory location to change the border and background... With the X16 we have the VERA... soooo...What register in the Vera (If any) to change the entire background ?
or is the trick to fill the screen with chr($1) ? in reverse ???..
this was easy on the C64... if that was a location?
c64.JPG
What would be the assembly equivalent of ' COLOR 1,0 '
lda colorcodeforblack
jsr CHROUT
lda #1
jsr CHROUT
lda colorcodeforWhite
jsr CHROUT
; to clrscrn
lda HOMECODE
jsr CHROUT
Re: Quick Question (I Think) Background color in ASM
You were right !
; This will change the color of the BACKGROUND
lda #$1 ;SWAP COLORS
jsr $FFD2
lda #147 ;CLEAR SCREEN
jsr $FFD2
rts
Just tried this code and worked ... really simple...
Thankyou again and sorry to be a bother~
Best regards
Shaun
; This will change the color of the BACKGROUND
lda #$1 ;SWAP COLORS
jsr $FFD2
lda #147 ;CLEAR SCREEN
jsr $FFD2
rts
Just tried this code and worked ... really simple...
Thankyou again and sorry to be a bother~
Best regards
Shaun
- ahenry3068
- Posts: 1145
- Joined: Tue Apr 04, 2023 9:57 pm
Re: Quick Question (I Think) Background color in ASM
No problem. I probably confused the issue by bring VRAM memory layout into the picture. There actually is a seperate color code in VRAM for each character. But Clear screen does fill the entire VRAM with the current background & foreground color code.