Problems/bugs with TI-86 emulation

Dec 13, 2011 at 12:21 PM

Hi, I got some problems with TI-86 emulation.

Bug #1: it seems like uploading programs (*.86p files), and possibly other variable types too, to TI-86 does not work correctly. The variable name in the calculator is wrong (last character missing), and it's not possible to access it in anyway. The "Open" command doesn't recognize any TI-86 variable files either (I have to choose "All files").

Bug #2: pressing Debug -> Reset calculator doesn't work. If I press it, the calculator shuts down, and when I press On, the calculator crashes with some random garbage pixels on the screen. Pressing "Reset calculator" won't solve the problem. I have to restart WabbitEmu to get it reset correctly.

It would be nice if TI-86 support was added, because there's really no other Windows emulators except for the old VTI 2.5 beta 5.

For TI-86 variable format, see http://www.ticalc.org/pub/text/calcinfo/tixx_guide.zip (I guess you know this already though).

Bug #3: The pixels on the screen are not drawn correctly. I mean, look at this picture: http://i.imgur.com/reKz8.png You can clearly see some pixels are wider than others.

I'm using TI-86 ROM version 1.6. My OS is Windows 7 SP1 32-bit.

Developer
Dec 13, 2011 at 1:17 PM

Hello,

Thanks for the feedback on the 86. We don't have very many users of it so emulation is a little poorer than it is for the 83+ family.

1. I tested a couple programs and strings on 1.3 and 1.6 and they seemed to send fine (ie sent properly and no characters cut off). Can you link me to some specific programs that you tried to trasfer and failed?

2. Fixed this one. You can get it from the downloads page.

3. Unfortunately there's not a lot I can do here. This is the best rendering mode Windows has without moving to DirectX, which is not something I want to require for a little program like this. The problem is that the 86 has rectangular pixels and your computer does not. So I'm fitting 256 pixels into a ~200 pixel area. I've made the screen as wide as I can without making the skin look too distorted, unfortunately there just isn't enough real estate to fit it all in.

Dec 13, 2011 at 1:41 PM

After some investigation, it seems that upload works only for some files. I failed with this game called FreeCell: http://www.ticalc.org/pub/86/asm/games/freecell.zip but on the other hand, I succeeded to upload Advanced Text Editor: http://www.ticalc.org/pub/86/asm/programs/ate.zip so there must be some bug somewhere.

This is what was in calculator after uploading FreeCell: http://imgur.com/5rbj9 (invalid last character, and thus not accessible).

Another bug: View -> Variables doesn't work (if it is supposed to view all variables in the calculator). The window is just empty. Refresh and Export buttons don't do anything.

Thanks for fixing the resetting bug quickly!

About the pixel bug - would it be possible to let the emulator assume that the pixels are squares? I mean could it be an option in the menu, for example?

Dec 14, 2011 at 10:01 PM

Thanks for fixing the upload bug, I can upload FreeCell fine now! And variables window works now too, except that it claims that those fStat, xStat and yStat are strings, but they are actually lists.

I found a couple of more problems, I'll summarize them here:

  1. Keyboard mapping is broken. For example, when pressing 'A' on keyboard, it toggles the 'GRAPH' button on calculator.
  2. In Menu->Open, the filter "Known File Types" doesn't recognize any TI-86 files.
  3. I guess the "Target memory" option (in Menu->Open dialog) in the case of TI-86 emulation should be restricted to "RAM".
  4. "Detached LCD" window is buggy. For me it shows a white (or sometimes black) vertical stripe on the right side of it.
  5. When pressing "Clear keypresses" in Keypress history window, WabbitEmu crashes. I also noted that it takes an unusual long amount of time to open this window.
  6. "Save keypresses" opens the Save dialog, but it doesn't save anything when I click Save.
  7. When "Use cutout skin" is enabled, the keypresses are not animated in the calculator window.
  8. "Copy last answer" doesn't work (if it's supposed to copy the "Ans" variable to clipboard).

Small feature request: "Automatically turn on calculator at startup" -option.

Developer
Dec 15, 2011 at 2:44 AM
Edited Dec 15, 2011 at 2:50 AM

Yeah wasn't quite done with the vars yet. Now I am. I think

1. Fixed

2. Fixed

3. Fixed

4. Fixed

5. Fixed. Tell me if it still takes a long time to open

6. Its not intended to yet. Still working on a file format that saves what I need.

7. Its a technical limitation. I did write the code for it, but it performs too poorly on low end computers. I'm investigating a better way to do this currently.

8. Yeah I need to do more research on this. Should be done by tomorrow

I've also implemented this new feature request. You might like the 'reload savestate' option more. This will save the entire calculator state on exit and reload it so its like you never closed the application.

Dec 15, 2011 at 10:13 AM

Thanks again for quick fixes and reply! I tested some more things and list them again:

  1. It still takes relatively long time to open Keypress history -window (about 1 second after clicking the menu item).
  2. If Keypress history is non-empty, pressing "Save Keypresses" and then "Cancel" crashes WabbitEmu.
  3. It seems like WabbitEmu messes up save states and ROM images somehow. I mean, I saved a state with name "test.sav", and then in Options->ROM it said that the ROM filename is "test.sav" although it was "TI86_16.ROM" before saving state. It also seems that the "Reload last savestate" -option has no effect (it always loads the last savestate regardless of whether this is checked or not). And when I delete the save state file, WabbitEmu asks for a ROM image at startup.
  4. There might be something wrong with save state loading - sometimes the calculator doesn't work after loading state, and the variables window is always empty. Even resetting calculator doesn't work in this case, so I have to delete the save state file.
  5. When a ROM image is loaded and the emulator is started for the first time, there's something wrong with the skin. The emulator starts without skin but when I click the window border, the skin suddenly appears, although View->Enable skin appears to be not checked.
  6. "Detached LCD" screen can only be enlarged by dragging from the window corner (should be possible to enlarge from window sides too). Shrinking works from sides too.
  7. "Detached LCD" window doesn't accept keypresses from keyboard (I must activate the main window).
  8. File->Close -option is a bit misleading because it only minimizes the calculator. I'd say it's a useless option anyway.
  9. AVI file recording is a bit inefficient, a 5 second clip takes 12mb of space. Also, there seems to be some wrong pixels at the bottom-left corner of the video: http://i.imgur.com/jUYgE.png

Another small feature request: Would be cool to be able to drag-n-drop files to calculator window straight from Windows Explorer. Possibly many at a time.

Developer
Dec 16, 2011 at 8:11 AM
Edited Dec 16, 2011 at 8:32 AM

1. I've found the cause and I'm working on a way around this.

2. Fixed

3. This is how save states work. They replace your ROM, as they contain all the information of the ROM and then some. A save state is handy as it saves both RAM and ROM, whereas the ROM file is just that. Also the reload last savestate option is poorly named, it means a save state is created and restored automatically on exit, meaning nothing is ever lost.

4. If you come across a savestate that doesn't work, I'd like to test it. I did some tests and I never reproduced the issue.

5. Fixed.

6. This is as designed. You're not allowed to resize it from the sides because we make sure the scale stays the same. To keep consistent actions consistent, we only allow resizing by the corner.

7. Again as designed. However a number of people have asked why this is so I'm changing it. Hopefully it will avoid confusion.

8. Excellent catch. Apparently the CloseWindow function in windows doesn't close the window.

9. A known issue, and a technical limitation. The avi is uncompressed (thus the large size) and I've yet to figure out how to setup a proper codec to compress it. I'll check out the bottom 8 pixels or so, its probably an issue copying it.

Drag and drop is already implemented, just drag on to the screen. Also I'm testing out a new way to render the 86 screen tell me if you like it better or worse.

Thank you very much for all your feedback, you've been a huge help. It's always nice to get feedback, but you've gone above and beyond, providing good details and finding lots of uncaught bugs. One of the hardest things to do is get people to give helpful reports and you've done an amazing job, thanks again.

Dec 16, 2011 at 11:56 AM
Edited Dec 16, 2011 at 12:02 PM

Comments on previous ones:

4. After some testing, I'm 99% sure that the bug is not in save state file, but with the "Turn calc on automatically" -option. Probably the emulator tries to adjust the instruction pointer somehow, which causes a crash (or weird errors) when loading a state (when using File->Open command). Well, at least I never got the bug when that option was disabled.

6. Ok, so I guess the bug is: It is possible to shrink the Detached LCD window from the sides, although it shouldn't be (only corner allowed).

I didn't notice that the area for drag-n-drop was the LCD area, nice! And about the new screen rendering style - I think it's slightly better than the old one.

I was a bit unsure when I posted the first message because there was a chance that no one would care about my minor problems. But once you replied, I knew it would make sense to continue finding and posting every possible bug/problem. Hence, thanks to you too!

Next bugs that I found, more or less serious ones:

  1. The icon in Calculator Variables -window is wrong (it's the default Windows icon).
  2. Variables of type Vector or Constant are not recognized by the Calculator Variables -window.
  3. For TI-86, I guess the "In RAM" info in Calculator Variables -window is useless (because it's always True).
  4. Resizing Calculator Variables -window doesn't work well. The texts at the bottom stay in the same position relative to the top-left corner of the window.
  5. Keypress history -window doesn't have any icon. The window is not visible in taskbar either.
  6. Delete key is mapped to "MORE" key on calculator, but it would be better to map it to "DEL" by default (and End key would then map to "MORE").
  7. When calculator is turned on, the "Debug->Turn on calculator" should either be disabled/hidden or changed to "Turn off calculator".
  8. The preview panel in File->Open dialog has wrong size for TI-86. This can be noticed by previewing some save state file.
  9. If default keys are modified for the menus, they are not updated to the menu texts.
  10. The names of keys in Options->Keys are given in the same language as the system locale. I'd prefer them in English.
  11. When I pause the calculator (Calculator->Speed->Pause) and then try to press some button with mouse, the button stays down, and after that I cannot open any menus. Plus, if I try to move the calculator window, it jumps to the left side of the screen, and I cannot move it.
  12. When WabbitEmu is started, there is no selection in Calculator->Speed menu (although 100% should be selected by default I guess).
  13. In the custom speed setting window, the label and tooltip text for the lowest speed are different (1% and 5%).
  14. If you press Cancel in the custom speed setting window, the selection is still updated to "Custom" in the Calculator->Speed menu.

One more feature request that would be extremely useful:

Ability to emulate a sequence of calculator keypresses with a single key on keyboard. For example, if I pressed Backspace on keyboard, it would send [Left arrow] + [Del] to calculator. Maybe this could be implemented with the help of Keypress history window (select a number of consecutive keypresses, then assign that sequence to some key on keyboard).

Developer
Dec 17, 2011 at 1:02 PM

I've changed it so that it doesn't try to turn on if its loading a save state. Also I fixed the issue with resizing from the sides.

1. Fixed

2. Fixed. I put constants under real, and vectors under matrices. I know its not perfect but I don't have icons for any new types.

3. I'm keeping this for consistency. It doesn't hurt to have and its consistent with using the var tree for other calculators.

4. Fixed. I've been meaning to do this for a while.

5. Fixed

6. Fixed

7. As designed. Its primarily for debugging things, not meant for turning the calc on and off.

8. Still working on a fix for this

9. Fixed

10. Not sure what you're talking about here. I don't localize anything, so anything not in English is Windows not me.

11. Fixed

12. Fixed

13. Fixed

14. Fixed

This feature is something I've been working towards for a while. This is one of the major reasons for having the key history. You'll be able to save, load, record and playback keys. Its a good idea to be able to assign these macros to a key. So yes its coming, but not immediately.

Dec 17, 2011 at 10:09 PM

Nice fixes, except that number 9 still doesn't seem to work for me. Menu texts are not getting updated if I change shortcut keys. And I'm happy you've thought about the same feature too.

New:

  1. If I check "Use custom skin" but if the filename is invalid and try to apply options, it displays the messagebox "Custom skin failed to load" and after pressing OK, Wabbitemu crashes. Also, the messagebox should be modal - now it's possible to ignore the messagebox. If you leave it open and try to close Options window, you get a new messagebox. And so on.
  2. Small bug in skin: http://imgur.com/2MQuo
  3. (The following ones are about the debugger.) Flash tabs should be hidden for TI-86. And I'm not totally sure what the difference between "Mem" and "RAM" views is.
  4. Adding/removing memory views is buggy. Sometimes I get duplicate tabs (2 x "Flash 1" for example).
  5. Adding a new disassembly window crashes Wabbitemu.
  6. Trying to open Breakpoints window crashes Wabbitemu.
  7. If I close Port monitor from File->Exit, I cannot open it again.
  8. There is no horizontal scrollbar in the upper tab view even if the contents didn't fit there completely.
  9. Clicking "Run" command in the menu behaves differently than clicking "Run" from the toolbar (the text "Run" should change to "Stop" in the toolbar and in menu too).
  10. Toggling a breakpoint/watchpoint causes sometimes Wabbitemu to crash (for example when scrolling all the way down in "Flash 1" window and trying to set a breakpoint there).
  11. "Step back" doesn't do anything. At least it doesn't seem so.

Small feature suggestions for the debugger:

-Ability to choose how many bytes there are in memory view per row.

-Ability to see bytes and their character representations in memory view at the same time (with a new column "Characters", for example).

Developer
Dec 18, 2011 at 1:58 PM

1. Fixed

2. Fixed. When I remapped the keys I was wondering why TI didn't label that as the space key. Guess it was my fault.

3. Flash shouldn't be hidden, but I have changed the name to ROM. Mem is what is mapped into the 4 banks. RAM is the 8 pages in sequetial order.

4. Hopefully fixed.

5. Again hopefully fixed.

6. Fixed

7. Fixed

8. Scrolling is tricky, I'll see what I can do about this.

9. Fixed

10. Hopefully I fixed this. Tell me if you get any more crashes

11. No it doesn't right now. I've removed it for the time being.

For your suggestions, what are your use case scenarios for them? I ask because you can already view characaters, just not at the same time. The problem is that they are useful to have alongside the hex bytes, but not if you are view memory as words or in decimal. To have them only on the byte hex view would mean its inconsistent with the other ones.

Also I can pretty easily set the number of columns, but I'm not sure why you would want to. The debugger already adjust the columns to the size of the window, but having less than that means a lot of whitespace somewhere, having more means scrollbars which are a pain.

Dec 18, 2011 at 5:44 PM

Hm ok, you're right about the char+hex view and column thing. I don't have any specific use cases for them.

Anyway, it's more important to get all bugs fixed, so here we go:

  1. Keypress history -window should probably be resizable (or not?).
  2. Holding down 2 buttons (or more) at the same time freezes the calculator (or emulation). It doesn't freeze immediately, but after 0.5 seconds or so. When I release the buttons, the freeze ends.
  3. Resizing Calculator Variables -window too fast (vertically) messes up "Address" and "Page" texts. See this picture: http://imgur.com/3eSij
  4. If I minimize and then maximize the "Interrupts" panel, the "iff2" checkbox is invisible until I hover mouse over it.
  5. The time that is next to "Next Timer2" label is not fully visible (it goes off the window border).
  6. If I add and remove a mem view and then resize the debugger window, the lower tab pages are not drawn correctly. See http://imgur.com/mar36
  7. There is some kind of infinite loop in Breakpoints window that occurs when there is at least 1 breakpoint/watchpoint. The list of breakpoints keeps flashing all the time.
  8. Options window doesn't have icon and is not visible in taskbar.
  9. Changes in Options->Skin are applied even if I press Cancel.
  10. The parent window for the "Custom skin failed to load" -messagebox is wrong. The options window is still accessible (so you can create as many messageboxes as you want by trying to close Options window).
  11. The ROM filename in Options->ROM is partially hidden if the path is long (for me it's like "C:\Users\[username]\AppData\Roaming\wabbitemu.sav").
  12. If I select "Display" tab from Options and then close and open Options window, it moves a bit towards the bottom-right corner. If I do this many times (open, close, open, ...), I can move the Options window off the screen so that it's unreachable.
  13. Hmm... something went wrong with the save state file because Wabbitemu crashes immediately at startup. Here's the state file: http://dl.dropbox.com/u/53800011/wabbitemu.sav
Developer
Dec 19, 2011 at 3:10 PM

1. I agree. Its resizable now.

2. Fixed

3. Fixed

4. Fixed

5. Fixed. The 86 doesn't have a 2nd timer so I just got rid of it for the 85 and 86.

6. Fixed

7. Fixed

8. And its not supposed to be.

9. Fixed

10. There's not anything I can really do anything about it. The messagebox is created by the main window not by the options dialog and isn't aware that its being called from the options dialog.

11. Fixed

12. Fixed

13. Fixed. Although there may be more crashes on invalid savestates.

Dec 19, 2011 at 7:48 PM
Edited May 21, 2012 at 9:08 AM

Thanks once again for the fixes. I believe there's not so many bugs/problems left anymore. Here's next ones:

  1. If I resize the debugger window vertically, the height of the lower tab view is not saved correctly. If I open and close the debugger window many times, the height of the lower tab view keeps increasing/decreasing.
  2. If I scroll all the way up in Disasm window (or ROM/RAM), select the topmost instruction and press Page Up, the addresses "wrap around". If I then press Page Down a few times, the scrollbar disappears. I get the same bug by scrolling all the way down and pressing Page Down a few times.
  3. I think toggling a breakpoint/watchpoint definitely needs shortcut keys. Or do they exist already?
  4. If I scroll the Disasm/ROM/RAM view with Page Up/Down, the selection is always updated to the topmost visible instruction. The same happens when I'm stepping the code. Not sure if it's a bug, but it's a bit disturbing anyway.
  5. I guess the "Find in Memory" reverses the byte order when searching? For example, if I search for "2305", it finds "0523". Maybe it could be added as an option. Furthermore, "Find next" finds only one (it doesn't search more if I click more).
  6. Tools->Rewind doesn't do anything.
  7. If I toggle a breakpoint/watchpoint in the upper tab view, the breakpoint doesn't appear in the lower tab view until I click it, and vice versa.
  8. If I scroll the views with mouse wheel, it scrolls only one row per notch, which feels quite slow. It would be better if it scrolled like 2-4 rows/notch.
  9. Page Up and Page Down scroll different amount of rows.
  10. In Breakpoints window, if I click "Remove" without any breakpoints selected, Wabbitemu crashes (sometimes I have to click twice to make it crash).
  11. The real TI-86 has this bug called "down-left bug" which causes the calculator to hang when down and left arrows are pressed at the same time. But it seems the emulator does not have this bug (the calculator doesn't hang when pressing down+left arrows).
Developer
Dec 20, 2011 at 1:21 PM

1. Its not a fixed height, but rather a ratio. The only time the height is fixed is when the mem view is hidden

2. Fixed

3. F2 is exectution, F3 is write, and F4 is read

4. Paging is a little funky. Because the disassembly is recalculated each time, so if you're paging up its never known beyond one page the size of the page.

5. Yes it searches by big endian. Memory is stored little endian, meaning the number 0xFF00 is stored as 00FF. I'm working on overhauling the search, so yes there will be an option but not immediately.

6. Fixed. It did at one point

7. Fixed

8. I've changed this, but tentatively.

9. Due to the funkiness described above

10. Fixed

11. Do you have technical details? I did some quick searching, but the most I've uncovered is that its related to the ISR and the 2,(iy+$12) flag. I'll disassemble it more but if you have any info on it, that'd be helpful.

Dec 20, 2011 at 4:14 PM

Comments on previous ones:

1. What I meant is this: If you resize the debugger window, the tab panels are resized and everything is ok so far. Now close the debugger window and open it again. You can see that the debugger window has the same size before closing, but the tab panels not. If you repeat this open&close&open many times, the lower tab panel either eventually gets hidden or fully maximized.

2. I can still get the bug like this: I scroll all the way down, resize the debugger window vertically (make it bigger) and then press Page Down.

7. Still not working for me. Proof: http://imgur.com/aW60j

11. Sorry, I don't know any more about the bug than what is told on this page: http://guide.ticalc.org/intermediate/down.htm

New bugs (I continue numbering from 12 for clarity):

12. In lower tab view, if I select "Watch", click the empty area (without selecting the "New label" row) and then press Delete, Wabbitemu crashes.

13. I can't rename watches in "Watch" tab (double-clicking "New Label" column doesn't do anything).

14. If I select a breakpoint in the list in "Breakpoints" window and click "Update" twice, Wabbitemu crashes.

Developer
Dec 21, 2011 at 5:38 AM

1. Fixed. Sorry didn't read that closely enough. There still seems to be some fluctuation but its nothing very noticeable.

2. I've fixed it. As you drag the pane down it'll move the disassembly down too.

7. Fixed. For real this time.

11. Yeah I saw that. Guess I'll have to do some disassembly and maybe see if I can get a cheap 86 off ebay or something.

12. Fixed

13. The label is weird. I let Windows handle it, which means the you can't double click, you click then click again, same as you rename things in explorer.

14. Fixed

Dec 21, 2011 at 11:13 AM

Nice, but I guess you didn't upload the exe yet? At least I'm seeing the same bugs in the current version.

Anyway I decided to download the sources (using SVN) to see if I could compile Wabbitemu myself. Well I got "Build succeeded", but Wabbitemu crashes when I try to open the debugger (started the exe from windows explorer). And if I try to debug it in VS, I get the error "Unable to start program Z80MapEditor.exe".

And when I try to compile this Z80MapEditor, I get these errors: http://i.imgur.com/1ccOE.png

Developer
Dec 22, 2011 at 12:20 AM

Yeah I forgot to upload it last night, latest is up now. If you want to compile wabbit, make sure the configuration manager is set to Wabbitemu Debug or Wabbitemu Release. Then in the Solution Explorer make sure the bolded project is Wabbitemu. If its not, you can change it by rght clicking on the project and selecting 'set as startup project'. Z80MapEditor is old, you can unload it by right clicking and saying unload project. This will get rid of any errors there.

Dec 22, 2011 at 8:25 AM
Edited Dec 22, 2011 at 8:26 AM

Ok, I managed to build and run it now. Some bugs I noticed:

1. I get a crash when opening the debugger.

2. If I delete all registry keys related to Wabbitemu and run it for the first time, it opens 2 calculator windows.

3. If I try to press some key when calculator is on, it opens the debugger (this seems to be related with the "Open debugger on invalid flash commands" -option). Sometimes the debugger looks pretty weird: http://i.imgur.com/JeQHb.png

I think it would be nicer if Wabbitemu saved all its stuff in the same directory where the exe is (autosave, settings in INI file).

Developer
Dec 22, 2011 at 9:26 AM

1. What line in what file does the debugger crash on? Also how are you building this, what configuration? You can either run it via Visual Studio, and it will automatically goto the line it crashes on. Or you can run it from explorer normally, then in Visual Studio attach it to the process via the debug menu. Alternatively you can dump it via Task Manager (right click and choose Create Dump File). Zip this and upload it somewhere I can grab it. If you do this last method I need the exe and the debug symbols as well (the PDB file in the same directory as the EXE).

2. Fixed

3. Yes, the OS is trying to write to ROM.

I'll see what I can do about exporting your settings somehow, but INI files are leftovers from the Windows 3.0 days. Its generally frowned upon to use them to save settings. It also means that Wabbitemu is tied to a directory which I don't like.

I'll release this shortly, I appear to have introduced a very serious bug that breaks the emulator completely.

Dec 22, 2011 at 10:52 AM

I get the crash with your exe too. In VS the configuration is "Wabbitemu Debug" and platform Win32 (it crashed with "Wabbitemu Release" config too). There's a stack overflow when opening the debugger, here's the call stack: http://pastebin.com/NQqvmgtA

Jan 13, 2012 at 9:29 PM

Thanks for fixing this. I also noticed some new features there, such as the bug report window. I complained about the debugger opening on a keypress but then I remembered that I only needed to uncheck the checkbox (open dbg on invalid flash commands). Btw, are the sent bug reports visible to others anywhere?

Developer
Jan 13, 2012 at 10:13 PM

Yep, sorry it took a while, I was distracted over the holidays. In the new version there's three major things, automatic checking for updates, automatic crash reporting, and the ability to file a bug report (as you already know). As of now the bug report is just a text file uploaded to my computer. Its the simplest way and works well with the crash dump (which works in much the same way).

As for resizing the bug report window I'll work on it, it requires manually fixing the textboxes as the window changes sizes.