Re: How do I redefine characters with 8k or more RAM?
Posted: Fri Jan 26, 2024 7:40 pm
Very nice -- glad to see you saw this through to creation.
The Commodore Vic 20 Forum
http://www.sleepingelephant.com/ipw-web/bulletin/bb/
http://www.sleepingelephant.com/ipw-web/bulletin/bb/viewtopic.php?t=10826
Code: Select all
POKE36869,255
Code: Select all
36869,205
Code: Select all
POKE5120
Code: Select all
FORX=0TO(D*8)-1:READA:POKE5120+X,A:NEXTX
Code: Select all
POKE44,22:POKE5632,0:NEW
Code: Select all
POKE36869,205
FORX=0TO511:POKE5120+X,PEEK(32768+X):NEXT X
FORX=0TO511:READA:POKE5120+X,A:NEXTX
Certainly true. I'm currently working with 64 redefined characters. I used these to make the basic layout for the game and some test art. You can see the full set in the pub picture.I would like to add that not only the letters A..Z can be redefined, you can build an entire new character set from up to 256 characters. There is also no restriction that the symbols shall somehow relate to the original glyphs - their shape is only relevant while you are working in text mode. Some games - when they use redefined letters - even only feature those letters in the character set that are actually used in the display, and these letters do not even need to reside at their 'original' position.
Code: Select all
2 POKE36869,205:POKE646,10:POKE36879,168:POKE36878,225
3 FOR X=0 TO 2047: POKE5120+X,PEEK(32768+X): NEXT X
4 FOR X=0 TO 2047: READ A: POKE5128+X,A: NEXT X
Code: Select all
POKE44,22:POKE7168,0:NEW
Code: Select all
POKE44,22:POKE7168,0:NEW
In Line 4 it should read POKE 5120+X,A not 5128. If you keep it that way you will overwrite your own program again, as you will POKE to 7175 in the end, which is where your BASIC-program is residing in memory.Duke wrote: ↑Sat Mar 09, 2024 11:19 amCode: Select all
2 POKE36869,205:POKE646,10:POKE36879,168:POKE36878,225 3 FOR X=0 TO 2047: POKE5120+X,PEEK(32768+X): NEXT X 4 FOR X=0 TO 2047: READ A: POKE5128+X,A: NEXT X
Right on the money. I didn't understand that there was math involved in creating that number. I thought 44,22 was a catch-all for redefining the starting address of basic. Now I know that I will need to calculate it further if I'm using different numbers of redefined characters.If you want to redefine 256 characters starting from 5120, you will need to protect 2048 bytes from BASIC access from 5120 onwards (= up to memory location 7167). As such you need to use POKE 44,28 (not 22) since 28*256 = 7168
Totally right. I thought I had corrected that in the program I posted. My apologies for being sloppy.In Line 4 it should read POKE 5120+X,A not 5128. If you keep it that way you will overwrite your own program again, as you will POKE to 7175 in the end, which is where your BASIC-program is residing in memory.
When you did not ask about that detail, it was foreseeable to me that you would run into this issue: next logical step after redefining part of a character set would be redefining the entire character set.Duke wrote:I didn't understand that there was math involved in creating that number.
Quite right. I already had that thought when I was redefining 64 characters, but I wasn't ready to make anything quite so big at the time. I also figured I had enough knowledge to just experiment my way through it, which was true up to a point. Once I hit that mental block, I had to reach out again. It's incredible how accurate and quick the responses are. This is an incredible place. I'm truly building off the backs of giants.When you did not ask about that detail, it was foreseeable to me that you would run into this issue: next logical step after redefining part of a character set would be redefining the entire character set.