Page 1 of 1

Change char set, how does that work from 0-255 please?

Posted: Fri Mar 08, 2024 4:01 pm
by funkheld
Hi good afternoon.

I changed the char 0 - 3 :
@ a b c

But is it a coincidence?

These addresses, how do they work please:
cx16.vaddr_autoincr(1, VERA_CHARSET, 0, 1)
b=255
b=129
.....
.....

Code: Select all

       txt.color(3) 	 
       txt.plot(1,1)
       txt.print("@ a b c ")

const uword VERA_CHARSET = $f000 

sub makechar() {
        ubyte b
		
        cx16.vaddr_autoincr(1, VERA_CHARSET, 0, 1)        
                        b=255
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b		
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=255
			cx16.VERA_DATA0 = b   

			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b		
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b     

			b=255
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b		
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b           	

			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b		
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=129
			cx16.VERA_DATA0 = b			
			b=255
			cx16.VERA_DATA0 = b        
      
    }
thanks
greeting

Re: Change char set, how does that work from 0-255 please?

Posted: Fri Mar 08, 2024 4:53 pm
by TomXP411
Back in the day, Commodore packed the display bitmap for the character set in a different order than the ASCII/PETSCII order. So there's some translation needed when outputting text to the screen.

Here's a reference tool to help with that:

https://www.pagetable.com/?p=1404

Re: Change char set, how does that work from 0-255 please?

Posted: Fri Mar 08, 2024 6:21 pm
by funkheld
Thanks for the help.

I am now looking for this address structure in the x16.
I cannot recognize the structure of this address as it is up to
address 255 is constructed. 8 bytes are always added and then it continues... but how?

cx16.vaddr_autoincr(1, VERA_CHARSET, 0, 1)
How are these last two numbers evaluated for the structure?

thanks

greeting