mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-02-16 15:30:26 +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
|
||||
----
|
||||
|
||||
### Demo game
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
@ -69,6 +72,7 @@ This should be tracked in the abstract interpretation.
|
||||
|
||||
### And at some point...
|
||||
|
||||
* Compare word (constant or memory location) with memory location or pointer. (Maybe?)
|
||||
* `copy x, [ptr] + y`
|
||||
* 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.
|
||||
|
@ -25,7 +25,8 @@ There are six *primitive types* in SixtyPical:
|
||||
|
||||
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)
|
||||
|
||||
Memory locations
|
||||
|
@ -32,7 +32,7 @@ word delta
|
||||
|
||||
vector dispatch_game_state
|
||||
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
|
||||
|
||||
//
|
||||
@ -49,13 +49,13 @@ vector dispatch_game_state
|
||||
|
||||
vector cinv
|
||||
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
|
||||
@ 788
|
||||
|
||||
vector save_cinv
|
||||
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
|
||||
|
||||
|
||||
@ -125,7 +125,7 @@ routine clear_screen
|
||||
|
||||
routine game_state_play
|
||||
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
|
||||
{
|
||||
call read_stick
|
||||
@ -145,15 +145,10 @@ routine game_state_play
|
||||
|
||||
routine game_state_title_screen
|
||||
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
|
||||
{
|
||||
ld a, 5
|
||||
st a, vic_border
|
||||
ld a, 0
|
||||
st a, vic_bg
|
||||
ld y, 0
|
||||
|
||||
repeat {
|
||||
ld a, 82
|
||||
st a, screen1 + y
|
||||
@ -182,7 +177,7 @@ routine game_state_title_screen
|
||||
|
||||
routine our_cinv
|
||||
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
|
||||
{
|
||||
goto dispatch_game_state
|
||||
@ -194,8 +189,16 @@ routine main
|
||||
screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
|
||||
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
|
||||
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
|
||||
with interrupts off {
|
||||
|
@ -1,6 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC=$1
|
||||
if [ "X$1" = "X" ]; then
|
||||
echo "Usage: ./loadngo.sh <source.60p>"
|
||||
exit 1
|
||||
fi
|
||||
OUT=/tmp/a-out.prg
|
||||
bin/sixtypical --traceback --analyze --compile --basic-prelude $SRC > $OUT || exit 1
|
||||
if [ -e vicerc ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user