Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
does anyone know how to convert a sprite (in any format) to ASM defb statements?
say for example my sprite was like this:
1,0,0,0,0,0,0,1
1,0,0,0,0,0,0,1
1,0,0,0,0,0,0,1
1,0,0,0,0,0,0,1
1,0,0,0,0,0,0,1
1,0,0,0,0,0,0,1
1,0,0,0,0,0,0,1
1,0,0,0,0,0,0,1
Posts: 805
Threads: 135
Joined: Apr 2009
Reputation:
5
slenkar Wrote:does anyone know how to convert a sprite (in any format) to ASM defb statements?
say for example my sprite was like this:
1,0,0,0,0,0,0,1
defb 1,0,0,0,0,0,0,1 if those are bytes.
defb %10000001, or defb 129 if those are bits.
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
will defb 1,0,0,0,0,0,0,1 work in fourspriter?
if not...
it seems that this website can convert binary to numbers
<!-- m --><a class="postlink" href="http://www.unitconversion.org/numbers/binary-to-base-10-conversion.html">http://www.unitconversion.org/numbers/b ... rsion.html</a><!-- m -->
so basically I convert each line of the sprite to a number it seems?
EDIT, I used 7up to create a sprite 16x16
then i copy and pasted the numbers into the 4spriter example but my sprite was corrupted,
It resembled the original but it looked like some pixels were added and some were taken away.
the output from 7up had 4 extra numbers too......
how did you design your sprite and get it into the game?
Posts: 805
Threads: 135
Joined: Apr 2009
Reputation:
5
You should be able to use binary like I said too:
defb %10000001
should be the same as
defb 129
(or for that matter defb 81h if you want to do hexadecimal
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
the result is coming out distorted,
(when i copy and paste numbers from 7up)
what did you use to design the sprite you used for the example?
it turns out 7up is exporting the data in the wrong order,
i cant seem to get the options to export it the right way
Posts: 805
Threads: 135
Joined: Apr 2009
Reputation:
5
Actually, I borrowed gentle there from someone else; but I've used 7up to design sprites as well. You probably have the byte order wrong. Use the example as a template - put the bytes for it back into your sprite designer in binary, and you'll see the order.
I'm pretty sure you can set the byte ordering in 7up.
Posts: 615
Threads: 49
Joined: Feb 2009
Reputation:
2
What byte order does Fourspriter need?
8 bytes character or 16 bit lines?
I implemented now Progressive format and vertical format (for PutChars) in BorIDE. It works, I added with it some graphics to QFJ. The most painter stuff works now, but still no saving added.
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
it seems to use 4 8byte characters
that is how the data is read (after doing a few experiments)
Posts: 805
Threads: 135
Joined: Apr 2009
Reputation:
5
It depends which version. There's one that uses 16 bit lines, because it uses 16 bit constructs (push and pop) to write to the screen, for example.
The one on here as "final slower version" for example, has an initialise setup of:
SUB fspInitialize (n as uByte, udgA as uByte, udgB as uByte, udgC as uByte, udgD as uByte,x as uByte,y as uByte) 'Initialize Sprite: n (sprite number 0-3);a,b,c,d (UDG number 0-20,99 means the sprite won't be printed)
That's not clear? It takes four locations in the user-definable graphics area, so clearly these should be defined as normal UDG's. You can repoint the UDG system variable to allow for initializing other graphics instead.
Posts: 615
Threads: 49
Joined: Feb 2009
Reputation:
2
Okay, so I will include three encoding methods: - Progressive (Standard)
Vertical (for PutChars)
Char (for grabbing to font or Fourspriter)
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
LCD Wrote:Okay, so I will include three encoding methods:- Progressive (Standard)
Vertical (for PutChars)
Char (for grabbing to font or Fourspriter)
looking forward to that
Posts: 805
Threads: 135
Joined: Apr 2009
Reputation:
5
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
LCD Wrote:Okay, so I will include three encoding methods:- Progressive (Standard)
Vertical (for PutChars)
Char (for grabbing to font or Fourspriter)
whens it gonna be released?
Posts: 615
Threads: 49
Joined: Feb 2009
Reputation:
2
slenkar Wrote:LCD Wrote:Okay, so I will include three encoding methods:- Progressive (Standard)
Vertical (for PutChars)
Char (for grabbing to font or Fourspriter)
whens it gonna be released? When ready... I'm working on multiple parts at the same time, but there are still some issues and unfinished parts. Anyway, It will definitly be released this year, but I cannot promise anything will work as expected.
Oh, and there are still some games which I write using it, for testing purposes.
|