Skip to content

Commit 21d46d8

Browse files
WIP #xx: 68k
1 parent c458423 commit 21d46d8

File tree

12 files changed

+5650
-939
lines changed

12 files changed

+5650
-939
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,5 @@
362362
/Sample Projects/MacroTest/basic_long_variables.prg
363363
/C64StudioRelease/shared content/Sample Projects/WiC64/ReadIP/ReadIP.prg
364364
/Sample Projects/MacroTest/renumberwithinclude2.prg
365+
/Sample Projects/MacroTest/simpleassemble.prg
366+
/Sample Projects/MacroTest/sbasic.prg

C64Models/Parser/ASMFileParser.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13441,6 +13441,7 @@ private bool IsBlankChar( char Character )
1344113441
_ParseContext.DoNotAddReferences = true;
1344213442
if ( EvaluateTokens( LineIndex, extraTokens, info.LineCodeMapping, out SymbolInfo expressionResultSymbol ) )
1344313443
{
13444+
/*
1344413445
expressionResult = expressionResultSymbol.ToInteger();
1344513446
LineTokens.RemoveRange( 2, LineTokens.Count - 2 );
1344613447
if ( LineTokens[1].Length > 1 )
@@ -13451,7 +13452,7 @@ private bool IsBlankChar( char Character )
1345113452
Types.TokenInfo token = new Types.TokenInfo();
1345213453
token.Content = expressionResult.ToString();
1345313454
token.Length = token.Content.Length;
13454-
LineTokens.Add( token );
13455+
LineTokens.Add( token );*/
1345513456
}
1345613457
else
1345713458
{

C64Models/Processors/Processor.68K.cs

Lines changed: 2761 additions & 414 deletions
Large diffs are not rendered by default.

C64Studio/BASIC Dialects/S-BASIC 65.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ INSTR;D4;
117117
INT;B5;
118118
JOY;CF;
119119
KEY;F9;
120-
LEFT;C8;
120+
LEFT$;C8;
121121
LEN;C3;
122122
LET;88;
123123
LIST;9B;
@@ -131,7 +131,7 @@ MADD;DC;
131131
MAN;FE56;
132132
MEM;FE23;
133133
MERGE;E6;
134-
MID;CA;
134+
MID$;CA;
135135
MOD;CE0B;
136136
MODE;FE2F;
137137
MONITOR;FA;
@@ -175,7 +175,7 @@ RESUME;D6;
175175
RETURN;8E;
176176
RFCMTEXT;CE13;
177177
RGRAPHIC;CC;
178-
RIGHT;C9;
178+
RIGHT$;C9;
179179
RLEVEL;CE10;
180180
RMOUSE;FE3F;
181181
RND;BB;
@@ -214,7 +214,7 @@ SPRSAVE;FE29;
214214
SQR;BA;
215215
STEP;A9;
216216
STOP;90;
217-
STR;C4;
217+
STR$;C4;
218218
SUB;F0;
219219
SYNC;DD;
220220
SYS;9E;

C64Studio/C64Studio.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@
350350
<None Remove="BASIC Dialects\BASIC V4.5.txt" />
351351
<None Remove="BASIC Dialects\BASIC V7.0.txt" />
352352
<None Remove="BASIC Dialects\Laser BASIC.txt" />
353+
<None Remove="BASIC Dialects\S-BASIC 65.txt" />
353354
<None Remove="BASIC Dialects\Simons' BASIC.txt" />
354355
<None Remove="BASIC Dialects\Tuned Simons' BASIC.txt" />
355356
<None Remove="BASIC Dialects\XC=Basic.txt" />
@@ -379,6 +380,9 @@
379380
<Content Include="BASIC Dialects\Laser BASIC.txt">
380381
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
381382
</Content>
383+
<Content Include="BASIC Dialects\S-BASIC 65.txt">
384+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
385+
</Content>
382386
<Content Include="BASIC Dialects\Simons' BASIC.txt">
383387
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
384388
</Content>
Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
#C64 Studio BASIC declaration file
2+
#Comments start with #
3+
#CSV Format
4+
#Token = actual name of command
5+
#ByteValues = one or more byte values (hex)
6+
#Abbreviation = short cut of command if it exists (lower case, shifted letters are upper case)
7+
#OptionalInfo = a list of strings (comment means the rest of the line is a comment)
8+
#
9+
#StartAddress=xxxx = sets the default BASIC start address
10+
#SafeLineLength=xxxx > sets the max. number of characters before a warning appears
11+
#HasTextLabels = Can use text labels of varying length, as either simple call, or following a BASIC token (e.g. EXEC, PROC)
12+
13+
StartAddress=8193
14+
SafeLineLength=160
15+
HexPrefix=$
16+
17+
Token;ByteValues;Abbreviation[;OptionalInfo]
18+
ABS;B6;
19+
ADD;EF;
20+
AFTER;FE14;
21+
AND;AF;
22+
APPEND;FE0E;
23+
ASC;C6;
24+
ASM;FE53;
25+
ATN;C1;
26+
BACKUP;F6;
27+
BANK;FE02;
28+
BEGIN;FE18;
29+
BEND;FE19;
30+
BIN;CD;
31+
BIT;FE4E;
32+
BLOAD;FE11;
33+
BORDER;FE3C;
34+
BOX;E1;
35+
BSAVE;FE10;
36+
BUMP;CE03;
37+
BVERIFY;FE28;
38+
BYTE;CE02;
39+
CALL;FE55;
40+
CHARDEF;E0;
41+
CHDIR;FE4B;
42+
CHR;C7;
43+
CLOSE;A0;
44+
CLR;9C;
45+
CLS;E8;
46+
CMD;9D;
47+
COLLECT;F3;
48+
COLLISION;FE17;
49+
COLOR;E7;
50+
CONCAT;FE13;
51+
CONT;FE54;
52+
COPY;F4;
53+
COS;BE;
54+
CURSOR;FE41;
55+
CUT;E4;
56+
DATA;83;
57+
DCLEAR;FE15;
58+
DCLOSE;FE0F;
59+
DEC;D1;
60+
DEF;96;
61+
DEFPROC;FE52;
62+
DELETE;F7;
63+
DIM;86;
64+
DIR;EE;
65+
DISK;FE40;
66+
DMA;FE1F;
67+
DO;EB;
68+
DOPEN;FE0D;
69+
DRAW;E5;
70+
EDMA;FE21;
71+
ELSE;D5;
72+
END;80;
73+
ENDPROC;FE51;
74+
ENVELOPE;FE0A;
75+
ERASE;F2;
76+
ERR;D3;
77+
EVERY;FE1B;
78+
EXIT;ED;
79+
EXP;BD;
80+
FAST;FE26;
81+
FCM;FE45;
82+
FCSPRCOLOR;FE59;
83+
FCSPRCOPY;FE57;
84+
FCSPRDEF;FE4A;
85+
FCSPRFLIP;FE5C;
86+
FCSPRFRAME;FE4C;
87+
FCSPRITE;FE58;
88+
FCSPRLOAD;FE5B;
89+
FCSPRSAVE;FE5A;
90+
FGOSUB;FE48;
91+
FGOTO;FE47;
92+
FILL;DF;
93+
FILTER;FE03;
94+
FN;A5;
95+
FONT;FE46;
96+
FOR;81;
97+
FRE;B8;
98+
FREAD#;FE1C;
99+
FWRITE#;FE1E;
100+
GCOPY;FE32;
101+
GET;A1;
102+
GETSCR;FE2C;
103+
GOSUB;8D;
104+
GOTO;89;
105+
GRAPHIC;DE;
106+
HEADER;F1;
107+
HELP;EA;
108+
HEX;D2;
109+
HIGHLIGHT;FE3D;
110+
HOME;FE0C;
111+
IF;8B;
112+
INFO;FE4D;
113+
INK;FE39;
114+
INPUT;85;
115+
INPUT#;84;
116+
INSTR;D4;
117+
INT;B5;
118+
JOY;CF;
119+
KEY;F9;
120+
LEFT$;C8;
121+
LEN;C3;
122+
LET;88;
123+
LIST;9B;
124+
LOAD;93;
125+
LOADIFF;FE43;
126+
LOCAL;FE50;
127+
LOG;BC;
128+
LOG10;CE08;
129+
LOOP;EC;
130+
MADD;DC;
131+
MAN;FE56;
132+
MEM;FE23;
133+
MERGE;E6;
134+
MID$;CA;
135+
MOD;CE0B;
136+
MODE;FE2F;
137+
MONITOR;FA;
138+
MOUNT;FE49;
139+
MOUSE;FE3E;
140+
MOVSPR;FE06;
141+
MSUB;FE37;
142+
NEW;A2;
143+
NEXT;82;
144+
NOT;A8;
145+
OFF;FE24;
146+
ON;91;
147+
OPEN;9F;
148+
OR;B0;
149+
PALETTE;FE34;
150+
PAPER;FE3B;
151+
PASTE;E3;
152+
PAUSE;FE0B;
153+
PEEK;C2;
154+
PEN;FE33;
155+
PETSCR;CE14;
156+
PIXEL;CE0C;
157+
PLAY;FE04;
158+
POINTER;CE0A;
159+
POKE;97;
160+
POS;B9;
161+
PRINT;99;
162+
PRINT#;98;
163+
PROC;FE4F;
164+
PUTSCR;FE2B;
165+
RCOLOR;CE04;
166+
RCURSOR;FE42;
167+
READ;87;
168+
RECORD;FE12;
169+
REM;8F;
170+
RENAME;F5;
171+
RENUMBER;F8;
172+
RESET;E2;
173+
RESTORE;8C;
174+
RESUME;D6;
175+
RETURN;8E;
176+
RFCMTEXT;CE13;
177+
RGRAPHIC;CC;
178+
RIGHT$;C9;
179+
RLEVEL;CE10;
180+
RMOUSE;FE3F;
181+
RND;BB;
182+
RPALETTE;CE0D;
183+
RPEN;D0;
184+
RPLAY;CE0F;
185+
RPROC;CE11;
186+
RREG;FE09;
187+
RSPCOLOR;CE07;
188+
RSPEED;CE0E;
189+
RSPPOS;CE05;
190+
RSPRITE;CE06;
191+
RTEXT;CE12;
192+
RUN;8A;
193+
RWINDOW;CE09;
194+
SAVE;94;
195+
SAVEIFF;FE44;
196+
SCREEN;FE2E;
197+
SCRPET;CE15;
198+
SET;FE2D;
199+
SGN;B4;
200+
SHL;FE30;
201+
SHR;FE35;
202+
SIN;BF;
203+
SLOW;FE5E;
204+
SOUND;DA;
205+
SPC(;A6;
206+
SPRCOLOR;FE08;
207+
SPRCOPY;FE16;
208+
SPRDEF;FE1D;
209+
SPRFLIP;FE36;
210+
SPRFRAME;FE25;
211+
SPRITE;FE07;
212+
SPRLOAD;FE2A;
213+
SPRSAVE;FE29;
214+
SQR;BA;
215+
STEP;A9;
216+
STOP;90;
217+
STR$;C4;
218+
SUB;F0;
219+
SYNC;DD;
220+
SYS;9E;
221+
TAB(;A3;
222+
TAN;C0;
223+
TEMPO;FE05;
224+
TEXT;FE38;
225+
THEN;A7;
226+
TO;A4;
227+
TRAP;D7;
228+
TROFF;D9;
229+
TRON;D8;
230+
TYPE;FE27;
231+
UNTIL;FC;
232+
USING;FB;
233+
VAL;C5;
234+
VERIFY;95;
235+
VIC4;FE5D;
236+
VIEWPORT;FE31;
237+
VOL;DB;
238+
WAIT;92;
239+
WHILE;FD;
240+
WINDOW;FE1A;
241+
XOR;E9;
242+
243+
-;AB;
244+
..;9A;
245+
*;AC;
246+
/;AD;
247+
^;AE;
248+
+;AA;
249+
<;B3;
250+
=;B2;
251+
>;B1;
252+
253+
#from here on it's extended opcodes, required for C64Studio extensions
254+
ExOpcodes
255+
256+
#C64 Studio extension
257+
LABEL;F0;
258+

Common/Common/Path.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public static string Normalize( string Path, bool IsDir )
108108

109109
public static string Normalize( string Path, bool IsDir, string Separators )
110110
{
111+
if ( string.IsNullOrEmpty( Path ) )
112+
{
113+
return Path;
114+
}
115+
111116
string result = "";
112117

113118
int pos = Path.Length - 1;
@@ -451,6 +456,15 @@ public static bool IsPathEqual( string Path1, string Path2 )
451456

452457
public static bool IsPathEqual( string Path1, string Path2, string Separators )
453458
{
459+
if ( ( string.IsNullOrEmpty( Path1 ) )
460+
|| ( string.IsNullOrEmpty( Path2 ) ) )
461+
{
462+
if ( Path1 == Path2 )
463+
{
464+
return true;
465+
}
466+
return false;
467+
}
454468
string commonPrefix = RemoveBackslash( CommonPrefix( Path1, Path2, Separators ) );
455469
if ( ( commonPrefix.Length == RemoveBackslash( Normalize( Path1, false ) ).Length )
456470
&& ( commonPrefix.Length == RemoveBackslash( Normalize( Path2, false ) ).Length ) )

0 commit comments

Comments
 (0)