mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-01-24 01:35:50 +00:00
VIC-20 example and rewrite docs.
This commit is contained in:
parent
766de6a455
commit
877f55b6cd
@ -84,6 +84,7 @@ is probably NP-complete. But doing it adequately is probably not that hard.
|
||||
* `const`s that can be used in defining the size of tables, etc.
|
||||
* Tests, and implementation, ensuring a routine can be assigned to a vector of "wider" type
|
||||
* Related: can we simply view a (small) part of a buffer as a byte table? If not, why not?
|
||||
* Related: add constant to buffer to get new buffer. (Or to table, but... well, maybe.)
|
||||
* Check that the buffer being read or written to through pointer, appears in approporiate inputs or outputs set.
|
||||
(Associate each pointer with the buffer it points into.)
|
||||
* `static` pointers -- currently not possible because pointers must be zero-page, thus `@`, thus uninitialized.
|
||||
@ -94,5 +95,6 @@ is probably NP-complete. But doing it adequately is probably not that hard.
|
||||
* Possibly `ld x, [ptr] + y`, possibly `st x, [ptr] + y`.
|
||||
* Maybe even `copy [ptra] + y, [ptrb] + y`, which can be compiled to indirect LDA then indirect STA!
|
||||
* Optimize `ld a, z` and `st a, z` to zero-page operations if address of z < 256.
|
||||
* Include files?
|
||||
|
||||
[VICE]: http://vice-emu.sourceforge.net/
|
||||
|
29
eg/README.md
29
eg/README.md
@ -1,7 +1,20 @@
|
||||
This directory contains SixtyPical example programs, categorized
|
||||
in subdirectories by the machine architecture.
|
||||
in subdirectories by machine architecture.
|
||||
|
||||
In the [c64](c64/) directory are programs that run on the Commodore 64:
|
||||
### rudiments
|
||||
|
||||
In the [rudiments](rudiments/) directory are programs which are not for
|
||||
any particular machine, but meant to demonstrate the features of SixtyPical.
|
||||
Some are meant to fail and produce an error message. Others can run on
|
||||
any architecture where there is a routine at 65490 which outputs the value
|
||||
of the accumulator as an ASCII character.
|
||||
|
||||
### c64
|
||||
|
||||
In the [c64](c64/) directory are programs that run on the Commodore 64.
|
||||
The directory itself contains some simple demos, for example
|
||||
[hearts.60p](c64/hearts.60p), while there are subdirectories for more
|
||||
elaborate demos:
|
||||
|
||||
* [demo-game](c64/demo-game/): a little game-like program written as a
|
||||
"can we write something you'd see in practice?" test case for SixtyPical.
|
||||
@ -12,17 +25,17 @@ In the [c64](c64/) directory are programs that run on the Commodore 64:
|
||||
|
||||
The second version of Ribos has been translated to SixtyPical.
|
||||
|
||||
* [petulant](c64/petulant/) -- "The PETulant Cursor", a tiny (44 bytes)
|
||||
* [petulant](c64/petulant/): "The PETulant Cursor", a tiny (44 bytes)
|
||||
"display hack". Originally written in the late 80's. Rewritten with
|
||||
the P65 assembler (now Ophis) and re-released on April 1st, 2008 (a
|
||||
hint as to its nature).
|
||||
|
||||
Translated to SixtyPical (in 2018), it's 48 bytes.
|
||||
|
||||
In the [rudiments](rudiments/) directory are programs which are not for
|
||||
any particular machine, but meant to demonstrate the features of SixtyPical.
|
||||
Some are meant to fail and produce an error message. Others can run on
|
||||
any architecture where there is a routine at 65490 which outputs the value
|
||||
of the accumulator as an ASCII character.
|
||||
### vic20
|
||||
|
||||
In the [vic20](vic20/) directory are programs that run on the
|
||||
Commodore VIC-20. The directory itself contains some simple demos,
|
||||
for example [hearts.60p](vic20/hearts.60p).
|
||||
|
||||
[Ophis]: http://michaelcmartin.github.io/Ophis/
|
||||
|
16
eg/vic20/hearts.60p
Normal file
16
eg/vic20/hearts.60p
Normal file
@ -0,0 +1,16 @@
|
||||
// Displays 256 hearts at the top of the VIC-20's screen.
|
||||
|
||||
// Define where the screen starts in memory:
|
||||
byte table[256] screen @ 7680
|
||||
|
||||
routine main
|
||||
// These are the values that will be written to by this routine:
|
||||
trashes a, x, z, n, screen
|
||||
{
|
||||
ld x, 0
|
||||
ld a, 83 // 83 = screen code for heart
|
||||
repeat {
|
||||
st a, screen + x
|
||||
inc x
|
||||
} until z // this flag will be set when x wraps around from 255 to 0
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user