Sprite'd a Sprite editor!

76 views
Skip to first unread message

Carl Attrill

unread,
Jan 20, 2014, 11:07:16 AM1/20/14
to fign...@googlegroups.com
Hi everyone,
 
I have made a sprite editor for the FIGnition, the listing and the files are below.

Notes.

you can put blocks in the screen with down and move the cursor back and forward with left and right.

press space to see the decimal value of the sprite.

pressing 1 2 3 or 4 will load your sprite and display it on the screen so you can see what it looks like.

There are four set out in a 2x2 this allows you to draw many types of icon.
The info of the most recent sprite is displayed in hex and decimal, but keep a pen handy if you are making sprites as only the last one loaded is recorded, however you can peek the values without loading with space.

q quits.

load these hex files into you fignition as you like but the last one '99' is to be saved at 99 or where dokey can get it, and it is to be loaded last as you compile it or it will not work.

'go' to run it.

if you have any issues please let me know. It could be a typo.

I also maintain figgi.boards.net  so please look and register if you would like to, its a repository of some old programs I have made plus there is room there to share topics if you are not keen on emailing some subjects.

Attached- fth listing, screenshot and hex files.

regards

Carl.




sprite_d_screenshot.png
S_editor.fth
S_editor_99.fth
sprited_lastblock00.hex
sprited00.hex
sprited01.hex
sprited02.hex
sprited03.hex
sprited04.hex

Julian Skidmore

unread,
Jan 20, 2014, 11:40:33 AM1/20/14
to fign...@googlegroups.com
Looks good Carl! I'm just about to do today's writeup for FIGkeys!

-cheers from Julz
> --
> You received this message because you are subscribed to the Google Groups
> "FIGnition" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fignition+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>


--

The DIY 8-bit computer from nichemachines™

carl

unread,
Jan 20, 2014, 12:18:02 PM1/20/14
to fign...@googlegroups.com
I never wrote a computer program before building a fignition! I should have done this earlier. :-! What car would I be driving today?

This program makes good use of loop and some maths with the binary adder halving each time the location moves to the right, until recently I would have used 8 if/then against 128,64 ... etc.

Next target is to understand over.

Stuart Taylor

unread,
Jan 20, 2014, 12:25:26 PM1/20/14
to fign...@googlegroups.com

A clapped out Honda civic :-)

Mark Wills

unread,
Jan 20, 2014, 1:54:46 PM1/20/14
to fign...@googlegroups.com

OVER just *copies* the second value on the stack to the top.

So if you did:

7 8 9 over

You would this on the stack:

7 8 9 8

So a copy of the 8 jumped "over" the 9.

Hope this helps.

Mark

On 20 Jan 2014 17:18, "carl" <carl.a...@gmail.com> wrote:

carl

unread,
Jan 22, 2014, 3:50:30 AM1/22/14
to fign...@googlegroups.com

OVER just *copies* the second value on the stack to the top.

So if you did:

7 8 9 over

You would this on the stack:

7 8 9 8

So a copy of the 8 jumped "over" the 9.

Hope this helps.

Mark


Thanks Mark, that makes sense, I see it in some code when an icon gets moved and rather than emitting a value, over is used instead. It looks more efficient.

A clapped out Honda civic :-)
 
Stu, a Honda Civic, haha. a  good answer you're right, one should not look too much at the what if's in life, 
or should I say on here the if whats.

saw this on the forum yesterday...


I am not sure if he is present here but I think he is going to get a fignition soon.

Carl.




Mark Wills

unread,
Jan 22, 2014, 4:53:53 AM1/22/14
to fign...@googlegroups.com
Over is a good way to copy the top two items on the stack, if your system doesn't have 2DUP:
 
: 2DUP ( n1 n2 -- n1 n2 n1 n2 )
  OVER OVER ;
 
Try it:
 
99 100 2DUP
 
Then display your stack (not sure what the command is on the figgy to display the stack; on my system it is .S).
 
You'll see you get:
 
99 100 99 100
 
Hopefully you can FIGure it out ;-)
 
(Did you see what I did there ;-)
 
Cheers
 
Mark
 


Julian Skidmore

unread,
Jan 22, 2014, 6:00:32 AM1/22/14
to fign...@googlegroups.com
Hi Mark,

FIGnition has 2dup built-in, as an inline command (i.e. when FIGnition
compiles 2dup it literally compiles over over into the program.
Similarly, compiling * compiles u* drop ).

However, FIGnition doesn't have .S built-in, but it's simply:

: .s
sp i@ sp0 do
i i@ .
2 +loop
;

-cheers from Julz

Mark Wills

unread,
Jan 22, 2014, 6:22:50 AM1/22/14
to fign...@googlegroups.com
Cheers Julz!
 
Mark

carl

unread,
Feb 5, 2014, 7:30:30 AM2/5/14
to fign...@googlegroups.com


I have made some alterations to the code to make it run smoother ( and run!)

#spriteblock9900.hex# is saved to block 99, but as before you can save it anywhere you want to, but change the load 99 in doKey  to reflect your location.

If you use t2e2 you may find that you lose the last little chunk of code in your hex files, I get around this by adding '( end)' at the conclusion of the code.

I am sure that with a tiny alteration I can change the four icon preview for a one udg animation in four slides. 

Regards.






S_editor.fth
S_editor_99.fth
sprited00.hex
sprited01.hex
sprited02.hex
sprited03.hex
sprited04.hex
spritedblock9900.hex
fignition_progs.png

carl

unread,
Feb 8, 2014, 7:28:18 AM2/8/14
to fign...@googlegroups.com

Sprite'd now includes animation!

By including a little routine right at the start, UDGs 1-4 are displayed with a delay so you can review your work.
'a' starts the animation and 's' returns you to your editing.

so you can type or load the blocks into your fignition, remember to put 9900.hex at block 99 or a block you can link doKey to in block 03.hex 
load all 5 blocks and do. 'go' to run the utility.


here are the files...

regards




S_editor.fth
S_editor_99.fth
sprited00.hex
sprited01.hex
sprited02.hex
sprited03.hex
sprited04.hex
spritedblock9900.hex
figgi.boards.net.png
Reply all
Reply to author
Forward
0 new messages