Author Topic: Little endian in Axe?  (Read 3542 times)

0 Members and 1 Guest are viewing this topic.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Little endian in Axe?
« on: June 29, 2010, 08:31:25 am »
When you are trying to display a sprite that is bigger than 8x8 and you are reading two bytes at a time, does that mean that the data needs to be reversed or something?
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Little endian in Axe?
« Reply #1 on: June 29, 2010, 10:46:58 am »
what exactly are you trying to do? why are you reading two bytes at a time? i think it's generally done with 4 8x8 sprites conjoined to make 16x16 (or whatever size measure yours is). i'm not sure how you would draw a sprite by reading two bytes at a time. you would need to use modulus and division by a number (16?) to get each byte separated. i'm not completely sure though. i'll play around with this.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Little endian in Axe?
« Reply #2 on: June 29, 2010, 11:28:15 am »
(Btw sorry if this is off-topic, but Nemo, thank you a lot in your post for at least making it clear you are curious what he wants to do. In the past on other calc forums, especially MaxCoderz, when someone asked a question where he is doing something new or close, he often got told "Why do you want to do that?" as sole response, as if he was not allowed to do anything unconventional. Way to allow the community to innovate. At least you did not do that and I appreciate it and gave you +1 for this post. Other people elsewhere should follow example.)

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Little endian in Axe?
« Reply #3 on: June 29, 2010, 03:29:53 pm »
Basically, if you were to display a sprite on the screen...
Gah. I can't say it without repeating myself.
Quigibo?
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Little endian in Axe?
« Reply #4 on: June 29, 2010, 03:30:49 pm »
Little endian is only for reading and writing 2 bytes at a time.  Almost every sprite drawing routine I've ever seen reads 1 byte at a time so you will never have this problem.  In the rare cases where a routine reads 2 bytes at a time like for instance drawing an aligned 16x16 sprite super quickly, sometimes the programmer will compensate the reversing effect for you.  If they don't they would surely mention that the bytes should be reversed.
___Axe_Parser___
Today the calculator, tomorrow the world!