Add screenshot.
Chris Pressey
5 years ago
36 | 36 |
|
37 | 37 |
The reference implementation can analyze and compile SixtyPical programs to
|
38 | 38 |
6502 machine code.
|
|
39 |
|
|
40 |
Quick Start
|
|
41 |
-----------
|
|
42 |
|
|
43 |
If you have the [VICE][] emulator installed, from this directory, you can run
|
|
44 |
|
|
45 |
./loadngo.sh c64 eg/c64/hearts.60p
|
|
46 |
|
|
47 |
and it will compile the [hearts.60p source code](eg/c64/hearts.60p) and
|
|
48 |
automatically start it in the `x64` emulator, and you should see:
|
|
49 |
|
|
50 |

|
|
51 |
|
|
52 |
You can try the `loadngo.sh` script on other sources in the `eg` directory
|
|
53 |
tree. There is an entire small game(-like program) in [demo-game.60p](eg/c64/demo-game.60p).
|
39 | 54 |
|
40 | 55 |
Documentation
|
41 | 56 |
-------------
|
|
107 | 122 |
* Automatic tail-call optimization (could be tricky, w/constraints?)
|
108 | 123 |
* Possibly `ld x, [ptr] + y`, possibly `st x, [ptr] + y`.
|
109 | 124 |
* Maybe even `copy [ptra] + y, [ptrb] + y`, which can be compiled to indirect LDA then indirect STA!
|
|
125 |
|
|
126 |
[VICE]: http://vice-emu.sourceforge.net/
|
|
0 |
// Displays 256 hearts at the top of the Commodore 64's screen.
|
|
1 |
|
|
2 |
// Define where the screen starts in memory:
|
|
3 |
byte table[256] screen @ 1024
|
|
4 |
|
|
5 |
routine main
|
|
6 |
// These are the values that will be written to by this routine:
|
|
7 |
trashes a, x, z, n, screen
|
|
8 |
{
|
|
9 |
ld x, 0
|
|
10 |
ld a, 83 // 83 = screen code for heart
|
|
11 |
repeat {
|
|
12 |
st a, screen + x
|
|
13 |
inc x
|
|
14 |
} until z // this flag will be set when x wraps around from 255 to 0
|
|
15 |
}
|
0 | |
// Displays 256 hearts at the top of the Commodore 64's screen.
|
1 | |
|
2 | |
// Define where the screen starts in memory:
|
3 | |
byte table[256] screen @ 1024
|
4 | |
|
5 | |
routine main
|
6 | |
// These are the values that will be written to by this routine:
|
7 | |
trashes a, x, z, n, screen
|
8 | |
{
|
9 | |
ld x, 0
|
10 | |
ld a, 83 // 83 = screen code for heart
|
11 | |
repeat {
|
12 | |
st a, screen + x
|
13 | |
inc x
|
14 | |
} until z // this flag will be set when x wraps around from 255 to 0
|
15 | |
}
|