Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to convert sprite to ASM?
#1
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
Reply
#2
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.
Reply
#3
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?
Reply
#4
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 Wink
Reply
#5
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
Reply
#6
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.
Reply
#7
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.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#8
it seems to use 4 8byte characters
that is how the data is read (after doing a few experiments)
Reply
#9
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.
Reply
#10
Okay, so I will include three encoding methods:
  • Progressive (Standard)
    Vertical (for PutChars)
    Char (for grabbing to font or Fourspriter)
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#11
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 Big Grin
Reply
#12
Awesome!
Reply
#13
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?
Reply
#14
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.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)