Jump to content
IGNORED

GROM in sprite data.


PuzZLeR

Recommended Posts

Greetings my friends. I ask for a little help, if this is possible. It should be simple if so, but for some reason I have not been able to fully understand the "f" part of the "SPRITE index,x,y,f" syntax.

 

All I really want to do is save a GRAM card by using a GROM card in a sprite. Is this possible?

 

Say you want a visible sprite, zoomed 2x at Y, colored white, with defined GRAM at 00, an example would be this:

 

sprite 0, avatar_x_pos + VISIBLE, avatar_y_pos + ZOOMY2, SPR00 + SPR_WHITE

 

How would you take this example and place, say, an "X" instead (GROM card 56). I tried to add the "f" bits but I get weird results.

 

Thanks so much! ?

Edited by PuzZLeR
Changed a coordinate since it was incorrect.
Link to comment
Share on other sites

I go to http://knox.ac.free.fr/inty_workshop/ to input data to f.  Example if I want to print number 0 in red.  I select color red, pick number 0 in the drop down menu, leave GRAM box unticked.  Then you get your f data, which is MOBA : $0082. SPR00 I believe always points at $0800. I'm not sure if there's magic number to point at GRAM card, you could open constant.bas and see if it is listed.

  • Thanks 1
Link to comment
Share on other sites

Hi Kiwi!

 

It worked!

 

I used that link before, just for "drawing" my cards, but never noticed how much depth it had all along this time.

 

Just for completion to anyone interested - here's what I did to change my example before to acheive a white "X" as a sprite.

 

Went to link, in the MOB tab clicked the white color, left GRAM unticked, used the GROM drop down menu to 56, and bingo! Magic number is $01C7.

 

The line of code that worked was:

 

sprite 0, avatar_x_pos + VISIBLE, avatar_y_pos + ZOOMY2, $01C7

 

Thanks so much my friend! ?

 

(Should also note that I was using the constants.bas file for my two examples.)

  • Like 1
Link to comment
Share on other sites

I believe you could use this, based on that you know the GROM character map:

sprite 0, avatar_x_pos + VISIBLE, avatar_y_pos + ZOOMY2, SPR00 - GRAM + SPR_WHITE

GRAM holds the magic constant $0800 which kind of makes sense in this context as you would point to GROM instead.

 

Of course you still need to look up which character is 00, 01, 02 etc up to 63. If you work in Color Stack mode that enables the full GROM, you would have to come up with your own constants or use actual values for the symbols 64-255.

  • Like 1
Link to comment
Share on other sites

6 hours ago, mmarrero said:

The way I've done it with a constant, multiplying the character code by 8.


SPRITE 0, avatar_x_pos + VISIBLE, avatar_y_pos + ZOOMY2, ("x" * 8) + SPR_WHITE
SPRITE 1, avatar2_x_pos + VISIBLE, avatar2_y_pos + ZOOMY2, ("\95" * 8) + SPR_RED '--solid block

 

I was just going to recommend that.  You could easily create a macro for it, like this:

DEF FN GetGromCard(c) = (c * 8)

Then you can just say:

SPRITE 0, avatar_x_pos + VISIBLE, avatar_y_pos + ZOOMY2, GetGromCard("x")

 

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...