• Features Wishlist 5 1
Currently:  

Author Topic: Features Wishlist  (Read 695322 times)

0 Members and 2 Guests are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #1155 on: September 07, 2010, 07:00:55 pm »
That could be made more generic :)
Perhaps something like EXPR!#, where EXPR is any expression, ! is the factorial symbol, and # is a constant or variable between 0 and 3 indicating what nibble.

You could always use ^ and / ;)

But it might be a good idea to make things clearer. Maybe [PTR].[NUM], since periods aren't really used right now? It would make sense, anyway, since it kinda means a part of the number.




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Features Wishlist
« Reply #1156 on: September 07, 2010, 07:13:25 pm »
I think it would be useful only if it was the variable part?  Since if it was constant, using / or ^ would be a bit easier.  Using it as a variable could be useful for half byte tilemapping

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #1157 on: September 07, 2010, 07:26:59 pm »
And even if it were a variable, / and ^ are pretty easy to use. For the high nibble, it's [EXP]^16, and for the low one, it's [EXP]/16. I think the original idea, though, was to make one that would be easier for two-byte numbers, since to get the low nibble of the high byte of A, it would be A^256/16 now. The only reason I can see of adding such a command would be to make things easier to figure out :P
« Last Edit: September 07, 2010, 07:27:30 pm by Deep Thought »




Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Features Wishlist
« Reply #1158 on: September 07, 2010, 08:19:33 pm »
I think it would be useful only if it was the variable part?  Since if it was constant, using / or ^ would be a bit easier.  Using it as a variable could be useful for half byte tilemapping
Exactly. You can't really have something that returns the upper nibble if X is 0 and the lower if X is 1 inline in an expression, can you? ;D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

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: Features Wishlist
« Reply #1159 on: September 07, 2010, 08:48:29 pm »
What about an alternative half byte referencing command?  I imagine that's what it would generally be used for anyway, so just take out the middle man.

Say I call this command nib{} which uses angle brackets like int{} since it's a referencing command.

[C0FFEE123456]->Str1
nib{Str1*2}   .returns C (12 in decimal)
nib{Str1*2+1} .returns 0
nib{Str1*2+2} .returns F (15 in decimal)
nib{Str1*2+N} .returns the Nth nibble in memory


The only strange thing you might notice about this is that the pointer has to be multiplied by 2.  That's because wherever it points to is in bytes so if the pointer is at the 100th byte, it is actually at the 200th nibble.  That's done during compile time in this case so its not going to increase program size or anything.  But now there are 131,072 (2^17) possible addresses, and so that means you can only use this command for half of the memory.  Ram is in $8000-$FFFF which is exactly the range needed.  However that would suck for apps because they need the other half from $0000-$7FFF.  To remedy this, there would be 2 commands, one for programs/ram/archive and one for apps.  So nib{} and nib{}r would work.

Would this be suitable?

EDIT: Oh, there could also be a store-to version for ram, like 5->nib{Str1*2+2} for instance.
« Last Edit: September 07, 2010, 09:14:24 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Features Wishlist
« Reply #1160 on: September 07, 2010, 09:14:00 pm »
That sounds like it'd work nicely :)
I say go do it! :D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #1161 on: September 07, 2010, 10:08:49 pm »
Yep, that'd be great. What token will this replace?




Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #1162 on: September 07, 2010, 10:10:23 pm »
Any chance of grayscale routines that play nicely with interrupts? I don't really mind if they're slower. Slower but more regular is better as far as I'm concerned.

Edit: Perhaps this could be implemented with a toggle in the Axe options menu? There must be grayscale routines out there that don't kill interrupts, right? Maybe just grab one that looks decent, tweak it a little bit for Axe, and (hopefully) not have to work too much on it.
« Last Edit: September 07, 2010, 10:51:42 pm by Runer112 »

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Features Wishlist
« Reply #1163 on: September 07, 2010, 10:10:44 pm »
What about iPart(? It's in the math menu near float{ and whatnot.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

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 #1164 on: September 07, 2010, 10:15:28 pm »
A nibble command would be nice. It would make it much easier to deal with half-byte tilemappers, especially those who have an harder time being experienced with Axe.

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: Features Wishlist
« Reply #1165 on: September 08, 2010, 12:34:33 am »
@Runner, yes, I fixed that now.  I decided to keep the grayscale routine unchanged since that is most critical and just change the interrupt routine to push and pop the af register pair instead of saving it to a shadow register.  Its exactly the same size as before now and unnoticeably slower.

Just an fyi to all you asm programmers, I was able to save one byte from each call to Copy(), Fill() and Exch() using an optimization I hadn't considered before.
Code: [Select]
this:
  ld   b,h
  ld   c,l
  pop  hl

can become:
  ex   (sp),hl
  pop  bc

Its slightly slower, but its one byte less.

Oh, and I finally took care of another request: dereferencing.  The routine actually already existed so I only had to add about 6 lines of code.  The new syntax for that is the degree sign followed by the variable and it will return the variable's address.  For those familiar with C, its identical to the &.

A        Returns the variable A
{A}r     Returns what A points to
oA       Returns the address of A
{oA}r    Identical to the first example

So I don't want to see anymore of that {L1-52} nonsense and no one has any excuse for being mad if I change where the variables are in the future.  This works with all variable types including files and the subroutine variables.  Also, don't forget that any dereferenced variable is a constant address just like the L1-L6 addresses so any math you do to it is done during compile time for extra optimization.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Features Wishlist
« Reply #1166 on: September 08, 2010, 12:39:50 am »
Nice to see address-of! Very handy, I've been wanting that for a while.
The size optimizations are nice too.
Keep up the good work! :D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Features Wishlist
« Reply #1167 on: September 08, 2010, 12:58:55 am »
I am perfectly happy with the dereferencing :) as long as they stay in the same order ;D and awesome on the optimization!

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 #1168 on: September 08, 2010, 01:03:41 am »
It should be fine with me too. I only use those variables the regular way personally (1->A for example).

Also I like the address command and optimizings. Nice job as always Quigibo.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #1169 on: September 08, 2010, 08:00:15 pm »
Addresses! That'll be useful. No more subtracting from L1 :)