Author Topic: Axe Parser Picture Issues  (Read 7928 times)

0 Members and 2 Guests are viewing this topic.

Offline waggyner

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +0/-0
    • View Profile
Axe Parser Picture Issues
« on: June 21, 2014, 05:43:45 pm »

I'm trying to make a game and I know I'm going to need more than the 10 pictures the calculator offers me so I thought if I convert the whole pic into hex and then display it, it would work.


Well its not working. The calculator is only graphic half the image and parts are messed up. I know my hex code is correct and I'm pretty sure the way I've set it up to display is correct so I don't know what the problem is.


I've include my source code and what the pic is suppose to look like if it was successful. Please help me out.
If you know a better way please give me an example and don't just say how to do it. Thanks

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Axe Parser Picture Issues
« Reply #1 on: June 21, 2014, 06:04:17 pm »
Have you tried http://www.cemetech.net/sc/? You can upload a picture and then convert it into hex.


edit: look at this example program I've made for you.
« Last Edit: June 21, 2014, 06:15:05 pm by ClrDraw »
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline waggyner

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +0/-0
    • View Profile
Re: Axe Parser Picture Issues
« Reply #2 on: June 21, 2014, 09:57:33 pm »

Thanks for the help. I didn't know how to use the bitmap command.
It now draws the picture correctly but it has a lot of random shading at the top and a few pixels at the bottom that are not in the hex.
Is there a problem with Axe and outputting for DoorsCS?


I attached the new code as well.

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Axe Parser Picture Issues
« Reply #3 on: June 21, 2014, 11:11:28 pm »
Anytime :)

As for the shading, it works when I try. Maybe you forgot ClrDraw (my favorite command  :P )?
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Parser Picture Issues
« Reply #4 on: June 22, 2014, 04:20:03 am »
Axe is not Basic. Here's the source code, in spoiler, for those who wonder why I am saying that.

Spoiler For Spoiler:

.TEMPLE
Goto 1

Lbl 2

ClrDraw

Bitmap(0,0,Pic1)
Bitmap(0,0,Pic2)^^r

DispGraph
Repeat getKey(15)
DispGraph^^r
End

Goto 3

Lbl 1

.black
Data(96,64)->Pic1
[long hex]

.gray
Data(96,64)->Pic2
[long hex]
Goto 2

Lbl 3

For example, this Data(96,64)→Pic2 is NOT storing numbers into a variable. This is declaring to the PARSER that the pointer to those numbers who are somewhere in the program whill be called Pic2 until the end of the program.
This means that you don't need your Lbl 1, Goto 2 and caetera. Just put your pic declarations either at the beginning of your program or at the end (after the final Return) or in the middle, it doesn't change anything (putting it at the end helps you reaching the code when you open your program, putting it at the beginning helps you not forgetting what is what and putting it in the middle helps you know which data is used for which part of the code).
But wherever you put it in your source code, they will be put at the end of the compiled executable so your code will be compiled exactly like this one:


.TEMPLE
Goto 1

Lbl 2

ClrDraw

Bitmap(0,0,Pic1)
Bitmap(0,0,Pic2)^^r

DispGraph
Repeat getKey(15)
DispGraph^^r
End

Goto 3
Lbl 1
Goto 2
Lbl 3
Return

.black
Data(96,64)->Pic1
[long hex]

.gray
Data(96,64)->Pic2
[long hex]



Don't you think now that your Goto 1 then Goto 2 to go back at the beginning are useless ? Same for your Goto 3 ? And even with your original code, the Goto 3 was not so useful, you could have put a Return instead it would have worked too.

Now about your code. You are basically filling the two buffers, so why use Bitmap ? Copy your bytes directly in your buffers instead of wasting space for a routine you use for no big reason. Even worse. Why that DispGraph before the loop with the DispGraph^^r ?

And I would talk about basic optimizations, but this will come later ;)

So yeah, just do this:


.TEMPLE
.black
[]->Pic1
[long hex]

.gray
[]->Pic2
[long hex]

.once again, you can put those declarations elsewhere if you want

Copy(Pic1,L6,768)
Copy(Pic2,L3,768)

Repeat getKey(15)
   DispGraph^^r
End
Return
.the Return is not useful if at the end of the program but it's still good to be used to tell the program exactly what we want it to do and not suppose that it will work.


And since you are completely replacing all previous content in L6 and L3 by copying and not Bitmapping, you don't even need any ClrDraw.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Axe Parser Picture Issues
« Reply #5 on: June 22, 2014, 07:06:00 am »
By the way, avoid bitmap as much as possible.

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Axe Parser Picture Issues
« Reply #6 on: June 22, 2014, 12:28:49 pm »
Why?  ???
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Axe Parser Picture Issues
« Reply #7 on: June 22, 2014, 01:48:50 pm »
IIRC it is slow and large
EDIT: I still used bitmap in reubenquest, though :P

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: Axe Parser Picture Issues
« Reply #8 on: June 22, 2014, 02:07:53 pm »
Can't you do:
Code: [Select]
Copy(Pic1)

[long hex]->Pic1

instead of:
Code: [Select]
Bitmap(0,0,Pic1)

Data(96,64)->Pic1
[long hex]
iirc it's much more optimized.
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Parser Picture Issues
« Reply #9 on: June 22, 2014, 02:08:51 pm »
Where you like "tl;dr" when you saw my post ? Because I am exactly saying that Copy is better :P
« Last Edit: June 22, 2014, 02:10:22 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: Axe Parser Picture Issues
« Reply #10 on: June 22, 2014, 02:13:32 pm »
Oh, apparently I did miss a huge part of your post. But you should be able to just use Copy(PTR_to_pic) and Copy(PTR_to_pic,L3) for the black and grey layers respectively.
But it probably compiles into the exact same binary as your code.
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Parser Picture Issues
« Reply #11 on: June 22, 2014, 02:15:16 pm »
Yeah, it's the same. I just like to know exactly where and how many bytes I am copying so I always give the three arguments ;)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser Picture Issues
« Reply #12 on: June 22, 2014, 04:43:52 pm »
Yeah, it's the same. I just like to know exactly where and how many bytes I am copying so I always give the three arguments ;)

I like this syntax more as well. The copy command can copy any kind of data and doesn't seem like it has much business performing buffer-specific logic. The one-argument version is exactly the same as the much more appropriately named and categorized RecallPic, and the two-argument version could just be a two-argument RecallPic or StorePic. For those reasons, I've actually had ideas of simply removing them.
« Last Edit: June 22, 2014, 04:49:48 pm by Runer112 »

Offline waggyner

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +0/-0
    • View Profile
Re: Axe Parser Picture Issues
« Reply #13 on: June 22, 2014, 07:50:54 pm »
Thank you all for your help. I finally have the picture displaying correctly. ;D

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Axe Parser Picture Issues
« Reply #14 on: June 23, 2014, 04:04:54 am »
Where you like "tl;dr" when you saw my post ? Because I am exactly saying that Copy is better :P
Hum. ::)