Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Commodore » Commodore 8-bit » PETSCII/Screen Code map?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
PETSCII/Screen Code map? [message #262513] Sun, 27 July 2014 14:46 Go to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
Where on the internet can I find them?
Re: PETSCII/Screen Code map? [message #262543 is a reply to message #262513] Sun, 27 July 2014 17:38 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Harry,

On 2014-07-27 18:46:24 +0000, Harry Potter said:
> Where on the internet can I find them?

you can poke the values 0-255 to the first 256 screen locations (don't
forget color RAM) and see what characters appear, then make a printout
of your Vice screen and mark each line start (0, 40, 80, 120,...).
That's the easiest way, if you really want it that way, that is... :-)
--
cul8er

Paul
paul.foerster@gmx.net
Re: PETSCII/Screen Code map? [message #262544 is a reply to message #262543] Sun, 27 July 2014 17:48 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Sunday, July 27, 2014 5:38:48 PM UTC-4, Paul Förster wrote:
> you can poke the values 0-255 to the first 256 screen locations (don't
> forget color RAM) and see what characters appear, then make a printout
> of your Vice screen and mark each line start (0, 40, 80, 120,...).
> That's the easiest way, if you really want it that way, that is... :-)
>
Well, for PETSCII, I used x64 and wrote PRINT ASC("<whatever>") and looked at the number that's printed. However, I'd rather have a table. Note that your approach gives only the screen codes, not the PETSCII codes. Thank you for trying.
Re: PETSCII/Screen Code map? [message #262545 is a reply to message #262513] Sun, 27 July 2014 18:43 Go to previous messageGo to next message
Payton Byrd is currently offline  Payton Byrd
Messages: 1198
Registered: December 2011
Karma: 0
Senior Member
On Sunday, July 27, 2014 1:46:24 PM UTC-5, Harry Potter wrote:
> Where on the internet can I find them?

http://www.paytonbyrd.com/BlogEngine.Web/post/2014/05/13/Com modore-Screen-Codes-in-ca65.aspx
Re: PETSCII/Screen Code map? [message #262577 is a reply to message #262513] Sun, 27 July 2014 23:42 Go to previous messageGo to next message
Larry Anderson is currently offline  Larry Anderson
Messages: 469
Registered: July 2012
Karma: 0
Senior Member
On Sunday, July 27, 2014 11:46:24 AM UTC-7, Harry Potter wrote:
> Where on the internet can I find them?

http://portcommodore.com/dokuwiki/doku.php?id=larry:comp:com modore:start

Theres the multichart which gives you the various values for the symbols (PETASCII, screen code, etc) and also some screen design grids to help you plan... screens. :-)
Re: PETSCII/Screen Code map? [message #267205 is a reply to message #262513] Fri, 12 September 2014 13:38 Go to previous messageGo to next message
The Doctor is currently offline  The Doctor
Messages: 71
Registered: July 2003
Karma: 0
Member
May I assume that you want a petscii to screen code converter for
programming purposes?

On Sun, 27 Jul 2014 11:46:24 -0700 (PDT), Harry Potter
<rose.joseph12@yahoo.com> wrote:

> Where on the internet can I find them?
Re: PETSCII/Screen Code map? [message #267217 is a reply to message #267205] Fri, 12 September 2014 16:37 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Friday, September 12, 2014 1:38:31 PM UTC-4, The Doctor wrote:
> May I assume that you want a petscii to screen code converter for
> programming purposes?
>
I'd like that, but I need to find the petscii and screen values for given symbols.
Re: PETSCII/Screen Code map? [message #267274 is a reply to message #262513] Sat, 13 September 2014 13:47 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Joe,

On 2014-07-27 18:46:24 +0000, Harry Potter said:
> Where on the internet can I find them?

This prints either a PETSCII or screen code table, depending on the
bool petscii. It runs on a C64. If you want to run it on some other
machine, make sure to adjust the screen address (scn) and screen color
address (scncol). On monochrome Commodores (PET/CBM), remove the
command POKE(scncol+offset, ccol);.

You can use the table printed to either determine the character for a
given code or vice versa.

Hope this helps.

#include <conio.h>
#include <stdio.h>
#include <peekpoke.h>
#include <stdbool.h>

int main(void) {

// Set petscii to either true or false, resulting in either
// PETSCII or screen code characters are being displayed.
const bool petscii = false;

const unsigned int scn = 0x0400; // Start of screen RAM.
const unsigned int scncol = 0xd400; // Start of color RAM.
char ccol = PEEK(0x286); // Get cursor color.

char x, y, c;

// Clear screen and print heading.
clrscr();
if (petscii) {
printf("\npetscii code table\n\n ");
} else
printf("\nscreen code table\n\n ");

// Table low nybble numbering.
for (x = 0; x < 16; ++x)
printf("%2x", x);
printf("\n\n");

// Output table, either PETSCII or screen codes.
for (y = 0; y < 16; ++y) {
printf(" %02x ", y<<4);
for (x = 0; x < 16; ++x) {
c = (y<<4)+x;
if (petscii) {
// cc65 doesn't like character 0, so manual provisions
// must be made. Also prepare for cr, shift-cr and del.
// Everything else prints properly, if quoted.
if (c == 0)
printf("\022@\222 ");
else if (c != 13 && c != 141 && c != 20)
printf("\"\b%c\"\b ", c);
else
printf(" ");
} else {
// Poke character code to screen and also set the
// corresponding color in screen color RAM.
unsigned int offset = 206+(x<<1)+y*40;
POKE(scn+offset, c);
POKE(scncol+offset, ccol);
}
}
printf("\n");
}

return 0;

}
--
cul8er

Paul
paul.foerster@gmx.net
Re: PETSCII/Screen Code map? [message #267283 is a reply to message #267274] Sat, 13 September 2014 15:42 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
Thank you. If I remember, I'll get back to it later.
Re: PETSCII/Screen Code map? [message #267402 is a reply to message #267217] Mon, 15 September 2014 13:22 Go to previous messageGo to next message
The Doctor is currently offline  The Doctor
Messages: 71
Registered: July 2003
Karma: 0
Member
When I did my C64 programming, almost entirely in asm, I would use a
table driven screen print routine. Much faster than the rom routine.

I still have all my old disks. No idea if they work anymore. They
have not been touched in over 20 years. If I get a change I'll take a
look.


On Fri, 12 Sep 2014 13:37:16 -0700 (PDT), Harry Potter
<rose.joseph12@yahoo.com> wrote:

> On Friday, September 12, 2014 1:38:31 PM UTC-4, The Doctor wrote:
>> May I assume that you want a petscii to screen code converter for
>> programming purposes?
>>
> I'd like that, but I need to find the petscii and screen values for given symbols.
Re: PETSCII/Screen Code map? [message #267417 is a reply to message #267402] Mon, 15 September 2014 14:50 Go to previous message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Doc,

On 2014-09-15 17:22:07 +0000, The Doctor said:
> When I did my C64 programming, almost entirely in asm, I would use a
> table driven screen print routine. Much faster than the rom routine.
>
> I still have all my old disks. No idea if they work anymore. They
> have not been touched in over 20 years. If I get a change I'll take a
> look.

I think Joe is not after performance. He wanted a way to translate
characters into codes or vice versa. Since he's an avid cc65 user, I
did that program quickly which either prints a PETSCII or screen code
table. It was not meant to be fast or comfortable in any way. I'm sure
it can be done *much* faster and way better. :-P But I'm sure it will
help Joe at whatever he's doing.
--
cul8er

Paul
paul.foerster@gmx.net
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Lode Runner creator
Next Topic: Particles! BBS Update
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Apr 24 00:02:35 EDT 2024

Total time taken to generate the page: 0.09127 seconds