btw, is there a tool on the PC to convert this to something that can be directly pasted into VICE ?Mike wrote: ↑Sat Jun 06, 2020 3:28 am This one gets the middle red stripe right:Code: Select all
1 PRINT"{BLU,3 C=-POUND,RED,4 C=-I,C=-F}" 2 FORT=1TO3:PRINT"{BLU,3 C=-+,RED,4 C=-I,C=-F}":NEXT 3 FORT=1TO3:PRINT"{RED,7 C=-I,C=-F,BLU}":NEXT
Though it may become valid on this zoom step, should the US ever grow to 336 States.chysn wrote:This is a bit stylized and simplistic, but so are we.
...
Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
Moderator: Moderators
Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
- chysn
- Vic 20 Scientist
- Posts: 1205
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
I use shell scripts that combine petcat and c1541 to generate a .d64 file that has whatever I need for a particular test. Then I can just drag that .d64 file onto the emulator. For example:
Code: Select all
## Build BASIC test suite
petcat -w2 -o vic/6502test.prg -- tests/6502test.bas
c1541 vic/wax.d64 -write vic/6502test.prg
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5
WIP: MIDIcast BASIC extension
he/him/his
WIP: MIDIcast BASIC extension
he/him/his
- Mike
- Herr VC
- Posts: 4887
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
Mike wrote:Code: Select all
1 PRINT"{BLU,3 C=-POUND,RED,4 C=-I,C=-F}" 2 FORT=1TO3:PRINT"{BLU,3 C=-+,RED,4 C=-I,C=-F}":NEXT 3 FORT=1TO3:PRINT"{RED,7 C=-I,C=-F,BLU}":NEXT
Fun fact: you're seeing the output of a self-written converter specifically aimed to produce quoted PETSCII, as a means of documentation or as a means to (re-)type it in.beamrider wrote:btw, is there a tool on the PC to convert this to something that can be directly pasted into VICE?
I just didn't bother to include a download link in this case, as I don't think it's too much of a burden to type in 3 lines of BASIC code.
Re: Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
CBM PrgStudio friendly version:-
Code: Select all
1 PRINT"{BLUE}{CM POUND*3}{RED}{CM I*4}{CM F}"
2 FORT=1TO3:PRINT"{BLUE}{CM +*3}{RED}{CM I*4}{CM F}":NEXT
3 FORT=1TO3:PRINT"{RED}{CM I*7}{CM F}{BLUE}":NEXT
Re: Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
cool thanks
Not that I'm too lazy to type in 3 lines of code, just wanted to understand whether there was some standard way of encoding these. It would appear not.
Not that I'm too lazy to type in 3 lines of code, just wanted to understand whether there was some standard way of encoding these. It would appear not.
- Mike
- Herr VC
- Posts: 4887
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
For what matters, here's the source of the program I use to produce quoted PETSCII:beamrider wrote:[...] just wanted to understand whether there was some standard way of encoding these. It would appear not.
Code: Select all
/*
* petscii.c - conversion from PETSCII to ASCII
*
* creation date: 2004-12-26 Michael Kircher
* date of change: 2005-01-31 Michael Kircher
* - 0x9B corrected to {CTRL-SHIFT-+}
* date of change: 2007-07-28 Michael Kircher
* - {ARROW UP} not anymore quoted, now rendered as '^'
* - rendering of {ARROW LEFT} replaced by {<-}
* date of last change: 2014-05-25 Michael Kircher
* - glyph of ISO 8859-1 0xA3 not in 7-bit ASCII, replaced by {POUND}
* - command line parser does extended checks on parameters
* - byte explicitly typed as unsigned char to prevent out of bounds
* accesses into the array petscii[] on machines that have char
* signed by default.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define CR 13
#define BUFFER_LEN 256
char *petscii[256]=
{
"~CTRL-@","~CTRL-A","~CTRL-B","~STOP","~CTRL-D","~WHT","~CTRL-F","~CTRL-G",
"~CTRL-H","~CTRL-I","~CTRL-J","~CTRL-K","~CTRL-L","~RETURN","~CTRL-N","~CTRL-O",
"~CTRL-P","~DOWN","~RVS ON","~HOME","~DEL","~CTRL-U","~CTRL-V","~CTRL-W",
"~CTRL-X","~CTRL-Y","~CTRL-Z","~CTRL-[","~RED","~RIGHT","~GRN","~BLU",
"~SPACE","!","\"","#","$","%","&","\'","(",")","*","+",",","-",".","/",
"0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
"@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
"P","Q","R","S","T","U","V","W","X","Y","Z","[","~POUND","]","^","~<-",
"~SHIFT-*","~SHIFT-A","~SHIFT-B","~SHIFT-C","~SHIFT-D","~SHIFT-E","~SHIFT-F","~SHIFT-G",
"~SHIFT-H","~SHIFT-I","~SHIFT-J","~SHIFT-K","~SHIFT-L","~SHIFT-M","~SHIFT-N","~SHIFT-O",
"~SHIFT-P","~SHIFT-Q","~SHIFT-R","~SHIFT-S","~SHIFT-T","~SHIFT-U","~SHIFT-V","~SHIFT-W",
"~SHIFT-X","~SHIFT-Y","~SHIFT-Z","~SHIFT-+","~C=--","~SHIFT--","~PI","~C=-*",
"~CTRL-SHIFT-@","~CTRL-SHIFT-A","~CTRL-SHIFT-B","~RUN","~CTRL-SHIFT-D","~F1","~F3","~F5",
"~F7","~F2","~F4","~F6","~F8","~SHIFT-RETURN","~CTRL-SHIFT-N","~CTRL-SHIFT-O",
"~BLK","~UP","~RVS OFF","~CLR","~INST","~CTRL-SHIFT-U","~CTRL-SHIFT-V","~CTRL-SHIFT-W",
"~CTRL-SHIFT-X","~CTRL-SHIFT-Y","~CTRL-SHIFT-Z","~CTRL-SHIFT-+","~PUR","~LEFT","~YEL","~CYN",
"~SHIFT-SPACE","~C=-K","~C=-I","~C=-T","~C=-@","~C=-G","~C=-+","~C=-M",
"~C=-POUND","~SHIFT-POUND","~C=-N","~C=-Q","~C=-D","~C=-Z","~C=-S","~C=-P",
"~C=-A","~C=-E","~C=-R","~C=-W","~C=-H","~C=-J","~C=-L","~C=-Y",
"~C=-U","~C=-O","~SHIFT-@","~C=-F","~C=-C","~C=-X","~C=-V","~C=-B",
"~SHIFT-*","~SHIFT-A","~SHIFT-B","~SHIFT-C","~SHIFT-D","~SHIFT-E","~SHIFT-F","~SHIFT-G",
"~SHIFT-H","~SHIFT-I","~SHIFT-J","~SHIFT-K","~SHIFT-L","~SHIFT-M","~SHIFT-N","~SHIFT-O",
"~SHIFT-P","~SHIFT-Q","~SHIFT-R","~SHIFT-S","~SHIFT-T","~SHIFT-U","~SHIFT-V","~SHIFT-W",
"~SHIFT-X","~SHIFT-Y","~SHIFT-Z","~SHIFT-+","~C=--","~SHIFT--","~PI","~C=-*",
"~SHIFT-SPACE","~C=-K","~C=-I","~C=-T","~C=-@","~C=-G","~C=-+","~C=-M",
"~C=-POUND","~SHIFT-POUND","~C=-N","~C=-Q","~C=-D","~C=-Z","~C=-S","~C=-P",
"~C=-A","~C=-E","~C=-R","~C=-W","~C=-H","~C=-J","~C=-L","~C=-Y",
"~C=-U","~C=-O","~SHIFT-@","~C=-F","~C=-C","~C=-X","~C=-V","~PI"
};
typedef enum {false,true} boolean;
void getline(char *dest, int n, FILE *stream)
{
int c;
int i;
for(i=0;i<n-1;i++)
{
c=getc(stream);
if(CR == c || EOF == c) break;
dest[i]=(char)c;
}
/* When n-1 non CR, non EOF characters have been read, check */
/* the next character. If it _is_ a CR or EOF, just drop it. */
if(i == n-1)
{
c=getc(stream);
if(CR != c && EOF != c) ungetc(c,stream);
}
/* Terminate. */
dest[i]='\0';
}
int main(int argc, char *argv[])
{
char line[BUFFER_LEN];
FILE *in_file,*out_file;
if(3 != argc)
{
fprintf(stderr,"%s: Syntax: %s <in_file> <out_file>\n",argv[0],argv[0]);
exit(EXIT_FAILURE);
}
if(NULL == (in_file=fopen(argv[1],"rb")))
{
fprintf(stderr,"%s: Error: couldn't open file '%s' for read access.\n",argv[0],argv[1]);
exit(EXIT_FAILURE);
}
if(NULL == (out_file=fopen(argv[2],"wb")))
{
fprintf(stderr,"%s: Error: couldn't open file '%s' for write access.\n",argv[0],argv[2]);
exit(EXIT_FAILURE);
}
while(!feof(in_file))
{
int len,pos,count;
unsigned char byte;
boolean quoted,do_quote,last_was_quoted;
getline(line,BUFFER_LEN,in_file);
len=(int)strlen(line);
pos=0;
last_was_quoted=false;
for(pos=0; pos<len; pos+=count)
{
byte=line[pos];
quoted='~'==petscii[byte][0];
for(count=1; quoted && pos+count<len && (char)byte==line[pos+count]; count++) {}
do_quote=quoted && !(' '==byte && 1==count);
if(!do_quote)
{
if(last_was_quoted) fputc('}',out_file);
if(' '==byte)
fputc(' ',out_file);
else
fputc(petscii[byte][0],out_file);
}
else
{
if(last_was_quoted) fputc(',',out_file); else fputc('{',out_file);
if(count>1)
fprintf(out_file,"%d %s",count,petscii[byte]+1);
else
fprintf(out_file,"%s",petscii[byte]+1);
}
last_was_quoted=do_quote;
}
if(last_was_quoted) fputc('}',out_file);
fprintf(out_file,"\n");
}
fclose(in_file);
fclose(out_file);
exit(EXIT_SUCCESS);
}
Michael
Re: Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
There never was a "standard" for this... pretty much every magazine made up their own, slightly different, version petcat supports two or three different variants iirc.
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
- chysn
- Vic 20 Scientist
- Posts: 1205
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
Yeah, the documentation for petcat mentions three-letter abbreviations like {blk} and {cyn}, but when I put in {black} and {cyan}, everything works just fine. So far, all of my wild guesses have worked
The worst ones were just regular print-outs with reversed graphics, like the ones at the end of the VIC-20 manual. Even with a key, it was hard to figure out exactly which reversed horizontal or vertical line you were looking at.
Last edited by chysn on Wed Jul 01, 2020 5:21 am, edited 1 time in total.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5
WIP: MIDIcast BASIC extension
he/him/his
WIP: MIDIcast BASIC extension
he/him/his
Re: Standards for quoted PETSCII? (split/OT from: Union Jack / lock-down challenge, [...])
I'm afraid that this may be out of topic and I don't know if anyone have done it already on vicy.
Animated petscii's. I think it's a nice way to don't bother about redefined charset, memory wastings. "Do your thing".
Of course made on some sort of X converter.
See this for example. (How can I know you saw this already? )
https://youtu.be/33kN2ns2xb0
Animated petscii's. I think it's a nice way to don't bother about redefined charset, memory wastings. "Do your thing".
Of course made on some sort of X converter.
See this for example. (How can I know you saw this already? )
https://youtu.be/33kN2ns2xb0
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
-._/classes instead of masses\_.-