This commit is contained in:
Denis Molony 2016-03-05 13:25:15 +11:00
parent 932fc03d14
commit e6f03bcb07
4 changed files with 106 additions and 66 deletions

View File

@ -61,7 +61,7 @@ public interface AssemblerConstants
"(Zero page, X)", "(Zero page), Y", "(Zero page)", "Relative" }; "(Zero page, X)", "(Zero page), Y", "(Zero page)", "Relative" };
byte[] chip65c02 = byte[] chip65c02 =
{ 0x04, 0x0C, 0x12, 0x14, 0x1A, 0x1C, 0x32, 0x34, 0x3A, 0x3C, 0x52, 0x5A, 0x64, 0x72, { 0x04, 0x0C, 0x12, 0x14, 0x1A, 0x1C, 0x32, 0x34, 0x3A, 0x3C, 0x52, 0x5A, 0x64,
0x74, 0x7A, 0x7C, (byte) 0x80, (byte) 0x89, (byte) 0x92, (byte) 0x9C, 0x72, 0x74, 0x7A, 0x7C, (byte) 0x80, (byte) 0x89, (byte) 0x92, (byte) 0x9C,
(byte) 0x9E, (byte) 0xB2, (byte) 0xD2, (byte) 0xDA, (byte) 0xF2, (byte) 0xFA, }; (byte) 0x9E, (byte) 0xB2, (byte) 0xD2, (byte) 0xDA, (byte) 0xF2, (byte) 0xFA, };
} }

View File

@ -116,27 +116,40 @@ F48A RIGHT EQU
F4D5 UP EQU F4D5 UP EQU
F504 DOWN EQU F504 DOWN EQU
F6B9 HFNS F6B9 HFNS
F800 PLOT
F819 HLINE
F828 VLINE
F864 SETCOL
F871 SCRN
F940 PRINTYX F940 PRINTYX
F941 PRINTAX - print a hex number F941 PRINTAX - print a hex number
FAA6 reboot DOS FAA6 reboot DOS
FAFF 0 = Autostart ROM, 1 = Old Monitor FAFF 0 = Autostart ROM, 1 = Old Monitor
FB1E PREAD - read game paddle FB1E PREAD - read game paddle
FB2F initialise text screen FB2F initialise text screen
FB39 text mode - SETTXT FB39 text mode - SETTXT
FB40 SETGR
FB5B TABV - monitor tab routine FB5B TABV - monitor tab routine
FC66 CURSDWN - move cursor down
FBF4 CURSRIT - move cursor right
FC10 CURSLFT - move cursor left
FC1A CURSUP - move cursor up
FB6F set powerup checksum FB6F set powerup checksum
FBC1 BASCALC - calculate video address FBC1 BASCALC - calculate video address
FBDD BEEP FBDD BEEP
FBF4 CURSRIT - move cursor right
FC10 CURSLFT - move cursor left
FC1A CURSUP - move cursor up
FC22 VTAB FC22 VTAB
FC42 CLREOP - clear to end of page FC42 CLREOP - clear to end of page
FC58 HOME - clear screen FC58 HOME - clear screen
FC62 CR FC62 CR
FC66 CURSDWN - move cursor down
FC9C CLREOL FC9C CLREOL
FCA8 WAIT 1/2(26+27A+5A^2) microseconds FCA8 WAIT 1/2(26+27A+5A^2) microseconds
FCFA RD2BIT
FD0C RDKEY - Blink cursor FD0C RDKEY - Blink cursor
FD1B KEYIN - Increment RNDL,H while polling keyboard FD1B KEYIN - Increment RNDL,H while polling keyboard
FD35 RDCHAR - Call RDKEY FD35 RDCHAR - Call RDKEY
@ -147,9 +160,16 @@ FDDA PRBYTE - print A in hex
FDED COUT - output a character FDED COUT - output a character
FDF0 COUT1 - output a character to screen FDF0 COUT1 - output a character to screen
FD8E CROUT - generate a return FD8E CROUT - generate a return
FE2C move a block of memory FE2C move a block of memory
FE89 disconnect DOS from I/O links FE89 disconnect DOS from I/O links
FE8B INPORT
FE93 disconnect DOS from I/O links FE93 disconnect DOS from I/O links
FE95 OUTPORT
FECD WRITE
FEFD READ
FF02 READ2
FF3A BELL FF3A BELL
FF3F SAVE FF3F SAVE
FF4A RESTORE FF4A RESTORE

View File

@ -34,6 +34,13 @@ class VisicalcCell implements Comparable<VisicalcCell>
case '/': case '/':
if (command.charAt (1) == 'F') // format cell if (command.charAt (1) == 'F') // format cell
{ {
// /FG - general
// /FD - default
// /FI - integer
// /F$ - dollars and cents
// /FL - left justified
// /FR - right justified
// /F* - graph
format = command.charAt (2); format = command.charAt (2);
if (command.length () > 3 && command.charAt (3) == '"') if (command.length () > 3 && command.charAt (3) == '"')
label = command.substring (4); label = command.substring (4);
@ -73,6 +80,9 @@ class VisicalcCell implements Comparable<VisicalcCell>
double result = 0.0; double result = 0.0;
double interim = 0.0; double interim = 0.0;
if (formula.startsWith ("@LOOKUP("))
return result;
Matcher m = cellContents.matcher (formula); Matcher m = cellContents.matcher (formula);
while (m.find ()) while (m.find ())
{ {
@ -88,7 +98,7 @@ class VisicalcCell implements Comparable<VisicalcCell>
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
System.out.printf ("NFE: %s%n", m.group (4)); System.out.printf ("NFE: %s [%s]%n", m.group (4), formula);
} }
else else
interim = parent.evaluateFunction (m.group (5)); // function interim = parent.evaluateFunction (m.group (5)); // function

View File

@ -196,11 +196,11 @@ public class VisicalcSpreadsheet implements Iterable<VisicalcCell>
char subCommand = command.charAt (1); char subCommand = command.charAt (1);
switch (subCommand) switch (subCommand)
{ {
case 'W': case 'W': // Window control
// System.out.println (" Window command: " + data); // System.out.println (" Window command: " + data);
break; break;
case 'G': case 'G': // Global command
// System.out.println (" Global command: " + data); // System.out.println (" Global command: " + data);
try try
{ {
@ -224,7 +224,7 @@ public class VisicalcSpreadsheet implements Iterable<VisicalcCell>
} }
break; break;
case 'T': case 'T': // Set title area
// System.out.println (" Title command: " + data); // System.out.println (" Title command: " + data);
break; break;
@ -268,6 +268,10 @@ public class VisicalcSpreadsheet implements Iterable<VisicalcCell>
{ {
return result; return result;
} }
if (function.startsWith ("@LOOKUP("))
{
return result;
}
Range range = getRange (function); Range range = getRange (function);
if (range == null) if (range == null)
@ -305,6 +309,11 @@ public class VisicalcSpreadsheet implements Iterable<VisicalcCell>
max = getValue (address); max = getValue (address);
result = max; result = max;
} }
else if (function.startsWith ("@LOOKUP"))
{
System.out.println ("Unfinished: " + function);
result = 0;
}
else else
System.out.println ("Unimplemented function: " + function); System.out.println ("Unimplemented function: " + function);
// http://www.bricklin.com/history/refcard1.htm // http://www.bricklin.com/history/refcard1.htm
@ -339,6 +348,7 @@ public class VisicalcSpreadsheet implements Iterable<VisicalcCell>
private Range getRange (String text) private Range getRange (String text)
{ {
Range range = null; Range range = null;
System.out.printf ("Range: [%s]%n", text);
Matcher m = functionPattern.matcher (text); Matcher m = functionPattern.matcher (text);
while (m.find ()) while (m.find ())
{ {