git @ Cat's Eye Technologies SixtyPical / af09bd8
Add screenshot. Chris Pressey 3 years ago
4 changed file(s) with 33 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
3636
3737 The reference implementation can analyze and compile SixtyPical programs to
3838 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 ![Screenshot of result of running hearts.60p](https://raw.github.com/catseye/SixtyPical/master/images/hearts.png)
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).
3954
4055 Documentation
4156 -------------
107122 * Automatic tail-call optimization (could be tricky, w/constraints?)
108123 * Possibly `ld x, [ptr] + y`, possibly `st x, [ptr] + y`.
109124 * 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
-16
eg/c64/screen2.60p less more
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 }
Binary diff not shown