Login
Back to forumSee the full topicGo to last reply

Posted By

Csabo
on 2009-01-11
10:55:18
 Re: Defining a custom charset from BASIC

The round of applause goes to gerliczer, he sent me a working proof of concept of his idea, which works perfectly! I simply changed the line breaks slightly, so the whole routine fits on one Plus/4 screen (and therefore can be copy/pasted wink)

10 REM SAVING ZERO PAGE VARIABLES      
11 C0=PEEK(192):C1=PEEK(193)
12 C8=PEEK(200):C9=PEEK(201)
13 A9=PEEK(169):AA=PEEK(170)
14 EA=PEEK(234):EB=PEEK(235)
15 REM SAVING ADDITIONAL VARIABLE
16 T=PEEK(2024)
17 REM SETTING UP ZERO PAGE ADDRESSES
18 REM $C0-$C1 SRC1 $C8-$C9 DEST1
19 REM $A9-$AA SRC2 $EA-$EB DEST2
20 POKE192,0 : POKE193,13*16
21 POKE200,0 : POKE201,3*16+8
22 POKE169,128 : POKE170,13*16
23 POKE234,128 : POKE235,3*16+8
24 REM SETTING UP ADDITIONAL VARIABLE
25 POKE2024,128
26 REM COPYING 256 BYTES FROM CHAR-GEN
27 SYSDEC("DA4F")
28 REM RESTORING ALL SAVED VALUES
29 POKE192,C0 : POKE193,C1
30 POKE200,C8 : POKE201,C9
31 POKE169,A9 : POKE170,AA
32 POKE234,EA : POKE235,EB
33 POKE2024,T

This copies 256 bytes from $D000 to $3800 very quickly. The routine (which I'm curious as to how he found it) copies two vectors, normally that would be character and color memory. I guess that means in one cycle we could copy two 256 byte pages. To copy the entire charset would need a simple loop. Other room for optimization would be to check if we can get away with not saving some of the zeropage variables, but this method is the holy grail happy



Back to top


Copyright © Plus/4 World Team, 2001-2024