• Features Wishlist 5 1
Currently:  

Author Topic: Features Wishlist  (Read 704476 times)

0 Members and 3 Guests are viewing this topic.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Features Wishlist
« Reply #3330 on: August 01, 2014, 11:06:42 am »
Nevertheless, it's always better (for the speed and for the program's size) to have the exact function needed. See spoiler.
In my opinion, Axe is some kind of ASM helper. As in you use it to make ASM programs without necessarily always writing ASM. Which means that when you absolutely need speed, you use Asm() (which is what you mentionned in your other post, and what I did in AudaciTI). And as in you make programs in Axe and optimize them until you know how everything works on the ASM side, then you can switch to ASM.

That works the other way round to for the first "As in", as in you use ASM when you can't use Axe. In other words, they are fellow languages that can be used together.

But what you say here it completely true for pure Axe programmers.

By the way, Robbox seems to be a good game :) I'll try it.
Erm, it is not finished yet so you'll probably be disappointed :P
I should get the same horizontal scrolling as the one I used in Flappy Bird btw, without white colums on the sides.

Also, sorry for forgetting my duty.
Welcome to Omnimaga Zemmargorp.
You can introduce yourself here if you didn't already :)
« Last Edit: August 01, 2014, 11:09:22 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 Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: Features Wishlist
« Reply #3331 on: August 01, 2014, 11:28:44 am »


But what you say here it completely true for pure Axe programmers.
That's why I suggested to add these new drawing functions. We're in "Features Wishlist", after all !


Erm, it is not finished yet so you'll probably be disappointed  :P
No, it's really good ! I'm used to starting writing new programs and never finishing them (unfortunately !), and Robbox is a good game, even if it's not finished.


Also, sorry for forgetting my duty.
Welcome to Omnimaga Zemmargorp.
You can introduce yourself here if you didn't already  :)
That's fine :) And thank you, Hayleia !
No, I didn't do it, but I don't intend to do it.


By the way, I apologize to everybody for the two lasts messages I posted, which had nothing to do with this topic  ;D  !
I'm french, that's the reason why my English can be a bit approximate.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3332 on: August 01, 2014, 12:03:45 pm »
Hi ! I've been using Axe for one year now (since version 1.0.0), and I love it !
It's way much faster than TI-Basic, and it's even easier to use ! Thanks for making Axe Parser !
I have some little ideas to improve it... Here's my contribution !

Thanks for the praise! It's always nice to occasionally be reminded that Axe is appreciated. And it's great to see you have such an interest in it that you're already coming with suggestions backed by assembly knowledge.

First of all, Axe Parser should check if there's any backup kept in RAM and either 1] show it in the "Compile" list or 2] ask to archive it. Because one day, just after compiling, it asked me for "Garbage Collect" like it does sometimes, and I answered "no" by mistake. I then thought my source was lost, because the source program was removed and its backup wasn't shown in the compile list (as it wasn't archived). I spent one hour to write the full source code again from memory, beause I didn't know the backup was kept in RAM !

Weird... backups in RAM indeed aren't displayed in the list. I've made a note to fix that.

I have an idea to improve the drawing functions... I think that games made with Axe Parser are sometimes slow, especially when they use grayscale graphics on a TI-83+, without the "Full" mode. So why not adding new drawing functions like "Pt-On(", "Pt-Off(", etc. but wich draws sprites only on full bytes of the buffer, each 8 pixels, for 0<=X<=11 ? These functions could be accessed by adding a letter to the other drawing functions' name, "C" for example (stands for "column" and "clipped"), and could be named "CPt-On(", "CPt-Off(", "CPt-Change(", "CPt-Mask(", "CPt-Get("... Also, you could add "CHorizontal +/-" and "CVertical +/-" to move the screen by 8 pixels. I wrote all these drawing functions in assembly if you want (although they may not be fully optimised).

I did a quick analysis of the sprite routines, and the amount of extra time they spend compared to aligned routines is actually not that much. The clipping code is pretty good about finishing fast if no work needs to be done, and if the x coordinate is a multiple of 8, the code switches to an aligned output code path with no rotates and such. My quick estimate suggests that the total overhead when drawing aligned sprites is only about 15-20%, which, to me, doesn't warrant adding entirely new versions of all the sprite commands. There are other contributing factors as well; they'd probably only be used by a handful of more advanced coders, and they would take up a lot of extra space in the application, which is already severely lacking.

Functions to shift the screen by more than one pixel at a time have definitely been on my to-do list for a while. But, like with the sprite situation, I think I'd prefer a general unaligned routine that's more capable and appealing to the average coder, but which uses a faster code path for aligned shifts. I should really start working down the to-do list, it's massive...

And to improve the datas, I think it could be great if we were able to make datas with binary values. To differentiate them with hexadecimal values, you could add the prefix "pi" to the data, like "pi[0101101010011001]->GDB1".

Hayleia answered this one pretty well already. Although not quite as compact as a blob of binary digits, Data(π01011010,π10011001) would provide this functionality. If you're entering binary data, you probably already aren't too worried about compactness, anyways.

I imagined others features and functions, but they will be much more complicated to do...

Shoot. :P

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: Features Wishlist
« Reply #3333 on: August 01, 2014, 12:53:21 pm »

Thanks, Runer112 ! So here's the complicated stuff I thought about...


First, you should add a command (and maybe associate it with the "Prompt" token) which inputs a number, because it's useful and a lot of people need this ! Probably use the "input" command, and then parse the returned string to convert it into a 2-byte number. You can make it able to convert the number into a float. For example, the command's syntax could be "Prompt A" to get a 2-byte number, and "Prompt float{A}" to get a float number located at the address pointed by A.


Talking about float numbers, here's another idea : it could be great to add the support in Axe of float numbers, by using the OS's bcalls. The tokens could be Axe's regular math tokens, with a dot just after, and the values would be located at the addresses pointed by the variables. For example, "A*.B->.C" would be compiled liked "Copy(A, OP1, 9):Copy(B, OP2, 9):bcall(FPMult):Copy(OP1, C, 9)". But maybe use the bcalls Mov9ToOP1/OP2 instead of Copy(VAR, OP1/OP2, 9).


I've discovered there's an Axiom that allows this kind of manipulation with the OS's float variables, but it would be better to have it the way I described it, without having to use the OS's variables. Because it leads to creating the variables if they do not exists, looking in the VAT for the variable's address, and lose time. It's better if we use adresses of free memory for temporary calculations (in safe RAM areas, for example) and it's even better because it doesn't modify the OS's variables, if the calculator's owners stored important data inside them. It makes me thinking that it would be great to have a way to allocate/deallocate memory to a program, like "GetCalc(" does, but without having to specify a variable name, only the size needed.


And, talking about memory, why not also add a way to save the program's self changes from $9D95 to the compiled program ? It can be usefull for people developping games, instead of using an appvar only for the two bytes of the best score !


And I kept the best for the end : to implement a "Menu(" function, by using the OS's DIALOG bcalls ! I know you probably already thought of it, and it may be very complicated, but it's an important and so useful command ! I saw an amazing use of these bcalls in Brandonw's calcstuff, in the compressed folder "ddemo.zip", described in "dialogNotes.txt"... But it would be great to have at least the equivalent of the TI-Basic "Menu(" command.
I'm french, that's the reason why my English can be a bit approximate.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Features Wishlist
« Reply #3334 on: August 01, 2014, 01:02:02 pm »
And, talking about memory, why not also add a way to save the program's self changes from $9D95 to the compiled program ? It can be usefull for people developping games, instead of using an appvar only for the two bytes of the best score !
If you use a smart shell that supports writeback, which is I guess the case for most people playing ASM games, you don't need to worry about making your program do that writeback itself ;)
A lot of Axe programs use writeback for saving, they don't all use appvars.

And I kept the best for the end : to implement a "Menu(" function, by using the OS's DIALOG bcalls ! I know you probably already thought of it, and it may be very complicated, but it's an important and so useful command ! I saw an amazing use of these bcalls in Brandonw's calcstuff, in the compressed folder "ddemo.zip", described in "dialogNotes.txt"... But it would be great to have at least the equivalent of the TI-Basic "Menu(" command.
I think the problem is not that it is complicated, but more that it is a good learning experience for beginners to make their own menus, and not a good experience for non beginners to have an ugly menu in their program when they can have an awesome wheel such as that in TinyCraft :P
But it's true that for debugging purposes at least, having a "fast" menu command would be great :)
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 Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: Features Wishlist
« Reply #3335 on: August 01, 2014, 01:39:17 pm »
If you use a smart shell that supports writeback, which is I guess the case for most people playing ASM games, you don't need to worry about making your program do that writeback itself  ;)
A lot of Axe programs use writeback for saving, they don't all use appvars.
Yes, but the game should always be able to save the score, even for people who don't have a smart shell ! And a shell that automatically saves the program's changes can also save other data that has been modified and shouldn't be saved back !

I think the problem is not that it is complicated, but more that it is a good learning experience for beginners to make their own menus, and not a good experience for non beginners to have an ugly menu in their program when they can have an awesome wheel such as that in TinyCraft  :P
But it's true that for debugging purposes at least, having a "fast" menu command would be great  :)
Well, it depends ! It would be very complicated to implement in Axe a way to add menus (using the OS's bcalls) like Brandown did in assembly : seriously, try his program (or see it working), it's amazing ! I agree with you, it's a good experience for beginners to learn how to make a menu, but it would be better to be able to make menus faster in little projects ! And personally, I like the TI default's menu style and his simple design. Obviously, for big games, nice menus are an important point.

And I forgot to talk about another feature I thought about. In some cases, it could be useful to have Axe's variables located in a specified data, to save/load default values easily with the "Copy(" command. I think the syntax "[X Y S ]rGDB0" is great. And it could allow the programmer to add customs variables, with two-letters name : if he writes "[XpYpXeYe]rGDB0", he could then use the additional variables Xp, Yp, Xe, and Ye. (It's not that 27 variables are not enough, it's rather that I prefer to use variables with a name that evokes me something, and sometimes I need several variables to memorize X and Y coordinates !)
EDIT : It is already possible, by doing "ADDR°NAME".
« Last Edit: August 01, 2014, 04:52:42 pm by Zemmargorp »
I'm french, that's the reason why my English can be a bit approximate.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3336 on: August 01, 2014, 02:42:05 pm »
First, you should add a command (and maybe associate it with the "Prompt" token) which inputs a number, because it's useful and a lot of people need this ! Probably use the "input" command, and then parse the returned string to convert it into a 2-byte number. You can make it able to convert the number into a float. For example, the command's syntax could be "Prompt A" to get a 2-byte number, and "Prompt float{A}" to get a float number located at the address pointed by A.

I'm hesitant to add built-in input routines because there are so many formats in which a programmer may expect their input: decimal/hexadecimal, signed/unsigned, integer/float, home/graph screen, maximum number of digits... it goes on. Many of these would require a fair amount of custom code not provided by the OS. I already don't like the existing input command because it's very non-ideal, clearing the entire home screen, reading in tokens rather than characters, and not allowing any sort of keypress-time validation (for instance, only allowing digits to be entered for a number). So input is something I figure is best left to the programmer, who knows exactly what they want and how they want it to be input... Unless you know how to remedy my woes with input, in which case I'd love to include some more powerful default input commands that are mildly robust and programmer- and user-friendly.

Talking about float numbers, here's another idea : it could be great to add the support in Axe of float numbers, by using the OS's bcalls. The tokens could be Axe's regular math tokens, with a dot just after, and the values would be located at the addresses pointed by the variables. For example, "A*.B->.C" would be compiled liked "Copy(A, OP1, 9):Copy(B, OP2, 9):bcall(FPMult):Copy(OP1, C, 9)". But maybe use the bcalls Mov9ToOP1/OP2 instead of Copy(VAR, OP1/OP2, 9).


I've discovered there's an Axiom that allows this kind of manipulation with the OS's float variables, but it would be better to have it the way I described it, without having to use the OS's variables. Because it leads to creating the variables if they do not exists, looking in the VAT for the variable's address, and lose time. It's better if we use adresses of free memory for temporary calculations (in safe RAM areas, for example) and it's even better because it doesn't modify the OS's variables, if the calculator's owners stored important data inside them. It makes me thinking that it would be great to have a way to allocate/deallocate memory to a program, like "GetCalc(" does, but without having to specify a variable name, only the size needed.

I absolutely agree that Axe could use floating point support. But if I'm going to add it, I'm going to do it right. That means growing out of the everything-is-a-16-bit-integer system and providing actual types. So for now, ugly Axioms will have to suffice. But if and when Axe 2.0 comes out, this will be included.

And, talking about memory, why not also add a way to save the program's self changes from $9D95 to the compiled program ? It can be usefull for people developping games, instead of using an appvar only for the two bytes of the best score !

If a program is in RAM when it is executed, it will simply be moved to $9D95, executed, and then moved back. So any changes made to the program during execution will be persisted because they were written directly to the sole copy of the program.

If a program is in archive when it is executed, then it must have been executed by a shell or something similar that either unarchived or copied the program to RAM. If it was unarchived, then just like normally running a program from RAM, writeback is implicit. If it was copied, then writeback must be performed by deleting the original and archiving the copy, which I believe is done by all shells that use this method.

So no matter how you execute a program, writeback should occur. In fact, the only problem should sometimes be preventing writeback rather than providing it. But this is something unavoidable that the programmer has to work around. Generally, the appropriate thing to do with data that you don't want to be written back is to locate it in RAM outside of your program.

And I kept the best for the end : to implement a "Menu(" function, by using the OS's DIALOG bcalls ! I know you probably already thought of it, and it may be very complicated, but it's an important and so useful command ! I saw an amazing use of these bcalls in Brandonw's calcstuff, in the compressed folder "ddemo.zip", described in "dialogNotes.txt"... But it would be great to have at least the equivalent of the TI-Basic "Menu(" command.

I'd love for this to exist as well. I just have absolutely no clue how the OS dialog/menu system works, so have been unable to try to add it myself. If you think you know enough about it to be able to contribute this feature, that would be awesome.

And I forgot to talk about another feature I thought about. In some cases, it could be useful to have Axe's variables located in a specified data, to save/load default values easily with the "Copy(" command. I think the syntax "[X Y S ]r->GDB0" is great. And it could allow the programmer to add customs variables, with two-letters name : if he writes "[XpYpXeYe]r->GDB0", he could then use the additional variables Xp, Yp, Xe, and Ye. (It's not that 27 variables are not enough, it's rather that I prefer to use variables with a name that evokes me something, and sometimes I need several variables to memorize X and Y coordinates !)

Axe's letter variables are stored in contiguous memory in alphabetical order, and you can retrieve the address of any variable with the °A syntax. So reading/storing contiguous variable values in bulk is absolutely possible. Perhaps I could think if there's some easy way to enable the default one-letter variables to be relocated so that variables not in contiguous alphabetical order can occupy contiguous memory, but it doesn't seem like a high priority to me. Especially because you can locate variables with non-contiguous names in contiguous memory by reading on.

Custom named variables were one of the biggest additions in Axe 1.0.0, and have as such been around for quite a while. Just as you use the °VAR syntax to retrieve the address of a variable, you use the addr→°VAR syntax to "store" a constant address of a variable so that VAR is then a variable that exists at the constant address addr. This same syntax is also Axe's mechanism for defining constants; store a constant value as the "address" of a "variable," and just read back the "address" in your code, never using it as an actual variable. However, note that, because of weird internal compiler reasons, the constant address cannot be a reference to a data section inside your program.
« Last Edit: August 01, 2014, 03:39:24 pm by Runer112 »

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: Features Wishlist
« Reply #3337 on: August 01, 2014, 03:57:01 pm »
Unless you know how to remedy my woes with input, in which case I'd love to include some more powerful default input commands that are mildly robust and programmer- and user-friendly.
Sorry to get your hopes up, but that's not the case ! However, if one day someone finds easily how to create custom menus, it would be interesting if somebody else could make an input function which accepts these custom menus while the user enter the data. (But there's a lot of conditions in this last sentence...)

I absolutely agree that Axe could use floating point support. But if I'm going to add it, I'm going to do it right. That means growing out of the everything-is-a-16-bit-integer system and providing actual types. So for now, ugly Axioms will have to suffice. But if and when Axe 2.0 comes out, this will be included.

In fact, it raises a big question : should Axe become closer to TI-Basic with floating point maths, or should it stay closer to assembly and 16/8 bits maths ? Both cases are interesting, it depends what kind of program people make. But for beginners, being forced to use 16-bit is a good thing, because otherwise they would keep using floating point maths where they could use 16-bits maths, it wouldn't be optimized, and Axe would become a sort of TI-Basic II.

If a program is in RAM when it is executed, it will simply be moved to $9D95, executed, and then moved back.So no matter how you execute a program, writeback should occur. In fact, the only problem should sometimes be preventing writeback rather than providing it.

No, without any shell, it's not the case ! Even if the program is stored in RAM ! Personnally, I use Noshell on my TI-83+ (OS 1.19), and I tried a little program "{GDB0}++:Disp {GDB0}>Dec,i", and the output is always the same ! But maybe, yeah, as a lot of people are using shells with the write-back option enabled, they face the opposite problem (which is easier to solve, by the way).


I'd love for this to exist as well. I just have absolutely no clue how the OS dialog/menu system works, so have been unable to try to add it myself. If you think you know enough about it to be able to contribute this feature, that would be awesome.

So do I ! I don't know anything about it neither (except I found two interesting documents in Brandown's calcstuff, and I should start trying to decrypt it), but if one day I succeed to understand how it works, I'll tell you.

Custom named variables were one of the biggest additions in Axe 1.0.0, and have as such been around for quite a while. Just as you use the °VAR syntax to retrieve the address of a variable, you use the addr→°VAR syntax to "store" a constant address of a variable so that VAR is then a variable that exists at the constant address addr.

Yes, sorry, just after posting my message I saw that it was possible to declare a variable anywhere using this syntax. But I never heard of it before ! Seems like nobody was informed, as I never saw a source using it.
I'm french, that's the reason why my English can be a bit approximate.

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 #3338 on: August 01, 2014, 04:13:07 pm »
You should look into more sources then. I didn't do a single program that doesn't use them.

Also for your input request, there is something like that already that has been done by nikitouzz : http://www.omnimaga.org/the-axe-parser-project/input-routine-done-!/

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: Features Wishlist
« Reply #3339 on: August 01, 2014, 04:36:59 pm »

You should look into more sources then. I didn't do a single program that doesn't use them.

Really ? *Goes looking into Matrefeytontias first's program found* Uh, yes ! I never noticed it... Perhaps, after all, I haven't opened so much sources and taken care to them. Anyway, that's a good discovery for me !


Also for your input request, there is something like that already that has been done by nikitouzz :
http://www.omnimaga.org/the-axe-parser-project/input-routine-done-!/
Wow, this routine is really nice ! But I think that Runer112 wanted to find a TI-like input command, which behaves exactly like the input command, but with characters instead of tokens, without the OS's menus, and without the OS's ... Well, maybe which behaves not exactly like the default command, but I think he was looking for a TI-looks-like input command, which uses characters instead of tokens, which uses the big font on the text screen, which is able to scroll, etc. Hum... I don't really know, in fact.
I'm french, that's the reason why my English can be a bit approximate.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3340 on: August 01, 2014, 05:08:58 pm »
In fact, it raises a big question : should Axe become closer to TI-Basic with floating point maths, or should it stay closer to assembly and 16/8 bits maths ? Both cases are interesting, it depends what kind of program people make. But for beginners, being forced to use 16-bit is a good thing, because otherwise they would keep using floating point maths where they could use 16-bits maths, it wouldn't be optimized, and Axe would become a sort of TI-Basic II.

Integer types would exist in tandem with floating point types, and you would pick what type different variables/values are. It would be very similar to a language like C.

No, without any shell, it's not the case ! Even if the program is stored in RAM ! Personnally, I use Noshell on my TI-83+ (OS 1.19), and I tried a little program "{GDB0}++:Disp {GDB0}>Dec,i", and the output is always the same ! But maybe, yeah, as a lot of people are using shells with the write-back option enabled, they face the opposite problem (which is easier to solve, by the way).

I'm not sure what I was thinking... You're absolutely correct that writeback doesn't occur when executing programs through the OS. TI just copies the program, runs the copy, and then deletes the copy.

Noshell has an option to toggle writeback, so it should support it. Also, I'd highly recommend replacing Noshell with zStart. It does everything Noshell does, plus so much more. Notable features for Axe developers are the ability to edit programs without unarchiving them, so you never have to worry about losing your source in a RAM clear, lots of helpful editor hooks like jumping to labels by name, and shortcuts to compile your program without even leaving editor. Also, zStart runs automatically after RAM clears, so all of its hooks and behaviors reinstate themselves without needing to run it every time.

Anyways, back to the topic at hand. Generally, as long as you run the program through any sort of shell/archived program running utility, writeback will be supported. So if you want to make sure writeback occurs, just compile your program with the MirageOS or DoorsCS header (I recommend the former, it's more widely accepted) to prevent it from being run by the OS. Everybody should really have a shell/archived program running utility on their calculator, so imposing this limitation shouldn't be a problem.
« Last Edit: August 01, 2014, 05:10:48 pm by Runer112 »

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: Features Wishlist
« Reply #3341 on: August 01, 2014, 06:13:49 pm »

Integer types would exist in tandem with floating point types, and you would pick what type different variables/values are. It would be very similar to a language like C.
Yes, I know that you'd keep 16-bit variables type, but I think that adding full floating number support will encourage beginners (who already used floating numbers in TI-Basic) to use it instead of learning how to use 16-bit numbers, and all its limitations !


Noshell has an option to toggle writeback, so it should support it. Also, I'd highly recommend replacing Noshell with zStart. It does everything Noshell does, plus so much more. Notable features for Axe developers are the ability to edit programs without unarchiving them, so you never have to worry about losing your source in a RAM clear, lots of helpful editor hooks like jumping to labels by name, and shortcuts to compile your program without even leaving editor. Also, zStart runs automatically after RAM clears, so all of its hooks and behaviors reinstate themselves without needing to run it every time.
I'm quite satisfied with Noshell. I've already heard of zStart, but I think it uses more than a single flash page ! And my sources program are always unarchived (with some backups on my computer), in case of RAM cleared (this occurs quite often).


Anyways, back to the topic at hand. Generally, as long as you run the program through any sort of shell/archived program running utility, writeback will be supported. So if you want to make sure writeback occurs, just compile your program with the MirageOS or DoorsCS header (I recommend the former, it's more widely accepted) to prevent it from being run by the OS.
It's a shame to prevent the program from being run by the OS just if you want to make sure writeback occurs ! Instead of preventing the user to execute the program if he hasn't got any shell, it's better to add a writeback routine inside the program ! I wrote a short code, which works when the program is shelled by the OS :
Spoiler For Code:
At the beginning of the program :
Code: [Select]

bcall(_PushRealO1)
And at its end :
Code: [Select]
bcall(_PopRealO1)
bcall(_ChkFindSym)
JR    C, SaveError  ;Not found !
XOR   A
CP    B
JR    NZ, SaveError ;Archived  !
LD    HL, DE
LD    C, (HL)
INC   HL
LD    B, (HL)
LD    HL, $9D95
LDIR
:SaveError
RET


Currently, I'm trying to adapt Brandown's code for menus to use it like menus in TI-Basic. It works great (only with less than 8 options) but I can't get the highlighted option's index, I don't know which choice was chosen !
I'm french, that's the reason why my English can be a bit approximate.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #3342 on: August 01, 2014, 07:15:12 pm »
I'm quite satisfied with Noshell. I've already heard of zStart, but I think it uses more than a single flash page ! And my sources program are always unarchived (with some backups on my computer), in case of RAM cleared (this occurs quite often).

zStart is also only one page. It's basically objectively better than Noshell, and I would once again recommend you grab it. :P

It's a shame to prevent the program from being run by the OS just if you want to make sure writeback occurs ! Instead of preventing the user to execute the program if he hasn't got any shell, it's better to add a writeback routine inside the program ! I wrote a short code, which works when the program is shelled by the OS :
Spoiler For Code:
At the beginning of the program :
Code: [Select]

bcall(_PushRealO1)
And at its end :
Code: [Select]
bcall(_PopRealO1)
bcall(_ChkFindSym)
JR    C, SaveError  ;Not found !
XOR   A
CP    B
JR    NZ, SaveError ;Archived  !
LD    HL, DE
LD    C, (HL)
INC   HL
LD    B, (HL)
LD    HL, $9D95
LDIR
:SaveError
RET

That actually looks relatively appealing. However, the potential problem I see is that, when run by a shell, it may not be the case that OP1 contains the name of the program being executed. Best case scenario, it doesn't contain the name of a variable, and no writeback occurs. Worst case scenario, it contains the name of another variable, perhaps Ans or some shell appvar, and then the writeback clobbers RAM. Maybe I (or you) can round up all the main shells (MirageOS, DoorsCS, CrunchyOS, Noshell, CalcUtil, and zStart) and test this. If OP1 turns out not to be reliable, it would be worth checking progCurrent, progToEdit, and nameBuff.

EDIT: Alternatively, it may be possible to detect if the OS or a shell launched the program.
« Last Edit: August 01, 2014, 07:23:35 pm by Runer112 »

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: Features Wishlist
« Reply #3343 on: August 01, 2014, 08:07:23 pm »

zStart is also only one page.
I see... Thanks for the tip ! *Removes Noshell and installs zStart*


However, the potential problem I see is that, when run by a shell, it may not be the case that OP1 contains the name of the program being executed. Best case scenario, it doesn't contain the name of a variable, and no writeback occurs. Worst case scenario, it contains the name of another variable, perhaps Ans or some shell appvar, and then the writeback clobbers RAM. Maybe I (or you) can round up all the main shells (MirageOS, DoorsCS, CrunchyOS, Noshell, CalcUtil, and zStart) and test this. If OP1 turns out not to be reliable, it would be worth checking progCurrent, progToEdit, and nameBuff.
EDIT: Alternatively, it may be possible to detect if the OS or a shell launched the program.
I know. It's risky. And even if it may be possible to detect if it's a shell which launched the program, it maybe also be possible that the shell hasn't got write-back enabled. And if this shell doesn't set OP1 = program's name...  :banghead:  And there's a lot of shells to try. And we can't assure a complete reliable routine, which will works for future shells ! Rather hope the user uses a shell with write-back enabled, especially if the write-back feature is used to save the game's best score.


Regarding the OS's DIALOG bcalls, I've achieved to find a way to know which item was chosen by the user, in menus like TI-Basic provides. I just need to improve a little the code source... I'll publish it somewhere, but not now.
I'm french, that's the reason why my English can be a bit approximate.

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: Features Wishlist
« Reply #3344 on: August 02, 2014, 11:38:22 am »
Maybe I (or you) can round up all the main shells (MirageOS, DoorsCS, CrunchyOS, Noshell, CalcUtil, and zStart) and test this.

I've tried "Disp e8478" with some of these shells, plus Ion you forgot  ;) , and here are the results : it works without any shell, with Noshell, with Mirage OS (v1.2), with zStart (v.1.3.013_83). I wasn't able to download CrunchyOS (I don't know why). Unluckily, CalcUtil and DoorsCS don't work in the emulator I'm using. It doesn't works with Ion (at least for v1.6), but Ion clears OP1's value, so there's no problem.



Regarding the OS's DIALOG bcalls, I've achieved to find a way to know which item was chosen by the user, in menus like TI-Basic provides. I just need to improve a little the code source... I'll publish it somewhere, but not now.

After two hours of bug-tracking, I've solved a problem I had with the "TI-83+ Flash Debugger". Good to know : sometimes it says some data is located into RAM, whereas it's in Flash ! Nevertheless, I think I've got a stable menu routine ! There's still some little work to do, but I've got a great base (thanks to Brandown and his DIALOG notes and program). Where can I publish it ? Do I make a new topic inside "The Axe Parser project" ? Because if we want to be able to use these bcalls in a reliable way, I'll probably need help from experimented assembly programmers...
I'm french, that's the reason why my English can be a bit approximate.