Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Hexadecimal Sprite Data

    Comments & Feedback
    3
    8
    367
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jacobmph
      jacobmph last edited by

      I was pleased to find that this seems to work as a replacement for the playerShip sprite image data in the Invader example (despite no obvious mention of hexadecimal notation in the documentation?). It's not that exciting in this case, but could presumably be expanded for larger sprites with different bit depths (4-colour, 16-colour, etc.) Then if there was a PC conversion tool that would transform graphics files on your PC into data which could be typed into FUZE then that might have some value? If I'm missing something then let me know (classic refusal to properly read the manual - sorry).

      I'm also wondering why some binary functions appear to be in 64-bit and others 32-bit? Doesn't matter really as 16-bit WORDs are probably easier for people to type in anyway, but there was something appealing about storing an entire sprite in one number :-)

      array playerShip [64]
      data = [ 0x99181800, 0xFFFFBD99 ]
      for bit=0 to 64 loop
          v = bitGet( data[floor(bit/32)], bit%32 )
          playerShip[bit] = { v,v,v,v }
      repeat
      
      N 1 Reply Last reply Reply Quote 2
      • M
        MikeDX last edited by

        This is actually really useful for me because I've been inputting hex data as 0xXX, 0xXX etc. Thanks!

        jacobmph 1 Reply Last reply Reply Quote 1
        • N
          Nisse5 F @jacobmph last edited by

          @jacobmph said in Hexadecimal Sprite Data:

          Then if there was a PC conversion tool that would transform graphics files on your PC into data which could be typed into FUZE then that might have some value?

          I made such a tool yesterday (where you can type in XPM files):
          https://fuzearena.com/forum/topic/197/xpm-graphics-converter-transferring-graphics-from-computers-and-other-sources

          Thanks for the tip on the hexadecimal syntax!

          1 Reply Last reply Reply Quote 1
          • jacobmph
            jacobmph last edited by jacobmph

            @Nisse5 Nice! What's it written in? Are you prepared to share your repo?

            N 1 Reply Last reply Reply Quote 1
            • jacobmph
              jacobmph @MikeDX last edited by

              @MikeDX Although I guess you're less likely to get confused about the byte order your way :-)

              1 Reply Last reply Reply Quote 1
              • M
                MikeDX last edited by

                that's true but i am happy to decode in the right order regardless. i had already considered using a string and converting string hex to bytes...

                1 Reply Last reply Reply Quote 0
                • N
                  Nisse5 F @jacobmph last edited by

                  @jacobmph said in Hexadecimal Sprite Data:

                  @Nisse5 Nice! What's it written in? Are you prepared to share your repo?

                  It's in FUZE4Switch. The code is shared on my Switch account.

                  Use any XPM converter on the PC to convert the graphics to XPM files there (XPM is text files).

                  1 Reply Last reply Reply Quote 0
                  • jacobmph
                    jacobmph last edited by

                    Oh I see. Okay I’ll look at knocking up a quick command line tool to output the data in hex when I get a moment. Perhaps some kind of RLE compression might help for larger images. Thanks. Will take a look at your Switch code too.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post