Post by Carl on Feb 7, 2014 21:04:18 GMT
I have made a demo to see how well self loading can work.
I have learned from the sprite'd utility that you can make effective use of loading blocks as you run a program, and then call up the changed code as you work. This is easy now as 0.9.8 firmware loads as a blank screen and no longer gives err #17 every time a known word is recompiled.
So in this demo you are able to load 9 simple UDGs from one block.
Step in the second block changes the value of some of the bytes while it also changes the vram location of each one.
To use this demo type in or avrdude the first block, I used 20 but you can use what you like, just alter the 'loadup' command in your second block to the block that has the byte code in it.
Load the second block up, then
do. loadup
do. ufo
this is sound supported, space will stop the demo.
It's not the most elaborate demo you will ever see, but I now appreciate how well the FIGnition can handle multiple loops and smooth animation from very little code.
more here...
here is the listing in full...
( ufo demo)
create udgs
0 c, 0 c, 0 c,
0 c, %% @ c, 65 c,
%% @ c, 0 c,
udgs vram $$ @ + 8 cmove pokes the bytes into vram
( end of block) save this block
: aud 64 191 42
>port> drop ; opens PD5 to sound
: beep 0 69 ic! 0 110 ic!
66 68 ic!
71 ic! 7 and 69 ic! ;
128 var %% byte value
608 var $$ vram location
: step
%% @ 2 / %% ! divide by two
$$ @ 8 + $$ ! ; add 8
: loadup
9 0 do i
20 load the location of your first block here
step
loop loads block 9 times
$4FB $5D i! ; this code stabilise the pointer ( todo)
300 var && && is the vram location start
: cycle
9 1 do
i vram && @ + ic! display udg i ( 1 to 8 )
0 pause
loop drop
32 vram && @ + ic! display a blank
&& @ 1 + && ! ; move along
: go
aud audio on
300 && ! re state 300
24 0 do i cycle
50 && @ 100 * beep 50 ( 1-9 * 100 ) beep && location var is used
loop ;
: text
7 10 at ." The UFO Demo"
0 14 at ." Space quits this nonsense" ;
: ufo cls text
begin go inkey 32 = until
0 0 beep ; turns sound off.
load the second block type 'loadup' then 'ufo'
I have learned from the sprite'd utility that you can make effective use of loading blocks as you run a program, and then call up the changed code as you work. This is easy now as 0.9.8 firmware loads as a blank screen and no longer gives err #17 every time a known word is recompiled.
So in this demo you are able to load 9 simple UDGs from one block.
Step in the second block changes the value of some of the bytes while it also changes the vram location of each one.
To use this demo type in or avrdude the first block, I used 20 but you can use what you like, just alter the 'loadup' command in your second block to the block that has the byte code in it.
Load the second block up, then
do. loadup
do. ufo
this is sound supported, space will stop the demo.
It's not the most elaborate demo you will ever see, but I now appreciate how well the FIGnition can handle multiple loops and smooth animation from very little code.
more here...
here is the listing in full...
( ufo demo)
create udgs
0 c, 0 c, 0 c,
0 c, %% @ c, 65 c,
%% @ c, 0 c,
udgs vram $$ @ + 8 cmove pokes the bytes into vram
( end of block) save this block
: aud 64 191 42
>port> drop ; opens PD5 to sound
: beep 0 69 ic! 0 110 ic!
66 68 ic!
71 ic! 7 and 69 ic! ;
128 var %% byte value
608 var $$ vram location
: step
%% @ 2 / %% ! divide by two
$$ @ 8 + $$ ! ; add 8
: loadup
9 0 do i
20 load the location of your first block here
step
loop loads block 9 times
$4FB $5D i! ; this code stabilise the pointer ( todo)
300 var && && is the vram location start
: cycle
9 1 do
i vram && @ + ic! display udg i ( 1 to 8 )
0 pause
loop drop
32 vram && @ + ic! display a blank
&& @ 1 + && ! ; move along
: go
aud audio on
300 && ! re state 300
24 0 do i cycle
50 && @ 100 * beep 50 ( 1-9 * 100 ) beep && location var is used
loop ;
: text
7 10 at ." The UFO Demo"
0 14 at ." Space quits this nonsense" ;
: ufo cls text
begin go inkey 32 = until
0 0 beep ; turns sound off.
load the second block type 'loadup' then 'ufo'