Page 3 of 3

Re: W65C816SXB Expansion, Keyboard, VGA and Sound.

Posted: Sun Feb 21, 2016 1:51 am
by Alamorobotics
Jac,

I modified the code to use 8x8 chars in stead and use a Commodore 64 Font...
This was a lot easier than adding color per characters.
If you still have your code and know where it is, I'm interested to see your font so see if it is different from the C64 Font.

Looks like the Commodore 64 does not follow the ASCII code so I need to re-arrange the characters...
I'll post some pictures once I have re-arranged the font.

Re: W65C816SXB Expansion, Keyboard, VGA and Sound.

Posted: Sun Feb 21, 2016 3:19 am
by Alamorobotics
The Commodore 64 font came out great, I now have a 100x75 screen area to play with.
The Font set I had didn't have the lower case characters but I can live with that.
I also had to move the Characters from position 0 to position 64 so I can use ordinary strings...

Re: W65C816SXB Expansion, Keyboard, VGA and Sound.

Posted: Sun Feb 21, 2016 4:41 am
by jac_goudsmit
Alamorobotics wrote:
That is looking great, do you happen to have the vga_hires_text with the PETSCII font ?
See attached :)

It needs some work but it will produce a PETSCII (ish) VGA picture. My aim was to produce something that looked like a PET (monochrome) so I don't think I made any changes to the color code but this is getting pretty old so I don't remember. It looks like I added "(JG)" everywhere I made changes, but I can't be sure. I recommend doing a diff with the standard vga_hires_text.spin to find out exactly what I changed.

Have fun!

===Jac

Re: W65C816SXB Expansion, Keyboard, VGA and Sound.

Posted: Sun Feb 21, 2016 5:37 am
by jac_goudsmit
Alamorobotics wrote:
Looks like the Commodore 64 does not follow the ASCII code so I need to re-arrange the characters...
That's correct, the PET character set is really weird. One reason is that it's based on an earlier ASCII standard than we all know now. So some characters are in a different place in the character set. But also, the characters are in a different order in the character ROM; When you tell the kernal to print a character (or use CHR$ in BASIC), it changes the value to make up for this. So CHR$(65) pokes a 1 into the screen location at the cursor to show an "A".

There are two character sets in each PET: the graphics character set which has upper case characters and graphics, and the lower case set which has upper case, lower case and fewer graphics. Interestingly, when you switch between the two character sets, earlier ROMs will show upper case glyphs for the same character codes (so PRINT remains PRINT) but newer ROMs have the lower case glyphs in the lower case set where the upper case glyphs are in the graphics set (so PRINT becomes print).

I didn't make any attempt to fix the problem that the characters are all in the wrong places because I was planning on making a PET replica which would make up for that by itself. For testing (i.e. when I wanted to print a text on the screen from the Propeller code), I modified the character printing routine to change the character values the same way as the PET does.

Both of the character sets (graphics and lower case) are in my PETSCII modified vga-hires-text driver but one of them is commented out. The plan was to eventually put both character sets into the module, and make it possible to switch character sets at runtime (just like on the real PET) by modifying the pointer that points to the font table. I never finished that, though.

===Jac