2016-09-11: Updated to version 56
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
This commit is contained in:
parent
0c6fbb14ef
commit
5b61a0678e
23 changed files with 1335 additions and 1206 deletions
|
@ -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
BIN
Emu48.dll
Binary file not shown.
BIN
Emu48.exe
BIN
Emu48.exe
Binary file not shown.
|
@ -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
|
||||
|
|
1849
source/CHANGES.TXT
1849
source/CHANGES.TXT
File diff suppressed because it is too large
Load diff
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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];
|
||||
|
||||
|
|
|
@ -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.
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
27
source/KML.C
27
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;
|
||||
}
|
||||
|
||||
|
|
45
source/KML.H
45
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue