Screen POKE - Help

Basic and Machine Language

Moderator: Moderators

Post Reply
JRBasic
Vic 20 Newbie
Posts: 17
Joined: Thu Dec 20, 2018 10:31 am
Occupation: Programmer

Screen POKE - Help

Post by JRBasic »

:(
Help, POKE 7680,X works fine, a character appears on the top left of the screen, but when I try to POKE other rows of the screen, it ignores it.

(mod: changed the topic title from "Help?" to something more verbose)
Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: Screen POKE - Help

Post by Kakemoms »

With screen at 7680, color map is at 38400, so try

POKE7702,0:POKE38422,0

Should set the first character of the second line to @, then change the color from white to black.
User avatar
srowe
Vic 20 Scientist
Posts: 1340
Joined: Mon Jun 16, 2014 3:19 pm

Re: Screen POKE - Help

Post by srowe »

By default the colour map is filled with 0 (white). The background is also white so your POKE is invisible. If you move the cursor to that location it will appear.
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Screen POKE - Help

Post by Mike »

srowe wrote:0 (white).
1 (white).

The issue at hand is already mentioned in the VIC-20 User's Manual, on pages 139 and 140:
VIC-20 User's Manual wrote:[...] type in a POKE statement with the number of the screen location (7800) and the number of the symbol (83) like this:

POKE 7800, 83

A white heart should appear in the middle area of the screen. Note that it will be invisible if the screen is white. [...] For example, to get a red heart, type the following:

POKE 38520, 2 [...]
Note these POKEs are only valid for unexpanded VIC-20 or with +3K RAM expansion. With +8K or more, the KERNAL sets the screen to start at 4096 and the colour RAM to 37888.


(The funny thing is: when typed in directly on the start up message, POKE7800,83 will overwrite the "3" of the number 83, and will result in a blue heart at that position as the colour RAM there has already been changed to 6 (blue) - so you will be oblivious to the issue in that case. The other POKE then though will truly change the colour to red.

Try those two POKEs after a screen clear instead.)
User avatar
Stormcrow
Vic 20 Enthusiast
Posts: 177
Joined: Mon Dec 24, 2012 9:46 pm
Website: http://trimboli.name
Location: Ronkonkoma, NY

Re: Screen POKE - Help

Post by Stormcrow »

And if you're sure you're going to be poking characters all over the screen, you can just set the character color in every screen location to whatever you want ahead of time, and poke in characters later.

For example, you can start with

FOR I=38400 TO 38905: POKE I,0: NEXT

to prepare every space for black characters. Then just poke whatever you want and they'll all come out black. If you want different areas of the screen to have different color characters, you can set different colors to each area of the screen with a statement like that.
JRBasic
Vic 20 Newbie
Posts: 17
Joined: Thu Dec 20, 2018 10:31 am
Occupation: Programmer

Re: Screen POKE - Help

Post by JRBasic »

So, the color's just not set, Thanks!
User avatar
Stormcrow
Vic 20 Enthusiast
Posts: 177
Joined: Mon Dec 24, 2012 9:46 pm
Website: http://trimboli.name
Location: Ronkonkoma, NY

Re: Screen POKE - Help

Post by Stormcrow »

The color IS set! It just happens to be set to the same color as the screen background. :D
User avatar
GreyGhost
Vic 20 Nerd
Posts: 525
Joined: Wed Oct 05, 2005 11:10 pm

Re: Screen POKE - Help

Post by GreyGhost »

Yep, you could also do this,

10 poke36879,61:poke7788,81
Rob
20questions
Vic 20 Hobbyist
Posts: 114
Joined: Sun Mar 10, 2019 7:39 pm
Location: lodi california
Occupation: student

Re: Screen POKE - Help

Post by 20questions »

poke and peek also help a lot. for example poke 36879,peek*<36879>and13 gives a black screen whereas and2 prints reverse text
Bedroom coder=rock star
modern coder= pop star
i'd rather be a rock star than a pop start 8)
Post Reply