This commit is contained in:
dgis 2018-11-20 22:46:33 +00:00
parent 510fa69fe0
commit afd40ada96
39 changed files with 608 additions and 479 deletions

View file

@ -28,9 +28,9 @@ add_library( # Sets the name of the library.
# src/main/cpp/debugger.c
# src/main/cpp/disasm.c
src/main/cpp/dismem.c
src/main/cpp/display.c
src/main/cpp/display.c -> To rewrite
src/main/cpp/disrpl.c
# src/main/cpp/Emu48.c
# src/main/cpp/Emu48.c -> To rewrite
src/main/cpp/engine.c
src/main/cpp/external.c
src/main/cpp/fetch.c

View file

@ -30,3 +30,59 @@ VOID SoundOut(CHIPSET* w, WORD wOut) {
}
VOID SoundBeep(DWORD dwFrequency, DWORD dwDuration) {
}
// Emu48.c
#define VERSION "1.59+"
//static BOOL bOwnCursor = FALSE;
//static BOOL bTitleBar = TRUE;
//
//CRITICAL_SECTION csGDILock; // critical section for hWindowDC
//CRITICAL_SECTION csLcdLock; // critical section for display update
//CRITICAL_SECTION csKeyLock; // critical section for key scan
//CRITICAL_SECTION csIOLock; // critical section for I/O access
//CRITICAL_SECTION csT1Lock; // critical section for timer1 access
//CRITICAL_SECTION csT2Lock; // critical section for timer2 access
//CRITICAL_SECTION csTxdLock; // critical section for transmit byte
//CRITICAL_SECTION csRecvLock; // critical section for receive byte
//CRITICAL_SECTION csSlowLock; // critical section for speed slow down
//CRITICAL_SECTION csDbgLock; // critical section for debugger purpose
//INT nArgc; // no. of command line arguments
//LPCTSTR *ppArgv; // command line arguments
//LARGE_INTEGER lFreq; // high performance counter frequency
//LARGE_INTEGER lAppStart; // high performance counter value at Appl. start
//DWORD idDdeInst; // DDE server id
//UINT uCF_HpObj; // DDE clipboard format
//HANDLE hThread;
//HANDLE hEventShutdn; // event handle to stop cpu thread
//
//HINSTANCE hApp = NULL;
//HWND hWnd = NULL;
//HWND hDlgDebug = NULL; // handle for debugger dialog
//HWND hDlgFind = NULL; // handle for debugger find dialog
//HWND hDlgProfile = NULL; // handle for debugger profile dialog
//HWND hDlgRplObjView = NULL; // handle for debugger rpl object viewer
//HDC hWindowDC = NULL;
//HPALETTE hPalette = NULL;
//HPALETTE hOldPalette = NULL; // old palette of hWindowDC
//DWORD dwTColor = (DWORD) -1; // transparency color
//DWORD dwTColorTol = 0; // transparency color tolerance
HRGN hRgn = NULL;
//HCURSOR hCursorArrow = NULL;
//HCURSOR hCursorHand = NULL;
//UINT uWaveDevId = WAVE_MAPPER; // default audio device
//DWORD dwWakeupDelay = 200; // ON key hold time to switch on calculator
//BOOL bAutoSave = FALSE;
//BOOL bAutoSaveOnExit = TRUE;
//BOOL bSaveDefConfirm = TRUE; // yes
//BOOL bStartupBackup = FALSE;
//BOOL bAlwaysDisplayLog = TRUE;
//BOOL bLoadObjectWarning = TRUE;
//BOOL bShowTitle = TRUE; // show main window title bar
//BOOL bShowMenu = TRUE; // show main window menu bar
//BOOL bAlwaysOnTop = FALSE; // emulator window always on top
//BOOL bActFollowsMouse = FALSE; // emulator window activation follows mouse
//BOOL bClientWinMove = FALSE; // emulator window can be moved over client area
//BOOL bSingleInstance = FALSE; // multiple emulator instances allowed

View file

@ -4,7 +4,7 @@
* This file is part of Emu48
*
* Copyright (C) 2005 CdB for HP
* Copyright (C) 2006 Christoph Gießelink
* Copyright (C) 2006 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2006 Christoph Gießelink
* Copyright (C) 2006 Christoph Gießelink
*
*/

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 1999 Christoph Gießelink
* Copyright (C) 1999 Christoph Gießelink
*
*/

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2004 Christoph Gießelink
* Copyright (C) 2004 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 1998 Christoph Gießelink
* Copyright (C) 1998 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2000 Christoph Gießelink
* Copyright (C) 2000 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 1999 Christoph Gießelink
* Copyright (C) 1999 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 1999 Christoph Gießelink
* Copyright (C) 1999 Christoph Gießelink
*
*/

View file

@ -4,7 +4,7 @@
* This file is part of Emu48, a ported version of x48
*
* Copyright (C) 1994 Eddie C. Dost
* Copyright (C) 1998 Christoph Gießelink
* Copyright (C) 1998 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2012 Christoph Gießelink
* Copyright (C) 2012 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -4,7 +4,7 @@
* This file is part of Emu48
*
* Copyright (C) 1995 Sebastien Carlier
* Copyright (C) 2002 Christoph Gießelink
* Copyright (C) 2002 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2008 Christoph Gießelink
* Copyright (C) 2008 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2008 Christoph Gießelink
* Copyright (C) 2008 Christoph Gießelink
*
*/

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2000 Christoph Gießelink
* Copyright (C) 2000 Christoph Gießelink
*
*/

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2000 Christoph Gießelink
* Copyright (C) 2000 Christoph Gießelink
*
*/

View file

@ -4,7 +4,7 @@
* This file is part of Emu48
*
* Copyright (C) 1995 Sebastien Carlier
* Copyright (C) 2005 Christoph Gießelink
* Copyright (C) 2005 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 1999 Christoph Gießelink
* Copyright (C) 1999 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2000 Christoph Gießelink
* Copyright (C) 2000 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2000 Christoph Gießelink
* Copyright (C) 2000 Christoph Gießelink
*
*/

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 1999 Christoph Gießelink
* Copyright (C) 1999 Christoph Gießelink
*
*/

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2004 Christoph Gießelink
* Copyright (C) 2004 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2006 Christoph Gießelink
* Copyright (C) 2006 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2007 Christoph Gießelink
* Copyright (C) 2007 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -4,7 +4,7 @@
* This file is part of Emu48
*
* Copyright (C) 1995 Sebastien Carlier
* Copyright (C) 1999 Christoph Gießelink
* Copyright (C) 1999 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 1999 Christoph Gießelink
* Copyright (C) 1999 Christoph Gießelink
*
*/

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2011 Christoph Gießelink
* Copyright (C) 2011 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 1998 Christoph Gießelink
* Copyright (C) 1998 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2000 Christoph Gießelink
* Copyright (C) 2000 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2015 Christoph Gießelink
* Copyright (C) 2015 Christoph Gießelink
*
*/

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2015 Christoph Gießelink
* Copyright (C) 2015 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2013 Christoph Gießelink
* Copyright (C) 2013 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2005 Christoph Gießelink
* Copyright (C) 2005 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2008 Christoph Gießelink
* Copyright (C) 2008 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -3,7 +3,7 @@
*
* This file is part of Emu48
*
* Copyright (C) 2011 Christoph Gießelink
* Copyright (C) 2011 Christoph Gießelink
*
*/
#include "pch.h"

View file

@ -1,6 +1,6 @@
#include "pch.h"
#import <mach/mach_time.h>
#import <fcntl.h>
#include <mach/mach_time.h>
#include <fcntl.h>
HANDLE hWnd;
LPTSTR szTitle;
@ -414,3 +414,25 @@ BOOL GetSystemPowerStatus(LPSYSTEM_POWER_STATUS status)
status->ACLineStatus = AC_LINE_ONLINE;
return TRUE;
}
// file.c
BOOL GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndpl) { return 0; }
DWORD GetFullPathName(LPCWSTR lpFileName, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR* lpFilePart) { return 0; }
void __cdecl _wsplitpath(wchar_t const* _FullPath, wchar_t* _Drive, wchar_t* _Dir, wchar_t* _Filename, wchar_t* _Ext) {}
LPWSTR lstrcpyn(LPWSTR lpString1, LPCWSTR lpString2,int iMaxLength) {
return strcpy(lpString1, lpString2);
}
LPWSTR lstrcat(LPWSTR lpString1, LPCWSTR lpString2) {
return NULL;
}
void _wmakepath(wchar_t _Buffer, wchar_t const* _Drive, wchar_t const* _Dir, wchar_t const* _Filename, wchar_t const* _Ext)
{
}
BOOL GetClientRect(HWND hWnd, LPRECT lpRect)
{
return 0;
}

View file

@ -1,12 +1,13 @@
#import <stdint.h>
#import <pthread.h>
#include <stdint.h>
#include <pthread.h>
#include <wchar.h>
#ifndef __OBJC__
typedef signed char BOOL; // deliberately same type as defined in objc
#endif
#define TRUE 1
#define FALSE 0
#define MAX_PATH MAXPATHLEN
#define MAX_PATH PATH_MAX
#define INFINITE 0
typedef unsigned long ulong; // ushort is already in types.h
@ -47,6 +48,7 @@ typedef struct _RECT {
short top;
short bottom;
} RECT;
typedef RECT *LPRECT
typedef BYTE *LPCVOID;
typedef struct _RGBQUAD {
BYTE rgbRed;
@ -161,20 +163,8 @@ typedef struct _SYSTEM_POWER_STATUS
#import <stdio.h>
#import <string.h>
#include <stdio.h>
#include <string.h>
enum
{
@ -347,3 +337,73 @@ extern void Sleep(int);
#define UNREFERENCED_PARAMETER(a)
extern BOOL GetSystemPowerStatus(LPSYSTEM_POWER_STATUS l);
//RC
struct HRGN__ { int unused; };
typedef struct HRGN__ *HRGN;
#define _ASSERT(expr)
//#define _ASSERT(expr) \
// (void)( \
// (!!(expr)) || \
// (1 != _CrtDbgReportW(_CRT_ASSERT, _CRT_WIDE(__FILE__), __LINE__, NULL, L"%ls", NULL)) || \
// (_CrtDbgBreak(), 0) \
// )
// disrpl.c
//wvsprintf(cOutput,lpFormat,arglist);
//_tcschr(_T(" \t\n\r"),str->szBuffer[str->dwPos-1]) == NULL)
//_tcschr(lpszStart,_T('\n')
//lstrcmp(lpszObject,ObjDecode[i].lpszName)
//lstrcmp(lpszObject,_T("::"))
//_tcsncmp(lpszObject,_T("DIR\n"),4)
//_tcsncmp(lpszStart,_T("ENDDIR"),lpszEnd-lpszStart)
// file.c
typedef struct tagPOINT
{
LONG x;
LONG y;
} POINT, *PPOINT;
typedef struct tagWINDOWPLACEMENT {
UINT length;
UINT flags;
UINT showCmd;
POINT ptMinPosition;
POINT ptMaxPosition;
RECT rcNormalPosition;
#ifdef _MAC
RECT rcDevice;
#endif
} WINDOWPLACEMENT;
typedef WINDOWPLACEMENT *PWINDOWPLACEMENT, *LPWINDOWPLACEMENT;
extern BOOL WINAPI GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndpl);
extern BOOL WINAPI SetWindowPlacement(HWND hWnd, CONST WINDOWPLACEMENT *lpwndpl);
#define _MAX_PATH 260 // max. length of full pathname
#define _MAX_DRIVE 3 // max. length of drive component
#define _MAX_DIR 256 // max. length of path component
#define _MAX_FNAME 256 // max. length of file name component
#define _MAX_EXT 256 // max. length of extension component
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
typedef CONST WCHAR *LPCWSTR, *PCWSTR;
typedef WCHAR *NWPSTR, *LPWSTR, *PWSTR;
extern DWORD WINAPI GetFullPathName(LPCWSTR lpFileName, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR* lpFilePart);
extern void __cdecl _wsplitpath(wchar_t const* _FullPath, wchar_t* _Drive, wchar_t* _Dir, wchar_t* _Filename, wchar_t* _Ext);
#define _tsplitpath _wsplitpath
#define _tcschr wcschr
extern LPWSTR WINAPI lstrcpyn(LPWSTR lpString1, LPCWSTR lpString2,int iMaxLength);
extern LPWSTR WINAPI lstrcat(LPWSTR lpString1, LPCWSTR lpString2);
#define _tmakepath _wmakepath
extern void _wmakepath(wchar_t _Buffer, wchar_t const* _Drive, wchar_t const* _Dir, wchar_t const* _Filename, wchar_t const* _Ext);
extern BOOL WINAPI GetClientRect(HWND hWnd, LPRECT lpRect);
typedef char *PSZ;

View file

@ -1,9 +0,0 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon Nov 12 10:19:12 CET 2018
ndk.dir=C\:\\Users\\cosnier\\AppData\\Local\\Android\\Sdk\\ndk-bundle
sdk.dir=C\:\\Users\\cosnier\\AppData\\Local\\Android\\Sdk