redefine the charset

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
Aturnwald
Vic 20 Amateur
Posts: 47
Joined: Sat Feb 13, 2016 2:11 am
Location: Germany / Bavaria
Occupation: painter & decorator

redefine the charset

Post by Aturnwald »

Hello to all,

just a small question, is it possible to redefine on a VIC the charset witch you can get via the SHIFT or COMMODORE key, I mean all chars excepted the alphabet ? And if yes, Can it be done also by 16 / 32 KB ?

cheers Toni
.....42, what else ???
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: redefine the charset

Post by eslapion »

A game like "Sword of Fargoal" does exactlyt like that.

In order to do that, the character set has to be mapped in RAM somewhere between $1000-$1FFF and the BASIC program space moved up accordingly.

Even if if it's technically impossible for the new character set to me mapped in the memory expansion area, having 8k or more of RAM expansion actually makes the job easier because new characters occupy space and reduces your BASIC RAM space accordingly.

Also, the complete original character set occupies 4K in ROM. Since the screen codes occupy 506 bytes it will not be possible for you to have a full set of replacement characters, except perhaps if you have an internal 3k RAM expansion that can be accessed by the 656X VIC chip.
Be normal.
User avatar
Aturnwald
Vic 20 Amateur
Posts: 47
Joined: Sat Feb 13, 2016 2:11 am
Location: Germany / Bavaria
Occupation: painter & decorator

Re: redefine the charset

Post by Aturnwald »

OK, I see, because I'd know that game, so I was thinking I can do nearly the same. But it should be possible, to define some characters and fix it up into the memory, and after a while I change that into other stuff, without lost of the main-program or without lost of for the game points, live ect.
.....42, what else ???
4matdemoscene
Vic 20 Newbie
Posts: 8
Joined: Sat May 16, 2015 4:14 pm
Website: http://www.atebit.org/
Location: UK
Occupation: Coder/Musician

Re: redefine the charset

Post by 4matdemoscene »

On unexpanded machines I usually do the reverse, with my redefined chars at the front of the charset and the rom font at the back:

POKE 36869,255 to set the gfx ram looking at 7168 onwards. (With the screen still at 7680 as usual, giving me 64 redefinable chars and both are right at the end of memory)
To get the rom font add 128 to any char number. Obviously this way you only get 128 of the rom characters but the standard alphabet, numbers and punctuation are only contained in the first 64.

Changing the 36869 high-nybble you can put the screen lower in memory to give you 128 definable chars if you need it. I don't use expansions so have no idea if memory wraps weirdly past that first 4kb block or it works the same way.
User avatar
Aturnwald
Vic 20 Amateur
Posts: 47
Joined: Sat Feb 13, 2016 2:11 am
Location: Germany / Bavaria
Occupation: painter & decorator

Re: redefine the charset

Post by Aturnwald »

OK, I understand, so if I use a 24KB I enter POKE56,21:CLR at the program start and that's all, the Basic is moved and save and I can define the keys and characters, also I can load during the game something into the memory and it should be all good.

By the way. When the master program is running is that possible to load some pictures with .SQL into the computer, or the game-pics can I do this on that way ? Or must I do it different, because I saw a game in GV a labyrinth one and you can play from level 1 to 88 or 99, you enter the number and the game would be loaded.

bye bye Toni
.....42, what else ???
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: redefine the charset

Post by Mike »

Aturnwald wrote:OK, I understand, so if I use a 24KB I enter POKE56,21:CLR at the program start and that's all, the Basic is moved and save and I can define the keys and characters, also I can load during the game something into the memory and it should be all good.
At the power up screen (with a +8K RAM expansion, or more), enter:

Code: Select all

POKE56,21:CLR
Then enter:

Code: Select all

PRINTFRE(0)
Now, take a look at the remaining bytes free for BASIC and then reconsider your quoted statement above.

(Hint: link)
User avatar
Aturnwald
Vic 20 Amateur
Posts: 47
Joined: Sat Feb 13, 2016 2:11 am
Location: Germany / Bavaria
Occupation: painter & decorator

Re: redefine the charset

Post by Aturnwald »

thnks a lot, now I know
cheers Toni
.....42, what else ???
Post Reply