diff --git a/README.markdown b/README.markdown index d44da56..add9e6a 100644 --- a/README.markdown +++ b/README.markdown @@ -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. diff --git a/doc/SixtyPical.md b/doc/SixtyPical.md index 4c4cf0f..6db3da3 100644 --- a/doc/SixtyPical.md +++ b/doc/SixtyPical.md @@ -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 diff --git a/eg/proto-game.60p b/eg/proto-game.60p index 9015362..944562e 100644 --- a/eg/proto-game.60p +++ b/eg/proto-game.60p @@ -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 { diff --git a/loadngo.sh b/loadngo.sh index b6e36d1..cb8955b 100755 --- a/loadngo.sh +++ b/loadngo.sh @@ -1,6 +1,10 @@ #!/bin/sh SRC=$1 +if [ "X$1" = "X" ]; then + echo "Usage: ./loadngo.sh " + exit 1 +fi OUT=/tmp/a-out.prg bin/sixtypical --traceback --analyze --compile --basic-prelude $SRC > $OUT || exit 1 if [ -e vicerc ]; then