Author Topic: Pictures, etc.  (Read 5342 times)

0 Members and 1 Guest are viewing this topic.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Pictures, etc.
« on: September 11, 2011, 06:06:33 pm »
Is it possible to display pic and sprites same time?
Also, why can't I do Data(variable, number, number, etc) ?
Sig wipe!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Pictures, etc.
« Reply #1 on: September 11, 2011, 06:14:25 pm »
You can copy a picture to a buffer and then draw whatever you want on top of it. Just copy the picture data to the buffer every frame before drawing anything else with code like this:

Code: [Select]
Copy([Pic1],L₆,768)


And you can't include the value of a variable in a data declaration because all the data is added to the program at compile time, whereas variables only have meaningful values at run time. If you must include a variable in a list of data, you can do something like the following:

Code: [Select]
Data(0,number,number,etc)→GDB0
variable→{GDB0}
« Last Edit: September 11, 2011, 06:15:03 pm by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Pictures, etc.
« Reply #2 on: September 11, 2011, 06:14:44 pm »
What do you mean by displaying a picture and a sprite at the same time?  Do you mean display a sprite over a picture?

And you can't use variables in the Data() command, because the Data is inserted at compile time, NOT when the program is running, so all of the numbers have to be constant

EDIT: Ninja'd :P

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Pictures, etc.
« Reply #3 on: September 11, 2011, 06:17:51 pm »
i meant to display sprite over a pic.
I managed to draw a pic over sprite, but not vice versa
Sig wipe!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Pictures, etc.
« Reply #4 on: September 11, 2011, 06:18:55 pm »
If you just follow Runers' instructions, that should work for you.  Just remember to draw the picture before you draw the sprite

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Pictures, etc.
« Reply #5 on: September 11, 2011, 06:20:36 pm »
so do like:
Code: [Select]
Copy([Pic1],L6,768]
-Displaying Sprites-
DispGraph
this?
Sig wipe!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Pictures, etc.
« Reply #6 on: September 11, 2011, 06:22:58 pm »
yep, that's it :) You could also store your picture into L3, that way instead of typing Copy([Pic1],L6,768) you can just enter RecallPic

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Pictures, etc.
« Reply #7 on: September 12, 2011, 07:03:40 am »
Erm another question XP
I got stuck here..It just won't work

Code: [Select]
.Making AppData with pics
[Pic1]->Str1
GetCalc("appvSIL001",768)->A
Str1->A

Code: [Select]
.Using AppData here
...codes
GetCalc("appvSIL001", Y[sub]1[/sub])
...codes
Copy(Y[sub]1[/sub],L[sub]6[/sub],768)
...codes
DispGraph

Somehow it doesn't work for me. Does anyone know why?
Sig wipe!

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Pictures, etc.
« Reply #8 on: September 12, 2011, 12:05:14 pm »
Your problem is the Str1->A line. That just stores the address of Str1 into the A variable. I think what you meant to do is Copy(Str1,A,768).
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Pictures, etc.
« Reply #9 on: September 12, 2011, 12:08:18 pm »
Oh, thank you.
then what's the difference of just storing and Copy() ?
Sig wipe!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Pictures, etc.
« Reply #10 on: September 12, 2011, 01:43:53 pm »
A is what's known as a pointer.  No matter what you do to A, it will just be a number from 0 to 65536 and nothing more.  Storing to A will do nothing but change A to be a number from 0 to 65536. 

The calculator has lots of RAM, and each piece of RAM has what's known as an Address.  That is, each byte has a number associated with it.  If you are talking about the 5th byte of RAM, the address of that RAM would be 5.  If you are talking about the 3475th byte of RAM, your address would be 3475.  What GetCalc does, is it finds the specific byte of RAM where your appvar starts, and returns it's address.  If you GetCalc("vM")->A, and if A now holds 57, that means that your appvar starts at the 57th byte of RAM.  Now, if you store to A, 8383->A, you arn't doing anything to the 57th byte of RAM, you are storing 8383 into A.  If you want to store into the byte of RAM *at* A, you use the copy command, or the brackets {A}.  These commands will use A as a location, and modify the RAM at that location instead of the variable itself.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Pictures, etc.
« Reply #11 on: September 12, 2011, 03:00:01 pm »
ah, ok. Thanks for the explanation.
Sig wipe!

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Pictures, etc.
« Reply #12 on: September 12, 2011, 10:49:13 pm »
Also keep in mind that:

5->A

^^stores 5 in variable A

Copy(Y1,L6,768)

^^copies 768 consecutive bytes of data, starting at Y1 (your archive location) into L6, the display buffer.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)