Changing 8k character set

Basic and Machine Language

Moderator: Moderators

Post Reply
edinky
Vic 20 Newbie
Posts: 18
Joined: Sat Apr 07, 2018 10:34 am

Changing 8k character set

Post by edinky »

Hi everyone,

Been trying to change the character set on 8k expansion, but keep getting repeating @'s or other repeating symbols. I've got this to work on unexpanded and 3k. I know that basic program ram is in different location, so trying to accommodate for this.

Here, I've tried to move the SOB and other BASIC pointers down memory 4 pages so I can copy the character ROM into the new location at 5120, then moving the start of character set to 5120 using poke 36869,253.

I've also tried inputting the pokes at line 10 below in first, before entering the BASIC program, again that didn't work.

Any ideas anyone? maybe there is a loader involved, but I cant see why even when I copy the values to 5120, it still doesnt seem to work? driving me nuts!

Code: Select all

10 poke (44),24: poke (46),24: poke (48),24:poke (50),24
20 clr
30 se=5120
40 fori=0 to 511:poke(i+se),peek(i+32768):next 
50 poke 36869,253 
*update*

I found that if i poked 205 instead of the documented 253, i can shift to 5120 - but now I'm getting a syntax error before its finished loading all the new characters into the location. I'm guessing this is because I cant change the basic pointer within this program?

Code: Select all

30 se=5120
60 for i=0 to 1024: read a: ?i:poke(se+i),a:next
70 poke 36869,205 
1000 DATA 28,34,74,86,76,32,30,0
1010 DATA 16,40,68,130,254,130,130,0
1020 DATA 252,130,130,252,130,130,252,0
1030 DATA 124,130,128,128,128,130,124,0
1040 DATA 248,132,130,130,130,132,248,0
1050 DATA 254,128,128,252,128,128,254,0
1060 DATA 254,128,128,252,128,128,128,0
1070 DATA 124,130,128,128,134,130,124,0
1080 DATA 130,130,130,254,130,130,130,0
1090 DATA 16,16,16,16,16,16,16,0
1100 DATA 14,2,2,2,2,130,124,0
1110 DATA 130,132,136,240,136,132,130,0
1120 DATA 128,128,128,128,128,128,254,0
1130 DATA 198,170,146,130,130,130,130,0
1140 DATA 130,194,162,146,138,134,130,0
1150 DATA 124,130,130,130,130,130,124,0
1160 DATA 252,130,130,252,128,128,128,0
1170 DATA 124,130,130,130,130,134,126,0
1180 DATA 252,130,130,252,130,130,130,0
1190 DATA 124,130,128,124,2,130,124,0
1200 DATA 254,16,16,16,16,16,16,0
1210 DATA 130,130,130,130,130,130,124,0
1220 DATA 130,130,130,130,68,40,16,0
1230 DATA 130,130,130,146,170,198,130,0
1240 DATA 130,68,40,16,40,68,130,0
1250 DATA 130,68,40,16,16,16,16,0
1260 DATA 254,2,4,56,64,128,254,0
1270 DATA 60,32,32,32,32,32,60,0
1280 DATA 12,16,16,60,16,112,110,0
1290 DATA 60,4,4,4,4,4,60,0
1300 DATA 0,8,28,42,8,8,8,8
1310 DATA 0,0,16,32,127,32,16,0
1320 DATA 0,0,0,0,0,0,0,0
1330 DATA 8,8,8,8,0,0,8,0
1340 DATA 36,36,36,0,0,0,0,0
1350 DATA 36,36,126,36,126,36,36,0
1360 DATA 8,30,40,28,10,60,8,0
1370 DATA 0,98,100,8,16,38,70,0
1380 DATA 48,72,72,48,74,68,58,0
1390 DATA 4,8,16,0,0,0,0,0
1400 DATA 4,8,16,16,16,8,4,0
1410 DATA 32,16,8,8,8,16,32,0
1420 DATA 8,42,28,62,28,42,8,0
1430 DATA 0,8,8,62,8,8,0,0
1440 DATA 0,0,0,0,0,8,8,16
1450 DATA 0,0,0,126,0,0,0,0
1460 DATA 0,0,0,0,0,24,24,0
1470 DATA 0,2,4,8,16,32,64,0
1480 DATA 60,66,70,90,98,66,60,0
1490 DATA 8,24,40,8,8,8,62,0
1500 DATA 60,66,2,12,48,64,126,0
1510 DATA 60,66,2,28,2,66,60,0
1520 DATA 4,12,20,36,126,4,4,0
1530 DATA 126,64,120,4,2,68,56,0
1540 DATA 28,32,64,124,66,66,60,0
1550 DATA 126,66,4,8,16,16,16,0
1560 DATA 60,66,66,60,66,66,60,0
1570 DATA 60,66,66,62,2,4,56,0
1580 DATA 0,0,8,0,0,8,0,0
1590 DATA 0,0,8,0,0,8,8,16
1600 DATA 14,24,48,96,48,24,14,0
1610 DATA 0,0,126,0,126,0,0,0
1620 DATA 112,24,12,6,12,24,112,0
1630 DATA 60,66,2,12,16,0,16,0
1640 DATA 0,0,0,0,255,0,0,0
1650 DATA 8,28,62,127,127,28,62,0
1660 DATA 16,16,16,16,16,16,16,16
1670 DATA 0,0,0,255,0,0,0,0
1680 DATA 0,0,255,0,0,0,0,0
1690 DATA 0,255,0,0,0,0,0,0
1700 DATA 0,0,0,0,0,255,0,0
1710 DATA 32,32,32,32,32,32,32,32
1720 DATA 4,4,4,4,4,4,4,4
1730 DATA 0,0,0,0,224,16,8,8
1740 DATA 8,8,8,4,3,0,0,0
1750 DATA 8,8,8,16,224,0,0,0
1760 DATA 128,128,128,128,128,128,128,255
1770 DATA 128,64,32,16,8,4,2,1
1780 DATA 1,2,4,8,16,32,64,128
1790 DATA 255,128,128,128,128,128,128,128
1800 DATA 255,1,1,1,1,1,1,1
1810 DATA 0,60,126,126,126,126,60,0
1820 DATA 0,0,0,0,0,0,255,0
1830 DATA 54,127,127,127,62,28,8,0
1840 DATA 64,64,64,64,64,64,64,64
1850 DATA 0,0,0,0,3,4,8,8
1860 DATA 129,66,36,24,24,36,66,129
1870 DATA 0,60,66,66,66,66,60,0
1880 DATA 8,28,42,119,42,8,8,0
1890 DATA 2,2,2,2,2,2,2,2
1900 DATA 8,28,62,127,62,28,8,0
1910 DATA 8,8,8,8,255,8,8,8
1920 DATA 160,80,160,80,160,80,160,80
1930 DATA 8,8,8,8,8,8,8,8
1940 DATA 0,0,1,62,84,20,20,0
1950 DATA 255,127,63,31,15,7,3,1
1960 DATA 0,0,0,0,0,0,0,0
1970 DATA 240,240,240,240,240,240,240,240
1980 DATA 0,0,0,0,255,255,255,255
1990 DATA 255,0,0,0,0,0,0,0
2000 DATA 0,0,0,0,0,0,0,255
2010 DATA 128,128,128,128,128,128,128,128
2020 DATA 170,85,170,85,170,85,170,85
2030 DATA 1,1,1,1,1,1,1,1
2040 DATA 0,0,0,0,170,85,170,85
2050 DATA 255,254,252,248,240,224,192,128
2060 DATA 3,3,3,3,3,3,3,3
2070 DATA 8,8,8,8,15,8,8,8
2080 DATA 0,0,0,0,15,15,15,15
2090 DATA 8,8,8,8,15,0,0,0
2100 DATA 0,0,0,0,248,8,8,8
2110 DATA 0,0,0,0,0,0,255,255
2120 DATA 0,0,0,0,15,8,8,8
2130 DATA 8,8,8,8,255,0,0,0
2140 DATA 0,0,0,0,255,8,8,8
2150 DATA 8,8,8,8,248,8,8,8
2160 DATA 192,192,192,192,192,192,192,192
2170 DATA 224,224,224,224,224,224,224,224
2180 DATA 7,7,7,7,7,7,7,7
2190 DATA 255,255,0,0,0,0,0,0
2200 DATA 255,255,255,0,0,0,0,0
2210 DATA 0,0,0,0,0,255,255,255
2220 DATA 1,1,1,1,1,1,1,255
2230 DATA 0,0,0,0,240,240,240,240
2240 DATA 170,85,170,125,195,129,0,255
2250 DATA 0,0,0,0,195,239,223,191
2260 DATA 0,0,0,0,224,248,254,255
2270 DATA 0,0,0,0,3,31,127,255
User avatar
Mike
Herr VC
Posts: 4849
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Changing 8k character set

Post by Mike »

First of all, you don't need to fiddle around with ZP addresses 46, 48, 50 (don't know where you got these from) - the only relevant addresses for start of BASIC are 43/44 (low/high).

Second - if you change 43/44 within a running program that action will not somehow copy up the program, will not adjust pointers and will not continue execution of the BASIC program at that higher address. The only two sensible things you can do after a change of 43/44 are RUN or NEW. If you instead continue execution, the interpreter will get into trouble as soon as any search process within the BASIC program is involved. Needless to say, with the program still in its old place, there's no room to load a new character set into there.

NEW will of course end and delete the current program. If you have prepared some printed statements and have filled the keyboard buffer, you can still chain to the next program, which then will be loaded to the new BASIC start.

RUN continues execution from the new BASIC start with what has already been placed in memory with what you loaded first. I posted an example of this not too long ago: Load Charset Direct to Correct Memory Location.

You find more detailed info in the thread "How to reinit 16k expansion?".
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Changing 8k character set

Post by funkheld »

why waste space with data.
make a charset.prg (bin) and invite the first one and there
your game program.

greeting

1 if a=0 then a=1 : load "charset.prg",8,1
2 if a=1 then a=2 : load "meinprogramm.prg",8
Post Reply