Change the charset in SAM
Change the charset in SAM
I think someone asked previously about this, but can't find it. I'm not very used to the SAM, how is to change the charset from BASIC? Is somewhere needed two pokes pointing the adress in RAM or what?
- flatduckrecords
- Manic Miner
- Posts: 787
- Joined: Thu May 07, 2020 11:47 am
- Location: Oban, Scotland
- Contact:
Re: Change the charset in SAM
The font (CHR$ 32 to 168) is in RAM at 0x5190 (20880) so you can load in a new font with:
CHR$ 128-143 are displayed as block graphics unless you switch them off with:
The location of CHR$ 169-254 is set by the HUDG system variable (0x5C7D). Initially set to 0 so you get garbage ROM data if you use those chars without defining them. SAM BASIC has DPOKE so you can POKE an address in with e.g.
Code: Select all
LOAD "font" CODE 20880
Code: Select all
BLOCKS 0
Code: Select all
DPOKE &5C7D,address
Re: Change the charset in SAM
I found it could be done with the UDG function. So whereas on a Spectrum, you'd have POKE USR "a" and POKE USR "A" both altering the first line of the UDG A, on the SAM, those would change the characters a and A respectively. To change the UDG, that required POKE UDG CHR$ (whatever the code of "UDG A" was).
It's a long, tedious process, but it'd still work to change the entire character set. Then again, it's an equally long, tedious process to do it from BASIC on the Spectrum and you're better off loading in 768 bytes of code and poking CHARS to the correct value.
It's a long, tedious process, but it'd still work to change the entire character set. Then again, it's an equally long, tedious process to do it from BASIC on the Spectrum and you're better off loading in 768 bytes of code and poking CHARS to the correct value.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Re: Change the charset in SAM
Here are several important values, in my 10 years old doc...
https://sam.speccy.cz/sam-coupe_keyb-char-map.pdf
https://sam.speccy.cz/sam-coupe_keyb-char-map.pdf
Re: Change the charset in SAM
Thats rather handy.
BTW - that is a really useful site indeed.
BTW - that is a really useful site indeed.
Can also be found at SamstersVideos - which does occasionally update when I have time...