Emu48 v1.14 EMU48.C - bugfix in function SaveChanges(), function GetSaveAsFilename() returns a boolean and not a button id and removed call of last document saving - changed function OnFileOpen(), added MruAdd() call - added new function OnFileMruOpen(), command handler for MRU menu selections - bugfix in function OnFileSaveAs(), function GetSaveAsFilename() returns a boolean and not a button id, minor optimizations, removed call of last document saving and added MruAdd() call - changed function OnObjectSave(), minor optimization - changed function OnPopupMenu(), added MRU list menu update - changed function MainWndProc(), added MRU message handler - changed function WinMain(), added MRU handling and added last document saving at end of program EMU48.VCP - added mru.c sources EMU48.H - extern declaration of global functions EMU48.RC - added Menuitem Files "Recent Files..." - changed version MRU.C - new module for MRU routines RESOURCE.H - added definition for MRU handling SETTINGS.C - added function DelReg() for deleting a registry item - added functions ReadSettingsString(), WriteSettingsString(), ReadSettingsInt(), WriteSettingsInt() and DelSettingsKey(), universal settings interface used for MRU data handling Emu48 v1.13 EMU48.C - changed function SetCommList(), fill both combo boxes at one loop for speed up scanning - changed function SettingsMemoryProc(), adjusted to new CRC handling of port2 - changed function SettingsPortProc(), adjusted to new prototype of function SetCommList() - bugfix in function OnFileNew(), function SaveBackup() was called when emulator engine was running -> this may caused inconsistent backup data - bugfix in function WinMain(), added StartupBackup handling and call ShowWindow() before asking for a new document preventing a KML script dialog without a parent window EMU48.H - extern declaration of global variables and function - changed function prototypes EMU48.RC - changed version FILES.C - added global variable saving the patched ROM checksum - changed function CrcRom(), change function prototype, added unpacked data check and made function public - bugfix in function CrcRom(), hadn't detected address content changes at addresses ending with a 0x2 and 0x3 because only lower 16 bit of checksum was used -> modified function cause a warmstart because of new checksum - changed function MapRom(), removed check for packed ROM image -> a more complete check is implemented in InitKML() now - changed function UnmapRom(), added reset of ROM checksum variable - changed function MapPort2(), added CRC calculation with saving result in global variable and added unpacked data check - changed function UnmapPort2(), added reset of port2 CRC variable - changed function OpenDocument(), use ROM checksum made in InitKML() and port2 CRC made in MapPort2() - changed function SaveDocument(), changed document signature to "Emu48 Document\xFE" without the calculator model dependent variations and adjusted implementation to new prototypes of CrcRom() and CrcPort2() - changed function SaveBackup(), added assertion for checking emulator engine state - bugfix in function GetSaveAsFilename(), removed "Win48 Document" from filter list because Emu48 cannot create such a document - changed function WriteStack(), adjusted to new prototype of function RPL_ObjectSize() and added new error state for bad objects - changed function LoadObject(), added error message for bad objects and removed formatting line feed from other error messages KML.C - bugfix in function KillKML(), class member variable wasn't reset - changed function InitKML(), added full check for unpacked ROM image and build checksum of patched ROM OPCODES.C - changed function o83n(), o88n() and o89n(), speed optimization OPS.H - changed function Tbit0(), Tbit1(), Ta(), Tb(), Tae() and Tbe(), speed optimization RPL.C - bugfix in RPL_ObjectSize(), changed function prototype for adding buffer size parameter preventing reading outside buffer area when decoding bad objects SETTINGS.C - changed function ReadSettings() and WriteSettings(), added item "StartupBackup" in section [Files] Emu48 v1.12 DISPLAY.C - changed function StopDisplay(), adjusted to new prototype of ReadIO() EMU48.C - replaced function IsPort2Writeable() with IsFileWriteable() - bugfix in function SettingsMemoryProc(), a changed port2 writeable checkbox made a warmstart even if there's no port2 filename and added all changes of Win32 version related to command line argument given port2 filename - bugfix in function OnPopupMenu(), checking for 1st level submenu was wrong - bugfix in function OnLButtonDown(), checking if outside virtual button area was wrong EMU48.H - changed function prototypes - extern declaration of global functions EMU48.VCP - added lowbat.c sources EMU48.RC - changed version and copyright ENGINE.C - changed function WorkerThread(), added control of battery measurement thread KEYBOARD.C - bugfix in function ScanKeyboard(), if keyboard reading wasn't active a released ON key wasn't cleared in the "in" register KML.C - changed function DisplayChooseKml(), changed return type of dialog box - changed function ParseLine(), change typecast of szLexString from DWORD to DWORD_PTR - bugfix in function TransparentCircle(), there was no radius value check for preventing division by 0 and color low adjust value wasn't reached because of wrong color offset divisor -> adjusted LOWADJ definition to get similar output to buggy earlier version KML.H - changed variable type of nParam[] element of KmlLine structure because element is also used as pointer LOWBAT.C - new module with battery measurement MOPS.C - changed function Npeek() and Nread(), adjusted to new prototype of ReadIO() - changed prototype of function ReadIO(), added update argument - bugfix in function ReadIO(), the LPE (0x109), RBR LSB (0x114) and RBR MSB (0x115) register access had to differ between peek and read mode and added implementation of the LB0 and VLBI bits in the LPD (0x108) and implementation of the ELBI and EVLBI bits in the LPE (0x109) register OPCODES.C - bugfix in function o807(), Chipset.in register must be refreshed before checking for a pressed key RPL.C - added definition of EDITLINE - added function RPL_Depth() returning stack depth - changed function RPL_Pick(), added check of stack depth - changed function RPL_Push(), new implementation with stack level argument STACK.C - adjusted calls of RPL_Push() to new function prototype - changed function RPL_SetBcd(), removed compiler warning - bugfix in function OnStackPaste(), case "any other format" must be treated as string and not as binary object TIMER.C - changed function CalcT2(), in the case of a pending timer2 interrupt return always the timer2 value 0xFFFFFFFF Emu48 v1.11 EMU48.C - changed function OnFileClose(), removed call of KillKML() because will be done in ResetDocument() - bugfix in function OnPopupMenu(), hadn't worked with popup menu because translation from position to ID was missing EMU48.RC - changed version FILES.C - changed function PatchNibble(), added saving state that ROM address is patched - bugfix in function UpdatePatches(), the function maybe called for patching the ROM when it's already patched, in this case the patch restore list was overwritten with the patched data - changed function PatchRom(), removed checking for writeable ROM images, read-only ROM files can now also be patched - changed function CrcRom(), minor optimization by using the ROM size variable directly - changed function MapRom(), only HP49G ROM images with write access are implemented for writing performance reasons as memory mapped file, all other ROM types use a normal memory buffer which have three major advantages, ROM patching is always possible, faster ROM loading and packed ROM files are also valid now - changed function UnmapRom(), adjusted to changed MapRom() function - changed function MapPort2(), improved checking for valid size KML.C - changed function KillKML(), use white background instead of background of other program now Emu48 v1.10 DISPLAY.C - change variable BOOL bFullScreen to UINT nFullScreen - added nLcdDiv handling for non integer display Zoom factors - changed function ResizeWindow(), adjusted to bit structure of nFullScreen EMU48.C - bugfix in function OnViewScript(), removed error message because it's wrong when script is ok, but log report was leaved with Cancel button, also if clause of error message box was never reached because error message box had no Cancel button - moved menu bar creation from OnCreate() to OnPaint() - changed function OnPaint(), added new menu bar off mode and nLcdDiv handling for non integer display Zoom factors - changed function OnPopupMenu(), added macro specifiy menu control - changed function OnLButtonDown(), OnLButtonUp(), OnMouseMove(), OnKeyDown() and OnKeyUp(), disable function handling when in macro play mode - changed function OnLButtonDown(), added context menu gesture handler - changed function MainWndProc(), added some macro command handler functions - changed function WinMain(), simplified document loading at startup EMU48.H - changed bFullScreen definition - extern declaration of global variables and functions EMU48.RC - changed IDD_CHOOSEKML, IDD_KMLLOG and IDD_MACROSET dialog from MODALFRAME to a centered popup style - added popup menu IDM_MENU - added Menuitem Tools "Macro..." - changed version EMU48.VCP - added keymacro.c sources ENGINE.C - changed function WorkerThread(), close running keyboard macros when switching into invalid state FETCH.C - changed function EvalOpcode(), included assertion for detecting access to packed memory data FILES.C - moved function WriteStack() inside file - changed function SaveLastDocumentFolder(), made function public - changed function GetOpenFilename(), GetSaveAsFilename(), GetLoadObjectFilename() and GetSaveObjectFilename(), moved storage place of local file buffer from heap to stack I28F160.C - bugfix in function WrStateE8N(), removed "Write to Buffer command failed when requesting for the buffer length" code part introduced in SP27; this was in reality a workaround for the actually fixed Nwrite() flash access bug and illegal data length information wasn't handled correctly IO.H - added BAUD bit definitions KEYBOARD.C - changed function KeyboardEvent(), added call to key recording function KeyMacroRecord() KEYMACRO.C - new module supporting keyboard macro functions KML.C - bugfix in function CreateKmlList(), fixed possible call of API function lstrcmpi() with NULL pointer at Hardware detection and select only KML files with a valid Model statement - bugfix in function Lex(), EOF without LF at end of non empty line wasn't detected as EOL - changed function InitBackground(), adjusted TOK_TOPBAR case to bit structure of nFullScreen and added "Menubar" keyword - changed function InitLcd(), added "ZoomDiv" keyword - changed function KillKML(), added reset of variable nLcdDiv - added function IsButtonArea(), check if cursor position is over a button - added function PlayKey(), handle button with OutIn code KML.H - added TOK_MENUBAR and TOK_ZOOMDIV definition - added IsButtonArea() and PlayKey() function prototypes MOPS.C - bugfix in function UckBit(), when UART is off then the UCK bit was always cleared, but it's always set - bugfix in function Npeek(), Nread() and Nwrite(), flash access over a 2KB MMU boundary caused problems in some cases - bugfix in function WriteIO(), race condition when clearing the SON bit in the IOC (0x110) register, the UART was still working so the cleared IOC (0x110), RCS (0x111), TCS (0x112), RBR (0x114,0x115) and TBR (0x116,0x117) register can be overwritten by the serial thread PCH.H - added MulDiv macro RESOURCE.H - added several definitions SERIAL.C - bugfix in function CommOpen(), method of port closing was illegal because COM port dependent threads hadn't been stopped SETTINGS.C - changed function ReadSettings() and WriteSettings(), added section [Macro] in INI-File Emu48 v1.09 EMU48.H - added definition with valid calculator models - added macro with model validation code EMU48.RC - changed IDD_KMLLOG, replaced "Always" text with "Show Script compilation result next time" - changed version FILES.C - bugfix in function NewDocument(), the backup now behave like with function OpenDocument() -> the backup now contain the emulator state before the new session and not the new session itself - bugfix in function OpenDocument(), after reading CPU state, port pointers must immediately be deleted because on error condition function ResetDocument() tries to free this memory; added check for valid calculator model - bugfix in function RestoreBackup(), window title wasn't updated - bugfix in function CreateBIPalette(), for 16 and 32 bitcount bitmaps no logical palette was created - bugfix in function LoadBitmapFile(), function blocked loading bitmap when ROM file was missing and replaced default handler for compression type with BI_BITFIELDS KML.C - changed pAnnunciator[] table size from 7 to 6 because Clarke/Yorke hardware has only six annunciators - changed table szLexDelim[], removed first element - added new table eIsGlobalBlock[] with valid block tokens - bugfix in function KMLLogProc(), return in WM_INITDIALOG case was missing, fallen into WM_COMMAND handler - added new function IsGlobalBlock(), checking if token inside eIsGlobalBlock[] table - changed function Lex(), added assertion for mode checking - changed function ParseLines(), added syntax checking for command tokens and removed "Open block." message - changed function ParseBlocks(), added syntax checking for block tokens - bugfix in function InitButton(), nested scancode block commands hadn't handled correctly - bugfix in function LoadKMLGlobal(), keyword "Global" had only been detected as first command in KML script - changed function InitKML(), changed checking for valid Model argument and changed the corresponding error message KML.H - adjusted definitions of LEX_BLOCK, LEX_COMMAND and LEX_PARAM to modified table szLexDelim[] RPL.C - added new function RPL_GarbageCol() for doing a garbage collection - changed function RPL_CreateTemp(), added garbage collection on low memory condition Emu48 v1.08 DISPLAY.C - changed variable BOOL bVertical to UINT nVertical - changed function CreateLcdBitmap() and UpdateDisplayV(), added new vertical mode EMU48.C - changed function OnPaint(), added new vertical mode EMU48.H - changed bVertical definition EMU48.RC - changed version and copyright KML.C - changed function InitLcd(), now decode integer values for TOK_ORIENTATION Emu48 v1.07 DISPLAY.C - bugfix in function UpdateContrast(), used background Color 0 in calculator off state even if Color 32 was defined - bugfix in function CreateLcdBitmap(), DIB section shouldn't created from the memory DC - deleted function UpdateDisplayPointers() - changed function UpdateDisplayH(), removed calculation of bitmap offset in menu area - changed function UpdateDisplayH() and UpdateDisplayV(), replaced Chipset.width variable with the calculation of Chipset.loffset and Chipset.boffset - changed function LcdThread(), removed critical section for the Chipset.width variable update - bugfix in function StopDisplay(), rectangle area for InvalidateRect() was wrong so sometimes display redraw part of WM_PAINT wasn't called EMU48.C - removed Critical Section initialization for display update - added function IsPort2Writeable() to check if read only file attribute is not set on port2 file - major changes in function SettingsMemoryProc(), added "Port 2 is Writeable" handling and make port2 changeable without closing the current emulation session - changed function SaveChanges(), default button for confirming the "Do you want to save changes ?" message depends now on the "SaveDefaultConfirm" INI-File setting (1=yes / 0=no button) EMU48.H - removed extern declaration of global variables and functions - extern declaration of global variable and function EMU48.RC - added item "Port 2 is Writeable" in settings dialog - removed unused dialog "Select Program" - changed version ENGINE.C - bugfix in function WorkerThread(), when changing into SM_RUN state display constrast must also be restored and removed call of UpdateDisplayPointers() FILES.C - changed function CrcPort2(), made it global accessible IO.H - added definitions KML.C - bugfix in function SkipWhite(), skipping remark text hadn't stop at string end - bugfix in function ParseBlocks(), stopped script parsing without error at unknown block token - bugfix in function SkipLines(), TOK_END was handeled wrong -> this caused a RunKey end if condition of TOK_IFPRESSED or TOK_IFFLAG was false and there was no TOK_ELSE inside this level - bugfix in function KillKML(), ROM type wasn't reset to the preset value at the end MOPS.C - changed function WriteIO(), removed handling for display pointer update and call of UpdateDisplayPointers() RESOURCE.H - removed unused definition - added definition RPL.C - added function RPL_GetSystemFlag() returning the state of the given system flag SETTINGS.C - changed function ReadSettings() and WriteSettings(), added item "SaveDefaultConfirm" in section [File] in the INI-File STACK.C - added helper functions RPL_GetZInt() and RPL_SetZInt() to handle HP49G Precision Integer objects - added function DoInt() to handle a HP49G Precision Integer object - changed function OnStackCopy() and OnStackPaste(), added HP49G Precision Integer support (limited to 127/128 digits incl. sign) TIMER.C - changed timer2 implementation, changed interrupt implementation from WM_TIMER to a thread solution for a significant improvement of the timer2 interrupt time accuracy - changed function CalcT2(), decreased dwCycPerTick counter so that less CPU cycles increase the timer2 ticks to solve skipping timer2 values on Pocket PC 2002 devices introduced with the new timer1 implementation in v1.06 - changed function CheckT1() and CheckT2(), minor optimization in checking if INT or WAKE bit is set Emu48 v1.06 DISPLAY.C - bugfix in function CreateMainBitmap(), in error case hMainDC variable wasn't cleared EMU48.C - changed function OnCreate(), added menu toolbar initialization - changed function OnPaint(), added menu toolbar setting - moved function OnStackCopy() and OnStackPaste() to STACK.C EMU48.H - extern declaration of global functions EMU48.RC - changed menu text "Copy String" to "Copy Stack" and menu text "Paste String" to "Paste Stack" - added menu toolbar - changed version EMU48.VCP - added external.c and stack.c sources EXTERNAL.C - new module with implementation of the beep patch FETCH.C - changed table o81B_[], replaced opcode 81B1 with the beep patch handler FILES.C - changed function MapRom(), enable ROM writing now for all models to make a ROM patch possible KML.C - bugfix in function DrawButton(), drawing released button Type 1 was wrong - bugfix in function InitKML(), changed log message for no "Model" definition found and a missing "Bitmap" definition wasn't detected OPCODES.C - added function o81B1(), opcode implementation for the beep patch OPCODES.H - extern declaration of global function STACK.C - new module with the message handler functions OnStackCopy() and OnStackPaste() prior located in EMU48.C - changed function OnStackCopy() and OnStackPaste(), they can now also copy real numbers from and to the clipboard TIMER.C - bugfix in timer1 implementation, changed implementation from WM_TIMER to a thread solution for a significant improvement of the timer1 accuracy also fixing a synchronizing problem on fast PDA's - new helper functions AbortT1() and T1Thread() for the thread solution - bugfix in function SetT1(), fixed unsynchronized access to timer1 value, stop timer1 only if running and restart timer1 only when timer2 is running TOOLBAR.BMP - bitmap with menu toolbar buttons Emu48 v1.05 DISPLAY.C - bugfix in function GetLineCounter() and StartDisplay(), VBL down counter counted 62,...,0,63 instead of 63,...,0 EMU48.C - changed variable qualifier of szNoTitle and szLicence string EMU48.RC - changed version FILES.C - changed function DecodeRleBmp(), added checking for corrupt BITMAPINFOHEADER biBitCount and biHeight member variables - bugfix in function LoadBitmapFile(), maybe returned illegal handle in the case of no "BM" file header and calculated bitmap size for BI_RGB coded top-down DIB bitmaps was wrong KML.C - bugfix in function MouseButtonDownAt(), last key state wasn't initialized in "NoHold" key case, so button hadn't released automatically Emu48 v1.04 EMU48.RC - changed version FILES.C - changed function PatchRom(), changed ASCII string handling from BYTE to CHAR data type - changed function DecodeRleBmp(), implementation do no use the biSizeImage element of the BITMAPINFOHEADER structure any more - bugfix in function LoadBitmapFile(), loading uncompressed bitmaps failed when BITMAPINFOHEADER element biSizeImage was 0 OPS.H - changed function Nsrb(), speed optimization Emu48 v1.03 EMU48.C - changed function OnStackPaste(), minor code optimization - changed function OnStackPaste() and OnObjectLoad(), removed delays after ON key state change - bugfix in function WinMain(), szCurrentKml wasn't initialized EMU48.RC - changed version FILES.C - changed function WriteStack(), minor optimization when saving as string - bugfix in function OpenDocument(), check for empty KML file name was wrong, so the error handler of the following InitKML() was always called in this case - changed function LoadObject(), file access is now shared KML.C - changed variable qualifier of eIsBlock[] table and removed TOK_NONE item from it - bugfix, global variables pKml and pKmlList hadn't be initialized - removed usage of global variables bKmlLogOkEnabled and nKmlFiles - changed function AddToLog(), changed argument qualifier and minor code optimization - changed function PrintfToLog(), use a local buffer instead of the heap for the output buffer of the wvsprintf() function, this helps to reduce fragmentation of the heap - changed function KMLLogProc(), minor code optimization and removed use of global variable bKmlLogOkEnabled and windows redraw in the WM_INITDIALOG case - changed function DisplayKMLLog(), removed unused debug stuff and removed use of global variable bKmlLogOkEnabled and transfer state of bOkEnabled over the lParam argument to the dialog box procedure - bugfix in function CreateKmlList(), fixed a memory leak in the case of no title - changed function ChooseKMLProc(), minor code optimization - changed function IsBlock(), minor code optimization - bugfix in function ParseString(), fixed memory leak in error case and optimized implementation - changed function IncludeLines(), IncludeBlocks(), LoadKMLGlobal() and InitKML(), file access is now shared OPS.H - bugfix in function Nsub() and Nrsub(), in some situations wrong results in dec mode with illegal decimal number entry as 2nd operator Emu48 v1.02 EMU48.RC - changed version FILES.C - changed function DibNumColors() and CreateBIPalette(), changed argument qualifier - added function DecodeRleBmp(), decoder for RLE4 and RLE8 bitmap data - bugfix in function LoadBitmapFile(), bitmap size calculation was wrong, so incomplete bitmap loading was possible; added support for RLE4 and RLE8 compressed bitmaps TIMER.C - bugfix in function RescheduleT2(), better accuracy on conversation of timer2 ticks into windows timer ms Emu48 v1.01 DISPLAY.C - removed fuction BuildPattern(), replaced by preset Pattern array - bugfix in function UpdateContrast(), used wrong size for display memory initialization in landscape mode - changed function UpdateDisplayPointers(), removed calculation of Chipset.start12, Chipset.end1 and Chipset.end2 - bugfix in function CreateLcdBitmap(), set UpdateDisplayMem function pointer with wrong referenced function - changed function UpdateDisplayH(), write only 34 instead of 36 nibbles in menu display area, therefore the display bitmap memory pointer must be adjusted after the loop - changed function UpdateDisplayV(), write only 34 instead of 36 nibbles in menu display area - replaced timer callback function LcdProc() with the worker thread function LcdThread() - changed functions GetLineCounter(), StartDisplay() and StopDisplay(), changed them from timer to thread implementation - changed function UpdateDisplayH(), UpdateDisplayV() and ResizeWindow(), added QVGA emulation for VGA devices EMU48.C - bugfix in function OnPaint(), added workaround for WM 2003 devices for disabling the menu top bar - changed function OnPaint(), added QVGA emulation for VGA devices EMU48.H - extern declaration of global variable EMU48.RC - added CEUX resource to enable the VGA display - changed version and copyright ENGINE.C - bugfix in function AdjustSpeed(), on large operations the workaround condition for Win2k was detected and the following synchronizing failed because the CPU didn't got the free running cycles for the waited time FILES.C - changed function MapRom(), added detection for packed ROM images - bugfix in function OpenDocument(), reload KML button state from last document close KEYBOARD.C - bugfix in function KeyboardEvent(), prevent buffer overflow with too big out codes on Chipset.Keyboard_Row array KML.C - changed function InitBackground(), added "Vga" keyword - changed function KillKML(), added reset to application zoom 1 - changed function DrawButton(), RefreshButtons(), DrawAnnunciator() and ClipButton(), added QVGA emulation for VGA devices - added function ReloadButtons(), update internal button state from chip keyboard matrix content - bugfix in function RefreshButtons(), bitmap offset wasn't handled - changed function InitKML(), added detection for VGA device and activating the Emu48 internal QVGA emulation KML.H - added TOK_VGA definition - added ReloadButtons() function prototype MOPS.C - bugfix in function WriteIO(), writing to timer2 failed if first writing address was before the timer2 address area - changed function WriteIO(), changing the CONTRLSB (0x101) or the DISPTEST (0x102) register doesn't effect any display pointer, so update request for recalculating the pointers removed OPCODES.C - bugfix in function o802() and o803(), the r=IN opcodes work also on odd addresses in the IO register memory mapping area TIMER.C - changed function CalcT2(), increased 2nd timer call time from 110ms to 156ms for VGA mode Emu48 v1.00 - first public version (c) by Christoph Gießelink, c dot giesselink at gmx dot de