2016-09-11: Updated to version 56

Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
This commit is contained in:
Gwenhael Le Moine 2024-03-20 07:46:28 +01:00
parent 0c6fbb14ef
commit 5b61a0678e
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
23 changed files with 1335 additions and 1206 deletions

View file

@ -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

BIN
Emu48.dll

Binary file not shown.

BIN
Emu48.exe

Binary file not shown.

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -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);
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))
dwSize = dwIndex;
dwSize = DdeGetData(hData,lpData+dwSize,dwSize,sizeof(DWORD));
bSuccess = (WriteStack(nStkLvl,lpData,dwSize) == S_ERR_NO);
free(lpData); // free memory
{
// 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:

View file

@ -237,7 +237,14 @@ DECLSPEC BOOL CALLBACK EmuInitLastInstr(
DWORD *pdwArray) // @parm pointer to linear array
{
if (pdwInstrArray) // circular buffer defined
{
EnterCriticalSection(&csDbgLock);
{
free(pdwInstrArray); // free memory
pdwInstrArray = NULL;
}
LeaveCriticalSection(&csDbgLock);
}
if (wNoInstr) // new size
{

View file

@ -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];
@ -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)
@ -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;
}
//
@ -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));
@ -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
}
@ -2983,7 +2984,7 @@ static BOOL ToggleBreakpointItem(HWND hWnd, INT nItem)
static VOID DrawBreakpoint(HWND hWnd, INT i)
{
TCHAR *szText,szBuffer[32];
INT nItem;
LPARAM nItem;
switch(sBreakpoint[i].nType)
{
@ -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];

View file

@ -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
@ -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)
{
@ -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,

View file

@ -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("");
@ -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)
{
@ -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,7 +2242,7 @@ start:
while (GetMessage(&msg, NULL, 0, 0))
{
if ( !TranslateAccelerator(hWnd, hAccel, &msg)
if( !TranslateAccelerator(hWnd, hAccel, &msg)
&& (hDlgDebug == NULL || !IsDialogMessage(hDlgDebug, &msg))
&& (hDlgFind == NULL || !IsDialogMessage(hDlgFind, &msg))
&& (hDlgProfile == NULL || !IsDialogMessage(hDlgProfile, &msg))

View file

@ -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"

View file

@ -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

View file

@ -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
@ -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]);
@ -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;
}

View file

@ -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;
b = t = nNumber;
if (nNumber > 0)
{
do
{
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
b = t;
t = (t + nNumber / t) / 2; // Heron's method
}
while (t < b);
}
while (t - b > 1);
return b;
}

View file

@ -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

View file

@ -244,9 +244,9 @@
//
#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

View file

@ -120,7 +120,7 @@ BOOL CommOpen(LPTSTR strWirePort,LPTSTR strIrPort)
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
NULL);
if (hComm != INVALID_HANDLE_VALUE)
if(hComm != INVALID_HANDLE_VALUE)
{
DWORD dwThreadId;
@ -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);

View file

@ -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