Author Topic: [Axiom] Menu( using OS's bcalls (finished !)  (Read 6596 times)

0 Members and 1 Guest are viewing this topic.

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
[Axiom] Menu( using OS's bcalls (finished !)
« Reply #15 on: August 07, 2014, 01:34:42 pm »
I've finally finished the Menu( axiom !

You can only use it like in TI-Basic, by writing Menu("WHO ARE YOU?","A BOY","A GIRL","A CALC"). Note you can't use labels as arguments. The function returns the selected choice's index. But there's a readme to explain it, and even its french translation.

EDIT : I improved the readme and translated it in french. No changes have been made to the axiom.

EDIT 2 : No more beta ! Final version released  :)
« Last Edit: August 09, 2014, 12:43:35 pm by Zemmargorp »
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: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #16 on: August 09, 2014, 03:50:03 pm »
Wait, that means you can only have up to 5 choices right ?

Also, maybe you can display the title in inversed font, like Basic menus.

Apart from this, well done ! I'm sure many persons were waiting for this to pop out :)

Les Français vaincront ! :D

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #17 on: August 09, 2014, 04:53:33 pm »
YES finally! A quick alternative to creating your own menu system every time you write an axe program! This slipped under my radar, but I am glad I see it now!
If you like my work: why not give me an internet?








Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #18 on: August 09, 2014, 05:46:32 pm »
Wait, that means you can only have up to 5 choices right ?

Also, maybe you can display the title in inversed font, like Basic menus.

Apart from this, well done ! I'm sure many persons were waiting for this to pop out :)

Les Français vaincront ! :D
No ! You can have up to 7 choices ! If you had downloaded the zip (nobody did, but I got two points of karma : that's funny !), you'd have seen I provided an alternative which consists of generating data corresponding to the menu (I've made a generator in the zip), and sending an pointer to the data using this syntax : "Menu(GDB0)rr".

Yes, but I don't know how to display the title in inversed font, because it's the OS routine which draws the menu.

Probably, and I hope it will be useful !

Pourquoi pas, ça m'irais bien !  ;D


YES finally! A quick alternative to creating your own menu system every time you write an axe program! This slipped under my radar, but I am glad I see it now!
In fact, I published it today, so you're one of the first people to see it !
I'm french, that's the reason why my English can be a bit approximate.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55833
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #19 on: August 14, 2014, 01:02:56 am »
This is interesting. I will most likely not use it since I don't code in Axe anymore but I know some people might not necessarily need complex menus in their games and might just want to use the default TI-OS ones.  In BASIC too it was pretty convenient and not too intrusive, game-design-wise, so it's good that they can now be used in Axe too. :)
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF



Official Website |T-Shirt store | Reverbnation | Facebook | Youtube | Twitter | Spotify

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #20 on: August 14, 2014, 12:32:22 pm »
This is interesting. I will most likely not use it since I don't code in Axe anymore but I know some people might not necessarily need complex menus in their games and might just want to use the default TI-OS ones.  In BASIC too it was pretty convenient and not too intrusive, game-design-wise, so it's good that they can now be used in Axe too. :)
Thank you. And, yeah, I'm one of these people who might not necessarily need complex menus...



I'm thinking of the syntax of the Menu( command, for Axe... First, I think it'd be better that this functions returns the selected item's index, instead of jumping to a specified address. Sometimes you don't need to jump : this is the case if the menu is used in a game to ask the number of players. Additionally, it would be a shame to have menus limited to one title and only two choices, as for now commands are limited to six arguments. If you want it to jump to labels, you can use it in combination with Z-Test. But there are still different ways to include it :
  • Use it like TI-Basic does : the first argument is the menu's title, and all the other are choices. The numeration is automatically made. It's easy to use, but very limited.
  • The second way is to use the first character of each string to describe what the string corresponds to. Adding the prefix "." to any string will treat it as a title, and ":" as a choice. This allows more kinds of menus, and it'll be easier to add later other options, like "=" to input numbers, etc.
  • Maybe use both ? Menu() will use the same syntax as TI-Basic does, and adding the ^r modifier will use the second way. This is a bit strange, though. And it will take a lot of bytes into Axe Parser, and everyone knows few bytes are remaining free.
What do you think ? (Personally, I think using both would be a waste, but I don't know which solution is better.)
« Last Edit: August 14, 2014, 12:48:55 pm by Zemmargorp »
I'm french, that's the reason why my English can be a bit approximate.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55833
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #21 on: August 14, 2014, 01:10:30 pm »
If I was you, I would make it as simple as BASIC did, but perhaps with extra options and the ability to have more than 7 items at once. In BASIC, for example, it's impossible to make the title so that it uses black text on white background like the rest, and you are limited to a maximum of 7 menu items. Of course it would depend how much space there is for this, though.
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF



Official Website |T-Shirt store | Reverbnation | Facebook | Youtube | Twitter | Spotify

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #22 on: August 16, 2014, 06:44:22 am »
If I was you, I would make it as simple as BASIC did, but perhaps with extra options and the ability to have more than 7 items at once. In BASIC, for example, it's impossible to make the title so that it uses black text on white background like the rest, and you are limited to a maximum of 7 menu items. Of course it would depend how much space there is for this, though.
It'd be better to have the title in inverted color, but currently, the only way I found to display the title is in black on white. And I'd love to find a way to have more than 7 items, but adding items beyond 7 makes it crashing...
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: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #23 on: August 16, 2014, 06:54:42 am »
Couldn't you use set 3,(iy+5) before writing the title, then res 3,(iy+5) after writing it to have it written in inverted color ?
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: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #24 on: August 16, 2014, 08:36:05 am »
Couldn't you use set 3,(iy+5) before writing the title, then res 3,(iy+5) after writing it to have it written in inverted color ?
No, I thought of it, but the menu is written in one fell swoop by the OS's routine, which must configure all the flags before.
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: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #25 on: August 27, 2014, 05:39:28 am »
As I'm not working on this axiom anymore (even though I had ideas of improvements), I decided to share the source code with you. In "you", I include ISSOtm who asked me the source code, and Runer112 if he wants to add it to Axe. However, either if you're going to download it or if you're one of the two people mentioned before, I recommend you to read the notes I wrote in the two spoilers of the first post of this topic.

And I hope the 5 people who downloaded the final axiom were happy to be able to use this feature in Axe  ;D
I'm french, that's the reason why my English can be a bit approximate.

Offline ISSOtm

  • LV3 Member (Next: 100)
  • ***
  • Posts: 56
  • Rating: +4/-0
  • Programming or playing games I've programmed
    • View Profile
Re: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #26 on: August 27, 2014, 09:27:08 am »
It seems there is a conflict between your axiom and zStart (which would be quite annoying, because it is a very common shell) :

I had zStart installed (with every options activated), and I ran the following program (once compiled with Axe) :
Code: [Select]
.BUGGY
#Axiom(MENUS)
Menu("TITLE SCREEN","CHOICE1","CHOICE2","CHOICE3")

The program worked fine, but after the execution, almost every zStart's hooks were off : only the custom font was still on.
Programmer ("always start, never finish")

Currently owning :
 - TI 84+SE (crashed by zStart :P )
 - Computer for life



Voir aussi la version française.

Puzzle Master (if you hate mathemathics...)

Also on codewalr.us !

Offline Zemmargorp

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +7/-2
  • Either programming or thinking of it.
    • View Profile
Re: [Axiom] Menu( using OS's bcalls (finished !)
« Reply #27 on: August 27, 2014, 09:46:10 am »
It seems there is a conflict between your axiom and zStart (which would be quite annoying, because it is a very common shell) :

I had zStart installed (with every options activated), and I ran the following program (once compiled with Axe) :
Code: [Select]
.BUGGY
#Axiom(MENUS)
Menu("TITLE SCREEN","CHOICE1","CHOICE2","CHOICE3")

The program worked fine, but after the execution, almost every zStart's hooks were off : only the custom font was still on.

Like you said, it's a bit annoying, as zStart is a common shell. I suppose you've downloaded the axiom's source code : as you can see, most of the ram areas (including hooks) modified by the routine are restored after displaying the menu, the only noticeable exception being ramCode, located at $8100, and 304 bytes long. If zStart uses this area to store his hooks (which is weird because ramCode is used when the OS is writing to Flash and to store graphical data), then we know why you encountered this problem.

Does anyone knows what causes the problem, or if zStart uses ramCode ?

EDIT : Just remembered that Runer112 already had this problem (but with number inputs, not basic menus) :
A bit of testing seems to suggest that it's some compatibility issue with Omnicalc and/or zStart.
« Last Edit: August 27, 2014, 09:55:43 am by Zemmargorp »
I'm french, that's the reason why my English can be a bit approximate.