Getting started with redefining characters

Basic and Machine Language

Moderator: Moderators

Post Reply
The Geek on Skates
Vic 20 Drifter
Posts: 33
Joined: Fri Jul 12, 2019 6:11 am
Website: http://www.geekonskates.com
Occupation: Code Monkey

Getting started with redefining characters

Post by The Geek on Skates »

Good morning, Great to see the old forum up and running again! :)

I have a question that I've been wondering about for some time now, and haven't found in the volumes of e-books I have on the Vic-20 (yet). How exactly does redefining a single character work? I found a few random posts on the web about doing it on the C64 (which is awesome but probably unrelated lol), but the only thing I could find on the VIC was about redefining all 256 characters using a RAM expander.

This was what the 8-bit Guy did in his Vic-20 video, but after running the code, it doesn't seem to work:

Code: Select all

poke 6264,126
poke 6265,129
poke 6266,165
poke 6267,129
poke 6268,153
poke 6269,129
poke 6270,126
Is a RAM expander is required for this too (and if so, is there a way to emulate one in VICE)? It doesn't seem like it should be necessary, since we're just setting 8 bytes (one for each row of pixels in the character), but since I've never seen the original hardware in action I could be way out in left field on that. :D
User avatar
tokra
Vic 20 Scientist
Posts: 1123
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: Getting started with redefining characters

Post by tokra »

I suggest having a look a "Programming the VIC" at the DLH-Bombjack-archive:

http://69.60.118.202/vic-20/books-vic.htm

Basically you need to point the VIC to your new character-defintions in RAM. Then it will read the definitions from there.

For starters without RAM-expansion you could try this:

POKE 7168,126
POKE 7169,129
and so on until 8 bytes are filled and then:

POKE 36869,255

Then try to type the @-character and you should see the new content.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Getting started with redefining characters

Post by funkheld »

Hi good afternoon.
I am an old German, 70 years old.
Here I have something, where you can change 255 characters, starting at 5120 bytes memory. have the VICE set to 8kb at the VIC20.
Here, the "A" is changed, which begins at 5128 bytes.

You can not set the memory area as you like.

greeting

Code: Select all

10 for i=0 to 2047
20 poke 5120+i,peek(32768+i)
30 next i
40 poke 36869,192+13
50 for j=0 to 7
60 read a
70 poke 5128+j,a
80 next j
1000 data 255,129,129,129,129,129,129,255
Attachments
charset.jpg
20questions
Vic 20 Hobbyist
Posts: 114
Joined: Sun Mar 10, 2019 7:39 pm
Location: lodi california
Occupation: student

Re: Getting started with redefining characters

Post by 20questions »

why does the Vic 20 take so long to redefine the set?
Bedroom coder=rock star
modern coder= pop star
i'd rather be a rock star than a pop start 8)
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: Getting started with redefining characters

Post by chysn »

20questions wrote: Sun Dec 29, 2019 2:56 pm why does the Vic 20 take so long to redefine the set?
The thing taking a long time is the copying of character data from ROM to the new location in RAM using BASIC. A worthwhile learning exercise would be to omit this loop and see what happens. (That is, start typing at line 40 right after turning the VIC on.)

Another instructive experiment would be to enter the whole program but add /4 to the end of line 20.
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
Post Reply