Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: squidgetx on January 22, 2011, 12:00:34 pm

Title: XXEdit
Post by: squidgetx on January 22, 2011, 12:00:34 pm
Another development tool I made to help myself figure out bugs with Ash: Phoenix...It's a memory viewer! Allows you to look at every address (0000 through FFFF) of your calculator's RAM and their contents. (Like Calcsys' hex editor, but more Axe user friendly)

Controls:
Arrow keys; move cursor around
1-6: Jump to memory locations L1-L6
XT0N: Jump to variables A through theta
/:Jump backwards by $1000 (4096)
*:Jump forwards by $1000
-:jump backwards by $100 (256)
+:jump forwards by $100
GRAPH: Goto 2 byte memory address pointed to by the current selection
Clear: quit

The cursor highlights the value of the byte you are looking at in hex and in ASCII (like calcsys)
In the upper left hand corner the 8x8 sprite starting at your cursor position is displayed
In the lower left hand corner the memory address your cursor is at is displayed in 3 different formats: hex, decimal, and the form Ln+(something) (displays the variable you are looking at if you are looking at variables)
In the bottom part of the screen there are two numbers: the value of the byte in decimal, and the value of the two-byte number little-endian (aka normal) starting at your cursor position.

Run with Asm(). Post comments/feedback/possible feature requests  ;D
Title: Re: Axe Memory Mapper
Post by: Michael_Lee on January 22, 2011, 12:03:42 pm
This program is so incredibly win that I'm going to download it, even though I don't actually need it at the moment.

Note: Does the Mapper program use L1-L6 or any of the variables?
Because I keep seeing the string 'Mapper' in L1...
Title: Re: Axe Memory Mapper
Post by: Binder News on January 22, 2011, 12:10:06 pm
Seriously! I made something like this a while ago, but it just displayed the associated characters, all in a row. Nothing useful, just fun.
But still, awesome, will download
Title: Re: Axe Memory Mapper
Post by: kindermoumoute on January 22, 2011, 12:11:30 pm
Woa, a dangerous program ! :D
Title: Re: Axe Memory Mapper
Post by: squidgetx on January 22, 2011, 12:16:17 pm
This program is so incredibly win that I'm going to download it, even though I don't actually need it at the moment.

Note: Does the Mapper program use L1-L6 or any of the variables?
Because I keep seeing the string 'Mapper' in L1...
Thanks. Besides L6 (the screen buffer), the mapping program doesn't use any of the saferam areas L1-L5. I don't know why "MAPPER" would appear in L1...unless it got written there from the transfer? It also uses variables, but before it's run it copies all the variables to $8000 (which is what you are really looking at when you hit XT0N) and when you exit it copies them all back. So no, it doesn't use any variables ;)
Title: Re: Axe Memory Mapper
Post by: Happybobjr on January 22, 2011, 12:17:43 pm
What use would this be?   (Happybobjr has no experience with these things)
Title: Re: Axe Memory Mapper
Post by: Michael_Lee on January 22, 2011, 12:20:18 pm
Hmm, I think it was DoorsCS - I tried running another program in archive using Doors then your program unarchived normally, and I saw the string for the other program's name instead of Mapper.

edit: If I'm writing data to L1, and I'm not sure if what I'm sticking in there was what I intended, then I could use this to check it out.
Title: Re: Axe Memory Mapper
Post by: Deep Toaster on January 22, 2011, 01:59:47 pm
Awesome! I needed that. And a feature suggestion: search?
Title: Re: Axe Memory Mapper
Post by: SirCmpwn on January 22, 2011, 02:05:00 pm
Very nice!  I made something very similar a while ago, but never released it.  I need to make something similar to include in my Debugger suite, if I ever finish it.
Title: Re: Axe Memory Mapper
Post by: Deep Toaster on January 22, 2011, 02:15:26 pm
Oh, yeah, and suggestion: memory bank switching is really important for a mem viewer.
Title: Re: Axe Memory Mapper
Post by: squidgetx on January 22, 2011, 04:33:55 pm
What kind of search function? Input a number, return all locations of said number? Also, what are mem banks (lol)
Title: Re: Axe Memory Mapper
Post by: yunhua98 on January 22, 2011, 04:40:39 pm
I'm really gonna need this to figure map bugs lol.  Very nice!
Title: Re: Axe Memory Mapper
Post by: Builderboy on January 22, 2011, 04:48:41 pm
Maybe where you can search for a string of numbers?
Title: Re: Axe Memory Mapper
Post by: Deep Toaster on January 23, 2011, 12:35:25 pm
What kind of search function? Input a number, return all locations of said number? Also, what are mem banks (lol)


A string of hex, maybe? It gets really useful for recovering data :D

As for mem banks, it's like this: The addresses you use for memory go from $0000 to $FFFF. $8000 and above are used for RAM (hence 32768 bytes of ram on a TI-83 Plus). $0000 to $3FFF are used for OS page 0. $4000 through $7FFF are used for the entire archive. Obviously, 16384 pointers can't point to each byte in the entire flash memory, so the calc uses a port (or two) for mem bank switching.

Basically, at any given point the data from $4000 to $7FFF point to one flash page. This could be almost any flash page in memory, but the point (no pun intended) is that while it's pointing to that page, you can read from that page only. If you want to switch to a different flash page, you send that byte to port 6. Then the data from $4000 to $7FFF would represent that page.

https://docs.google.com/viewer?url=http://education.ti.com/calculators/downloads/US/Software/Download/en/6142/6584/sdk83pguide.pdf for more info.
Title: Re: Axe Memory Mapper
Post by: squidgetx on January 23, 2011, 02:00:54 pm
Thanks for the explanation. [friendlysarcasm]I like how you pointed to the massive 188 page SDK for "more info" lol [/fs]

Ok, so here are the features I am planning to add (was going to add them last night but then I got tired :P)
-mem bank switching (thanks dthought)
-search for a program/appvar
-search for a hex string up to 8 bytes long
-search for a character string. supports A-Z, a-z, theta, and 0-9
-binary display of byte you are currently viewing

thanks to calcdude and graphmastur for providing the asm code for mem bank switching: if anyone wants them, here they are: Asm(DB066F)^256 gives you the current page, and Page#Asm(7DD306) switches the page to page Page#
Title: Re: Axe Memory Mapper
Post by: calcdude84se on January 23, 2011, 03:08:32 pm
Glad to help, and I'm sure graph was too :D
Can't wait for an updated version with bank-swapping support! :) (at which point I will download it ;D)
Title: Re: Axe Memory Mapper
Post by: jnesselr on January 23, 2011, 03:30:20 pm
*graphmastur, and glad I could help. ;-)
Title: Re: Axe Memory Mapper
Post by: calcdude84se on January 23, 2011, 03:32:22 pm
I call you graph for short, graphmastur :P
Title: Re: Axe Memory Mapper
Post by: calc84maniac on January 23, 2011, 03:48:37 pm
I think you can also read from any archive page in pure Axe by modifying the File objects directly. If I'm not mistaken, it would work like:
Code: [Select]
Address->{°Y1}r
Page->{°Y1+2}
.Now use {Y1} to read the byte

Edit:
Forgot the "r" after the address store.
Title: Re: Axe Memory Mapper
Post by: squidgetx on January 23, 2011, 06:18:35 pm
Update! Woah, look at all this cool stuff :D
Controls for all this new stuff:
Press MODE to open the search menu. From there, decide what you want to search for (2nd+arrow keys), then type in the name of what you want to search for, then press 2nd to search for it!
If you aren't looking for a program/appvar, you have the choice of starting from your current position (Find Next) or from the beginning of RAM (Find First: $8000). Note that you can search inside of archive by moving the cursor to any position before $8000.
If you are looking for a program/appvar, the mapper will automatically jump to the location of the program/appvar. If the program/appvar is in RAM, the page will be changed automatically for you. :)
I also added a new shortcut key: pressing 8 will take you to $4000, or the current page of flash. To change the memory bank, simply press Y= and use the arrow keys to select which page you want to switch to. WARNING: I did not put any restrictions on which banks you can switch to. You can attempt to switch to any bank between 0 and 255. Be warned that switching to a bank that does not exist could, at the very least, cause a RAM clear Apparently, it doesn't :P My bad. But I still wouldn't try it if I were you XD

Enjoy! :D
Title: Re: Axe Memory Mapper
Post by: Deep Toaster on January 23, 2011, 06:38:54 pm
Thanks for the explanation. [friendlysarcasm]I like how you pointed to the massive 188 page SDK for "more info" lol [/fs]

At least I didn't link you to the system routines PDF (506 pages) ;D
Title: Re: Axe Memory Mapper
Post by: jnesselr on January 23, 2011, 07:38:14 pm
I call you graph for short, graphmastur :P
I go by pretty much anything but graphy. ;-)
Title: Re: Axe Memory Mapper
Post by: DJ Omnimaga on January 24, 2011, 01:27:34 am
THis looks pretty nice. I doubt I'll mess much with it, though, since I'm not experienced much with reading memory stuff, although it might be useful eventually to debug and stuff.
Title: Re: Axe Memory Mapper
Post by: calcdude84se on January 24, 2011, 07:54:44 am
WARNING: I did not put any restrictions on which banks you can switch to. You can attempt to switch to any bank between 0 and 255. Be warned that switching to a bank that does not exist could, at the very least, cause a RAM clear
Actually, just to clarify, it shouldn't ;D. On the 83+SE and 84+(SE), the calculator simply ignores bits that don't mean anything (so $92 is the same as $82, for example). Apparently the 83+ is stranger, and swapping in something out of range gets you an unpredictable page, but AFAIK it shouldn't crash. :)
Also, nice to see an update! :D
Title: Re: Axe Memory Mapper
Post by: DJ Omnimaga on January 27, 2011, 08:42:37 pm
Cool to see it released :D

You should make a screenshot.
Title: Re: Axe Memory Mapper
Post by: squidgetx on January 31, 2011, 06:39:23 pm
I'm now planning to turn this into a fully fledged hex editor complete with sprite support too as well as some other stuff I thought up. I'll start on it as soon as I can get (and keep) Axe .4.8 onto my calc (If you want to know why, its a long story and it has to do with Ash:Phoenix and the new line routine that doesn't clip; basically Runer112 and I are working on trying to rewrite a section of code so that I can use .4.8 with it)
Title: Re: Axe Memory Mapper
Post by: DJ Omnimaga on February 01, 2011, 11:12:51 pm
Yeah I remember about Axe line clipping. You use 4.6, right? Also I'm glad to hear about the ideas. It would be nice to have sprite editing and other features integrated in this. :)
Title: Re: Axe Memory Mapper
Post by: squidgetx on February 02, 2011, 09:50:21 am
I finally got 0.4.8 :D. Runer112 managed to help me rewrite a few routines so that they don't need the clipped lines.

I tried working on this yesterday, but the program began really messing up...pressing Down acted as if I was pressing Graph...I think I have too many getkey()'s XD To fix this, I think I'll change it to BASIC style getkey->var...
Title: Re: Axe Memory Mapper
Post by: Happybobjr on February 02, 2011, 09:51:58 am
So is that why pressing up acts if i press left on one of my calcs?
Title: Re: Axe Memory Mapper
Post by: squidgetx on February 02, 2011, 09:53:49 am
Perhaps...I suspect that maybe an overload of getkey()s can make it behave oddly (I don't know for sure though). I had about 20 If getkey() statements, and adding the 21st made it start acting up. RAM clearing didn't help either, only removing the new features I added did. I'll let you know if I manage to figure it out...
Title: Re: Axe Memory Mapper
Post by: DJ Omnimaga on February 02, 2011, 07:18:29 pm
Weird, Does the new Axe limits the amount of different keys that can be used per program?
Title: XXEdit 1.0
Post by: squidgetx on February 02, 2011, 07:52:36 pm
http://www.omnimaga.org/index.php?action=downloads;sa=view;down=627

XXEdit (aXe heX Editor) is the evolution of my old Axe Memory Mapper. It is a comprehensive memory mapper and editor for the z80 series, designed to be a superfunctional form of Calcsys. It is highly useful for helping debug Axe and assembly programs on calc.
Features:
Memory bank switching
Display of addresses in hex, decimal, and in the form of pointer+offest
Quick access to L1 (saveSScreen), L2 (StatVars), L3 (appBackUpScreen), L4 (tempSwapArea), L5 (textShadow), L6 (plotSScreen), $4000 (the start of Flash), and $8000 (the start of RAM and appData)
Display of byte in hex, binary, decimal, ascii, the two byte number at that point, and the 8x8 sprite of the 8 bytes at the cursor position
Jumping to the currently highlighted two byte address
Jumping to any user defined hex address
Search for any 8 byte string. Accepts input in both hex and ascii
Search for any program/protected program/appvar in RAM or archive.
Edit up to 8 bytes at a time of current cursor position, input accepted as hex or ASCII
Edit via sprite editing of the 8 bytes at the current cursor position
And probably something else I forgot...

(http://img.removedfromgame.com/imgs/xxedit1.gif) (http://img.removedfromgame.com/imgs/xxedit2.gif)
Title: Re: XXEdit 1.0
Post by: Deep Toaster on February 02, 2011, 08:24:15 pm
XXEdit (aXe heX Editor) is the evolution of my old Axe Memory Mapper. It is a comprehensive memory mapper and editor for the z80 series, designed to be a superfunctional form of Calcsys. It is highly useful for helping debug Axe and assembly programs on calc.

:banghead: I just made that last week: a Calcsys replacement (since it's hard for me to redownload it).

But yours sounds great! :) That dynamic sprite feature is awesome.
Title: Re: XXEdit 1.0
Post by: squidgetx on February 02, 2011, 09:17:29 pm
Thanks.

Unfortunately, I've found a rather serious bug lol. It leads to a mess of garbled text followed by a spectacular ran clear. It's actually kind of cool. It's triggered by trying to change the value of a single byte to $00. So uh, yeah, don't try that. I'm going to have to rewrite how this thing handles hex input... Mergh
Title: Re: XXEdit 1.0
Post by: Deep Toaster on February 03, 2011, 12:01:36 am
Thanks.

Unfortunately, I've found a rather serious bug lol. It leads to a mess of garbled text followed by a spectacular ran clear. It's actually kind of cool. It's triggered by trying to change the value of a single byte to $00. So uh, yeah, don't try that. I'm going to have to rewrite how this thing handles hex input... Mergh

We should compile a list of the best RAM clear screenshots ever :D

Just wondering, why (not) $00?
Title: Re: XXEdit 1.0
Post by: squidgetx on February 03, 2011, 07:12:13 am
Basically because, since you are allowed to enter a variable amount of hex, I use 00 as the 'null byte' to determine the end of where the engine should stop copying hex. So I'm guessing entering $00 tells the engine to copy something with 0 length, which it does not like at all. Anyway, here's the patched version XD
Title: Re: XXEdit 1.0
Post by: DJ Omnimaga on February 03, 2011, 09:42:05 am
Seems pretty cool Squidgetx. I'M glad to see this is being developed more. :D
Title: Re: XXEdit 1.0
Post by: ACagliano on February 03, 2011, 01:31:53 pm
As perhaps a feature request, maybe there should be an option where you can, if searching for a program or something, there is an option to display the z80 dissassembly of the program.
Title: Re: XXEdit 1.0
Post by: squidgetx on February 03, 2011, 05:24:26 pm
Hm, that would be cool, although I'm not sure I'd like to spend all the time getting together all the disassembly resources I'd need....

As a side note, new version is now in archives :P
Title: Re: XXEdit 1.0
Post by: DJ Omnimaga on February 04, 2011, 02:41:53 am
I need to try this eventually. :D
Title: Re: XXEdit 1.0
Post by: squidgetx on February 06, 2011, 03:04:58 pm
Sometime later I might rewrite the editing engine to support 00s as well as infinitely long strings to be copied. Basically, I'll have pressing 2nd or ALPHA enter into edit mode, where typing using the keys will edit one byte at a time and then automatically move the cursor to the next byte as you type.
Title: Re: XXEdit
Post by: DJ Omnimaga on February 07, 2011, 11:59:28 pm
That would be cool. Just make sure it won't be as buggy as Omnicalc's clipboard function, tho, lol  ._.