git @ Cat's Eye Technologies SixtyPical / 877f55b
VIC-20 example and rewrite docs. Chris Pressey 3 years ago
3 changed file(s) with 39 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
8383 * `const`s that can be used in defining the size of tables, etc.
8484 * Tests, and implementation, ensuring a routine can be assigned to a vector of "wider" type
8585 * Related: can we simply view a (small) part of a buffer as a byte table? If not, why not?
86 * Related: add constant to buffer to get new buffer. (Or to table, but... well, maybe.)
8687 * Check that the buffer being read or written to through pointer, appears in approporiate inputs or outputs set.
8788 (Associate each pointer with the buffer it points into.)
8889 * `static` pointers -- currently not possible because pointers must be zero-page, thus `@`, thus uninitialized.
9394 * Possibly `ld x, [ptr] + y`, possibly `st x, [ptr] + y`.
9495 * Maybe even `copy [ptra] + y, [ptrb] + y`, which can be compiled to indirect LDA then indirect STA!
9596 * Optimize `ld a, z` and `st a, z` to zero-page operations if address of z < 256.
97 * Include files?
9698
9799 [VICE]: http://vice-emu.sourceforge.net/
00 This directory contains SixtyPical example programs, categorized
1 in subdirectories by the machine architecture.
1 in subdirectories by machine architecture.
22
3 In the [c64](c64/) directory are programs that run on the Commodore 64:
3 ### rudiments
4
5 In the [rudiments](rudiments/) directory are programs which are not for
6 any particular machine, but meant to demonstrate the features of SixtyPical.
7 Some are meant to fail and produce an error message. Others can run on
8 any architecture where there is a routine at 65490 which outputs the value
9 of the accumulator as an ASCII character.
10
11 ### c64
12
13 In the [c64](c64/) directory are programs that run on the Commodore 64.
14 The directory itself contains some simple demos, for example
15 [hearts.60p](c64/hearts.60p), while there are subdirectories for more
16 elaborate demos:
417
518 * [demo-game](c64/demo-game/): a little game-like program written as a
619 "can we write something you'd see in practice?" test case for SixtyPical.
1124
1225 The second version of Ribos has been translated to SixtyPical.
1326
14 * [petulant](c64/petulant/) -- "The PETulant Cursor", a tiny (44 bytes)
27 * [petulant](c64/petulant/): "The PETulant Cursor", a tiny (44 bytes)
1528 "display hack". Originally written in the late 80's. Rewritten with
1629 the P65 assembler (now Ophis) and re-released on April 1st, 2008 (a
1730 hint as to its nature).
1831
1932 Translated to SixtyPical (in 2018), it's 48 bytes.
2033
21 In the [rudiments](rudiments/) directory are programs which are not for
22 any particular machine, but meant to demonstrate the features of SixtyPical.
23 Some are meant to fail and produce an error message. Others can run on
24 any architecture where there is a routine at 65490 which outputs the value
25 of the accumulator as an ASCII character.
34 ### vic20
35
36 In the [vic20](vic20/) directory are programs that run on the
37 Commodore VIC-20. The directory itself contains some simple demos,
38 for example [hearts.60p](vic20/hearts.60p).
2639
2740 [Ophis]: http://michaelcmartin.github.io/Ophis/
0 // Displays 256 hearts at the top of the VIC-20's screen.
1
2 // Define where the screen starts in memory:
3 byte table[256] screen @ 7680
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 }