• Features Wishlist 5 1
Currently:  

Author Topic: Features Wishlist  (Read 689974 times)

0 Members and 6 Guests are viewing this topic.

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: Features Wishlist
« Reply #3195 on: June 18, 2013, 05:10:36 pm »
Yeah a BASIC style menu command would be nice actually, since some games focus on small size and gameplay rather than the general interface. I hope that this wouldn't cause an invasion of terrible Axe games and menu-based RPGs, though, like what happened with TI-BASIC, but again most Axe games out there are good (although very large) so maybe people will refrain from posting as much crap on ticalc.org.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Features Wishlist
« Reply #3196 on: June 19, 2013, 01:08:05 am »
Hayleia :
Assuming that each image is 8*8 (thus 8 bytes long) and that x and y go from 0 to tilemap_width-1 and tilemap_height-1 respectively (in number of sprites, not pixels) and X and Y go from 0 to 11 and 7 respectively
Here are your For loops.
And I don't think a Menu( command really is a good idea. I'm afraid that it could make beginners lazy, since they would have a command to do everything.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #3197 on: July 12, 2013, 11:58:29 am »
A prefix version of ++ and -- that returns the in/decremented value instead of the previous one.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline jo-thijs

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +1/-0
    • View Profile
Re: Features Wishlist
« Reply #3198 on: July 12, 2013, 12:24:14 pm »
Can the fill( function be auto opted when the byte it should fill with is a predetermined constant?
And can it be optimised even further if the size is less than 256?
I think it would look like this:
0<size<256:
bytesize: 7
ld b,*
ld(hl),*
inc hl
djnz -5

size>=256
bytesize: 15
xor a
ld bc,**
ld(hl),*
inc hl
djnz -5
ld b,255
dec c
cp c
jr z,-11

and I think the current code has a size of 18 bytes.
I don't know if the code I gave is as optimised as it can be (nor have I tested it yet), but it is smaller.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Features Wishlist
« Reply #3199 on: July 12, 2013, 12:28:01 pm »
Actually this would belong in the optimization thread but it's a good idea indeed.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3200 on: July 12, 2013, 12:57:50 pm »
A prefix version of ++ and -- that returns the in/decremented value instead of the previous one.

As of now, the ++ and -- operators don't actually have defined return values. Technically, any code that does currently use their return values is a hack, and would no longer work if ++ and -- were properly implemented. There are numerous programs that take advantage of the current implementation, and I don't want to break them, at least not for the moment.

I believe the main reason ++ and -- were never set up to properly return the new/old value exactly is for optimization reasons. If they were all fully implemented, VAR++ would be 1 byte larger, VARr++ and {EXPR}++ would be 4 bytes larger, and {EXPR}r++ would be 3 bytes larger. And it's not uncommon that the return value isn't actually needed, so those would be wasted bytes. It was kept in mind that programmers could use the "undefined" return values to get the real return values if they wanted them. For the first two cases, which I believe are the most common, it actually costs the programmer nothing to do this; the assembly implementations would be the same as VAR++-1 for the first and {VARr++}-1 and {{EXPR}++}-1 for the second (pre-increment would be the same as well, just without the -1's). It does get a little hairy with the two-byte pointed increment/decrement, though.

Don't get me wrong, I do eventually want real ++ and -- implementation. However, I would like to save it for when Axe has a more powerful optimizer and can intelligently see if the return value is actually used, and then decide whether to use the smaller undefined return value code or the larger defined return value code.


Can the fill( function be auto opted when the byte it should fill with is a predetermined constant?
And can it be optimised even further if the size is less than 256?
I think it would look like this:
0<size<256:
bytesize: 7
ld b,*
ld(hl),*
inc hl
djnz -5

size>=256
bytesize: 15
xor a
ld bc,**
ld(hl),*
inc hl
djnz -5
ld b,255
dec c
cp c
jr z,-11

and I think the current code has a size of 18 bytes.
I don't know if the code I gave is as optimised as it can be (nor have I tested it yet), but it is smaller.

Fill is absolutely a command I'd like to optimize, and I like your ideas. But on a note related to my response to Freyaday above, Axe's optimizer is unfortunately too simple at the moment to allow for such optimizations. It doesn't provide for any way to supply optimized versions of multiple-input functions for which some set of the inputs are constants.

When Axe gets a more powerful optimization engine, I certainly would like to see things like this added.





I think I'm seeing a theme here... x.x

Offline jo-thijs

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +1/-0
    • View Profile
Re: Features Wishlist
« Reply #3201 on: July 26, 2013, 01:12:44 pm »
I don't know whatever this is possible, but I was thinking about an option where you can precompile a file, so that if it is called by another file that is being compiled, it compiles faster.
so you can precompile everything, except the level design part and then only recompile that for faster testing.

Offline jo-thijs

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +1/-0
    • View Profile
Re: Features Wishlist
« Reply #3202 on: July 26, 2013, 05:18:16 pm »
also, i think I've found a smaller code for ee14 (if it isn't changed already).
now it takes 7 bytes, but it can be done with 6 bytes only too with as code:
xor a
add hl,hl
add hl,hl
ld h,a
rla
ld l,a

I thought I found a better way for ee15 too, but it seems the auto opts file was wrong about that.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3203 on: July 26, 2013, 06:38:36 pm »
I don't know whatever this is possible, but I was thinking about an option where you can precompile a file, so that if it is called by another file that is being compiled, it compiles faster.
so you can precompile everything, except the level design part and then only recompile that for faster testing.

This sounds like a very tricky thing to do. Hopefully it won't really be necessary to consider such aggressive and complicated speed improvements if the base compiling process itself can be made faster.


also, i think I've found a smaller code for ee14 (if it isn't changed already).
now it takes 7 bytes, but it can be done with 6 bytes only too with as code:
xor a
add hl,hl
add hl,hl
ld h,a
rla
ld l,a

I thought I found a better way for ee15 too, but it seems the auto opts file was wrong about that.

That optimization was actually already made a long time ago... I really need to just remove that auto opts file from Axe releases. In fact, I just did it now. It's so old and outdated, and all the information in there and much more can now be found in the Commands.html file.

If you do want to try optimizing Axe routines, the best place to look is probably at the Commands.inc file. There you can see the exact code for each routine and it's always up to date. And if you do spot any optimizations, there's this thread specifically for such posts. :)

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Features Wishlist
« Reply #3204 on: July 27, 2013, 07:41:18 am »
I don't know whatever this is possible, but I was thinking about an option where you can precompile a file, so that if it is called by another file that is being compiled, it compiles faster.
so you can precompile everything, except the level design part and then only recompile that for faster testing.
Using external data and DrDnar's excellent RunPRGM are the best solution for that IMO. ;)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Features Wishlist
« Reply #3205 on: July 27, 2013, 08:31:48 am »
I don't know whatever this is possible, but I was thinking about an option where you can precompile a file, so that if it is called by another file that is being compiled, it compiles faster.
so you can precompile everything, except the level design part and then only recompile that for faster testing.

This sounds like a very tricky thing to do. Hopefully it won't really be necessary to consider such aggressive and complicated speed improvements if the base compiling process itself can be made faster.
I guess that you could have "Compile as Ion,Noshell,...,Include", and the Include (or call it something else if you want) mode would "compile" the source into a program that would only be Asm(<hex>). This way, compiling it again would be faster I guess (no need to think again about optimizations and such, just need to translate directly from alphabetical tokens into true hex). The problem with that is that the code in the include has to be independant.
« Last Edit: July 27, 2013, 08:32:55 am 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 Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Features Wishlist
« Reply #3206 on: July 28, 2013, 04:27:27 am »
I wonder if there could be a command to force a program to be compiled for a certain shell and also constants that give info on the build (machine model, extra RAM or not, shell it's being compiled for...). That would make things a little easier to manage in certain cases (i. e. 15MHz only code or app only code).

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: Features Wishlist
« Reply #3207 on: July 28, 2013, 07:41:48 am »
wait, i just got a good idea....maybe adding like a optional 2nd line header which tells axe for which shell to compile, that way you don't always have to switch from app to noshell when you want to make an appvar.

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

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Features Wishlist
« Reply #3208 on: July 28, 2013, 09:02:40 am »
wait, i just got a good idea....maybe adding like a optional 2nd line header which tells axe for which shell to compile, that way you don't always have to switch from app to noshell when you want to make an appvar.
Exactly what I suggested. x.x
Also an appvar "shell" could be nice.

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: Features Wishlist
« Reply #3209 on: July 28, 2013, 11:25:28 am »
wait, i just got a good idea....maybe adding like a optional 2nd line header which tells axe for which shell to compile, that way you don't always have to switch from app to noshell when you want to make an appvar.
Exactly what I suggested. x.x
I didn't quite catch that x.x
Quote
Also an appvar "shell" could be nice.
Agreed, that way I don't need that few bytes prog on my calc to convert :P

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