screen colors - machine language vs. pokes

Basic and Machine Language

Moderator: Moderators

Post Reply
piranger
Vic 20 Newbie
Posts: 14
Joined: Mon Feb 20, 2023 4:45 pm
Location: Cedar Park, TX

screen colors - machine language vs. pokes

Post by piranger »

I am trying to use the vicmon cartridge to write to $900F (36879) to change the screen colors.

when reading:
.M 900F
.:900F 1B 05 18 00 80

ok, that makes sense, as 0x1B =27 decimal, which p.36 of manual say is white screen with cyan border.

However, when I move my cursor over the '1B' and re-type '1B', the whole screen turns cyan (border and screen).

this is just one example. None of the colors match the table when using vicmon.

however, in BASIC, using pokes to 36879 and decimal values - no problem. it follows the manual.

what am I missing?

thanks
piranger
Vic 20 Newbie
Posts: 14
Joined: Mon Feb 20, 2023 4:45 pm
Location: Cedar Park, TX

Re: screen colors - machine language vs. pokes

Post by piranger »

I did figure out that this works:

.A 1000 LDA #$1B
.A 1002 STA $900F
.G 1000


colors track the table
User avatar
joshuadenmark
Big Mover
Posts: 1218
Joined: Sat Oct 23, 2010 11:32 am
Location: Fr-Havn, Denmark
Occupation: Service engineer

Re: screen colors - machine language vs. pokes

Post by joshuadenmark »

Hi Piranger

Welcome to our friendly forum, glad you figured it out 👍🏻
Kind regards, Peter.
____________________________________________________
In need of a wiki logon - PM me
piranger
Vic 20 Newbie
Posts: 14
Joined: Mon Feb 20, 2023 4:45 pm
Location: Cedar Park, TX

Re: screen colors - machine language vs. pokes

Post by piranger »

Thanks Joshua,

I guess there are registers the monitor just can only manipulate thru the accumulator.

Regardless, this cartridge is such a cool tool. Very intuitive to an assembly novice. I'm so
glad I jumped on it at the Classicgamefest in Austin last summer.
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: screen colors - machine language vs. pokes

Post by Mike »

Hi, piranger,
piranger wrote:[...] when I move my cursor over the '1B' and re-type '1B', the whole screen turns cyan (border and screen).
the extra bytes in the memory dump behind $900F contain invalid values that come from 'stray' read accesses to the VIA chips (address mirrors and tug-of-war between outputs are the keywords here).
I guess there are registers the monitor just can only manipulate thru the accumulator.
No worries, VICMON is perfectly capable of doing what you wanted. You just need to short the ".:" command on entry so only the byte to $900F is written.

You find more background info here: VICMON on VICE help.

Actually, I'd presume you also took the example from the techtinkering.com site. As stated by me in the other thread, it is a particularly bad example. It only works in emulation on very old VICE versions. These old versions were not accurate enough to emulate the address mirrors and tug-of-war mentioned above.

Greetings,

Michael

P.S. your machine code example needs to include a BRK instruction in $1005 to return to VICMON. It only worked by chance because the opcode value of BRK, $00, is very likely to be there. But it is not necessarily the case and then the CPU continues to execute whatever comes as code after the STA $900F instruction.

P.P.S. for more examples, there's always my primer thread for VICMON around. :)
piranger
Vic 20 Newbie
Posts: 14
Joined: Mon Feb 20, 2023 4:45 pm
Location: Cedar Park, TX

Re: screen colors - machine language vs. pokes

Post by piranger »

hi Mike,

Thanks for the insights. Actually, I am working through the 'assembly with vicmon' tutorial (mary music player) where he shows directly changing memory values. I figured to try it with the screen colors too and hit the wall. Glad I didn't do the earlier tutorial first or I would have been xtra confused. I'll now keep emulator related bugs in mind if/when I run into another tutorial anomaly.

I still don't see how to change just 900F. I tried M 900F,900F but that still displays the whole line. I also tried typing over all 5 registers on the line and still get a full cyan screen. I'm missing the trick of showing just 1 memory value.

And thanks for the 'BRK' tip. I will remember and use.

Very grateful for the knowledgeable helpful community. I'll try to keep the dumb questions to a minimum and will definitely attempt to figure it out on my own first, but sometimes I strangely reach a solution only after using 'the confessional method' and posing the question.

Looking forward to walking thru your vicmon primer and making some "coloured birds" (after the obligatory modding of the mary code to play Alex's 'limelight' intro). Its funny you say 'Christmas morning' in your tutorial, as that is often where I project myself when sitting at the keyboard of this amazing little computer. Though if I had gotten it from santa 40yrs ago, I would wish also for the vicmodem and a denialesque BBS to walk aside me in my journey.

Thanks,
Piranger
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: screen colors - machine language vs. pokes

Post by chysn »

piranger wrote: Tue Feb 21, 2023 7:11 am I still don't see how to change just 900F. I tried M 900F,900F but that still displays the whole line. I also tried typing over all 5 registers on the line and still get a full cyan screen. I'm missing the trick of showing just 1 memory value.
To change a single value, supply only a single parameter after the address:

Code: Select all

.:900F 08
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
piranger
Vic 20 Newbie
Posts: 14
Joined: Mon Feb 20, 2023 4:45 pm
Location: Cedar Park, TX

Re: screen colors - machine language vs. pokes

Post by piranger »

ahhhh...yes! that worked!

thanks,

Piranger
Post Reply