Author Topic: Bitmap command  (Read 4471 times)

0 Members and 1 Guest are viewing this topic.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Bitmap command
« on: August 30, 2010, 12:37:08 pm »
Can someone explain to me how to use the Bitmap command. I get the bitmap(x,y...    part. X means x and Y means y. But what about the actual map? How should a filled 6x6 sprite look for that command?

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: Bitmap command
« Reply #1 on: August 30, 2010, 12:53:04 pm »
What you do is use the Data() command and make it so that 6x6 is your width and height.
Then, write your data after that.
Then, Bitmap that Pointer.
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 ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Bitmap command
« Reply #2 on: August 30, 2010, 12:59:57 pm »
But what I'm asking is how should the data look. What would the "rows of that image" look like?

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: Bitmap command
« Reply #3 on: August 30, 2010, 01:04:17 pm »
Code: (Axe BASIC) [Select]
:.BLAH
:Data(6,1->GDB1
:[FFFFFFFFFFFF
:ClrDraw
:Bitmap(1,1,GDB1
« Last Edit: August 30, 2010, 06:24:03 pm by Raylin »
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: Bitmap command
« Reply #4 on: August 30, 2010, 06:12:57 pm »
Code: (General Formula) [Select]
Data(rowsInImage , columnsInImage)->Pic1  .columnsInImage must be a multiple of eight!
[[HEX]]
Bitmap(X,Y,Pic1)


Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Bitmap command
« Reply #5 on: August 30, 2010, 06:33:01 pm »
Actually, you can define the first two bytes of the sprite as the size.

Code: [Select]
.BITMAP
[181000000070009803641E6430127FD254B1192919251035F1DE5E242528DCD6B7F54C5B3ECE1DFC23664E32D42BF81F0000→Pic1
Bitmap(X,Y,Pic1)
The first two bytes are hexadecimal for the height and the width of what you want to display in that order.
The width that you define does not have to be a multiple of 8, but you do have to pad all the rows in your bitmap to the nearest byte.

Be aware that if you use bitmaps in an App, you'll have to copy the bitmap you want to display to saferam or an appvar, then use a pointer to that location to display it.
Code: [Select]
.Bitmap
[181000000070009803641E6430127FD254B1192919251035F1DE5E242528DCD6B7F54C5B3ECE1DFC23664E32D42BF81F0000→Pic1
"appvBITMAP→Str1
GetCalc(Str1,50)→P
Bitmap(X,Y,P)

The examples I posted will display a 16x24 sprite at X,Y.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Bitmap command
« Reply #6 on: August 31, 2010, 05:23:21 am »
can't you read from Archive with Axe? Or is this because of Bitmap is an OS ROMcall, which isn't fully converted to Axe command (jet)?
« Last Edit: August 31, 2010, 05:24:00 am by LordConiupiter »
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Bitmap command
« Reply #7 on: August 31, 2010, 11:05:56 am »
Thank you both. I'll play around an see what I can do.

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: Bitmap command
« Reply #8 on: August 31, 2010, 05:34:40 pm »
If you draw sprites from archive, you will need to follow a few steps.  First have a small reserved place in ram for a very small and very temporary storage such as L5.  Use the copy command to copy the sprite's data to that temporary buffer.  Draw the sprite using that buffer as an argument instead of the file.  You should turn this into a subroutine that does both of these things for you automatically so you only need a single call to draw the sprite.  The exact same procedure should be used with apps as well.  If you're drawing the same sprite multiple times, you can optimize by only copying once and then drawing every instance of that sprite before copying the next sprite to be drawn.
___Axe_Parser___
Today the calculator, tomorrow the world!