Author Topic: Celtic III Spriting with Hex Code  (Read 5286 times)

0 Members and 2 Guests are viewing this topic.

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Celtic III Spriting with Hex Code
« on: February 13, 2009, 12:47:16 pm »
Updated multiple times due to unexpected problems.
Everything works fine in this version.
I apologize for anyone who may have been following the old version. (it won't crash your calc or anything, just look weird)

Here's a quick "Spriting with Hex Code" tutorial.

Hex code is just a series of numbers and letters 0-9 and A-F.
Each digit is responsible for 4 pixels.
Code: [Select]
X = on (black)
. = off (white)

0 - ....
1 - ...X
2 - ..X.
3 - ..XX
4 - .X..
5 - .X.X
6 - .XX.
7 - .XXX
8 - X...
9 - X..X
A - X.X.
B - X.XX
C - XX..
D - XX.X
E - XXX.
F - XXXX

Here's an example of an S sprite.
In full it's "007C82807C02827C". (look at the digits in the parentheses on the side in order)

Code: [Select]
0 -> . . . . | . . . .    <- 0  (00)
7 -> . X X X | X X . .    <- C  (7C)
8 -> X . . . | . . X .    <- 2  (82)
8 -> X . . . | . . . .    <- 0  (80)
7 -> . X X X | X X . .    <- C  (7C)
0 -> . . . . | . . X .    <- 2  (02)
8 -> X . . . | . . X .    <- 2  (82)
7 -> . X X X | X X . .    <- C  (7C)

Any questions, just ask.
« Last Edit: February 13, 2009, 01:17:30 pm by {AP} »

Offline boot2490

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 607
  • Rating: +54/-36
    • View Profile
    • Boot2490's Stuff
Re: Celtic III Spriting with Hex Code
« Reply #1 on: September 17, 2011, 03:05:14 pm »
So if it is just a string, ("007C82807C02827C") how does it know to make a square image? Lets say I wanted to make a 94 by 62 image like that. How would I? How do you tell it how to form the image?
I'm not worried about SOPA creating censorship, that will not stand for long. I'm worried that they'll succeed in stopping piracy!

Spoiler For Signature, updated march 23, 11:28 PM EST:















An useful tool!

PM me if you need some help. I am glad to be of assistance and part of the TI Communnity.

Offline Geekboy1011

  • The Oneironaut
  • Donator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2031
  • Rating: +119/-2
  • Dream that Awakening dream
    • View Profile
Re: Celtic III Spriting with Hex Code
« Reply #2 on: September 17, 2011, 03:14:00 pm »
HOly necro post

Basically Celtic3 takes the hex value and uses it with a asm sprite routine. the way it reads the string its stored like a actual data for a sprite in memory.


and for that consult the celtic 3 read me its all listed in there ^_^ (i dont have a copy handy sorry :/)

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Celtic III Spriting with Hex Code
« Reply #3 on: September 17, 2011, 03:26:25 pm »
Hehe, nice :) Okay, so I am assuming this is for the identity(5 command? If so, you will need to know how to convert binary to hex which isn't too difficult. Each hex digit is 4 bits or pixels. So for the byte on the screen 01111110, we get  the first pixel off followed by 6 pixels on and then a pixel off. Convert this to hex and you have "7E" as a more compressed form :) However, if you want an easier. If you want to make a sprite that is two bytes wide and 3 pixels tall:

01111111 11111110   = 7F FE
10000000 00000001   = 80 01
01111111 11111110   = 7F FE

So we would use the code "7FFE80017FFE" for the picture :) You can likewise apply this to wider and taller sprites, however for a sprite that large, it is better to just use a picture. You can use the xLIB functions of Celtic 3 to make hacked pictures (I think they are real(3 and real(9)

I hope this helps?

EDIT: I used to code a lot with Celtic 3, so I know I have the readme somewhere on my computer. Hopefully next time I will be able to give a better answer :)