CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: c4ooo on May 09, 2016, 01:58:39 AM

Title: Shell that opens when prgm key is pressed.
Post by: c4ooo on May 09, 2016, 01:58:39 AM
I have wanted to create a library of sorts that speeds up basic by modding the drawing commands. As i was researching annoying mateo on how to do this, i decided i might as well also make a shell. However, instead of making a simple shell i decided that this shell will start when you press [prgm]. Furthermore, i hope that the file system of this shell will be compatible to that of Doors :)

How do you use this shell? Simple. You send the program INSTALL and the Appvar HOOK to your calc (the later of which has to be archive), and then you run INSTALL with the Asm() command. From then on (until the next memory reset), when you press the [prgm] key, my GUI will show up instead of TIOS's.

(http://imgur.com/cUwf2fQ.gif)
Title: Re: Shell that opens when is pressed.
Post by: Dream of Omnimaga on May 09, 2016, 03:52:00 AM
Hm interesting idea. Just a few questions:

1) When opening the shell with PRGM, would we still be able to launch programs from the home screen (eg an option to do it)?

2) Will xLIBCE/Celtic2CSE commands still work while this shell is installed?

3) Will # and ! be hidden? Because messing with them (eg archiving/hiding) can cause nasty results >.< (I once got forced to do a full memory reset on my 83+ after archiving # from MirageOS back when MirageOS showed them)

4) You mention enhanced drawing command speeds. Is that a planned shell feature or did you take a different route?

Either way, good luck :)
Title: Re: Shell that opens when [prgm] is pressed.
Post by: c4ooo on May 09, 2016, 04:32:55 AM
1) Probably not. Its very hard to type in a program name without opening the [prgm] menu, so there is no reason to add i homerun feature, every thing will be done via the custom UI.

2) Nope :( If @tr1p1ea gives me the code to xLibCE/Celtic, then yes i will be able to add them along side my code-speeder-upper.

3) Yep. Ile try to tackle this issue to morrow :)

4) If this feature will end up compatible with -all- Tibasic programs, then it will be enabled by default. Else there will be someway to flag  the program as compatible.

And finally:
Thanks! :D
Title: Re: Shell that opens when is pressed.
Post by: Unicorn on May 09, 2016, 04:35:51 AM
What about creating a program? Will you add and option for that in the gui?
Title: Re: Shell that opens when is pressed.
Post by: Dream of Omnimaga on May 09, 2016, 04:50:30 AM
Quote from: c4ooo on May 09, 2016, 04:32:55 AM
1) Probably not. Its very hard to type in a program name without opening the [prgm] menu, so there is no reason to add i homerun feature, every thing will be done via the custom UI.

2) Nope :( If @tr1p1ea gives me the code to xLibCE/Celtic, then yes i will be able to add them along side my code-speeder-upper.

3) Yep. Ile try to tackle this issue to morrow :)

4) If this feature will end up compatible with -all- Tibasic programs, then it will be enabled by default. Else there will be someway to flag  the program as compatible.

And finally:
Thanks! :D
1) I see. My main worry was that not allowing that could cause some issues if for example I am editing a BASIC program and want to insert a program name or copy the code over. Also if the PRGM commands are no longer reachable from the TI-BASIC editor then that could be problematic. I hope you have this covered up.

2) I am ok with the shell overwritting xLIBCE hooks, but back in 2005-06 Reuben Quest and Metroid II often had poor reception because people had to manually uninstall Omnicalc then install xLIB or vice-versa. But again on CW it would be a bannable offense to single out someone's game over such thing (like on Omni until 2011) so I guess that won't make much of a difference here. :P

4) Actually, something that would be cool too is if you improved the speed of the Asm(prgmname command. This is the main issue for non-hook libs like CE Textlib and the new 10x10 sprite program from TI-Planet. I wonder if there would be an easy way to map the calculator VAT in a way that when using Asm() it doesn't have to search the program everytime?
Title: Re: Shell that opens when is pressed.
Post by: c4ooo on May 09, 2016, 11:00:39 AM
Quote from: Unicorn on May 09, 2016, 04:35:51 AM
What about creating a program? Will you add and option for that in the gui?
Definitely. Alongside with [un]archiving/moving etc ;)
Quote from: DJ Omnimaga on May 09, 2016, 04:50:30 AM
Quote from: c4ooo on May 09, 2016, 04:32:55 AM
1) Probably not. Its very hard to type in a program name without opening the [prgm] menu, so there is no reason to add i homerun feature, every thing will be done via the custom UI.

2) Nope :( If @tr1p1ea gives me the code to xLibCE/Celtic, then yes i will be able to add them along side my code-speeder-upper.

3) Yep. Ile try to tackle this issue to morrow :)

4) If this feature will end up compatible with -all- Tibasic programs, then it will be enabled by default. Else there will be someway to flag  the program as compatible.

And finally:
Thanks! :D
1) I see. My main worry was that not allowing that could cause some issues if for example I am editing a BASIC program and want to insert a program name or copy the code over. Also if the PRGM commands are no longer reachable from the TI-BASIC editor then that could be problematic. I hope you have this covered up.

2) I am ok with the shell overwritting xLIBCE hooks, but back in 2005-06 Reuben Quest and Metroid II often had poor reception because people had to manually uninstall Omnicalc then install xLIB or vice-versa. But again on CW it would be a bannable offense to single out someone's game over such thing (like on Omni until 2011) so I guess that won't make much of a difference here. :P

4) Actually, something that would be cool too is if you improved the speed of the Asm(prgmname command. This is the main issue for non-hook libs like CE Textlib and the new 10x10 sprite program from TI-Planet. I wonder if there would be an easy way to map the calculator VAT in a way that when using Asm() it doesn't have to search the program everytime?

1) Actually, the hook checks to see if you pressed [prgm] from the homescreem, and if not, not then it functions normally. My concern right now is that the hook may be slowing down key presses. Everytime a key is pressed the hook copies some code into saferam becouse its better to execute it there. So even if the [prgm] key was not pressed, or pressed in the wrong context, the whole GUI will be copied into safeRam. This is something that should be fixed soon :P

4) That would be possible in the future ;)
Title: Re: :walrii: that :wa1rii: with a custom :walriichu: n:3=
Post by: Dream of Omnimaga on May 09, 2016, 11:25:35 AM
Yeah I agree about #1, I'm sure there is a solution for that, since 83+ programs had keypress-based hooks too. Good luck :)
Title: Re: Shell that opens with a custom program menu
Post by: Unicorn on May 09, 2016, 09:25:16 PM
I Will definitely use this! Could you make setting where if you press a designated hook, you launch a pre-chosen program of the users choice?
Title: Re: Shell that opens with a custom program menu
Post by: c4ooo on May 09, 2016, 09:43:47 PM
Quote from: Unicorn on May 09, 2016, 09:25:16 PM
I Will definitely use this! Could you make setting where if you press a designated hook, you launch a pre-chosen program of the users choice?
This is a great idea! What keys do you think should be used?

Edit:
(http://i.imgur.com/Vx9MOUJ.jpg)
Title: Re: Shell that opens with a custom program menu
Post by: Unicorn on May 10, 2016, 03:34:49 AM
How about any combination that the user wants? Though maybe make having [On} part of the hook mandatory.
Title: Re: Shell that opens with a custom program menu
Post by: Dream of Omnimaga on May 10, 2016, 05:33:03 AM
@Unicorn By pre-chosen program, do you mean like on the TI-89 where pressing diamond+another key launches a program that was assigned to that key combo for quick access?

Also while the folder icon looks nice, this might lead to confusion. Maybe you should use an icon that looks more like a file? Also folders would be nice to add, as long as they are not lost on every RAM clear.

Also will we be able to edit programs from there?
Title: Re: Shell that opens with a custom program menu
Post by: alexgt on May 10, 2016, 11:49:27 AM
Nice! c4ooo ;) The menu looks really good.
Title: Re: Shell that opens with a custom program menu
Post by: Unicorn on May 11, 2016, 02:51:03 AM
Quote from: DJ Omnimaga on May 10, 2016, 05:33:03 AM
@Unicorn By pre-chosen program, do you mean like on the TI-89 where pressing diamond+another key launches a program that was assigned to that key combo for quick access?
Yes, exaclty, @c4ooo
Title: Re: Shell that opens with a custom program menu
Post by: c4ooo on May 16, 2016, 10:52:47 PM
Great news! You can now create folders with names, and their names are displayed correctly. I can not confirm this, but any folder you create in my shell should be visible in Doors CE and vice versa.
Title: Re: Shell that opens with a custom program menu
Post by: alexgt on May 17, 2016, 03:09:31 AM
Nice! Sounds very useful ;)
Title: Re: Shell that opens with a custom program menu
Post by: Dream of Omnimaga on May 17, 2016, 03:22:38 AM
Quote from: Unicorn on May 11, 2016, 02:51:03 AM
Quote from: DJ Omnimaga on May 10, 2016, 05:33:03 AM
@Unicorn By pre-chosen program, do you mean like on the TI-89 where pressing diamond+another key launches a program that was assigned to that key combo for quick access?
Yes, exaclty, @c4ooo
I'M c4ooo now? O.O
Quote from: c4ooo on May 16, 2016, 10:52:47 PM
Great news! You can now create folders with names, and their names are displayed correctly. I can not confirm this, but any folder you create in my shell should be visible in Doors CE and vice versa.
That is great news. Hopefully Doors won't break compatibility with them in the future. I like folders since the CE lacks apps and thus, could make the program menu much more cluttered in the near future. Just make sure that RAM clears won't erase our folders setup like MirageOS 1.2 did <_<
Title: Re: Shell that opens with a custom program menu
Post by: Unicorn on May 17, 2016, 03:39:31 AM
Woops, didn't phrase the post very well. :P Was saying that you where correct, and I wanted c4ooo to see it.

Anyways, having folders is really nice, when do you think we can get a download?
Title: Re: Shell that opens with a custom program menu
Post by: Dream of Omnimaga on May 17, 2016, 05:18:31 AM
By the way, I am curious about what is the current file size? Some shells' main selling point are the smaller file size, since some people don't mind having less features. On the other hand, you already have competition from PHASM on that point. :P
Title: Re: Shell that opens with a custom program menu
Post by: c4ooo on June 01, 2016, 01:21:45 AM
Quote from: DJ Omnimaga on May 17, 2016, 05:18:31 AM
By the way, I am curious about what is the current file size? Some shells' main selling point are the smaller file size, since some people don't mind having less features. On the other hand, you already have competition from PHASM on that point. :P
It's about 5KB right now, though it will probably be 16KB when i finish it :P

Here's a screenshot of the Program/File creation menu :) :
(http://imgur.com/Hjnx03v.png)
Title: Re: Shell that opens with a custom program menu
Post by: Dream of Omnimaga on June 01, 2016, 01:24:44 AM
Thanks for the new screenshot. The other one was kinda blurry for some reasons :P

Also nice choice of colors, although I think the black text on blue should be white (unless it actually looks fine this way on-calc? Sometimes things look better on-calc than emulators or vice-versa).


Are icons supported, by the way?
Title: Re: Shell that opens with a custom program menu
Post by: c4ooo on June 04, 2016, 10:24:53 PM
I don't think i will support programs having icons. Maybe i will do it like MirageOS though and have  the icon show up in the corner of the screen when you select the program.
Title: Re: Shell that opens with a custom program menu
Post by: Dream of Omnimaga on June 05, 2016, 12:19:50 AM
That would be fine :)

By the way, how stable is the shell hook so far and what works?
Title: Re: Shell that opens with a custom program menu
Post by: Unicorn on July 02, 2016, 12:28:43 AM
I'd forgotten about this! @c4ooo, how goes progress with this, I'm looking forward to it :)
Title: Re: Shell that opens with a custom program menu
Post by: c4ooo on July 05, 2016, 07:22:12 AM
Progress has been slow the last two weeks ;/
I have however resumed work on the Shell today :)
Here's some code i wrote today :P
    ld a,(temp2)
    or a
    jp z,createTheDamFile
    call _ChkFindSym
    ld a,b
    or a
    jp nz,thatDamFileIsArchived
    call _DelVar
    jr createTheDamFile
thatDamFileIsArchived:
    call _DelVarArc
createTheDamFile:
    ld hl,0
    call _CreateProg
Title: Re: Shell that opens with a custom program menu
Post by: Dream of Omnimaga on July 06, 2016, 04:07:25 AM
Those label names XD

Glad to see progress, though.
Title: Re: Shell that opens with a custom program menu
Post by: c4ooo on July 06, 2016, 01:14:58 PM
Not much progress yet, but the shell now can detect archived and protected programs  :D (In the futer, folders will not have icons by them)
(http://imgur.com/A7PHW8A.png)
I will soon make a list of the *major* things that i need to implement before a beta release will be possible.
RIght now, i would be grateful if  someone could make me an 'archived' and 'locked' icon. Here is my current icon sprite sheet:
(http://imgur.com/sQpSihg.png)
Each image is 16 pixels wide but a maximum of 15 high. The last two are the archived and locked icons, respectively. As you can tell, i also need a better 'asm' program icon and a 'TIBASIC' program icon (currently a question mark)
Title: Re: Shell that opens with a custom program menu
Post by: Unicorn on July 06, 2016, 03:00:17 PM
Looking good! For an archived icon you could do like an icon zip file or something.
Title: Re: Shell that makes c4ooo lose the game with a program menu
Post by: Dream of Omnimaga on July 06, 2016, 03:46:44 PM
I like them :D, but maybe you should highlight the entire icon instead of just 70% of the sprite :P
Title: Re: Shell that opens with a custom program menu
Post by: MateoConLechuga on July 07, 2016, 03:21:33 AM
Quote from: c4ooo on July 05, 2016, 07:22:12 AM
Progress has been slow the last two weeks ;/
I have however resumed work on the Shell today :)
Here's some code i wrote today :P
    ld a,(temp2)
    or a
    jp z,createTheDamFile
    call _ChkFindSym
    ld a,b
    or a
    jp nz,thatDamFileIsArchived
    call _DelVar
    jr createTheDamFile
thatDamFileIsArchived:
    call _DelVarArc
createTheDamFile:
    ld hl,0
    call _CreateProg

Your code doesnt actually behave the way you may be anticipating. Here's a possible solution:

  ld a,(temp2)
  or a,a
  jr z,+_
  call _PushOP1
  call _ChkFindSym
  call _DeleteVarArc
  call _PopOP1
_:
  or a,a
  sbc hl,hl
  call _CreateProg


Also note that your way of checking archived status is incorrect in your code :p The saving of OP1 technically may not be nesassary, but is an okay future proofing technique.
Title: Re: Shell that opens when prgm key is pressed.
Post by: c4ooo on July 08, 2016, 12:30:02 PM
Thanks mateo! TBH i dont get the difference between DelVar, DelVarArc, and DelVarNoArc.

I was wondering how to treat the deletion of folders. When a folder is deleted should all item in that folder be deleted too? Or should all files/folders in the deleted folder be moved to Folder:Root or something?
Title: Re: Shell that opens when prgm key is pressed.
Post by: Dream of Omnimaga on July 08, 2016, 03:45:04 PM
Either the user should be warned in red box that erasing a folder will erase its content. Or you could ask the user in which folder to move the files
Title: Re: Shell that opens when prgm key is pressed.
Post by: c4ooo on July 09, 2016, 03:14:52 PM
To be honest i am not sure how to move a large amount of files from one folder to another. I will basically have to unarchive each file/folder to make change the folder its in; and then rearchive it. If there's a lot of files in the deleted folder, thats a lot of flash wear >_>
Title: Re: Shell that opens when prgm key is pressed.
Post by: Dream of Omnimaga on July 11, 2016, 11:39:57 PM
Yeah true. In any case, be sure to warn the user if you have to delete all files when deleting a folder, else there will be quite a lot of pissed off users.