Author Topic: Questions  (Read 4682 times)

0 Members and 1 Guest are viewing this topic.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Questions
« on: September 22, 2010, 02:56:51 pm »
I tried this:
Code: [Select]
.ATEST
ClrHome
For(A,0,5)
    A->{L1+A}/16
    A+5->{L1+A}^16
    Disp {L1+A}/16->Dec,{L1+A}^16->Dec,i       .imaginary i for newline
End

Repeat getKey
End

and expected this:

Code: [Select]
   0    5
    1    6
    2    7
    3    8
    4    9
    5   10

but got this:

Code: [Select]
   0    5
    0    6
    0    7
    0    8
    0    9
    0   10

And I don't like that result.
Help?

Also, what are bitmaps and how do I use them (and the bitmap command(s))?

Edit: added a '->Dec'
« Last Edit: September 22, 2010, 03:07:48 pm by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Questions
« Reply #1 on: September 22, 2010, 03:05:17 pm »
Just so you know you forgot a ►Dec after the {L1+A}^16.
« Last Edit: September 22, 2010, 08:34:37 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Questions
« Reply #2 on: September 22, 2010, 03:08:09 pm »
Thanks, but it still doesn't work...
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Questions
« Reply #3 on: September 22, 2010, 03:09:39 pm »
Ya, I know. I'm looking, though I doubt I'll be the person to figure it out. Just helps to have it all there because someone would've mentioned it.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

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: Questions
« Reply #4 on: September 22, 2010, 03:10:15 pm »
I'll have to look at that code in a little bit, but here's some knowledge on bitmaps.

You have to 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 meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Questions
« Reply #5 on: September 22, 2010, 03:14:21 pm »
Well about the code, I can tell you that it isn't storing them to the half-bytes. It for some reason is just storing them to the full byte I think, that's why only one thing is showing. Or it is storing to the half-byte but then overwriting the first one or something.

If you reverse the storing lines you will end up with the first five instead.
« Last Edit: September 22, 2010, 03:16:05 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Questions
« Reply #6 on: September 22, 2010, 04:09:06 pm »
The problem exists in this code:

Code: [Select]
   A->{L1+A}/16
    A+5->{L1+A}^16

Although {L1+A}/16 and {L1+A}^16 would correctly retrieve the high and low nibbles of a byte if they were on the left side of a value→pointer statement, there is currently no built-in support for storing to nibbles. As of now, you can only store one or two whole bytes at a time. As soon as the parser reads the closing brace around the pointer and sees that the next character is not the r modifier, it would encode this as storing the value to the full byte at L1+A. The calculation would then carry on to /16 or ^16, but as there are no more storing statements after this, these would just be do-nothing calculations. And because the A+5 line operates second, it overwrites any value the previous line wrote to L1+A. A+5 is stored to the byte L1+A, resulting in the first nibble always being 0 because A+5/16 is (for the current domain of A) always 0.

To store two nibbles to a byte at the same time, you could do the following:
Code: [Select]
A*16+A+5→{L₁+A}
Or to store two nibbles to a byte separately, you could do this:
Code: [Select]
.Store high nibble
{L₁+A}^16+(A*16)→{L₁+A}
.Store low nibble
{L₁+A}/16+A+5→{L₁+A}


Or, wait for Axe 0.4.5, which will have built-in nibble support. ;)

« Last Edit: September 22, 2010, 04:15:20 pm by Runer112 »

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: Questions
« Reply #7 on: September 22, 2010, 04:17:25 pm »
.BITMAP

.Data(height,width)→Pic
.[Sprite]

Data(8,8)→Pic1
[3C7EDBFFBDDB663C]

Bitmap(20,10,Pic1)
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

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: Questions
« Reply #8 on: September 22, 2010, 10:48:58 pm »
Or, wait for Axe 0.4.5, which will have built-in nibble support. ;)
I wonder if that'll save us some effort on half-byte tilemapping tile calling? It's not that hard to display a tilemap but I had serious issues making a map editor that fits my needs.