diff --git a/ueforth/common/extra_opcodes.h b/ueforth/common/extra_opcodes.h index 52f2d3f..831fcb6 100644 --- a/ueforth/common/extra_opcodes.h +++ b/ueforth/common/extra_opcodes.h @@ -89,5 +89,8 @@ XV(internals, "'argc", ARGC, DUP; tos = (cell_t) &g_sys.argc) \ XV(internals, "'argv", ARGV, DUP; tos = (cell_t) &g_sys.argv) \ XV(internals, "'runner", RUNNER, DUP; tos = (cell_t) &g_sys.runner) \ + YV(internals, fill32, cell_t c = tos; DROP; cell_t n = tos; DROP; \ + uint32_t *a = (uint32_t *) tos; DROP; \ + for (;n;--n) *a++ = c) \ Y(context, DUP; tos = (cell_t) (g_sys.context + 1)) \ Y(latestxt, DUP; tos = (cell_t) g_sys.latestxt) diff --git a/ueforth/common/grf_utils.fs b/ueforth/common/grf_utils.fs index 8a8d64b..b3880db 100644 --- a/ueforth/common/grf_utils.fs +++ b/ueforth/common/grf_utils.fs @@ -18,6 +18,7 @@ \ Drawing: \ box ( x y w h -- ) +also internals grf definitions 0 value color @@ -25,7 +26,8 @@ grf definitions internals definitions : hline { x y w } - x y pixel w 1- for color over l! 4 + next drop ; + \ x y pixel w 1- for color over l! 4 + next drop ; + x y pixel w color fill32 ; grf definitions also internals diff --git a/ueforth/examples/heart_game.fs b/ueforth/examples/heart_game.fs index 2c63631..7aed626 100755 --- a/ueforth/examples/heart_game.fs +++ b/ueforth/examples/heart_game.fs @@ -192,8 +192,12 @@ create arrow-table targeted-arrow ; +0 value last-tm +0 value next-tm + : run begin + poll PRESSED event = if 65 last-key = if init @@ -202,11 +206,14 @@ create arrow-table fire then then - poll - 100 random 0= if volcano-spew then - draw - tick - cleanup + event UNKNOWN = if + begin ms-ticks to next-tm next-tm last-tm - 10 < while 1 ms repeat + next-tm to last-tm + 100 random 0= if volcano-spew then + draw + tick + cleanup + then FINISHED event = until bye ;