This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
cch


Newbie


Joined: 25 Jun 2011
Posts: 4

Posted: 25 Jun 2011 10:16:20 pm    Post subject:

Before you go yelling at me that this already exists, please make sure you read in more detail.

I'm looking for a small ASM program I can use with my BASIC programs that will make a sprite. The closest things I've found do something close, but are lacking the exact feature I need.

Omnicalc has a nice sprite() function that plots the sprites exactly the way I want, except that it requires a Pic variable to take the sprite from. Other ASM programs like Qsprite are able to store the sprite data as Hex or Token strings and plot them, but it seems they're restricted to the X coordinate being a multiple of 8, which means it's really only good for plotting tiles and not really for moving sprites like a cursor or character in a game.

What I'm hoping for is a combination. Something I can feed a Hex or Tokenized string to and be able to plot the sprite anywhere on the screen. I'd like it to be able to use all the normal methods, AND, OR, XOR, and Overwrite.

Preferably, I'd like it to be a ASM program and not an App so that it can be easily bundled with my programs. Syntax being something like:
{Sprite_Width,Sprite_Height,X-Coord,Y-Coord,Plot_Method,Data_Type,Sprite_Data_as_String}:Asm(prgmSprite)
(Data_Type being if it's Hex or Tokenized, Plot_Method being: 1=AND + Screen Update, 2=AND + No Update, 3=OR + Screen Update, 4=OR + No Update, etc., No Update meaning it'll plot to the buffer, but not yet show it on the screen, such as if I want to plot multiple sprites and make it appear as if they all plotted at the same time.
My intent would look something like:
{8,8,18,12,4,1,"3C4281818181423C"}:Asm(prgmSprite)
which would draw a 8x8 shape at 18,12, using OR logic, but not update the screen, so that I might plot another sprite somewhere else using another method that does update the screen.

If a program like this already exists, please point me towards it, otherwise, maybe one of the pros around here might be able to write something up for me? (I'll give credit in my programs if desired)
I'm a major newbie to writing ASM since I've never done such low level programming before. All my experience is high level languages like TI-BASIC, Javascript, PHP, etc.

Edit:
I found a ASM tool called RAGE that nearly does what I want. It's limited to 8x8 sprites and only seems to use XOR logic and takes decimal numbers instead of Hex for each byte, but it at least allows me to place the sprite anywhere on the screen I want. I'm basically looking for this kind of program, only a bit bigger and using at least Hex instead of decimal.

At the moment at least, I am using Omnicalc's base conversion function to change binary versions of my sprites to decimal lists, and those lists seem to be working nicely, but it would be so much easier if I can do a Hex string instead of a list of binary. (At the moment, to draw a sprite, it takes the following input: {11, X-coord, Y-coord, Byte1, Byte2, Byte3, Byte4, Byte5, Byte6, Byte7, Byte8}:Asm(prgmRAGE), where of course each Byte is a decimal number equal to the binary form of that line of the sprite. Very limiting and annoying to write out...(The 11 at the beginning is to tell it to make a sprite, since RAGE does more than just sprites))


Last edited by Guest on 26 Jun 2011 01:15:56 am; edited 1 time in total
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 27 Jun 2011 08:35:33 pm    Post subject:

The closest I have that even begins to get close to what you want for sprite placement is something benryves made for me for pokemon purple. It takes hex input and displays a sprite at a specified coordinate, and if you use negative coordinates, it mirrors the sprite. It also allows for the character 'G' to be used as a hex value, showing a premature end to a line. It was designed with 32x32 in mind though.
Back to top
DJ Omnimaga
http://i-lost-the-ga.me


Calc Guru


Joined: 14 Nov 2003
Posts: 1196

Posted: 02 Jul 2011 11:49:59 pm    Post subject:

One tool I liked was Codex, but it was a bit slow at times. Another good tool would be xLIB v0.3a, which can draw entire tilemaps.

The best tools are Doors CS7, xLIB and Celtic III, but they're very large, so only use them if using an extra 16 KB of archive is not an issue for you.
Back to top
montytyper


Newbie


Joined: 06 Nov 2010
Posts: 13

Posted: 08 Jul 2011 01:11:52 am    Post subject:

Batlib is probably the best library for this. It's pretty small (only one app page) and actively maintained. The problem is that it's an app, which may or may not be a dealbreaker.
Back to top
cch


Newbie


Joined: 25 Jun 2011
Posts: 4

Posted: 11 Jul 2011 02:10:55 pm    Post subject:

Tried Codex, didn't have the routines I wanted. Tried xLIB too, and Batlib, being a App, does kinda mess up the ability to distribute my programs freely. I hate dependencies like that.

I'm actually working with the writer of EnPro/Batlib for a newer version that has more graphical functions, including the sprite routine I'm looking for. He's expecting to release it as a new version of EnPro, but I'm sure he'll add it into Batlib as well if it works well.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 19 Jul 2011 02:39:09 pm    Post subject:

I plan to add the spriting routines into BatLib if I can accomplish them and I plan to add in a few of the other ideas (like the screen wipes and whatnot). Also, I go by many pseudonyms on the interwebs... sometimes I am too paranoid Very Happy I try to maintain some activity here when I have internet access, by the way, but for now I am limited in that x.x
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement