mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-02-21 04:29:14 +00:00
Add more notes and basically small cleanups in many places.
This commit is contained in:
parent
4f919c1d81
commit
7323927f72
@ -40,13 +40,16 @@ Documentation
|
|||||||
TODO
|
TODO
|
||||||
----
|
----
|
||||||
|
|
||||||
|
### Demo game
|
||||||
|
|
||||||
Finish the little demo "game" where you can move a block around the screen with
|
Finish the little demo "game" where you can move a block around the screen with
|
||||||
the joystick (i.e. bring it up to par with the original demo game that was written
|
the joystick (i.e. bring it up to par with the original demo game that was written
|
||||||
for SixtyPical)
|
for SixtyPical)
|
||||||
|
|
||||||
### Operations on 16 bit values
|
### Self-reference in signatures
|
||||||
|
|
||||||
Compare word (constant or memory location) with memory location or pointer. (Maybe?)
|
A vector might store [the address of] a routine which changes the vector. Thus its
|
||||||
|
signature might look like `vector foo outputs foo`. Thus we need to support that.
|
||||||
|
|
||||||
### `vector table` type
|
### `vector table` type
|
||||||
|
|
||||||
@ -69,6 +72,7 @@ This should be tracked in the abstract interpretation.
|
|||||||
|
|
||||||
### And at some point...
|
### And at some point...
|
||||||
|
|
||||||
|
* Compare word (constant or memory location) with memory location or pointer. (Maybe?)
|
||||||
* `copy x, [ptr] + y`
|
* `copy x, [ptr] + y`
|
||||||
* Maybe even `copy [ptra] + y, [ptrb] + y`, which can be compiled to indirect LDA then indirect STA!
|
* Maybe even `copy [ptra] + y, [ptrb] + y`, which can be compiled to indirect LDA then indirect STA!
|
||||||
* Check that the buffer being read or written to through pointer, appears in approporiate inputs or outputs set.
|
* Check that the buffer being read or written to through pointer, appears in approporiate inputs or outputs set.
|
||||||
|
@ -25,7 +25,8 @@ There are six *primitive types* in SixtyPical:
|
|||||||
|
|
||||||
There are also two *type constructors*:
|
There are also two *type constructors*:
|
||||||
|
|
||||||
* X table (256 entries, each holding a value of type X, where X is `byte`)
|
* T table (256 entries, each holding a value of type T, where T is either
|
||||||
|
`byte` or `word`)
|
||||||
* buffer[N] (N entries; each entry is a byte; N is a power of 2, ≤ 64K)
|
* buffer[N] (N entries; each entry is a byte; N is a power of 2, ≤ 64K)
|
||||||
|
|
||||||
Memory locations
|
Memory locations
|
||||||
|
@ -32,7 +32,7 @@ word delta
|
|||||||
|
|
||||||
vector dispatch_game_state
|
vector dispatch_game_state
|
||||||
inputs joy2, pos
|
inputs joy2, pos
|
||||||
outputs delta, pos, screen, vic_border, vic_bg, screen1
|
outputs delta, pos, screen, screen1
|
||||||
trashes a, x, y, c, z, n, v, ptr
|
trashes a, x, y, c, z, n, v, ptr
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -49,13 +49,13 @@ vector dispatch_game_state
|
|||||||
|
|
||||||
vector cinv
|
vector cinv
|
||||||
inputs joy2, pos
|
inputs joy2, pos
|
||||||
outputs delta, pos, screen, vic_border, vic_bg, screen1
|
outputs delta, pos, screen, screen1
|
||||||
trashes a, x, y, c, z, n, v, ptr
|
trashes a, x, y, c, z, n, v, ptr
|
||||||
@ 788
|
@ 788
|
||||||
|
|
||||||
vector save_cinv
|
vector save_cinv
|
||||||
inputs joy2, pos
|
inputs joy2, pos
|
||||||
outputs delta, pos, screen, vic_border, vic_bg, screen1
|
outputs delta, pos, screen, screen1
|
||||||
trashes a, x, y, c, z, n, v, ptr
|
trashes a, x, y, c, z, n, v, ptr
|
||||||
|
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ routine clear_screen
|
|||||||
|
|
||||||
routine game_state_play
|
routine game_state_play
|
||||||
inputs joy2, pos
|
inputs joy2, pos
|
||||||
outputs delta, pos, screen, vic_border, vic_bg, screen1
|
outputs delta, pos, screen, screen1
|
||||||
trashes a, x, y, c, z, n, v, ptr
|
trashes a, x, y, c, z, n, v, ptr
|
||||||
{
|
{
|
||||||
call read_stick
|
call read_stick
|
||||||
@ -145,15 +145,10 @@ routine game_state_play
|
|||||||
|
|
||||||
routine game_state_title_screen
|
routine game_state_title_screen
|
||||||
inputs joy2, pos
|
inputs joy2, pos
|
||||||
outputs delta, pos, screen, vic_border, vic_bg, screen1
|
outputs delta, pos, screen, screen1
|
||||||
trashes a, x, y, c, z, n, v, ptr
|
trashes a, x, y, c, z, n, v, ptr
|
||||||
{
|
{
|
||||||
ld a, 5
|
|
||||||
st a, vic_border
|
|
||||||
ld a, 0
|
|
||||||
st a, vic_bg
|
|
||||||
ld y, 0
|
ld y, 0
|
||||||
|
|
||||||
repeat {
|
repeat {
|
||||||
ld a, 82
|
ld a, 82
|
||||||
st a, screen1 + y
|
st a, screen1 + y
|
||||||
@ -182,7 +177,7 @@ routine game_state_title_screen
|
|||||||
|
|
||||||
routine our_cinv
|
routine our_cinv
|
||||||
inputs joy2, pos
|
inputs joy2, pos
|
||||||
outputs delta, pos, screen, vic_border, vic_bg, screen1
|
outputs delta, pos, screen, screen1
|
||||||
trashes a, x, y, c, z, n, v, ptr
|
trashes a, x, y, c, z, n, v, ptr
|
||||||
{
|
{
|
||||||
goto dispatch_game_state
|
goto dispatch_game_state
|
||||||
@ -194,8 +189,16 @@ routine main
|
|||||||
screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
|
screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
|
||||||
trashes a, y, n, c, z, vic_border, vic_bg
|
trashes a, y, n, c, z, vic_border, vic_bg
|
||||||
{
|
{
|
||||||
|
ld a, 5
|
||||||
|
st a, vic_border
|
||||||
|
ld a, 0
|
||||||
|
st a, vic_bg
|
||||||
|
ld y, 0
|
||||||
|
|
||||||
call clear_screen
|
call clear_screen
|
||||||
copy game_state_title_screen, dispatch_game_state
|
|
||||||
|
copy game_state_play, dispatch_game_state
|
||||||
|
// copy game_state_title_screen, dispatch_game_state
|
||||||
|
|
||||||
copy word 0, pos
|
copy word 0, pos
|
||||||
with interrupts off {
|
with interrupts off {
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
SRC=$1
|
SRC=$1
|
||||||
|
if [ "X$1" = "X" ]; then
|
||||||
|
echo "Usage: ./loadngo.sh <source.60p>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
OUT=/tmp/a-out.prg
|
OUT=/tmp/a-out.prg
|
||||||
bin/sixtypical --traceback --analyze --compile --basic-prelude $SRC > $OUT || exit 1
|
bin/sixtypical --traceback --analyze --compile --basic-prelude $SRC > $OUT || exit 1
|
||||||
if [ -e vicerc ]; then
|
if [ -e vicerc ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user