Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Builderboy on May 15, 2010, 04:25:11 pm

Title: TI Basic Editor
Post by: Builderboy on May 15, 2010, 04:25:11 pm
So i was playing around with the idea of writing my own Small Font Basic editor in Axe, but i got stumped when it came to the idea of how to realocate memory when you insert text into a large file.  Like if you had an 8000 bytes program, and you add an extra digit on the first line.  Would i have to shift everything else down by a couple bytes?  Is there any fast way to handle the dynamic memory needed for a text editor?  And how does the Ti OS manage to do it so well?
Title: Re: TI Basic Editor
Post by: Galandros on May 15, 2010, 04:49:58 pm
I don't know everything. But I have some hints to give you (is all I know of concrete):
Each time you edit a program, the TI-OS allocates all the free ram to that program.
When you exit, it shrinks down to the size used.


Now, the simplest way is indeed copy all the program one byte "down".
You could make secondary buffers to the inserts you put somewhere, but it will be hard to track all the changes you did to the program...


Because of allocating all memory to the program is more reachable from assembly, I say pure assembly is preferred to this task. But I wish best of luck to do it. I bet we can do a better job than TI even with Axe Parser. ::) The scrolls down for Rcl a program and Goto the error in TI-BASIC editor are complete nonsense. I bet Brandon Wilson ranted this at some time.
Title: Re: TI Basic Editor
Post by: Quigibo on May 15, 2010, 05:02:34 pm
That would be cool!  Yeah, you just copy all the bytes down one by one.  But remember this is asm, that takes about a millisecond.  The hard part is the fact that you have to put the calculator in edit mode first and then keep track of the edit mode pointers.  Basically, the calculator moves around all programs and variables so that your current program is last in the in line so expanding things to the end of it doesn't overwrite your other programs, you have the entire free ram to expand.  Then when you're done expanding, you have to update the size bytes of the file and close the edit mode.

You're looking for the assembly bcalls "EditProg" and "CloseProg".  Those require assembly input though, so even if you make it in Axe, you're still going to need some assembly.  Also there are 4 other pointers that you need to keep track of in $84D3, $84D5, $84D7, and $84D9 which hold important information related to the editing.

Good luck!  If you manage to get it working I would be very impressed.  This gave me a lot of trouble when I was using this in Axe Parser to create the assembly programs.  The TI-Developer's Guide is slightly wrong on some critical stuff so that really threw me off.  Specifically, you need to update the program size manually, even though it says its done automatically.
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 15, 2010, 05:05:55 pm
mhmm that would be interesting. I assume this wouldn't leave a lot of RAM for developers, right, tho? (unless programs could be edited from flash?)
Title: Re: TI Basic Editor
Post by: calcdude84se on May 15, 2010, 06:07:13 pm
This would definitely be more useful in ASM, because then an app could be made, leaving ram free.
The main problem is that, yeah, the program would be kind of large, somewhat defeating the purpose. Still a good concept, though.
Oh, I just realized something: ->Frac displays characters, doesn't it? That means doing a little extra work because the editor must work with the tokens. How does one get the sequence of characters corresponding to a given one- or two-byte token?
Title: Re: TI Basic Editor
Post by: Builderboy on May 15, 2010, 06:19:41 pm
Thats some good information :) Although it seems that this might be more difficult than i first imagined.  Once (and if) i finish the program, would it be possible for the raw Asm file to be converted into an APplication using a computer or something?  That way you really would have all the RAM you needed.  I think i might start in Basic first so i can get all the interface and things down to where i want them, and so i can work on the cursor movement, to get it as close to the Basic editor as possible.
Title: Re: TI Basic Editor
Post by: calcdude84se on May 15, 2010, 06:22:26 pm
It would have to be recompiled from source, since all the jp's, call's and many ld's would have to be changed.
I'm not sure how hard it would be to make a slightly modified version of Axe where the program's .org is different.
Title: Re: TI Basic Editor
Post by: Quigibo on May 15, 2010, 06:36:37 pm
I could compile it for an app fairly easily (an app that is just hex code and not signed).  It would look just like a program, but unable to execute and you would have to extract the hex from that program on the computer and then sign it there and send it back as an app.

Is app signing on-calc really that hard?  How does app signing even work?  Isn't it just RSA encryption or something?
Title: Re: TI Basic Editor
Post by: Builderboy on May 15, 2010, 06:51:01 pm
I dont know, you should probably talk to Brandon Wilson, he knows lots of things ;D
Title: Re: TI Basic Editor
Post by: _player1537 on May 15, 2010, 06:51:55 pm
Brandon Wilson made a program that takes unsquished hex and makes it into an app, and signs it too

iirc signing means putting something at the beggining or end of a program to make it recognized on the calc
Title: Re: TI Basic Editor
Post by: calcdude84se on May 15, 2010, 06:52:19 pm
IIRC correctly it just takes over 10 minutes if it's not an 83+, in which case it takes longer.
It just takes forever... it's doable, though. I can't remember the exact method, but RSA sounds right.
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 15, 2010, 06:55:03 pm
You would probably need to ask BrandonW for that since he's the biggest expert in that stuff. That said, maybe FloppusMaximus on UTI or Calc84maniac might know a bit about that, too
Title: Re: TI Basic Editor
Post by: Builderboy on May 16, 2010, 09:03:30 pm
Hmm hey Quigibo, is GetCalc(Str,100) supposed to be able to create programs?  I can only get it to create AppVars on my Ti84SE
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 16, 2010, 10:05:17 pm
Strange, just tried on emulator (OS 2.41) and it wouldn't create the program

"prgmLOL"->Str1
GetCalc(Str1,90)
Title: Re: TI Basic Editor
Post by: Builderboy on May 17, 2010, 12:52:55 am
So if/when creating a program is suppoorted, would that be a substitute for the assembly BCALLS you mentioned earlier?  FOr instance you could use GetCalc(Name,Size) to create a temp program for working space, and then worked on it from there
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 01:28:14 am
Wewt, I have gotten a program to kinda read from Basic programs.  Right now it supports most of the 1 Byte tokens (except the tricky ones like -> and ") but none of the 2 byte ones.  It also has a shiny line indent feature :].  It runs a mono spaced font right now, so some of the text looks weird, and some of it is squished or stretched, so i need to work on that as well.  But getting the token system working was a real hurdle so i am pleased ^^

The screenshot shows it displaying a simple text sprite editing program of mine, although i had to remove all two byte characters, so it looks kinda weird.  There are ? marks where there are other unsuported tokens.

EDIT: Right now i need to put a stop at the end of the program so it knows when to stop, how do i find the size of a program?
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 19, 2010, 01:38:22 am
Wow nice! Is it all in Axe or does it use inline ASM? I love how it is. I assume you read from calc RAM and display the token depending of the byte content?
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 01:42:26 am
Yeah, its all still pure Axe :) I have two huge tables in the program, one with all the token text data and one with all the token byte value data.  They were a pain to create x.x So far though im really liking the look and feel of the editing, and it will be sooo nice to have a 21x10 screen space instead of a 16x7 ^^ Plus some cool features like faster scrolling, line indenting, and custom menus to give access to extra tokens and such.  I hope to create most of the Ti Os environment exactly though, so it will still feel like programing in the regular basic editor.  That way people who use the key codes to navigate menu's wont get tripped up :P
Title: Re: TI Basic Editor
Post by: Quigibo on May 19, 2010, 01:44:37 am
Awesome, it looks really promising!

You know there is a bcall for displaying tokens right?  You can display them with Asm(EBEF6049).  If the high byte is zero, it displays it as a 1 byte token, and if the high byte is non-zero, it displays the full 2 bytes as a 2 byte token.  You can get the size of the program with the program pointer by doing this: {P-2}r that returns the size for the program (it comes directly before the start of the data).
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 19, 2010, 01:44:57 am
Yeah I assume this must have taken so long x.x

One thing I wonder, tho: For people wanting to make extremly large games, how will they be handled?

Also you should rename this to TI-BASIC & Axe Editor :P since both are programmable in the PRGM editor :P
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 01:48:56 am
No wayyy really?  Does it work in the small font?  And thanks a bunch for the size info :) I was worried i was going to have to start messing with the VAT ;D

And yeah DJ, this is going to have a special Axe option in the options menu, since the syntax is a bit different (like how If's dont use Then's). And i could also rename some of the tokens to be whatever i wanted ;) like i could make it display conj( as copy( since in the current version i have complete control of the display.  It could make some things a lot easier ^^
Title: Re: TI Basic Editor
Post by: Quigibo on May 19, 2010, 01:53:49 am
Yup, works in any Fix mode you're in I think.  It will be supported natively soon too :)

I was thinking of in the far future actually overwriting the operating system tokens with axe tokens as an option in the parser, but I don't know how hard that would be.
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 01:56:44 am
Alright so how do i use the hex code you gave me?  What variables does it take and how do i tell it what they are?
Title: Re: TI Basic Editor
Post by: Quigibo on May 19, 2010, 02:03:15 am
Try this:

:For(H,1,255)
:HAsm(EBEF6049)
:End

Will display single byte tokens.

For 2 byte tokens, you need 2 bytes, so if you were reading from a program pointer, you would check if the token is 2 bytes first, and then if it is, read it 2 bytes at a time and then display it so it has the whole 2 bytes.
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 02:11:42 am
Alright that seems to display them fine, but Fix doesn't seem to do anything, they are all in the large font on the homescreen
Title: Re: TI Basic Editor
Post by: meishe91 on May 19, 2010, 02:48:36 am
That looks really sweet. Good luck with future improvements ;D
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 03:34:10 am
One thing I wonder, tho: For people wanting to make extremly large games, how will they be handled?

what exactly did you mean by that?  Like memory wise or what?
Title: Re: TI Basic Editor
Post by: calcdude84se on May 19, 2010, 07:21:14 am
Probably he means not enough memory to write them, if your program is large.
@Quigibo: That would probably be possible, given that all TI's language localization apps do it. I don't know what hooks (if it's hooks) you would use, though.
Title: Re: TI Basic Editor
Post by: TIfanx1999 on May 19, 2010, 08:06:07 am
I didn't expect this to progress quite so quickly. O_o This is looking really neat Builderboy!
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 19, 2010, 11:53:51 am
One thing I wonder, tho: For people wanting to make extremly large games, how will they be handled?

what exactly did you mean by that?  Like memory wise or what?
Example, some Illusiat 13 programs are nearly 15 KB large each. I know there are other BASIC programs that can be even larger too. I wondered if the BASIC editor could open those or if it was out of the question?
Title: Re: TI Basic Editor
Post by: Galandros on May 19, 2010, 03:30:11 pm
Really promising.
I hope it gets stable enough to start using.

One wish, although you may have it planned anyway:
If it is possible do a definitive Catalog with all the tokens we need for ASCII art (greek letters and such)
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 05:05:08 pm
Yeah im going to plan to change the catalogue a lot.  It will remove all the functions that you can acess from other menus and add all the greek and special characters.  There also might be an alternate menu for special characters. 

As for editing large files, it currently only takes up 2000 bytes so it should be able to load any file that can fit in Ram allongside it.  And i hopeo be able to port it to an app later on.
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 19, 2010, 05:13:10 pm
nice :D
Title: Re: TI Basic Editor
Post by: ztrumpet on May 19, 2010, 05:20:09 pm
I was thinking of in the far future actually overwriting the operating system tokens with axe tokens as an option in the parser, but I don't know how hard that would be.
I know there's some code to do this in Mirage1.0: http://brandonw.net/calculators/savethewhales/

Builderboy, this is progressing nicely!  I really like how it's turning out.  Once this is done, I'm pretty sure I'll use it, as it's pretty nice.  I really like the line indent feature.  Keep up the awesome work! ;D
Title: Re: TI Basic Editor
Post by: meishe91 on May 19, 2010, 05:23:43 pm
What you could do for the catalog is have the commands in one menu then like have another menu that has all the characters. Like when your in a menu and you push left and right for new commands. I don't know if that is what ya meant when you described it.
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 19, 2010, 05:31:49 pm
I was thinking of in the far future actually overwriting the operating system tokens with axe tokens as an option in the parser, but I don't know how hard that would be.
I know there's some code to do this in Mirage1.0: http://brandonw.net/calculators/savethewhales/

Builderboy, this is progressing nicely!  I really like how it's turning out.  Once this is done, I'm pretty sure I'll use it, as it's pretty nice.  I really like the line indent feature.  Keep up the awesome work! ;D
It would be cool, altough idk if it would be that useful. It might eventually confuse some ppl who got used to the current syntax. I think for the rest of the ppl, just elaborating the command doc more will help enough.

It is possible, though. You would probably need to do something like the Français, Deutsch and Espanol apps. One of them even overwrites one of the calc fonts.
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 11:11:35 pm
Hey guys i was trying to get line wrapping working correctly, but it turns out that it is very difficult to get right... Then i had an idea, what if instead of wrapping down to another line, it would just continue offscreen?  Like if you had a giant list representing some level data, it wouldnt take up multiple lines, it would just be really long, and then you could scroll from left to right.  What do you guys think?
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 19, 2010, 11:16:58 pm
that could be a nice idea, because word-wrapping can make code hard to read sometimes.

However to edit maps like Illusiat 13, it would make things considerably harder since the game map format takes advantage of the 16 char width nature of the TI-OS BASIC editor (maps are 16x8)
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 11:20:26 pm
Ah thats a good point, hmmmmm maybe there will be an option to edit specific lines in the large font
Title: Re: TI Basic Editor
Post by: Geekboy1011 on May 19, 2010, 11:21:33 pm
wow this just looks utterly amazing BuilderBoy cant wait to acctually try to use it hmm will it support like undo things if yo accidentaly like delete a line of code??
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 19, 2010, 11:23:19 pm
Ah thats a good point, hmmmmm maybe there will be an option to edit specific lines in the large font
well, that would prbly not solve my issue x.x, unless those line wrapped x.x
Title: Re: TI Basic Editor
Post by: meishe91 on May 19, 2010, 11:29:55 pm
Ya, that actually sounds like a really cool idea. But ya, the problem DJ brought up is an issue. You could make it so like instead of making every line wrap you could make it an option so you choose a line you want to wrap and just that line is displayed wrapping (like no other lines are viewable). I don't know how practical that would be code wise but who knows.
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 11:32:26 pm
yeah thats what i meant :)
Title: Re: TI Basic Editor
Post by: meishe91 on May 19, 2010, 11:34:05 pm
Well I still meant on the graph screen since it still shows more but either would work really. But cool :)
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 11:44:00 pm
Well you still want it to wrap through 16 characters in width, so normal font might be preferable.  Its not that important right now though, i'll worry about it once i get all the other things working
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 19, 2010, 11:46:43 pm
yeah true, for now the most important thing to do is make sure no crashes occurs and that the editor works fine. How is key detection btw? That's one major issue I have on the TI-Nspire 84+ keypad
Title: Re: TI Basic Editor
Post by: Builderboy on May 19, 2010, 11:51:17 pm
Heh, right now there isnt even any editing features.  I am still trying to get it to be able to display the programs correctly, as well as scroll up and down.  I am working on some subs to help me, like displayToken, diplsyLine, displayScreen, newLine, moveUp, and moveDown.
Title: Re: TI Basic Editor
Post by: Quigibo on May 19, 2010, 11:51:41 pm
DJ, I don't think your problem would be solved regardless of what builderboy does becasue the small font is not going to take up 16 columns anyway, its variable width, and he is using automatic indents on top of all that.  You can use both editors at any time though, its not like you have to use only one of them, so you can always get the best of both worlds and just switch whenever you feel its more convenient.

Builderboy there is a way to make it display small fonts, but its a somewhat longer routine, I can give you the hex if you want, but I don't know if its useful since it looks like you're trying to make it a fixed width font.
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 20, 2010, 12:02:15 am
oh yeah right forgot about that x.x

Altough if he makes lines selectable for editing with word-wrap, he could use the big fonts and it would go back to 16x8
Title: Re: TI Basic Editor
Post by: Builderboy on May 20, 2010, 12:04:08 am
Heh, then i would have to write a small font editor *and* a large font editor :P well at least one thing is for sure, using line wrap on the small font wont help map makers, so i am officially doing the one line scrolling thing
Title: Re: TI Basic Editor
Post by: ztrumpet on May 20, 2010, 04:49:20 pm
so i am officially doing the one line scrolling thing
Awesome!  I like that idea.  Could [2nd] [Left or Right] go to the next page of code instead of to the end of the line?
Title: Re: TI Basic Editor
Post by: Galandros on May 20, 2010, 05:20:48 pm
so i am officially doing the one line scrolling thing
Awesome!  I like that idea.  Could [2nd] [Left or Right] go to the next page of code instead of to the end of the line?
I think it is better to make [2nd] [Left or Right] should go to the being or end of line and [2nd] [Down or Up] go one page down or one page up.
Because if wordwrap is off, a way to go the end of line is useful and is more intuitive that [Down] goes one page down.
Title: Re: TI Basic Editor
Post by: ztrumpet on May 20, 2010, 05:41:40 pm
I think it is better to make [2nd] [Left or Right] should go to the being or end of line and [2nd] [Down or Up] go one page down or one page up.
Because if wordwrap is off, a way to go the end of line is useful and is more intuitive that [Down] goes one page down.
Wouldn't it be better to have [Alpha] [Down or Up] to go one page down or one page up since that's what happens in the normal Ti-basic editor?
Title: Re: TI Basic Editor
Post by: Builderboy on May 20, 2010, 05:55:29 pm
I am most likely going to keep all menus, controls, and menus the same as in the regular TiOS, just so i dont confuse people or experienced speed coders.
Title: Re: TI Basic Editor
Post by: Galandros on May 20, 2010, 05:58:44 pm
I think it is better to make [2nd] [Left or Right] should go to the being or end of line and [2nd] [Down or Up] go one page down or one page up.
Because if wordwrap is off, a way to go the end of line is useful and is more intuitive that [Down] goes one page down.
Wouldn't it be better to have [Alpha] [Down or Up] to go one page down or one page up since that's what happens in the normal Ti-basic editor?
Oh, yes, I confused the [2nd] with [Alpha]. Maybe [2nd] for going to the end of lines/pages and [Alpha] for next page.
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 20, 2010, 06:53:04 pm
I am most likely going to keep all menus, controls, and menus the same as in the regular TiOS, just so i dont confuse people or experienced speed coders.
Idea: for the CLEAR button, I would add an option in the BASIC editor where by default, the calc asks you to confirm if you try to delete a line of code. A major issue about the current BASIC editor is that people accidentally their code because the CLEAR key is too close to the down arrow. In some cases (example, when entering an extremly long string of character, a huge matrix or the like) it's almost as bad as a RAM clear.
Title: Re: TI Basic Editor
Post by: Builderboy on May 20, 2010, 07:19:48 pm
Yeah that sounds like a good idea :) Like maybe if you have 15 or more characters in a line it asks you to confirm. 

Currently I have a cursor that is working and able to move around and explore the program.  I had to take out indenting though, and once i get program reading/writing finished ill work on putting that back in.  I also am expirmenting with non mono-spaced fonts but its not decided yet.
Title: Re: TI Basic Editor
Post by: ztrumpet on May 20, 2010, 08:04:45 pm
Cool!  This is really neat! :D

I am most likely going to keep all menus, controls, and menus the same as in the regular TiOS, just so i dont confuse people or experienced speed coders.
Idea: for the CLEAR button, I would add an option in the BASIC editor where by default, the calc asks you to confirm if you try to delete a line of code. A major issue about the current BASIC editor is that people accidentally their code because the CLEAR key is too close to the down arrow. In some cases (example, when entering an extremly long string of character, a huge matrix or the like) it's almost as bad as a RAM clear.
Could you have an undo (like [ctrl] + [z] on a comp) to protect in case of this?  [Alpha] [Del] maybe...

Yeah that sounds like a good idea :) Like maybe if you have 15 or more characters in a line it asks you to confirm. 
I think this is a bad situation regardless, so could you have an option menu to turn the clear to delete on and off.  The clear confirm should ask you to confirm (imho) if there are any characters on the line (it's not blank.)

Is this meant to emulate the 84+ oses, 83+ oses, or 84+ MP os?
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 20, 2010, 08:07:40 pm
wouldn't undo takes a lot of memory, though?
Title: Re: TI Basic Editor
Post by: ztrumpet on May 20, 2010, 08:15:46 pm
wouldn't undo takes a lot of memory, though?
Unfortunately, it probably would. =/
Title: Re: TI Basic Editor
Post by: calcdude84se on May 20, 2010, 08:16:45 pm
Another good suggestion is to have 89-style line clearing, where pressing clear from the middle of a line removes everything from there to the end, and pressing it from the beginning or end clears everything.
Title: Re: TI Basic Editor
Post by: ztrumpet on May 20, 2010, 08:18:59 pm
Another good suggestion is to have 89-style line clearing, where pressing clear from the middle of a line removes everything from there to the end, and pressing it from the beginning or end clears everything.
Omnicalc does this on the 83/84s, but only on the homescreen.  I never really liked it, but I know some people did.  Could this be another option? ;D
 * ZTrumpet like options... :D
Title: Re: TI Basic Editor
Post by: Builderboy on May 20, 2010, 08:20:55 pm
Maybe i could have a couple different options, like

regular
Confirm
15 character confirm

and then an 89 style switch where clear does the clearing from that point and onward
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 20, 2010, 08:47:15 pm
Another good suggestion is to have 89-style line clearing, where pressing clear from the middle of a line removes everything from there to the end, and pressing it from the beginning or end clears everything.
Omnicalc does this on the 83/84s, but only on the homescreen.  I never really liked it, but I know some people did.  Could this be another option? ;D
 * ZTrumpet like options... :D
I liked it. I wish it did it in PRGM editor, tho. Maybe BBoy could have this in his CLEAR routine?
Title: Re: TI Basic Editor
Post by: Builderboy on May 20, 2010, 09:38:50 pm
Yeah i plan to have that as an option :)

Ok so i have the non monospaced fonts working, so it looks a lot better, but the cursor now looks weird because it is always 4 spaces wide, no matter what the width of the character it is on.  What kind of cursor might look good?  A black box like the TiOS?  An underline?  I vertical line before the character?  Invert? What do you guys think?
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 20, 2010, 09:48:12 pm
Vertical line before the char sounds good, as long as it flashes. Otherwise a black box sounds good
Title: Re: TI Basic Editor
Post by: Builderboy on May 20, 2010, 09:55:00 pm
The thing about a vertical bar, would it seem like when you type, its expected to behave like on a computer, where the text is inserted instead of being overwriten, do you think that would be ok?  I still want it to behave like the TiOS
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 20, 2010, 09:57:05 pm
Oh yeah didn't thought about that x.x It migth lead to confusion. I guess it might be best to use the black box then
Title: Re: TI Basic Editor
Post by: Builderboy on May 20, 2010, 09:58:46 pm
Ok, but just so you know, the black box will have to change size in order to account for different sized characters
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 20, 2010, 10:00:50 pm
Yeah I know. /me hopes it is possible D:
Title: Re: TI Basic Editor
Post by: Builderboy on May 20, 2010, 10:03:57 pm
Oh its deffinetaly possible, i just wasnt sure it would be appealing.  I am also experimenting with an inverted box instead of a filled one.


Lol i implemented it, but i used token length instead of character width by accident and the cursor got as big as an entire While token XD I fixed it :P
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 20, 2010, 10:05:26 pm
i would prefer inverted
Title: Re: TI Basic Editor
Post by: meishe91 on May 20, 2010, 11:37:22 pm
Ya, I my vote is for either black box, inverted, or the underscore line. Sounds like progress is coming along though, keep it up :)
Title: Re: TI Basic Editor
Post by: Geekboy1011 on May 21, 2010, 12:40:24 am
my vote is for inverted ^^ and dam this is coming along nicely
Title: Re: TI Basic Editor
Post by: Builderboy on May 21, 2010, 01:28:23 am
Ok woooo i got inverted and variable sized cursor working! Yayyy, enclosed is a screenshot :)  Note that there is no bounds on the program reading right now so the first and last lines are both displayed incorrectly.  Also note that there is no file editing right now either :P Haha i'll have to write another table of key-to-token conversions before that happens ;D Haha gosh i am going to have a lot of data.  Is there any way to declare it at the *end* of my program so i dont have to scroll through it all the time?
Title: Re: TI Basic Editor
Post by: Geekboy1011 on May 21, 2010, 01:29:57 am
wow that just looks epic BBoy good luck with the tables X.x
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 21, 2010, 01:40:51 am
wow awesome looking so far!
Title: Re: TI Basic Editor
Post by: Quigibo on May 21, 2010, 01:55:23 am
Haha gosh i am going to have a lot of data.  Is there any way to declare it at the *end* of my program so i dont have to scroll through it all the time?
You can already do that ;)  Just make sure you use less than 150 pointer names or the parser will run out of memory.

EDIT: Actually, I don't remember how that works anymore.  Maybe or maybe not.
Title: Re: TI Basic Editor
Post by: Builderboy on May 21, 2010, 01:59:39 am
Hurm then why does this throw an error?

.Axe
Pt-On(0,0,Pic1
[0000000000000000]->Pic1
Title: Re: TI Basic Editor
Post by: Quigibo on May 21, 2010, 02:03:54 am
Oh yeah, I forgot.  I changed the way the pointer handling worked a long time ago.  This will be possible in the future though.  I just need to find some large continuous rom page I can use to read and write a bunch of data to (preferably not the extra ram pages).  That would also allow me to make label and static pointer names 8 characters in length.
Title: Re: TI Basic Editor
Post by: Builderboy on May 21, 2010, 02:12:48 am
Alright, I'll see if I can find some way around it in the meantime. Heh because I have a *lot* more data to add, just think, I need tokens for all of the keys, all of the [2nd] keys, and all of the [alpha] keys, and that's not even including all the menus I will need to code.  One things for sure, this will *definetaly* need to be an app when It is finished.
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 21, 2010, 02:15:04 am
keep in mind app compiling on calc will most likely take several minutes, though, according to BrandonW. App compiling would most likely be a computer-only feature
Title: Re: TI Basic Editor
Post by: Builderboy on May 21, 2010, 02:36:22 am
Yep, that sounds good to me.  And I can get the editor working in program form, editing smaller files and such, and then when it is finished I can compile it into an app :) since so much of he program size is going to be data, I don't think I'll have a problem with the 8000 byte limitation since it only counts towards executable code
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 21, 2010, 07:23:15 am
Aaah ok well I guess if it's mostly data you should be fine. Putting as many things as data form instead of hard-coding it is usually the best solution in ASM and Axe, I think (when it comes to 8xp files)
Title: Re: TI Basic Editor
Post by: calcdude84se on May 21, 2010, 07:26:22 am
Not to mention hard-coding normally makes code more inflexible and difficult to debug.
This is coming along nicely. I'm looking forward to a screenshot. :)
Title: Re: TI Basic Editor
Post by: ztrumpet on May 21, 2010, 03:59:19 pm
This is great!  One suggestion:  I'd make the default cursor width to be 4 because most letters are 4 pixels wide. :)
Calcdude, check the last page... :D (link: http://ourl.ca/4836/90921 )
Title: Re: TI Basic Editor
Post by: Builderboy on May 21, 2010, 06:40:14 pm
Default cursor as in when you are just in empty space?  Or are you suggesting i make the character 2 spaces thinner in general?
Title: Re: TI Basic Editor
Post by: BrandonW on May 22, 2010, 01:18:03 am
keep in mind app compiling on calc will most likely take several minutes, though, according to BrandonW. App compiling would most likely be a computer-only feature

I never wrote a program that re-signed a Flash application, but I did write one that re-signed the OS (and fixed the self-test checksum) at http://brandonw.net/calcstuff/resign.zip , which is basically exactly the same math and would take exactly the same amount of time.

I just thought I'd post the link so you guys could see it for yourself, if you're skeptical. I "hook" into a boot code math subroutine to do the dirty work, which could probably be heavily optimized, but I don't see it taking any less than 5-10 minutes.
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 22, 2010, 01:20:36 am
nice thanks for that link
Title: Re: TI Basic Editor
Post by: meishe91 on May 22, 2010, 02:43:36 am
That looks really cool, Builder! I can't wait to see how this continues to progress :)
Title: Re: TI Basic Editor
Post by: ztrumpet on May 22, 2010, 12:56:00 pm
Default cursor as in when you are just in empty space?  Or are you suggesting i make the character 2 spaces thinner in general?
Empty space. :)
Title: Re: TI Basic Editor
Post by: Builderboy on May 22, 2010, 01:37:30 pm
Ah, well in that case i can just change the width of the ending character and everything will fix itself :) Note that the cursor will be 2 pixels wider when it is over 4 pixel width characters, since it leaves a 1 pixel space to either side.  So if you move the cursor from empty space onto text it will get bigger.  Unfortunately the conj()r command is making it very difficult to implement editing, i might have to just use a For loop.
Title: Re: TI Basic Editor
Post by: ztrumpet on May 23, 2010, 10:20:14 am
Ah, okay. :)  I think the width of the ending character should be 6 then. :D
Title: Re: TI Basic Editor
Post by: Builderboy on May 24, 2010, 11:03:44 pm
Wewt, I have added basic editing to my program! Right now it only supports tokens that are found directly on the calculator keys, and without pressing 2nd or Alpha.  There is also no Deleting or clearing lines yet, although you can add data onto the end of a line making it bigger.  However, it will not resize the program, which means it cuts of data from the end of the program.  This is how it will have to work until i can get the memory management thing working :P

Here is a fun screenie showing the new features!

I am also starting work on implementing 2 byte tokens, which is proving to be a bit tricky.  As of now they just look appear as random symbols ;D
Title: Re: TI Basic Editor
Post by: DJ Omnimaga on May 24, 2010, 11:07:51 pm
wow awesome! And I like how it looks with the cursor. Some people who disliked the BASIC editor due to not showing enough code in the screen will like this. I also think the inverted cursor is a good idea definitively. Keep up the good work!
Title: Re: TI Basic Editor
Post by: Geekboy1011 on May 24, 2010, 11:08:40 pm
awsome dude cant wait to see 2byte token support
Title: Re: TI Basic Editor
Post by: meishe91 on May 24, 2010, 11:14:05 pm
That looks really cool :)
Title: Re: TI Basic Editor
Post by: TIfanx1999 on May 25, 2010, 08:57:49 am
Very nice work! I'd also agree that the inverted cursor looks great as well. =D
Title: Re: TI Basic Editor
Post by: ztrumpet on May 25, 2010, 08:20:30 pm
This looks really nice!  Excellent job on this, I can't wait for more! ;D
Title: Re: TI Basic Editor
Post by: bwang on May 25, 2010, 08:48:28 pm
Beautiful!
Title: Re: TI Basic Editor
Post by: calcdude84se on May 26, 2010, 07:04:09 am
This is coming along nicely. Keep up the good work! :)