FAQ  •  Register  •  Login

how to convert sprite to ASM?

<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Thu Nov 03, 2011 7:44 pm

how to convert sprite to ASM?

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
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Thu Nov 03, 2011 10:27 pm

Re: how to convert sprite to ASM?

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.
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Fri Nov 04, 2011 12:55 am

Re: how to convert sprite to ASM?

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
http://www.unitconversion.org/numbers/b ... rsion.html

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?
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Fri Nov 04, 2011 2:32 am

Re: how to convert sprite to ASM?

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 ;)
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Fri Nov 04, 2011 2:43 am

Re: how to convert sprite to ASM?

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
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Fri Nov 04, 2011 10:16 am

Re: how to convert sprite to ASM?

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.
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Fri Nov 04, 2011 4:07 pm

Re: how to convert sprite to ASM?

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!
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Fri Nov 04, 2011 11:55 pm

Re: how to convert sprite to ASM?

it seems to use 4 8byte characters
that is how the data is read (after doing a few experiments)
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Sat Nov 05, 2011 5:40 pm

Re: how to convert sprite to ASM?

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.
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Sat Nov 05, 2011 7:00 pm

Re: how to convert sprite to ASM?

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!
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Sat Nov 05, 2011 7:51 pm

Re: how to convert sprite to ASM?

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 :D
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Sun Nov 06, 2011 3:01 am

Re: how to convert sprite to ASM?

Awesome!
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Mon Nov 07, 2011 2:43 pm

Re: how to convert sprite to ASM?

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?
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Mon Nov 07, 2011 8:56 pm

Re: how to convert sprite to ASM?

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!

Return to ZX Basic Compiler

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO