Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: cooliojazz on May 20, 2010, 12:07:22 am

Title: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on May 20, 2010, 12:07:22 am
After umpteen-months, I finally finished a semi-functional version of TI-File Editor.  Right now, it can finally open and save programs.  I finally found my error after such a long time of searching (it was very stupid :P) But anyways, i do not have most mdi things working, so just be alert...  Oh, and yes, I know there's no easy way to write things like -> yet... ill work on that next... For now, just copy from an existing file... or wait, did I fix those? idk, oh well... :P  Oh, and encounter any errors? Please tell me :D
Title: Re: TFE - Resurrection
Post by: DJ Omnimaga on May 20, 2010, 12:16:05 am
I'm glad this didn't died, I was worried a few months ago. It looks nice so far. One bug I found tho is when saving as. I got to use the regular save option otherwise I get an error. But it opens files fine and the regular save option saves fine too.

This should be a good offline alternative to the 16 bits TI-Graph Link software. Are you planning to add a command menu at one point?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on May 20, 2010, 12:20:07 am
Mk, I'll look into that.  And definitely.  That's one of the things i'll be working on next...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on May 20, 2010, 12:28:59 am
Ya, same thing as DJ really. Only the saving issue I saw. Opens files great as far as I can tell.

As for the "" though would alt+26 work the same since it displays a "→?" I mean you can type it in fine, I just don't know if it will save correctly.

Great job on this :)
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: ztrumpet on May 20, 2010, 04:51:00 pm
This sounds awesome!  I'm glad it didn't die. :)
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on May 20, 2010, 07:00:58 pm
Mk, I'll look into that.  And definitely.  That's one of the things i'll be working on next...
Glad to hear!

Hopefully this will come handy for people like Juju or Eeems who don't have access to a working calc. Typing programs in WabbitEmu is not always convenient.

For Juju2143, one issue tho is that he uses Linux, but IIRC he has dual-booting
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on May 20, 2010, 07:09:22 pm
Hey, you guys, when getting the error, were you trying to save a new file?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on May 20, 2010, 07:24:41 pm
Yeah, using the save as option, I tried saving under a new file name

Windows 7 64 bit on my side
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on May 20, 2010, 07:27:32 pm
Err, i mean like did you click new file to get a blank one, then try to save it? tho it doesnt sound like you did... which means thats another error x.x Till i update it, (which should be soon) (not like last time's "soon"!) please dont save new files =P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on May 20, 2010, 08:02:00 pm
oh, no, I opened an existing file, edited it a bit, then saved as, under a new name. I did not try with a new file
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on May 20, 2010, 11:20:18 pm
I think I tried both with an existing (re-saving it with "Save-as") and a new one. Got the same message both times.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: Geekboy1011 on May 21, 2010, 12:31:17 am
awsome ive been wondering how this has been progressing great to see ^_^
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on May 23, 2010, 02:13:27 am
Ok, so i seem to have an issue...  People have tried to save files and just gotten random errors that seem to be generated from a mid() somewhere, but ONLY WHEN SAVING AS, not just plain save. So...
1.  Can more people try this and tell me whether they get the error?  Note that i personally have not as of yet been able to recreate it (otherwise i would just be trying to debug this myself all the rest of the night =P)
2.  Does a VB programmer want to look at it and tell me if the see anything?...
Code: [Select]
    Private Sub SaveFile() Handles SaveToolStripButton.Click, SaveToolStripMenuItem.Click
        If Not String.IsNullOrEmpty(CurrentFilePath) Then
            SaveFileRoutine(CurrentFilePath)
        Else
            If SaveTIFile.ShowDialog = DialogResult.OK Then
                SaveFileRoutine(SaveTIFile.FileName)
                UpdateInfo(1) = SaveTIFile.FileName
                UpdateInfo(2) = "1"
            End If
        End If
    End Sub

    Private Sub SaveAsToolStripMenuItem_Click() Handles SaveAsToolStripMenuItem.Click
        If SaveTIFile.ShowDialog = DialogResult.OK Then
            SaveFileRoutine(SaveTIFile.FileName)
            UpdateInfo(1) = SaveTIFile.FileName
            UpdateInfo(2) = "1"
        End If
    End Sub
    Private Function SaveFileRoutine(ByVal FilePath As String)
        Dim FileBytes(1048576) As Byte
        Dim FileBytesCounter1 As Integer = 0
        Dim y As Integer
        Dim CurrentByte As String
        Dim CurrentString As String = ""
        Dim SecondByte As String
        Dim TempContents As String = ProgramContents(CurrentFileNumber)
        While True
            If InStr(TempContents, vbCrLf) Then
                TempContents = Mid(TempContents, 1, InStr(TempContents, vbCrLf) - 1) + "{vbCrLf}" + Mid(TempContents, InStr(TempContents, vbCrLf) + 2, TempContents.Length - InStr(TempContents, vbCrLf))
            Else
                Exit While
            End If
        End While
        For x As Integer = 1 To TempContents.Length
            y = 15
            SecondByte = ""
            CurrentHex = Mid(TempContents, x, y)
            CurrentByte = myTITools.TokenToHex(CurrentHex, SecondByte)
            While CurrentByte = ""
                SecondByte = ""
                CurrentHex = Mid(TempContents, x, y)
                CurrentByte = myTITools.TokenToHex(CurrentHex, SecondByte)
                If y < 1 Then
                    MsgBox("Invalid Character Detected!" & vbCrLf & """" & CurrentHex & """" & vbCrLf & "is not recognized as a usable token for the TI 83+/84+ Series of calculators.")
                    FileBytesCounter1 -= 1
                    GoTo Skip
                End If
                y -= 1
            End While
            If SecondByte = "" Then
                FileBytes(74 + FileBytesCounter1) = cInteger(CurrentByte)
            Else
                FileBytes(74 + FileBytesCounter1) = cInteger(CurrentByte)
                FileBytes(75 + FileBytesCounter1) = cInteger(SecondByte)
                FileBytesCounter1 += 1
            End If
Skip:
            FileBytesCounter1 += 1
            x += y
        Next
        '**TI83F*
        FileBytes(0) = 42
        FileBytes(1) = 42
        FileBytes(2) = 84
        FileBytes(3) = 73
        FileBytes(4) = 56
        FileBytes(5) = 51
        FileBytes(6) = 70
        FileBytes(7) = 42
        '1A,0A,00
        FileBytes(8) = 26
        FileBytes(9) = 10
        FileBytes(10) = 0
        'Comment
        FileComment(CurrentFileNumber).PadRight(42)
        For x As Integer = 0 To 41
            FileBytes(x + 11) = AscW(FileComment(CurrentFileNumber).Chars(x))
        Next
        'Data Size
        If FileBytesCounter1 + 19 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 19, 4)
            FileBytes(54) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(53) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(54) = 0
            FileBytes(53) = FileBytesCounter1 + 19
        End If
        'Random Flag (either B or D)
        FileBytes(55) = 13
        FileBytes(56) = 0
        'Variable Size
        If FileBytesCounter1 + 2 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 2, 4)
            FileBytes(58) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(57) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(58) = 0
            FileBytes(57) = FileBytesCounter1 + 2
        End If
        'Type ID
        FileBytes(59) = 5
        'Name
        FileName(CurrentFileNumber).PadRight(8)
        For x As Integer = 0 To 7
            FileBytes(60 + x) = AscW(FileName(CurrentFileNumber).Chars(x))
        Next
        'Version
        FileBytes(68) = 0
        'Archived
        FileBytes(69) = 0
        'Variable Size Again
        If FileBytesCounter1 + 2 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 2, 4)
            FileBytes(71) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(70) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(71) = 0
            FileBytes(70) = FileBytesCounter1 + 2
        End If
        'Total Token Count
        If FileBytesCounter1 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1, 4)
            FileBytes(73) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(72) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(73) = 0
            FileBytes(72) = FileBytesCounter1
        End If
        'Totals data
        Dim Counter = 0
        For x As Integer = 0 To FileBytesCounter1 + 19
            Counter += FileBytes(x + 55)
        Next
        'Lower 16 bits of data totalled together
        If Hex(Counter).Length > 4 Then Counter = cInteger(Mid(cHex(Counter, 4), cHex(Counter, 4).Length - 4, 4))
        If Counter > 255 Then
            FileBytes(FileBytesCounter1 + 75) = cInteger(Mid(cHex(Counter, 4), 1, 2))
            FileBytes(FileBytesCounter1 + 74) = cInteger(Mid(cHex(Counter, 4), 3, 2))
        Else
            FileBytes(FileBytesCounter1 + 75) = 0
            FileBytes(FileBytesCounter1 + 74) = Counter
        End If
        Dim FinalBytes(FileBytesCounter1 + 75) As Byte
        For x As Integer = 0 To FileBytesCounter1 + 75
            FinalBytes(x) = FileBytes(x)
        Next
        File.WriteAllBytes(FilePath, FinalBytes)
        CurrentBytes = FileBytes
    End Function
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on May 23, 2010, 07:30:56 am
I kinda wish I could help, I haven't done VB in 7 years :(
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on May 23, 2010, 04:13:56 pm
I just tried it again. I get the error whether I use Save, Save-As, or the Save button.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on June 07, 2010, 01:20:18 am
Ok, well I updated quite a bit of stuffs.  The "Save As..." should be working now, file properties works now, new files work, as long as you remember to set the properties before saving, things like copy etc. work now.  And it's less buggy.  And there's a couple aesthetic touchups.  At this point, I might say it's feasible to actually use... except no symbol table yet =P (-> is Alt+0252 if you want it) So here... Please report bugs =D
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on June 07, 2010, 01:23:09 am
cool glad you work it working ^^

I tried save as and it effectively works!

Do you think you could eventually add a feature to convert weird characters so we can copy/paste the source code on forums?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on June 07, 2010, 01:26:00 am
You can pretty much already post all the characters on the forum. As far as I know the only one you can't really is the inverted equal sign.

On topic: Sweet. I'll have to try this out :)
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on June 07, 2010, 04:52:14 am
Nah I tried and a lot turned into stuff like û or ü :(

TI-Graph Link did the exact same thing.

That said, it would also be good to implement CTRL+C/V shortcuts in next version :P

The ability to drag and drop a file on the TFE icon to open them would be nice, too
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: TIfanx1999 on June 07, 2010, 05:17:26 am
Is saving implemented yet? I created a new file and typed in my code. When I try to save it brings up a window to save, but when I click save it gives me this error message:
Code: [Select]
Unhandled exception has occurred in your application. If you click
Continue, the application will ignore this error and attempt to continue. If
you click Quit, the application will close immediatley.

Object reference not set to an instance of an object.

Hitting continue allows the program to continue executing, but does not save the file. I assume there is no syntax checking or a table of tokens yet either, as I couldn't trigger any syntax highlighting nor could i find a token table.

*edit* Just tested saving with someone else's existing file. I opened the file and saved it under a different name and it worked fine. It doesn't seem to like the file I hand typed. I guess it doesn't convert my hand typed ASCII to tokens (yet)?

*edit 2* Oh and as Omni said, some characters appeared as ü or Á or other odd things. I saw this when I opened an actual 8xp file and then re-saved it.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on June 07, 2010, 01:00:12 pm
@DJ Omnimaga: CRTL-C/V is implemented...
@Art_of_camelot: 1. I mentioned this, but i guess didn't explain it: when creating a new file, you have to go to File>File Properties and set the file name (calculator name) and comment, otherwise, you will get what happened to you, which is a null string error, since it has not been set yet.  Something I meant to do (Make it set to a default value) but forgot. I'll do it in the next version. 2. See 1. for reason yours didn't save.  3.  Do you have the TI83P-PC font installed on your computer?  Cause it should show everything fine... unless it resorts to a standard font =P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: TIfanx1999 on June 07, 2010, 01:21:02 pm
Ah, ok. I wondered what that box was for, I thought it seemed out of place. And no, I don't have a TI83 font installed. I just kind of assumed the program would support those characters or if it needed an extra font that it would have it included. (I don't really program BASIC on PC).
I'll see if I can test it a bit more later. :)
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on June 07, 2010, 01:36:16 pm
@DJ Omnimaga: CRTL-C/V is implemented...
Strange, on my Windows 7 (64 bit) computer it does nothing at all...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on June 07, 2010, 01:38:14 pm
Huh, odd... Does clicking them from the menu bar up top do anything?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on June 07, 2010, 01:41:20 pm
It does, same for right clicking. Just the keyboard shortcuts do nothing
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on June 07, 2010, 01:43:48 pm
Huh, well... No clue... Does it list the keyboard shortcuts next to the menu items?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on June 07, 2010, 01:49:42 pm
Yeah it does.

ALso selecting File->New does nothing, same for CTRL+N. I need to use the icon below the menu bar.

Also selecting all with CTRL+A or from the top menu causes an error similar to what Art_Of_Camelot reported. Right-click then choosing "Select all" works fine, though.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on June 07, 2010, 01:52:40 pm
Well, I don't know... I'll look into that...  And yeah, I don't think I added that one yet, I'll do that too... And that doesn't work?... x.x
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on June 07, 2010, 06:17:53 pm
Ok, all the Ctrl shortcuts and the other new button *should* work now. I also added a symbol palate. (under tools) Yes, I know, there's no logical organization. (Well, technically there is, i guess just not useful organization) I also cleaned up a couple of other routines.  And DJ, you should be able to drag and drop to open. I have no clue when that stopped working... x.x I also stuck the font it needs in there for you who dont have it... :P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on June 08, 2010, 12:48:09 am
It seems to work fine now ^^

Just one thing, though, I am not sure if Texas Instruments allows to redistribute their fonts with your program without their permission.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on June 19, 2010, 05:29:54 pm
Question: In future versions of the file editor, are you planning to support the new Axe tokens? You would just need to detect if the program code starts with a dot and it would parse the changed tokens differently.

It might make editing Axe programs easier for when Axe language will use a lot of modified token names.

EDIT: With the option to disable them, maybe, especially for the earliest versions of Axe supporting them, since the old tokens are being gradually phased out, not instantly
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on June 19, 2010, 05:36:23 pm
Umm, I was thinking of adding a setting to toggle axe tokens on or off, not just turning them on for all "axe" programs, since some people might still not want to use them, but yeah, i'll add something like that... =P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on August 18, 2010, 02:59:52 am
Ok, new version out that fixed a couple bugs, optimized a bit, and added primitive syntax highlighting which was a b*tch to add, if i do say so myself.  The stage it's at right now just attempts to highlight If, While, and Repeat blocks, which it can do most of the time.  I mostly am just releasing it at this stage to get feedback on how you guys think it should look etc.  Enjoy, and please comment! =D
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on August 18, 2010, 03:14:18 am
I'm glad this is progressing again. I still got a few save errors, though, but it seemed random. At first I tried saving a file and when I opened it, the code seemed broken. Afterward it wouldn't let me save anything anymore :(, then it crashed. Syntax highlighting seemed to work fine from what I seen, although I did not check very hard. I think the colors should be different, though, because gray seems a bit hard to read. Maybe like green for if, yellow for while, light blue for repeat and orange for For(). Also alternating between a lighter and darker color for each nested loops/ifs would be easier to read too.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on August 23, 2010, 02:24:45 am
Ok, I finished block highlighting, anything else you guys would like to see added to the highlighting while I'm working on this part?  Also, Dj, errors... when? How?  That always helps getting rid of them... =P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on August 23, 2010, 03:00:15 am
I'Ll try this version tomorrow, hopefully, and try to track when the errors occurs in particular.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: matthias1992 on August 23, 2010, 05:12:38 am
sorry for the bump but:
Code: [Select]
      While True
            If InStr(TempContents, vbCrLf) Then
                TempContents = Mid(TempContents, 1, InStr(TempContents, vbCrLf) - 1)
+ "{vbCrLf}" + Mid(TempContents, InStr(TempContents, vbCrLf)
+ 2, TempContents.Length - InStr(TempContents, vbCrLf))
            Else
                Exit While
            End If
        End While
The above section, couldn't that be:
Code: [Select]
While InStr(TempContents, vbCrLf)
                TempContents = Mid(TempContents, 1, InStr(TempContents, vbCrLf) - 1) + "{vbCrLf}"
+ Mid(TempContents, InStr(TempContents, vbCrLf)
+ 2, TempContents.Length - InStr(TempContents, vbCrLf))
    End While
Maybe I have drawn it out of context but i think it is a fair ,albeit small, optimization.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on August 23, 2010, 02:43:28 pm
How do you actually disassemble VB executables? O.o
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: qazz42 on August 23, 2010, 03:43:43 pm
This is in VB? Woah!
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on August 23, 2010, 05:08:09 pm
@matthias Yeah, actually I could, I just didn't notice.  That particular section of code is old...
@qazz42 It is, is it really that surprising? :P  Although, I do have to say I was happy that the current highlighting isn't slowing down the text editing speed so far as I can tell...  ;D
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 12, 2010, 11:56:57 pm
Random Update: I added Axe Tokens...If the saving is not perfect, please tell me! I have this strange feeling i am doing somethign wrong, but I don't know what, and it's working so far... =P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on September 12, 2010, 11:58:42 pm
Cool an update! I'll load some Axe progs into it when I get around testing it.

If saving fails, will you post the source code for it in the non calc dev section? Someone may be able to help. I think a few others know VB here
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 13, 2010, 12:06:20 am
(I accidentally posted the wrong version, that was the one where I was working on the picture interface, so clicking new would have failed... Try this one)
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on September 17, 2010, 04:14:12 am
Do you plan on adding the Greek letters into this? I just noticed that it doesn't show them correctly and such so I figured they weren't added.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 17, 2010, 09:31:55 am
99% of tokens are added, only a couple of the "BBxx" tokens and the bold N, since it's not in their font set and I'll need to fix that... Anyways, what I'm saying is they are added...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: LordConiupiter on September 17, 2010, 09:43:56 am
i see it doesn't matter wheter you write If...Then...End, or just only If, it just starts a new highlight block, while the End command will be never found while looping through the code. so there is an error in the syntax highlighting: when there is a single If in BASIC (not in Axe), just only the next expression* should be highlighted is that color, not all the other code in the file.

Then there is a question you will now the answer to (I think): which type of checksum is used in the program header?

*this is not necessarily the next line, because there can just be a semicolon between the If statement and the next expression
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 17, 2010, 11:20:18 am
Oh, yeah, I need to fix that.  Cause, you know, that part was harder to do the incomplete ones, so I did the straight ifs first, and yeah, i forgot to add those.  And what do you mean by "checksum"?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: LordConiupiter on September 17, 2010, 01:26:14 pm
well, I don't really know how to explain. when you want to write a 8xp file that could also be send using TIconnect, it should have a valid checksum or so stored in the first few bytes of the file. when that is not done correctly, TIconnect wouldn't send it to the calc, and perhaps even other linking programs won't do it. I would like to know how to create that checksum, so I can write valid 8xp files, so I don't have to export all my data created by my progs in plain text, and then use cemetech or your prog.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 17, 2010, 01:56:39 pm
O... well, theres a whole format, not just a single checksum...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: LordConiupiter on September 17, 2010, 02:22:31 pm
which class is for writing the file?

EDIT: I found it!
am I allowed to use your code?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on September 17, 2010, 05:51:21 pm
99% of tokens are added, only a couple of the "BBxx" tokens and the bold N, since it's not in their font set and I'll need to fix that... Anyways, what I'm saying is they are added...

Hmmm, odd. I tried just loading a program that has the Omnimaga logo (lowercase Sigma, "m," Pi, imaginary number i, "m," Alpha, "g," Alpha) and it doesn't show correctly.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 17, 2010, 06:42:43 pm
Hmm, ok it seems that that "o" is one the couple BBxx tokens I didn't add... sorry I misspoke. the "a" is definitely added there as an "a" tho, I don't know why it would be showing "n" (the letters in quotes are the special symbols im to lazy to find to copypasta :P)
@LordConiupiter Sure, but that code might not really work too well (be easy to work with), If you want, I could wrap it  into an easy function that you can just copy in if you want...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on September 17, 2010, 08:31:52 pm
Ah ok. Well what's up with the cosh-1? :P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 17, 2010, 10:21:29 pm
Well, since it's unsure whether it's one or two bytes, it just tells you both then skips one. AKA "CB" = "cosh-1", since it just skipped the CB (I mean BB :P) part...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on September 17, 2010, 10:22:14 pm
Ah ok. Gotcha.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on September 19, 2010, 05:54:40 pm
Well I found a bug. When a program is being opened that has the expr( it displays it as "Exch(" as individual tokens.

Also, I don't think this is a bug in the program but for what ever reason this won't just start up from the executable. I have to run it from the executable inside the .zip file ??? Just thought I'd mention that since it involves it.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 19, 2010, 07:46:14 pm
First of all, that sounds like you are reporting a bug in the axe recognition.  But... What do you mean by ""Exch(" as individual tokens."? And about that... Umm... I really don't know, thats really odd...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on September 19, 2010, 08:21:55 pm
What do you mean about the Axe thing? expr( isn't an Axe token, nor was this an Axe program. I'm confused.

As for what I mean. I mean when the program with expr( opened up at each place where expr( was it showed "Exch(." Then when I moved it back to a calculator, I did it before I noticed the bug, it was like someone just used [ALPHA] to type each letter and parenthesis in. Make more sense?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 19, 2010, 08:27:09 pm
I just checked ma' 4.3 documentation, expr() = Exch()... And thats what I mean by a bug with Axe recognition, it thinks a non-Axe program is axe.  Gotta fix that... =P Thats weird its doing that tho... its just doing that with axe replaced tokens, right?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: meishe91 on September 19, 2010, 08:40:44 pm
Oh ok, my bad. I didn't know Exch( was a Axe token. But even if it is a Axe token shouldn't it have saved it as if it were expr(, or something like that?

As far as I know it's just doing it with that. I haven't tested anything else.
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 19, 2010, 08:58:48 pm
That just means I messed up when modding my de-tokenizing routine to allow for two different types of tokens, joy, now thats like 3 major bugs... Ok, I'll try and fix it by tonight or tomorrow night...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 20, 2010, 02:39:31 am
Ok, I fixed Axe recognition, (It shows in the title bar if it's axe or not now =P) and I *think* got rid of the messed up detokenizing, which was majorly linked to axe recognition. Yes, I still need to fix the single if highlighting in regular programs... Hmm, I don't even remember, were there any other bugs I was supposed to be fixing? =P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: LordConiupiter on September 20, 2010, 02:53:06 am
Hmm, ok it seems that that "o" is one the couple BBxx tokens I didn't add... sorry I misspoke. the "a" is definitely added there as an "a" tho, I don't know why it would be showing "n" (the letters in quotes are the special symbols im to lazy to find to copypasta :P)
@LordConiupiter Sure, but that code might not really work too well (be easy to work with), If you want, I could wrap it  into an easy function that you can just copy in if you want...
well, if it's not too much trouble, I really would appreciate it!
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 20, 2010, 03:11:24 am
Spoiler For Not too much trouble ;D:
Code: [Select]
  Public Function GenerateFile(ByVal File_Bytes() As Byte, ByVal File_Name As String, ByVal File_Comment As String)
        Dim FileBytes(1048576) As Byte
        Dim FileBytesCounter1 As Integer = File_Bytes.Length
        Dim FileComment = File_Comment
        Dim FileName = File_Name
        '**TI83F*
        FileBytes(0) = 42
        FileBytes(1) = 42
        FileBytes(2) = 84
        FileBytes(3) = 73
        FileBytes(4) = 56
        FileBytes(5) = 51
        FileBytes(6) = 70
        FileBytes(7) = 42
        '1A,0A,00
        FileBytes(8) = 26
        FileBytes(9) = 10
        FileBytes(10) = 0
        'Comment
        FileComment = FileComment.PadRight(42, ChrW(0))
        For x As Integer = 0 To 41
            FileBytes(x + 11) = AscW(FileComment.Chars(x))
        Next
        'Data Size
        If FileBytesCounter1 + 19 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 19, 4)
            FileBytes(54) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(53) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(54) = 0
            FileBytes(53) = FileBytesCounter1 + 19
        End If
        'Random Flag (either B or D)
        FileBytes(55) = 13
        FileBytes(56) = 0
        'Variable Size
        If FileBytesCounter1 + 2 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 2, 4)
            FileBytes(58) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(57) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(58) = 0
            FileBytes(57) = FileBytesCounter1 + 2
        End If
        'Type ID
        FileBytes(59) = 5
        'Name
        FileName = FileName.PadRight(8, ChrW(0))
        For x As Integer = 0 To 7
            FileBytes(60 + x) = AscW(FileName.Chars(x))
        Next
        'Version
        FileBytes(68) = 0
        'Archived
        FileBytes(69) = 0
        'Variable Size Again
        If FileBytesCounter1 + 2 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 2, 4)
            FileBytes(71) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(70) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(71) = 0
            FileBytes(70) = FileBytesCounter1 + 2
        End If
        'Total Token Count
        If FileBytesCounter1 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1, 4)
            FileBytes(73) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(72) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(73) = 0
            FileBytes(72) = FileBytesCounter1
        End If
        'Totals data
        Dim Counter = 0
        For x As Integer = 0 To FileBytesCounter1 + 19
            Counter += FileBytes(x + 55)
        Next
        'Lower 16 bits of data totalled together
        If Hex(Counter).Length > 4 Then Counter = cInteger(Mid(cHex(Counter, 4), 1, 4))
        If Counter > 255 Then
            FileBytes(FileBytesCounter1 + 75) = cInteger(Mid(cHex(Counter, 4), 1, 2))
            FileBytes(FileBytesCounter1 + 74) = cInteger(Mid(cHex(Counter, 4), 3, 2))
        Else
            FileBytes(FileBytesCounter1 + 75) = 0
            FileBytes(FileBytesCounter1 + 74) = Counter
        End If
        Dim FinalBytes(FileBytesCounter1 + 75) As Byte
        For x As Integer = 0 To FileBytesCounter1 + 75
            FinalBytes(x) = FileBytes(x)
        Next
        Return FinalBytes
    End Function

    Shared Function cHex(ByVal IntValue As Integer, ByVal Length As Integer) As String
        Dim Int_Length As Integer = Int(Math.Log10(IntValue) / Math.Log10(16)) + 1
        Dim Temp_Value As Integer
        Dim Hex_String As String = ""
        For X As Integer = Length - 1 To 0 Step -1
            Temp_Value = Int(IntValue / (16 ^ X))
            Hex_String += Mid("0123456789ABCDEF", Temp_Value + 1, 1)
            IntValue -= Temp_Value * (16 ^ X)
        Next
        Return Hex_String
    End Function

    Shared Function cInteger(ByVal HexString As String) As Integer
        Dim Int_Value As Integer
        For X As Integer = HexString.Length To 1 Step -1
            Int_Value += (InStr("0123456789ABCDEF", Mid(HexString, X, 1)) - 1) * (16 ^ (HexString.Length - X))
        Next
        Return Int_Value
    End Function
It takes an array of bytes which consists of the data you want put into the program, a string which is the eight or less on calc program name, and a string which is a... (either 40 or 42 i can't remember) or less file comment, which is mostly pointless, but can be set anyways...  :P
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on September 20, 2010, 03:54:43 am
I like the code highlighting so far. I noticed a few issues, though (see screenie) D:

Also what's with the "the game" in the code? I lost :( (it wasn't even part of the code x.x)
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 20, 2010, 11:12:42 am
...Yes, I still need to fix the single if highlighting in regular programs...
Yes,  I know that's an issue =P
And... What?!?!? XD
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on September 20, 2010, 11:26:11 am
Oh ok I wasn't too sure since a Repeat was involved in the code. But yeah check in the code where it says "If The Game". I never actually wrote that code. It appears in your editor for some reasons. Invalid/unrecognized token?
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: matthias1992 on September 20, 2010, 11:28:24 am
Oh ok I wasn't too sure since a Repeat was involved in the code. But yeah check in the code where it says "If The Game". I never actually wrote that code. It appears in your editor for some reasons. Invalid/unrecognized token?
Mission objective completed: easter egg found.

I guess...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on September 20, 2010, 11:44:04 am
Maybe it's an easter egg for when TFE cannot recognize a token in particular.

Or the program got corrupted. I'll redownload it later to see...
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 20, 2010, 01:14:15 pm
Umm, as far as I know, I never typed the words "the game" in any part of the program... x.x
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: DJ Omnimaga on September 20, 2010, 01:21:01 pm
Ok I just discovered it was the same file I used when I tested TFE over a month ago, my bad x.x

I modified it a bit back then but I did not realize I saved it x.x. Sorry
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: cooliojazz on September 20, 2010, 01:48:09 pm
O, *Phew* that makes me feel a bit better, cause that was really strange... Hmm, that is a good idea for a future addition tho... O_o
Title: Re: TFE - Resurrection (TI-File Editor)
Post by: LordConiupiter on September 20, 2010, 04:25:28 pm
Spoiler For Not too much trouble ;D:
Code: [Select]
   Public Function GenerateFile(ByVal File_Bytes() As Byte, ByVal File_Name As String, ByVal File_Comment As String)
        Dim FileBytes(1048576) As Byte
        Dim FileBytesCounter1 As Integer = File_Bytes.Length
        Dim FileComment = File_Comment
        Dim FileName = File_Name
        '**TI83F*
        FileBytes(0) = 42
        FileBytes(1) = 42
        FileBytes(2) = 84
        FileBytes(3) = 73
        FileBytes(4) = 56
        FileBytes(5) = 51
        FileBytes(6) = 70
        FileBytes(7) = 42
        '1A,0A,00
        FileBytes(8) = 26
        FileBytes(9) = 10
        FileBytes(10) = 0
        'Comment
        FileComment = FileComment.PadRight(42, ChrW(0))
        For x As Integer = 0 To 41
            FileBytes(x + 11) = AscW(FileComment.Chars(x))
        Next
        'Data Size
        If FileBytesCounter1 + 19 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 19, 4)
            FileBytes(54) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(53) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(54) = 0
            FileBytes(53) = FileBytesCounter1 + 19
        End If
        'Random Flag (either B or D)
        FileBytes(55) = 13
        FileBytes(56) = 0
        'Variable Size
        If FileBytesCounter1 + 2 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 2, 4)
            FileBytes(58) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(57) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(58) = 0
            FileBytes(57) = FileBytesCounter1 + 2
        End If
        'Type ID
        FileBytes(59) = 5
        'Name
        FileName = FileName.PadRight(8, ChrW(0))
        For x As Integer = 0 To 7
            FileBytes(60 + x) = AscW(FileName.Chars(x))
        Next
        'Version
        FileBytes(68) = 0
        'Archived
        FileBytes(69) = 0
        'Variable Size Again
        If FileBytesCounter1 + 2 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1 + 2, 4)
            FileBytes(71) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(70) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(71) = 0
            FileBytes(70) = FileBytesCounter1 + 2
        End If
        'Total Token Count
        If FileBytesCounter1 > 255 Then
            Dim TempHex = cHex(FileBytesCounter1, 4)
            FileBytes(73) = cInteger(Mid(TempHex, 1, 2))
            FileBytes(72) = cInteger(Mid(TempHex, 3, 2))
        Else
            FileBytes(73) = 0
            FileBytes(72) = FileBytesCounter1
        End If
        'Totals data
        Dim Counter = 0
        For x As Integer = 0 To FileBytesCounter1 + 19
            Counter += FileBytes(x + 55)
        Next
        'Lower 16 bits of data totalled together
        If Hex(Counter).Length > 4 Then Counter = cInteger(Mid(cHex(Counter, 4), 1, 4))
        If Counter > 255 Then
            FileBytes(FileBytesCounter1 + 75) = cInteger(Mid(cHex(Counter, 4), 1, 2))
            FileBytes(FileBytesCounter1 + 74) = cInteger(Mid(cHex(Counter, 4), 3, 2))
        Else
            FileBytes(FileBytesCounter1 + 75) = 0
            FileBytes(FileBytesCounter1 + 74) = Counter
        End If
        Dim FinalBytes(FileBytesCounter1 + 75) As Byte
        For x As Integer = 0 To FileBytesCounter1 + 75
            FinalBytes(x) = FileBytes(x)
        Next
        Return FinalBytes
    End Function

    Shared Function cHex(ByVal IntValue As Integer, ByVal Length As Integer) As String
        Dim Int_Length As Integer = Int(Math.Log10(IntValue) / Math.Log10(16)) + 1
        Dim Temp_Value As Integer
        Dim Hex_String As String = ""
        For X As Integer = Length - 1 To 0 Step -1
            Temp_Value = Int(IntValue / (16 ^ X))
            Hex_String += Mid("0123456789ABCDEF", Temp_Value + 1, 1)
            IntValue -= Temp_Value * (16 ^ X)
        Next
        Return Hex_String
    End Function

    Shared Function cInteger(ByVal HexString As String) As Integer
        Dim Int_Value As Integer
        For X As Integer = HexString.Length To 1 Step -1
            Int_Value += (InStr("0123456789ABCDEF", Mid(HexString, X, 1)) - 1) * (16 ^ (HexString.Length - X))
        Next
        Return Int_Value
    End Function
It takes an array of bytes which consists of the data you want put into the program, a string which is the eight or less on calc program name, and a string which is a... (either 40 or 42 i can't remember) or less file comment, which is mostly pointless, but can be set anyways...  :P
thank you very very very much!