diff --git a/EMU48PLUS.TXT b/EMU48PLUS.TXT index fb88db8..968ff65 100644 --- a/EMU48PLUS.TXT +++ b/EMU48PLUS.TXT @@ -1,4 +1,4 @@ -Emu48 1.55+ (based on Emu48 1.57) +Emu48 1.56+ (based on Emu48 1.58) Emu48+ is a modified version of Emu48 to add support for the ARM-based calculators. It does not emulate the ARM CPU, but it enhances the diff --git a/Emu48.dll b/Emu48.dll index 5b122cf..becb20a 100644 Binary files a/Emu48.dll and b/Emu48.dll differ diff --git a/Emu48.exe b/Emu48.exe index 59c2fa4..1fb1dc5 100644 Binary files a/Emu48.exe and b/Emu48.exe differ diff --git a/PROBLEMS.TXT b/PROBLEMS.TXT index ad3178d..edfff3e 100644 --- a/PROBLEMS.TXT +++ b/PROBLEMS.TXT @@ -1,4 +1,4 @@ -Known bugs and restrictions of Emu48 V1.57 +Known bugs and restrictions of Emu48 V1.58 ------------------------------------------ - the following I/O bits aren't emulated (incomplete) @@ -47,4 +47,4 @@ Known bugs and restrictions of Emu48 V1.57 - quitting the emulator while programming the flash isn't allowed, because the content of flash state machine isn't saved so far -07/14/15 (c) by Christoph Gießelink, c dot giesselink at gmx dot de +08/16/16 (c) by Christoph Gießelink, c dot giesselink at gmx dot de diff --git a/source/CHANGES.TXT b/source/CHANGES.TXT index 6bf9f48..4ddf7ef 100644 --- a/source/CHANGES.TXT +++ b/source/CHANGES.TXT @@ -1,18 +1,66 @@ -Service Pack 57 for Emu48 Version 1.0 +-------------------------------------------------------------------- +Service Pack 56 for Emu48 Version 1.0 + +DDESERV.C +- bugfix in function DdeCallback(), improved input data checking and + avoided multiple DDE data fetch in XTYP_POKE case DEBUGGER.C +- changed function UpdateStackWnd(), OnStackPush() and OnStackPop(), + fixed signed/unsigned mismatch +- changed function UpdateProfileWnd(), fixed signed/unsigned + mismatch and optimized ENG unit search break + +DISPLAY.C +- bugfix in function ResizeWindow(), the WM_PAINT message wasn't + generated by the InvalidateRect() call when the title and menu bar + was disabled and the client area was empty, so we got a main + window with zero size which could not be activated any more -> + issue solved by forcing a menu bar when client area is empty + +EMU48.C +- changed szLicence string, updated to the latest revision of the + GPLv2 + +EMU48.RC +- changed IDD_SET_PERIPHERAL, enlarged width of slider + IDC_SOUND_SLIDER and combo box IDC_SOUND_DEVICE +- changed version and copyright + +KML.C +- changed function InitLcd(), removed zoom factor 4 limitation +- changed function iSqrt(), changed implementation to Heron's method + for speed optimization + + +Service Pack 55 for Emu48 Version 1.0 + +DEBUGGER.C +- bugfix in function OnLButtonUp(), fixed a buffer overflow when + converting a 3 byte hexadecimal string to variable Chipset.out + which overwrite the content of variable Chipset.in, fixed a buffer + overflow when converting a 4 byte hexadecimal string to variable + Chipset.in which overwrite the following two padding bytes and + changed method converting a 2 byte hexadecimal string to variable + Chipset.Bank_FF - bugfix in function OnContextMenu(), when the context menu was generated from the keyboard it was opened at the wrong position - bugfix in function Debugger(), use critical section for secure deletion of the last instruction buffer +- changed function InfoWoRegister(), changed function prototype to + DLGPROC -DISMEM.C -- changed function SetMemRomType(), fixed signed/unsigned mismatch +DEBUGDLL.C +- bugfix in function EmuInitLastInstr(), use critical section for + secure deletion of the last instruction buffer DISPLAY.C - changed function ResizeWindow(), optimized implementation now works independent from window style and menu bar setting +DISMEM.C +- changed function SetMemRomType(), fixed signed/unsigned mismatch + DISRPL.C - changed function PutSn(), minor optimization - changed function DoHexStream(), DoIntStream(), DoBint(), DoReal(), @@ -36,8 +84,13 @@ EMU48.C "Show Menu" checkbox handling - changed function SettingsPeripheralProc(), added UNREFERENCED_PARAMETER statement +- bugfix in function SettingsGeneralProc(), SettingsMemoryProc() and + SettingsPeripheralProc(), changed function prototype to DLGPROC + for getting a 64 bit lParam pointer when compiling for x64 + architecture - changed function OnPaint(), added UpdateWindowBars() call - changed function OnInitMenu(), added MRU list update +- changed function OnViewSettings(), removed DLGPROC typecasts - added function OnContextMenu(), context menu implementation - added function OnNcHitTest(), when no title bar check if mouse position is in client not over a button area @@ -57,7 +110,7 @@ EMU48.RC - changed IDD_SET_GENERAL, added "Show Title" and "Show Menu" checkbox - added menu IDM_MENU -- changed version and copyright +- changed version ENGINE.C - bugfix in function SaveInstrAddr(), added critical section to be @@ -69,7 +122,6 @@ FETCH.C FILES.C - defined abs() and labs() as intrinsic -- changed function DibNumColors(), fixed typecast - changed function DecodeGif(), changed function prototype by adding an argument overwritten by the transparent color if found - changed function LoadBitmapFile(), adjusted to new prototype of @@ -86,6 +138,7 @@ KML.C "SysItem" - changed function KillKML(), added reset of variables hRgn, dwTColor and dwTColorTol +- changed function iSqrt(), made some speed optimizations - added function MouseIsButton() to check if mouse over button area - changed function MouseMovesTo(), changed _ASSERT implementation to make sure that class cursor is NULL and use function @@ -144,18 +197,19 @@ SYMBFILE.C integrity checks -Service Pack 56 for Emu48 Version 1.0 +Service Pack 54 for Emu48 Version 1.0 DEBUGGER.C - removed INSTRSIZE definition - changed function GetAddr(), made function more general by adding address range check and the ability of decoding a symbolic entry into an address -- bugfix in function OnSetCursor(), on "Activation follows mouse" - enabled child dialogs lost focus when cursor moved over parent - debugger dialog - changed function Debugger(), removed initialization of global - variable wInstrSize + variable wInstrSize and added call of "RPL Object Viewer" handling + function +- changed function OnFindOK(), in the case of a search match update + also the RPL object viewer window +- added functions for "RPL Object Viewer" dialog box - changed function EnterAddr(), changed parameter storage from static variable to window user data and replaced address decoder code by GetAddr() function call @@ -174,14 +228,17 @@ DEBUGGER.C change in behavior, on empty address fields the operation fails and the dialog still remains open +DISRPL.C +- new module for RPL object decoding + +DISRPL.H +- header file for RPL object decoding part + EMU48.C -- changed function SetSoundDeviceList(), replaced "Standard Audio" - device ID from constant to definition -- bugfix in function SettingsGeneralProc(), on "Activation follows - mouse" enabled debugger dialog maybe got focus even if it's not - the last active one -- bugfix in function SettingsPeripheralProc(), restart the sound - engine by calling the clean up and initialization functions now +- added function SetSoundDeviceList(), helper function for filling + sound device combo box with waveform-audio output devices +- changed function SettingsPeripheralProc(), removed sound radio + button handlers and added implementation of sound device combo box - changed function OnFileNew(), removed call of function SaveBackup() which is already a part of function NewDocument() - changed function OnFileNew(), OnFileOpen(), OnFileMruOpen(), @@ -189,19 +246,42 @@ EMU48.C of document is available from variable pbyRom (ROM image loaded) to variable bDocumentAvail - changed function OnViewCopy(), removed MONOCHROME source code part -- changed function WinMain(), added sound engine initialization and - clean up +- changed function WinMain(), preset MRU list length (overloaded by + registry setting) now with 4 elements, added more flexible CPU + binding for the Saturn core emulation thread on Windows NT4.0 and + later, added sound engine initialization and clean up and added + non modal "RPL Object Viewer" dialog box in main message handler + +EMU48.DSP +- added disrpl.c and sound.c sources + +EMU48.H +- extern declaration of global variables and functions +- removed extern declaration of global variable EMU48.RC +- added dialog IDD_RPLVIEW +- changed IDD_SET_PERIPHERAL dialog, removed "Speaker" and "Wave" + radio buttons and added "Device" combo box in the sound section +- added "Rpl Object Viewer..." menu entry in debugger "Memory" + context menu - changed version and copyright +EMU48DLL.C +- changed function DLLCreateWnd(), added sound engine initialization +- changed function DLLDestroyWnd(), added sound engine clean up + ENGINE.C - initialized variable wInstrSize with size of last instruction array (the circular buffer can hold (wInstrSize-1) instructions) -- bugfix in function WorkerThread(), moved sound engine - initialization and clean up from SM_RUN state to main function, - this prevents a non responding Saturn CPU emulation when changing - from SM_SLEEP to SM_RUN state during sound engine initialization + +EXTERNAL.C +- removed global variable bWaveBeep +- moved global variable dwWaveVol to module sound.c +- removed functions BeepWave(), BeepWin9x() and Beeper() +- changed function External() and RCKBp(), removed PC speaker + support and used function SoundBeep() instead of Beeper() for beep + output over sound card FETCH.C - made typedef of jump table struct constant, so the const keyword @@ -211,23 +291,27 @@ FETCH.C FILES.C - bugfix in function PatchRom(), removed limitation that patch file must have 6 characters minimum, fixed a buffer overflow when end - of patch file consists of white space characters, recalculate - CRC's only on address patch written and return failture on syntax - errors now + of patch file consists of white space characters and return + failure on syntax errors now PCH.H +- added include winsock2.h and malloc.h - added GWLP_USERDATA, SetWindowLongPtr, GetWindowLongPtr and LONG_PTR definitions for MSVC6.0 SDK and earlier +RESOURCE.H +- added definitions for sound settings and RPL object viewer + handling +- removed IDC_SOUND_SPEAKER and IDC_SOUND_WAVE + SETTINGS.C - changed function ReadSettings() and WriteSettings(), added item - "LastInstrBufSize" in section [Debugger] in the INI-File + "LastInstrBufSize" in section [Debugger] and item "WaveTime" in + section [Emulator] and deleted item "WaveBeep" in section + [Emulator] in the INI-File SOUND.C -- bugfix in function DestroyWaveThread(), the WM_QUIT message may - failed and so the sound message thread wasn't shut down -- changed function SoundOpen(), added additional check if the sound - device support the necessary audio format +- new module for native beeper emulation over wave output device STACK.C - added function Trim(), create a trimmed copy of the input string @@ -255,87 +339,13 @@ UDP.C freeing the allocated memory manually -Service Pack 55 for Emu48 Version 1.0 +Service Pack 53 for Emu48 Version 1.0 -DISMEM.C -- prepared for C++ compiling - -EMU48.C -- replaced global variable lThreadId with local variable dwThreadId -- added global variable with the identifier for the waveform-audio - output device -- added function SetSoundDeviceList(), helper function for filling - sound device combo box with waveform-audio output devices -- changed function SettingsPeripheralProc(), removed sound radio - button handlers and added implementation of sound device combo box -- bugfix in function OnViewScript(), ROM image change wasn't handled - -EMU48.DSP -- added sound.c sources - -EMU48.H -- extern declaration of global variables and functions -- removed extern declaration of global variable - -EMU48.RC -- changed IDD_SET_PERIPHERAL dialog, removed "Speaker" and "Wave" - radio buttons and added "Device" combo box in the sound section -- changed version - -ENGINE.C -- added global variable bEnableSlow for global disabling slowing - down the CPU -- added global variable bSoundSlow slowing down the CPU core at - sound output -- changed function AdjustSpeed() and InitAdjustSpeed, added sound - slow down implementation -- changed function WorkerThread(), added sound engine control - -EXTERNAL.C -- removed global variable bWaveBeep -- moved global variable dwWaveVol to module sound.c -- removed functions BeepWave(), BeepWin9x() and Beeper() -- changed function External() and RCKBp(), removed PC speaker - support and used function SoundBeep() instead of Beeper() for beep - output over sound card - -FILES.C -- bugfix in function MapRom(), modified minimum file size detection - and fixed memory deallocation bug in memory allocation error case -- changed function MapPort2(), improved file size validation and - freeing of file mapping in error case -- changed function UnmapPort2(), added ability to free incomplete - file mapping - -KML.C -- bugfix in function KillKML(), key mapping state table wasn't - cleared at the end - -MOPS.C -- changed function ReadIO(), make only DEBUG_SERIAL output if - bUpdate is true to distinguish between peek-access from debugger - (no output) and read-access from opcode evaluation (with output) - -OPCODES.C -- changed function o801(), call beeper handler function on beeper - port change - -RESOURCE.H -- added definition -- removed IDC_SOUND_SPEAKER and IDC_SOUND_WAVE - -SETTINGS.C -- bugfix in function GetRegistryString(), ignored target buffer size - when copying the default to the target string buffer -- changed function ReadSettings() and WriteSettings(), added item - "WaveDeviceId" and "WaveTime" and deleted item "WaveBeep" in - section [Emulator] in the INI-File - -SOUND.C -- new module for native beeper emulation over wave output device - - -Service Pack 54 for Emu48 Version 1.0 +APPLE.C +- added functions WrDirtyPage() and EraseBlock() for access to the + ROM buffer +- changed function o80B14() and o80B24(), changed implementation + using the new ROM buffer access functions DDESERV.C - prepared for C++ compiling @@ -344,17 +354,38 @@ DEBUGGER.C - prepared for C++ compiling - added new function OnCodeFindPCO(), search for a PCO object in the code window +- bugfix in function OnSetCursor(), on "Activation follows mouse" + enabled child dialogs lost focus when cursor moved over parent + debugger dialog - changed function Debugger(), added context menu commands handler in the WM_COMMAND section - changed function OnFindOK(), added downwards search direction - changed function Find(), added and changed message handler for the "Previous" and "Next" buttons +DISMEM.C +- prepared for C++ compiling + DISPLAY.C - prepared for C++ compiling EMU48.C - prepared for C++ compiling +- replaced global variable lThreadId with local variable dwThreadId +- added global variable with the identifier for the waveform-audio + output device +- added property sheet page handlers SettingsGeneralProc(), + SettingsMemoryProc() and SettingsPeripheralProc() +- bugfix in function SettingsGeneralProc(), on "Activation follows + mouse" enabled debugger dialog maybe got focus even if it's not + the last active one +- removed function SettingsProc(), replaced by the property sheet + page handler functions +- bugfix in function OnViewScript(), ROM image change wasn't handled +- added function PropSheetProc(), callback function for setup the + property sheet +- changed function OnViewSettings(), now creating a propery sheet + instead of a settings dialog - added function OnCopyData() as WM_COPYDATA message handler implementation for changing the state file to the given state file name @@ -366,36 +397,126 @@ EMU48.C EMU48.H - prepared for C++ compiling - added WM_COPYDATA identifier definition +- added definitions for sound interface +- extern declaration of global variables EMU48.RC - changed IDD_FIND, added a "Previous" button for previous search, shorten the text of the "Find Next" button to "Next" and changed the ID of the next search button +- split IDD_SETTINGS dialog into the property pages IDD_SET_GENERAL, + IDD_SET_MEMORY and IDD_SET_PERIPHERAL and added item + "Single Instance" in the "General" property page +- removed IDD_SETTINGS dialog - added "Previous PCO" and "Next PCO" menu entries in debugger "Code" context menu - changed version and copyright -EXTERNAL.C -- prepared for C++ compiling +EMU48DLL.C +- replaced global variable ThreadId with local variable dwThreadId -FETCH.C -- prepared for C++ compiling +ENGINE.C +- added global variable bEnableSlow for global disabling slowing + down the CPU +- added global variable bSoundSlow slowing down the CPU core at + sound output +- changed function AdjustSpeed() and InitAdjustSpeed, added sound + slow down implementation +- changed function WorkerThread(), added sound engine control + +EXTERNAL.C +- changed PCM sampling frequency and definition name +- bugfix in function BeepWave(), eliminated DC offset from waveform, + use global waveform-audio output device identifier for opening and + made a more general initialization of the waveform-audio output + device FILES.C - prepared for C++ compiling -- changed function MapRom() and UnmapRom(), replaced VirtualAlloc() - with malloc() memory request +- changed function MapRom(), removed using of memory mapped files + which has the major advantage that packed ROM files are also valid + now +- changed function UnmapRom(), adjusted to changed MapRom() function +- changed function MapPort2(), improved file size validation and + freeing of file mapping in error case +- changed function UnmapPort2(), added ability to free incomplete + file mapping - changed function SaveBackup() and RestoreBackup(), improved document available detection and added check at port data copy if port source buffer is allocated I28F160.C -- prepared for C++ compiling +- added functions WrDirtyPage(), EraseBlock(), WriteByte() and + ReadByte() for access to the ROM buffer +- changed function WrStateE8C(), WrState40D(), WrState20C(), + WrState30C() and RdStateData(), changed implementation using the + new ROM buffer access functions KML.C - prepared for C++ compiling - added global variable wKeybLocId to hold the keyboard layout input locale at begin of KML loading +- activated keyword "Locale" in pLexToken[] table +- changed function ParseBlocks(), use variable wKeybLocId instead + of input locale reading +- bugfix in function KillKML(), key mapping state table wasn't + cleared at the end and added reset of variable wKeybLocId +- bugfix in function InitKML(), changed implementation by reading + the current keyboard layout and convert the layout data to the + input locale setting + +MRU.C +- prepared for C++ compiling + +OPCODES.C +- changed function o801(), call beeper handler function on beeper + port change + +RESOURCE.H +- added some definitions +- removed IDD_SETTINGS and IDC_FIND_CASE definition + +RPL.C +- prepared for C++ compiling + +SETTINGS.C +- bugfix in function GetRegistryString(), ignored target buffer size + when copying the default to the target string buffer +- changed function ReadSettings() and WriteSettings(), added item + "WaveDeviceId" in section [Emulator] in the INI-File + +STACK.C +- prepared for C++ compiling + +SYMBFILE.C +- prepared for C++ compiling + + +Service Pack 52 for Emu48 Version 1.0 + +EMU48.C +- changed function SettingsProc(), added infrared printer settings + +EMU48.DSP +- added redeye.c and udp.c sources +- added library Ws2_32.lib + +EMU48.H +- extern declaration of global variables and functions + +EMU48.RC +- changed version and copyright + +EMU48DLL.C +- added function DllMain(), implemented "CEmu48" window class + registration and unregistration in process attach and detach + especially for dynamic DLL load with LoadLibrary() and + FreeLibrary() +- bugfix in function DLLCreateWnd(), moved "CEmu48" window class + registration to DllMain(), so it's now possible to unregister + the window class automatically at DLL detach + +KML.C - added global variable bLocaleInc for checking if locale block content already included - added keyword "Locale" to pLexToken[] and token TOK_LOCALE to @@ -413,45 +534,48 @@ KML.C mode "include" or "parse" for the next lines or blocks and verifying the "Include" argument was incomplete and may caused memory leaks at error condition -- bugfix in function ParseBlock(), verifying the block commmand +- bugfix in function ParseBlock(), verifying the block command argument was incomplete and may caused a memory leak at error condition - changed function ParseBlocks(), changed function prototype by adding a boolean argument if an "End" token is also valid and added implementation of block "Locale" -- changed function KillKML(), added reset of variables wKeybLocId - and bLocaleInc +- changed function KillKML(), added reset of variable bLocaleInc - changed function ReleaseButton(), for speed optimization skip function if button is already released - bugfix in function LoadKMLGlobal(), fixed a memory leak caused by the error condition that expected block command is a string -- changed function InitKML(), read and added current keyboard layout - input locale setting to log file text +- changed function InitKML(), added current keyboard input locale + setting log file text KML.H - added TOK_LOCALE definition -MRU.C -- prepared for C++ compiling +MOPS.C +- bugfix in function WriteIO(), removed implementation of the ELBE + bit in the LCR (0x11C) register for apples; the Saturnator has no + ELBE bit simulation so the LSRQ bit in SRQ2 register is untouched -PCH.H -- added include malloc.h +REDEYE.C +- new module for decoding the redeye data stream for a HP82240B + printer RESOURCE.H -- added definitions -- removed IDC_FIND_CASE +- added some definitions -RPL.C -- prepared for C++ compiling +SETTINGS.C +- changed function ReadSettings() and WriteSettings(), added the + items "Address" and "Port" in section [IrPrinter] in the INI-File -STACK.C -- prepared for C++ compiling +TIMER.C +- changed function SetHP48Time(), time calculation now work properly + for host system dates before 1970/01/01 and after 2106/02/07 -SYMBFILE.C -- prepared for C++ compiling +UDP.C +- new module for sending a byte over UDP -Service Pack 53 for Emu48 Version 1.0 +Service Pack 51 for Emu48 Version 1.0 DEBUGGER.C - removed structure MODEL_MAP_T, variables pbyNoMEM, MemMap[], @@ -466,19 +590,10 @@ DEBUGGER.C changed to DISMEM.C implementation - changed function ViewCodeWnd(), set disassembler to memory mapped mode -- bugfix in function OnDblClick(), fixed buffer overflow when - converting a 2 byte hexadecimal string to a byte and added an - update of code window +- bugfix in function OnDblClick(), added update of code window - changed function Debugger(), changed disassembler mode setting and - added initialization of RPL object viewer get nibble function in - WM_INITDIALOG message and added calls of "Load Memory Data..." and - "Save Memory Data..." handling functions -- bugfix in function UpdateRplObjViewWnd(), show entry point names - only in mapped mode and end address for RPL object viewer depend - on the actual memory mapping mode and with the design change to - the DISMEM.C implementation in all debugger and disassembler - related parts, the RPL object viewer also works in all memory - mapping modes properly now + added calls of "Load Memory Data..." and "Save Memory Data..." + handling functions - added functions OnBrowseLoadMem(), OnBrowseSaveMem(), LoadMemData(), SaveMemData(), GetAddr(), DebugMemLoad(), OnMemLoadData(), DebugMemSave() and OnMemSaveData() to handle the @@ -495,18 +610,6 @@ DISASM.C DISMEM.C - new module for accessing memory data for debug view purpose -DISPLAY.C -- changed function GetLineCounterGray() to static - -DISRPL.C -- the get nibble function is not hard referenced as read_nibble() - call any more, it's now called over RplReadNibble() function - pointer -- changed function PrintTail(), expanded to handle 6 digit addresses - -DISRPL.H -- added extern declaration of RplReadNibble() function pointer - EMU48.C - changed function Disasm(), replaced the radio button implementation for the memory mapping mode by a combo box @@ -514,8 +617,6 @@ EMU48.C names any more, it now use the memory controller names used in the debugger memory viewer for a more general approach for the non HP48 calculator models -- changed function WinMain(), added more flexible CPU binding for - the Saturn core emulation thread on Windows NT4.0 and later EMU48.DSP - added dismem.c sources @@ -531,7 +632,15 @@ EMU48.RC - added dialogs IDD_DEBUG_MEMSAVE and IDD_DEBUG_MEMLOAD - added "Load Memory Data..." and "Save Memory Data..." menu entries in debugger "Memory" context menu -- changed version +- changed version and copyright + +EMU48DLL.C +- bugfix in function DLLCreateWnd(), when starting an emulator + session the function was trying to register the window class, but + with introducíng the ATOM variable the system tells that only the + first registration for the process was successful and so on any + other further registration the content of the ATOM variable + pointing to window class got lost KML.C - bugfix in function ReloadButtons(), ON key button wasn't handled @@ -540,91 +649,11 @@ RESOURCE.H - added several definitions - deleted some radio button definitions from the IDD_DISASM dialog -TIMER.C -- changed function SetHP48Time(), time calculation now work properly - for host system dates before 1970/01/01 and after 2106/02/07 +Service Pack 50 for Emu48 Version 1.0 -Service Pack 52 for Emu48 Version 1.0 - -DEBUGGER.C -- changed function ViewMemWnd(), removed initialized but unused - variable - -DISPLAY.C -- changed DIBPIXEL4() and DIBPIXEL3() define, generates the same - code on MSVC6.0 but made it GCC4 compiler compatible - -DISRPL.C -- changed function RplCreateObjView(), defined end pointer also as - constant - -EMU48.C -- added property sheet page handlers SettingsGeneralProc(), - SettingsMemoryProc() and SettingsPeripheralProc() -- removed function SettingsProc(), replaced by the property sheet - page handler functions -- bugfix in function OnDropFiles(), changed function prototype to - the correct structure type of dropped file names and initialized - the bSuccess variable for the case the wNumFiles variable is 0 -- added function PropSheetProc(), callback function for setup the - property sheet -- changed function OnViewSettings(), now creating a propery sheet - instead of a settings dialog -- changed function MainWndProc(), made correct type cast to argument - of function OnDropFiles() -- changed function WinMain(), replaced multiple class name usage - with atom variable, moved read settings before window creation, - and added check for setting "SingleInstance" to switch to an - already running program instance instead of creating a new one - -EMU48.H -- extern declaration of global variable and function - -EMU48.RC -- split IDD_SETTINGS dialog into the property pages IDD_SET_GENERAL, - IDD_SET_MEMORY and IDD_SET_PERIPHERAL and added item - "Single Instance" in the "General" property page -- removed IDD_SETTINGS dialog -- changed version and copyright - -FILES.C -- bugfix in function DecodeBmp() and DecodeGif(), a 2nd bitmap load - allocated and bound a 2nd palette to the main window, now only the - 1st bitmap (mostly the KML background bitmap) bound his palette to - the main window - -KML.C -- changed table pLexToken[], defined table as constant and changed - last token id table preset from constant number to member of token - id enumerator -- bugfix in function ParseString(), decoding the \" sequence as - quotation mark inside a string was incomplete, so every single '\' - character was also removed - -MRU.C -- changed function MruUpdateMenu(), changed variable type of - variable hMenu -- changed function MruReadList(), removed initialized but unused - variable - -RESOURCE.H -- removed IDD_SETTINGS definition -- added some definitions - -SETTINGS.C -- changed function ReadSettings(), moved CPU speed setting to - MainWndProc() -- changed function ReadSettings() and WriteSettings(), added item - "SingleInstance" in section [Emulator] in the INI-File - -UDP.C -- added function ResetUdp(), reset UDP address -- bugfix in function SendByteUdp(), fixed memory leak at error - condition and optimized IP address decoding - - -Service Pack 51 for Emu48 Version 1.0 +APPLE.C +- added BUSCC 56 (opcode 80B65) implementation DDESERV.C - replaced all HeapAlloc() with malloc() memory requests @@ -633,53 +662,49 @@ DEBUGGER.C - replaced all HeapAlloc() with malloc() memory requests - changed function ToggleBreakpoint() and EditBreakpoint(), minor code optimization purging breakpoint -- changed function Debugger(), removed all UpdateWindowStatus() - function calls +- changed function ViewMemWnd(), removed initialized but unused + variable +- bugfix in function OnDblClick(), fixed buffer overflow when + converting a 2 byte hexadecimal string to a byte - bugfix in function LoadBreakpointList(), added check of breakpoint entries against breakpoint table size -DISRPL.C -- replaced all HeapAlloc() with malloc() memory requests -- bugfix in function BCDx(), fixed possible uninitialized bExpflag - variable -- bugfix in function DoRrp(), fixed possible uninitialized bErr - variable +DISPLAY.C +- changed DIBPIXEL() define, generates the same code on MSVC6.0 but + made it GCC4 compiler compatible EMU48.C - removed global variable hHeap - replaced all HeapAlloc() with malloc() memory requests -- changed function SettingsProc(), added infrared printer settings - changed function SaveChanges(), detect if document is available now over the variable bDocumentAvail and not over the variable pbyRom any more; in the case of an illegal KML script there maybe a document loaded, but no ROM image, so pbyRom will be NULL in this case -- renamed function UpdateWindowStatus() to OnInitMenu() and modified - it to a WM_INITMENU message handler -- changed function OnFileNew() and WinMain(), removed all - UpdateWindowStatus() function calls - bugfix function OnViewScript(), when quitted the dialog "Choose Your KML Script" with the Cancel button when chosen an invalid script the function returned without the possibility of saving the current document; now the function try to reload the primarily KML script and if this also fails then the current document is saved -- changed function MainWndProc(), added WM_INITMENU message handler - and call of _CrtDumpMemoryLeaks() at end of program to detect - malloc() memory leaks - -EMU48.DSP -- changed the resource natural language to English -- added redeye.c and udp.c sources -- added library Ws2_32.lib +- changed function WinMain(), replaced multiple class name usage + with atom variable, moved read settings before window creation, + added check for setting "SingleInstance" to switch to an already + running program instance instead of creating a new one and added + call of _CrtDumpMemoryLeaks() at end of program to detect malloc() + memory leaks EMU48.H - removed extern declaration of hHeap - extern declaration of global variables and functions -- removed declaration of global function UpdateWindowStatus() - replaced all HeapAlloc() with malloc() memory requests EMU48.RC -- changed version and copyright +- changed version + +EMU48DLL.C +- changed function DLLCreateWnd(), replaced multiple class name + usage with atom variable and moved read settings before window + creation ENGINE.C - added global variable nOpcSlow to hold the number of CPU opcodes @@ -690,53 +715,25 @@ ENGINE.C if necessary - changed function AdjKeySpeed() and SetSpeed(), use function InitAdjustSpeed() to initialize the CPU slow down variables -- changed function SwitchToState(), removed all UpdateWindowStatus() - function calls EXTERNAL.C - replaced all HeapAlloc() with malloc() memory requests FILES.C - replaced all HeapAlloc() with malloc() memory requests -- changed TREENODE structure, added prev element for a double linked - list -- changed function PatchNibble(), added prev element handling -- bugfix in function UpdatePatches(), in the case an address was - patched more than one time, the ROM was patched in wrong order and - moreover the original content of the double patched ROM address - was destroyed - changed function CrcRom(), if no ROM available return without modifying the checksum -- changed function MapRom(), removed using of memory mapped files - which has the major advantage that packed ROM files are also valid - now -- changed function UnmapRom(), adjusted to changed MapRom() function -- changed function ResetDocument(), OpenDocument(), - SaveDocumentAs(), SaveBackup(), RestoreBackup() and ResetBackup(), - removed all UpdateWindowStatus() function calls - changed function ResetDocument(), NewDocument(), OpenDocument() and RestoreBackup(), added state variable if document is available -- bugfix in function OpenDocument(), added check of KML script name - length against target buffer size -- changed function DibNumColors(), changed function prototype from - UINT to WORD return -- changed function CreateBIPalette(), changed variable - UINT nNumColors to WORD wNumColors to avoid variable overflow - loading palNumEntries of LOGPALETTE structure - -I28F160.C -- added functions WrDirtyPage(), EraseBlock(), WriteByte() and - ReadByte() for access to the ROM buffer -- changed function WrStateE8C(), WrState40D(), WrState20C(), - WrState30C() and RdStateData(), changed implementation using the - new ROM buffer access functions +- bugfix in function DecodeBmp() and DecodeGif(), a 2nd bitmap load + allocated and bound a 2nd palette to the main window, now only the + 1st bitmap (mostly the KML background bitmap) bound his palette to + the main window IO.H - added LBR and LBO bit definitions KEYMACRO.C -- changed function OnToolMacroNew(), OnToolMacroPlay() and - OnToolMacroStop(), removed all UpdateWindowStatus() function calls - changed function EventThread(), added minimum key hold time for keyboard macro playing and subtract minimum key hold time from saved waiting time, this is more accurate when the user has @@ -748,15 +745,15 @@ KEYMACRO.C holding time to the reference time, this is not necessary any more KML.C +- changed table pLexToken[], defined table as constant and changed + last token id table preset from constant number to member of token + id enumerator - replaced all HeapAlloc() with malloc() memory requests -- changed function ParseLines(), BOOL expression was missing in main - while() loop, worked because TOK_NONE is 0 +- bugfix in function ParseString(), decoding the \" sequence as + quotation mark inside a string was incomplete, so every single '\' + character was also removed - bugfix in function ParseBlock(), string argument wasn't freed in error case -- changed function KillKML(), removed UpdateWindowStatus() function - call -- changed function LoadKMLGlobal(), used wrong variable type for - variable eToken MOPS.C - added function ReadT2Acc(), reading timer2 value with checking for @@ -772,45 +769,105 @@ MOPS.C MRU.C - replaced all HeapAlloc() with malloc() memory requests +- changed function MruUpdateMenu(), changed variable type of + variable hMenu +- changed function MruReadList(), removed initialized but unused + variable + +RPL.C +- replaced all HeapAlloc() with malloc() memory requests + +SETTINGS.C +- changed function ReadSettings(), moved CPU speed setting to + MainWndProc() +- changed function ReadSettings() and WriteSettings(), added item + "KeyMinDelay" in section [Macro] and added item "SingleInstance" + in section [Emulator] in the INI-File + +STACK.C +- replaced all HeapAlloc() with malloc() memory requests + +SYMBFILE.C +- replaced all HeapAlloc() with malloc() memory requests + + +Service Pack 49 for Emu48 Version 1.0 + +DEBUGGER.C +- changed function Debugger(), removed all UpdateWindowStatus() + function calls + +EMU48.C +- renamed function UpdateWindowStatus() to OnInitMenu() and modified + it to a WM_INITMENU message handler +- changed function OnFileNew() and WinMain(), removed all + UpdateWindowStatus() function calls +- changed function MainWndProc(), added WM_INITMENU message handler + +EMU48.H +- added definitions to detect Apple platform +- removed declaration of global function UpdateWindowStatus() + +EMU48.RC +- changed version and copyright + +ENGINE.C +- changed function SwitchToState(), removed all UpdateWindowStatus() + function calls + +FILES.C +- changed TREENODE structure, added prev element for a double linked + list +- changed function PatchNibble(), added prev element handling +- bugfix in function UpdatePatches(), in the case an address was + patched more than one time, the ROM was patched in wrong order and + moreover the original content of the double defined ROM address + was destroyed +- changed function ResetDocument(), OpenDocument(), + SaveDocumentAs(), SaveBackup(), RestoreBackup() and ResetBackup(), + removed all UpdateWindowStatus() function calls +- bugfix in function OpenDocument(), added check of KML script name + length against target buffer size +- changed function DibNumColors(), changed function prototype from + UINT to WORD return +- changed function CreateBIPalette(), changed variable + UINT nNumColors to WORD wNumColors to avoid variable overflow + loading palNumEntries of LOGPALETTE structure + +KEYMACRO.C +- changed function OnToolMacroNew(), OnToolMacroPlay() and + OnToolMacroStop(), removed all UpdateWindowStatus() function calls + +KML.C +- changed function ParseLines(), BOOL expression was missing in main + while() loop, worked because TOK_NONE is 0 +- changed function KillKML(), removed UpdateWindowStatus() function + call +- changed function LoadKMLGlobal(), used wrong variable type for + variable eToken + +MOPS.C +- changed function ReadIO() and WriteIO(), on Apple hardware the + BAUD (0x10D) register use 4 bits for baud rate setting, the UCK + bit isn't supported on this platform OPS.H - bugfix in function FASTPTR(), longest opcode calculation from buffer size was wrong, so MMU boundary fixup wasn't working properly -PCH.H -- added include winsock2.h - -REDEYE.C -- new module for decoding the redeye data stream for a HP82240B - printer - -RESOURCE.H -- added some definitions - -RPL.C -- replaced all HeapAlloc() with malloc() memory requests - -SETTINGS.C -- changed function ReadSettings() and WriteSettings(), added item - "KeyMinDelay" in section [Macro] and the items "Address" and - "Port" in section [IrPrinter] in the INI-File +SERIAL.C +- changed function CommSetBaud(), expanded dwBaudrates[] table and + enabled the access to these baud rates on the Apple platform STACK.C -- replaced all HeapAlloc() with malloc() memory requests - bugfix in function RPL_GetBcd(), fixed possible uninitialized bExpflag variable - bugfix in function OnStackCopy(), fixed possible uninitialized uClipboardFormat variable in DOCSTR case -SYMBFILE.C -- replaced all HeapAlloc() with malloc() memory requests -UDP.C -- new module for sending a byte over UDP - - -Service Pack 50 for Emu48 Version 1.0 +Service Pack 48 for Emu48 Version 1.0 DEBUGGER.C - changed table MemMap[], replaced Chipset_t memory pointer Port0, @@ -820,22 +877,16 @@ DISASM.C - changed function rn_ram(), rn_port1() and rn_port2(), replaced Chipset_t memory pointers Port0, Port1 and Port2 by new variables -DISRPL.C -- cosmetic changes - EMU48.C - changed function Disasm(), added if opcode should be interpreted as PCO EMU48.H - extern declaration of global variables -- added RplGetName(a) definition for DLL version linking EMU48.RC -- changed IDD_DEBUG_SETTINGS, replaced "Ok" with "OK" and removed - accelerator keys from "OK" and "Cancel" - changed IDR_DEBUG_MEM, added several accelerator keys -- changed version and copyright +- changed version ENGINE.C - changed function WorkerThread(), replaced structure Chipset_t @@ -853,8 +904,6 @@ FILES.C variables KML.C -- changed function RunLine(), removed warning when compiling for x64 - architecture - changed function InitKML(), pointed out that a packed ROM image is an error @@ -867,8 +916,6 @@ OPCODES.C going into shutdown mode OPS.H -- bugfix in function FASTPTR(), longest opcode is 21 nibbles long - and fixed problem executing an opcode over a MMU boundary - changed function Nunpack(), new coding for speed optimization, this solved also a bug in the code optimizer of VS2010 (the optimizer generated wrong code, another possible workaround for @@ -877,7 +924,6 @@ OPS.H PCH.H - added INVALID_FILE_ATTRIBUTES definition -- enabled WinXP style under VS2005, VS2008 and VS2010 RPL.C - changed function Metakernel(), replaced structure Chipset_t @@ -901,31 +947,59 @@ TYPES.H the state file structure -Service Pack 49 for Emu48 Version 1.0 +Service Pack 47 for Emu48 Version 1.0 -DISRPL.C -- bugfix in function BCDx(), detection for exponent writing was - wrong -> on negative exponents sometimes the result format was - wrong, on positive exponents sometimes the result itself was wrong +DDESERV.C +- changed function DdeCallback(), made ON key hold time variable + +DEBUGGER.C +- changed function Debugger(), added Debugger Settings to the system + menu EMU48.C +- changed function OnDropFiles() and OnObjectLoad(), made ON key + hold time variable - changed function OnFileMruOpen(), on success move selected entry to top of MRU table EMU48.DSP -- changed to REGISTRY (HKCU/Software/Emu48) saving +- changed to REGISTRY (HKCU/Software/Emu48) saving in Release, + Debug, Release Unicode and Debug Unicode configuration +- added symbfile.c sources EMU48.H -- extern declaration of global variable and function +- extern declaration of global variables and functions EMU48.RC -- changed version +- changed IDD_DEBUG_SETTINGS, replaced "Ok" with "OK" and removed + accelerator keys from "OK" and "Cancel" +- changed version and copyright + +KEYBOARD.C +- changed function KeyboardEvent(), made key switch time variable + +KML.C +- enabled "IfMem" KML keyword +- changed function RunLine(), removed warning when compiling for x64 + architecture MRU.C - changed function MruAdd(), added entry moving to top when the entry is already in the table - added function MruMoveTop(), move MRU entry to top of table +OPS.H +- bugfix in function FASTPTR(), longest opcode is 21 nibbles long + and fixed problem executing an opcode over a MMU boundary + +PCH.H +- enabled WinXP style under VS2005 and VS2008 + +SETTINGS.C +- changed function ReadSettings() and WriteSettings(), added items + "WakeupDelay" and "KeyMinDelay" in section [Emulator] in the + INI-File + STACK.C - bugfix in function RPL_GetBcd(), detection for exponent writing was wrong -> on negative exponents sometimes the result format was @@ -935,19 +1009,136 @@ STACK.C handle complex number objects - added function DoComplex() to handle a complex number object - changed function OnStackCopy(), added complex number support -- changed function OnStackPaste(), added flag to disable automatic - clipboard object detection and added complex number support +- changed function OnStackPaste(), made ON key hold time variable, + added flag to disable automatic clipboard object detection and + added complex number support + +SYMBFILE.C +- new module for loading external symbols from a Saturn3 linker file -Service Pack 48 for Emu48 Version 1.0 +Service Pack 46 for Emu48 Version 1.0 + +APPLE.C +- added BUSCC 09 (opcode 80B90) data streamer implementation as NOP DDESERV.C - bugfix in function DdeCallback(), readded delay at XTYP_POKE after ON key state change switching calculator on, bug introduced in - SP37 and made ON key hold time variable + SP37 + +DEBUGDLL.C +- added dummy functions CreateBackupBreakpointList() and + RestoreBackupBreakpointList() for linking DEBUGGER.C - added backup breakpoint list +- bugfix in function InfoWoRegister(), changed WM_COMMAND message + handler from IDOK to IDCANCEL to make the close button working + properly +- added functions SaveBreakpointList() and + CreateBackupBreakpointList() to handle the backup breakpoint list + +DEBUGGER.H +- extern declaration of global functions + +DISPLAY.C +- made gobal variable pbyLcd static + +EMU48.C +- bugfix in function OnDropFiles() and OnObjectLoad(), readded + delay after ON key state change switching calculator on, bug + introduced in SP37 +- changed function OnFileOpen(), added MruAdd() call +- added new function OnFileMruOpen(), command handler for MRU menu + selections +- changed function OnFileSaveAs(), added MruAdd() call +- changed function OnObjectLoad(), changed load object warning + message +- changed function MainWndProc(), added MRU message handler +- changed function WinMain(), added MRU handling +- bugfix in function WinMain(), getting the full path name of the + current state file failed in the case of an empty name buffer + +EMU48.DSP +- added mru.c sources + +EMU48.H +- removed extern declaration of pbyLcd +- extern declaration of global functions + +EMU48.RC +- changed IDD_WRITEONLYREG, changed ID of OK control from IDOK to + IDCANCEL +- changed IDD_SETTINGS, replaced "Ok" with "OK" and removed + accelerator keys from "OK" and "Cancel" +- added Menuitem Files "Recent Files..." +- changed version and copyright + +EMU48DLL.C +- bugfix in function DLLDestroyWnd(), getting the full path name of + the current state file failed in the case of an empty name buffer + +FILES.C +- bugfix in function OpenDocument(), if document reload was refused + the function returned no success -> this caused trouble in + function OnFileMruOpen() removing the MRU entry of this document +- bugfix in function SaveBackup(), a backup of the debugger + breakpoint list wasn't created +- bugfix in function RestoreBackup(), the debugger breakpoint list + wasn't restored so the breakpoints got lost when saving the state + file and added preserving debugger open state, this feature was + lost as a result of a bugfix in an earlier version +- changed function GetOpenFilename(), added file filter for all + Emu48 specific filenames which is default, changed filter names + and removed model specific file extention selection +- changed function GetSaveAsFilename(), changed filter names and use + small size characters for file extentions +- changed function DecodeGif(), fixed a GCC type mismatch warning + +KML.C +- added token TOK_IFMEM to eIsBlock[] table +- added function UpdateScriptList(), filling the KML script combo + box with all found script titles and select the current used one +- changed function ChooseKMLProc(), call function UpdateScriptList() + to update the KML script combo box now +- removed function FatalError() +- bugfix in function ParseString(), replaced error text +- bugfix in function IncludeLines(), removed fatal error message + text +- bugfix in function ParseLines(), in some cases parsing hadn't + stopped with an error inside a block with an unreferenced include + file and removed a fatal error message text +- bugfix in function ParseBlock(), block argument checking generated + wrong error messages in the case of syntax errors +- bugfix in function IncludeBlocks(), removed fatal error message + text +- changed function ParseBlocks(), removed "Invalid block." message + text and made some code optimizations calling the function + FatalError() +- changed function InitGlobal(), changed some punctuation and + capital letters +- changed function InitButton(), source code improvement checking + the size of button array +- changed function RunLine(), added implementation of "IfMem" + command +- bugfix in function ReloadButtons(), global variable bKeyPressed + wasn't updated + +KML.H +- added TOK_IFMEM definition + +MRU.C +- new module for MRU routines + +STACK.C +- bugfix in function OnStackPaste(), readded delay after ON key + state change switching calculator on + + +Service Pack 45 for Emu48 Version 1.0 + +DEBUGGER.C - added function LoadSymbTable(), loading symbol table defined in INI-File - added function GetMemCurAddr(), get address of cursor in memory @@ -970,25 +1161,13 @@ DEBUGGER.C removed limitation going back before address 0 - changed function OnDrawCodeWnd(), added draw style for label line - changed function Debugger(), added initialization and - uninitialization of symbol table and bold font, added +/- key - handling for memory window, added Debugger Settings to the system - menu and added call of "RPL Object Viewer" handling function -- changed function OnFindOK(), in the case of a search match update - also the RPL object viewer window -- added functions for "RPL Object Viewer" dialog box + uninitialization of smybol table and bold font and added +/- key + handling for memory window - added functions for Debugger Settings handling - changed function EnterAddr(), added decoding a symbolic entry into - an address and expanded hex address range from 6 to 8 digits + an address - changed function InfoIntr(), added label line if instruction address is a known entry -- bugfix in function InfoWoRegister(), changed WM_COMMAND message - handler from IDOK to IDCANCEL to make the close button working - properly -- added functions SaveBreakpointList() and - CreateBackupBreakpointList() to handle the backup breakpoint list - -DEBUGGER.H -- extern declaration of global functions DISASM.C - added variable disassembler_symb to enable symbolic address @@ -1014,68 +1193,27 @@ DISASM.C prototypes by removing the view argument DISPLAY.C -- made global variable public static -- changed DIBPIXEL4() define, generates the same code on MSVC6.0 but +- changed DIBPIXEL() define, generates the same code on MSVC6.0 but made it GCC compiler compatible -DISRPL.C -- new module for RPL object decoding - -DISRPL.H -- header file for RPL object decoding part - EMU48.C -- bugfix in function OnDropFiles() and OnObjectLoad(), readded - delay after ON key state change switching calculator on, bug - introduced in SP37 and made ON key hold time variable -- changed function OnObjectLoad(), changed load object warning - message - changed function Disasm(), adjusted to new prototype of function disassemble() -- changed function WinMain(), added non modal "RPL Object Viewer" - dialog box in main message handler -- bugfix in function WinMain(), getting the full path name of the - current state file failed in the case of an empty name buffer - -EMU48.DSP -- added disrpl.c and symbfile.c sources EMU48.H -- removed extern declaration of pbyLcd - removed VIEW_SHORT and VIEW_LONG definition - changed function prototypes -- extern declaration of global variables and functions +- extern declaration of global variable and functions EMU48.RC -- changed IDD_WRITEONLYREG, changed ID of OK control from IDOK to - IDCANCEL -- changed IDD_SETTINGS, replaced "Ok" with "OK" and removed - accelerator keys from "OK" and "Cancel" -- added dialogs IDD_DEBUG_SETTINGS and IDD_RPLVIEW -- added "Rpl Object Viewer..." menu entry in debugger "Memory" - context menu -- changed version and copyright +- added dialog IDD_DEBUG_SETTINGS +- changed name order in copyright messages +- changed version FILES.C -- changed function GetCutPathName(), removed warning when compiling - for x64 architecture - changed function IsDataPacked(), made a DWORD pointer copy of the VOID pointer argument to avoid type casting, this generates the same code on MSVC6.0 but made it GCC compiler compatible -- bugfix in function OpenDocument(), if document reload was refused - the function returned no success -> this caused trouble in - function OnFileMruOpen() removing the MRU entry of this document -- bugfix in function SaveBackup(), a backup of the debugger - breakpoint list wasn't created -- bugfix in function RestoreBackup(), the debugger breakpoint list - wasn't restored so the breakpoints got lost when saving the state - file and added preserving debugger open state, this feature was - lost as a result of a bugfix in an earlier version -- changed function GetOpenFilename(), added file filter for all - Emu48 specific filenames which is default, changed filter names - and removed model specific file extension selection -- changed function GetSaveAsFilename(), changed filter names and use - small size characters for file extensions - added function DecodeBmp(), contain the BMP image file decoder prior located in function LoadBitmapFile() and added check of bitmap file size @@ -1085,57 +1223,22 @@ FILES.C was missing, moved BMP image file decoder to function DecodeBmp() and added GIF image file support -KEYBOARD.C -- changed function KeyboardEvent(), made key switch time variable - KML.C - changed szText variable qualifier from LPTSTR to LPCTSTR -- added keyword "IfMem" to pLexToken[] table -- added token TOK_IFMEM to eIsBlock[] table - changed function CreateKmlList(), adjusted to new prototype of function GetStringParam() -- added function UpdateScriptList(), filling the KML script combo - box with all found script titles and select the current used one -- changed function ChooseKMLProc(), call function UpdateScriptList() - to update the KML script combo box now -- removed function FatalError() -- bugfix in function ParseToken(), modifying the +- bugfix in function FatalError() and ParseToken(), modifying the script buffer content isn't allowed -- changed function InitLex(), adjusted to constant pointer of - variable szText -- bugfix in function ParseString(), replaced error text -- bugfix in function IncludeLines(), removed fatal error message - text and adjusted to constant pointer of variable szText -- bugfix in function ParseLines(), in some cases parsing hadn't - stopped with an error inside a block with an unreferenced include - file and removed a fatal error message text -- bugfix in function ParseBlock(), block argument checking generated - wrong error messages in the case of syntax errors -- bugfix in function IncludeBlocks(), removed fatal error message - text and adjusted to constant pointer of variable szText -- changed function ParseBlocks(), removed "Invalid block." message - text and made some code optimizations calling the function - FatalError() -- changed function InitGlobal(), changed some punctuation and - capital letters -- changed function InitButton(), source code improvement checking - the size of button array -- changed function RunLine(), added implementation of "IfMem" - command +- changed function InitLex(), IncludeLines() and IncludeBlocks(), + adjusted to constant pointer of variable szText - changed function GetStringParam(), changed return variable qualifier from LPTSTR to LPCTSTR -- bugfix in function ReloadButtons(), global variable bKeyPressed - wasn't updated - -KML.H -- added TOK_IFMEM definition PCH.H - added INVALID_SET_FILE_POINTER definition RESOURCE.H -- added definitions for Debugger Settings and RPL object viewer - handling +- added definitions for Debugger Settings handling RPL.C - renamed definition DOEREAL to DOEREL and adjusted usage in @@ -1148,57 +1251,66 @@ RPL.C SETTINGS.C - changed function ReadSettings() and WriteSettings(), added item - "Symbolic" in section [Disassembler] and added items "WakeupDelay" - and "KeyMinDelay" in section [Emulator] in the INI-File - -STACK.C -- bugfix in function OnStackPaste(), readded delay after ON key - state change switching calculator on and made ON key hold time - variable - -SYMBFILE.C -- new module for loading external symbols from a Saturn3 linker file + "Symbolic" in section [Disassembler] in the INI-File -Service Pack 47 for Emu48 Version 1.0 +Service Pack 44 for Emu48 Version 1.0 + +APPLE.C +- changed function o80BReg164(), o80BReg264() and o80BRegWrite(), + optimization by throwing out case switch +- added BUSCC 00 (opcode 80B00) implementation +- added BUSCC 03 (opcode 80B30) implementation +- added BUSCC 04 (opcode 80B40) implementation +- added BUSCC 06 (opcode 80B60) implementation +- added BUSCC 07 (opcode 80B70) implementation +- added BUSCC 08 (opcode 80B80) implementation +- added BUSCC 09 (opcode 80B90) implementation +- added BUSCC 7F (opcode 80BF7) implementation but not called so far +- bugfix in function o80BExt(), RCKBp has opcode BUSCC 09 (opcode + 80B90) and not BUSCC 90 and changed BUSCC 7F (opcode 80BF7) + setting carry flag to tell that SETFLDn failed (SETFLDn not + implemented so far) DDESERV.C - bugfix in function DdeCallback(), readded delay after ON key state - change, bug introduced in SP37 - -DEBUGGER.C -- changed function OnLButtonUp(), NewValue(), EnterAddr() and - EnterBreakpoint(), replaced WM_GETTEXT message call with function - GetWindowText() + change, bug introduced in SP36 DISASM.C - bugfix in function disassemble(), the NOP5 opcode returned wrong address for next instruction (GOTO opcode skipping one nibble) EMU48.C -- changed function SettingsProc(), adjusted to new prototype of - function GetLoadObjectFilename(), use (*.BIN) as default file - filter now +- changed function SettingsProc(), added "Always On Top" and + "Activation Follows Mouse" checkbox handling and adjusted to new + prototype of function GetLoadObjectFilename(), use (*.BIN) as + default file filter now +- changed in function SaveChanges() and OnFileSaveAs(), removed call + of last document saving - changed function OnPaint(), removed mixture of BitBlt() calls with argument hPaintDC and hWindowDC inside critical section -- changed function OnFileClose(), removed call of DisableDebugger() - because it's now done in function ResetDocument() - bugfix in function OnDropFiles() and OnObjectLoad(), readded delay - after ON key state change, bug introduced in SP37 + after ON key state change, bug introduced in SP36 - changed function OnObjectLoad() and OnObjectSave(), adjusted to new prototype of function GetLoadObjectFilename() and GetSaveObjectFilename(), use (*.HP;*.LIB) as default file filter now +- changed function WinMain(), added last document saving at end of + program EMU48.H - added file filter definitions -- extern declaration of global variable and function +- extern declaration of global variable and global functions - changed function prototypes EMU48.RC -- changed name order in copyright messages +- added item "Always On Top" and "Activation Follows Mouse" in + settings dialog - changed version and copyright +EMU48DLL.C +- changed in function DLLDestroyWnd(), added last document saving + EXTERNAL.C - removed inline function Return(), replaced by a rstkpop() call - added function Beeper() for beeping without taking care about @@ -1206,13 +1318,21 @@ EXTERNAL.C - added function RCKBp() simulating the ROM Check Beep FILES.C -- changed function ResetDocument(), added call of DisableDebugger() +- changed function GetCutPathName(), removed warning when compiling + for x64 architecture +- changed function PatchRom() and MapRom(), if szRomDirectory + contain data, the data is used as path to the ROM image else the + ROM image in the standard szRomDirectory is used + +FILES.C - changed function GetOpenFilename() and GetSaveAsFilename(), removed some NULL characters at end of file filter definition string - changed function GetLoadObjectFilename() and GetSaveObjectFilename(), changed function prototype, added arguments for the file filter and the default extention +- changed function WriteStack(), adjusted to new prototype of + function RPL_CreateTemp() I28F160.C - adjusted implementation to the new bit array of the block lock @@ -1230,7 +1350,7 @@ KML.C - changed function GetStringOf(), changed for better reading - changed function SkipWhite(), optimized and better readable implementation -- bugfix in function ParseToken(), optimized string delimiter +- bugfix in function ParseToken(), optimized string delimeter searching among other optimizations and removed increment of line counter on LF character to correct the line numbering on UNIX files with LF instead of CR LF at line end -> line counter @@ -1238,68 +1358,108 @@ KML.C in function Lex() - changed function ParseLine(), replaced main loop "goto" construct -LOWBAT.C -- bugfix in function StartBatMeasure(), creating the battery - watching thread wasn't Win9x compatible -- changed function GetBatteryState(), added possibility to disable - low battery detection +OPCODES.C +- bugfix in function o81B1(), on ARM-based calculators return to RPL + preserve Carry flag + +RPL.C +- changed function RPL_CreateTemp(), added garbage collection + argument to disable automatic garbage collection SETTINGS.C -- changed function ReadSettings() and WriteSettings(), added item - "Disable" in section [LowBat] in the INI-File +- changed function ReadSettings(), added item "RomDirectory" in + section [Files] in the INI-File STACK.C - bugfix in function OnStackPaste(), readded delay after ON key - state change, bug introduced in SP37 + state change, bug introduced in SP36 and adjusted to new prototype + of function RPL_CreateTemp() + +TYPES.H +- renamed structure Chipset_t to CHIPSET and removed CHIPSET define +- added structure APPLE_CHIPSET containing Apple specific data -Service Pack 46 for Emu48 Version 1.0 - -EMU48.C -- bugfix in function SaveChanges(), returned wrong ID when function - GetSaveAsFilename() returned FALSE, bug introduced in SP45 -- bugfix in function WinMain(), in some cases only file short names - had been written as last document - -EMU48.RC -- changed version - - -Service Pack 45 for Emu48 Version 1.0 +Service Pack 43 for Emu48 Version 1.0 + +DEBUGGER.C +- changed function OnLButtonUp(), NewValue(), EnterAddr() and + EnterBreakpoint(), replaced WM_GETTEXT message call with function + GetWindowText() + +DISASM.C +- disabled automatic inline code +- fixed source file formatting error +- changed function append_field(), defined as inline code +- changed function append_r_addr(), code optimization EMU48.C +- changed function SetCommList(), don't try all possible COM ports + any more, get current serial device list from registry + "HKLM\Hardware\\DeviceMap\\SerialComm" and fill both combo boxes + at one loop for speed up scanning +- changed function SettingsProc(), adjusted to new prototype of + function SetCommList() - 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 + returns a boolean and not a button id +- bugfix in function OnFileNew(), function SaveBackup() was called + when emulator engine was running -> this may caused inconsistent + backup data - 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 MainWndProc(), added MRU message handler -- changed function WinMain(), added MRU handling and added last - document saving at end of program + returns a boolean and not a button id +- changed function OnFileSaveAs() and OnObjectSave(), minor + optimizations +- changed function OnFileClose(), removed call of DisableDebugger() + because it's now done in function ResetDocument() +- changed function OnMouseMove(), added "Activation follows mouse" + feature +- added function OnNcMouseMove() for "Activation follows mouse" + feature in non client area +- changed function MainWndProc(), added WM_NCMOUSEMOVE message + handler +- changed function WinMain(), added StartupBackup handling -EMU48.DSP -- added mru.c sources +EMU48DLL.C +- changed function DLLCreateWnd(), added StartupBackup handling EMU48.H -- extern declaration of global functions +- extern declaration of global variable and global functions +- changed prototype of function RPL_ObjectSize() EMU48.RC -- added Menuitem Files "Recent Files..." +- cosmetic changes in dialog IDD_CHOOSEKML to improve WinXP style - changed version -MRU.C -- new module for MRU routines +FILES.C +- changed function GetCutPathName(), better support for UNC names +- changed function ResetDocument(), added call of DisableDebugger() +- changed function SaveBackup(), added assertion for checking + emulator engine state +- 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 + +OPCODES.C +- changed function o83n(), o88n() and o89n(), speed optimization + +OPS.H +- changed function Tbit0(), Tbit1(), Ta(), Tb(), Tae() and Tbe(), + speed optimization RESOURCE.H - added definition for MRU handling +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 - added function DelReg() for deleting a registry item +- changed function ReadSettings() and WriteSettings(), added item + "StartupBackup" in section [Files] and item "ActFollowsMouse" and + "AlwaysOnTop" in section [Emulator] - added functions ReadSettingsString(), WriteSettingsString(), ReadSettingsInt(), WriteSettingsInt() and DelSettingsKey(), universal settings interface used for MRU data handling @@ -1310,7 +1470,7 @@ TIMER.C reset timer event identifier -Service Pack 44 for Emu48 Version 1.0 +Service Pack 42 for Emu48 Version 1.0 DEBUGGER.C - added new function OnSetCursor(), message handler for @@ -1321,59 +1481,42 @@ DEBUGGER.C was wrong, but over the years I has liked this debugger dialog behavior so I put in the correct argument for this behavior -DISASM.C -- disabled automatic inline code -- fixed source file formatting error -- changed function append_field(), defined as inline code -- changed function append_r_addr(), code optimization - DISPLAY.C - changed function ResizeWindow(), added "Always on top" feature EMU48.C -- removed definition of MAXPORTS - removed global variable bClassicCursor - added function ForceForegroundWindow() forcing window to foreground -- changed function SetCommList(), don't try all possible COM ports - any more, get current serial device list from registry - "HKLM\Hardware\\DeviceMap\\SerialComm" and fill both combo boxes - at one loop for speed up scanning -- changed function SettingsProc(), added "Always On Top" and - "Activation Follows Mouse" checkbox handling, adjusted to new CRC - handling of port2 and 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 -- changed function OnMouseMove(), added "Activation follows mouse" - feature -- added function OnNcMouseMove() for "Activation follows mouse" - feature in non client area -- changed function MainWndProc(), added WM_NCMOUSEMOVE message - handler +- major changes in function SettingsProc(), added "Port 2 is + Writeable" handling, make port2 changeable without closing the + current emulation session and adjusted to new CRC handling of + port2 - bugfix in function WinMain(), moved additional DDE stuff just - behind DDE server initialization, added StartupBackup handling, - adjusted length for cut filenames preventing negative values and - call ShowWindow() before asking for a new document preventing a - KML script dialog without a parent window + behind DDE server initialization, adjusted length for cutted + filenames preventing negative values and call ShowWindow() before + asking for a new document preventing a KML script dialog without a + parent window EMU48.H - removed declaration of bClassicCursor - extern declaration of global variables and functions -- changed function prototypes EMU48.RC -- added item "Always On Top" and "Activation Follows Mouse" in - settings dialog -- cosmetic changes in dialog IDD_CHOOSEKML to improve WinXP style -- changed version +- added item "Port 2 is Writeable" in settings dialog +- changed version and copyright + +EMU48DLL.C +- bugfix in function DLLCreateWnd(), moved additional DDE stuff just + behind DDE server initialization, adjusted length for cutted + filenames preventing negative values and call ShowWindow() before + asking for a new document preventing a KML script dialog without a + parent window FILES.C - added global variables holding the patched ROM checksum and the port2 CRC -- changed function GetCutPathName(), better support for UNC names -- changed function SetWindowPathTitle(), adjusted length for cut +- changed function SetWindowPathTitle(), adjusted length for cutted filename - changed function CrcRom(), change function prototype, added unpacked data check and made function public @@ -1384,11 +1527,11 @@ FILES.C - 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 CrcPort2(), change function prototype and added - unpacked data check +- changed function CrcPort2(), change function prototype, added + unpacked data check and made it global accessible - 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 UnmapPort2(), added reset of Port 2 CRC variable - new function IsDataPacked() for unpacked data check - changed function OpenDocument(), use ROM checksum made in InitKML() and port2 CRC made in MapPort2() and added checks for @@ -1397,28 +1540,23 @@ FILES.C "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 KML.C - bugfix in function KillKML(), class member variable wasn't reset +- 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 - changed function MouseMovesTo(), removed bClassicCursor switch for using arrow cursor over button - 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 +- bugfix in function o807(), Chipset.in register must be refreshed + before checking for a pressed key PCH.H - added include stddef.h @@ -1427,22 +1565,19 @@ PCH.H RESOURCE.H - added some definitions -RPL.C -- bugfix in RPL_ObjectSize(), changed function prototype for adding - buffer size parameter preventing reading outside buffer area when - decoding bad objects - -SERIAL.C -- changed function CommOpen(), increased buffer size for device name - SETTINGS.C -- changed function ReadSettings() and WriteSettings(), added item - "StartupBackup" in section [Files] and item "ActFollowsMouse" and - "AlwaysOnTop" in section [Emulator], removed item "ClassicCursor" - from [KML] section in the INI-File +- bugfix in function WriteSettings(), in the INI-File in section + [Files] the item "SaveDefaultConfirm" was missing and saving item + "AutoSaveOnExit" was called twice +- changed function ReadSettings() and WriteSettings(), removed item + "ClassicCursor" from [KML] section in the INI-File + +TIMER.C +- changed function CalcT2(), in the case of a pending timer2 + interrupt return always the timer2 value 0xFFFFFFFF -Service Pack 43 for Emu48 Version 1.0 +Service Pack 41 for Emu48 Version 1.0 DDESERV.C - removed warnings when compiling under VS2005 @@ -1457,39 +1592,26 @@ DISASM.C ?=0 opcode DISPLAY.C -- changed function StopDisplayGray() and StopDisplayBW(), adjusted - to new prototype of ReadIO() +- changed function StopDisplay(), adjusted to new prototype of + ReadIO() EMU48.C - removed warnings when compiling under VS2005 - moved CF_HPOBJ definition to EMU48.H -- replaced function IsPort2Writeable() with IsFileWriteable() -- bugfix in function SettingsProc(), in case IDC_PORT2LOAD an update - of the port2 writeable checkbox was missing, in case IDOK a - changed port2 writeable checkbox made a warmstart even if there's - no port2 filename, changed behavior of port2 area if port2 - filename is given by the command line argument: show actual port2 - file in disabled port2 filename edit field now, also changes of - the port2 shared and writeable checkboxes have affect now - changed function OnFileClose(), removed call of KillKML() because will be done in ResetDocument() -EMU48.DSP -- added lowbat.c sources - EMU48.H - added CF_HPOBJ definition from EMU48.C - changed function prototypes -- extern declaration of global functions EMU48.RC +- changed version - replaced CREATEPROCESS_MANIFEST_RESOURCE_ID definition in manifest declaration by 1 -- changed version and copyright -ENGINE.C -- changed function WorkerThread(), added control of battery - measurement thread +EMU48DLL.C +- added DDE server EXTERNAL.C - changed function BeepWave(), removed VS2005 warning @@ -1504,9 +1626,6 @@ FILES.C restore list was overwritten with the patched data - changed function PatchRom(), removed VS2005 warning - changed function MapPort2(), improved checking for valid size -- bugfix in function GetLoadObjectFilename(), removed call of - HeapFree() which was a remainder of the implementation prior to - SP42 - changed function WriteStack(), added stack level argument - changed function LoadObject(), adjusted call of WriteStack() to new function prototype @@ -1521,36 +1640,22 @@ KEYMACRO.C macro file header KML.C -- removed warnings when compiling under VS2005 - 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 + read mode PCH.H - added _CRT_SECURE_NO_DEPRECATE definition @@ -1575,11 +1680,18 @@ STACK.C TIMER.C - removed warnings when compiling under VS2005 -- changed function CalcT2(), in the case of a pending timer2 - interrupt return always the timer2 value 0xFFFFFFFF -Service Pack 42 for Emu48 Version 1.0 +Service Pack 40 for Emu48 Version 1.0 + +APPLE.C +APPLE.H +- new module containing Saturnator BUSCC extentions and helper + functions prior located in opcodes.c +- changed BUSCC 2E (opcode 80BE2) implementation, return Carry = 1 + for big apple V2 when "Class 50" KML command is set +- added BUSCC 40 (opcode 80B04) implementation +- added BUSCC 42 (opcode 80B24) implementation EMU48.C - bugfix in function OnViewScript(), removed error message because @@ -1589,24 +1701,41 @@ EMU48.C - changed function OnViewScript(), added call of SetWindowPathTitle() to adjust length of window title - changed function WinMain(), simplified document loading at startup - and replaced full filename title with length cut filename + and replaced full filename title with length cutted filename + +EMU48.DSP +- added apple.c and apple.h sources EMU48.H +- added definition with valid calculator models +- added macro with model validation code - extern declaration of global functions EMU48.RC - changed version +EMU48DLL.C +- changed function DLLCreateWnd(), simplified document loading at + startup and replaced full filename title with length cutted + filename + +EMU48DLL.DSP +- added apple.c and apple.h sources + FETCH.C - changed function EvalOpcode(), included assertion for detecting access to packed memory data FILES.C - moved function WriteStack() inside file -- added new function GetCutPathName(), creating a length cut +- added new function GetCutPathName(), creating a length cutted filename - added new function SetWindowPathTitle(), replacement for calling - SetWindowTitle() for getting length cut filenames as title + SetWindowTitle() for getting length cutted filenames as title +- 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 - changed function OpenDocument(), SaveDocumentAs() and RestoreBackup(), replaced call of function SetWindowTitle() with SetWindowPathTitle() @@ -1621,19 +1750,15 @@ I28F160.C Nwrite() flash access bug and illegal data length information wasn't handled correctly -IO.H -- added DISP1CTL, LINENIBS, DISP2CTL and BAUD bit definitions - KML.C -- added keyword "Menubar" to pLexToken[] table -> scripts using this - keyword are parsed with a warning but not with a fatal error - changed function CreateKmlList(), 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 - -KML.H -- added TOK_MENUBAR definition +- bugfix in function InitButton(), nested scancode block commands + hadn't handled correctly +- changed function InitKML(), changed checking for valid Model + argument and changed the corresponding error message MOPS.C - bugfix in function UckBit(), when UART is off then the UCK bit @@ -1646,12 +1771,17 @@ MOPS.C and TBR (0x116,0x117) register can be overwritten by the serial thread +OPCODES.C +- moved function DecodeReg64(), o80BReg164(), o80BReg264(), + EncodeReg64() and o80BRegWrite() to apple.c +- changed function o80B(), moved Saturnator extentions to apple.c + SERIAL.C - bugfix in function CommOpen(), method of port closing was illegal because COM port dependent threads hadn't been stopped -Service Pack 41 for Emu48 Version 1.0 +Service Pack 39 for Emu48 Version 1.0 DDESERV.C - bugfix in function DdeCallback(), used wrong return in XTYP_POKE @@ -1659,7 +1789,7 @@ DDESERV.C DEBUGGER.C - changed function UpdateMemoryWnd(), added follow dispatcher -- new function OnMemFollow() to handle follow menu entries +- new fuction OnMemFollow() to handle follow menu entries - changed function OnDblClick() and OnKeyUpDown(), replaced all function calls of UpdateMemoryWnd() with ViewMemWnd() because of the modified behavior of UpdateMemoryWnd() @@ -1667,15 +1797,16 @@ DEBUGGER.C initialization in WM_INITDIALOG and menu commands handler in WM_COMMAND section -DISPLAY.C -- added Zoom 3 to all nLcdZoom range assertions -- changed function UpdateMainDisplay(), UpdateMenuDisplay(), - WriteToMainDisplay() and WriteToMenuDisplay(), added Zoom factor 3 - handling +EMU48.C +- 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.DSP +- added new build modes using Debug4x registry settings of Emu48.dll EMU48.H -- added definition with valid calculator models -- added macro with model validation code +- extern declaration of global variable EMU48.RC - changed IDD_KMLLOG, replaced "Always" text with "Show Script @@ -1687,16 +1818,15 @@ 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 +IO.H +- added DISP1CTL, LINENIBS, DISP2CTL and BAUD bit definitions + KML.C - changed table szLexDelim[], removed first element - added new table eIsGlobalBlock[] with valid block tokens @@ -1709,16 +1839,13 @@ KML.C tokens - changed function InitLcd(), added zoom factor 3 to range check of TOK_ZOOM -- 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[] +- added TOK_TOPBAR and TOK_VGA definition RESOURCE.H - added several definitions @@ -1728,8 +1855,12 @@ RPL.C - changed function RPL_CreateTemp(), added garbage collection on low memory condition +SETTINGS.C +- changed function ReadSettings() and WriteSettings(), added item + "SaveDefaultConfirm" in section [Files] in the INI-File -Service Pack 40 for Emu48 Version 1.0 + +Service Pack 38 for Emu48 Version 1.0 DISPLAY.C - bugfix in function UpdateContrast(), used background Color 0 in @@ -1740,81 +1871,10 @@ DISPLAY.C EMU48.C - added function IsPort2Writeable() to check if read only file attribute is not set on port2 file -- major changes in function SettingsProc(), 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 -- extern declaration of global variable and functions - -EMU48.RC -- added item "Port 2 is Writeable" in settings dialog -- changed version - -ENGINE.C -- bugfix in function WorkerThread(), when changing into SM_RUN state - display contrast must also be restored - -FILES.C -- changed function CrcPort2(), made it global accessible - -KML.C -- added keywords "Topbar" and "Vga" to pLexToken[] table -> scripts - using these keywords now are parsed with warnings and not quit - with a fatal error any more -- 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 handled 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 - -KML.H -- added TOK_TOPBAR and TOK_VGA definition - -RESOURCE.H -- 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 [Files] 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 function CheckT1() and CheckT2(), minor optimization in - checking if INT or WAKE bit is set - - -Service Pack 39 for Emu48 Version 1.0 - -DISPLAY.C -- bugfix in function CreateMainBitmap(), in error case hMainDC - variable wasn't cleared - -EMU48.C - changed function SettingsProc(), added sound handling - moved function OnStackCopy() and OnStackPaste() to STACK.C - changed function WinMain(), added accelerator key access for menus -EMU48.DSP -- added stack.c sources - EMU48.H - extern declaration of global variables and functions @@ -1825,6 +1885,26 @@ EMU48.RC - added accelerator resource - changed version +EMU48.DSP +- added stack.c sources + +EMU48DLL.C +- changed function DLLCreateWnd(), added accelerator table resource + loading +- added function EmuAcceleratorTable() for exporting the necessary + data to activate the emulator accelerator table in the main + message loop of the caller + +EMU48DLL.DSP +- added stack.c sources + +EMU48DLL.H +- extern declaration of global function + +ENGINE.C +- bugfix in function WorkerThread(), when changing into SM_RUN state + display constrast must also be restored + EXTERNAL.C - added function BeepWave(), beeper function using sound card - added function BeepWin9x(), PC speaker function for working on @@ -1833,25 +1913,108 @@ EXTERNAL.C call function BeepWin9x() on Win9x instead of Beep() or in the case of wave sound the function BeepWave() +FILES.C +- bugfix in function SaveObject(), calculator models HP48GII and + HP49G+ hasn't used the HP49G object header + KML.C -- bugfix in function InitKML(), changed log message for no "Model" - definition found and a missing "Bitmap" definition wasn't detected +- 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 + +OPCODES.C +- bugfix in function o80BdecodeReg64(), WP and XS case worked wrong +- replaced function o80BdecodeReg64() with DecodeReg64() +- changed function o80BReg164() and o80BReg264(), adjusted to + DecodeReg64() call +- deleted function o80BWriteHex() +- replaced complete buggy function o80BEncodeReg64() with + EncodeReg64() +- changed function o80BRegWrite(), adjusted to EncodeReg64() call +- bugfix in function o80B(), case 85 of BUSCC extensions used '/' + instead of '%' operator +- added simulation of off switch for 49g+ family + +OPS.H +- added function Npack64() and Nunpack64() for 64bit register + packing/unpacking PCH.H - added include conio.h RESOURCE.H -- added several definitions +- 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 - "WaveBeep" and "WaveVolume" in section [Emulator] in the INI-File + "WaveBeep" in section [Emulator] in the INI-File STACK.C -- new module with the message handler functions OnStackCopy() and +- new modul 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 + also copy real numbers and HP49G Precision Integer (limited to + 127/128 digits incl. sign) from and to the clipboard + +TIMER.C +- changed function CheckT1() and CheckT2(), minor optimization in + checking if INT or WAKE bit is set + + +Service Pack 37 for Emu48 Version 1.0 + +DISPLAY.C +- replaced the DIBPIXELGRAY and DIBPIXELBW use with DIBPIXEL macro + to avoid the "if (bGrayscale)" construct in the inner loop of + display drawing +- renamed the bmiLcdGray structure to bmiLcd +- removed the bmiLcdBW structure, use bmiLcd instead +- replaced UpdateContrast() implementation by a optimized one +- bugfix in function CreateMainBitmap(), in error case hMainDC + variable wasn't cleared +- changed function UpdateMainDisplay() and UpdateMenuDisplay(), + added display buffer ckecking in debug mode +- bugfix in function GetLineCounter() and StartDisplay(), VBL down + counter counted 62,...,0,63 instead of 63,...,0 + +EMU48.C +- changed function SettingsProc(), make "grayscale" mode online + switchable + +EMU48.H +- bugfix in definition MENUHEIGHT, calculated number of lines was + always 1 to much (with the exception of Chipset.lcounter==0); + this caused a buffer overflow in function UpdateMenuDisplay() + which prevented program execution on Win9x + +EMU48.RC +- changed menu text order from "Copy Stack/Copy Screen/Paste Stack" + to "Copy Screen/Copy Stack/Paste Stack" +- changed "Enable Virtual LCD Delay" in Settings dialog to the Emu48 + style without a group box + +EMU48DLL.C +- changed function EmuCalculatorType(), removed workaround for older + Debug4x versions + +FILES.C +- changed function PatchRom(), changed ASCII string handling from + BYTE to CHAR data type + +KML.C +- bugfix in function InitKML(), changed log message for no "Model" + definition found and a missing "Bitmap" definition wasn't detected + +OPS.H +- changed function Nsrb(), speed optimization TIMER.C - bugfix in function SetT1(), fixed unsynchronized access to timer1 @@ -1859,85 +2022,94 @@ TIMER.C timer2 is running -Service Pack 38 for Emu48 Version 1.0 +Service Pack 36 for Emu48 Version 1.0 -DISPLAY.C -- changed gray scale implementation from conditional compiling to - variable controlled -- bugfix in function GetLineCounterGray() and StartDisplayGray(), - VBL down counter counted 62,...,0,63 instead of 63,...,0 +- changed display management to use stretchBlit instead of doing it + by hand +- debugged usage of Apple header display to allow one to change the + header size to any size +- added runtime-configurable grayscale simulation support -EMU48.C -- changed function SettingsProc(), added IDC_GRAYSCALE button - handling -- changed function OnCreate() and OnDestroy(), changed gray scale - implementation from conditional compiling to variable controlled - -EMU48.H -- removed gray scale definitions -- changed some function prototypes to function pointers - -EMU48.RC -- added "Enable Virtual LCD Delay" checkbox in Settings dialog -- changed menu text order from "Copy Stack/Copy Screen/Paste Stack" - to "Copy Screen/Copy Stack/Paste Stack" -- changed version - -ENGINE.C -- changed function WorkerThread(), changed gray scale implementation - from conditional compiling to variable controlled - -FILES.C -- changed function PatchRom(), changed ASCII string handling from - BYTE to CHAR data type - -MOPS.C -- changed function Nwrite(), changed gray scale implementation from - conditional compiling to variable controlled - -OPS.H -- changed function Nsrb(), speed optimization - -RESOURCE.H -- added definition - -SETTINGS.C -- changed function ReadSettings() and WriteSettings(), added item - "Grayscale" in section [Emulator] in the INI-File - - -Service Pack 37 for Emu48 Version 1.0 +CHECKBOX.BMP +- fixed one pixel with wrong color DDESERV.C - changed function DdeCallback(), removed delays after ON key state change +DEBUGGER.C +- bugfix in function Debugger(), used function to set icon which + hasn't worked properly under WinXP + +DISPLAY.C +- changed function UpdateMenuDisplay(), minor code optimizations + EMU48.C +- changed function UpdateWindowStatus(), added macro specifiy menu + control +- changed function CopyItemsToClipboard(), simplified implementation + in UNICODE mode by saving the data in the CF_UNICODETEXT format - changed function SettingsProc(), added IDC_PORT2LOAD button handling - changed function OnStackPaste(), minor code optimization - changed function OnDropFiles(), OnStackPaste() and OnObjectLoad(), removed delays after ON key state change +- changed function OnLButtonDown(), OnLButtonUp(), OnMouseMove(), + OnKeyDown() and OnKeyUp(), disable function handling when in macro + play mode - bugfix in function WinMain(), szCurrentKml wasn't initialized +- changed function MainWndProc(), added some macro handler functions + +EMU48.DSP +- added keymacro.c sources EMU48.RC - added "..." button Settings dialog -- changed version +- changed "Always" checkbox in "KML Script Compilation Result" + dialog from a pushlike to normal one for better readability under + Windows XP style +- added "Macro Settings" dialog +- added Menuitem Tools "Macro..." +- changed version and copyright + +EMU48.H +- replaced T2CYCLES with the one from OPCODES.H + +EMU48DLL.DSP +- added keymacro.c sources 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 - bugfix in function UpdateKdnBit(), wrong DWORD truncation of Chipset.cycles variable +- changed function WorkerThread(), close running keyboard macros + when switching into invalid state FILES.C - changed function WriteStack(), minor optimization when saving as string +- changed function MapRom(), added detection for packed ROM images - 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 +- bugfix in function OpenDocument(), reload KML button state from + last document close - changed function LoadObject(), file access is now shared - changed function DibNumColors() and CreateBIPalette(), changed argument qualifier +KEYBOARD.C +- changed function KeyboardEvent(), added call to key recording + function KeyMacroRecord() +- bugfix in function KeyboardEvent(), prevent buffer overflow with + too big out codes on Chipset.Keyboard_Row array + +KEYMACRO.C +- new modul supporting keyboard macro functions + KML.C - changed variable qualifier of eIsBlock[] table and removed TOK_NONE item from it @@ -1962,85 +2134,6 @@ KML.C 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 - -RESOURCE.H -- added definition - -TIMER.C -- bugfix in function RescheduleT2(), better accuracy on conversation - of timer2 ticks into multimedia timer ms -- changed function StartTimers(), added calculation of maximum - timer2 ticks that can be handled by one timer event -- changed function StartTimers() and StopTimers(), changed - multimedia timer to best possible timer resolution instead of - risking to fail with 1 ms resolution preset - - -Service Pack 36 for Emu48 Version 1.0 - -CHECKBOX.BMP -- fixed one pixel with wrong color - -DEBUGGER.C -- bugfix in function Debugger(), used function to set icon which - hasn't worked properly under WinXP - -DISPLAY.C -- changed function UpdateMenuDisplay(), minor code optimizations -- changed function WriteToMenuDisplay(), code optimizations - -EMU48.C -- changed function UpdateWindowStatus(), added macro specific menu - control -- changed function CopyItemsToClipboard(), simplified implementation - in UNICODE mode by saving the data in the CF_UNICODETEXT format -- changed function OnLButtonDown(), OnLButtonUp(), OnMouseMove(), - OnKeyDown() and OnKeyUp(), disable function handling when in macro - play mode -- changed function MainWndProc(), added some macro handler functions - -EMU48.DSP -- added keymacro.c sources - -EMU48.H -- extern declaration of global variables and functions - -EMU48.RC -- changed "Always" checkbox in "KML Script Compilation Result" - dialog from a pushlike to normal one for better readability under - WinXP style -- added "Macro Settings" dialog -- added Menuitem Tools "Macro..." -- 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 -- changed function WorkerThread(), close running keyboard macros - when switching into invalid state - -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 -- changed function KeyboardEvent(), added call to key recording - function KeyMacroRecord() -- bugfix in function KeyboardEvent(), prevent buffer overflow with - too big out codes on Chipset.Keyboard_Row array - -KEYMACRO.C -- new module supporting keyboard macro functions - -KML.C - added function ReloadButtons(), update internal button state from chip keyboard matrix content - added function PlayKey(), handle button with OutIn code @@ -2059,6 +2152,11 @@ OPCODES.C - bugfix in function o802() and o803(), the r=IN opcodes work also on odd addresses in the IO register memory mapping area +OPS.H +- bugfix in function Nsub() and Nrsub(), in some situations wrong + results in dec mode with illegal decimal number entry as 2nd + operator + PCH.H - added VERIFY macro @@ -2069,6 +2167,15 @@ SETTINGS.C - changed function ReadSettings() and WriteSettings(), added section [Macro] in INI-File +TIMER.C +- bugfix in function RescheduleT2(), better accuracy on conversation + of timer2 ticks into multimedia timer ms +- changed function StartTimers(), added calculation of maximum + timer2 ticks that can be handled by one timer event +- changed function StartTimers() and StopTimers(), changed + multimedia timer to best possible timer resolution instead of + risking to fail with 1 ms resolution preset + Service Pack 35 for Emu48 Version 1.0 @@ -2161,11 +2268,17 @@ TIMER.C - changed function ReadT2(), minor optimization calculating the timer2 value +Service Pack 34+ for Emu48 Version 1.0 +- added new calcualtor type: P, 2 and Q for 39G+, 48Gii and 49G+. +- added 80 lines display and header support +- added extra speed for Apple series +- added BUSCC function support +- change the compile always visible by default Service Pack 34 for Emu48 Version 1.0 CURSOR.C -- new module to create a hand cursor +- new modul to create a hand cursor DEBUGGER.C - bugfix in function NewValue(), EnterAddr(), EnterBreakpoint(), @@ -2365,7 +2478,7 @@ KML.C - changed function InitGlobal(), added logfile output for the "Hardware" keyword - changed function InitKML(), enable object "Drag and Drop" - calculator model dependent here now + calculator model dependend here now KML.H - added TOK_HARDWARE definition @@ -3512,7 +3625,7 @@ FILES.C flash memory structure I28F160.C -- new module with I28F160 flash memory implementation +- new modul with I28F160 flash memory implementation I28F160.H - header file for flash memory implementation @@ -3769,7 +3882,7 @@ SERIAL.H - renamed to IO.H SETTINGS.C -- new module to handle the INI file +- new modul to handle the INI file TIMER.C - removed timer I/O definitions, replaced by include file IO.H @@ -3796,7 +3909,7 @@ DDESERV.C - added different files headers for HP48/49 DEBUGGER.C -- new module for debugger routines +- new modul for debugger routines DEBUGGER.H - header file for debugger part @@ -3912,10 +4025,10 @@ ENGINE.C - made function AdjKeySpeed() public - replaced opcode handling include files by a function call, decoder now works with tables instead of case switching -- deleted unused code parts in module +- deleted unused code parts in modul FETCH.C -- new module with opcode dispatcher +- new modul with opcode dispatcher FETCH.H - file deleted, replaced by FETCH.C @@ -3925,7 +4038,7 @@ FILES.C interpreter failed on lower case hex digits in arguments OPCODES.C -- new module with opcode implementation +- new modul with opcode implementation OPCODES.H - file content changed, replaced by OPCODES.C @@ -4303,7 +4416,7 @@ TIMER.C Service Pack 7 for Emu48 Version 1.0 DISASM.C -- new module with disassembler +- new modul with disassembler DISPLAY.C - bugfixes in function UpdateDisplayPointers(), next line offset was @@ -4427,7 +4540,7 @@ OPCODES.H - update field select table in "EXTENSION opcode o81B1" TIMER.C -- moved static lFreq variable to module EMU48.C +- moved static lFreq variable to modul EMU48.C Service Pack 5a for Emu48 Version 1.0 @@ -4467,7 +4580,7 @@ FILES.C MOPS.C - bugfix in MapP0(), data offset was wrong - bugfix in MapP1(), data offset was wrong -- bugfix in MapP2(), data offset was wrong and real size of module +- bugfix in MapP2(), data offset was wrong and real size of modul was zero - bugfix in MapBS(), wrong pointer in mirrored data page - bugfix in MapROM(), wrong pointer in mirrored data page @@ -4535,7 +4648,7 @@ TIMER.C Service Pack 3 for Emu48 Version 1.0 DDESERV.C -- new module for DDE communication +- new modul for DDE communication EMU48.C - init DDE callback function and name service @@ -4575,7 +4688,7 @@ RESOURCE.H - added IDC_WIRE and IDC_IR SERIAL.C -- new module for serial support +- new modul for serial support SERIAL.H - new header with serial definitions diff --git a/source/DDESERV.C b/source/DDESERV.C index b8d21f8..84c40ad 100644 --- a/source/DDESERV.C +++ b/source/DDESERV.C @@ -46,13 +46,6 @@ HDDEDATA CALLBACK DdeCallback(UINT iType,UINT iFmt,HCONV hConv, if (*psz != 0 || nStkLvl < 1) // invalid number format return (HDDEDATA) DDE_FNOTPROCESSED; - DdeAccessData(hData,&dwSize); // fetch data size - DdeUnaccessData(hData); - - // reserve memory - if ((lpData = (LPBYTE) malloc(dwSize * 2)) == NULL) - return (HDDEDATA) DDE_FNOTPROCESSED; - SuspendDebugger(); // suspend debugger bDbgAutoStateCtrl = FALSE; // disable automatic debugger state control @@ -66,7 +59,6 @@ HDDEDATA CALLBACK DdeCallback(UINT iType,UINT iFmt,HCONV hConv, if (WaitForSleepState()) // wait for cpu SHUTDN then sleep state { - free(lpData); // free memory hReturn = DDE_FNOTPROCESSED; goto cancel; } @@ -74,13 +66,32 @@ HDDEDATA CALLBACK DdeCallback(UINT iType,UINT iFmt,HCONV hConv, while (nState!=nNextState) Sleep(0); _ASSERT(nState==SM_SLEEP); - // fetch data and write to stack - DdeGetData(hData,(LPBYTE) &dwIndex,sizeof(DWORD),0L); - if (dwIndex <= dwSize - sizeof(DWORD)) - dwSize = dwIndex; - dwSize = DdeGetData(hData,lpData+dwSize,dwSize,sizeof(DWORD)); - bSuccess = (WriteStack(nStkLvl,lpData,dwSize) == S_ERR_NO); - free(lpData); // free memory + bSuccess = FALSE; + + // get data and size + lpData = DdeAccessData(hData,&dwSize); + + // has object length header + if (lpData && dwSize >= sizeof(DWORD)) + { + dwIndex = *(LPDWORD) lpData; // object length + + if (dwIndex <= dwSize - sizeof(DWORD)) + { + // reserve unpacked object length memory + LPBYTE pbyMem = (LPBYTE) malloc(dwIndex * 2); + + if (pbyMem != NULL) + { + // copy data and write to stack + CopyMemory(pbyMem+dwIndex,lpData+sizeof(DWORD),dwIndex); + bSuccess = (WriteStack(nStkLvl,pbyMem,dwIndex) == S_ERR_NO); + free(pbyMem); // free memory + } + } + } + + DdeUnaccessData(hData); SwitchToState(SM_RUN); // run state while (nState!=nNextState) Sleep(0); @@ -96,7 +107,7 @@ HDDEDATA CALLBACK DdeCallback(UINT iType,UINT iFmt,HCONV hConv, Sleep(dwWakeupDelay); KeyboardEvent(FALSE,0,0x8000); // wait for sleep mode - while(Chipset.Shutdn == FALSE) Sleep(0); + while (Chipset.Shutdn == FALSE) Sleep(0); hReturn = (HDDEDATA) DDE_FACK; cancel: diff --git a/source/DEBUGDLL.C b/source/DEBUGDLL.C index b9955f5..2f7c8a4 100644 --- a/source/DEBUGDLL.C +++ b/source/DEBUGDLL.C @@ -237,7 +237,14 @@ DECLSPEC BOOL CALLBACK EmuInitLastInstr( DWORD *pdwArray) // @parm pointer to linear array { if (pdwInstrArray) // circular buffer defined - free(pdwInstrArray); // free memory + { + EnterCriticalSection(&csDbgLock); + { + free(pdwInstrArray); // free memory + pdwInstrArray = NULL; + } + LeaveCriticalSection(&csDbgLock); + } if (wNoInstr) // new size { diff --git a/source/DEBUGGER.C b/source/DEBUGGER.C index ba3e6ac..bb50e5f 100644 --- a/source/DEBUGGER.C +++ b/source/DEBUGGER.C @@ -156,50 +156,6 @@ static VOID DisableMenuKeys(HWND hDlg) return; } -// -// read edit control and decode content as hex number or if enabled as symbol name -// -static BOOL GetAddr(HWND hDlg,INT nID,DWORD *pdwAddr,DWORD dwMaxAddr,BOOL bSymbEnable) -{ - TCHAR szBuffer[48]; - INT i; - BOOL bSucc = TRUE; - - HWND hWnd = GetDlgItem(hDlg,nID); - - GetWindowText(hWnd,szBuffer,ARRAYSIZEOF(szBuffer)); - - if (*szBuffer != 0) - { - // if address is not a symbol name decode number - if ( !bSymbEnable || szBuffer[0] != _T('=') - || RplGetAddr(&szBuffer[1],pdwAddr)) - { - // test if valid hex address - for (i = 0; bSucc && i < (LONG) lstrlen(szBuffer); ++i) - { - bSucc = (_istxdigit(szBuffer[i]) != 0); - } - - if (bSucc) // valid characters - { - // convert string to number - *pdwAddr = _tcstoul(szBuffer,NULL,16); - } - } - - // inside address range? - bSucc = bSucc && (*pdwAddr <= dwMaxAddr); - - if (!bSucc) // invalid address - { - SendMessage(hWnd,EM_SETSEL,0,-1); - SetFocus(hWnd); // focus to edit control - } - } - return bSucc; -} - // // set mapping menu // @@ -256,6 +212,50 @@ static VOID SetMappingMenu(HWND hDlg,UINT uID) return; }; +// +// read edit control and decode content as hex number or if enabled as symbol name +// +static BOOL GetAddr(HWND hDlg,INT nID,DWORD *pdwAddr,DWORD dwMaxAddr,BOOL bSymbEnable) +{ + TCHAR szBuffer[48]; + INT i; + BOOL bSucc = TRUE; + + HWND hWnd = GetDlgItem(hDlg,nID); + + GetWindowText(hWnd,szBuffer,ARRAYSIZEOF(szBuffer)); + + if (*szBuffer != 0) + { + // if address is not a symbol name decode number + if ( !bSymbEnable || szBuffer[0] != _T('=') + || RplGetAddr(&szBuffer[1],pdwAddr)) + { + // test if valid hex address + for (i = 0; bSucc && i < (LONG) lstrlen(szBuffer); ++i) + { + bSucc = (_istxdigit(szBuffer[i]) != 0); + } + + if (bSucc) // valid characters + { + // convert string to number + *pdwAddr = _tcstoul(szBuffer,NULL,16); + } + } + + // inside address range? + bSucc = bSucc && (*pdwAddr <= dwMaxAddr); + + if (!bSucc) // invalid address + { + SendMessage(hWnd,EM_SETSEL,0,-1); + SetFocus(hWnd); // focus to edit control + } + } + return bSucc; +} + // // get address of cursor in memory window // @@ -713,7 +713,7 @@ static VOID UpdateMemoryWnd(HWND hDlg) // static VOID UpdateStackWnd(HWND hDlg) { - INT i; + UINT i; LONG nPos; TCHAR szBuffer[64]; @@ -1143,7 +1143,7 @@ static BOOL OnClearAll(HWND hDlg) // static BOOL OnToggleMenuItem(HWND hDlg,UINT uIDCheckItem,BOOL *bCheck) { - *bCheck = !*bCheck; // toggle flag + *bCheck = !*bCheck; // toggle flag CheckMenuItem(GetMenu(hDlg),uIDCheckItem,*bCheck ? MF_CHECKED : MF_UNCHECKED); return 0; } @@ -1168,15 +1168,15 @@ static BOOL OnStackPush(HWND hDlg) TCHAR szBuffer[] = _T("00000"); DWORD dwAddr; HWND hWnd; - INT i,j; + UINT i,j; if (nDbgState != DBG_STEPINTO) // not in single step mode return TRUE; hWnd = GetDlgItem(hDlg,IDC_DEBUG_STACK); - i = (INT) SendMessage(hWnd,LB_GETCURSEL,0,0); - if (LB_ERR == i) return TRUE; // no selection + i = (UINT) SendMessage(hWnd,LB_GETCURSEL,0,0); + if (LB_ERR == (INT) i) return TRUE; // no selection if (IDOK != OnNewValue(szBuffer)) // canceled function return TRUE; @@ -1200,15 +1200,15 @@ static BOOL OnStackPush(HWND hDlg) static BOOL OnStackPop(HWND hDlg) { HWND hWnd; - INT i,j; + UINT i,j; if (nDbgState != DBG_STEPINTO) // not in single step mode return TRUE; hWnd = GetDlgItem(hDlg,IDC_DEBUG_STACK); - i = (INT) SendMessage(hWnd,LB_GETCURSEL,0,0); - if (LB_ERR == i) return TRUE; // no selection + i = (UINT) SendMessage(hWnd,LB_GETCURSEL,0,0); + if (LB_ERR == (INT) i) return TRUE; // no selection // pop stack element for (j = i + 1; j < ARRAYSIZEOF(Chipset.rstk); ++j) @@ -1263,7 +1263,7 @@ static BOOL OnLButtonUp(HWND hDlg, LPARAM lParam) // handle of selected window hWnd = ChildWindowFromPointEx(hDlg,pt,CWP_SKIPDISABLED); - nId = GetDlgCtrlID(hWnd); // control ID of window + nId = GetDlgCtrlID(hWnd); // control ID of window GetWindowText(hWnd,szBuffer,ARRAYSIZEOF(szBuffer)); switch (nId) @@ -1324,11 +1324,11 @@ static BOOL OnLButtonUp(HWND hDlg, LPARAM lParam) break; case IDC_REG_OUT: // OUT OnNewValue(&szBuffer[4]); - _stscanf(&szBuffer[4],_T("%3X"),&Chipset.out); + Chipset.out = (WORD) _tcstoul(&szBuffer[4],NULL,16); break; case IDC_REG_IN: // IN OnNewValue(&szBuffer[3]); - _stscanf(&szBuffer[3],_T("%4X"),&Chipset.in); + Chipset.in = (WORD) _tcstoul(&szBuffer[3],NULL,16); break; case IDC_REG_ST: // ST OnNewValue(&szBuffer[3]); @@ -1362,7 +1362,7 @@ static BOOL OnLButtonUp(HWND hDlg, LPARAM lParam) break; case IDC_MISC_BS: // Bank switcher setting OnNewValue(szBuffer); - _stscanf(szBuffer,_T("%2X"),&Chipset.Bank_FF); + Chipset.Bank_FF = _tcstoul(szBuffer,NULL,16); Chipset.Bank_FF &= 0x7F; RomSwitch(Chipset.Bank_FF); // update memory mapping @@ -1423,6 +1423,7 @@ static BOOL OnDblClick(HWND hWnd, WORD wId) ViewMemWnd(hDlg,dwAdrMem); // update memory window SendMessage(hWnd,LB_SETCURSEL,i,0); return FALSE; + return FALSE; } // @@ -1444,7 +1445,7 @@ static VOID OnContextMenu(HWND hDlg, LPARAM lParam, WPARAM wParam) pt.y = rc.top + 5; } - nId = GetDlgCtrlID((HWND) wParam); // control ID of window + nId = GetDlgCtrlID((HWND) wParam); // control ID of window switch(nId) { @@ -1499,7 +1500,7 @@ static __inline BOOL OnKeyRightLeft(HWND hWnd, WPARAM wParam) WORD wX; INT nId; - nId = GetDlgCtrlID(hWnd); // control ID of window + nId = GetDlgCtrlID(hWnd); // control ID of window for (wX = 0; wX < MEMWNDMAX; ++wX) // scan all Id's if (nCol[wX] == nId) // found ID @@ -1522,10 +1523,10 @@ static __inline BOOL OnKeyRightLeft(HWND hWnd, WPARAM wParam) // static __inline BOOL OnKeyUpDown(HWND hWnd, WPARAM wParam) { - INT wX, wY; - INT nId; + INT wX, wY; + INT nId; - nId = GetDlgCtrlID(hWnd); // control ID of window + nId = GetDlgCtrlID(hWnd); // control ID of window for (wX = 0; wX < MEMWNDMAX; ++wX) // scan all Id's if (nCol[wX] == nId) // found ID @@ -1577,10 +1578,10 @@ static __inline BOOL OnKeyUpDown(HWND hWnd, WPARAM wParam) // static __inline BOOL OnKeyPlusMinus(HWND hWnd, WPARAM wParam) { - INT wX, wY; - INT nId; + INT wX, wY; + INT nId; - nId = GetDlgCtrlID(hWnd); // control ID of window + nId = GetDlgCtrlID(hWnd); // control ID of window for (wX = 0; wX < MEMWNDMAX; ++wX) // scan all Id's if (nCol[wX] == nId) // found ID @@ -1873,6 +1874,7 @@ static INT_PTR CALLBACK Debugger(HWND hDlg, UINT message, WPARAM wParam, LPARAM // add Settings item to sysmenu _ASSERT((IDM_DEBUG_SETTINGS & 0xFFF0) == IDM_DEBUG_SETTINGS); _ASSERT(IDM_DEBUG_SETTINGS < 0xF000); + if ((hSysMenu = GetSystemMenu(hDlg,FALSE)) != NULL) { VERIFY(AppendMenu(hSysMenu,MF_SEPARATOR,0,NULL)); @@ -2059,10 +2061,10 @@ static INT_PTR CALLBACK Debugger(HWND hDlg, UINT message, WPARAM wParam, LPARAM { case VK_F2: return OnKeyF2(hDlg); // toggle breakpoint case VK_F5: return OnKeyF5(hDlg); // key run - case VK_F6: return OnKeyF6(hDlg); // key step cursor + case VK_F6: return OnKeyF6(hDlg); // key step cursor case VK_F7: return OnKeyF7(hDlg); // key step into case VK_F8: return OnKeyF8(hDlg); // key step over - case VK_F9: return OnKeyF9(hDlg); // key step out + case VK_F9: return OnKeyF9(hDlg); // key step out case VK_F11: return OnKeyF11(hDlg); // key break } @@ -2120,7 +2122,7 @@ static INT_PTR CALLBACK Debugger(HWND hDlg, UINT message, WPARAM wParam, LPARAM case WM_NOTIFY: // tooltip for toolbar - if (((LPNMHDR) lParam)->code == TTN_GETDISPINFO) + if(((LPNMHDR) lParam)->code == TTN_GETDISPINFO) { ((LPTOOLTIPTEXT) lParam)->hinst = hApp; ((LPTOOLTIPTEXT) lParam)->lpszText = MAKEINTRESOURCE(((LPTOOLTIPTEXT) lParam)->hdr.idFrom); @@ -2357,7 +2359,7 @@ static VOID UpdateProfileWnd(HWND hDlg) QWORD lVar; TCHAR szBuffer[64]; - INT i; + UINT i; DWORD dwFreq, dwEndFreq; if (hDlg == NULL) return; // dialog not open @@ -2379,10 +2381,9 @@ static VOID UpdateProfileWnd(HWND hDlg) } dwEndFreq = ((999 * 2 - 1) * dwFreq) / (2 * 1000); - // search for unit - for (i = 0; i < ARRAYSIZEOF(pcUnit) - 1; ++i) + // search for ENG unit + for (i = 0; i < ARRAYSIZEOF(pcUnit) - 1 && lVar <= dwEndFreq; ++i) { - if (lVar > dwEndFreq) break; // found ENG unit lVar *= 1000; // next ENG unit } @@ -2858,7 +2859,7 @@ static VOID OnEnterAddress(HWND hDlg, DWORD *dwValue) static INT_PTR CALLBACK EnterBreakpoint(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { static BP_T *sBp; - + DWORD dwAddr; switch (message) @@ -2982,8 +2983,8 @@ static BOOL ToggleBreakpointItem(HWND hWnd, INT nItem) // static VOID DrawBreakpoint(HWND hWnd, INT i) { - TCHAR *szText,szBuffer[32]; - INT nItem; + TCHAR *szText,szBuffer[32]; + LPARAM nItem; switch(sBreakpoint[i].nType) { @@ -3019,11 +3020,11 @@ static INT_PTR CALLBACK EditBreakpoint(HWND hDlg, UINT message, WPARAM wParam, L { TEXTMETRIC tm; - HWND hWnd; - HDC hDC; - HFONT hFont; - BP_T sBp; - INT i,nItem; + HWND hWnd; + HDC hDC; + HFONT hFont; + BP_T sBp; + INT i,nItem; switch (message) { @@ -3149,7 +3150,7 @@ static INT_PTR CALLBACK EditBreakpoint(HWND hDlg, UINT message, WPARAM wParam, L } case WM_VKEYTOITEM: - if (LOWORD(wParam) == VK_SPACE) + if(LOWORD(wParam) == VK_SPACE) { hWnd = GetDlgItem(hDlg,IDC_BREAKEDIT_WND); for (nItem = 0; nItem < wBreakpointCount; ++nItem) @@ -3277,7 +3278,7 @@ static BOOL OnInfoIntr(HWND hDlg) // // view write only I/O registers // -static BOOL CALLBACK InfoWoRegister(HWND hDlg, UINT message, DWORD wParam, LONG lParam) +static INT_PTR CALLBACK InfoWoRegister(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { TCHAR szBuffer[8]; diff --git a/source/DISMEM.C b/source/DISMEM.C index 73f7692..dc793f8 100644 --- a/source/DISMEM.C +++ b/source/DISMEM.C @@ -39,7 +39,7 @@ static CONST MODEL_MAP_T MemMap[] = { '6', // HP38G (64K) &pbyRom, &dwRomSize, // ROM - &Port0, &Chipset.Port0Size, // RAM + &Port0, &Chipset.Port0Size, // RAM &pbyNoMEM, NULL, // nc. &pbyNoMEM, NULL, // nc. &pbyNoMEM, NULL // nc. @@ -47,7 +47,7 @@ static CONST MODEL_MAP_T MemMap[] = { 'A', // HP38G &pbyRom, &dwRomSize, // ROM - &Port0, &Chipset.Port0Size, // RAM + &Port0, &Chipset.Port0Size, // RAM &pbyNoMEM, NULL, // nc. &pbyNoMEM, NULL, // nc. &pbyNoMEM, NULL // nc. @@ -58,21 +58,21 @@ static CONST MODEL_MAP_T MemMap[] = &Port0, &Chipset.Port0Size, // RAM part 1 &pbyNoMEM, NULL, // BS &pbyNoMEM, NULL, // nc. - &Port2, &Chipset.Port2Size // RAM part 2 + &Port2, &Chipset.Port2Size // RAM part 2 }, { 'G', // HP48GX &pbyRom, &dwRomSize, // ROM &Port0, &Chipset.Port0Size, // RAM &pbyNoMEM, NULL, // BS - &Port1, &Chipset.Port1Size, // Card slot 1 + &Port1, &Chipset.Port1Size, // Card slot 1 &pbyPort2, &dwPort2Size // Card slot 2 }, { 'S', // HP48SX &pbyRom, &dwRomSize, // ROM &Port0, &Chipset.Port0Size, // RAM - &Port1, &Chipset.Port1Size, // Card slot 1 + &Port1, &Chipset.Port1Size, // Card slot 1 &pbyPort2, &dwPort2Size, // Card slot 2 &pbyNoMEM, NULL // nc. }, diff --git a/source/DISPLAY.C b/source/DISPLAY.C index c877e74..d8fe4cc 100644 --- a/source/DISPLAY.C +++ b/source/DISPLAY.C @@ -15,9 +15,8 @@ // #define DEBUG_DISPLAY // switch for DISPLAY debug purpose -#define NOCOLORSGRAY 8 // no. of colors in gray scale mode -#define NOCOLORSBW 2 // no. of colors in black and white mode - +#define NOCOLORSGRAY 8 +#define NOCOLORSBW 2 #define B 0x00000000 // black #define W 0x00FFFFFF // white @@ -43,7 +42,7 @@ UINT nLcdZoom = 1; HDC hLcdDC = NULL; HDC hMainDC = NULL; -static LPBYTE pbyLcd; +static LPBYTE pbyLcd; static HBITMAP hLcdBitmap; static HBITMAP hMainBitmap; @@ -64,7 +63,7 @@ static DWORD dwKMLColor[64] = // color table loaded by KML script static struct { BITMAPINFOHEADER Lcd_bmih; - RGBQUAD bmiColors[NOCOLORSGRAY]; + RGBQUAD bmiColors[NOCOLORSGRAY]; } bmiLcd = { {0x28,0/*x*/,0/*y*/,1,8,BI_RGB,0,0,0,NOCOLORSGRAY,0} @@ -152,8 +151,8 @@ VOID DestroyLcdBitmap(VOID) { // set contrast palette to startup colors WORD i = 0; dwKMLColor[i++] = W; - while (i < 32) dwKMLColor[i++] = B; - while (i < 64) dwKMLColor[i++] = I; + while(i < 32) dwKMLColor[i++] = B; + while(i < 64) dwKMLColor[i++] = I; if (hLcdDC != NULL) { @@ -290,8 +289,8 @@ VOID UpdateMainDisplay(VOID) VOID UpdateMenuDisplay(VOID) { - UINT x, y; - BYTE *p; + UINT x, y; + BYTE *p; DWORD d = Chipset.start2; #if defined DEBUG_DISPLAY @@ -541,7 +540,7 @@ VOID ResizeWindow(VOID) AdjustWindowRect(&rectWindow, (DWORD) GetWindowLongPtr(hWnd,GWL_STYLE), - GetMenu(hWnd) != NULL); + GetMenu(hWnd) != NULL || IsRectEmpty(&rectWindow)); SetWindowPos(hWnd, bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, rectWindow.right - rectWindow.left, rectWindow.bottom - rectWindow.top, diff --git a/source/EMU48.C b/source/EMU48.C index 84acdb2..fb7159c 100644 --- a/source/EMU48.C +++ b/source/EMU48.C @@ -13,7 +13,7 @@ #include "kml.h" #include "debugger.h" -#define VERSION "1.55+" +#define VERSION "1.56+" #ifdef _DEBUG LPCTSTR szNoTitle = _T("Emu48 ")_T(VERSION)_T(" Debug"); @@ -35,9 +35,9 @@ static const LPCTSTR szLicence = _T("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r\n") _T("See the GNU General Public License for more details.\r\n") _T("\r\n") - _T("You should have received a copy of the GNU General Public License\r\n") - _T("along with this program; if not, write to the Free Software Foundation,\r\n") - _T("Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"); + _T("You should have received a copy of the GNU General Public License along\r\n") + _T("with this program; if not, write to the Free Software Foundation, Inc.,\r\n") + _T("51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."); static BOOL bOwnCursor = FALSE; static BOOL bTitleBar = TRUE; @@ -394,7 +394,7 @@ static VOID SetCommList(HWND hDlg,LPCTSTR szWireSetting,LPCTSTR szIrSetting) // test if COM port is valid hComm = CreateFile(szBuffer,GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); - if (hComm != INVALID_HANDLE_VALUE) + if(hComm != INVALID_HANDLE_VALUE) { VERIFY(CloseHandle(hComm)); bAddWire = bAddIr = TRUE; @@ -423,7 +423,7 @@ static VOID SetCommList(HWND hDlg,LPCTSTR szWireSetting,LPCTSTR szIrSetting) return; } -static BOOL CALLBACK SettingsGeneralProc(HWND hDlg, UINT uMsg, DWORD wParam, LONG lParam) +static INT_PTR CALLBACK SettingsGeneralProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { HWND hWndInsertAfter; @@ -496,7 +496,7 @@ static BOOL CALLBACK SettingsGeneralProc(HWND hDlg, UINT uMsg, DWORD wParam, LON UNREFERENCED_PARAMETER(wParam); } -static BOOL CALLBACK SettingsMemoryProc(HWND hDlg, UINT uMsg, DWORD wParam, LONG lParam) +static INT_PTR CALLBACK SettingsMemoryProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { LPCTSTR szActPort2Filename = _T(""); @@ -594,9 +594,9 @@ static BOOL CALLBACK SettingsMemoryProc(HWND hDlg, UINT uMsg, DWORD wParam, LONG && (Chipset.IORam[CARDCTL] & ECDT) != 0 && (Chipset.IORam[TIMER2_CTRL] & RUN) != 0 ) { - Chipset.HST |= MP; // set Module Pulled - IOBit(SRQ2,NINT,FALSE); // set NINT to low - Chipset.SoftInt = TRUE; // set interrupt + Chipset.HST |= MP; // set Module Pulled + IOBit(SRQ2,NINT,FALSE); // set NINT to low + Chipset.SoftInt = TRUE; // set interrupt bInterrupt = TRUE; } SwitchToState(nOldState); @@ -686,7 +686,7 @@ static BOOL CALLBACK SettingsMemoryProc(HWND hDlg, UINT uMsg, DWORD wParam, LONG return FALSE; } -static BOOL CALLBACK SettingsPeripheralProc(HWND hDlg, UINT uMsg, DWORD wParam, LONG lParam) +static INT_PTR CALLBACK SettingsPeripheralProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { TCHAR cPort[8]; LONG i; @@ -893,6 +893,8 @@ static LRESULT OnPaint(HWND hWindow) PAINTSTRUCT Paint; HDC hPaintDC; + UpdateWindowBars(); // update visibility of title and menu bar + hPaintDC = BeginPaint(hWindow, &Paint); if (hMainDC != NULL) { @@ -967,7 +969,7 @@ static LRESULT OnInitMenu(HMENU hMenu) EnableMenuItem(hMenu,ID_TOOL_MACRO_RECORD,(bRun && nMacroState == MACRO_OFF) ? MF_ENABLED : MF_GRAYED); EnableMenuItem(hMenu,ID_TOOL_MACRO_PLAY,(bRun && nMacroState == MACRO_OFF) ? MF_ENABLED : MF_GRAYED); EnableMenuItem(hMenu,ID_TOOL_MACRO_STOP,(bRun && nMacroState != MACRO_OFF) ? MF_ENABLED : MF_GRAYED); - + MruUpdateMenu(hMenu); // update MRU list return 0; } @@ -979,7 +981,7 @@ static LRESULT OnDropFiles(HDROP hFilesInfo) { TCHAR szFileName[MAX_PATH]; WORD wNumFiles,wIndex; - BOOL bSuccess = FALSE; + BOOL bSuccess; // get number of files dropped wNumFiles = DragQueryFile (hFilesInfo,(UINT)-1,NULL,0); @@ -1028,7 +1030,7 @@ static LRESULT OnDropFiles(HDROP hFilesInfo) Sleep(dwWakeupDelay); KeyboardEvent(FALSE,0,0x8000); // wait for sleep mode - while (Chipset.Shutdn == FALSE) Sleep(0); + while(Chipset.Shutdn == FALSE) Sleep(0); cancel: bDbgAutoStateCtrl = TRUE; // enable automatic debugger state control @@ -1327,7 +1329,7 @@ static LRESULT OnViewSettings(VOID) psp[0].pszTemplate = MAKEINTRESOURCE(IDD_SET_GENERAL); psp[0].hIcon = NULL; psp[0].pszTitle = NULL; - psp[0].pfnDlgProc = (DLGPROC) SettingsGeneralProc; + psp[0].pfnDlgProc = SettingsGeneralProc; psp[0].lParam = 0; psp[0].pfnCallback = NULL; @@ -1337,7 +1339,7 @@ static LRESULT OnViewSettings(VOID) psp[1].pszTemplate = MAKEINTRESOURCE(IDD_SET_MEMORY); psp[1].hIcon = NULL; psp[1].pszTitle = NULL; - psp[1].pfnDlgProc = (DLGPROC) SettingsMemoryProc; + psp[1].pfnDlgProc = SettingsMemoryProc; psp[1].lParam = 0; psp[1].pfnCallback = NULL; @@ -1347,7 +1349,7 @@ static LRESULT OnViewSettings(VOID) psp[2].pszTemplate = MAKEINTRESOURCE(IDD_SET_PERIPHERAL); psp[2].hIcon = NULL; psp[2].pszTitle = NULL; - psp[2].pfnDlgProc = (DLGPROC) SettingsPeripheralProc; + psp[2].pfnDlgProc = SettingsPeripheralProc; psp[2].lParam = 0; psp[2].pfnCallback = NULL; @@ -1489,7 +1491,7 @@ static LRESULT OnObjectLoad(VOID) KeyboardEvent(FALSE,0,0x8000); // wait for sleep mode - while (Chipset.Shutdn == FALSE) Sleep(0); + while(Chipset.Shutdn == FALSE) Sleep(0); } if (nState != SM_RUN) @@ -1544,7 +1546,7 @@ static LRESULT OnObjectLoad(VOID) KeyboardEvent(TRUE,0,0x8000); Sleep(dwWakeupDelay); KeyboardEvent(FALSE,0,0x8000); - while (Chipset.Shutdn == FALSE) Sleep(0); + while(Chipset.Shutdn == FALSE) Sleep(0); cancel: bDbgAutoStateCtrl = TRUE; // enable automatic debugger state control @@ -1735,7 +1737,7 @@ static LRESULT OnToolDisasm(VOID) // disasm dialogbox call { if (pbyRom) SwitchToState(SM_SLEEP); if (DialogBox(hApp, MAKEINTRESOURCE(IDD_DISASM), hWnd, (DLGPROC)Disasm) == -1) - AbortMessage(_T("Disassembler Dialog Box Creation Error!")); + AbortMessage(_T("Disassembler Dialog Box Creation Error !")); if (pbyRom) SwitchToState(SM_RUN); return 0; } @@ -1743,7 +1745,7 @@ static LRESULT OnToolDisasm(VOID) // disasm dialogbox call static LRESULT OnAbout(VOID) { if (DialogBox(hApp, MAKEINTRESOURCE(IDD_ABOUT), hWnd, (DLGPROC)About) == -1) - AbortMessage(_T("About Dialog Box Creation Error!")); + AbortMessage(_T("About Dialog Box Creation Error !")); return 0; } @@ -2002,8 +2004,8 @@ LRESULT CALLBACK MainWndProc(HWND hWindow, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_LBUTTONUP: return OnLButtonUp((UINT) wParam, LOWORD(lParam), HIWORD(lParam)); case WM_MOUSEMOVE: return OnMouseMove((UINT) wParam, LOWORD(lParam), HIWORD(lParam)); case WM_NCMOUSEMOVE: return OnNcMouseMove((UINT) wParam, LOWORD(lParam), HIWORD(lParam)); - case WM_KEYUP: return OnKeyUp((int) wParam, lParam); - case WM_KEYDOWN: return OnKeyDown((int) wParam, lParam); + case WM_KEYUP: return OnKeyUp((int)wParam, lParam); + case WM_KEYDOWN: return OnKeyDown((int)wParam, lParam); #if !defined _USRDLL // not in DLL version case WM_COPYDATA: return OnCopyData((PCOPYDATASTRUCT) lParam); #endif @@ -2123,10 +2125,10 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC rectWindow.top = 0; rectWindow.right = 256; rectWindow.bottom = 0; - AdjustWindowRect(&rectWindow, STYLE_TITLE, TRUE); + AdjustWindowRect(&rectWindow, WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_OVERLAPPED, TRUE); hWnd = CreateWindow(MAKEINTATOM(classAtom),_T("Emu48"), - STYLE_TITLE, + WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_OVERLAPPED, CW_USEDEFAULT, CW_USEDEFAULT, rectWindow.right - rectWindow.left, rectWindow.bottom - rectWindow.top, @@ -2240,11 +2242,11 @@ start: while (GetMessage(&msg, NULL, 0, 0)) { - if ( !TranslateAccelerator(hWnd, hAccel, &msg) - && (hDlgDebug == NULL || !IsDialogMessage(hDlgDebug, &msg)) - && (hDlgFind == NULL || !IsDialogMessage(hDlgFind, &msg)) - && (hDlgProfile == NULL || !IsDialogMessage(hDlgProfile, &msg)) - && (hDlgRplObjView == NULL || !IsDialogMessage(hDlgRplObjView, &msg))) + if( !TranslateAccelerator(hWnd, hAccel, &msg) + && (hDlgDebug == NULL || !IsDialogMessage(hDlgDebug, &msg)) + && (hDlgFind == NULL || !IsDialogMessage(hDlgFind, &msg)) + && (hDlgProfile == NULL || !IsDialogMessage(hDlgProfile, &msg)) + && (hDlgRplObjView == NULL || !IsDialogMessage(hDlgRplObjView, &msg))) { TranslateMessage(&msg); DispatchMessage(&msg); diff --git a/source/EMU48.H b/source/EMU48.H index 851a24a..d8d9d17 100644 --- a/source/EMU48.H +++ b/source/EMU48.H @@ -20,8 +20,8 @@ #define PORT2_PRESENT ((cCurrentRomType=='S')?P2C:P1C) #define PORT2_WRITE ((cCurrentRomType=='S')?P2W:P1W) -#define BINARYHEADER48 "HPHP48-W" -#define BINARYHEADER49 "HPHP49-W" +#define BINARYHEADER48 "HPHP48-W" +#define BINARYHEADER49 "HPHP49-W" #define BIN_FILTER "Port Data File (*.BIN)\0*.BIN\0All Files (*.*)\0*.*\0" #define HP_FILTER "HP Binary Object (*.HP;*.LIB)\0*.HP;*.LIB\0All Files (*.*)\0*.*\0" @@ -36,14 +36,14 @@ #define SM_RETURN 2 #define SM_SLEEP 3 -#define S_ERR_NO 0 // stack errorcodes +#define S_ERR_NO 0 // stack errorcodes #define S_ERR_OBJECT 1 -#define S_ERR_BINARY 2 -#define S_ERR_ASCII 3 +#define S_ERR_BINARY 2 +#define S_ERR_ASCII 3 #define BAD_OB (0xFFFFFFFF) // bad object -#define NO_SERIAL "disabled" // port not open +#define NO_SERIAL "disabled" // port not open #define HP_MNEMONICS FALSE // disassembler mnenomics mode #define CLASS_MNEMONICS TRUE @@ -322,8 +322,8 @@ extern VOID WriteIO(BYTE *a, DWORD b, DWORD s); // Keyboard.c extern DWORD dwKeyMinDelay; -extern VOID ScanKeyboard(BOOL bActive, BOOL bReset); -extern VOID KeyboardEvent(BOOL bPress, UINT out, UINT in); +extern VOID ScanKeyboard(BOOL bActive, BOOL bReset); +extern VOID KeyboardEvent(BOOL bPress, UINT out, UINT in); // Keymacro.c extern INT nMacroState; @@ -336,10 +336,10 @@ extern LRESULT OnToolMacroPlay(VOID); extern LRESULT OnToolMacroStop(VOID); extern LRESULT OnToolMacroSettings(VOID); -// Redeye.c +// Redeye.c extern VOID IrPrinter(BYTE c); -// Udp.c +// Udp.c extern TCHAR szUdpServer[1024]; extern WORD wUdpPort; extern VOID ResetUdp(VOID); diff --git a/source/EMU48.RC b/source/EMU48.RC index f2fb2e5..6bafc8d 100644 --- a/source/EMU48.RC +++ b/source/EMU48.RC @@ -242,7 +242,7 @@ BEGIN LTEXT "Find &what:",IDC_STATIC,7,9,34,8 COMBOBOX IDC_FIND_DATA,46,7,88,41,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - CONTROL "Find &ASCII",IDC_FIND_ASCII,"Button",BS_AUTOCHECKBOX | + CONTROL "Find &ASCII",IDC_FIND_ASCII,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,9,49,10 PUSHBUTTON "&Previous",IDC_FIND_PREV,6,26,50,14 DEFPUSHBUTTON "&Next",IDC_FIND_NEXT,74,26,50,14 @@ -365,9 +365,9 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Volume",IDC_STATIC,14,21,24,8 CONTROL "Slider1",IDC_SOUND_SLIDER,"msctls_trackbar32", - TBS_AUTOTICKS | WS_TABSTOP,44,16,118,18 + TBS_AUTOTICKS | WS_TABSTOP,44,16,193,18 LTEXT "Device",IDC_STATIC,13,42,24,8 - COMBOBOX IDC_SOUND_DEVICE,44,40,118,87,CBS_DROPDOWNLIST | + COMBOBOX IDC_SOUND_DEVICE,44,40,193,87,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP GROUPBOX "Sound",IDC_STATIC,7,7,237,54 LTEXT "IP Address:",IDC_STATIC,14,81,37,8 @@ -692,8 +692,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,5,5,0 - PRODUCTVERSION 1,5,5,0 + FILEVERSION 1,5,6,0 + PRODUCTVERSION 1,5,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -710,12 +710,12 @@ BEGIN BEGIN VALUE "CompanyName", "Christoph Gießelink & Sebastien Carlier\0" VALUE "FileDescription", "HP38/39/40/48/49 Emulator\0" - VALUE "FileVersion", "1, 5, 5, 0\0" + VALUE "FileVersion", "1, 5, 6, 0\0" VALUE "InternalName", "Emu48\0" VALUE "LegalCopyright", "Copyright © 2015\0" VALUE "OriginalFilename", "Emu48.exe\0" VALUE "ProductName", "Emu48\0" - VALUE "ProductVersion", "1, 5, 5, 0\0" + VALUE "ProductVersion", "1, 5, 6, 0\0" END END BLOCK "VarFileInfo" diff --git a/source/Emu48.dsp b/source/Emu48.dsp index 3d9e1e8..aad0d55 100644 --- a/source/Emu48.dsp +++ b/source/Emu48.dsp @@ -7,23 +7,23 @@ CFG=Emu48 - Win32 DebugRegDebug4x !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Emu48.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Emu48.mak" CFG="Emu48 - Win32 DebugRegDebug4x" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "Emu48 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "Emu48 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE "Emu48 - Win32 Release Unicode" (based on "Win32 (x86) Application") !MESSAGE "Emu48 - Win32 Debug Unicode" (based on "Win32 (x86) Application") !MESSAGE "Emu48 - Win32 DebugRegDebug4x" (based on "Win32 (x86) Application") !MESSAGE "Emu48 - Win32 ReleaseRegDebug4x" (based on "Win32 (x86) Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -37,13 +37,13 @@ RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\Release" -# PROP BASE Intermediate_Dir ".\Release" +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir ".\Release" -# PROP Intermediate_Dir ".\Release" +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c @@ -63,13 +63,13 @@ LINK32=link.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir ".\Debug" -# PROP BASE Intermediate_Dir ".\Debug" +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir ".\Debug" -# PROP Intermediate_Dir ".\Debug" +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c @@ -89,14 +89,14 @@ LINK32=link.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Emu48___" -# PROP BASE Intermediate_Dir "Emu48___" +# PROP BASE Output_Dir "ReleaseUnicode" +# PROP BASE Intermediate_Dir "ReleaseUnicode" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir ".\ReleaseUnicode" -# PROP Intermediate_Dir ".\ReleaseUnicode" +# PROP Output_Dir "ReleaseUnicode" +# PROP Intermediate_Dir "ReleaseUnicode" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /Gr /MT /W3 /GX /O2 /Ob2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /Yu"pch.h" /FD /c @@ -116,14 +116,14 @@ LINK32=link.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Emu48__0" -# PROP BASE Intermediate_Dir "Emu48__0" +# PROP BASE Output_Dir "DebugUnicode" +# PROP BASE Intermediate_Dir "DebugUnicode" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir ".\DebugUnicode" -# PROP Intermediate_Dir ".\DebugUnicode" +# PROP Output_Dir "DebugUnicode" +# PROP Intermediate_Dir "DebugUnicode" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /FR /Yu"pch.h" /FD /c @@ -143,14 +143,14 @@ LINK32=link.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Emu48___Win32_DebugRegDebug4x" -# PROP BASE Intermediate_Dir "Emu48___Win32_DebugRegDebug4x" +# PROP BASE Output_Dir "DebugRegDebug4x" +# PROP BASE Intermediate_Dir "DebugRegDebug4x" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir ".\DebugRegDebug4x" -# PROP Intermediate_Dir ".\DebugRegDebug4x" +# PROP Output_Dir "DebugRegDebug4x" +# PROP Intermediate_Dir "DebugRegDebug4x" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /FR /Yu"pch.h" /FD /c @@ -170,14 +170,14 @@ LINK32=link.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Emu48___Win32_ReleaseRegDebug4x" -# PROP BASE Intermediate_Dir "Emu48___Win32_ReleaseRegDebug4x" +# PROP BASE Output_Dir "ReleaseRegDebug4x" +# PROP BASE Intermediate_Dir "ReleaseRegDebug4x" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir ".\ReleaseRegDebug4x" -# PROP Intermediate_Dir ".\ReleaseRegDebug4x" +# PROP Output_Dir "ReleaseRegDebug4x" +# PROP Intermediate_Dir "ReleaseRegDebug4x" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /Gr /MT /W3 /GX /O2 /Ob2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /Yu"pch.h" /FD /c @@ -193,7 +193,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib shell32.lib winmm.lib comctl32.lib advapi32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib shell32.lib winmm.lib comctl32.lib advapi32.lib ws2_32.lib /nologo /subsystem:windows /machine:I386 -!ENDIF +!ENDIF # Begin Target diff --git a/source/FILES.C b/source/FILES.C index fe34d36..ca03d00 100644 --- a/source/FILES.C +++ b/source/FILES.C @@ -675,7 +675,7 @@ BOOL MapPort2(LPCTSTR szFilename) dwFileSizeLo = GetFileSize(hPort2File, &dwFileSizeHi); // size not 32, 128, 256, 512, 1024, 2048 or 4096 KB - if ( dwFileSizeHi != 0 + if ( dwFileSizeHi != 0 || dwFileSizeLo == 0 || (dwFileSizeLo & (dwFileSizeLo - 1)) != 0 || (dwFileSizeLo & 0xFF02FFFF) != 0) @@ -873,7 +873,7 @@ restore: ResetBackup(); // HP48SX/GX - if (Chipset.type == 'S' || Chipset.type == 'G') + if(Chipset.type == 'S' || Chipset.type == 'G') { // use 2nd command line argument if defined MapPort2((nArgc < 3) ? szPort2Filename : ppArgv[2]); @@ -1060,7 +1060,7 @@ BOOL OpenDocument(LPCTSTR szFilename) } // HP48SX/GX - if (cCurrentRomType=='S' || cCurrentRomType=='G') + if(cCurrentRomType=='S' || cCurrentRomType=='G') { MapPort2((nArgc < 3) ? szPort2Filename : ppArgv[2]); // port2 changed and card detection enabled @@ -1097,7 +1097,7 @@ BOOL OpenDocument(LPCTSTR szFilename) RomSwitch(Chipset.Bank_FF); // reload ROM view of HP49G and map memory - if (Chipset.wRomCrc != wRomCrc) // ROM changed + if (Chipset.wRomCrc != wRomCrc) // ROM changed { CpuReset(); Chipset.Shutdn = FALSE; // automatic restart @@ -1128,7 +1128,7 @@ restore: ResetBackup(); // HP48SX/GX - if (cCurrentRomType=='S' || cCurrentRomType=='G') + if(cCurrentRomType=='S' || cCurrentRomType=='G') { // use 2nd command line argument if defined MapPort2((nArgc < 3) ? szPort2Filename : ppArgv[2]); @@ -1732,7 +1732,7 @@ static HBITMAP DecodeBmp(LPBMPFILE pBmp) else { dwFileSize += WIDTHBYTES(pBmi->bmiHeader.biWidth * pBmi->bmiHeader.biBitCount) - * labs(pBmi->bmiHeader.biHeight); + * labs(pBmi->bmiHeader.biHeight); } if (pBmp->dwFileSize < dwFileSize) return NULL; @@ -2325,7 +2325,7 @@ HBITMAP LoadBitmapFile(LPCTSTR szFilename) if ( Bmp.dwFileSize >= 6 && (memcmp(Bmp.pbyFile,"GIF87a",6) == 0 || memcmp(Bmp.pbyFile,"GIF89a",6) == 0)) { - hBitmap = DecodeGif(&Bmp,&dwTColor); + hBitmap = DecodeGif(&Bmp,NULL); break; } diff --git a/source/KML.C b/source/KML.C index 93c8403..a21c1d4 100644 --- a/source/KML.C +++ b/source/KML.C @@ -76,7 +76,6 @@ static CONST KmlToken pLexToken[] = {TOK_VIRTUAL, 000000, 7,_T("Virtual")}, {TOK_INCLUDE, 000002, 7,_T("Include")}, {TOK_NOTFLAG, 000001, 7,_T("NotFlag")}, - {TOK_MENUBAR, 000001, 7,_T("Menubar")}, // for PPC compatibility reasons {TOK_GLOBAL, 000000, 6,_T("Global")}, {TOK_AUTHOR, 000002, 6,_T("Author")}, {TOK_BITMAP, 000002, 6,_T("Bitmap")}, @@ -86,7 +85,6 @@ static CONST KmlToken pLexToken[] = {TOK_ONDOWN, 000000, 6,_T("OnDown")}, {TOK_NOHOLD, 000000, 6,_T("NoHold")}, {TOK_LOCALE, 000001, 6,_T("Locale")}, - {TOK_TOPBAR, 000001, 6,_T("Topbar")}, // for PPC compatibility reasons {TOK_TITLE, 000002, 5,_T("Title")}, {TOK_OUTIN, 000011, 5,_T("OutIn")}, {TOK_PATCH, 000002, 5,_T("Patch")}, @@ -105,7 +103,6 @@ static CONST KmlToken pLexToken[] = {TOK_ONUP, 000000, 4,_T("OnUp")}, {TOK_MAP, 000011, 3,_T("Map")}, {TOK_ROM, 000002, 3,_T("Rom")}, - {TOK_VGA, 000001, 3,_T("Vga")}, // for PPC compatibility reasons {TOK_LCD, 000000, 3,_T("Lcd")}, {TOK_END, 000000, 3,_T("End")}, {TOK_NONE, 000000, 0,_T("")} @@ -1335,8 +1332,7 @@ static KmlLine* InitLcd(KmlBlock* pBlock) nLcdY = (UINT) pLine->nParam[1]; break; case TOK_ZOOM: - nLcdZoom = (UINT) pLine->nParam[0]; - if (!(nLcdZoom >= 1 && nLcdZoom <= 4)) + if ((nLcdZoom = (UINT) pLine->nParam[0]) == 0) nLcdZoom = 1; break; case TOK_COLOR: @@ -1740,20 +1736,21 @@ static DWORD GetIntegerParam(KmlBlock* pBlock, TokenId eBlock, TokenId eCommand, //# //################ -static INT iSqrt(INT nNumber) // integer y=sqrt(x) function +static UINT iSqrt(UINT nNumber) // integer y=sqrt(x) function { - INT m, b = 0, t = nNumber; + UINT b, t; - do + b = t = nNumber; + + if (nNumber > 0) { - m = (b + t + 1) / 2; // median number - if (m * m - nNumber > 0) // calculate x^2-y - t = m; // adjust upper border - else - b = m; // adjust lower border + do + { + b = t; + t = (t + nNumber / t) / 2; // Heron's method + } + while (t < b); } - while (t - b > 1); - return b; } diff --git a/source/KML.H b/source/KML.H index f2d0346..62ef378 100644 --- a/source/KML.H +++ b/source/KML.H @@ -39,29 +39,28 @@ typedef enum eTokenId TOK_NOHOLD, //23 TOK_LOCALE, //24 TOK_TOPBAR, //25 - TOK_MENUBAR, //26 - TOK_TITLE, //27 - TOK_OUTIN, //28 - TOK_PATCH, //29 - TOK_PRINT, //30 - TOK_DEBUG, //31 - TOK_COLOR, //32 - TOK_MODEL, //33 - TOK_CLASS, //34 - TOK_PRESS, //35 - TOK_IFMEM, //36 - TOK_TYPE, //37 - TOK_SIZE, //38 - TOK_DOWN, //39 - TOK_ZOOM, //40 - TOK_ELSE, //41 - TOK_ONUP, //42 - TOK_EOL, //43 - TOK_MAP, //44 - TOK_ROM, //45 - TOK_VGA, //46 - TOK_LCD, //47 - TOK_END //48 + TOK_TITLE, //26 + TOK_OUTIN, //27 + TOK_PATCH, //28 + TOK_PRINT, //29 + TOK_DEBUG, //30 + TOK_COLOR, //31 + TOK_MODEL, //32 + TOK_CLASS, //33 + TOK_PRESS, //34 + TOK_IFMEM, //35 + TOK_TYPE, //36 + TOK_SIZE, //37 + TOK_DOWN, //38 + TOK_ZOOM, //39 + TOK_ELSE, //40 + TOK_ONUP, //41 + TOK_EOL, //42 + TOK_MAP, //43 + TOK_ROM, //44 + TOK_VGA, //45 + TOK_LCD, //46 + TOK_END //47 } TokenId; #define TYPE_NONE 00 diff --git a/source/PCH.H b/source/PCH.H index 31cb02a..9175827 100644 --- a/source/PCH.H +++ b/source/PCH.H @@ -1,55 +1,55 @@ -// -// PCH.H -// - -#define _WIN32_IE 0x0200 -#define _CRT_SECURE_NO_DEPRECATE -#define _CRTDBG_MAP_ALLOC +// +// PCH.H +// + +#define _WIN32_IE 0x0200 +#define _CRT_SECURE_NO_DEPRECATE +#define _CRTDBG_MAP_ALLOC #define _WINSOCK_DEPRECATED_NO_WARNINGS + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined VERIFY +#if defined _DEBUG +#define VERIFY(f) _ASSERT(f) +#else // _DEBUG +#define VERIFY(f) ((VOID)(f)) +#endif // _DEBUG +#endif // _VERIFY + +#if !defined INVALID_SET_FILE_POINTER +#define INVALID_SET_FILE_POINTER ((DWORD)-1) +#endif + +#if !defined INVALID_FILE_ATTRIBUTES +#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) +#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if !defined VERIFY -#if defined _DEBUG -#define VERIFY(f) _ASSERT(f) -#else // _DEBUG -#define VERIFY(f) ((VOID)(f)) -#endif // _DEBUG -#endif // _VERIFY - -#if !defined INVALID_SET_FILE_POINTER -#define INVALID_SET_FILE_POINTER ((DWORD)-1) -#endif - -#if !defined INVALID_FILE_ATTRIBUTES -#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) -#endif - -#if !defined GWLP_USERDATA -#define GWLP_USERDATA GWL_USERDATA -#endif +#if !defined GWLP_USERDATA +#define GWLP_USERDATA GWL_USERDATA +#endif #if !defined GCLP_HCURSOR #define GCLP_HCURSOR GCL_HCURSOR #endif - -#if !defined IDC_HAND // Win2k specific definition -#define IDC_HAND MAKEINTRESOURCE(32649) -#endif - + +#if !defined IDC_HAND // Win2k specific definition +#define IDC_HAND MAKEINTRESOURCE(32649) +#endif + #if _MSC_VER <= 1200 // missing type definition in the MSVC6.0 SDK and earlier #define SetWindowLongPtr SetWindowLong #define GetWindowLongPtr GetWindowLong @@ -58,36 +58,36 @@ typedef SIZE_T DWORD_PTR, *PDWORD_PTR; typedef ULONG ULONG_PTR, *PULONG_PTR; typedef LONG LONG_PTR, *PLONG_PTR; -#endif - -#if _MSC_VER >= 1400 // valid for VS2005 and later -#if defined _M_IX86 -#pragma comment(linker,"/manifestdependency:\" \ - type='win32' \ - name='Microsoft.Windows.Common-Controls' \ - version='6.0.0.0' processorArchitecture='x86' \ - publicKeyToken='6595b64144ccf1df' \ - language='*'\"") -#elif defined _M_IA64 -#pragma comment(linker,"/manifestdependency:\" \ - type='win32' \ - name='Microsoft.Windows.Common-Controls' \ - version='6.0.0.0' processorArchitecture='ia64' \ - publicKeyToken='6595b64144ccf1df' \ - language='*'\"") -#elif defined _M_X64 -#pragma comment(linker,"/manifestdependency:\" \ - type='win32' \ - name='Microsoft.Windows.Common-Controls' \ - version='6.0.0.0' processorArchitecture='amd64' \ - publicKeyToken='6595b64144ccf1df' \ - language='*'\"") -#else -#pragma comment(linker,"/manifestdependency:\" \ - type='win32' \ - name='Microsoft.Windows.Common-Controls' \ - version='6.0.0.0' processorArchitecture='*' \ - publicKeyToken='6595b64144ccf1df' \ - language='*'\"") -#endif -#endif +#endif + +#if _MSC_VER >= 1400 // valid for VS2005 and later +#if defined _M_IX86 +#pragma comment(linker,"/manifestdependency:\" \ + type='win32' \ + name='Microsoft.Windows.Common-Controls' \ + version='6.0.0.0' processorArchitecture='x86' \ + publicKeyToken='6595b64144ccf1df' \ + language='*'\"") +#elif defined _M_IA64 +#pragma comment(linker,"/manifestdependency:\" \ + type='win32' \ + name='Microsoft.Windows.Common-Controls' \ + version='6.0.0.0' processorArchitecture='ia64' \ + publicKeyToken='6595b64144ccf1df' \ + language='*'\"") +#elif defined _M_X64 +#pragma comment(linker,"/manifestdependency:\" \ + type='win32' \ + name='Microsoft.Windows.Common-Controls' \ + version='6.0.0.0' processorArchitecture='amd64' \ + publicKeyToken='6595b64144ccf1df' \ + language='*'\"") +#else +#pragma comment(linker,"/manifestdependency:\" \ + type='win32' \ + name='Microsoft.Windows.Common-Controls' \ + version='6.0.0.0' processorArchitecture='*' \ + publicKeyToken='6595b64144ccf1df' \ + language='*'\"") +#endif +#endif diff --git a/source/REDEYE.C b/source/REDEYE.C index 2c47163..17713dc 100644 --- a/source/REDEYE.C +++ b/source/REDEYE.C @@ -12,7 +12,7 @@ #define ERR_CHAR 127 // character for transfer error -#define H1 0x78 +#define H1 0x78 #define H2 0xE6 #define H3 0xD5 #define H4 0x8B diff --git a/source/RESOURCE.H b/source/RESOURCE.H index dc8c150..d28ed34 100644 --- a/source/RESOURCE.H +++ b/source/RESOURCE.H @@ -241,12 +241,12 @@ #define ID_FILE_MRU_FILE1 40100 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 132 +#define _APS_NEXT_RESOURCE_VALUE 130 #define _APS_NEXT_COMMAND_VALUE 40072 #define _APS_NEXT_CONTROL_VALUE 1136 -#define _APS_NEXT_SYMED_VALUE 109 +#define _APS_NEXT_SYMED_VALUE 108 #endif #endif diff --git a/source/SERIAL.C b/source/SERIAL.C index fdd18cf..05a0233 100644 --- a/source/SERIAL.C +++ b/source/SERIAL.C @@ -113,14 +113,14 @@ BOOL CommOpen(LPTSTR strWirePort,LPTSTR strIrPort) _tcscat(szDevice,strPort); // device name hComm = CreateFile(szDevice, - GENERIC_READ | GENERIC_WRITE, + GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); - if (hComm != INVALID_HANDLE_VALUE) + if(hComm != INVALID_HANDLE_VALUE) { DWORD dwThreadId; @@ -140,7 +140,7 @@ BOOL CommOpen(LPTSTR strWirePort,LPTSTR strIrPort) hCThreadTxd = CreateThread(NULL,0,&TransmitThread,NULL,CREATE_SUSPENDED,&dwThreadId); _ASSERT(hCThreadTxd); SetThreadPriority(hCThreadTxd,THREAD_PRIORITY_ABOVE_NORMAL); - ResumeThread(hCThreadTxd); // start thread + ResumeThread(hCThreadTxd); // start thread // create Comm event handler bReading = FALSE; @@ -148,7 +148,7 @@ BOOL CommOpen(LPTSTR strWirePort,LPTSTR strIrPort) hCThreadEv = CreateThread(NULL,0,&EventThread,NULL,CREATE_SUSPENDED,&dwThreadId); _ASSERT(hCThreadEv); SetThreadPriority(hCThreadEv,THREAD_PRIORITY_ABOVE_NORMAL); - ResumeThread(hCThreadEv); // start thread + ResumeThread(hCThreadEv); // start thread while (!bReading) Sleep(0); // wait for SerialThread started } else @@ -353,13 +353,13 @@ VOID CommReceive(VOID) // reject reading if com port is closed and not whole operation if (hComm && dwBytesRead == 0L) // com port open and buffer empty { - if (ReadFile(hComm,&cBuffer,sizeof(cBuffer),&dwBytesRead,&os) == FALSE) + if(ReadFile(hComm,&cBuffer,sizeof(cBuffer),&dwBytesRead,&os) == FALSE) dwBytesRead = 0L; else // bytes received nRp = 0; // reset read pointer } - if (dwBytesRead == 0L) // receive buffer empty + if(dwBytesRead == 0L) // receive buffer empty break; #if defined DEBUG_SERIAL @@ -379,7 +379,7 @@ VOID CommReceive(VOID) --dwBytesRead; Chipset.IORam[RCS] |= RBF; // receive buffer full - if (UpdateUSRQ()) // update USRQ bit + if(UpdateUSRQ()) // update USRQ bit INTERRUPT; } while(0); diff --git a/source/SETTINGS.C b/source/SETTINGS.C index d837c91..e0d11c4 100644 --- a/source/SETTINGS.C +++ b/source/SETTINGS.C @@ -67,7 +67,7 @@ static VOID ReadReg(LPCTSTR lpSubKey, LPCTSTR lpValueName, LPBYTE lpData, DWORD 0, KEY_QUERY_VALUE, &hKey); - if (retCode == ERROR_SUCCESS) + if (retCode == ERROR_SUCCESS) { retCode = RegQueryValueEx(hKey,lpValueName,NULL,&dwType,lpData,pdwSize); RegCloseKey(hKey); @@ -117,7 +117,7 @@ static BOOL DelReg(LPCTSTR lpSubKey, LPCTSTR lpValueName) 0, KEY_SET_VALUE, &hKey); - if (retCode == ERROR_SUCCESS) + if (retCode == ERROR_SUCCESS) { retCode = RegDeleteValue(hKey,lpValueName); RegCloseKey(hKey); diff --git a/source/STACK.C b/source/STACK.C index 417c6f9..0170729 100644 --- a/source/STACK.C +++ b/source/STACK.C @@ -113,7 +113,7 @@ static __inline INT SetZInt(LPCTSTR cp,LPBYTE pbyNum,INT nSize) } // nStrLen = no. of digits without sign - if (nStrLen >= nSize) // destination buffer too small + if (nStrLen >= nSize) // destination buffer too small return 0; nNumSize = nStrLen + 1; // no. of written data @@ -126,7 +126,7 @@ static __inline INT SetZInt(LPCTSTR cp,LPBYTE pbyNum,INT nSize) if (!((c >= _T('0')) || (c <= _T('9')))) return 0; - c -= _T('0'); + c -= _T('0'); *pbyNum++ = (BYTE) c; } *pbyNum = bySign; // add sign @@ -296,7 +296,7 @@ static __inline INT SetBcd(LPCTSTR cp,INT nMantLen,INT nExpLen,CONST TCHAR cDec, byNum[j] = byNum[j + i]; } - if (byNum[1] == 0) // number is 0 + if(byNum[1] == 0) // number is 0 { ZeroMemory(pbyNum,nMantLen + nExpLen + 1); return nMantLen + nExpLen + 1; @@ -326,7 +326,7 @@ static __inline INT SetBcd(LPCTSTR cp,INT nMantLen,INT nExpLen,CONST TCHAR cDec, while (*cp >= _T('0') && *cp <= _T('9')) lExp = lExp * 10 + *cp++ - _T('0'); - if (i) lExp = -lExp; + if(i) lExp = -lExp; } if (*cp != 0) return 0; @@ -805,7 +805,7 @@ LRESULT OnStackPaste(VOID) // paste data to stack } } } - while (FALSE); + while(FALSE); GlobalUnlock(hClipObj); } @@ -825,7 +825,7 @@ LRESULT OnStackPaste(VOID) // paste data to stack KeyboardEvent(FALSE,0,0x8000); // wait for sleep mode - while (Chipset.Shutdn == FALSE) Sleep(0); + while(Chipset.Shutdn == FALSE) Sleep(0); cancel: bDbgAutoStateCtrl = TRUE; // enable automatic debugger state control