Changes for 2.0b3 (6/2/98) -------------------------- * Windows only: Added Greg's nifty Hyperlink controls to the About box. * Added Keith's Palm OS Emulator article from HHSJ. * Windows only: Added Greg's fixes to the serial emulation routines. * Fixed Headpatch::SysGremlins bug where it would read garbage from the stack when trying to get the selector parameter. * Got A-Trap breaks working ("atb" from the PalmDebugger). * Windows only: bumped number of recently loaded application from five to nine. * Fixed 1.0 ROM compatibility problem: the emulator was trying to call a function introduced in Palm OS 2.0 (PrefSetPreference). Changes for 2.0b2 (5/25/98) --------------------------- * Windows only: Fixed bug that would zap the version number in the system preferences when attempting to set the timeout value to be infinite. * Fixed bug that would cause the emulator try to access invalid memory if the emulated app tries to access invalid memory. * If an exception occurs that an external debugger should handle and there is no external debugger, instead show a dialog that reports the problem and forces the user to reset. * When getting application version string, look for ID's 1 and 1000. * Windows only: Fixed bug that would leave a debugger-related messaging event object signalled if there were no external debugger. Changes for 2.0b1 (5/??/98) --------------------------- * Prevent the device from ever going to sleep. Letting it go to sleep is only annoying, and doesn't accomplish anything. You can make the device go to sleep by setting the timeout value in the General Preference panel, but that setting will get reset back to "never" on any reset. * Mac only: Fixed problem that would cause the emulator to hang if you tried to open a console window from within MWDebug. * Got alarms working. * Mac only: Wasn't doing a "weak import" of AppearanceLib in non-debug version. * With regards to a change in 2.0d8, it's OK to load an application that already exists in ROM. The RAM-based version will override the one that's in ROM. Changes for 2.0d9 (5/13/98) --------------------------- * The handling of DbgBreak was broken. * Allow application to resume after ErrDisplayFileLineMessage. This is handy in cases where you're using ErrNonFatalDisplayIf to display warning messages and it's OK for the application to continue execution. * Accidentally turned off checksumming of post-2.0 ROMs; turned it back on. * Windows only: there was supposed to be a feature whereby holding down the caps-lock key when starting the emulator would cause it to bring up a Download/Browse/Quit dialog box. However, the dialog box would actually come up if the caps-lock key had ever been toggled since the last time the emulator had been executed. Fixed. * Selecting "Gremlin/New..." while a gremlin is currently running will now switch to the new gremlin. * Fixed error message to say RAM instead of ROM when saving a RAM image file, and added an exception handler to deal with the ensuing thrown exception. Changes for 2.0d8 (5/27/98) -------------------------- * Added Greg's Copilot article from HHSJ. * Added updates to Guide.html from Roger. * Removed support for the 2.0 Debug ROM that offset the low-memory globals byte four bytes. There were problems with that ROM that would cause it to crash. * Gremlins now latches into KeyCurrentState in order to randomly set the bits so that applications can respond to them. * The patched versions of SysFatalAlert and ErrDisplayFileLineMsg now display dialogs containing "Debug" and "Reset" buttons. Clicking on "Debug" will simulate a bus error, which an external debugger will catch. Clicking on "Reset" is the same as selecting the Reset menu item. NOTE: currently, clicking on the "Debug" button when there's no external debugger running will result in the ROM attempting to handle the simulated bus error. If the ROM is a Debug ROM, it will attempt to contact a debugger over the seial port. Since there is probably no such debugger listening on the serial port, the emulator will appear to hang with a blank screen. Selecting the Reset menu item will restart the ROM. * Failures reported via SysFatalAlert and ErrDisplayFileLineMsg during application execution have more info for users to report. The dialog has text along the lines of: SubHunt 2.0 has failed while running Gremlin 2 at 20,000 events. SubHunt complains "SubHunt.c: Line 100: Score too good." If this is the latest version of SubHunt, please report this to the application author. or: SubHunt 2.0 has failed. PalmOS complains "Window.c: Line 100: Invalid Window." If this is the latest version of SubHunt, please report this to the application author. NOTE: currently no effort is made to determine if the application or the PalmOS is generating the message. This shortcoming will be addressed in a future version. * Use application name from 'tAIN' resource when generating the list of applications for the New Gremlin dialog box. * Reduced the 10% random pen tap chance in Gremlins to 2% (per Roger's recommendation). * Internal change: added "TrapIndex" inline function for converting a trap number (0xA000) to an index that can be used with the trap table. Standardized on its use all over. This function converts by merely masking off the upper byte (which mirrors what the ROM does) instead of subtracting "sysTrapBase" from trap numbers (which fails because some applications appear to use trap numbers that don't have "A" in their upper nybble). * Internal change: we patch ROM system functions. We also call ROM system functions. Now, whenever we call a ROM system function, any trap patches made to that function are called (they didn't used to be). * Fixed emulator/debugger communications bug that occured when one would quit and then restart (needed to refresh -- not just flush -- the handle to the other guy's window). (Windows only) * After the UI has been initialized, prevent even the ROM from writing to low-memory (except from HwrSleep, which patches out the exception vectors). * When trying to load an application that's already in ROM, warn with a specific error message instead of a generic one. Changes for 2.0d7 (4/27/98) --------------------------- * Gremlins now works better with "ill-formed" forms (forms with no "live" objects in them). Gremlins will also now generate random taps 10% of the time instead of always trying to target form objects. * Turn off Gremlins on a reset or fatal system error. * Only the last 128K of Gremlins logging text will now be written to the logging file. * Added "Debug" button to the "Application so-and-so just made an invalid memory access" dialog. Clicking on this button emulates a bus error. If an external debugger is running, it will be notified of this bus error. If not, the emulated ROM will take over, displaying a Fatal Error dialog. * Fixed a bug where the emulator itself would cause a "The current application just accessed Palm OS Globals ..." to appear after downloading an application via MWDebug. Changes for 2.0d6 (4/22/98) --------------------------- * Added ROM Transfer project (for Mac). * Added Docs folder. * Added Plugins folder containing MWDebug plugins. * Tweaks to PCH file generation for CW Pro 3. * Added HotSync to Mac side. IMPORTANT: For both versions of the Emulator, HotSyncing has only been tested between two machines (in both cases, between a Mac and a PC). I don't know what performance is like when both the emulator and HotSync are running on the same machine. * Now enable and disable Gremlins menu items in WinEmulator. * Fixed bug in ROM Transfer.prc which would cause it to crash on Palm III's. * Fixed some bugs in RAM file management in Mac version. Changes for 2.0d5 (4/??/98) -------------------------- * Checksum the ROMs when they're loaded. This checksum is used to (a) validate the ROM contents (for pre-3.0 ROMs, the checksum is checked against a hard-coded list of ROM checksums, for 3.0 ROMs and later, the checksum is checked against the checksum in the ROM header) and (b) determine if we're running the 2.0 debug ROM, which needs special hacks activated in order to run. * Allow *.* patterns when loading ROM and application files. * Support serial port emulation in WinEmulator (not in Mac, yet). * Added method for applications to call the emulator (see EmuTraps.h). Note that there currently is no method to see at runtime if an application is running under the emulator or not. * Tweaks to get Mac version to build under CWP R2 with CW4POS R4 installed in it. * Backed out checksumming of pre-3.0 ROMs until I get get an accurate set of checksum numbers. Changes for 2.0d4 (4/9/98) -------------------------- * Reset auto-off timer when processing debugger packets. * Changed way tailpatches are implemented. I used to set the return address of a system function I was tailpatching to point to a TRAP $E opcode (saving the original return address in an array in the emulator). This approach has the advantage of not modifying any opcodes in memory, and handles recursive system functions very well. Sadly, the critical flaw in this approach is that some operations need the real return address to be on the stack. For instance, the TRAP $F handler (TrapDispatcher) in the ROM looks at the return address so that it can look up the $Axxx function selector. Therefore, the approach I now take is to write a TRAP $E into memory after the TRAP $F / $Axxx sequence, saving the overwritten opcode in a table. Recursive functions are handled by incrementing and decrementing a counter associated with that memory location. When the counter gets back down to zero, the opcode is restored. * Added preliminary profiling stuff. Still disabled at this point. * Don't let the user enter pen and keyboard events if the CPU is stopped (for example, when it's in the debugger). * Don't run RPC commands from the debugger in TRACE mode (that is, run the commands, but turn trace mode off, first). * Respond better to a SysReset message from the debugger. * Remove tailpatch opcode when the CPU is reset. * In WinEmulator, restart the CPU after a screenshot only if it was running before we took the screenshot. * Fixed problems with synchronization between the UI thread and the CPU thread. One way to trip up over the bug was to run Gremlins and at the same time click like crazy on the screen or hardware buttons. After a while, you'd get the dreaded "ATrap::DoCall returned and exception" dialog box. * Fixed Gremlins bug that would put it into an infinite loop if the top form had only frmBitmapObj, frmLineObj, frmFrameObj, frmRectangleObj, frmLabelObj, frmTitleObj, and/or frmPopupObj objects in it. Games like SubHunt, HardBall, and Reptoids are examples of programs with such forms. * Changed the low-level mechanism for handling exceptions and entering the debugger. With the old way, an exception would cause the main CPU loop to exit before the debugger was notified about the exception. But if there were no external debugger to notify, there was no way to cleanly restart the CPU loop in order to have the emulated ROM handle the exception (either by trying to connect to a serial debugger, or by showing a fatal error dialog). Now, the attempt to contact an external debugger is made before exiting the CPU loop. If the attempt succeeds, the CPU loop is exited. If the attempt fails, the normal exception handling process takes over (i.e., the appropriate vector from the low- memory exception table is loaded into the PC and execution continues). * Added support for 2.0.2 Debug ROMs (added minimal support for 68681 serial access and account for different low-memory variable locations). * Removed support for ROM files with the pattern "ROM *". This pattern also matches the "ROM Transfer.prc" application, causing the emulator to try loading it if there are no other candicates. * For MacEmulator, save RAM files with the type '(Pi)RAM' and ROM files with the type '(Pi)ROM'. Also, if untyped files are accessed as RAM or ROM files, they are changed to have the appropriate type. * Restarting and stepping of Gremlins in WinEmulator more reliable. * Better warning messages for applications that: - Access low-memory directly - Access system global variables directly - Access the screen directly - Access Dragonball registers directly Changes for 2.0d3 ----------------- * Lots of internal changes: - Names changed from Foo_Bar format to Foo::Bar format (where Bar is a static member function of the Foo class). This change makes it easier to look things up in a class browser. - Handling of memory access errors codified. All accesses are checked; any errors are reported through bottleneck functions; all accesses can be turned on/off with compile-time and/or runtime switches; added CEnableFullAccess class that allows internal functions full access to memory (i.e., turns off memory access checking) so that we can do things like set breakpoints in ROM. - Added Palm copyrights to all files. - Standardized on PowerPlant-style function header comments. - Removed all mention of Pilot and Pilot-derivatives. - Untemplatized some functions in UAE_Utils that didn't need to be templates. - Sped up uae_memset by using long-word access. - Changed way tail patches are implemented. Previously, I'd write a TRAP $E opcode into memory after the TRAP $F/Axxx instruction sequence that would invoke the trap. The problems with this approach is that (a) this wouldn't break on all returns from the function if it called itself recursively, and (b) it modified memory in a way that would need to be reversed on selected occassions (e.g., when we entered the debugger, or when RAM was saved to disk. Instead, when a trap function is called that I wish to tail patch, I modify the return address from the function in such a way that I get control when the function exits (I save the old return address and replace it with a pointer to a TRAP $E opcode, which leads to a CPU exception which I catch in Software::ProcessException). - Patched calls to SysDoze and SysSleep so we better know the state of the ROM/CPU. We don't actually use this information, yet. - Centralized all compile-time pre-processor symbols into Switches.h. - Centralized all byteswapping into Byteswapping.h/.cpp. Used a templatized Canonical() function on the Mac so that Canonical is zero-overhead no matter what type it's called with. - Added internal diagnostic logging functions. - Lots of timing tests to optimize memory access and core CPU emulation loop. - Committed to "word-swapped" memory layout in x86-compatible systems. Removed experimental alternative memory layout code. Look for WORDSWAP_MEMORY symbol for areas that are byte-order sensitive. * Fixed some bugs with external debugger hooks. - Now support the same notion of "sockets" as the SerialLinkMgr. - On some entries into the debugger, the PC would incorrectly be adjusted to point 2 bytes before the instruction causing the debugger entry instead of pointing right at the instruction. - Finally added debugger hooks to WinEmulator (missing functionality's considered a "bug", right?). * Fixed bug where UAE would allocate a significant chunk of memory and then try using it without first checking that the allocation attempt succeeded. This would result in the Mac emulator freezing on startup when emulator a 4Meg device. * Fixed ROM Transfer.prc to download Palm III ROMs. Updated Mac "Download ROM" command to work with larger ROMs. Added "Download ROM" to Windows emulator. * On startup, if WinEmulator can't find a ROM, it will ask you to find one or download one. * On startup, if the capslock key is down, WinEmulator will _always_ bring up the dialog asking you to find a ROM file or download one. * Removed "Backlight" and "Enter debugger on startup" properties from WinEmulator. * When looking for a ROM file, Emulator use the following search order: - The file you've explicitly specified in Properties (WinEmulator only). - The first file in the Emulator directory ending with ".ROM" - The first file in the Emulator directory ending with " ROM" - The first file in the Emulator directory starting with "ROM." - The first file in the Emulator directory starting with "ROM " * Fixed problem where mouse clicking wasn't working with 1.0 ROMs. I'm still not sure what the root of the problem is, but I've added a check for 1.0 ROMs and implemented a workaround. * In WinEmulator, RAM image is automatically saved to and read from a file based on the name of the ROM being used and the RAM size requested. The name of the RAM file is "..RAM". In other words, the old Windows Copilot functionality is back (it was temporarily removed during the Grand Code Unification). The format of this RAM image file is a little different, however. There are chunks of data in this file, each tagged with an ID and a chunk size. For now, the only defined chunk is 'ram '. In the future, there will be chunks for register state, associated ROM version, etc. In MacEmulator, the file saving operation remains the same as in Mac Copilot, but the file format is the same as in WinEmulator. * Switched to new case graphics. Changes for 2.0d2 ----------------- * Fixed MacEmulator bug when switching between 1x and 2x screen sizes. * Fixed bug where loading an application would smash 4 random bytes of memory. * Sped up emulation on the Mac by 20% by streamlining some Mac-specific operations. * Sped up core emulation loop on both platforms by moving some not-oft-used functionality into some subroutines, thus simplifying the core loop. * Added hooks for external debugger. * Made Gremlins deterministic. * Ensured Gremlins did the same thing on both Mac and Windows. Changes for 2.0d1 ----------------- * Support for Palm OS 3.0: - memChunk headers changed, so reliance on their format when loading applications has been removed. - More complete support for Dragonball registers. - Allow for 96K and 128K dynamic heaps. * Common source code base. * Refitted with latest UAE sources. * Can load .prc files larger than 64K. * Windows version is much smaller. * Mac version is much bigger (it's a FAT binary). * Removed built-in debugger. * Support grayscale mode. * Now emulates hardware method for turning on backlighting (holding down the power key). Properties option is no longer needed. * Added screen shot command. * Added Gremlins. (Note that user input (typing, mousing) is disabled while Gremlins is running due to the incompatible ways in which they enter their events.) * Set the Palm OS date on startup. * Trap dispatcher is now run as native code instead of being emulated. This results in about a 10 - 12% speedup. * Auto-calibrate the pen on startup; no more digitizer screen. * InternetConfig-savvy About box on the Mac. Panel-savvy About box on Windows. * Gremlins can now confine itself to a single application. * Emulate MemSet, MemMove, and RctPtInRectangle with native code for 15% performance increase. * While Gremlins is running, can optionally log to a text file: - posted events - received events - system functions called - time of execution.