├── include ├── gcr_table.h ├── aipcdefs.h ├── debug.h ├── diskimagedos.h ├── arch │ ├── customthread.h │ ├── CommandLineOption.h │ ├── frame │ │ ├── dlgconfighdd.h │ │ ├── colorbutton.h │ │ ├── aipc.h │ │ ├── dlgconfigdisk.h │ │ ├── dlgconfigmockingboard.h │ │ ├── dlgdebug.h │ │ ├── wcSliderPopup.h │ │ ├── applestatusbar.h │ │ ├── stdafx.h │ │ ├── wcSliderButton.h │ │ └── mainfrm.h │ └── directx │ │ ├── dikeyboard.h │ │ ├── dxsound.h │ │ ├── dimouse.h │ │ ├── dibase.h │ │ └── dijoystick.h ├── scanline.h ├── localclock.h ├── clocklistener.h ├── 6502.h ├── iou.h ├── messageque.h ├── speaker.h ├── diskimagepo.h ├── diskimagenib.h ├── psg.h ├── 65c02.h ├── cpu.h ├── keyboard.h ├── phasor.h ├── mousecard.h ├── diskinterface.h ├── slots.h ├── joystick.h ├── card.h ├── diskdrive.h ├── 6821.h ├── 6522.h ├── 8913.h ├── diskimage.h ├── lockmgr.h ├── hdd.h ├── appleclock.h └── memory.h ├── res ├── aipc.ico ├── hdd.bmp ├── icon1.ico ├── icon2.ico ├── Toolbar.bmp ├── bitmap1.bmp ├── cursor1.cur ├── cursor2.cur ├── diskOff.bmp ├── diskRead.bmp ├── diskWrite.bmp ├── disk_off.bmp ├── disk_rea.bmp ├── disk_wri.bmp ├── key_caps.bmp ├── toolbar1.bmp ├── key_scroll.bmp ├── numlock_off.bmp ├── numlock_on.bmp ├── key_caps_off.bmp ├── key_scroll_off.bmp └── aipc.rc2 ├── src ├── slots.cpp ├── diskdrive.cpp ├── diskimage.cpp ├── diskimagepo.cpp ├── arch │ ├── frame │ │ ├── mainfrm.cpp │ │ ├── screen.cpp │ │ ├── dlgsettingsslot.cpp │ │ ├── dlgconfigmockingboard.cpp │ │ ├── stdafx.cpp │ │ ├── dlgsettingssound.h │ │ ├── dlgsettingsslot.h │ │ ├── dlgsettingsinput.h │ │ ├── dlgsettingsmachine.h │ │ ├── dlgsettings.h │ │ ├── dlgsettingscolor.h │ │ ├── colorbutton.cpp │ │ ├── dlgsettingssound.cpp │ │ ├── dlgsettingsinput.cpp │ │ └── dlgconfighdd.cpp │ └── CommandLineOption.cpp ├── iou.cpp ├── psg.cpp ├── messageque.cpp ├── cpu.cpp ├── card.cpp ├── lockmgr.cpp └── speaker.cpp ├── data ├── APPLE2.ROM └── APPLE2E.ROM ├── dx80 ├── lib │ ├── d3d8.lib │ ├── d3dx.lib │ ├── DSETUP.lib │ ├── d3dx8.lib │ ├── d3dx8d.lib │ ├── d3dxd.lib │ ├── d3dxof.lib │ ├── ddraw.lib │ ├── dinput.lib │ ├── dplayx.lib │ ├── dpnet.lib │ ├── dsound.lib │ ├── dxerr8.lib │ ├── dxguid.lib │ ├── ksuser.lib │ ├── msdmo.lib │ ├── qedit.lib │ ├── quartz.lib │ ├── Script1.aps │ ├── amstrmid.lib │ ├── d3dx8dt.lib │ ├── dinput8.lib │ ├── dmoguids.lib │ ├── dpnaddr.lib │ ├── dpnlobby.lib │ ├── dpvoice.lib │ ├── dxtrans.lib │ ├── ksproxy.lib │ ├── strmiids.lib │ ├── resource.h │ └── Script1.rc └── include │ ├── edevdefs.h │ ├── xprtdefs.h │ ├── d3dx.h │ ├── activecf.h │ ├── mediaerr.h │ ├── ksguid.h │ ├── dmo.h │ ├── DShowIDL │ ├── strmif.idl │ ├── devenum.idl │ ├── dmodshow.idl │ ├── regbag.idl │ ├── dshowasf.idl │ ├── ddstream.idl │ └── austream.idl │ ├── d3dx8.h │ ├── comlite.h │ ├── amparse.h │ ├── atsmedia.h │ ├── d3drmwin.h │ ├── errors.h │ ├── audevcod.h │ ├── dmusbuff.h │ ├── amaudio.h │ ├── dv.h │ ├── dxerr8.h │ ├── vpnotify.h │ ├── dmort.h │ ├── vptype.h │ ├── DShow.h │ ├── dxsdk.inc │ ├── amva.h │ ├── mpegtype.h │ ├── il21dec.h │ └── dmoreg.h ├── .editorconfig ├── LICENSE.txt ├── README.md ├── aipc.sln ├── licenses ├── MAME.txt └── src │ └── ay8910.h └── .gitignore /include/gcr_table.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /res/aipc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/aipc.ico -------------------------------------------------------------------------------- /res/hdd.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/hdd.bmp -------------------------------------------------------------------------------- /res/icon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/icon1.ico -------------------------------------------------------------------------------- /res/icon2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/icon2.ico -------------------------------------------------------------------------------- /src/slots.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/src/slots.cpp -------------------------------------------------------------------------------- /data/APPLE2.ROM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/data/APPLE2.ROM -------------------------------------------------------------------------------- /data/APPLE2E.ROM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/data/APPLE2E.ROM -------------------------------------------------------------------------------- /dx80/lib/d3d8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/d3d8.lib -------------------------------------------------------------------------------- /dx80/lib/d3dx.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/d3dx.lib -------------------------------------------------------------------------------- /res/Toolbar.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/Toolbar.bmp -------------------------------------------------------------------------------- /res/bitmap1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/bitmap1.bmp -------------------------------------------------------------------------------- /res/cursor1.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/cursor1.cur -------------------------------------------------------------------------------- /res/cursor2.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/cursor2.cur -------------------------------------------------------------------------------- /res/diskOff.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/diskOff.bmp -------------------------------------------------------------------------------- /res/diskRead.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/diskRead.bmp -------------------------------------------------------------------------------- /res/diskWrite.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/diskWrite.bmp -------------------------------------------------------------------------------- /res/disk_off.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/disk_off.bmp -------------------------------------------------------------------------------- /res/disk_rea.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/disk_rea.bmp -------------------------------------------------------------------------------- /res/disk_wri.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/disk_wri.bmp -------------------------------------------------------------------------------- /res/key_caps.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/key_caps.bmp -------------------------------------------------------------------------------- /res/toolbar1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/toolbar1.bmp -------------------------------------------------------------------------------- /src/diskdrive.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/src/diskdrive.cpp -------------------------------------------------------------------------------- /src/diskimage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/src/diskimage.cpp -------------------------------------------------------------------------------- /dx80/lib/DSETUP.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/DSETUP.lib -------------------------------------------------------------------------------- /dx80/lib/d3dx8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/d3dx8.lib -------------------------------------------------------------------------------- /dx80/lib/d3dx8d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/d3dx8d.lib -------------------------------------------------------------------------------- /dx80/lib/d3dxd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/d3dxd.lib -------------------------------------------------------------------------------- /dx80/lib/d3dxof.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/d3dxof.lib -------------------------------------------------------------------------------- /dx80/lib/ddraw.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/ddraw.lib -------------------------------------------------------------------------------- /dx80/lib/dinput.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dinput.lib -------------------------------------------------------------------------------- /dx80/lib/dplayx.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dplayx.lib -------------------------------------------------------------------------------- /dx80/lib/dpnet.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dpnet.lib -------------------------------------------------------------------------------- /dx80/lib/dsound.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dsound.lib -------------------------------------------------------------------------------- /dx80/lib/dxerr8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dxerr8.lib -------------------------------------------------------------------------------- /dx80/lib/dxguid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dxguid.lib -------------------------------------------------------------------------------- /dx80/lib/ksuser.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/ksuser.lib -------------------------------------------------------------------------------- /dx80/lib/msdmo.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/msdmo.lib -------------------------------------------------------------------------------- /dx80/lib/qedit.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/qedit.lib -------------------------------------------------------------------------------- /dx80/lib/quartz.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/quartz.lib -------------------------------------------------------------------------------- /include/aipcdefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/include/aipcdefs.h -------------------------------------------------------------------------------- /res/key_scroll.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/key_scroll.bmp -------------------------------------------------------------------------------- /res/numlock_off.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/numlock_off.bmp -------------------------------------------------------------------------------- /res/numlock_on.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/numlock_on.bmp -------------------------------------------------------------------------------- /src/diskimagepo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/src/diskimagepo.cpp -------------------------------------------------------------------------------- /dx80/lib/Script1.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/Script1.aps -------------------------------------------------------------------------------- /dx80/lib/amstrmid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/amstrmid.lib -------------------------------------------------------------------------------- /dx80/lib/d3dx8dt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/d3dx8dt.lib -------------------------------------------------------------------------------- /dx80/lib/dinput8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dinput8.lib -------------------------------------------------------------------------------- /dx80/lib/dmoguids.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dmoguids.lib -------------------------------------------------------------------------------- /dx80/lib/dpnaddr.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dpnaddr.lib -------------------------------------------------------------------------------- /dx80/lib/dpnlobby.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dpnlobby.lib -------------------------------------------------------------------------------- /dx80/lib/dpvoice.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dpvoice.lib -------------------------------------------------------------------------------- /dx80/lib/dxtrans.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/dxtrans.lib -------------------------------------------------------------------------------- /dx80/lib/ksproxy.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/ksproxy.lib -------------------------------------------------------------------------------- /dx80/lib/strmiids.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/lib/strmiids.lib -------------------------------------------------------------------------------- /include/debug.h: -------------------------------------------------------------------------------- 1 | #ifndef DEBUG_H 2 | #define DEBUG_H 3 | 4 | extern BOOL g_debug; 5 | 6 | #endif -------------------------------------------------------------------------------- /include/diskimagedos.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/include/diskimagedos.h -------------------------------------------------------------------------------- /res/key_caps_off.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/key_caps_off.bmp -------------------------------------------------------------------------------- /res/key_scroll_off.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/res/key_scroll_off.bmp -------------------------------------------------------------------------------- /dx80/include/edevdefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/include/edevdefs.h -------------------------------------------------------------------------------- /dx80/include/xprtdefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/dx80/include/xprtdefs.h -------------------------------------------------------------------------------- /include/arch/customthread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/include/arch/customthread.h -------------------------------------------------------------------------------- /src/arch/frame/mainfrm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/src/arch/frame/mainfrm.cpp -------------------------------------------------------------------------------- /src/arch/frame/screen.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/src/arch/frame/screen.cpp -------------------------------------------------------------------------------- /src/arch/frame/dlgsettingsslot.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/src/arch/frame/dlgsettingsslot.cpp -------------------------------------------------------------------------------- /include/scanline.h: -------------------------------------------------------------------------------- 1 | #if !defined(OPTABLE__INCLUDED_) 2 | #define OPTABLE__INCLUDED_ 3 | 4 | static BYTE g_scanLine[192]; 5 | 6 | #endif -------------------------------------------------------------------------------- /src/arch/frame/dlgconfigmockingboard.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sosaria7/appleinpc/HEAD/src/arch/frame/dlgconfigmockingboard.cpp -------------------------------------------------------------------------------- /include/localclock.h: -------------------------------------------------------------------------------- 1 | #if !defined(__LOCALCLOCK__INCLUDED_) 2 | #define __LOCALCLOCK__INCLUDED_ 3 | 4 | 5 | extern BYTE MemReturnRandomData(BYTE highbit); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/arch/frame/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // apple2.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "arch/frame/stdafx.h" 6 | 7 | -------------------------------------------------------------------------------- /include/clocklistener.h: -------------------------------------------------------------------------------- 1 | #ifndef __CLOCKLISTENER_H__ 2 | #define __CLOCKLISTENER_H__ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | 8 | class CClockListener 9 | { 10 | public: 11 | virtual void Clock(unsigned int clock) = 0; 12 | }; 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = crlf 5 | insert_final_newline = true 6 | indent_style = tab 7 | indent_size = 4 8 | charset = utf-8 9 | 10 | # Matches multiple files with brace expansion notation 11 | [*.{js,jsx,html,sass}] 12 | trim_trailing_whitespace = true 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /res/aipc.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // AIPC.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /dx80/lib/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Script1.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 102 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /src/iou.cpp: -------------------------------------------------------------------------------- 1 | // Iou.cpp: implementation of the CIou class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "arch/frame/stdafx.h" 6 | #include "Iou.h" 7 | 8 | ////////////////////////////////////////////////////////////////////// 9 | // Construction/Destruction 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | CIou::CIou() 13 | { 14 | 15 | } 16 | 17 | CIou::~CIou() 18 | { 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | AIPC is open source under GPL and free to use. 2 | 3 | Folloing codes are also licensed under MAME License(2007) 4 | - src/8913.cpp 5 | - src/6821.cpp 6 | 7 | The original source codes are follows: 8 | - licenses/src/ay8910.c 9 | - licenses/src/ay8910.h 10 | - licenses/src/6821pia.c 11 | - licenses/src/6821pia.h 12 | 13 | ================================================================================ 14 | GNU GENERAL PUBLIC LICENSE version 3 15 | - licenses/GPLv3.txt 16 | 17 | MAME LICENSE (2007) 18 | - licenses/MAME.txt 19 | -------------------------------------------------------------------------------- /include/arch/CommandLineOption.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef __COMMAND_LINE_OPTION_H__ 3 | #define __COMMAND_LINE_OPTION_H__ 4 | 5 | #include "arch/frame/stdafx.h" 6 | #include "aipcdefs.h" 7 | 8 | class CCommandLineOption 9 | { 10 | public: 11 | CString m_strDisk1Path; 12 | CString m_strDisk2Path; 13 | CString m_strStatePath; 14 | CString m_strHardDiskPath; 15 | CString m_strErrorMsg; 16 | BOOL m_bSaveOnExit; 17 | BOOL m_bReboot; 18 | 19 | public: 20 | CCommandLineOption(); 21 | ~CCommandLineOption(); 22 | BOOL Parse(CString strCommandLine); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/6502.h: -------------------------------------------------------------------------------- 1 | // 65c02.h: interface for the C65c02 class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #ifndef __6502_H__ 6 | #define __6502_H__ 7 | 8 | #ifndef __AFXWIN_H__ 9 | #error include 'stdafx.h' before including this file for PCH 10 | #endif 11 | 12 | // gloval value 13 | 14 | 15 | #include "cpu.h" 16 | #include "65c02.h" 17 | 18 | class C6502 : public C65c02 19 | { 20 | public: 21 | C6502(); 22 | virtual ~C6502(); 23 | 24 | int Process(); 25 | void Serialize(CArchive &archive); 26 | 27 | protected: 28 | 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/iou.h: -------------------------------------------------------------------------------- 1 | // Iou.h: interface for the CIou class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_IOU_H__5014797B_2A4B_4AAB_A519_35C564856FCC__INCLUDED_) 6 | #define AFX_IOU_H__5014797B_2A4B_4AAB_A519_35C564856FCC__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CIou : public CObject 13 | { 14 | public: 15 | virtual void WriteMem16(int nAddr, WORD wData) = NULL; 16 | virtual WORD ReadMem16(int nAddr) = NULL; 17 | CIou(); 18 | virtual ~CIou(); 19 | }; 20 | 21 | #endif // !defined(AFX_IOU_H__5014797B_2A4B_4AAB_A519_35C564856FCC__INCLUDED_) 22 | -------------------------------------------------------------------------------- /dx80/include/d3dx.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx.h 6 | // Content: D3DX utility library 7 | // 8 | /////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef __D3DX_H__ 11 | #define __D3DX_H__ 12 | 13 | #ifndef D3DXINLINE 14 | #ifdef __cplusplus 15 | #define D3DXINLINE inline 16 | #else 17 | #define D3DXINLINE _inline 18 | #endif 19 | #endif 20 | 21 | #include "d3dxcore.h" 22 | #include "d3dxmath.h" 23 | #include "d3dxshapes.h" 24 | #include "d3dxsprite.h" 25 | 26 | #endif //__D3DX_H__ 27 | -------------------------------------------------------------------------------- /dx80/include/activecf.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: ActiveCf.h 3 | // 4 | // Desc: Contains the data formats for the transfer of VfW4 filters via the 5 | // clipboard. 6 | // 7 | // Copyright (c) 1992 - 2000, Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #define CFSTR_VFW_FILTERLIST "Video for Windows 4 Filters" 12 | 13 | typedef struct tagVFW_FILTERLIST{ 14 | UINT cFilters; // number of CLSIDs in aClsId 15 | CLSID aClsId[1]; // ClsId of each filter 16 | } VFW_FILTERLIST; 17 | 18 | 19 | -------------------------------------------------------------------------------- /dx80/include/mediaerr.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: MediaErr.h 3 | // 4 | // Desc: Shell error codes 5 | // 6 | // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef _MEDIAERR_H_ 11 | #define _MEDIAERR_H_ 12 | 13 | #define DMO_E_INVALIDSTREAMINDEX 0x80040201 14 | #define DMO_E_INVALIDTYPE 0x80040202 15 | #define DMO_E_TYPE_NOT_SET 0x80040203 16 | #define DMO_E_NOTACCEPTING 0x80040204 17 | #define DMO_E_TYPE_NOT_ACCEPTED 0x80040205 18 | #define DMO_E_NO_MORE_ITEMS 0x80040206 19 | 20 | #endif _MEDIAERR_H_ 21 | -------------------------------------------------------------------------------- /dx80/include/ksguid.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) Microsoft Corporation, 1996 - 1999 4 | 5 | Module Name: 6 | 7 | ksguid.h 8 | 9 | Abstract: 10 | 11 | Define guids for non-C++. 12 | 13 | --*/ 14 | 15 | #define INITGUID 16 | #include 17 | 18 | #if defined( DEFINE_GUIDEX ) 19 | #undef DEFINE_GUIDEX 20 | #endif 21 | #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID __declspec(selectany) name = { STATICGUIDOF(name) } 22 | 23 | #ifndef STATICGUIDOF 24 | #define STATICGUIDOF(guid) STATIC_##guid 25 | #endif // !defined(STATICGUIDOF) 26 | 27 | #if !defined( DEFINE_WAVEFORMATEX_GUID ) 28 | #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 29 | #endif 30 | -------------------------------------------------------------------------------- /include/messageque.h: -------------------------------------------------------------------------------- 1 | // MessageQue.h: interface for the CMessageQue class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MESSAGEQUE_H__8822C252_ACB9_45B2_9000_8D91AE55DE8E__INCLUDED_) 6 | #define AFX_MESSAGEQUE_H__8822C252_ACB9_45B2_9000_8D91AE55DE8E__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CMessageQue 13 | { 14 | public: 15 | void ClearQueue(); 16 | int GetMesg(); 17 | void AddMessage(int message); 18 | int Size(); 19 | CMessageQue(); 20 | virtual ~CMessageQue(); 21 | 22 | protected: 23 | BYTE m_byteTail; 24 | BYTE m_byteHead; 25 | int m_anQueue[256]; 26 | }; 27 | 28 | #endif // !defined(AFX_MESSAGEQUE_H__8822C252_ACB9_45B2_9000_8D91AE55DE8E__INCLUDED_) 29 | -------------------------------------------------------------------------------- /dx80/include/dmo.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DMO.h 3 | // 4 | // Desc: Headers needed by almost all DMOs. 5 | // 6 | // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __DMO_H__ 11 | #define __DMO_H__ 12 | 13 | 14 | #include "mediaerr.h" 15 | 16 | // When using ATL we get collisions on Lock so in this case rename 17 | // IMediaObject::Lock to IMediaObject::DMOLock 18 | 19 | #ifdef FIX_LOCK_NAME 20 | #define Lock DMOLock 21 | #endif 22 | #include "mediaobj.h" 23 | #ifdef FIX_LOCK_NAME 24 | #undef Lock 25 | #endif 26 | #include "dmoreg.h" 27 | #include "dmort.h" 28 | 29 | #endif //__DMO_H__ 30 | -------------------------------------------------------------------------------- /include/speaker.h: -------------------------------------------------------------------------------- 1 | // Speaker.h: interface for the CSpeaker class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_SPEAKER_H__0EF0E8FA_253C_42CF_A9E4_12FD5313C4B5__INCLUDED_) 6 | #define AFX_SPEAKER_H__0EF0E8FA_253C_42CF_A9E4_12FD5313C4B5__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "psg.h" 13 | 14 | class CSpeaker : public CPSG 15 | { 16 | public: 17 | void ChangeSampleRate(); 18 | void Toggle(); 19 | void Update(int length); 20 | CSpeaker(); 21 | virtual ~CSpeaker(); 22 | 23 | protected: 24 | BOOL m_bToggle; 25 | int m_iLastUpdatePos; 26 | DWORD m_dwLastAppleClock; 27 | int m_iUpdateStep; 28 | }; 29 | 30 | #endif // !defined(AFX_SPEAKER_H__0EF0E8FA_253C_42CF_A9E4_12FD5313C4B5__INCLUDED_) 31 | -------------------------------------------------------------------------------- /dx80/include/DShowIDL/strmif.idl: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: StrmIf.idl 3 | // 4 | // Desc: ActiveMovie interface definitions. 5 | // 6 | // Copyright (c) 1992 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | import "unknwn.idl"; 11 | import "objidl.idl"; // for IPersist (IFilter's root) 12 | 13 | #include "devenum.idl" 14 | 15 | // core interfaces 16 | #include "axcore.idl" 17 | 18 | // extended, ActiveMovie-only interfaces 19 | #include "axextend.idl" 20 | 21 | // ActiveMovie-only sample plug-in distributor interface 22 | #include "IAMovie.idl" 23 | 24 | // application interfaces for DVD 25 | #include "dvdif.idl" 26 | 27 | // Dynamic graph stuff 28 | #include "dyngraph.idl" 29 | -------------------------------------------------------------------------------- /dx80/include/d3dx8.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx8.h 6 | // Content: D3DX utility library 7 | // 8 | /////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef __D3DX8_H__ 11 | #define __D3DX8_H__ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef D3DXINLINE 17 | #ifdef __cplusplus 18 | #define D3DXINLINE inline 19 | #else 20 | #define D3DXINLINE _inline 21 | #endif 22 | #endif 23 | 24 | #define D3DX_DEFAULT ULONG_MAX 25 | #define D3DX_DEFAULT_FLOAT FLT_MAX 26 | 27 | #include "d3dx8math.h" 28 | #include "d3dx8core.h" 29 | #include "d3dx8tex.h" 30 | #include "d3dx8mesh.h" 31 | #include "d3dx8shape.h" 32 | #include "d3dx8effect.h" 33 | 34 | 35 | #endif //__D3DX8_H__ 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apple in PC 2 | 3 | AIPC(Apple in PC) is an Apple //e computer emulator for Windows. 4 | 5 | AIPC is open source under GPL and free to use. 6 | 7 | Features include: 8 | - Emulates Apple //e enhanced computer 9 | - Mockingboard and/or PHASOR card support 10 | - Mouse Interface card support 11 | - Disk II card with disk image (DSK, DO, PO, NIB, 2MG images supported) 12 | - Mass storage (HDV, 2MG images supported) 13 | - Joystick with NumPad or PC Joystick 14 | - Various screen mode: Full screen, 2x mode, Scan line, Color/Mono/Green/Custom colors 15 | - NTSC color approximation 16 | - Save and restore running status 17 | 18 | Source download: 19 | https://github.com/sosaria7/appleinpc 20 | 21 | Latest release: 22 | https://github.com/sosaria7/appleinpc/releases/latest 23 | 24 | Screen shots: 25 | https://github.com/sosaria7/appleinpc/wiki/Apple-in-PC---Screen-Shot 26 | -------------------------------------------------------------------------------- /src/arch/frame/dlgsettingssound.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxcmn.h" 3 | 4 | 5 | // CDlgSettingsSound dialog 6 | 7 | class CDlgSettingsSound : public CDialogEx 8 | { 9 | DECLARE_DYNAMIC(CDlgSettingsSound) 10 | 11 | public: 12 | CDlgSettingsSound(CWnd* pParent = NULL); // standard constructor 13 | virtual ~CDlgSettingsSound(); 14 | 15 | // Dialog Data 16 | #ifdef AFX_DESIGN_TIME 17 | enum { IDD = IDD_SETTINGS_SOUND }; 18 | #endif 19 | 20 | protected: 21 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 22 | 23 | DECLARE_MESSAGE_MAP() 24 | public: 25 | CSliderCtrl m_cBalance; 26 | CSliderCtrl m_cVolume; 27 | CSliderCtrl m_cSpeakerVolume; 28 | BOOL m_bMute; 29 | BOOL m_bSpeakerMute; 30 | afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); 31 | virtual void OnOK(); 32 | virtual void OnCancel(); 33 | virtual BOOL OnInitDialog(); 34 | virtual BOOL PreTranslateMessage(MSG* pMsg); 35 | }; 36 | -------------------------------------------------------------------------------- /src/arch/frame/dlgsettingsslot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | #include "card.h" 4 | 5 | // CDlgSettingsSlot dialog 6 | 7 | class CDlgSettingsSlot : public CDialogEx 8 | { 9 | DECLARE_DYNAMIC(CDlgSettingsSlot) 10 | 11 | public: 12 | CDlgSettingsSlot(CWnd* pParent = NULL); // standard constructor 13 | virtual ~CDlgSettingsSlot(); 14 | 15 | // Dialog Data 16 | #ifdef AFX_DESIGN_TIME 17 | enum { IDD = IDD_SETTINGS_SLOT }; 18 | #endif 19 | 20 | protected: 21 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 22 | 23 | DECLARE_MESSAGE_MAP() 24 | public: 25 | CComboBox m_acSlots[7]; 26 | CButton m_acSetupCard[7]; 27 | CCard* m_pCards[7]; 28 | afx_msg void OnSelchangeSlot(UINT uId); 29 | afx_msg void OnClickedSlotSetup(UINT uId); 30 | int DeviceNameToDeviceID(CString strDeviceName); 31 | virtual BOOL OnInitDialog(); 32 | virtual void OnOK(); 33 | virtual void OnCancel(); 34 | virtual BOOL PreTranslateMessage(MSG* pMsg); 35 | }; 36 | -------------------------------------------------------------------------------- /include/diskimagepo.h: -------------------------------------------------------------------------------- 1 | // diskimagepo.h: interface for the CDiskImagePo class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DISKIMAGEPO_H__44FA5C8E_4106_4349_8249_25F81157F9FD__INCLUDED_) 6 | #define AFX_DISKIMAGEPO_H__44FA5C8E_4106_4349_8249_25F81157F9FD__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "diskimagedos.h" 13 | #include "aipcdefs.h" 14 | /* PO logical order 0 E D C B A 9 8 7 6 5 4 3 2 1 F */ 15 | /* physical order 0 2 4 6 8 A C E 1 3 5 7 9 B D F */ 16 | 17 | class CDiskImagePo : public CDiskImageDos 18 | { 19 | public: 20 | virtual int GetId(){ return IMAGE_PRODOS; } 21 | CDiskImagePo(); 22 | virtual ~CDiskImagePo(); 23 | static BOOL IsMyType(int hFile); 24 | static BOOL IsMyExtension(const char* szExt) { return IsMatch("po", szExt); } 25 | }; 26 | 27 | #endif // !defined(AFX_DISKIMAGEPO_H__44FA5C8E_4106_4349_8249_25F81157F9FD__INCLUDED_) 28 | -------------------------------------------------------------------------------- /aipc.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aipc", "aipc.vcxproj", "{8B73EEA9-AEEE-40F6-A6BA-2EBB5EC18120}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {8B73EEA9-AEEE-40F6-A6BA-2EBB5EC18120}.Debug|x86.ActiveCfg = Debug|Win32 15 | {8B73EEA9-AEEE-40F6-A6BA-2EBB5EC18120}.Debug|x86.Build.0 = Debug|Win32 16 | {8B73EEA9-AEEE-40F6-A6BA-2EBB5EC18120}.Release|x86.ActiveCfg = Release|Win32 17 | {8B73EEA9-AEEE-40F6-A6BA-2EBB5EC18120}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /include/diskimagenib.h: -------------------------------------------------------------------------------- 1 | // diskimagenib.h: interface for the CDiskImageNib class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #ifndef __DISKIMAGENIB_H 6 | #define __DISKIMAGENIB_H 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "diskimagedos.h" 13 | #include "aipcdefs.h" 14 | /* PO logical order 0 E D C B A 9 8 7 6 5 4 3 2 1 F */ 15 | /* physical order 0 2 4 6 8 A C E 1 3 5 7 9 B D F */ 16 | 17 | class CDiskImageNib : public CDiskImage 18 | { 19 | public: 20 | virtual int GetId(){ return IMAGE_NIBBLE; } 21 | CDiskImageNib(); 22 | virtual ~CDiskImageNib(); 23 | static BOOL IsMyType(int hFile); 24 | static BOOL IsMyExtension(const char* szExt) { return IsMatch("nib", szExt); } 25 | protected: 26 | static BOOL CheckImage(int hFile); 27 | virtual BOOL ReadBuffer(); 28 | virtual void SaveBuffer(); 29 | virtual BOOL InitImage(); 30 | 31 | protected: 32 | BOOL StoreData(BYTE* pbyData); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/psg.h: -------------------------------------------------------------------------------- 1 | // PSG.h: interface for the CPSG class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_PSG_H__EBB84D23_6A7F_42E7_89EB_3528943030D0__INCLUDED_) 6 | #define AFX_PSG_H__EBB84D23_6A7F_42E7_89EB_3528943030D0__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CPSG : public CObject 13 | { 14 | public: 15 | virtual long GetPulse(){ return 0; }; 16 | CPSG(); 17 | virtual ~CPSG(); 18 | virtual void Update(int length){ }; 19 | virtual void ChangeSampleRate(){ }; 20 | virtual void SetVolume( int iVol ) 21 | { 22 | if ( iVol > 31 ) 23 | iVol = 31; 24 | if ( iVol < 0 ) 25 | iVol = 0; 26 | m_iVol = iVol; 27 | } 28 | virtual void Serialize( CArchive &ar ); 29 | 30 | WORD m_awVolume[32]; 31 | 32 | public: 33 | BOOL m_bMute; 34 | WORD **m_lpwBuf; 35 | int m_iVol; 36 | unsigned int m_nNumOfBuf; 37 | }; 38 | 39 | #endif // !defined(AFX_PSG_H__EBB84D23_6A7F_42E7_89EB_3528943030D0__INCLUDED_) 40 | -------------------------------------------------------------------------------- /dx80/include/comlite.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: COMLite.h 3 | // 4 | // Desc: This header file is to provide a migration path for users of 5 | // ActiveMovie betas 1 and 2. 6 | // 7 | // Copyright (c) 1992 - 2000, Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #ifndef _INC_COMLITE_ 12 | #define _INC_COMLITE_ 13 | 14 | #define QzInitialize CoInitialize 15 | #define QzUninitialize CoUninitialize 16 | #define QzFreeUnusedLibraries CoFreeUnusedLibraries 17 | 18 | #define QzGetMalloc CoGetMalloc 19 | #define QzTaskMemAlloc CoTaskMemAlloc 20 | #define QzTaskMemRealloc CoTaskMemRealloc 21 | #define QzTaskMemFree CoTaskMemFree 22 | #define QzCreateFilterObject CoCreateInstance 23 | #define QzCLSIDFromString CLSIDFromString 24 | #define QzStringFromGUID2 StringFromGUID2 25 | 26 | #endif // _INC_COMLITE_ 27 | -------------------------------------------------------------------------------- /src/arch/frame/dlgsettingsinput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "arch/frame/wcsliderbutton.h" 4 | #include "afxwin.h" 5 | 6 | // CDlgSettingsInput dialog 7 | 8 | class CDlgSettingsInput : public CDialogEx 9 | { 10 | DECLARE_DYNAMIC(CDlgSettingsInput) 11 | 12 | public: 13 | CDlgSettingsInput(CWnd* pParent = NULL); // standard constructor 14 | virtual ~CDlgSettingsInput(); 15 | 16 | // Dialog Data 17 | #ifdef AFX_DESIGN_TIME 18 | enum { IDD = IDD_SETTINGS_INPUT }; 19 | #endif 20 | 21 | protected: 22 | static const int m_anDeadZoneList[]; 23 | static const int m_anSaturationList[]; 24 | 25 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 26 | 27 | DECLARE_MESSAGE_MAP() 28 | 29 | public: 30 | wcSliderButton m_cKeyDelay; 31 | wcSliderButton m_cKeyRepeat; 32 | CComboBox m_cJoyDead; 33 | CComboBox m_cJoySat; 34 | BOOL m_bArrowAsPaddle; 35 | BOOL m_bSwapButtons; 36 | 37 | virtual void OnOK(); 38 | virtual void OnCancel(); 39 | 40 | virtual BOOL OnInitDialog(); 41 | 42 | virtual BOOL PreTranslateMessage(MSG* pMsg); 43 | }; 44 | -------------------------------------------------------------------------------- /src/psg.cpp: -------------------------------------------------------------------------------- 1 | // PSG.cpp: implementation of the CPSG class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "arch/frame/stdafx.h" 6 | #include "psg.h" 7 | 8 | ////////////////////////////////////////////////////////////////////// 9 | // Construction/Destruction 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | #define MAX_AMPLITUDE 0x7FFF; 13 | CPSG::CPSG() 14 | { 15 | m_bMute = FALSE; 16 | m_iVol = 32; 17 | m_lpwBuf = NULL; 18 | m_nNumOfBuf = 0; 19 | 20 | int i; 21 | double out; 22 | out = MAX_AMPLITUDE; 23 | // reduce amplitude by 1.5 db 24 | for (i = 31; i > 0; i--) 25 | { 26 | m_awVolume[i] = (WORD)(out + 0.5); /* round to nearest */ 27 | 28 | out /= 1.148153621; /* = 10 ^ (.6/10) = 0.6dB */ 29 | } 30 | m_awVolume[0] = 0; 31 | } 32 | 33 | CPSG::~CPSG() 34 | { 35 | 36 | } 37 | 38 | void CPSG::Serialize( CArchive &ar ) 39 | { 40 | CObject::Serialize( ar ); 41 | 42 | if ( ar.IsStoring() ) 43 | { 44 | ar << m_bMute; 45 | ar << m_iVol; 46 | } 47 | else 48 | { 49 | ar >> m_bMute; 50 | ar >> m_iVol; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /dx80/include/DShowIDL/devenum.idl: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DevEnum.idl 3 | // 4 | // Desc: IDL source for devenum.dll. This file will be processed by the 5 | // MIDL tool to produce the type library (devenum.tlb) and marshalling 6 | // code. 7 | // 8 | // Copyright (c) 1998 - 2000, Microsoft Corporation. All rights reserved. 9 | //------------------------------------------------------------------------------ 10 | 11 | 12 | cpp_quote("#define CDEF_CLASS_DEFAULT 0x0001") 13 | cpp_quote("#define CDEF_BYPASS_CLASS_MANAGER 0x0002") 14 | //cpp_quote("#define CDEF_CLASS_LEGACY 0x0004") 15 | cpp_quote("#define CDEF_MERIT_ABOVE_DO_NOT_USE 0x0008") 16 | 17 | [ 18 | object, 19 | uuid(29840822-5B84-11D0-BD3B-00A0C911CE86), 20 | pointer_default(unique) 21 | ] 22 | interface ICreateDevEnum : IUnknown 23 | { 24 | import "oaidl.idl"; 25 | 26 | HRESULT CreateClassEnumerator( 27 | [in] REFCLSID clsidDeviceClass, 28 | [out] IEnumMoniker ** ppEnumMoniker, 29 | [in] DWORD dwFlags); 30 | } 31 | -------------------------------------------------------------------------------- /include/65c02.h: -------------------------------------------------------------------------------- 1 | // 65c02.h: interface for the C65c02 class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #ifndef __65C02_H__ 6 | #define __65C02_H__ 7 | 8 | #ifndef __AFXWIN_H__ 9 | #error include 'stdafx.h' before including this file for PCH 10 | #endif 11 | 12 | // gloval value 13 | 14 | 15 | #include "cpu.h" 16 | 17 | 18 | class C65c02 : public CCpu 19 | { 20 | public: 21 | BOOL m_initialized; 22 | 23 | C65c02(); 24 | virtual ~C65c02(); 25 | 26 | void init_6502(); 27 | void init_optable(); 28 | WORD getRegPC(void); 29 | 30 | // overrided from CCpu 31 | int Process(); 32 | void Reset(); 33 | 34 | void Serialize(CArchive &archive); 35 | 36 | public: 37 | 38 | BYTE m_regX; // 6502 X register 39 | BYTE m_regY; // 6502 Y register 40 | BYTE m_regA; // 6502 A register 41 | BYTE m_regF; // 6502 flags 42 | BYTE m_regS; // 6502 Stack pointer 43 | WORD m_BCD_Table1[512]; 44 | WORD m_BCD_Table2[512]; 45 | protected: 46 | int m_nClock; 47 | 48 | protected: 49 | #ifdef _DEBUG 50 | BYTE m_current; 51 | WORD m_trace[256]; 52 | #endif 53 | WORD m_regPC; // 6502 Program Counter 54 | 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/messageque.cpp: -------------------------------------------------------------------------------- 1 | // MessageQue.cpp: implementation of the CMessageQue class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "arch/frame/stdafx.h" 6 | #include "arch/frame/aipc.h" 7 | #include "messageque.h" 8 | 9 | #ifdef _DEBUG 10 | #undef THIS_FILE 11 | static char THIS_FILE[]=__FILE__; 12 | #define new DEBUG_NEW 13 | #endif 14 | 15 | ////////////////////////////////////////////////////////////////////// 16 | // Construction/Destruction 17 | ////////////////////////////////////////////////////////////////////// 18 | 19 | CMessageQue::CMessageQue() 20 | { 21 | m_byteHead=0; 22 | m_byteTail=0; 23 | } 24 | 25 | CMessageQue::~CMessageQue() 26 | { 27 | 28 | } 29 | 30 | void CMessageQue::AddMessage(int message) 31 | { 32 | if(m_byteTail==(BYTE)(m_byteHead-1)) 33 | return; 34 | m_anQueue[m_byteTail++] = message; 35 | } 36 | 37 | int CMessageQue::GetMesg() 38 | { 39 | if(m_byteTail==m_byteHead) 40 | return 0; 41 | return m_anQueue[m_byteHead++]; 42 | } 43 | 44 | void CMessageQue::ClearQueue() 45 | { 46 | m_byteHead = m_byteTail; 47 | } 48 | 49 | int CMessageQue::Size() 50 | { 51 | return (int)(BYTE)(m_byteTail - m_byteHead); 52 | } -------------------------------------------------------------------------------- /dx80/include/amparse.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AMParse.h 3 | // 4 | // Desc: Interface to the parser to get current time. This is useful for 5 | // multifile playback. 6 | // 7 | // Copyright (c) 1996 - 2000, Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #ifndef __AMPARSE__ 12 | #define __AMPARSE__ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif // __cplusplus 17 | 18 | 19 | DEFINE_GUID(IID_IAMParse, 20 | 0xc47a3420, 0x005c, 0x11d2, 0x90, 0x38, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x98); 21 | 22 | // 23 | // Parser interface - supported by MPEG-2 splitter filter 24 | // 25 | DECLARE_INTERFACE_(IAMParse, IUnknown) { 26 | STDMETHOD(GetParseTime) (THIS_ 27 | REFERENCE_TIME *prtCurrent 28 | ) PURE; 29 | STDMETHOD(SetParseTime) (THIS_ 30 | REFERENCE_TIME rtCurrent 31 | ) PURE; 32 | STDMETHOD(Flush) (THIS) PURE; 33 | }; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif // __cplusplus 38 | #endif // __AMPARSE__ 39 | -------------------------------------------------------------------------------- /dx80/include/atsmedia.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: ATSMedia.h 3 | // 4 | // Desc: Broadcast Driver Architecture Media Definitions for ATSC 5 | // 6 | // Copyright (c) 1996 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #if !defined(_KSMEDIA_) 11 | #error KSMEDIA.H must be included before BDAMEDIA.H 12 | #endif // !defined(_KSMEDIA_) 13 | 14 | #if !defined(_BDAMEDIA_) 15 | #error BDAMEDIA.H must be included before ATSCMEDIA.H 16 | #endif // !defined(_KSMEDIA_) 17 | 18 | #if !defined(_ATSCMEDIA_) 19 | #define _ATSCMEDIA_ 20 | 21 | 22 | //=========================================================================== 23 | // 24 | // ATSC Network Type 25 | // 26 | //=========================================================================== 27 | 28 | #define STATIC_BDANETWORKTYPE_ATSC\ 29 | 0x71985f51, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 30 | DEFINE_GUIDSTRUCT("71985F51-1CA1-11d3-9CC8-00C04F7971E0", BDANETWORKTYPE_ATSC); 31 | #define BDANETWORKTYPE_ATSC DEFINE_GUIDNAMED(BDANETWORKTYPE_ATSC) 32 | 33 | 34 | #endif // _ATSCMEDIA_ 35 | -------------------------------------------------------------------------------- /dx80/include/DShowIDL/dmodshow.idl: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DMODShow.idl 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | import "unknwn.idl"; 11 | import "objidl.idl"; 12 | import "mediaobj.idl"; 13 | 14 | // 94297043-bd82-4dfd-b0de-8177739c6d20 15 | cpp_quote("DEFINE_GUID(CLSID_DMOWrapperFilter, 0x94297043,0xbd82,0x4dfd,0xb0,0xde,0x81,0x77,0x73,0x9c,0x6d,0x20);") 16 | // bcd5796c-bd52-4d30-ab76-70f975b89199 17 | cpp_quote("DEFINE_GUID(CLSID_DMOFilterCategory,0xbcd5796c,0xbd52,0x4d30,0xab,0x76,0x70,0xf9,0x75,0xb8,0x91,0x99);") 18 | 19 | 20 | [ 21 | object, 22 | uuid(52d6f586-9f0f-4824-8fc8-e32ca04930c2), 23 | ] 24 | interface IDMOWrapperFilter : IUnknown 25 | { 26 | // Init is passed in the clsid (so it can call CoCreateInstance) 27 | // and the catgory under which the DMO lives 28 | // Note that catDMO can be CLSID_NULL in which case no special 29 | // category-specific processing will be invoked in the wrapper filter 30 | HRESULT Init(REFCLSID clsidDMO, REFCLSID catDMO); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /include/cpu.h: -------------------------------------------------------------------------------- 1 | // Cpu.h: interface for the CCpu class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_CPU_H__4143AA29_8CA5_4EBB_9EDB_87147331C999__INCLUDED_) 6 | #define AFX_CPU_H__4143AA29_8CA5_4EBB_9EDB_87147331C999__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "clocklistener.h" 13 | 14 | #define SIG_CPU_SHUTDOWN (1<<0) 15 | #define SIG_CPU_RES (1<<1) 16 | #define SIG_CPU_NMI (1<<2) 17 | #define SIG_CPU_IRQ (1<<3) 18 | #define SIG_CPU_WAIT (1<<4) 19 | 20 | CALLBACK_HANDLER(Clock); 21 | 22 | class CCpu : public CObject 23 | { 24 | public: 25 | CCpu(); 26 | virtual ~CCpu(); 27 | virtual void Assert_NMI(); 28 | virtual void Assert_IRQ(); 29 | virtual void Shutdown(); 30 | virtual void Reset(); 31 | virtual void Wait(); 32 | virtual int Process() = NULL; 33 | 34 | virtual void Serialize( CArchive& ar ); 35 | void setClockListener(CClockListener* clockListener) { m_clockListener = clockListener; }; 36 | 37 | unsigned m_uException_Register; 38 | protected: 39 | int PendingIRQ; 40 | CClockListener* m_clockListener; 41 | }; 42 | 43 | #endif // !defined(AFX_CPU_H__4143AA29_8CA5_4EBB_9EDB_87147331C999__INCLUDED_) 44 | -------------------------------------------------------------------------------- /src/arch/frame/dlgsettingsmachine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | 4 | 5 | // CDlgSettingsMachine dialog 6 | 7 | class CDlgSettingsMachine : public CDialogEx 8 | { 9 | DECLARE_DYNAMIC(CDlgSettingsMachine) 10 | 11 | public: 12 | CDlgSettingsMachine(CWnd* pParent = NULL); // standard constructor 13 | virtual ~CDlgSettingsMachine(); 14 | 15 | // Dialog Data 16 | #ifdef AFX_DESIGN_TIME 17 | enum { IDD = IDD_SETTINGS_MACHINE }; 18 | #endif 19 | 20 | protected: 21 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 22 | 23 | DECLARE_MESSAGE_MAP() 24 | 25 | public: 26 | virtual void OnOK(); 27 | virtual void OnCancel(); 28 | CButton m_cMachineA2p; 29 | CButton m_cMachineA2e; 30 | CButton m_cMachineNTSC; 31 | CButton m_cMachinePAL; 32 | virtual BOOL OnInitDialog(); 33 | virtual BOOL PreTranslateMessage(MSG* pMsg); 34 | protected: 35 | CEdit m_cSateFilename; 36 | CString m_strStateFileName; 37 | public: 38 | void SetFileName(CEdit *edit, CString path); 39 | afx_msg void OnClickedStateLoad(); 40 | afx_msg void OnClickedStateSave(); 41 | afx_msg void OnClickedStateBrowse(); 42 | afx_msg void OnSetfocusStateFilename(); 43 | afx_msg void OnKillfocusStateFilename(); 44 | BOOL m_bSaveStateOnExit; 45 | }; 46 | -------------------------------------------------------------------------------- /include/arch/frame/dlgconfighdd.h: -------------------------------------------------------------------------------- 1 | #if !defined(__DLG_CONFIG_HDD_H__) 2 | #define __DLG_CONFIG_HDD_H__ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // dlgconfighdd.h : header file 8 | // 9 | 10 | #include "hdd.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // CDlgConfigHDD dialog 14 | 15 | class CDlgConfigHDD : public CDialog 16 | { 17 | // Construction 18 | public: 19 | CDlgConfigHDD(CHDDInterface* pInterface, CWnd* pParent =NULL); // standard constructor 20 | 21 | // Dialog Data 22 | enum { IDD = IDD_CONFIGURE_HDD }; 23 | CButton m_btnEnableDisk1; 24 | CButton m_btnBrowseDisk1; 25 | CString m_strDisk1Image; 26 | 27 | 28 | // Overrides 29 | protected: 30 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 31 | 32 | // Implementation 33 | protected: 34 | CHDDInterface* m_pInterface; 35 | 36 | virtual BOOL OnInitDialog(); 37 | afx_msg void OnBtnBrowse1(); 38 | afx_msg void OnChkDisk1(); 39 | virtual void OnOK(); 40 | 41 | DECLARE_MESSAGE_MAP() 42 | 43 | public: 44 | CEdit m_cDisk1Path; 45 | afx_msg void OnSetfocusEditFilename(); 46 | afx_msg void OnKillfocusEditFilename(); 47 | void SetFileName(CEdit *edit, CString path); 48 | }; 49 | 50 | #endif -------------------------------------------------------------------------------- /dx80/include/d3drmwin.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. 4 | * 5 | * File: d3drm.h 6 | * Content: Direct3DRM include file 7 | * 8 | ***************************************************************************/ 9 | 10 | #ifndef __D3DRMWIN_H__ 11 | #define __D3DRMWIN_H__ 12 | 13 | #ifndef WIN32 14 | #define WIN32 15 | #endif 16 | 17 | #include "d3drm.h" 18 | 19 | #include "ddraw.h" 20 | #include "d3d.h" 21 | 22 | /* 23 | * GUIDS used by Direct3DRM Windows interface 24 | */ 25 | DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); 26 | 27 | WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE); 28 | 29 | #undef INTERFACE 30 | #define INTERFACE IDirect3DRMWinDevice 31 | 32 | DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject) 33 | { 34 | IUNKNOWN_METHODS(PURE); 35 | IDIRECT3DRMOBJECT_METHODS(PURE); 36 | 37 | /* 38 | * IDirect3DRMWinDevice methods 39 | */ 40 | 41 | /* Repaint the window with the last frame which was rendered. */ 42 | STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE; 43 | 44 | /* Respond to a WM_ACTIVATE message. */ 45 | STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE; 46 | }; 47 | 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /include/keyboard.h: -------------------------------------------------------------------------------- 1 | // Keyboard.h: interface for the CKeyboard class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_KEYBOARD_H__BEC02B80_AC5F_4DC7_84B1_3D4CA5BA58C3__INCLUDED_) 6 | #define AFX_KEYBOARD_H__BEC02B80_AC5F_4DC7_84B1_3D4CA5BA58C3__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | //#include "appleclock.h" 13 | class CAppleClock; 14 | 15 | class CKeyboard 16 | { 17 | public: 18 | static void EnableNumKey(BOOL enable); 19 | BYTE AppleKeyRead(BYTE addr); 20 | void AppleKeyWrite(BYTE addr, BYTE data); 21 | void OnKeyDown(WPARAM wParam, LPARAM lParam); 22 | void SetCapsLock(BOOL bCaps); 23 | void SetScrollLock(BOOL bScroll); 24 | void SetNumLock(BOOL bNumLock); 25 | BOOL GetScrollLock() { return m_bScroll; } 26 | BOOL GetCapsLock() { return m_bCaps; } 27 | BOOL GetNumLock() { return m_bNumLock; } 28 | void Clock(DWORD clock); 29 | void SetAutoKeyData(char* pszAutoKeyData); 30 | BOOL IsOnAutoKeyData(); 31 | CKeyboard(); 32 | virtual ~CKeyboard(); 33 | 34 | protected: 35 | BOOL m_bCaps; 36 | BOOL m_bScroll; 37 | BOOL m_bNumLock; 38 | BYTE m_lastKey; 39 | BYTE m_last; 40 | char* m_pszAutoKeyData; 41 | int m_nAutoKeyOffset; 42 | CCSWrapper m_Lock; 43 | }; 44 | 45 | #endif // !defined(AFX_KEYBOARD_H__BEC02B80_AC5F_4DC7_84B1_3D4CA5BA58C3__INCLUDED_) 46 | -------------------------------------------------------------------------------- /src/arch/frame/dlgsettings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxcmn.h" 3 | #include "afxdialogex.h" 4 | #include "dlgsettingscolor.h" 5 | #include "dlgsettingsinput.h" 6 | #include "dlgsettingsmachine.h" 7 | #include "dlgsettingsslot.h" 8 | #include "dlgsettingssound.h" 9 | 10 | // CDlgSettings dialog 11 | 12 | class CDlgSettings : public CDialogEx 13 | { 14 | DECLARE_DYNAMIC(CDlgSettings) 15 | 16 | public: 17 | CDlgSettings(CWnd* pParent = NULL); // standard constructor 18 | virtual ~CDlgSettings(); 19 | 20 | // Dialog Data 21 | #ifdef AFX_DESIGN_TIME 22 | enum { IDD = IDD_SETTINGS }; 23 | #endif 24 | 25 | protected: 26 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 27 | DECLARE_MESSAGE_MAP() 28 | static const int TAB_COUNT = 5; 29 | 30 | CDialogEx m_cDlgTabs[TAB_COUNT]; 31 | public: 32 | CTabCtrl m_cTabs; 33 | CDlgSettingsColor m_cDlgColor; 34 | CDlgSettingsInput m_cDlgInput; 35 | CDlgSettingsMachine m_cDlgMachine; 36 | CDlgSettingsSlot m_cDlgSlot; 37 | CDlgSettingsSound m_cDlgSound; 38 | 39 | virtual BOOL OnInitDialog(); 40 | afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); 41 | afx_msg void OnSelchangeSettingsTab(NMHDR *pNMHDR, LRESULT *pResult); 42 | 43 | protected: 44 | CRect m_cTabsRect; 45 | void ShowWindowNumber(int nTabNumber); 46 | static int s_nTabSelect; 47 | 48 | virtual void OnOK(); 49 | virtual void OnCancel(); 50 | }; 51 | -------------------------------------------------------------------------------- /src/cpu.cpp: -------------------------------------------------------------------------------- 1 | // Cpu.cpp: implementation of the CCpu class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "arch/frame/stdafx.h" 6 | #include "cpu.h" 7 | #include "appleclock.h" 8 | 9 | extern CAppleClock *g_pBoard; 10 | ////////////////////////////////////////////////////////////////////// 11 | // Construction/Destruction 12 | ////////////////////////////////////////////////////////////////////// 13 | 14 | CCpu::CCpu() 15 | { 16 | m_uException_Register = 0; 17 | PendingIRQ = 0; 18 | m_clockListener = NULL; 19 | } 20 | 21 | CCpu::~CCpu() 22 | { 23 | 24 | } 25 | 26 | void CCpu::Assert_NMI() 27 | { 28 | m_uException_Register |= SIG_CPU_NMI; 29 | } 30 | 31 | void CCpu::Assert_IRQ() 32 | { 33 | m_uException_Register |= SIG_CPU_IRQ; 34 | } 35 | 36 | void CCpu::Reset() 37 | { 38 | m_uException_Register |= SIG_CPU_RES; 39 | } 40 | 41 | void CCpu::Shutdown() 42 | { 43 | m_uException_Register |= SIG_CPU_SHUTDOWN; 44 | } 45 | 46 | void CCpu::Wait() 47 | { 48 | m_uException_Register |= SIG_CPU_WAIT; 49 | } 50 | 51 | void CCpu::Serialize( CArchive &ar ) 52 | { 53 | CObject::Serialize( ar ); 54 | int dummy = 0; 55 | 56 | if ( ar.IsStoring() ) 57 | { 58 | ar << m_uException_Register; 59 | ar << dummy; 60 | ar << dummy; 61 | ar << PendingIRQ; 62 | } 63 | else 64 | { 65 | ar >> m_uException_Register; 66 | ar >> dummy; 67 | ar >> dummy; 68 | ar >> PendingIRQ; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /dx80/include/errors.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: Errors.h 3 | // 4 | // Desc: ActiveMovie error defines. 5 | // 6 | // Copyright (c) 1992 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __ERRORS__ 11 | #define __ERRORS__ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif // __cplusplus 16 | 17 | #ifndef _AMOVIE_ 18 | #define AMOVIEAPI DECLSPEC_IMPORT 19 | #else 20 | #define AMOVIEAPI 21 | #endif 22 | 23 | // codes 0-01ff are reserved for OLE 24 | #define VFW_FIRST_CODE 0x200 25 | #define MAX_ERROR_TEXT_LEN 160 26 | 27 | #include // includes all message definitions 28 | 29 | typedef BOOL (WINAPI* AMGETERRORTEXTPROCA)(HRESULT, char *, DWORD); 30 | typedef BOOL (WINAPI* AMGETERRORTEXTPROCW)(HRESULT, WCHAR *, DWORD); 31 | 32 | AMOVIEAPI DWORD WINAPI AMGetErrorTextA( HRESULT hr , char *pbuffer , DWORD MaxLen); 33 | AMOVIEAPI DWORD WINAPI AMGetErrorTextW( HRESULT hr , WCHAR *pbuffer , DWORD MaxLen); 34 | 35 | 36 | #ifdef UNICODE 37 | #define AMGetErrorText AMGetErrorTextW 38 | typedef AMGETERRORTEXTPROCW AMGETERRORTEXTPROC; 39 | #else 40 | #define AMGetErrorText AMGetErrorTextA 41 | typedef AMGETERRORTEXTPROCA AMGETERRORTEXTPROC; 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif // __cplusplus 47 | #endif // __ERRORS__ 48 | -------------------------------------------------------------------------------- /src/arch/frame/dlgsettingscolor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "arch/frame/colorbutton.h" 4 | #include "arch/frame/wcsliderbutton.h" 5 | 6 | // CDlgSettingsColor dialog 7 | 8 | class CDlgSettingsColor : public CDialogEx 9 | { 10 | DECLARE_DYNAMIC(CDlgSettingsColor) 11 | 12 | public: 13 | CDlgSettingsColor(CWnd* pParent = NULL); // standard constructor 14 | virtual ~CDlgSettingsColor(); 15 | 16 | // Dialog Data 17 | #ifdef AFX_DESIGN_TIME 18 | enum { IDD = IDD_SETTINGS_COLOR }; 19 | #endif 20 | 21 | protected: 22 | unsigned int m_uHSB; 23 | unsigned int m_auColors[16]; 24 | unsigned int m_uMono; 25 | unsigned int m_uGreen; 26 | int m_nMode; 27 | int m_nOrgMode; 28 | BOOL m_bOrgScanline; 29 | 30 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 31 | 32 | DECLARE_MESSAGE_MAP() 33 | 34 | public: 35 | BOOL m_bPreview; 36 | BOOL m_bScanline; 37 | CColorButton m_acColorBtn[16]; 38 | wcSliderButton m_cSaturation; 39 | wcSliderButton m_cBright; 40 | wcSliderButton m_cHue; 41 | 42 | void ApplyColor(); 43 | void ResetScreen(); 44 | 45 | virtual void OnOK(); 46 | virtual void OnCancel(); 47 | virtual BOOL OnInitDialog(); 48 | afx_msg void OnClickedPreview(); 49 | afx_msg void OnClickedScanline(); 50 | afx_msg void OnClickedDefault(); 51 | afx_msg void OnChangeColorMode(UINT uId); 52 | afx_msg void OnColorClicked(UINT uId); 53 | afx_msg void OnChangeHSB(UINT uId); 54 | virtual BOOL PreTranslateMessage(MSG* pMsg); 55 | }; 56 | -------------------------------------------------------------------------------- /include/phasor.h: -------------------------------------------------------------------------------- 1 | // Phasor.h: interface for the CPhasor class. 2 | 3 | // 4 | 5 | ////////////////////////////////////////////////////////////////////// 6 | 7 | 8 | 9 | #if !defined(AFX_PHASOR_H__84DFED54_4C93_4700_9642_F8C00E6EDCAD__INCLUDED_) 10 | 11 | #define AFX_PHASOR_H__84DFED54_4C93_4700_9642_F8C00E6EDCAD__INCLUDED_ 12 | 13 | 14 | 15 | #if _MSC_VER > 1000 16 | 17 | #pragma once 18 | 19 | #endif // _MSC_VER > 1000 20 | 21 | #include "Card.h" 22 | #include "6522.h" 23 | #include "8913.h" 24 | #ifdef HAVE_VOTRAX 25 | #include "votrax.h" 26 | #endif 27 | 28 | class CPhasor : public CCard 29 | { 30 | 31 | public: 32 | void SetDipSwitch( int nDipSwitch ); 33 | virtual void Reset(); 34 | virtual void PowerOn(); 35 | DECLARE_DYNAMIC( CPhasor ); 36 | 37 | void Clock(int clock); 38 | CPhasor(); 39 | virtual ~CPhasor(); 40 | 41 | virtual void WriteRom(WORD addr, BYTE data); 42 | virtual BYTE ReadRom(WORD addr); 43 | virtual void InitRomImage(); 44 | 45 | virtual void Write(WORD addr, BYTE data); 46 | virtual BYTE Read(WORD addr); 47 | virtual void Configure(); 48 | 49 | virtual void Serialize(CArchive &ar); 50 | 51 | protected: 52 | BYTE m_byMode; 53 | BOOL m_bSwapSpeakers; 54 | C6522 m_6522[2]; 55 | C8913 m_8913[4]; 56 | #ifdef HAVE_VOTRAX 57 | CVotrax m_cVotrax[2]; 58 | #endif 59 | void RegisterPSG(); 60 | void UnregisterPSG(); 61 | }; 62 | 63 | 64 | 65 | #endif // !defined(AFX_PHASOR_H__84DFED54_4C93_4700_9642_F8C00E6EDCAD__INCLUDED_) 66 | 67 | -------------------------------------------------------------------------------- /include/arch/directx/dikeyboard.h: -------------------------------------------------------------------------------- 1 | // DIKeyboard.h: interface for the CDIKeyboard class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DIKEYBOARD_H__4D4177D5_C36A_44A0_80FF_FD46D1A12647__INCLUDED_) 6 | #define AFX_DIKEYBOARD_H__4D4177D5_C36A_44A0_80FF_FD46D1A12647__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "arch/customthread.h" 13 | 14 | class CDIKeyboard : public CCustomThread 15 | { 16 | public: 17 | CDIKeyboard(); // Constructor 18 | virtual ~CDIKeyboard(); // Destructor 19 | void SetHWND(HWND); // Overridden SetHWND 20 | void SetHWND(CWnd*); // Overridden SetHWND 21 | bool IsKeyPressed(unsigned char keyname); // Has a specific DI_KEY been pressed. 22 | bool InitKeyboard(void); 23 | void Restore(); 24 | 25 | public: 26 | void GetDelayTime(int* pnRepeat, int* pnDelay); 27 | void SetDelayTime(int nRepeat, int nDelay); 28 | void KeyDown(USHORT key); 29 | void KeyUp(USHORT key); 30 | BOOL m_bLostKey; 31 | char m_buffer[256]; 32 | char m_oldbuf[256]; 33 | 34 | protected: 35 | void ProcessKey(BOOL bRepeat); 36 | void OnAfterDeactivate(); 37 | BOOL OnBeforeActivate(); 38 | void Run(void); 39 | 40 | HANDLE m_hKeyboardEvent; 41 | BYTE m_last; 42 | unsigned int m_uDelay; 43 | unsigned int m_uRepeat; 44 | BOOL m_Initialised; 45 | HWND m_hwnd; 46 | }; 47 | 48 | #endif // !defined(AFX_DIKEYBOARD_H__4D4177D5_C36A_44A0_80FF_FD46D1A12647__INCLUDED_) 49 | -------------------------------------------------------------------------------- /include/arch/frame/colorbutton.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_COLORBUTTON_H__B7D05142_FE0B_415B_A301_D11102E73248__INCLUDED_) 2 | #define AFX_COLORBUTTON_H__B7D05142_FE0B_415B_A301_D11102E73248__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // colorbutton.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CColorButton window 12 | 13 | class CColorButton : public CButton 14 | { 15 | // Construction 16 | public: 17 | CColorButton(); 18 | 19 | // Attributes 20 | public: 21 | protected: 22 | COLORREF m_crColor; 23 | COLORREF m_crBlack; 24 | BYTE m_byMask; 25 | 26 | // Operations 27 | public: 28 | protected: 29 | 30 | // Overrides 31 | // ClassWizard generated virtual function overrides 32 | //{{AFX_VIRTUAL(CColorButton) 33 | public: 34 | void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); 35 | //}}AFX_VIRTUAL 36 | 37 | // Implementation 38 | public: 39 | void SetColor( COLORREF crColor, BYTE byMask); 40 | ~CColorButton() {} 41 | 42 | // Generated message map functions 43 | protected: 44 | //{{AFX_MSG(CColorButton) 45 | // NOTE - the ClassWizard will add and remove member functions here. 46 | //}}AFX_MSG 47 | 48 | DECLARE_MESSAGE_MAP() 49 | }; 50 | 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | //{{AFX_INSERT_LOCATION}} 54 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 55 | 56 | #endif // !defined(AFX_COLORBUTTON_H__B7D05142_FE0B_415B_A301_D11102E73248__INCLUDED_) 57 | -------------------------------------------------------------------------------- /include/mousecard.h: -------------------------------------------------------------------------------- 1 | // MouseCard.h: interface for the CMouseCard class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MOUSECARD_H__DB1618B4_296C_4381_8E1F_BC5D1B4A3D4D__INCLUDED_) 6 | #define AFX_MOUSECARD_H__DB1618B4_296C_4381_8E1F_BC5D1B4A3D4D__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "Card.h" 13 | #include "6821.h" 14 | 15 | class CMouseCard : public CCard 16 | { 17 | public: 18 | protected: 19 | C6821 m_c6821; 20 | 21 | public: 22 | CMouseCard(); 23 | virtual ~CMouseCard(); 24 | 25 | void Reset(); 26 | void Clock(int nClock); 27 | BYTE ReadRom( WORD wAddr ); 28 | void Write( WORD wAddr, BYTE byData ); 29 | BYTE Read( WORD wAddr ); 30 | DECLARE_DYNAMIC( CMouseCard ); 31 | 32 | void Serialize( CArchive &ar ); 33 | 34 | protected: 35 | void OnMouseEvent(); 36 | int m_nDataLen; 37 | BYTE m_byMode; 38 | void OnWrite(); 39 | void OnCommand(); 40 | void On6821_B(BYTE byData); 41 | void On6821_A(BYTE byData ); 42 | 43 | void InitRomImage(); 44 | friend WRITE_HANDLER( M6821_Listener_A ); 45 | friend WRITE_HANDLER( M6821_Listener_B ); 46 | friend CALLBACK_HANDLER( MouseHandler ); 47 | 48 | BYTE m_by6821B; 49 | BYTE m_by6821A; 50 | BYTE m_byBuff[8]; // m_byBuff[0] is mode byte 51 | int m_nBuffPos; 52 | 53 | BYTE m_byState; 54 | int m_nX; 55 | int m_nY; 56 | BOOL m_bBtn0; 57 | BOOL m_bBtn1; 58 | 59 | BOOL m_bVBL; 60 | }; 61 | 62 | #endif // !defined(AFX_MOUSECARD_H__DB1618B4_296C_4381_8E1F_BC5D1B4A3D4D__INCLUDED_) 63 | -------------------------------------------------------------------------------- /include/arch/frame/aipc.h: -------------------------------------------------------------------------------- 1 | // apple2.h : main header file for the APPLE2 application 2 | // 3 | 4 | #if !defined(AFX_APPLE2_H__BD43CFF0_6E38_404C_83F6_3C673167822F__INCLUDED_) 5 | #define AFX_APPLE2_H__BD43CFF0_6E38_404C_83F6_3C673167822F__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #ifndef __AFXWIN_H__ 12 | #error include 'stdafx.h' before including this file for PCH 13 | #endif 14 | 15 | #include "arch/resource.h" // main symbols 16 | #include "aipcdefs.h" 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | // CApple2App: 20 | // See apple2.cpp for the implementation of this class 21 | // 22 | 23 | class CApple2App : public CWinApp 24 | { 25 | public: 26 | CApple2App(); 27 | 28 | // Overrides 29 | // ClassWizard generated virtual function overrides 30 | //{{AFX_VIRTUAL(CApple2App) 31 | public: 32 | virtual BOOL InitInstance(); 33 | //}}AFX_VIRTUAL 34 | 35 | // Implementation 36 | 37 | public: 38 | //{{AFX_MSG(CApple2App) 39 | afx_msg void OnAppAbout(); 40 | afx_msg void OnHelpCmdUsage(); 41 | // NOTE - the ClassWizard will add and remove member functions here. 42 | // DO NOT EDIT what you see in these blocks of generated code ! 43 | //}}AFX_MSG 44 | DECLARE_MESSAGE_MAP() 45 | }; 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | //{{AFX_INSERT_LOCATION}} 51 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 52 | 53 | #endif // !defined(AFX_APPLE2_H__BD43CFF0_6E38_404C_83F6_3C673167822F__INCLUDED_) 54 | -------------------------------------------------------------------------------- /include/diskinterface.h: -------------------------------------------------------------------------------- 1 | // DiskInterface.h: interface for the CDiskInterface class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DISKINTERFACE_H__03C7C26F_CB29_4C07_84E9_EB3B20111E6F__INCLUDED_) 6 | #define AFX_DISKINTERFACE_H__03C7C26F_CB29_4C07_84E9_EB3B20111E6F__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "Card.h" 13 | #include "DiskDrive.h" 14 | 15 | #define MAX_DRIVES 2 16 | 17 | class CDiskInterface : public CCard 18 | { 19 | public: 20 | DECLARE_SERIAL( CDiskInterface ); 21 | //DECLARE_DYNAMIC( CDiskInterface ); 22 | 23 | void SetMotorLightHandler(void* objTo, callback_handler func); 24 | void Clock(int nClock); 25 | void PowerOff(); 26 | void PowerOn(); 27 | virtual void Reset(); 28 | 29 | CDiskInterface(); 30 | virtual ~CDiskInterface(); 31 | 32 | virtual void InitRomImage(); 33 | 34 | virtual void Write(WORD addr, BYTE data); 35 | virtual BYTE Read(WORD addr); 36 | virtual void Configure(); 37 | 38 | CDiskDrive* GetDrive(int nDrive) {return m_pDiskDrive[nDrive];}; 39 | 40 | void Serialize( CArchive &ar ); 41 | 42 | protected: 43 | BYTE m_byLatchWData; 44 | BYTE m_byLatchAddr; 45 | BYTE m_byLatchData; 46 | BYTE m_byStepperStatus; 47 | DWORD m_dwMotorOn; 48 | DWORD m_dwWriteLED; 49 | CDiskDrive* m_pDiskDrive[MAX_DRIVES]; 50 | 51 | int m_iCurrentDisk; 52 | 53 | STCallbackHandler stLightHandler; 54 | 55 | void ToggleStepper( BYTE byOffset ); 56 | void UpdateMotorLight(); 57 | }; 58 | 59 | #endif // !defined(AFX_DISKINTERFACE_H__03C7C26F_CB29_4C07_84E9_EB3B20111E6F__INCLUDED_) 60 | 61 | -------------------------------------------------------------------------------- /include/slots.h: -------------------------------------------------------------------------------- 1 | // Slots.h: interface for the CSlots class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_SLOTS_H__3A324547_6F9B_457B_8806_63D948497F5F__INCLUDED_) 6 | #define AFX_SLOTS_H__3A324547_6F9B_457B_8806_63D948497F5F__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #define MAX_SLOTS 7 13 | 14 | #include "card.h" 15 | 16 | class CSlots : public CObject 17 | { 18 | public: 19 | DECLARE_SERIAL( CSlots ); 20 | CSlots(); 21 | virtual ~CSlots(); 22 | 23 | void SetDipSwitch(int nSlot, int nDipSwitch); 24 | BOOL InsertCard(int nSlot, int nDeviceNum); 25 | BOOL InsertCard(int nSlot, CCard* pCard); 26 | void RemoveCard( int nSlot ); 27 | CCard* GetCard( int slot ); 28 | void Clock( DWORD clock ); 29 | void Reset(); 30 | void Write( WORD addr, BYTE data ); 31 | void WriteRom( WORD addr, BYTE data ); 32 | BYTE ReadRom( WORD addr ); 33 | void PowerOff(); 34 | BYTE Read( WORD addr ); 35 | void PowerOn(); 36 | BOOL Initialize(); 37 | void ConfigureDiskette(); 38 | void ConfigureHardDisk(); 39 | BOOL HasDiskInterface(); 40 | BOOL HasHardDiskInterface(); 41 | BOOL HasMouseInterface(); 42 | void SetDiskette1(CString strDiskPath); 43 | void SetDiskette2(CString strDiskPath); 44 | void SetHardDisk(CString strDiskPath); 45 | 46 | void Serialize( CArchive &ar ); 47 | 48 | protected: 49 | CCard *m_slots[MAX_SLOTS]; // slots 50 | int m_nDiskSlotNum; 51 | int m_nHardDiskSlotNum; 52 | int m_nMouseSlotNum; 53 | int m_nLastSlotNum; 54 | }; 55 | 56 | #endif // !defined(AFX_SLOTS_H__3A324547_6F9B_457B_8806_63D948497F5F__INCLUDED_) 57 | -------------------------------------------------------------------------------- /dx80/lib/Script1.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // Unknown language: 0x22, 0x1 resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_UKR) 19 | #ifdef _WIN32 20 | LANGUAGE 0x22, 0x1 21 | #pragma code_page(1251) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE DISCARDABLE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE DISCARDABLE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE DISCARDABLE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | #endif // Unknown language: 0x22, 0x1 resources 50 | ///////////////////////////////////////////////////////////////////////////// 51 | 52 | 53 | 54 | #ifndef APSTUDIO_INVOKED 55 | ///////////////////////////////////////////////////////////////////////////// 56 | // 57 | // Generated from the TEXTINCLUDE 3 resource. 58 | // 59 | 60 | 61 | ///////////////////////////////////////////////////////////////////////////// 62 | #endif // not APSTUDIO_INVOKED 63 | 64 | -------------------------------------------------------------------------------- /dx80/include/audevcod.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AudEvCod.h 3 | // 4 | // Desc: List of Audio device error event codes and the expected params. 5 | // 6 | // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | 11 | #ifndef __AUDEVCOD__ 12 | #define __AUDEVCOD__ 13 | 14 | 15 | #define EC_SND_DEVICE_ERROR_BASE 0x0200 16 | 17 | typedef enum _tagSND_DEVICE_ERROR { 18 | 19 | SNDDEV_ERROR_Open=1, 20 | SNDDEV_ERROR_Close=2, 21 | SNDDEV_ERROR_GetCaps=3, 22 | SNDDEV_ERROR_PrepareHeader=4, 23 | SNDDEV_ERROR_UnprepareHeader=5, 24 | SNDDEV_ERROR_Reset=6, 25 | SNDDEV_ERROR_Restart=7, 26 | SNDDEV_ERROR_GetPosition=8, 27 | SNDDEV_ERROR_Write=9, 28 | SNDDEV_ERROR_Pause=10, 29 | SNDDEV_ERROR_Stop=11, 30 | SNDDEV_ERROR_Start=12, 31 | SNDDEV_ERROR_AddBuffer=13, 32 | SNDDEV_ERROR_Query=14, 33 | 34 | } SNDDEV_ERR; 35 | 36 | 37 | // Sound device error event codes 38 | // ============================== 39 | // 40 | // All audio device error events are always passed on to the application, and are 41 | // never processed by the filter graph 42 | 43 | 44 | #define EC_SNDDEV_IN_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x00) 45 | #define EC_SNDDEV_OUT_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x01) 46 | // Parameters: ( DWORD, DWORD) 47 | // lParam1 is an enum SND_DEVICE_ERROR which notifies the app how the device was 48 | // being accessed when the failure occurred. 49 | // 50 | // lParam2 is the error returned from the sound device call. 51 | // 52 | 53 | #endif // __AUDEVCOD__ 54 | -------------------------------------------------------------------------------- /include/joystick.h: -------------------------------------------------------------------------------- 1 | // Joystick.h: interface for the CJoystick class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_JOYSTICK_H__4DF81BD0_F4BF_4630_BCB4_82A4983195E4__INCLUDED_) 6 | #define AFX_JOYSTICK_H__4DF81BD0_F4BF_4630_BCB4_82A4983195E4__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "dinput.h" 13 | #include 14 | 15 | #define JM_NONE 0 16 | #define JM_KEYPAD 1 17 | #define JM_PCJOYSTICK 2 18 | 19 | #define JE_NOPCJOYSTICK 1 20 | class CAppleClock; 21 | 22 | class CJoystick : public CObject 23 | { 24 | public: 25 | CJoystick(); 26 | virtual ~CJoystick(); 27 | 28 | void Strobe(); 29 | BYTE GetStatus( BYTE num ); 30 | 31 | void Serialize( CArchive &ar ); 32 | void SetDeadZone( int nDeadZone ); 33 | void SetSaturation( int nSaturation ); 34 | int GetDeadZone(); 35 | int GetSaturation(); 36 | void Initialize(); 37 | void InitPCJoystick(); 38 | bool GetSwapButtons() { return m_bSwapButtons; } 39 | bool GetArrowAsPaddle() { return m_bArrowAsPaddle; } 40 | void SetSwapButtons(bool bSwapButtons) { m_bSwapButtons = bSwapButtons; } 41 | void SetArrayAsPaddle(bool bArrayAsPaddle) { m_bArrowAsPaddle = bArrayAsPaddle; } 42 | BOOL m_bHasPCJoystick; 43 | 44 | protected: 45 | void Poll(); 46 | BOOL IsButtonDown(int num); 47 | int GetPaddleState(int num); 48 | 49 | BOOL m_bStrobe; 50 | DWORD m_dwLastClock; 51 | DWORD m_dwLastPoll; 52 | int m_nDeadZone; 53 | int m_nSaturation; 54 | bool m_bArrowAsPaddle; 55 | bool m_bSwapButtons; 56 | BOOL m_bIsLegacy; 57 | XINPUT_STATE m_xinputState; 58 | }; 59 | 60 | #endif // !defined(AFX_JOYSTICK_H__4DF81BD0_F4BF_4630_BCB4_82A4983195E4__INCLUDED_) 61 | -------------------------------------------------------------------------------- /include/card.h: -------------------------------------------------------------------------------- 1 | // Card.h: interface for the CCard class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_CARD_H__F3CE19E7_6ECF_4B71_B319_87955300BBCE__INCLUDED_) 6 | #define AFX_CARD_H__F3CE19E7_6ECF_4B71_B319_87955300BBCE__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #define PM_NATIVE 0x00 13 | #define PM_MB 0x02 14 | #define PM_ECHO 0x03 15 | 16 | #define MAX_CARD_TYPES 4 17 | 18 | class CAppleClock; 19 | 20 | class CCard : public CObject 21 | { 22 | public: 23 | DECLARE_DYNAMIC( CCard ); 24 | CCard(); 25 | virtual ~CCard(); 26 | 27 | virtual void WriteRom(WORD addr, BYTE data); 28 | virtual BYTE ReadRom(WORD addr); 29 | virtual void WriteExRom(WORD addr, BYTE data); 30 | virtual BYTE ReadExRom(WORD addr); 31 | virtual void InitRomImage(); 32 | virtual void Write(WORD addr, BYTE data); 33 | virtual BYTE Read(WORD addr); 34 | virtual void Configure(){ }; 35 | virtual void Clock(int clock){ }; 36 | virtual void Reset(){ }; 37 | virtual void PowerOn(){ }; 38 | virtual void PowerOff() { Reset(); }; 39 | virtual CString& GetDeviceName() { return m_strDeviceName; }; 40 | virtual int GetDeviceNum() { return m_iDeviceNum; }; 41 | virtual void SetDipSwitch(int nMode) 42 | { 43 | m_nDipSwitch = nMode; 44 | }; 45 | virtual BOOL HasExtendRom() { return m_bHasExtendRom; } 46 | 47 | virtual int GetDipSwitch() { return m_nDipSwitch; }; 48 | 49 | virtual void Serialize( CArchive &ar ); 50 | 51 | protected: 52 | BYTE *m_pbyRom; 53 | CString m_strDeviceName; 54 | int m_iDeviceNum; 55 | int m_nDipSwitch; 56 | BOOL m_bHasExtendRom; 57 | }; 58 | 59 | #endif // !defined(AFX_CARD_H__F3CE19E7_6ECF_4B71_B319_87955300BBCE__INCLUDED_) 60 | -------------------------------------------------------------------------------- /src/card.cpp: -------------------------------------------------------------------------------- 1 | // Card.cpp: implementation of the CCard class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "arch/frame/stdafx.h" 6 | #include "arch/frame/aipc.h" 7 | #include "card.h" 8 | #include "memory.h" 9 | #include "aipcdefs.h" 10 | 11 | #ifdef _DEBUG 12 | #undef THIS_FILE 13 | static char THIS_FILE[]=__FILE__; 14 | #define new DEBUG_NEW 15 | #endif 16 | 17 | ////////////////////////////////////////////////////////////////////// 18 | // Construction/Destruction 19 | ////////////////////////////////////////////////////////////////////// 20 | IMPLEMENT_DYNAMIC( CCard, CObject ); 21 | 22 | CCard::CCard() 23 | { 24 | InitRomImage(); 25 | m_iDeviceNum = CARD_EMPTY; 26 | m_nDipSwitch = 0; 27 | m_pbyRom = NULL; 28 | m_bHasExtendRom = FALSE; 29 | } 30 | 31 | CCard::~CCard() 32 | { 33 | 34 | } 35 | 36 | BYTE CCard::ReadRom(WORD addr) 37 | { 38 | if ( m_pbyRom ) 39 | return m_pbyRom[addr&0xFF]; 40 | return MemReturnRandomData(2); 41 | } 42 | 43 | void CCard::WriteRom(WORD addr, BYTE data) 44 | { 45 | } 46 | 47 | BYTE CCard::ReadExRom(WORD addr) 48 | { 49 | return MemReturnRandomData(2); 50 | } 51 | 52 | void CCard::WriteExRom(WORD addr, BYTE data) 53 | { 54 | } 55 | 56 | void CCard::InitRomImage() 57 | { 58 | } 59 | 60 | 61 | BYTE CCard::Read(WORD addr) 62 | { 63 | return 0x00; 64 | } 65 | 66 | void CCard::Write(WORD addr, BYTE data) 67 | { 68 | 69 | } 70 | 71 | void CCard::Serialize( CArchive &ar ) 72 | { 73 | CObject::Serialize( ar ); 74 | CString dummy = ""; 75 | 76 | if ( ar.IsStoring() ) 77 | { 78 | ar << m_strDeviceName; 79 | ar << m_iDeviceNum; 80 | ar << m_nDipSwitch; 81 | } 82 | else 83 | { 84 | ar >> dummy; 85 | ar >> m_iDeviceNum; 86 | ar >> m_nDipSwitch; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /include/diskdrive.h: -------------------------------------------------------------------------------- 1 | // DiskDrive.h: interface for the CDiskDrive class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DISKDRIVE_H__21765B6D_6C44_4AA4_BCC1_CB140F0E0911__INCLUDED_) 6 | #define AFX_DISKDRIVE_H__21765B6D_6C44_4AA4_BCC1_CB140F0E0911__INCLUDED_ 7 | 8 | #include "diskimagedos.h" 9 | #include "diskimagepo.h" 10 | #include "lockmgr.h" 11 | 12 | #if _MSC_VER > 1000 13 | #pragma once 14 | #endif // _MSC_VER > 1000 15 | 16 | //#define RAW_TRACK_BYTES 6392 17 | 18 | #define DDS_MOTORON ( 1 << 0 ) 19 | #define DDS_WRITEMODE ( 1 << 1 ) 20 | #define DDS_ACTIVE ( 1 << 2 ) 21 | 22 | // read cycle per 1 nibble data 23 | // 1020484 / ( 32 * 6656 ) = 4.7912 rps = 287.47 rpm 24 | #define READ_CLOCK 32 25 | 26 | class CDiskDrive : public CObject 27 | { 28 | public: 29 | CDiskDrive(); 30 | virtual ~CDiskDrive(); 31 | 32 | BYTE ReadWrite( WORD addr, BYTE data ); 33 | void Umount(); 34 | BOOL Mount(const char* pszImageName); 35 | void Reset(); 36 | BOOL IsWriteProtected(); 37 | BYTE ToggleMotor(WORD addr); 38 | 39 | BYTE WriteNibble(BYTE data); 40 | BYTE ReadNibble(); 41 | BOOL IsEnhanced(); 42 | 43 | virtual void Serialize(CArchive &ar); 44 | 45 | // attributes 46 | protected: 47 | void AdjustSpeed(); 48 | 49 | int m_iPosition; 50 | int m_iPhysicalTrackNo; 51 | int m_iTrackNo; 52 | 53 | DWORD m_dwLastAppleClock; 54 | WORD m_wDiskStatus; 55 | BOOL m_bReadFlag; 56 | CString m_strImagePath; 57 | CCSWrapper m_Lock; 58 | 59 | CDiskImage* m_pDiskImage; 60 | 61 | public: 62 | BOOL m_bEnhanced; 63 | BOOL IsWriteMode(); 64 | void SetStepper(BYTE byStepperStatus); 65 | LPCTSTR GetFileName(); 66 | }; 67 | 68 | #endif // !defined(AFX_DISKDRIVE_H__21765B6D_6C44_4AA4_BCC1_CB140F0E0911__INCLUDED_) 69 | -------------------------------------------------------------------------------- /include/arch/frame/dlgconfigdisk.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_DLGCONFIGDISK_H__EE2A993B_E71D_406F_9138_2E4448E32306__INCLUDED_) 2 | #define AFX_DLGCONFIGDISK_H__EE2A993B_E71D_406F_9138_2E4448E32306__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // DlgConfigDisk.h : header file 8 | // 9 | 10 | #include "diskinterface.h" 11 | #include "afxwin.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // CDlgConfigDisk dialog 15 | 16 | class CDlgConfigDisk : public CDialog 17 | { 18 | // Construction 19 | public: 20 | CDlgConfigDisk(CDiskInterface* pInterface, CWnd* pParent = NULL); // standard constructor 21 | 22 | // Dialog Data 23 | enum { IDD = IDD_CONFIGURE_DISK }; 24 | CButton m_btnEnableDisk2; 25 | CButton m_btnEnableDisk1; 26 | CButton m_btnBrowseDisk2; 27 | CButton m_btnBrowseDisk1; 28 | CString m_strDisk1Image; 29 | CString m_strDisk2Image; 30 | BOOL m_bEnhanced1; 31 | BOOL m_bEnhanced2; 32 | 33 | // Overrides 34 | protected: 35 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 36 | 37 | // Implementation 38 | protected: 39 | CDiskInterface* m_pInterface; 40 | 41 | virtual BOOL OnInitDialog(); 42 | afx_msg void OnBtnBrowse1(); 43 | afx_msg void OnBtnBrowse2(); 44 | afx_msg void OnChkDisk2(); 45 | afx_msg void OnChkDisk1(); 46 | virtual void OnOK(); 47 | DECLARE_MESSAGE_MAP() 48 | public: 49 | CEdit m_cDisk1Path; 50 | CEdit m_cDisk2Path; 51 | afx_msg void OnSetfocusEditFilename1(); 52 | afx_msg void OnKillfocusEditFilename1(); 53 | afx_msg void OnSetfocusEditFilename2(); 54 | afx_msg void OnKillfocusEditFilename2(); 55 | void SetFileName(CEdit *edit, CString path); 56 | }; 57 | 58 | #endif // !defined(AFX_DLGCONFIGDISK_H__EE2A993B_E71D_406F_9138_2E4448E32306__INCLUDED_) 59 | -------------------------------------------------------------------------------- /include/arch/directx/dxsound.h: -------------------------------------------------------------------------------- 1 | #ifndef __DXSOUND_H 2 | #define __DXSOUND_H 3 | 4 | #include 5 | #include 6 | #include "lockmgr.h" 7 | 8 | #define MAX_CHARACTER 5 9 | #define MAX_ACTION 7 10 | 11 | #define SAMPLES_PER_SEC 44100 12 | #define BITS_PER_SAMPLE 16 13 | #define SND_CHANNEL 2 14 | 15 | #define SND_BUFFER_SIZE ( SAMPLES_PER_SEC * ( BITS_PER_SAMPLE / 8 ) * SND_CHANNEL ) 16 | #define MAX_AMPLITUDE ( ( 1 << ( BITS_PER_SAMPLE - 1 ) ) - 1 ) 17 | 18 | #include "psg.h" 19 | 20 | struct stPSG 21 | { 22 | CPSG *psg; 23 | int pan; 24 | stPSG *next; 25 | }; 26 | 27 | class CDXSound 28 | { 29 | public: 30 | void RemovePSG( CPSG *psg ); 31 | void AddPSG( CPSG *psg, int pan ); 32 | BOOL CreateBuffer(); 33 | void DestroyBuffer(); 34 | CDXSound(); 35 | ~CDXSound(); 36 | 37 | LPDIRECTSOUND Create( HWND hwnd, DWORD dwLevel = DSSCL_NORMAL ); 38 | 39 | void ChangeSampleRate(unsigned int nSampleRate); 40 | unsigned int m_nSampleRate; 41 | void SetVolume(int nVol); 42 | int GetVolume(); 43 | void SetPan(int nPan); 44 | int GetPan(); 45 | void Resume(); 46 | void Suspend(); 47 | void Toggle(); 48 | void Clock(); 49 | void UpdateSoundBuffer(); 50 | 51 | public: 52 | BOOL m_bMute; 53 | WORD m_wCurPos; 54 | int m_nSamplesInFrame; 55 | 56 | protected: 57 | CCSWrapper m_Lock; 58 | int m_nToggleValue; 59 | BOOL m_bPlay; 60 | BOOL m_iToggle; 61 | int m_iRateLow; 62 | int m_iRateHigh; 63 | BYTE m_abyBuffer[SND_BUFFER_SIZE]; 64 | DWORD m_dwLastClock; 65 | DWORD m_dwBufferIn; 66 | HWND m_hWnd; 67 | LPDIRECTSOUND m_lpDS; 68 | LPDIRECTSOUNDBUFFER m_lpSndBuffer; 69 | stPSG* m_stPSG; 70 | int m_nVol; 71 | int m_nPan; 72 | int m_nCheckStep; 73 | 74 | }; 75 | 76 | 77 | 78 | extern CDXSound g_DXSound; 79 | 80 | extern WORD g_tblVolume[32]; 81 | 82 | 83 | #endif -------------------------------------------------------------------------------- /licenses/MAME.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 1997-2007, Nicola Salmoria and the MAME team 2 | All rights reserved. 3 | 4 | Redistribution and use of this code or any derivative works are permitted 5 | provided that the following conditions are met: 6 | 7 | * Redistributions may not be sold, nor may they be used in a commercial 8 | product or activity. 9 | 10 | * Redistributions that are modified from the original source must include the 11 | complete source code, including the source code for all components used by a 12 | binary built from the modified sources. However, as a special exception, the 13 | source code distributed need not include anything that is normally distributed 14 | (in either source or binary form) with the major components (compiler, kernel, 15 | and so on) of the operating system on which the executable runs, unless that 16 | component itself accompanies the executable. 17 | 18 | * Redistributions must reproduce the above copyright notice, this list of 19 | conditions and the following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 26 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /dx80/include/dmusbuff.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * DMusBuff.h -- This module defines the buffer format for DirectMusic * 4 | * Shared file between user mode and kernel mode components * 5 | * * 6 | * Copyright (c) 1998, Microsoft Corp. All rights reserved. * 7 | * * 8 | ***************************************************************************/ 9 | 10 | #ifndef _DMusBuff_ 11 | #define _DMusBuff_ 12 | 13 | /* Format of DirectMusic events in a buffer 14 | * 15 | * A buffer contains 1 or more events, each with the following header. 16 | * Immediately following the header is the event data. The header+data 17 | * size is rounded to the nearest quadword (8 bytes). 18 | */ 19 | 20 | #include /* Do not pad at end - that's where the data is */ 21 | typedef struct _DMUS_EVENTHEADER *LPDMUS_EVENTHEADER; 22 | typedef struct _DMUS_EVENTHEADER 23 | { 24 | DWORD cbEvent; /* Unrounded bytes in event */ 25 | DWORD dwChannelGroup; /* Channel group of event */ 26 | REFERENCE_TIME rtDelta; /* Delta from start time of entire buffer */ 27 | DWORD dwFlags; /* Flags DMUS_EVENT_xxx */ 28 | } DMUS_EVENTHEADER; 29 | #include 30 | 31 | #define DMUS_EVENT_STRUCTURED 0x00000001 /* Unstructured data (SysEx, etc.) */ 32 | 33 | /* The number of bytes to allocate for an event with 'cb' data bytes. 34 | */ 35 | #define QWORD_ALIGN(x) (((x) + 7) & ~7) 36 | #define DMUS_EVENT_SIZE(cb) QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb) 37 | 38 | 39 | #endif /* _DMusBuff_ */ 40 | 41 | 42 | -------------------------------------------------------------------------------- /include/arch/frame/dlgconfigmockingboard.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_DLGCONFIGMOCKINGBOARD_H__8256FD6E_641D_4769_8F51_D0C59475BCD2__INCLUDED_) 2 | #define AFX_DLGCONFIGMOCKINGBOARD_H__8256FD6E_641D_4769_8F51_D0C59475BCD2__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // DlgConfigMockingBoard.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CDlgConfigMockingBoard dialog 12 | 13 | class CDlgConfigMockingBoard : public CDialog 14 | { 15 | // Construction 16 | public: 17 | void SetDipSwitch(int nDipSwitch); 18 | int GetDipSwitch(); 19 | int GetRightVol(); 20 | int GetLeftVol(); 21 | void SetRightVol(int vol); 22 | void SetLeftVol(int vol); 23 | CDlgConfigMockingBoard(CWnd* pParent = NULL); // standard constructor 24 | // Dialog Data 25 | //{{AFX_DATA(CDlgConfigMockingBoard) 26 | enum { IDD = IDD_CONFIGURE_MOCKINGBOARD }; 27 | CButton m_btnMockingBoard; 28 | CButton m_btnPhasorNative; 29 | CSliderCtrl m_slVolume; 30 | CSliderCtrl m_slBalance; 31 | BOOL m_bMute; 32 | BOOL m_bSwapSpeakers; 33 | //}}AFX_DATA 34 | 35 | 36 | // Overrides 37 | // ClassWizard generated virtual function overrides 38 | //{{AFX_VIRTUAL(CDlgConfigMockingBoard) 39 | protected: 40 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 41 | //}}AFX_VIRTUAL 42 | 43 | // Implementation 44 | protected: 45 | unsigned int m_uLeftVol; 46 | unsigned int m_uRightVol; 47 | int m_nDipSwitch; 48 | 49 | // Generated message map functions 50 | //{{AFX_MSG(CDlgConfigMockingBoard) 51 | virtual BOOL OnInitDialog(); 52 | virtual void OnOK(); 53 | //}}AFX_MSG 54 | DECLARE_MESSAGE_MAP() 55 | }; 56 | 57 | //{{AFX_INSERT_LOCATION}} 58 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 59 | 60 | #endif // !defined(AFX_DLGCONFIGMOCKINGBOARD_H__8256FD6E_641D_4769_8F51_D0C59475BCD2__INCLUDED_) 61 | -------------------------------------------------------------------------------- /include/6821.h: -------------------------------------------------------------------------------- 1 | // 6821.h: interface for the C6821 class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | // Motorola MC6821 PIA 5 | 6 | #if !defined(AFX_6821_H__9E776B26_9725_43D8_9CA0_7166D716372A__INCLUDED_) 7 | #define AFX_6821_H__9E776B26_9725_43D8_9CA0_7166D716372A__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | 14 | #define PIA_DDRA 0 15 | #define PIA_CTLA 1 16 | #define PIA_DDRB 2 17 | #define PIA_CTLB 3 18 | 19 | class C6821 : public CObject 20 | { 21 | public: 22 | 23 | protected: 24 | BYTE m_byIA; 25 | BYTE m_byCA1; 26 | BYTE m_byICA2; 27 | BYTE m_byOA; 28 | BYTE m_byOCA2; 29 | BYTE m_byDDRA; 30 | BYTE m_byCTLA; 31 | BYTE m_byIRQAState; 32 | 33 | BYTE m_byIB; 34 | BYTE m_byCB1; 35 | BYTE m_byICB2; 36 | BYTE m_byOB; 37 | BYTE m_byOCB2; 38 | BYTE m_byDDRB; 39 | BYTE m_byCTLB; 40 | BYTE m_byIRQBState; 41 | 42 | STWriteHandler m_stOutA; 43 | STWriteHandler m_stOutB; 44 | STWriteHandler m_stOutCA2; 45 | STWriteHandler m_stOutCB2; 46 | STWriteHandler m_stOutIRQA; 47 | STWriteHandler m_stOutIRQB; 48 | 49 | public: 50 | C6821(); 51 | virtual ~C6821(); 52 | 53 | BYTE GetPB(); 54 | BYTE GetPA(); 55 | void SetPB(BYTE byData); 56 | void SetPA(BYTE byData); 57 | void SetCA1( BYTE byData ); 58 | void SetCA2( BYTE byData ); 59 | void SetCB1( BYTE byData ); 60 | void SetCB2( BYTE byData ); 61 | void Reset(); 62 | BYTE Read( BYTE byRS ); 63 | void Write( BYTE byRS, BYTE byData ); 64 | 65 | void UpdateInterrupts(); 66 | 67 | void SetListenerA( void *objTo, mem_write_handler func ); 68 | void SetListenerB( void *objTo, mem_write_handler func ); 69 | void SetListenerCA2( void *objTo, mem_write_handler func ); 70 | void SetListenerCB2( void *objTo, mem_write_handler func ); 71 | 72 | void Serialize( CArchive &ar ); 73 | 74 | protected: 75 | 76 | }; 77 | 78 | #endif // !defined(AFX_6821_H__9E776B26_9725_43D8_9CA0_7166D716372A__INCLUDED_) 79 | -------------------------------------------------------------------------------- /include/arch/frame/dlgdebug.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_DLGDEBUG_H__CDB82413_19FD_4287_BBAE_8906DB94DC0F__INCLUDED_) 2 | #define AFX_DLGDEBUG_H__CDB82413_19FD_4287_BBAE_8906DB94DC0F__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // DlgDebug.h : header file 8 | // 9 | 10 | #include "65c02.h" 11 | #include "memory.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // CDlgDebug dialog 15 | 16 | class CDlgDebug : public CDialog 17 | { 18 | // Construction 19 | public: 20 | void UpdateData(); 21 | int m_aiAddrs[10]; 22 | void addProcess(int num, WORD address); 23 | CAppleIOU* m_pMemory; 24 | C65c02* m_pCPU; 25 | CDlgDebug(C65c02* pCPU, CAppleIOU* pMemory, CWnd* pParent = NULL); // standard constructor 26 | 27 | // Dialog Data 28 | //{{AFX_DATA(CDlgDebug) 29 | enum { IDD = IDD_DEBUG }; 30 | CStatic m_flagZ; 31 | CEdit m_editData; 32 | CListCtrl m_listRegisters; 33 | CListCtrl m_listProcess; 34 | CStatic m_flagV; 35 | CStatic m_flagN; 36 | CStatic m_flagI; 37 | CStatic m_flagX; 38 | CStatic m_flagD; 39 | CStatic m_flagC; 40 | CStatic m_flagB; 41 | //}}AFX_DATA 42 | 43 | 44 | // Overrides 45 | // ClassWizard generated virtual function overrides 46 | //{{AFX_VIRTUAL(CDlgDebug) 47 | protected: 48 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 49 | //}}AFX_VIRTUAL 50 | 51 | // Implementation 52 | protected: 53 | 54 | // Generated message map functions 55 | //{{AFX_MSG(CDlgDebug) 56 | afx_msg void OnButtonTrace(); 57 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 58 | afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); 59 | virtual BOOL OnInitDialog(); 60 | //}}AFX_MSG 61 | DECLARE_MESSAGE_MAP() 62 | }; 63 | 64 | //{{AFX_INSERT_LOCATION}} 65 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 66 | 67 | #endif // !defined(AFX_DLGDEBUG_H__CDB82413_19FD_4287_BBAE_8906DB94DC0F__INCLUDED_) 68 | -------------------------------------------------------------------------------- /dx80/include/amaudio.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AMAudio.h 3 | // 4 | // Desc: Audio related definitions and interfaces for ActiveMovie. 5 | // 6 | // Copyright (c) 1992 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __AMAUDIO__ 11 | #define __AMAUDIO__ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif // __cplusplus 16 | 17 | #include 18 | #include 19 | 20 | // This is the interface the audio renderer supports to give the application 21 | // access to the direct sound object and buffers it is using, to allow the 22 | // application to use things like the 3D features of Direct Sound for the 23 | // soundtrack of a movie being played with Active Movie 24 | 25 | // be nice to our friends in C 26 | #undef INTERFACE 27 | #define INTERFACE IAMDirectSound 28 | 29 | DECLARE_INTERFACE_(IAMDirectSound,IUnknown) 30 | { 31 | /* IUnknown methods */ 32 | 33 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; 34 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 35 | STDMETHOD_(ULONG,Release)(THIS) PURE; 36 | 37 | /* IAMDirectSound methods */ 38 | 39 | STDMETHOD(GetDirectSoundInterface)(THIS_ LPDIRECTSOUND *lplpds) PURE; 40 | STDMETHOD(GetPrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; 41 | STDMETHOD(GetSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; 42 | STDMETHOD(ReleaseDirectSoundInterface)(THIS_ LPDIRECTSOUND lpds) PURE; 43 | STDMETHOD(ReleasePrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; 44 | STDMETHOD(ReleaseSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; 45 | STDMETHOD(SetFocusWindow)(THIS_ HWND, BOOL) PURE ; 46 | STDMETHOD(GetFocusWindow)(THIS_ HWND *, BOOL*) PURE ; 47 | }; 48 | 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif // __cplusplus 53 | #endif // __AMAUDIO__ 54 | 55 | -------------------------------------------------------------------------------- /dx80/include/DShowIDL/regbag.idl: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: RegBag.idl 3 | // 4 | // Desc: IDL source for RegBag.dll. 5 | // 6 | // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | import "objidl.idl"; 11 | import "oaidl.idl"; 12 | import "ocidl.idl"; 13 | 14 | 15 | //***************************************************************************** 16 | /////////////////////////////////////////////////////////////////////////////// 17 | // 18 | // Custom Factory interface 19 | // since com doesn't support ctors or initialization parameters on std factory interface 20 | // we have a custom creation interface 21 | // 22 | /////////////////////////////////////////////////////////////////////////////// 23 | //***************************************************************************** 24 | /////////////////////////////////////////////////////////////////////////////////////// 25 | [object, 26 | hidden, restricted, 27 | uuid(8A674B48-1F63-11d3-B64C-00C04F79498E), 28 | helpstring("Create property bag backed by registry"), 29 | pointer_default(unique), 30 | local 31 | ] 32 | interface ICreatePropBagOnRegKey : IUnknown { 33 | // NOTE: it is up to the caller to set the correct registry access based on the interface 34 | // and methods the caller intends to use 35 | // IPropertyBag2::GetPropertyInfo and CountProperties require both KEY_QUERY_VALUE and KEY_ENUMERATE_SUBKEYS 36 | // IPropertyBagXXX::Read requires KEY_READ 37 | // IPropertyBagXXX::Write requires KEY_WRITE 38 | // also, you must CoTaskMemFree the name string from GetPropertyInfo 39 | // if you write a value of VT_EMPTY or VT_NULL the property will be removed from the bag and the corresponding 40 | // registry info will be deleted. 41 | HRESULT Create([in] HKEY hkey, [in] LPCOLESTR subkey, [in] DWORD ulOptions, [in] DWORD samDesired, REFIID iid, [out] LPVOID *ppBag); 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /src/lockmgr.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // LockMgr.cpp 4 | // 5 | // SUBSYSTEM: 6 | // Generic libraries 7 | // MODULE: 8 | // Interface declaration of CCSWrapper CRITICAL_SECTION wrapper 9 | // 10 | // DESCRIPTION: 11 | // 12 | // 13 | // AUTHOR: Ivo Ivanov 14 | // 15 | //--------------------------------------------------------------------------- 16 | #include "arch/frame/stdafx.h" 17 | #include "lockmgr.h" 18 | 19 | //--------------------------------------------------------------------------- 20 | // 21 | // class CCSWrapper 22 | // 23 | // CRTICIAL_SECTION user object wrapper 24 | // 25 | //--------------------------------------------------------------------------- 26 | 27 | //--------------------------------------------------------------------------- 28 | // 29 | // Constructor 30 | // 31 | //--------------------------------------------------------------------------- 32 | CCSWrapper::CCSWrapper() 33 | { 34 | m_nSpinCount = 0; 35 | ::InitializeCriticalSection( &m_cs ); 36 | } 37 | 38 | //--------------------------------------------------------------------------- 39 | // 40 | // Destructor 41 | // 42 | //--------------------------------------------------------------------------- 43 | CCSWrapper::~CCSWrapper() 44 | { 45 | ::DeleteCriticalSection( &m_cs ); 46 | } 47 | 48 | 49 | //--------------------------------------------------------------------------- 50 | // Enter 51 | // 52 | // This function waits for ownership of the specified critical section object 53 | //--------------------------------------------------------------------------- 54 | void CCSWrapper::Enter() 55 | { 56 | ::EnterCriticalSection( &m_cs ); 57 | m_nSpinCount++; 58 | } 59 | 60 | //--------------------------------------------------------------------------- 61 | // Leave 62 | // 63 | // Releases ownership of the specified critical section object. 64 | //--------------------------------------------------------------------------- 65 | void CCSWrapper::Leave() 66 | { 67 | m_nSpinCount--; 68 | ::LeaveCriticalSection( &m_cs ); 69 | } 70 | 71 | //--------------------- End of the file ------------------------------------- 72 | -------------------------------------------------------------------------------- /dx80/include/DShowIDL/dshowasf.idl: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DShowASF.idl 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) 1992-2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | import "unknwn.idl"; 11 | import "objidl.idl"; 12 | import "strmif.idl"; // for media type and time definitions 13 | import "wmsdkidl.idl"; 14 | 15 | cpp_quote( "EXTERN_GUID( IID_IConfigAsfWriter,0x45086030,0xF7E4,0x486a,0xB5,0x04,0x82,0x6B,0xB5,0x79,0x2A,0x3B );" ) 16 | 17 | interface IConfigAsfWriter; 18 | interface IWMProfile; 19 | 20 | // Interface to control the ASF writer 21 | [ 22 | object, 23 | uuid(45086030-F7E4-486a-B504-826BB5792A3B), 24 | pointer_default(unique) 25 | ] 26 | interface IConfigAsfWriter : IUnknown 27 | { 28 | // 29 | // The user is expected to enumerate profiles using the wmsdk IWMProfileManager 30 | // method and then pass the desired profile index to the ASF Writer filter via this 31 | // method. The filter will then try to configure itself for the selected profile. 32 | // 33 | // NOTE: These 2 XXXProfileId methods are now obsolete because they assume 34 | // version 4.0 WMSDK profiles. To configure the filter for later profile 35 | // versions using a profile index, use the XXXProfile methods which take 36 | // the IWMProfile* directly. 37 | // 38 | HRESULT ConfigureFilterUsingProfileId([in] DWORD dwProfileId); 39 | HRESULT GetCurrentProfileId([out] DWORD *pdwProfileId); 40 | 41 | // 42 | // configure using a pre-defined wmsdk profile guid 43 | // 44 | HRESULT ConfigureFilterUsingProfileGuid([in] REFGUID guidProfile); 45 | HRESULT GetCurrentProfileGuid([out] GUID *pProfileGuid); 46 | 47 | // 48 | // Use these methods when a custom profile setup is preferred 49 | // 50 | HRESULT ConfigureFilterUsingProfile([in] IWMProfile * pProfile); 51 | HRESULT GetCurrentProfile([out] IWMProfile **ppProfile); 52 | 53 | // 54 | // allow app to control whether or not to index file 55 | // 56 | HRESULT SetIndexMode( [in] BOOL bIndexFile ); 57 | HRESULT GetIndexMode( [out] BOOL *pbIndexFile ); 58 | } 59 | 60 | -------------------------------------------------------------------------------- /include/arch/frame/wcSliderPopup.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------- 2 | | Slider popup Edit | 3 | | @ Roland Seah | 4 | | @ 15/02/2002 | 5 | -----------------------------------------------------------------------*/ 6 | #ifndef _WC_SLIDER_POPUP_H_ 7 | #define _WC_SLIDER_POPUP_H_ 8 | 9 | #if _MSC_VER >= 1000 10 | #pragma once 11 | #endif // _MSC_VER >= 1000 12 | 13 | class wcSliderPopup : public CWnd 14 | { 15 | // Construction 16 | public: 17 | wcSliderPopup ( void ); 18 | wcSliderPopup ( CPoint p, int Pos, int nMin, int nMax, CWnd* pParentWnd ); 19 | 20 | // Operations 21 | public: 22 | BOOL Create ( CPoint p, int Pos, int nMin, int nMax, CWnd* pParentWnd ); 23 | void SetPos ( int Pos, BOOL bInvalidate = TRUE ); 24 | int GetPos ( void ) { return m_Pos; }; 25 | void SetRange ( int nMin, int nMax ) { m_Min = nMin; m_Max = nMax; }; 26 | void SetDelta ( int Dlt ) { m_Delta = Dlt; }; 27 | 28 | // Overrides 29 | // ClassWizard generated virtual function overrides 30 | //{{AFX_VIRTUAL(wcSliderPopup) 31 | //}}AFX_VIRTUAL 32 | 33 | protected: 34 | void PositionChange ( void ); 35 | void EndSliderPopup ( int nMessage ); 36 | void DrawTriAt ( int Pos, BOOL Clear, BOOL DrawTrack = FALSE ); 37 | int GetTriPos ( int Pos ); 38 | int TriToPos ( void ); 39 | 40 | // protected attributes 41 | protected: 42 | CRect m_WindowRect; 43 | CWnd* m_pParent; 44 | int m_Pos; 45 | int m_OldPos; 46 | int m_TriPos; 47 | 48 | int m_Min; 49 | int m_Max; 50 | int m_Delta; 51 | 52 | // Generated message map functions 53 | protected: 54 | //{{AFX_MSG(wcSliderPopup) 55 | afx_msg BOOL OnEraseBkgnd(CDC* pDC); 56 | afx_msg void OnNcDestroy(); 57 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 58 | afx_msg void OnPaint(); 59 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 60 | afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 61 | afx_msg void OnKillFocus(CWnd* pNewWnd); 62 | afx_msg void OnActivateApp(BOOL bActive, DWORD hTask); 63 | //}}AFX_MSG 64 | DECLARE_MESSAGE_MAP() 65 | }; 66 | 67 | #endif // !defined(AFX_COLOURPOPUP_H__D0B75902_9830_11D1_9C0F_00A0243D1382__INCLUDED_) 68 | -------------------------------------------------------------------------------- /dx80/include/dv.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DV.h 3 | // 4 | // Desc: DV typedefs and defines. 5 | // 6 | // Copyright (c) 1997 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef _DV_H_ 11 | #define _DV_H_ 12 | 13 | #define DV_DVSD_NTSC_FRAMESIZE 120000L 14 | #define DV_DVSD_PAL_FRAMESIZE 144000L 15 | 16 | #define DV_SMCHN 0x0000e000 17 | #define DV_AUDIOMODE 0x00000f00 18 | #define DV_AUDIOSMP 0x38000000 19 | 20 | #define DV_AUDIOQU 0x07000000 21 | #define DV_NTSCPAL 0x00200000 22 | #define DV_STYPE 0x001f0000 23 | 24 | 25 | //There are NTSC or PAL DV camcorders 26 | #define DV_NTSC 0 27 | #define DV_PAL 1 28 | //DV camcorder can output sd/hd/sl 29 | #define DV_SD 0x00 30 | #define DV_HD 0x01 31 | #define DV_SL 0x02 32 | //user can choice 12 bits or 16 bits audio from DV camcorder 33 | #define DV_CAP_AUD16Bits 0x00 34 | #define DV_CAP_AUD12Bits 0x01 35 | 36 | #define SIZE_DVINFO 0x20 37 | 38 | typedef struct Tag_DVAudInfo 39 | { 40 | BYTE bAudStyle[2]; 41 | //LSB 6 bits for starting DIF sequence number 42 | //MSB 2 bits: 0 for mon. 1: stereo in one 5/6 DIF sequences, 2: stereo audio in both 5/6 DIF sequences 43 | //example: 0x00: mon, audio in first 5/6 DIF sequence 44 | // 0x05: mon, audio in 2nd 5 DIF sequence 45 | // 0x15: stereo, audio only in 2nd 5 DIF sequence 46 | // 0x10: stereo, audio only in 1st 5/6 DIF sequence 47 | // 0x20: stereo, left ch in 1st 5/6 DIF sequence, right ch in 2nd 5/6 DIF sequence 48 | // 0x26: stereo, rightch in 1st 6 DIF sequence, left ch in 2nd 6 DIF sequence 49 | BYTE bAudQu[2]; //qbits, only support 12, 16, 50 | 51 | BYTE bNumAudPin; //how many pin(language) 52 | WORD wAvgSamplesPerPinPerFrm[2]; //samples size for one audio pin in one frame(which has 10 or 12 DIF sequence) 53 | WORD wBlkMode; //45 for NTSC, 54 for PAL 54 | WORD wDIFMode; //5 for NTSC, 6 for PAL 55 | WORD wBlkDiv; //15 for NTSC, 18 for PAL 56 | } DVAudInfo; 57 | 58 | #endif // _DV_H_ 59 | -------------------------------------------------------------------------------- /include/arch/directx/dimouse.h: -------------------------------------------------------------------------------- 1 | // DIMouse.h: interface for the CDIMouse class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DIMOUSE_H__61EC9D6C_35D7_40A3_B4DB_FF492D4A5CFA__INCLUDED_) 6 | #define AFX_DIMOUSE_H__61EC9D6C_35D7_40A3_B4DB_FF492D4A5CFA__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "arch/customthread.h" 13 | #include "lockmgr.h" // Added by ClassView 14 | 15 | #define SYNCHRO(exp) \ 16 | { \ 17 | CLockMgr guard(m_Lock,TRUE); \ 18 | exp \ 19 | } 20 | #define SYNC__ \ 21 | { \ 22 | CLockMgr guard(m_Lock,TRUE); 23 | #define __SYNC \ 24 | } 25 | 26 | class CDIMouse : public CCustomThread 27 | { 28 | public: 29 | void SetMouseListener(void* objTo, callback_handler func); 30 | void OnAfterDeactivate(); 31 | CDIMouse(); 32 | CDIMouse(bool exclusive); 33 | virtual ~CDIMouse(); 34 | 35 | void SetHWND(CWnd* cwnd); 36 | void SetHWND(HWND hwnd); 37 | 38 | int GetX(void) { SYNCHRO( return m_iX; ); }; 39 | int GetY(void) { SYNCHRO( return m_iY; ); }; 40 | int GetMaxX(void) { SYNCHRO(return m_iMaxX; ); }; 41 | int GetMaxY(void) { SYNCHRO(return m_iMaxY; ); }; 42 | int GetMinX(void) { SYNCHRO(return m_iMinX; ); }; 43 | int GetMinY(void) { SYNCHRO(return m_iMinY; ); }; 44 | 45 | bool IsButton0(void) { SYNCHRO( return m_Button0; ); }; 46 | bool IsButton1(void) { SYNCHRO( return m_Button1; ); }; 47 | 48 | bool InitMouse(); // Initialise the mouse. 49 | 50 | void ClampX(int nMinX, int nMaxX); 51 | void ClampY(int nMinY, int nMaxY); 52 | 53 | void SetPosition(int iX, int iY); 54 | void ChangeState(int nXDelta, int nYDelta, unsigned uButtonFlag); 55 | 56 | protected: 57 | CCSWrapper m_Lock; 58 | HANDLE m_hMouseEvent; 59 | HWND m_hwnd; 60 | 61 | BOOL OnBeforeActivate(); 62 | void Run(); 63 | 64 | int m_iX; // X Position 65 | int m_iY; // Y Position 66 | int m_iMaxX; // X Max Position 67 | int m_iMaxY; // Y Max Position 68 | int m_iMinX; // X Min Position 69 | int m_iMinY; // Y Min Position 70 | 71 | bool m_Button0; // Has Button 0 Been Pressed? 72 | bool m_Button1; // Has Button 1 Been Pressed? 73 | 74 | STCallbackHandler m_stMouseHandler; 75 | }; 76 | 77 | #endif // !defined(AFX_DIMOUSE_H__61EC9D6C_35D7_40A3_B4DB_FF492D4A5CFA__INCLUDED_) 78 | -------------------------------------------------------------------------------- /dx80/include/DShowIDL/ddstream.idl: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DDStream.idl 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) 1998 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | import "unknwn.idl"; 11 | import "mmstream.idl"; 12 | 13 | cpp_quote("//") 14 | cpp_quote("// The following declarations within the 'if 0' block are dummy typedefs used to make") 15 | cpp_quote("// the ddstream.idl file build. The actual definitions are contained in DDRAW.H") 16 | cpp_quote("//") 17 | cpp_quote("#if 0") 18 | typedef void * LPDDSURFACEDESC; 19 | typedef struct tDDSURFACEDESC DDSURFACEDESC; 20 | cpp_quote("#endif") 21 | cpp_quote("#include ") 22 | 23 | enum { 24 | DDSFF_PROGRESSIVERENDER = 0x00000001 25 | }; 26 | 27 | interface IDirectDraw; 28 | interface IDirectDrawSurface; 29 | interface IDirectDrawPalette; 30 | 31 | interface IDirectDrawMediaStream; 32 | interface IDirectDrawStreamSample; 33 | 34 | // IDirectDrawMediaStream 35 | [ 36 | object, 37 | local, 38 | uuid(F4104FCE-9A70-11d0-8FDE-00C04FD9189D), 39 | pointer_default(unique) 40 | ] 41 | interface IDirectDrawMediaStream : IMediaStream 42 | { 43 | HRESULT GetFormat( 44 | [out] DDSURFACEDESC *pDDSDCurrent, 45 | [out] IDirectDrawPalette **ppDirectDrawPalette, 46 | [out] DDSURFACEDESC *pDDSDDesired, 47 | [out] DWORD *pdwFlags); 48 | 49 | HRESULT SetFormat( 50 | [in] const DDSURFACEDESC *pDDSurfaceDesc, 51 | [in] IDirectDrawPalette *pDirectDrawPalette); 52 | 53 | HRESULT GetDirectDraw( 54 | [out] IDirectDraw **ppDirectDraw); 55 | 56 | HRESULT SetDirectDraw( 57 | [in] IDirectDraw *pDirectDraw); 58 | 59 | HRESULT CreateSample( 60 | [in] IDirectDrawSurface *pSurface, 61 | [in] const RECT *pRect, 62 | [in] DWORD dwFlags, 63 | [out]IDirectDrawStreamSample **ppSample); 64 | 65 | HRESULT GetTimePerFrame( 66 | [out] STREAM_TIME *pFrameTime); 67 | }; 68 | 69 | 70 | // IDirectDrawStreamSample 71 | [ 72 | object, 73 | local, 74 | uuid(F4104FCF-9A70-11d0-8FDE-00C04FD9189D), 75 | pointer_default(unique) 76 | ] 77 | interface IDirectDrawStreamSample : IStreamSample 78 | { 79 | HRESULT GetSurface( 80 | [out] IDirectDrawSurface ** ppDirectDrawSurface, 81 | [out] RECT * pRect); 82 | 83 | HRESULT SetRect( 84 | [in] const RECT * pRect); 85 | 86 | }; 87 | -------------------------------------------------------------------------------- /dx80/include/dxerr8.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * 4 | * File: dxerr8.h 5 | * Content: DirectX Error Library Include File 6 | * 7 | ****************************************************************************/ 8 | 9 | #ifndef _DXERR8_H_ 10 | #define _DXERR8_H_ 11 | 12 | 13 | // 14 | // DXGetErrorString8 15 | // 16 | // Desc: Converts an DirectX HRESULT to a string 17 | // 18 | // Args: HRESULT hr Can be any error code from 19 | // DPLAY D3D8 D3DX8 DMUSIC DSOUND 20 | // 21 | // Return: Converted string 22 | // 23 | const char* __stdcall DXGetErrorString8A(HRESULT hr); 24 | const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr); 25 | 26 | #ifdef UNICODE 27 | #define DXGetErrorString8 DXGetErrorString8W 28 | #else 29 | #define DXGetErrorString8 DXGetErrorString8A 30 | #endif 31 | 32 | 33 | // 34 | // DXTrace 35 | // 36 | // Desc: Outputs a formatted error message to the debug stream 37 | // 38 | // Args: CHAR* strFile The current file, typically passed in using the 39 | // __FILE__ macro. 40 | // DWORD dwLine The current line number, typically passed in using the 41 | // __LINE__ macro. 42 | // HRESULT hr An HRESULT that will be traced to the debug stream. 43 | // CHAR* strMsg A string that will be traced to the debug stream (may be NULL) 44 | // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. 45 | // 46 | // Return: The hr that was passed in. 47 | // 48 | HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE ); 49 | HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE ); 50 | 51 | #ifdef UNICODE 52 | #define DXTrace DXTraceW 53 | #else 54 | #define DXTrace DXTraceA 55 | #endif 56 | 57 | 58 | // 59 | // Helper macros 60 | // 61 | #if defined(DEBUG) | defined(_DEBUG) 62 | #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) 63 | #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) 64 | #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) 65 | #else 66 | #define DXTRACE_MSG(str) (0L) 67 | #define DXTRACE_ERR(str,hr) (hr) 68 | #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr) 69 | #endif 70 | 71 | 72 | #endif 73 | 74 | 75 | -------------------------------------------------------------------------------- /include/arch/directx/dibase.h: -------------------------------------------------------------------------------- 1 | // DIBase.h: interface for the CDIBase class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DIBASE_H__836FAAB2_7FCF_49CC_B59D_0EE9D9381021__INCLUDED_) 6 | #define AFX_DIBASE_H__836FAAB2_7FCF_49CC_B59D_0EE9D9381021__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include 13 | 14 | class CDIBase 15 | { 16 | public: 17 | bool Release(); 18 | CDIBase(); 19 | virtual ~CDIBase(); 20 | virtual void SetHWND(CWnd*); // Set the windows handle 21 | virtual void SetHWND(HWND); // Set the windows handle 22 | virtual bool Acquire(bool); // Acquire the device 23 | 24 | virtual LPCDIDEVICEINSTANCE GetFirstDeviceID(); 25 | virtual LPCDIDEVICEINSTANCE GetNextDeviceID(); 26 | protected: 27 | void RemoveDeviceList(void); 28 | virtual bool Enumerate(DWORD dwDevType); 29 | static BOOL CALLBACK EnumDevicesProc(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef); 30 | virtual bool AddDeviceInfo(LPCDIDEVICEINSTANCE lpddi); 31 | 32 | virtual bool Initialise(void); // Initialise Direct Input 33 | virtual void Shutdown(void); // Shutdown Direct Input 34 | 35 | virtual bool PollDevice(void)=NULL; // Obtain Data From Device 36 | virtual bool ReInitialise(void); // Try and reinitialise the DX7 Object 37 | TCHAR* GetDIError(HRESULT); // Get text description of DI Error 38 | 39 | bool m_Initialised; // Has Direct Input Been Successfully Initialised. 40 | HINSTANCE m_hInstance; // This Modules Instance 41 | HWND m_hwnd; // Windows Handle for this instance 42 | HCURSOR m_hCursorWait; // Windows Handle to a Wait Cursor 43 | HCURSOR m_hOldCursor; // Windows Handle to Previous Cursor 44 | 45 | DWORD m_DoubleClickTime; // Windows Double Click Time 46 | 47 | HRESULT hr; // Used for error codes in calls to DX 48 | #if DIRECTINPUT_VERSION > 0x0700 49 | LPDIRECTINPUT8 m_lpDI; // Pointer to Direct Input 8 50 | LPDIRECTINPUTDEVICE8 m_lpDIDevice; // Pointer to Direct Input 8 Device 51 | #else 52 | LPDIRECTINPUT7 m_lpDI; // Pointer to Direct Input 7 53 | LPDIRECTINPUTDEVICE7 m_lpDIDevice; // Pointer to Direct Input 7 Device 54 | #endif 55 | private: 56 | POSITION m_DevicePOS; // Used in CPtrList to keep track of next item. 57 | bool m_EnumerationStarted; // Has enumeration started and device been found? 58 | CPtrList m_DIDeviceList; // Contains a pointer list to Attached Devices 59 | }; 60 | 61 | #endif // !defined(AFX_DIBASE_H__836FAAB2_7FCF_49CC_B59D_0EE9D9381021__INCLUDED_) 62 | -------------------------------------------------------------------------------- /include/6522.h: -------------------------------------------------------------------------------- 1 | // 6522.h: interface for the C6522 class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_6522_H__E7D9408B_2309_402B_B3B0_9BCE8D6EBC9E__INCLUDED_) 6 | #define AFX_6522_H__E7D9408B_2309_402B_B3B0_9BCE8D6EBC9E__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | // output register A 13 | #define SY_ORB 0x00 14 | // output register B 15 | #define SY_ORA 0x01 16 | // data direction register B 17 | #define SY_DDRB 0x02 18 | // data direction register A 19 | #define SY_DDRA 0x03 20 | // read : T1 Low-Order Counter 21 | // write: T1 Low-Order Latches 22 | #define SY_T1C_L 0x04 23 | // read & write : T1 High-Order Counter 24 | #define SY_T1C_H 0x05 25 | // read & write: T1 Low-Order Latches 26 | #define SY_T1L_L 0x06 27 | // read & write: T1 High-Order Latches 28 | #define SY_T1L_H 0x07 29 | // read : T2 Low-Order Counter 30 | // write: T2 Low-Order Latches 31 | #define SY_T2C_L 0x08 32 | // read & write : T2 High-Order Counter 33 | #define SY_T2C_H 0x09 34 | // Shift Register 35 | #define SY_SR 0x0A 36 | // Auxiliary Control Register 37 | #define SY_ACR 0x0B 38 | // Peripheral Control Register 39 | #define SY_PCR 0x0C 40 | // Interrupt Flag Register 41 | #define SY_IFR 0x0D 42 | // Interrupt Enable Register 43 | #define SY_IER 0x0E 44 | // output register a w/o handshaking 45 | #define SY_ORAHLP 0x0F 46 | 47 | #define SY_BIT_CA2 ( 1 << 0 ) 48 | #define SY_BIT_CA1 ( 1 << 1 ) 49 | #define SY_BIT_SR ( 1 << 2 ) 50 | #define SY_BIT_CB2 ( 1 << 3 ) 51 | #define SY_BIT_CB1 ( 1 << 4 ) 52 | #define SY_BIT_T2 ( 1 << 5 ) 53 | #define SY_BIT_T1 ( 1 << 6 ) 54 | #define SY_BIT_IRQ ( 1 << 7 ) 55 | 56 | class C6522 : public CObject 57 | { 58 | public: 59 | C6522(); 60 | virtual ~C6522(); 61 | 62 | void SetCB1(BOOL cb1); 63 | void SetCA2(BOOL ca2); 64 | void SetCA1(BOOL ca1); 65 | BYTE m_byIRB; 66 | BYTE m_byIRA; 67 | BYTE GetORB(); 68 | BYTE GetORA(); 69 | void Clock(WORD clock); 70 | BOOL GetIRQB(); 71 | void Reset(); 72 | BYTE Read( BYTE reg ); 73 | void Write(BYTE reg, BYTE data); 74 | BOOL m_bDoubleClock; 75 | 76 | virtual void Serialize( CArchive &ar ); 77 | 78 | protected: 79 | void SetIFR7(); 80 | 81 | private: 82 | BOOL m_bIRQB; 83 | BYTE m_abyRegs[16]; 84 | BYTE m_byORB; 85 | BYTE m_byORA; 86 | BYTE m_byT2L_L; 87 | BOOL m_bCA1; 88 | BOOL m_bCA2; 89 | BOOL m_bCB1; 90 | BOOL m_bCB2; 91 | BOOL m_byExtraClock; 92 | BYTE m_byIRQBCtl; 93 | }; 94 | 95 | #endif // !defined(AFX_6522_H__E7D9408B_2309_402B_B3B0_9BCE8D6EBC9E__INCLUDED_) 96 | -------------------------------------------------------------------------------- /dx80/include/vpnotify.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: VPNotify.h 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) 1997 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __IVPNotify__ 11 | #define __IVPNotify__ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | // interface IVPBaseNotify 18 | DECLARE_INTERFACE_(IVPBaseNotify, IUnknown) 19 | { 20 | public: 21 | // this function initializes the reconnection to the decoder. 22 | STDMETHOD (RenegotiateVPParameters)(THIS_ 23 | ) PURE; 24 | 25 | }; 26 | 27 | // interface IVPNotify 28 | DECLARE_INTERFACE_(IVPNotify, IVPBaseNotify) 29 | { 30 | public: 31 | // function to set the mode (bob, weave etc) 32 | STDMETHOD (SetDeinterlaceMode)(THIS_ 33 | IN AMVP_MODE mode 34 | ) PURE; 35 | 36 | // function to get the mode (bob, weave etc) 37 | STDMETHOD (GetDeinterlaceMode)(THIS_ 38 | OUT AMVP_MODE *pMode 39 | ) PURE; 40 | }; 41 | 42 | // interface IVPNotify 43 | DECLARE_INTERFACE_(IVPNotify2, IVPNotify) 44 | { 45 | public: 46 | // function to set the mode (bob, weave etc) 47 | STDMETHOD (SetVPSyncMaster)(THIS_ 48 | IN BOOL bVPSyncMaster 49 | ) PURE; 50 | 51 | // function to get the mode (bob, weave etc) 52 | STDMETHOD (GetVPSyncMaster)(THIS_ 53 | OUT BOOL *pbVPSyncMaster 54 | ) PURE; 55 | 56 | /* 57 | // this function sets the directdraw surface that the mixer is supposed to use. 58 | STDMETHOD (SetDirectDrawSurface)(THIS_ 59 | IN LPDIRECTDRAWSURFACE pDirectDrawSurface 60 | ) PURE; 61 | 62 | // this function gets the directdraw surface that the mixer is using 63 | STDMETHOD (GetDirectDrawSurface)(THIS_ 64 | OUT LPDIRECTDRAWSURFACE *ppDirectDrawSurface 65 | ) PURE; 66 | 67 | // this functions sets the color-controls, if the chip supports it. 68 | STDMETHOD (SetVPColorControls)(THIS_ 69 | IN LPDDCOLORCONTROL pColorControl 70 | ) PURE; 71 | 72 | // this functions also returns the capability of the hardware in the dwFlags 73 | // value of the struct. 74 | STDMETHOD (GetVPColorControls)(THIS_ 75 | OUT LPDDCOLORCONTROL *ppColorControl 76 | ) PURE; 77 | */ 78 | }; 79 | 80 | 81 | // interface IVPVBINotify 82 | DECLARE_INTERFACE_(IVPVBINotify, IVPBaseNotify) 83 | { 84 | public: 85 | }; 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | 92 | #endif // __IVPNotify__ 93 | -------------------------------------------------------------------------------- /dx80/include/DShowIDL/austream.idl: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AuStream.idl 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) 1998 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | import "unknwn.idl"; 11 | import "mmstream.idl"; 12 | 13 | cpp_quote("//") 14 | cpp_quote("// The following declarations within the 'if 0' block are dummy typedefs used to make") 15 | cpp_quote("// the ddstream.idl file build. The actual definitions are contained in DDRAW.H") 16 | cpp_quote("//") 17 | cpp_quote("#if 0") 18 | typedef struct tWAVEFORMATEX WAVEFORMATEX; 19 | cpp_quote ("#endif") 20 | 21 | interface IAudioMediaStream; 22 | interface IAudioStreamSample; 23 | interface IMemoryData; 24 | interface IAudioData; 25 | 26 | // IAudioMediaStream 27 | 28 | 29 | [ 30 | object, 31 | local, 32 | uuid(f7537560-a3be-11d0-8212-00c04fc32c45), 33 | pointer_default(unique) 34 | ] 35 | interface IAudioMediaStream : IMediaStream 36 | { 37 | 38 | HRESULT GetFormat( 39 | [out] WAVEFORMATEX *pWaveFormatCurrent 40 | ); 41 | 42 | HRESULT SetFormat( 43 | [in] const WAVEFORMATEX *lpWaveFormat); 44 | 45 | HRESULT CreateSample( 46 | [in] IAudioData *pAudioData, 47 | [in] DWORD dwFlags, 48 | [out] IAudioStreamSample **ppSample 49 | ); 50 | } 51 | 52 | [ 53 | object, 54 | local, 55 | uuid(345fee00-aba5-11d0-8212-00c04fc32c45), 56 | pointer_default(unique) 57 | ] 58 | interface IAudioStreamSample : IStreamSample 59 | { 60 | HRESULT GetAudioData( 61 | [out] IAudioData **ppAudio 62 | ); 63 | } 64 | 65 | 66 | [ 67 | object, 68 | local, 69 | uuid(327fc560-af60-11d0-8212-00c04fc32c45), 70 | pointer_default(unique) 71 | ] 72 | interface IMemoryData : IUnknown 73 | { 74 | HRESULT SetBuffer( 75 | [in] DWORD cbSize, 76 | [in] BYTE *pbData, 77 | [in] DWORD dwFlags 78 | ); 79 | 80 | HRESULT GetInfo( 81 | [out] DWORD *pdwLength, 82 | [out] BYTE **ppbData, 83 | [out] DWORD *pcbActualData 84 | ); 85 | HRESULT SetActual( 86 | [in] DWORD cbDataValid 87 | ); 88 | } 89 | 90 | [ 91 | object, 92 | local, 93 | uuid(54c719c0-af60-11d0-8212-00c04fc32c45), 94 | pointer_default(unique) 95 | ] 96 | interface IAudioData : IMemoryData 97 | { 98 | HRESULT GetFormat( 99 | [out] WAVEFORMATEX *pWaveFormatCurrent 100 | ); 101 | 102 | HRESULT SetFormat( 103 | [in] const WAVEFORMATEX *lpWaveFormat 104 | ); 105 | } 106 | 107 | -------------------------------------------------------------------------------- /include/8913.h: -------------------------------------------------------------------------------- 1 | // 8913.h: interface for the C8913 class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_8913_H__223C9736_A480_466D_89E3_44C58ECE0FFB__INCLUDED_) 6 | #define AFX_8913_H__223C9736_A480_466D_89E3_44C58ECE0FFB__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "arch/directx/dxsound.h" 13 | #include "psg.h" 14 | 15 | #define AY_A_TONE_FINE 0x00 16 | #define AY_A_TONE_COARSE 0x01 17 | #define AY_B_TONE_FINE 0x02 18 | #define AY_B_TONE_COARSE 0x03 19 | #define AY_C_TONE_FINE 0x04 20 | #define AY_C_TONE_COARSE 0x05 21 | #define AY_NOISE 0x06 22 | #define AY_ENABLE 0x07 23 | #define AY_A_AMPLITUDE 0x08 24 | #define AY_B_AMPLITUDE 0x09 25 | #define AY_C_AMPLITUDE 0x0A 26 | #define AY_ENVELOPE_FINE 0x0B 27 | #define AY_ENVELOPE_COARSE 0x0C 28 | #define AY_ENVELOPE_SHAPE 0x0D 29 | #define AY_PORT_A 0x0E 30 | #define AY_PORT_B 0x0F 31 | 32 | class C8913 : public CPSG 33 | { 34 | public: 35 | C8913(); 36 | virtual ~C8913(); 37 | void SetClockSpeed( DWORD clock ); 38 | void ChangeSampleRate(); 39 | void Update(int length); 40 | void Clock( WORD clock ); 41 | void Reset(); 42 | BYTE ReadData(); 43 | void SetData(BYTE data); 44 | void SetMode(BYTE mode); 45 | void Serialize( CArchive &ar ); 46 | void WriteReg(BYTE reg, BYTE data); 47 | 48 | protected: 49 | void UpdateBuffer(int length); 50 | void UpdateStream(); 51 | 52 | DWORD m_dwClock; 53 | BOOL m_bHolding; 54 | BYTE m_byMode; 55 | BYTE m_byAddr; 56 | BYTE m_byData; 57 | BYTE m_abyRegs[16]; 58 | BYTE m_byNoise; 59 | 60 | BYTE m_byOutputA; 61 | BYTE m_byOutputB; 62 | BYTE m_byOutputC; 63 | BYTE m_byOutputN; 64 | 65 | BYTE m_byEnvelopeA; 66 | BYTE m_byEnvelopeB; 67 | BYTE m_byEnvelopeC; 68 | 69 | WORD m_wVolA; 70 | WORD m_wVolB; 71 | WORD m_wVolC; 72 | WORD m_wVolE; 73 | 74 | DWORD m_dwRNG; 75 | 76 | int m_iUpdateStep; 77 | int m_iPeriodA; 78 | int m_iPeriodB; 79 | int m_iPeriodC; 80 | int m_iPeriodN; 81 | int m_iPeriodE; 82 | 83 | int m_iCountA; 84 | int m_iCountB; 85 | int m_iCountC; 86 | int m_iCountN; 87 | int m_iCountE; 88 | 89 | char m_chCountEnv; 90 | 91 | BYTE m_byHold; 92 | BYTE m_byAlternate; 93 | BYTE m_byAttack; 94 | 95 | int m_iLastUpdatePos; 96 | int m_iStartUpdatePos; 97 | DWORD m_dwLastAppleClock; 98 | 99 | private: 100 | int buffpos; 101 | }; 102 | 103 | #endif // !defined(AFX_8913_H__223C9736_A480_466D_89E3_44C58ECE0FFB__INCLUDED_) 104 | -------------------------------------------------------------------------------- /include/diskimage.h: -------------------------------------------------------------------------------- 1 | // DiskImage.h: interface for the CDiskImage class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DISKIMAGE_H__8D677F92_8D18_4BC1_B58E_46C13A940CE5__INCLUDED_) 6 | #define AFX_DISKIMAGE_H__8D677F92_8D18_4BC1_B58E_46C13A940CE5__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "aipcdefs.h" 13 | 14 | // 1020484 / ( 32 * 6656 ) = 4.7912 rps = 287.47 rpm 15 | //#define RAW_TRACK_BYTES 6400 16 | #define RAW_TRACK_BYTES 6656 17 | #define MAX_TRACK_BYTES 6656 18 | 19 | #define DIS_BUFFER_VALID 0x01 20 | #define DIS_BUFFER_DIRTY 0x02 21 | #define DIS_WRITE_PROTECTED 0x04 22 | 23 | class CDiskImage 24 | { 25 | public: 26 | CDiskImage(); 27 | virtual ~CDiskImage(); 28 | 29 | LPCTSTR GetImagePath(); 30 | virtual int GetId(){ return 0; } 31 | BOOL IsWriteProtected(); 32 | BOOL IsMounted(); 33 | void Flush(); 34 | 35 | inline BYTE Read(UINT nOffset) 36 | { 37 | nOffset %= m_nNibblesPerTrack; 38 | if ( !( m_nStatus & DIS_BUFFER_VALID ) ) 39 | ReadBuffer(); 40 | return m_abyNibBuffer[nOffset]; 41 | }; 42 | inline void Write(UINT nOffset, BYTE byData) 43 | { 44 | if ( m_nStatus & DIS_WRITE_PROTECTED ) 45 | return; 46 | nOffset %= m_nNibblesPerTrack; 47 | if ( !( m_nStatus & DIS_BUFFER_VALID ) ) 48 | ReadBuffer(); 49 | m_abyNibBuffer[nOffset] = byData; 50 | m_nStatus |= DIS_BUFFER_DIRTY; 51 | }; 52 | virtual int Mount(const char* szFileName); 53 | virtual void Umount(); 54 | 55 | virtual BOOL InitImage() { return TRUE; } 56 | 57 | virtual void MoveTrack(UINT m_nTrack); 58 | static BOOL IsMyType(int hFile) { return FALSE; } 59 | static BOOL IsMyExtension(const char* szExt) { return FALSE; } 60 | static int Get2mgFormat(int hFile); 61 | int GetNibblesPerTrack() 62 | { 63 | return m_nNibblesPerTrack; 64 | } 65 | int GetNumOfTrack() 66 | { 67 | return (int)m_uNumOfTrack; 68 | } 69 | protected: 70 | virtual BOOL ReadBuffer(){ m_nStatus |= DIS_BUFFER_VALID; return TRUE; }; 71 | virtual void SaveBuffer(){ m_nStatus &= ~DIS_BUFFER_DIRTY; }; 72 | static BOOL IsMatch(const char* szExtList, const char* szExt); 73 | 74 | protected: 75 | UINT m_nTrack; 76 | UINT m_nStatus; 77 | int m_hFile; 78 | BYTE m_abyNibBuffer[MAX_TRACK_BYTES]; 79 | BYTE m_abyLogicalSector[16]; // Physical sector to Logical sector 80 | CString m_strImagePath; 81 | int m_nNibblesPerTrack; 82 | UINT m_uNumOfTrack; 83 | UINT m_uVolumeNo; 84 | UINT m_uDataOffset; 85 | UINT m_uDataLength; 86 | }; 87 | 88 | #endif // !defined(AFX_DISKIMAGE_H__8D677F92_8D18_4BC1_B58E_46C13A940CE5__INCLUDED_) 89 | -------------------------------------------------------------------------------- /include/arch/frame/applestatusbar.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_APPLESTATUSBAR_H__20D8D936_8BBC_452A_A297_0C420BBA60C6__INCLUDED_) 2 | #define AFX_APPLESTATUSBAR_H__20D8D936_8BBC_452A_A297_0C420BBA60C6__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // AppleStatusBar.h : header file 8 | // 9 | 10 | #define KEY_STATE_CAPTURE 0 11 | #define KEY_STATE_CAPS 1 12 | #define KEY_STATE_SCROLL 2 13 | #define KEY_STATE_NUMLOCK 3 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CAppleStatusBar window 17 | 18 | class CAppleStatusBar : public CStatusBar 19 | { 20 | // Construction 21 | public: 22 | CAppleStatusBar(); 23 | 24 | // Attributes 25 | public: 26 | protected: 27 | CBitmap m_bmDisk; 28 | CBitmap m_bmDiskOff; 29 | CBitmap m_bmDiskRead; 30 | CBitmap m_bmDiskWrite; 31 | 32 | CBitmap m_bmDiskOff_Full; 33 | CBitmap m_bmDiskRead_Full; 34 | CBitmap m_bmDiskWrite_Full; 35 | 36 | CBitmap m_bmCapsOn; 37 | CBitmap m_bmCapsOff; 38 | CBitmap m_bmScrollLockOn; 39 | CBitmap m_bmScrollLockOff; 40 | CBitmap m_bmNumLockOn; 41 | CBitmap m_bmNumLockOff; 42 | 43 | int m_iDiskStatus[5]; 44 | bool m_bKeyCaptured; 45 | bool m_bKeyCaps; 46 | bool m_bKeyScrollLock; 47 | bool m_bKeyNumLock; 48 | CBitmap m_bmHdd; 49 | 50 | // Operations 51 | public: 52 | 53 | // Overrides 54 | // ClassWizard generated virtual function overrides 55 | //{{AFX_VIRTUAL(CAppleStatusBar) 56 | //}}AFX_VIRTUAL 57 | 58 | // Implementation 59 | public: 60 | void SetMessage( LPCTSTR lpszText ); 61 | void DrawDiskLight(HDC hDC, RECT rect); 62 | void DrawDiskLight_Full(HDC hDC, RECT rect); 63 | void DrawKeyStatus(HDC hDC, RECT rc); 64 | void SetDiskStatus(int index, int status); 65 | void SetKeyStatus(int index, int status); 66 | void SetFrame(double frame); 67 | void SetSpeed(double speed); 68 | BOOL Create(CWnd *pParentWnd, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM); 69 | void DrawItem(LPDRAWITEMSTRUCT lpDrawItem); 70 | virtual ~CAppleStatusBar(); 71 | 72 | friend CALLBACK_HANDLER(OnDiskLightChange); 73 | // Generated message map functions 74 | protected: 75 | CRect m_rectDisk; 76 | CRect m_rectKeyStatus; 77 | //{{AFX_MSG(CAppleStatusBar) 78 | afx_msg void OnSize(UINT nType, int cx, int cy); 79 | //}}AFX_MSG 80 | 81 | DECLARE_MESSAGE_MAP() 82 | }; 83 | 84 | ///////////////////////////////////////////////////////////////////////////// 85 | 86 | //{{AFX_INSERT_LOCATION}} 87 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 88 | 89 | #endif // !defined(AFX_APPLESTATUSBAR_H__20D8D936_8BBC_452A_A297_0C420BBA60C6__INCLUDED_) 90 | -------------------------------------------------------------------------------- /include/lockmgr.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // LockMgr.h 4 | // 5 | // SUBSYSTEM: 6 | // Generic libraries 7 | // MODULE: 8 | // 1. Interface and implementation for the CLockMgr class template. 9 | // 2. Interface declaration of CCSWrapper CRITICAL_SECTION wrapper 10 | // 11 | // DESCRIPTION: 12 | // 13 | // 14 | // AUTHOR: Ivo Ivanov 15 | // 16 | //--------------------------------------------------------------------------- 17 | #ifndef _LOCKMGR_H_ 18 | #define _LOCKMGR_H_ 19 | 20 | #if _MSC_VER > 1000 21 | #pragma once 22 | #endif // _MSC_VER > 1000 23 | 24 | //--------------------------------------------------------------------------- 25 | // 26 | // class CCSWrapper 27 | // 28 | // Win32 CRTICIAL_SECTION user object wrapper 29 | // 30 | //--------------------------------------------------------------------------- 31 | class CCSWrapper 32 | { 33 | public: 34 | CCSWrapper(); 35 | virtual ~CCSWrapper(); 36 | // 37 | // This function waits for ownership of the specified critical section object 38 | // 39 | void Enter(); 40 | // 41 | // Releases ownership of the specified critical section object. 42 | // 43 | void Leave(); 44 | private: 45 | CRITICAL_SECTION m_cs; 46 | long m_nSpinCount; 47 | }; 48 | 49 | 50 | 51 | //--------------------------------------------------------------------------- 52 | // 53 | // class CLockMgr 54 | // 55 | // Provides the access-control mechanism used in controlling access to a resource 56 | // in a multithreaded environment. This class is used in combination with 57 | // CCSWrapper and rather than direct calls for locking and unlocking shared 58 | // resources, it performs it in the constructor and the destructor of the class. 59 | // Having this approach we can just simply instantiate an object of type CCSWrapper 60 | // on the stack in the beginning of the target method. The object will be 61 | // automatically released when it goes out of the scope. This solves the issues 62 | // with exception handling of the protected by CCSWrapper code. 63 | // 64 | //--------------------------------------------------------------------------- 65 | template 66 | class CLockMgr 67 | { 68 | public: 69 | // 70 | // Constructor 71 | // 72 | CLockMgr(T& lockObject, BOOL bEnabled): 73 | m_rLockObject( lockObject ), 74 | m_bEnabled( bEnabled ) 75 | { 76 | if ( m_bEnabled ) 77 | m_rLockObject.Enter(); 78 | } 79 | // 80 | // Destructor 81 | // 82 | virtual ~CLockMgr() 83 | { 84 | if ( m_bEnabled ) 85 | m_rLockObject.Leave(); 86 | } 87 | private: 88 | T& m_rLockObject; 89 | BOOL m_bEnabled; 90 | }; 91 | 92 | #endif //_LOCKMGR_H_ 93 | 94 | //--------------------- End of the file ------------------------------------- 95 | -------------------------------------------------------------------------------- /include/hdd.h: -------------------------------------------------------------------------------- 1 | // DiskInterface.h: interface for the CDiskInterface class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(__HDD_H__) 6 | #define __HDD_H__ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "Card.h" 13 | #include "lockmgr.h" 14 | 15 | #define HDD_DRIVES_NO 2 16 | #define HDD_BLOCK_SIZE 512 17 | 18 | class CHDDImage : public CObject 19 | { 20 | public: 21 | DECLARE_SERIAL( CHDDImage ); 22 | CHDDImage(); 23 | virtual ~CHDDImage(); 24 | 25 | int ReadBlock( int nBlockNo, void* pBuffer ); 26 | int WriteBlock( int nBlockNo, void* pBuffer ); 27 | 28 | int Mount( const char* szFileName ); 29 | void Umount(); 30 | BOOL IsMounted(); 31 | int GetBlockCount() { return m_nBlockCount; } 32 | BOOL IsWriteProtected() { return m_bIsWriteProtected; } 33 | 34 | LPCTSTR GetFileName(); 35 | 36 | void Serialize( CArchive &ar ); 37 | 38 | protected: 39 | int m_hFile; 40 | CString m_strImagePath; 41 | CCSWrapper m_Lock; 42 | int m_nBlockCount; 43 | UINT m_uDataOffset; 44 | UINT m_uDataLength; 45 | UINT m_uVolumeNo; 46 | BOOL m_bIsWriteProtected; 47 | }; 48 | 49 | 50 | class CHDDInterface : public CCard 51 | { 52 | public: 53 | DECLARE_SERIAL( CHDDInterface ); 54 | //DECLARE_DYNAMIC( CHDDInterface ); 55 | 56 | void SetMotorLightHandler(void* objTo, callback_handler func); 57 | void Clock(int nClock); 58 | void PowerOff(); 59 | void PowerOn(); 60 | virtual void Reset(); 61 | 62 | CHDDInterface(); 63 | virtual ~CHDDInterface(); 64 | 65 | virtual void InitRomImage(); 66 | 67 | virtual BYTE ReadRom(WORD addr); 68 | virtual BYTE ReadExRom(WORD addr); 69 | virtual void Write(WORD addr, BYTE data); 70 | virtual BYTE Read(WORD addr); 71 | virtual void Configure(); 72 | 73 | CHDDImage* GetDrive( int nDriveNo ); 74 | 75 | void Serialize( CArchive &ar ); 76 | 77 | static const BYTE CMD_NONE; 78 | static const BYTE CMD_STAT; 79 | static const BYTE CMD_READ; 80 | static const BYTE CMD_WRITE; 81 | 82 | static const BYTE ERR_WAIT; // ($00) Wait for response 83 | static const BYTE ERR_IO; // ($27) IO Error 84 | static const BYTE ERR_NDEV; // ($28) No Device Connected 85 | static const BYTE ERR_WP; // ($2B) Write Protect 86 | static const BYTE ERR_READY; // ($80) Ready for data 87 | 88 | protected: 89 | CHDDImage m_cHDD[HDD_DRIVES_NO]; 90 | BYTE m_abyData[HDD_BLOCK_SIZE]; 91 | BYTE m_byCommand; 92 | BYTE m_byCheckSum; 93 | BYTE m_byStatus; 94 | int m_nCurOffset; 95 | int m_nBlockNo; 96 | 97 | DWORD m_dwMotorOn; 98 | DWORD m_dwWriteLED; 99 | int m_nCurrentDisk; 100 | 101 | STCallbackHandler stLightHandler; 102 | 103 | void UpdateMotorLight(); 104 | void MotorOn(BOOL bWrite); 105 | }; 106 | 107 | 108 | 109 | #endif 110 | 111 | -------------------------------------------------------------------------------- /src/arch/frame/colorbutton.cpp: -------------------------------------------------------------------------------- 1 | // colorbutton.cpp : implementation file 2 | // 3 | 4 | #include "arch/frame/stdafx.h" 5 | #include "arch/frame/colorbutton.h" 6 | 7 | #ifdef _DEBUG 8 | #define new DEBUG_NEW 9 | #undef THIS_FILE 10 | static char THIS_FILE[] = __FILE__; 11 | #endif 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // CColorButton 15 | 16 | CColorButton::CColorButton() 17 | { 18 | } 19 | 20 | BEGIN_MESSAGE_MAP(CColorButton, CButton) 21 | //{{AFX_MSG_MAP(CColorButton) 22 | // NOTE - the ClassWizard will add and remove mapping macros here. 23 | //}}AFX_MSG_MAP 24 | END_MESSAGE_MAP() 25 | 26 | ///////////////////////////////////////////////////////////////////////////// 27 | // CColorButton message handlers 28 | 29 | void CColorButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 30 | { 31 | // TODO: Add your code to draw the specified item 32 | CRect cRect( lpDrawItemStruct->rcItem ); 33 | CBrush cBrush; 34 | CPen cPen, cPenBlack; 35 | CDC cDC; 36 | BYTE byBit; 37 | int i; 38 | 39 | cDC.Attach( lpDrawItemStruct->hDC ); 40 | cPenBlack.CreatePen( PS_SOLID, 1, (COLORREF)0 ); 41 | // draw outline 42 | if ( !IsWindowEnabled() ) 43 | cPen.CreatePen( PS_SOLID, 1, RGB(128, 128, 128 ) ); 44 | else if ( GetFocus() == this ) 45 | cPen.CreatePen( PS_SOLID, 1, RGB(255, 128, 128 ) ); 46 | else 47 | cPen.CreatePen( PS_SOLID, 1, RGB(0, 0, 0 ) ); 48 | 49 | cDC.SelectObject( cPen ); 50 | cDC.Rectangle( cRect ); 51 | cRect.DeflateRect( 1, 1, 1, 1 ); 52 | cDC.SelectObject( cPenBlack ); 53 | cDC.Rectangle( cRect ); 54 | cRect.DeflateRect( 1, 1, 1, 1 ); 55 | cDC.Rectangle( cRect ); 56 | cRect.DeflateRect( 1, 1, 1, 1 ); 57 | 58 | cPen.DeleteObject(); 59 | 60 | if ( m_byMask == 0x1F ) 61 | { 62 | cBrush.CreateSolidBrush( m_crColor ); 63 | cDC.FillRect( cRect, &cBrush ); 64 | cBrush.DeleteObject(); 65 | } 66 | else 67 | { 68 | cPen.CreatePen( PS_SOLID, 1, m_crColor ); 69 | byBit = 1; 70 | for( i = cRect.left; i < cRect.right; i++ ) 71 | { 72 | if ( m_byMask & byBit ) 73 | cDC.SelectObject( cPen ); 74 | else 75 | cDC.SelectObject( cPenBlack ); 76 | cDC.MoveTo( i, cRect.top ); 77 | cDC.LineTo( i, cRect.bottom ); 78 | byBit <<= 1; 79 | if ( byBit == 0x10 ) 80 | byBit = 1; 81 | } 82 | if ( !( m_byMask & 0x10 ) ) 83 | { 84 | cDC.SelectObject( cPenBlack ); 85 | for( i = cRect.top + 1; i < cRect.bottom; i += 2 ) 86 | { 87 | cDC.MoveTo( cRect.left, i ); 88 | cDC.LineTo( cRect.right, i ); 89 | } 90 | } 91 | cPen.DeleteObject(); 92 | } 93 | 94 | cPenBlack.DeleteObject(); 95 | 96 | cDC.Detach(); 97 | } 98 | 99 | void CColorButton::SetColor(COLORREF crColor, BYTE byMask) 100 | { 101 | m_crColor = crColor; 102 | m_byMask = byMask; 103 | 104 | Invalidate( FALSE ); 105 | } 106 | -------------------------------------------------------------------------------- /src/speaker.cpp: -------------------------------------------------------------------------------- 1 | // Speaker.cpp: implementation of the CSpeaker class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | #include "arch/frame/stdafx.h" 5 | #include "arch/directx/dxsound.h" 6 | #include "speaker.h" 7 | #include "appleclock.h" 8 | #include "aipcdefs.h" 9 | ////////////////////////////////////////////////////////////////////// 10 | // Construction/Destruction 11 | ////////////////////////////////////////////////////////////////////// 12 | 13 | extern WORD g_tblVolume[32]; 14 | #ifndef STEP 15 | #define STEP 0x8000 16 | #endif 17 | 18 | CSpeaker::CSpeaker() 19 | { 20 | int clock; 21 | m_nNumOfBuf = 1; 22 | m_lpwBuf = new LPWORD[1]; 23 | m_lpwBuf[0] = new WORD[SAMPLES_PER_SEC * BITS_PER_SAMPLE / 8]; 24 | clock = g_dwCPS; // 1MHz 25 | m_iUpdateStep = (int)( ( (double)STEP * g_DXSound.m_nSampleRate + clock / 2 ) / clock ); 26 | m_dwLastAppleClock = 0; 27 | m_iLastUpdatePos = -1; 28 | m_bToggle = FALSE; 29 | m_iVol = 28; 30 | } 31 | 32 | CSpeaker::~CSpeaker() 33 | { 34 | delete m_lpwBuf[0]; 35 | delete m_lpwBuf; 36 | } 37 | 38 | void CSpeaker::Update(int length) 39 | { 40 | // int currentStep = ( g_pBoard->GetClock() - m_dwLastAppleClock ) * m_iUpdateStep; 41 | int currentPos = length - 1; 42 | int i; 43 | if ( currentPos >= (signed)g_DXSound.m_nSampleRate * BITS_PER_SAMPLE / 8 ) 44 | currentPos = g_DXSound.m_nSampleRate * BITS_PER_SAMPLE / 8 - 1; 45 | 46 | if ( m_iLastUpdatePos == -1 && m_bToggle ) 47 | { 48 | m_bToggle = FALSE; 49 | for ( i = 0; i <= currentPos; i++ ) 50 | m_lpwBuf[0][i] = MAX_AMPLITUDE - MAX_AMPLITUDE * i / currentPos; 51 | } 52 | else 53 | { 54 | for( i = m_iLastUpdatePos+1; i <= currentPos; i++ ) 55 | m_lpwBuf[0][i] = ( m_bToggle ) ? MAX_AMPLITUDE : 0; 56 | } 57 | 58 | // m_bToggle = FALSE; 59 | 60 | m_iLastUpdatePos = -1; 61 | m_dwLastAppleClock = g_pBoard->GetClock(); 62 | } 63 | 64 | void CSpeaker::Toggle() 65 | { 66 | unsigned int currentStep = ( g_pBoard->GetClock() - m_dwLastAppleClock ) * m_iUpdateStep; 67 | unsigned int currentPos = currentStep / STEP; 68 | int left = STEP - currentStep + ( currentPos * STEP ); 69 | unsigned int i; 70 | 71 | if ( currentPos >= SAMPLES_PER_SEC * BITS_PER_SAMPLE / 8 ) 72 | { 73 | currentPos = SAMPLES_PER_SEC * BITS_PER_SAMPLE / 8 - 1; 74 | left = 0; 75 | } 76 | 77 | for( i = m_iLastUpdatePos+1; i <= currentPos; i++ ) 78 | m_lpwBuf[0][i] = ( m_bToggle ) ? MAX_AMPLITUDE : 0; 79 | 80 | 81 | m_iLastUpdatePos = currentPos; 82 | m_bToggle = !m_bToggle; 83 | m_lpwBuf[0][currentPos] += ( m_bToggle ) ? MAX_AMPLITUDE * left / STEP : -MAX_AMPLITUDE * left / STEP; 84 | } 85 | 86 | void CSpeaker::ChangeSampleRate() 87 | { 88 | int clock; 89 | clock = g_dwCPS; // 1MHz 90 | m_iUpdateStep = (int)( (double)STEP * (double)g_DXSound.m_nSampleRate / clock + .5 ); 91 | m_dwLastAppleClock = g_pBoard->GetClock(); 92 | m_iLastUpdatePos = -1; 93 | m_bToggle = FALSE; 94 | } 95 | -------------------------------------------------------------------------------- /dx80/include/dmort.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DMORt.h 3 | // 4 | // Desc: Miscellaneous runtime support for DirectShow Media Objects 5 | // 6 | // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __DMORT_H__ 11 | #define __DMORT_H__ 12 | 13 | // 14 | // Mediatype helpers. MoInitMediaType() goes with MoFreeMediaType(), 15 | // MoCreateMediaType() goes with MoDeleteMediaType() - don't mix ! 16 | // 17 | 18 | 19 | 20 | // 21 | // Takes a pointer to an already allocated DMO_MEDIA_TYPE structure, allocates 22 | // a format block of cbFormat bytes, and sets appropriate members of 23 | // DMO_MEDIA_TYPE to point to the newly allocated format block. Also 24 | // initializes the IUnknown pointer inside DMO_MEDIA_TYPE to NULL. 25 | // 26 | // The format block allocated by MoInitMediaType must be freed by calling 27 | // MoFreeMediaType(). 28 | // 29 | STDAPI MoInitMediaType(DMO_MEDIA_TYPE *pmt, DWORD cbFormat); 30 | 31 | // 32 | // Frees the format block and releases any IUnknown, but does not free the 33 | // DMO_MEDIA_TYPE structure itself. Input parameter must point to an 34 | // DMO_MEDIA_TYPE structure previously initialized by MoInitMediaType(). 35 | // 36 | STDAPI MoFreeMediaType(DMO_MEDIA_TYPE *pmt); 37 | 38 | // 39 | // Copies the DMO_MEDIA_TYPE members. Also duplicates the format block and 40 | // the IUnknown pointer. Both parameters must point to valid DMO_MEDIA_TYPE 41 | // structures. Target structure must be later freed using MoFreeMediaType(). 42 | // 43 | STDAPI MoCopyMediaType(DMO_MEDIA_TYPE *pmtDest, const DMO_MEDIA_TYPE *pmtSrc); 44 | 45 | 46 | 47 | // 48 | // Allocates a new DMO_MEDIA_TYPE structure and initializes it just like 49 | // MoInitMediaType. I.e., this function allocates both the format block 50 | // and the DMO_MEDIA_TYPE structure itself. Pointer to DMO_MEDIA_TYPE is 51 | // returned as *ppmt. 52 | // 53 | // DMO_MEDIA_TYPE structures allocated by MoCreateMediaType() must be freed 54 | // by calling MoDeleteMediaType(). 55 | // 56 | STDAPI MoCreateMediaType(DMO_MEDIA_TYPE **ppmt, DWORD cbFormat); 57 | 58 | // 59 | // Frees any format block, releases any IUnknown, and deletes the 60 | // DMO_MEDIA_TYPE structure itself. The input parameter must point to an 61 | // DMO_MEDIA_TYPE structure previously allocated by MoCreateMediaType(). 62 | // 63 | STDAPI MoDeleteMediaType(DMO_MEDIA_TYPE *pmt); 64 | 65 | // 66 | // Allocates a new DMO_MEDIA_TYPE structure and copies pmtSrc into it like 67 | // MoCopyMediaType. I.e., this function allocates a new DMO_MEDIA_TYPE struct 68 | // as well as a new format block for the target mediatype. Trager mediatype 69 | // must later be freed using MoDeleteMediaType(). 70 | // 71 | STDAPI MoDuplicateMediaType(DMO_MEDIA_TYPE **ppmtDest, const DMO_MEDIA_TYPE *pmtSrc); 72 | 73 | 74 | 75 | #endif //__DMORT_H__ 76 | -------------------------------------------------------------------------------- /dx80/include/vptype.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: VPType.h 3 | // 4 | // Desc: This file includes all the data structures defined for the IVPConfig 5 | // interface. 6 | // 7 | // Copyright (c) 1997 - 2000, Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #ifndef __IVPType__ 12 | #define __IVPType__ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | // enum to specify the criterion, which the vpmixer is supposed to use 19 | // in order to select the video format 20 | typedef enum _AMVP_SELECT_FORMAT_BY 21 | { 22 | AMVP_DO_NOT_CARE, 23 | AMVP_BEST_BANDWIDTH, 24 | AMVP_INPUT_SAME_AS_OUTPUT 25 | } AMVP_SELECT_FORMAT_BY; 26 | 27 | // enum to specify the various mode 28 | typedef enum _AMVP_MODE 29 | { 30 | AMVP_MODE_WEAVE, 31 | AMVP_MODE_BOBINTERLEAVED, 32 | AMVP_MODE_BOBNONINTERLEAVED, 33 | AMVP_MODE_SKIPEVEN, 34 | AMVP_MODE_SKIPODD 35 | } AMVP_MODE; 36 | 37 | // struct to specify the width and height. The context could be anything 38 | // such as scaling cropping etc. 39 | typedef struct _AMVPSIZE 40 | { 41 | DWORD dwWidth; // the width 42 | DWORD dwHeight; // the height 43 | } AMVPSIZE, *LPAMVPSIZE; 44 | 45 | // struct to specify the dimensional characteristics of the input stream 46 | typedef struct _AMVPDIMINFO 47 | { 48 | DWORD dwFieldWidth; // Field height of the data 49 | DWORD dwFieldHeight; // Field width of the data 50 | DWORD dwVBIWidth; // Width of the VBI data 51 | DWORD dwVBIHeight; // Height of the VBI data 52 | RECT rcValidRegion; // The vaild rectangle, used for cropping 53 | } AMVPDIMINFO, *LPAMVPDIMINFO; 54 | 55 | // struct to specify the various data specific characteristics of the input stream 56 | typedef struct _AMVPDATAINFO 57 | { 58 | DWORD dwSize; // Size of the struct 59 | DWORD dwMicrosecondsPerField; // Time taken by each field 60 | AMVPDIMINFO amvpDimInfo; // Dimensional Information 61 | DWORD dwPictAspectRatioX; // X dimension of Picture Aspect Ratio 62 | DWORD dwPictAspectRatioY; // Y dimension of Picture Aspect Ratio 63 | BOOL bEnableDoubleClock; // Videoport should enable double clocking 64 | BOOL bEnableVACT; // Videoport should use an external VACT signal 65 | BOOL bDataIsInterlaced; // Indicates that the signal is interlaced 66 | LONG lHalfLinesOdd; // number of halflines in the odd field 67 | BOOL bFieldPolarityInverted; // Device inverts the polarity by default 68 | DWORD dwNumLinesInVREF; // Number of lines of data in VREF 69 | LONG lHalfLinesEven; // number of halflines in the even field 70 | DWORD dwReserved1; // Reserved for future use 71 | } AMVPDATAINFO, *LPAMVPDATAINFO; 72 | 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif // __IVPType__ 79 | -------------------------------------------------------------------------------- /include/arch/frame/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__773A52F9_856B_48ED_8E9A_1F1616291758__INCLUDED_) 7 | #define AFX_STDAFX_H__773A52F9_856B_48ED_8E9A_1F1616291758__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 14 | 15 | #include // MFC core and standard components 16 | #include // MFC extensions 17 | #include // MFC Automation classes 18 | #include // MFC support for Internet Explorer 4 Common Controls 19 | #ifndef _AFX_NO_AFXCMN_SUPPORT 20 | #include // MFC support for Windows Common Controls 21 | #endif // _AFX_NO_AFXCMN_SUPPORT 22 | 23 | #include "afxmt.h" 24 | 25 | #include "arch/resource.h" 26 | 27 | typedef void (*mem_write_handler) (void* objFrom, void* objTo, int nAddr, BYTE byData); 28 | typedef BYTE (*mem_read_handler) (void* objFrom, void* objTo, int nAddr); 29 | typedef void (*callback_handler) (void* objFrom, void* objTo, LPARAM lParam); 30 | 31 | typedef struct _STWriteHandler 32 | { 33 | void* objTo; 34 | mem_write_handler func; 35 | } STWriteHandler; 36 | 37 | typedef struct _STReadHandler 38 | { 39 | void* objTo; 40 | mem_read_handler func; 41 | } STReadHandler; 42 | 43 | typedef struct _STCallbackHandler 44 | { 45 | void* objTo; 46 | callback_handler func; 47 | } STCallbackHandler; 48 | 49 | #define WRITE_HANDLER(func) void func( void* objFrom, void* objTo, int nAddr, BYTE byData ) 50 | #define READ_HANDLER(func) void func( void* objFrom, void* objTo, int nAddr ) 51 | #define CALLBACK_HANDLER(func) void func( void* objFrom, void* objTo, LPARAM lParam ) 52 | 53 | #if defined _M_IX86 54 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 55 | #elif defined _M_IA64 56 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") 57 | #elif defined _M_X64 58 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 59 | #else 60 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 61 | #endif 62 | 63 | //{{AFX_INSERT_LOCATION}} 64 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 65 | 66 | #endif // !defined(AFX_STDAFX_H__773A52F9_856B_48ED_8E9A_1F1616291758__INCLUDED_) 67 | -------------------------------------------------------------------------------- /include/appleclock.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_APPLECLOCK_H__9316A5A3_197F_4B8F_8FAB_7E3A63861227__INCLUDED_) 2 | #define AFX_APPLECLOCK_H__9316A5A3_197F_4B8F_8FAB_7E3A63861227__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // AppleClock.h : header file 8 | // 9 | ///////////////////////////////////////////////////////////////////////////// 10 | // CAppleClock thread 11 | 12 | #include "arch/frame/screen.h" 13 | #include "arch/customthread.h" 14 | #include "keyboard.h" 15 | #include "memory.h" 16 | #include "65c02.h" 17 | #include "joystick.h" 18 | 19 | #include "messageque.h" 20 | #include "slots.h" 21 | #include "speaker.h" 22 | #include "lockmgr.h" 23 | #include "iou.h" 24 | #include "clocklistener.h" 25 | 26 | class CMainFrame; 27 | 28 | class CAppleClock : public CCustomThread, public CObject, public CClockListener 29 | { 30 | // Attributes 31 | public: 32 | CCpu* m_pCpu; 33 | CAppleIOU m_cIOU; 34 | CKeyboard m_keyboard; 35 | CJoystick m_joystick; 36 | CScreen *m_pScreen; 37 | CMainFrame* m_lpwndMainFrame; 38 | CSlots m_cSlots; 39 | 40 | CSpeaker m_cSpeaker; 41 | 42 | CEvent m_cMessage; 43 | BOOL m_bPALMode; 44 | BOOL m_bReserveLoadState; 45 | CString m_strStateFilePath; 46 | BOOL m_bSaveStateOnExit; 47 | 48 | int m_nMachineType; 49 | 50 | protected: 51 | CMessageQue m_queSignal; 52 | 53 | // Operations 54 | public: 55 | CAppleClock(); 56 | virtual ~CAppleClock(); 57 | 58 | void OnAfterDeactivate(); 59 | BOOL OnBeforeActivate(); 60 | void Exit(); 61 | DWORD GetClock(); 62 | BOOL Initialize(); 63 | void Resume(); 64 | void Suspend(BOOL bWait=TRUE); 65 | int GetAppleStatus(); 66 | void PowerOff(); 67 | void PowerOn(); 68 | double m_dClockSpeed; 69 | void ChangeMonitorType(); 70 | int GetMonitorType(); 71 | void Reboot(); 72 | void Reset(); 73 | void SetSignal(int signal); 74 | void OnConfigureSlots(); 75 | 76 | void SpeedUp(); 77 | void SpeedStable(); 78 | 79 | void OnDebug(); 80 | 81 | virtual void Run(); 82 | 83 | void Serialize( CArchive &archive ); 84 | void SetMachineType(int nMachineType, BOOL bPalMode); 85 | BOOL SaveState(CString strPath); 86 | BOOL LoadState(CString strPath); 87 | void ReserveLoadState(CString strPath) { 88 | m_strStateFilePath = strPath; 89 | m_bReserveLoadState = TRUE; 90 | } 91 | CString GetStateFilePath() { 92 | return m_strStateFilePath; 93 | } 94 | BOOL GetSaveStateOnExit() { 95 | return m_bSaveStateOnExit; 96 | } 97 | void SetStateFilePath(CString strPath, BOOL bSaveStateOnExit) { 98 | m_strStateFilePath = strPath; 99 | m_bSaveStateOnExit = bSaveStateOnExit; 100 | } 101 | 102 | // Implementation 103 | protected: 104 | DWORD m_dwClock; 105 | int m_nDrift; 106 | int m_nAppleStatus; 107 | virtual void Clock(unsigned int clock); 108 | }; 109 | 110 | extern CAppleClock *g_pBoard; 111 | extern int g_nSerializeVer; 112 | extern DWORD g_dwCPS; 113 | extern DWORD g_dwVBLClock; 114 | extern DWORD g_dwFrameClock; 115 | 116 | ///////////////////////////////////////////////////////////////////////////// 117 | 118 | //{{AFX_INSERT_LOCATION}} 119 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 120 | 121 | #endif // !defined(AFX_APPLECLOCK_H__9316A5A3_197F_4B8F_8FAB_7E3A63861227__INCLUDED_) 122 | -------------------------------------------------------------------------------- /licenses/src/ay8910.h: -------------------------------------------------------------------------------- 1 | #ifndef AY8910_H 2 | #define AY8910_H 3 | 4 | /* 5 | AY-3-8910A: 2 I/O ports 6 | AY-3-8912A: 1 I/O port 7 | AY-3-8913A: 0 I/O port 8 | AY8930: upper compatible with 8910. 9 | In extended mode, it has higher resolution and duty ratio setting 10 | YM2149: higher resolution 11 | YM3439: same as 2149 12 | YMZ284: 0 I/O port, different clock divider 13 | YMZ294: 0 I/O port 14 | */ 15 | 16 | 17 | #define ALL_8910_CHANNELS -1 18 | 19 | struct AY8910interface 20 | { 21 | read8_handler portAread; 22 | read8_handler portBread; 23 | write8_handler portAwrite; 24 | write8_handler portBwrite; 25 | }; 26 | 27 | void AY8910_set_volume(int chip,int channel,int volume); 28 | 29 | 30 | READ8_HANDLER( AY8910_read_port_0_r ); 31 | READ8_HANDLER( AY8910_read_port_1_r ); 32 | READ8_HANDLER( AY8910_read_port_2_r ); 33 | READ8_HANDLER( AY8910_read_port_3_r ); 34 | READ8_HANDLER( AY8910_read_port_4_r ); 35 | READ16_HANDLER( AY8910_read_port_0_lsb_r ); 36 | READ16_HANDLER( AY8910_read_port_1_lsb_r ); 37 | READ16_HANDLER( AY8910_read_port_2_lsb_r ); 38 | READ16_HANDLER( AY8910_read_port_3_lsb_r ); 39 | READ16_HANDLER( AY8910_read_port_4_lsb_r ); 40 | READ16_HANDLER( AY8910_read_port_0_msb_r ); 41 | READ16_HANDLER( AY8910_read_port_1_msb_r ); 42 | READ16_HANDLER( AY8910_read_port_2_msb_r ); 43 | READ16_HANDLER( AY8910_read_port_3_msb_r ); 44 | READ16_HANDLER( AY8910_read_port_4_msb_r ); 45 | 46 | WRITE8_HANDLER( AY8910_control_port_0_w ); 47 | WRITE8_HANDLER( AY8910_control_port_1_w ); 48 | WRITE8_HANDLER( AY8910_control_port_2_w ); 49 | WRITE8_HANDLER( AY8910_control_port_3_w ); 50 | WRITE8_HANDLER( AY8910_control_port_4_w ); 51 | WRITE16_HANDLER( AY8910_control_port_0_lsb_w ); 52 | WRITE16_HANDLER( AY8910_control_port_1_lsb_w ); 53 | WRITE16_HANDLER( AY8910_control_port_2_lsb_w ); 54 | WRITE16_HANDLER( AY8910_control_port_3_lsb_w ); 55 | WRITE16_HANDLER( AY8910_control_port_4_lsb_w ); 56 | WRITE16_HANDLER( AY8910_control_port_0_msb_w ); 57 | WRITE16_HANDLER( AY8910_control_port_1_msb_w ); 58 | WRITE16_HANDLER( AY8910_control_port_2_msb_w ); 59 | WRITE16_HANDLER( AY8910_control_port_3_msb_w ); 60 | WRITE16_HANDLER( AY8910_control_port_4_msb_w ); 61 | 62 | WRITE8_HANDLER( AY8910_write_port_0_w ); 63 | WRITE8_HANDLER( AY8910_write_port_1_w ); 64 | WRITE8_HANDLER( AY8910_write_port_2_w ); 65 | WRITE8_HANDLER( AY8910_write_port_3_w ); 66 | WRITE8_HANDLER( AY8910_write_port_4_w ); 67 | WRITE16_HANDLER( AY8910_write_port_0_lsb_w ); 68 | WRITE16_HANDLER( AY8910_write_port_1_lsb_w ); 69 | WRITE16_HANDLER( AY8910_write_port_2_lsb_w ); 70 | WRITE16_HANDLER( AY8910_write_port_3_lsb_w ); 71 | WRITE16_HANDLER( AY8910_write_port_4_lsb_w ); 72 | WRITE16_HANDLER( AY8910_write_port_0_msb_w ); 73 | WRITE16_HANDLER( AY8910_write_port_1_msb_w ); 74 | WRITE16_HANDLER( AY8910_write_port_2_msb_w ); 75 | WRITE16_HANDLER( AY8910_write_port_3_msb_w ); 76 | WRITE16_HANDLER( AY8910_write_port_4_msb_w ); 77 | 78 | /*********** An interface for SSG of YM2203 ***********/ 79 | 80 | void *ay8910_start_ym(sound_type chip_type, int sndindex, int clock, int streams, 81 | read8_handler portAread, read8_handler portBread, 82 | write8_handler portAwrite, write8_handler portBwrite); 83 | 84 | void ay8910_stop_ym(void *chip); 85 | void ay8910_reset_ym(void *chip); 86 | void ay8910_set_clock_ym(void *chip, int clock); 87 | void ay8910_write_ym(void *chip, int addr, int data); 88 | int ay8910_read_ym(void *chip); 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /dx80/include/DShow.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // Copyright (C) 2000 Microsoft Corporation. All Right Reserved. 3 | // 4 | // File: dshow.h 5 | // Content: DirectShow top-level include file 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __DSHOW_INCLUDED__ 9 | #define __DSHOW_INCLUDED__ 10 | 11 | /////////////////////////////////////////////////////////////////////////// 12 | // Set up constants & pragmas for the compiler 13 | /////////////////////////////////////////////////////////////////////////// 14 | #ifdef _MSC_VER 15 | // disable some level-4 warnings, use #pragma warning(enable:###) to re-enable 16 | #pragma warning(disable:4100) // warning C4100: unreferenced formal parameter 17 | #pragma warning(disable:4201) // warning C4201: nonstandard extension used : nameless struct/union 18 | #pragma warning(disable:4511) // warning C4511: copy constructor could not be generated 19 | #pragma warning(disable:4512) // warning C4512: assignment operator could not be generated 20 | #pragma warning(disable:4514) // warning C4514: "unreferenced inline function has been removed" 21 | 22 | #if _MSC_VER>=1100 23 | #define AM_NOVTABLE __declspec(novtable) 24 | #else 25 | #define AM_NOVTABLE 26 | #endif 27 | #endif // MSC_VER 28 | 29 | /////////////////////////////////////////////////////////////////////////// 30 | // Include standard Windows files 31 | /////////////////////////////////////////////////////////////////////////// 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #ifndef NUMELMS 39 | #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0])) 40 | #endif 41 | 42 | /////////////////////////////////////////////////////////////////////////// 43 | // Include DirectShow include files 44 | /////////////////////////////////////////////////////////////////////////// 45 | #include // Generated IDL header file for streams interfaces 46 | #include // ActiveMovie video interfaces and definitions 47 | #include // ActiveMovie audio interfaces and definitions 48 | #include // generated from control.odl 49 | #include // event code definitions 50 | #include // declaration of type GUIDs and well-known clsids 51 | #include // HRESULT status and error definitions 52 | #include // External device control interface defines 53 | #include // audio filter device error event codes 54 | #include // DVD error event codes 55 | 56 | /////////////////////////////////////////////////////////////////////////// 57 | // Define OLE Automation constants 58 | /////////////////////////////////////////////////////////////////////////// 59 | #ifndef OATRUE 60 | #define OATRUE (-1) 61 | #endif // OATRUE 62 | #ifndef OAFALSE 63 | #define OAFALSE (0) 64 | #endif // OAFALSE 65 | 66 | /////////////////////////////////////////////////////////////////////////// 67 | // Define Win64 interfaces if not already defined 68 | /////////////////////////////////////////////////////////////////////////// 69 | 70 | // InterlockedExchangePointer 71 | #ifndef InterlockedExchangePointer 72 | #define InterlockedExchangePointer(Target, Value) \ 73 | (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value)) 74 | #endif 75 | 76 | 77 | #endif // __DSHOW_INCLUDED__ 78 | -------------------------------------------------------------------------------- /dx80/include/dxsdk.inc: -------------------------------------------------------------------------------- 1 | !IFDEF BORLAND 2 | cc = bcc32 3 | rc = brc32 4 | link = ilink32 5 | bldlib = tlib 6 | cflags = -c -3 -j1 -X -Vd -I$(INCLUDE) 7 | rcflags = -r -fo 8 | linkflags = -n -V4.0 -aa 9 | !IFDEF main 10 | linkflags = $(linkflags) -ap 11 | borobjs=c0x32.obj 12 | !ELSE 13 | linkflags = $(linkflags) -Tpe 14 | borobjs=c0w32.obj 15 | !ENDIF 16 | linkflags = $(linkflags) -j$(LIB) -L$(LIB) 17 | libflags=$(OBJ_DIR)\$(proj).lib 18 | outobj = -o 19 | commas =, 20 | outexe= 21 | borlib=+ 22 | deflibs = import32.lib cw32mti.lib ole2w32.lib 23 | !IFDEF MFC 24 | cflags =$(cflags) -VF -w-hid -w-par -w-aus -w-inl -w-inq -WM -Vd /D_NO_VCL;_RTLDLL;_AFXDLL;_X86_;_WINDOWS;_MSC_VER=1100;WIN32; 25 | !IFDEF NODEBUG 26 | deflibs = bfc42.lib bfcs42.lib $(deflibs) 27 | !ELSE 28 | deflibs = BFC42D.lib BFCS42D.lib bfcd42d.lib bfco42d.lib bfcn42d.lib $(deflibs) 29 | !ENDIF 30 | !ENDIF 31 | 32 | d3dframe=..\..\lib\borland\d3dframe.lib 33 | 34 | !IFDEF nodebug 35 | cdebug = -Od 36 | linkdebug = /x 37 | cflags = $(cflags) /DNDEBUG; 38 | !ELSE 39 | cdebug = -Od -v -y 40 | linkdebug = /v 41 | cflags = $(cflags) /DDEBUG; 42 | !ENDIF 43 | 44 | !ELSE 45 | !IFDEF WATCOM 46 | cc = cl 47 | rc = rc 48 | link = link 49 | bldlib = lib 50 | deflibs = kernel32.lib gdi32.lib user32.lib advapi32.lib gdi32.lib comdlg32.lib winspool.lib shell32.lib winmm.lib comctl32.lib ole32.lib oleaut32.lib 51 | cflags = -c /D "WIN32" /D "_WINDOWS" 52 | !IFDEF NODEBUG 53 | cflags =$(cflags) /D "NDEBUG" 54 | cdebug = -Ox 55 | linkdebug = 56 | !IFDEF MFC 57 | cflags =$(cflags) /MD /D "_AFXDLL" 58 | !ELSE 59 | cflags =$(cflags) /ML 60 | !ENDIF 61 | !ELSE 62 | cflags =$(cflags) /D "DEBUG" 63 | cdebug = -Z7 -Ox 64 | linkdebug = -map -debug:full 65 | !IFDEF MFC 66 | cflags =$(cflags) /MDd /D "_AFXDLL" 67 | !ELSE 68 | cflags =$(cflags) /MLd 69 | !ENDIF 70 | !ENDIF 71 | rcflags = -r -fo 72 | linkflags = /INCREMENTAL:NO /NOLOGO 73 | !IFDEF main 74 | linkflags = $(linkflags) /SUBSYSTEM:CONSOLE 75 | !ELSE 76 | linkflags = $(linkflags) /SUBSYSTEM:WINDOWS 77 | !ENDIF 78 | libflags=/OUT:$(OBJ_DIR)\$(proj).lib 79 | outobj = -Fo 80 | commas= 81 | outexe=-out: 82 | borobjs= 83 | borlib= 84 | d3dframe=..\..\lib\watcom\d3dframe.lib 85 | 86 | !ELSE 87 | cc = cl 88 | rc = rc 89 | link = link 90 | bldlib = lib 91 | deflibs = kernel32.lib gdi32.lib user32.lib advapi32.lib gdi32.lib comdlg32.lib winspool.lib shell32.lib winmm.lib comctl32.lib ole32.lib oleaut32.lib 92 | cflags = -c /D "WIN32" /D "_WINDOWS" 93 | linkflags= 94 | !IFDEF NODEBUG 95 | cflags =$(cflags) /D "NDEBUG" 96 | cdebug = -Ox 97 | linkdebug = /RELEASE 98 | !IFDEF MFC 99 | cflags =$(cflags) /MD /D "_AFXDLL" 100 | !ELSE 101 | cflags =$(cflags) /ML 102 | !ENDIF 103 | !ELSE 104 | cflags = $(cflags) /D "DEBUG" 105 | cdebug = -Z7 -Ox 106 | linkdebug = -map -debug:full -debugtype:cv 107 | !IFDEF MFC 108 | cflags =$(cflags) /MDd /D "_AFXDLL" 109 | !ELSE 110 | linkflags = $(linkflags) /NODEFAULTLIB:LIBC 111 | cflags =$(cflags) /MLd 112 | !ENDIF 113 | !ENDIF 114 | cflags =$(cflags) 115 | rcflags = -r -fo 116 | linkflags = $(linkflags) /INCREMENTAL:NO /PDB:NONE /NOLOGO 117 | !IFDEF main 118 | linkflags = $(linkflags) /SUBSYSTEM:CONSOLE 119 | !ELSE 120 | linkflags = $(linkflags) /SUBSYSTEM:WINDOWS 121 | !ENDIF 122 | libflags=/OUT:$(OBJ_DIR)\$(proj).lib /SUBSYSTEM:WINDOWS 123 | outobj = -Fo 124 | commas= 125 | outexe=-out: 126 | borobjs= 127 | borlib= 128 | d3dframe=..\..\lib\d3dframe.lib 129 | 130 | !ENDIF 131 | !ENDIF 132 | -------------------------------------------------------------------------------- /src/arch/CommandLineOption.cpp: -------------------------------------------------------------------------------- 1 | #include "arch/CommandLineOption.h" 2 | 3 | CCommandLineOption::CCommandLineOption() : 4 | m_strDisk1Path(), 5 | m_strDisk2Path(), 6 | m_strStatePath(), 7 | m_strHardDiskPath(), 8 | m_bSaveOnExit(FALSE), 9 | m_bReboot(FALSE) 10 | { 11 | } 12 | 13 | CCommandLineOption::~CCommandLineOption() 14 | { 15 | } 16 | 17 | extern "C" 18 | TCHAR** 19 | CommandLineToArgv( 20 | const TCHAR* CmdLine, 21 | int* _argc 22 | ) 23 | { 24 | TCHAR** argv; 25 | TCHAR* _argv; 26 | ULONG len; 27 | ULONG argc; 28 | TCHAR a; 29 | ULONG i, j; 30 | 31 | BOOLEAN in_QM; 32 | BOOLEAN in_TEXT; 33 | BOOLEAN in_SPACE; 34 | 35 | len = _tcslen(CmdLine); 36 | i = ((len + 2) / 2)*sizeof(PVOID) + sizeof(PVOID); 37 | 38 | argv = (TCHAR**)LocalAlloc(LMEM_FIXED, 39 | i + (len + 2)*sizeof(TCHAR)); 40 | 41 | _argv = (TCHAR*)(((PUCHAR)argv) + i); 42 | 43 | argc = 0; 44 | argv[argc] = _argv; 45 | in_QM = FALSE; 46 | in_TEXT = FALSE; 47 | in_SPACE = TRUE; 48 | i = 0; 49 | j = 0; 50 | 51 | while (a = CmdLine[i]) { 52 | if (in_QM) { 53 | if (a == '\"') { 54 | in_QM = FALSE; 55 | } 56 | else { 57 | _argv[j] = a; 58 | j++; 59 | } 60 | } 61 | else { 62 | switch (a) { 63 | case '\"': 64 | in_QM = TRUE; 65 | in_TEXT = TRUE; 66 | if (in_SPACE) { 67 | argv[argc] = _argv + j; 68 | argc++; 69 | } 70 | in_SPACE = FALSE; 71 | break; 72 | case ' ': 73 | case '\t': 74 | case '\n': 75 | case '\r': 76 | if (in_TEXT) { 77 | _argv[j] = '\0'; 78 | j++; 79 | } 80 | in_TEXT = FALSE; 81 | in_SPACE = TRUE; 82 | break; 83 | default: 84 | in_TEXT = TRUE; 85 | if (in_SPACE) { 86 | argv[argc] = _argv + j; 87 | argc++; 88 | } 89 | _argv[j] = a; 90 | j++; 91 | in_SPACE = FALSE; 92 | break; 93 | } 94 | } 95 | i++; 96 | } 97 | _argv[j] = '\0'; 98 | argv[argc] = NULL; 99 | 100 | (*_argc) = argc; 101 | return argv; 102 | } 103 | 104 | BOOL CCommandLineOption::Parse(CString strCommandLine) 105 | { 106 | TCHAR** argv; 107 | int argc; 108 | int i; 109 | 110 | m_strErrorMsg = TEXT(""); 111 | m_strDisk1Path = TEXT(""); 112 | m_strDisk2Path = TEXT(""); 113 | m_strHardDiskPath = TEXT(""); 114 | m_strStatePath = TEXT(""); 115 | m_bSaveOnExit = FALSE; 116 | m_bReboot = FALSE; 117 | 118 | argv = CommandLineToArgv(strCommandLine, &argc); 119 | 120 | for (i = 1; i < argc; i++) 121 | { 122 | if (i < argc - 1) 123 | { 124 | if (_tcscmp(argv[i], TEXT("-d1")) == 0) 125 | { 126 | m_strDisk1Path = argv[i + 1]; 127 | i++; 128 | continue; 129 | } 130 | else if (_tcscmp(argv[i], TEXT("-d2")) == 0) 131 | { 132 | m_strDisk2Path = argv[i + 1]; 133 | i++; 134 | continue; 135 | } 136 | else if (_tcscmp(argv[i], TEXT("-h")) == 0) 137 | { 138 | m_strHardDiskPath = argv[i + 1]; 139 | i++; 140 | continue; 141 | } 142 | else if (_tcscmp(argv[i], TEXT("-s")) == 0) 143 | { 144 | m_strStatePath = argv[i + 1]; 145 | i++; 146 | continue; 147 | } 148 | } 149 | if (_tcscmp(argv[i], TEXT("-w")) == 0) 150 | { 151 | m_bSaveOnExit = TRUE; 152 | continue; 153 | } 154 | else if (_tcscmp(argv[i], TEXT("-r")) == 0) 155 | { 156 | m_bReboot = TRUE; 157 | continue; 158 | } 159 | break; 160 | } 161 | LocalFree(argv); 162 | if (i < argc) 163 | { 164 | m_strErrorMsg.Format(TEXT("Invalid argument: %s"), argv[i]); 165 | return FALSE; 166 | } 167 | return TRUE; 168 | } 169 | -------------------------------------------------------------------------------- /include/arch/frame/wcSliderButton.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------- 2 | | Slider popup Edit | 3 | | @ Roland Seah | 4 | | @ 15/02/2002 | 5 | -----------------------------------------------------------------------*/ 6 | #ifndef _WC_SLIDER_BUTTON_H 7 | #define _WC_SLIDER_BUTTON_H 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | // CColourPopup messages 14 | #define CSP_DELTAPOS WM_USER + 1201 // Colour Picker Selection change 15 | #define CSP_CLOSEUP WM_USER + 1202 // Colour Picker close up 16 | 17 | class wcSliderButton : public CEdit 18 | { 19 | DECLARE_DYNAMIC (wcSliderButton) 20 | // Construction 21 | public: 22 | wcSliderButton(void); 23 | 24 | // Attributes 25 | public: 26 | 27 | // Operations 28 | public: 29 | 30 | // Overrides 31 | // ClassWizard generated virtual function overrides 32 | //{{AFX_VIRTUAL(wcSliderButton) 33 | public: 34 | //}}AFX_VIRTUAL 35 | virtual BOOL Create(BOOL LeftBut, DWORD dwExStyle, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); 36 | 37 | // Implementation 38 | public: 39 | virtual ~wcSliderButton(); 40 | void SetLeftButton ( BOOL Left ); 41 | void SetPos ( int Pos ); 42 | int GetPos ( void ) { return m_Pos; }; 43 | void SetRange ( int nMin, int nMax ) { m_Min = nMin; m_Max = nMax; }; 44 | void SetRange ( int Pos, int nMin, int nMax ) { SetRange (nMin, nMax); SetPos (Pos); }; 45 | 46 | // Generated message map functions 47 | protected: 48 | enum 49 | { 50 | VALID = 0x00, 51 | OUT_OF_RANGE = 0x01, 52 | INVALID_CHAR = 0x02, 53 | MINUS_PLUS = 0x03 54 | }; 55 | 56 | void ButtonClicked(CPoint p ); // handles a mouse click on the button 57 | void DrawButton ( int nButtonState = 0 ); // draws the button 58 | BOOL ScreenPointInButtonRect ( CPoint point ); // checks if the given point is in the browse button 59 | void CheckPosRange ( void ); 60 | int GetPosPerc ( void ); 61 | void OnBadInput ( void ); 62 | virtual int IsValid ( void ) const; 63 | 64 | 65 | //{{AFX_MSG(wcSliderButton) 66 | afx_msg void OnUpdate(); 67 | afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); 68 | afx_msg void OnEnable(BOOL bEnable); 69 | afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 70 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 71 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 72 | afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); 73 | afx_msg LRESULT OnNcHitTest(CPoint point); 74 | afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); 75 | afx_msg void OnNcPaint(); 76 | afx_msg void OnSetFocus(CWnd* pOldWnd); 77 | afx_msg void OnSize(UINT nType, int cx, int cy); 78 | //}}AFX_MSG 79 | afx_msg LONG OnSliderDelta(UINT lParam, LONG wParam); 80 | afx_msg LONG OnSliderClose(UINT lParam, LONG wParam); 81 | DECLARE_MESSAGE_MAP() 82 | 83 | private: 84 | BOOL m_bButtonLeft; // browse button on left side of control? 85 | BOOL m_bMouseCaptured; // button has captured the mouse? 86 | int m_nButtonState; // current button state (up, down, or disabled) 87 | CRect m_rcButtonRect; // window coordinates of the button 88 | int m_Pos; 89 | int m_Min; 90 | int m_Max; 91 | }; 92 | 93 | ///////////////////////////////////////////////////////////////////////////// 94 | // DDV_/DDX_FileEditCtrl functions 95 | 96 | void DDX_SliderButtonCtrl (CDataExchange *pDX, int nIDC, wcSliderButton &rCFEC, BOOL LeftBut); 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | *.vc.opendb 10 | 11 | # User-specific files (MonoDevelop/Xamarin Studio) 12 | *.userprefs 13 | 14 | # Build results 15 | [Dd]ebug/ 16 | [Dd]ebugPublic/ 17 | [Rr]elease/ 18 | [Rr]eleases/ 19 | x64/ 20 | x86/ 21 | build/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | 26 | # Visual Studo 2015 cache/options directory 27 | .vs/ 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | # NUNIT 34 | *.VisualState.xml 35 | TestResult.xml 36 | 37 | # Build Results of an ATL Project 38 | [Dd]ebugPS/ 39 | [Rr]eleasePS/ 40 | dlldata.c 41 | 42 | *_i.c 43 | *_p.c 44 | *_i.h 45 | *.ilk 46 | *.meta 47 | *.obj 48 | *.pch 49 | *.pdb 50 | *.pgc 51 | *.pgd 52 | *.rsp 53 | *.sbr 54 | *.tlb 55 | *.tli 56 | *.tlh 57 | *.tmp 58 | *.tmp_proj 59 | *.log 60 | *.vspscc 61 | *.vssscc 62 | .builds 63 | *.pidb 64 | *.svclog 65 | *.scc 66 | 67 | # Chutzpah Test files 68 | _Chutzpah* 69 | 70 | # Visual C++ cache files 71 | ipch/ 72 | *.aps 73 | *.ncb 74 | *.opensdf 75 | *.sdf 76 | *.cachefile 77 | 78 | # Visual Studio profiler 79 | *.psess 80 | *.vsp 81 | *.vspx 82 | 83 | # TFS 2012 Local Workspace 84 | $tf/ 85 | 86 | # Guidance Automation Toolkit 87 | *.gpState 88 | 89 | # ReSharper is a .NET coding add-in 90 | _ReSharper*/ 91 | *.[Rr]e[Ss]harper 92 | *.DotSettings.user 93 | 94 | # JustCode is a .NET coding addin-in 95 | .JustCode 96 | 97 | # TeamCity is a build add-in 98 | _TeamCity* 99 | 100 | # DotCover is a Code Coverage Tool 101 | *.dotCover 102 | 103 | # NCrunch 104 | _NCrunch_* 105 | .*crunch*.local.xml 106 | 107 | # MightyMoose 108 | *.mm.* 109 | AutoTest.Net/ 110 | 111 | # Web workbench (sass) 112 | .sass-cache/ 113 | 114 | # Installshield output folder 115 | [Ee]xpress/ 116 | 117 | # DocProject is a documentation generator add-in 118 | DocProject/buildhelp/ 119 | DocProject/Help/*.HxT 120 | DocProject/Help/*.HxC 121 | DocProject/Help/*.hhc 122 | DocProject/Help/*.hhk 123 | DocProject/Help/*.hhp 124 | DocProject/Help/Html2 125 | DocProject/Help/html 126 | 127 | # Click-Once directory 128 | publish/ 129 | 130 | # Publish Web Output 131 | *.[Pp]ublish.xml 132 | *.azurePubxml 133 | # TODO: Comment the next line if you want to checkin your web deploy settings 134 | # but database connection strings (with potential passwords) will be unencrypted 135 | *.pubxml 136 | *.publishproj 137 | 138 | # NuGet Packages 139 | *.nupkg 140 | # The packages folder can be ignored because of Package Restore 141 | **/packages/* 142 | # except build/, which is used as an MSBuild target. 143 | !**/packages/build/ 144 | # Uncomment if necessary however generally it will be regenerated when needed 145 | #!**/packages/repositories.config 146 | 147 | # Windows Azure Build Output 148 | csx/ 149 | *.build.csdef 150 | 151 | # Windows Store app package directory 152 | AppPackages/ 153 | 154 | # Others 155 | *.[Cc]ache 156 | ClientBin/ 157 | [Ss]tyle[Cc]op.* 158 | ~$* 159 | *~ 160 | *.dbmdl 161 | *.dbproj.schemaview 162 | *.pfx 163 | *.publishsettings 164 | node_modules/ 165 | bower_components/ 166 | 167 | # RIA/Silverlight projects 168 | Generated_Code/ 169 | 170 | # Backup & report files from converting an old project file 171 | # to a newer Visual Studio version. Backup files are not needed, 172 | # because we have git ;-) 173 | _UpgradeReport_Files/ 174 | Backup*/ 175 | UpgradeLog*.XML 176 | UpgradeLog*.htm 177 | 178 | # SQL Server files 179 | *.mdf 180 | *.ldf 181 | 182 | # Business Intelligence projects 183 | *.rdl.data 184 | *.bim.layout 185 | *.bim_*.settings 186 | 187 | # Microsoft Fakes 188 | FakesAssemblies/ 189 | 190 | # Node.js Tools for Visual Studio 191 | .ntvs_analysis.dat 192 | 193 | # Visual Studio 6 build log 194 | *.plg 195 | 196 | # Visual Studio 6 workspace options file 197 | *.opt 198 | 199 | -------------------------------------------------------------------------------- /include/arch/frame/mainfrm.h: -------------------------------------------------------------------------------- 1 | // MainFrm.h : interface of the CMainFrame class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MAINFRM_H__9DAB2781_4BAC_4D3D_BE80_BB3BF894A70E__INCLUDED_) 6 | #define AFX_MAINFRM_H__9DAB2781_4BAC_4D3D_BE80_BB3BF894A70E__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include "appleclock.h" 13 | #include "arch/frame/screen.h" 14 | #include "arch/frame/applestatusbar.h" 15 | 16 | class CMainFrame : public CFrameWnd 17 | { 18 | DECLARE_DYNAMIC(CMainFrame) 19 | 20 | public: 21 | CMainFrame(); 22 | protected: 23 | 24 | // Attributes 25 | public: 26 | CAppleStatusBar m_wndStatusBar; 27 | CToolBar m_wndToolBar; 28 | CScreen m_wndView; 29 | CMenu m_cMenu; 30 | 31 | // Operations 32 | public: 33 | 34 | // Overrides 35 | // ClassWizard generated virtual function overrides 36 | //{{AFX_VIRTUAL(CMainFrame) 37 | public: 38 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 39 | virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); 40 | protected: 41 | virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder); 42 | //}}AFX_VIRTUAL 43 | 44 | // Implementation 45 | public: 46 | CRect m_winRect; 47 | POINT m_stWindowPos; 48 | BOOL m_bDoubleSize; 49 | BOOL m_bFullScreen; 50 | BOOL m_bKeyboardCapture; 51 | HCURSOR m_hCursor; 52 | POINT m_stCursorPos; 53 | RECT m_stCursorClip; 54 | virtual ~CMainFrame(); 55 | #ifdef _DEBUG 56 | virtual void AssertValid() const; 57 | virtual void Dump(CDumpContext& dc) const; 58 | #endif 59 | void ResizeWindow(); 60 | 61 | protected: 62 | //{{AFX_MSG(CMainFrame) 63 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 64 | afx_msg void OnDebug(); 65 | afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 66 | afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); 67 | afx_msg void OnConfigureSlots(); 68 | afx_msg void OnReboot(); 69 | afx_msg void OnReset(); 70 | afx_msg void OnMonitor(); 71 | afx_msg void OnChangeSize(); 72 | afx_msg void OnUpdateMonitor(CCmdUI* pCmdUI); 73 | afx_msg void OnPowerOn(); 74 | afx_msg void OnUpdatePowerOn(CCmdUI* pCmdUI); 75 | afx_msg void OnPowerOff(); 76 | afx_msg void OnUpdatePowerOff(CCmdUI* pCmdUI); 77 | afx_msg void OnUpdateReset(CCmdUI* pCmdUI); 78 | afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); 79 | afx_msg void OnPower(); 80 | afx_msg void OnDiskette(); 81 | afx_msg void OnUpdatePower(CCmdUI* pCmdUI); 82 | afx_msg void OnClose(); 83 | afx_msg LRESULT OnReqAcquire(WPARAM wParam, LPARAM lParam); 84 | afx_msg LRESULT OnKeyDown(WPARAM wParam, LPARAM lParam); 85 | afx_msg LRESULT OnKeyUp(WPARAM wParam, LPARAM lParam); 86 | afx_msg LRESULT OnKeyRepeat(WPARAM wParam, LPARAM lParam); 87 | afx_msg void OnToggleFullScreen(); 88 | afx_msg void OnKillFocus(CWnd* pNewWnd); 89 | afx_msg void OnHarddisk(); 90 | afx_msg void OnUpdateDiskette(CCmdUI* pCmdUI); 91 | afx_msg void OnUpdateHarddisk(CCmdUI* pCmdUI); 92 | afx_msg void OnUpdateScanline(CCmdUI* pCmdUI); 93 | afx_msg void OnUpdateSuspend(CCmdUI* pCmdUI); 94 | afx_msg void OnUpdateResume(CCmdUI* pCmdUI); 95 | afx_msg void OnScanline(); 96 | afx_msg void OnSetFocus(CWnd* pOldWnd); 97 | afx_msg void OnSuspend(); 98 | afx_msg void OnResume(); 99 | afx_msg void OnSuspendResume(); 100 | afx_msg void OnRawInput(UINT nInputcode, HRAWINPUT hRawInput); 101 | afx_msg void OnPaste(); 102 | afx_msg void OnStopPaste(); 103 | afx_msg void OnUpdatePaste(CCmdUI* pCmdUI); 104 | afx_msg void OnUpdateStopPaste(CCmdUI* pCmdUI); 105 | //}}AFX_MSG 106 | DECLARE_MESSAGE_MAP() 107 | }; 108 | 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | //{{AFX_INSERT_LOCATION}} 112 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 113 | 114 | #endif // !defined(AFX_MAINFRM_H__9DAB2781_4BAC_4D3D_BE80_BB3BF894A70E__INCLUDED_) 115 | -------------------------------------------------------------------------------- /src/arch/frame/dlgsettingssound.cpp: -------------------------------------------------------------------------------- 1 | // F:\night_project\appleinpc\src\arch\frame\dlgsettingssound.cpp : implementation file 2 | // 3 | 4 | #include "arch/frame/stdafx.h" 5 | #include "afxdialogex.h" 6 | #include "aipcdefs.h" 7 | #include "dlgsettingssound.h" 8 | #include "arch/directx/dxsound.h" 9 | #include "appleclock.h" 10 | 11 | // CDlgSettingsSound dialog 12 | 13 | IMPLEMENT_DYNAMIC(CDlgSettingsSound, CDialogEx) 14 | 15 | CDlgSettingsSound::CDlgSettingsSound(CWnd* pParent /*=NULL*/) 16 | : CDialogEx(IDD_SETTINGS_SOUND, pParent) 17 | , m_bMute(FALSE) 18 | , m_bSpeakerMute(FALSE) 19 | { 20 | 21 | } 22 | 23 | CDlgSettingsSound::~CDlgSettingsSound() 24 | { 25 | } 26 | 27 | void CDlgSettingsSound::DoDataExchange(CDataExchange* pDX) 28 | { 29 | CDialogEx::DoDataExchange(pDX); 30 | DDX_Control(pDX, IDC_MASTER_BALANCE, m_cBalance); 31 | DDX_Control(pDX, IDC_MASTER_VOLUME, m_cVolume); 32 | DDX_Control(pDX, IDC_SPEAKER_VOLUME, m_cSpeakerVolume); 33 | DDX_Check(pDX, IDC_MASTER_MUTE, m_bMute); 34 | DDX_Check(pDX, IDC_SPEAKER_MUTE, m_bSpeakerMute); 35 | } 36 | 37 | 38 | BEGIN_MESSAGE_MAP(CDlgSettingsSound, CDialogEx) 39 | ON_WM_CTLCOLOR() 40 | END_MESSAGE_MAP() 41 | 42 | 43 | // CDlgSettingsSound message handlers 44 | 45 | 46 | HBRUSH CDlgSettingsSound::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 47 | { 48 | HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); 49 | 50 | // TODO: Change any attributes of the DC here 51 | if (m_cBalance.m_hWnd == pWnd->m_hWnd || 52 | m_cVolume.m_hWnd == pWnd->m_hWnd || 53 | m_cSpeakerVolume.m_hWnd == pWnd->m_hWnd ) 54 | { 55 | return (HBRUSH)::GetStockObject(WHITE_BRUSH); 56 | } 57 | // TODO: Return a different brush if the default is not desired 58 | return hbr; 59 | } 60 | 61 | 62 | void CDlgSettingsSound::OnOK() 63 | { 64 | int nVol; 65 | 66 | UpdateData(TRUE); 67 | 68 | // master volume 69 | nVol = m_cVolume.GetPos(); 70 | if (nVol == 0) 71 | g_DXSound.SetVolume(0); 72 | else 73 | g_DXSound.SetVolume(5 - nVol); 74 | g_DXSound.SetPan(m_cBalance.GetPos()); 75 | g_DXSound.m_bMute = m_bMute; 76 | nVol = m_cSpeakerVolume.GetPos(); 77 | if (nVol == 0) 78 | g_pBoard->m_cSpeaker.SetVolume(0); 79 | else 80 | g_pBoard->m_cSpeaker.SetVolume(5 - nVol); // nVol is -26 to 0 81 | g_pBoard->m_cSpeaker.m_bMute = m_bSpeakerMute; 82 | 83 | CDialogEx::OnOK(); 84 | } 85 | 86 | void CDlgSettingsSound::OnCancel() 87 | { 88 | // TODO: Add your specialized code here and/or call the base class 89 | 90 | CDialogEx::OnCancel(); 91 | } 92 | 93 | 94 | BOOL CDlgSettingsSound::OnInitDialog() 95 | { 96 | CDialogEx::OnInitDialog(); 97 | 98 | int nPan; 99 | int nVol; 100 | 101 | // Master Volume 102 | m_cVolume.SetRange(-26, 0, FALSE); 103 | m_cVolume.SetTicFreq(2); 104 | m_cVolume.SetPageSize(4); 105 | m_cBalance.SetRange(-6, 6, FALSE); 106 | m_cBalance.SetTicFreq(3); 107 | m_cBalance.SetPageSize(3); 108 | 109 | nPan = g_DXSound.GetPan(); 110 | m_cBalance.SetPos(nPan); 111 | m_bMute = g_DXSound.m_bMute; 112 | 113 | nVol = g_DXSound.GetVolume(); 114 | if (nVol <= 5) 115 | m_cVolume.SetPos(0); 116 | else 117 | m_cVolume.SetPos(5 - nVol); 118 | 119 | // Speaker Volume 120 | m_cSpeakerVolume.SetRange(-26, 0, FALSE); 121 | m_cSpeakerVolume.SetTicFreq(2); 122 | m_cSpeakerVolume.SetPageSize(2); 123 | 124 | nVol = g_pBoard->m_cSpeaker.m_iVol; 125 | if (nVol <= 5) 126 | m_cSpeakerVolume.SetPos(0); 127 | else 128 | m_cSpeakerVolume.SetPos(5 - nVol); 129 | m_bSpeakerMute = g_pBoard->m_cSpeaker.m_bMute; 130 | 131 | UpdateData(FALSE); 132 | 133 | return TRUE; // return TRUE unless you set the focus to a control 134 | // EXCEPTION: OCX Property Pages should return FALSE 135 | } 136 | 137 | 138 | 139 | BOOL CDlgSettingsSound::PreTranslateMessage(MSG* pMsg) 140 | { 141 | if (pMsg->message == WM_KEYDOWN) 142 | { 143 | if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) 144 | { 145 | return TRUE; // Do not process further 146 | } 147 | } 148 | 149 | return CDialogEx::PreTranslateMessage(pMsg); 150 | } 151 | -------------------------------------------------------------------------------- /src/arch/frame/dlgsettingsinput.cpp: -------------------------------------------------------------------------------- 1 | // F:\night_project\appleinpc\src\arch\frame\dlgsettingsinput.cpp : implementation file 2 | // 3 | 4 | #include "arch/frame/stdafx.h" 5 | #include "afxdialogex.h" 6 | #include "aipcdefs.h" 7 | #include "dlgsettingsinput.h" 8 | #include "arch/directx/dikeyboard.h" 9 | #include "appleclock.h" 10 | 11 | extern CDIKeyboard g_cDIKeyboard; 12 | 13 | const int CDlgSettingsInput::m_anDeadZoneList[] = { 0, 10, 20 }; 14 | const int CDlgSettingsInput::m_anSaturationList[] = { 100, 95, 85, 70, 50 }; 15 | 16 | // CDlgSettingsInput dialog 17 | 18 | IMPLEMENT_DYNAMIC(CDlgSettingsInput, CDialogEx) 19 | 20 | CDlgSettingsInput::CDlgSettingsInput(CWnd* pParent /*=NULL*/) 21 | : CDialogEx(IDD_SETTINGS_INPUT, pParent) 22 | , m_bArrowAsPaddle(FALSE) 23 | , m_bSwapButtons(FALSE) 24 | { 25 | 26 | } 27 | 28 | CDlgSettingsInput::~CDlgSettingsInput() 29 | { 30 | } 31 | 32 | void CDlgSettingsInput::DoDataExchange(CDataExchange* pDX) 33 | { 34 | CDialogEx::DoDataExchange(pDX); 35 | 36 | DDX_SliderButtonCtrl(pDX, IDC_KEYBOARD_DELAY, m_cKeyDelay, 0); 37 | DDX_SliderButtonCtrl(pDX, IDC_KEYBOARD_REPEAT, m_cKeyRepeat, 0); 38 | DDX_Control(pDX, IDC_JOYDEAD, m_cJoyDead); 39 | DDX_Control(pDX, IDC_JOYSAT, m_cJoySat); 40 | DDX_Check(pDX, IDC_ARRAW_AS_PADDLE, m_bArrowAsPaddle); 41 | DDX_Check(pDX, IDC_SWAP_BUTTON_1_2, m_bSwapButtons); 42 | } 43 | 44 | 45 | BEGIN_MESSAGE_MAP(CDlgSettingsInput, CDialogEx) 46 | 47 | END_MESSAGE_MAP() 48 | 49 | 50 | // CDlgSettingsInput message handlers 51 | 52 | 53 | void CDlgSettingsInput::OnOK() 54 | { 55 | int nSelect; 56 | 57 | UpdateData(TRUE); 58 | 59 | // keyboard 60 | g_cDIKeyboard.SetDelayTime(m_cKeyRepeat.GetPos(), m_cKeyDelay.GetPos()); 61 | 62 | // joystick 63 | nSelect = m_cJoyDead.GetCurSel(); 64 | g_pBoard->m_joystick.SetDeadZone(m_anDeadZoneList[nSelect]); 65 | nSelect = m_cJoySat.GetCurSel(); 66 | g_pBoard->m_joystick.SetSaturation(m_anSaturationList[nSelect]); 67 | g_pBoard->m_joystick.SetArrayAsPaddle(m_bArrowAsPaddle != 0); 68 | g_pBoard->m_joystick.SetSwapButtons(m_bSwapButtons != 0); 69 | 70 | CDialogEx::OnOK(); 71 | } 72 | 73 | void CDlgSettingsInput::OnCancel() 74 | { 75 | // TODO: Add your specialized code here and/or call the base class 76 | 77 | CDialogEx::OnCancel(); 78 | } 79 | 80 | 81 | BOOL CDlgSettingsInput::OnInitDialog() 82 | { 83 | CDialogEx::OnInitDialog(); 84 | int nKeyRepeat; 85 | int nKeyDelay; 86 | int i; 87 | 88 | // keyboard 89 | g_cDIKeyboard.GetDelayTime(&nKeyRepeat, &nKeyDelay); 90 | m_cKeyRepeat.SetRange(nKeyRepeat, 15, 100); 91 | m_cKeyDelay.SetRange(nKeyDelay, 250, 1000); 92 | 93 | // Joystick 94 | CString strValue; 95 | int nSelect = 0; 96 | int nCheckValue = g_pBoard->m_joystick.GetDeadZone(); 97 | for (i = 0; i < sizeof(m_anDeadZoneList) / sizeof(m_anDeadZoneList[0]); i++) 98 | { 99 | strValue.Format(TEXT("%d"), m_anDeadZoneList[i]); 100 | m_cJoyDead.AddString(strValue); 101 | if (m_anDeadZoneList[i] == nCheckValue) 102 | { 103 | nSelect = i; 104 | } 105 | } 106 | m_cJoyDead.SetCurSel(nSelect); 107 | 108 | nSelect = 0; 109 | nCheckValue = g_pBoard->m_joystick.GetSaturation(); 110 | for (i = 0; i < sizeof(m_anSaturationList) / sizeof(m_anSaturationList[0]); i++) 111 | { 112 | strValue.Format(TEXT("%d"), m_anSaturationList[i]); 113 | m_cJoySat.AddString(strValue); 114 | if (m_anSaturationList[i] == nCheckValue) 115 | { 116 | nSelect = i; 117 | } 118 | } 119 | m_cJoySat.SetCurSel(nSelect); 120 | 121 | m_bSwapButtons = g_pBoard->m_joystick.GetSwapButtons(); 122 | m_bArrowAsPaddle = g_pBoard->m_joystick.GetArrowAsPaddle(); 123 | 124 | UpdateData(FALSE); 125 | return TRUE; // return TRUE unless you set the focus to a control 126 | // EXCEPTION: OCX Property Pages should return FALSE 127 | } 128 | 129 | 130 | BOOL CDlgSettingsInput::PreTranslateMessage(MSG* pMsg) 131 | { 132 | if (pMsg->message == WM_KEYDOWN) 133 | { 134 | if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) 135 | { 136 | return TRUE; // Do not process further 137 | } 138 | } 139 | 140 | return CDialogEx::PreTranslateMessage(pMsg); 141 | } 142 | -------------------------------------------------------------------------------- /include/arch/directx/dijoystick.h: -------------------------------------------------------------------------------- 1 | // DIJoystick.h: interface for the CDIJoystick class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DIJOYSTICK_H__D1950720_938F_4491_A3E3_583B1FB98E2C__INCLUDED_) 6 | #define AFX_DIJOYSTICK_H__D1950720_938F_4491_A3E3_583B1FB98E2C__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #pragma comment (lib, "dxguid.lib") 13 | #pragma comment (lib, "dinput.lib") 14 | 15 | #include 16 | #include "arch/directx/dibase.h" 17 | #define MAXJOYBUTTONS 256 18 | 19 | class CDIJoystick : public CDIBase 20 | { 21 | public: 22 | CDIJoystick(); 23 | virtual ~CDIJoystick(); 24 | 25 | bool Enumerate(); // Start Enumeration of Attached Joystick Devices 26 | void SetPreferredDevice(GUID* pguid); // Set the current GUID for joystick device. 27 | int HowManyButtons(void); // Find out how many buttons the attached device has 28 | 29 | TCHAR* GetFirstButtonName(void); // Get First Joystick Button Friendly Name For Enumerated Device (Must be called before GetNextJoystickID() 30 | TCHAR* GetNextButtonName(); // Get First Joystick Button Friendly Name For Enumerated Device 31 | 32 | bool IsJoystickLeft(void) {return m_JoyLeft;}; // Is Joystick Being Moved Left? 33 | bool IsJoystickRight(void) {return m_JoyRight;}; // Is Joystick Being Moved Right? 34 | bool IsJoystickUp(void) {return m_JoyUp;}; // Is Joystick Being Moved Up? 35 | bool IsJoystickDown(void) { return m_JoyDown;}; // Is Joystick Being Moved Down? 36 | // bool IsJoystickFire(void) { return m_JoyFire1;}; // Has Any Fire Button Been Pressed? 37 | // bool IsJoystickFire(int button) { return m_JoyFire[button%MAXJOYBUTTONS];}; // Has a specific button been pressed? 38 | bool IsJoystickFire(int button) 39 | { 40 | if ( button >= sizeof( m_dijs.rgbButtons ) ) 41 | return false; 42 | return ( m_dijs.rgbButtons[button] & 0x80 ) ? true : false; 43 | }; // Has a specific button been pressed? 44 | 45 | DIJOYSTATE2* GetJoystickStateInfo(void) { return &m_dijs; }; 46 | void RunControlPanel(void); // Run the Control Panel 47 | 48 | bool InitJoystick(void); // Initialise the Joystick 49 | 50 | // Derived from CDIBase 51 | void SetHWND(CWnd *cwnd); 52 | void SetHWND(HWND hwnd); 53 | bool PollDevice(); // Update the device state. 54 | bool SetDeadZone( int nDeadZone ); 55 | bool SetSaturation( int nSaturation ); 56 | 57 | protected: 58 | int CountButtons(void); 59 | 60 | void ClearFriendlyButtonNames(void); // Clear Down Allocated Memory for Friendly Button Names 61 | 62 | // Derived from CDIBase 63 | void Shutdown(void); // Close down and de-allocate any memory assigned to this object. 64 | 65 | private: 66 | 67 | int m_nNumOfButtons; 68 | POSITION m_ButtonPOS; // Used in CPtrList to keep track of next item. 69 | DIJOYSTATE2 m_dijs; // Holds Joystick State Information 70 | GUID m_JoystickGUID; // Current Joystick GUID 71 | CPtrList m_DIButtonNames; // Contains a pointer list to Button Names for selected Joystick 72 | 73 | bool m_JoyLeft; // Generic Direction, Is Joystick Moving Left 74 | bool m_JoyUp; // Generic Direction, Is Joystick Moving Up 75 | bool m_JoyDown; // Generic Direction, Is Joystick Moving Down 76 | bool m_JoyRight; // Generic Direction, Is Joystick Moving Right 77 | // bool m_JoyFire[MAXJOYBUTTONS]; // Which Fire Button Has Been Pressed? 78 | // bool m_JoyFire1; // Has any fire button been pressed? 79 | 80 | 81 | 82 | char m_buffer[256]; // A Generic buffer 83 | 84 | 85 | ////////////////////////////////////////////////////////////////////// 86 | // Used for Force Feed Back, Not Yet Implemented 87 | ////////////////////////////////////////////////////////////////////// 88 | LPDIRECTINPUTEFFECT m_lpTriggerEffect; // For Force Feedback Effects 89 | LPDIRECTINPUTEFFECT m_lpStickyEffect; // For Force Feedback Effects 90 | LPDIRECTINPUTEFFECT m_lpResistEffect; // For Force Feedback Effects 91 | bool m_TriggerOK; 92 | BOOL m_FFAvailable; // Is device Force Feedback Compatible? 93 | GUID m_TriggerGuid; // GUID For Force Feed Back Device? 94 | }; 95 | #endif // !defined(AFX_DIJOYSTICK_H__D1950720_938F_4491_A3E3_583B1FB98E2C__INCLUDED_) 96 | -------------------------------------------------------------------------------- /dx80/include/amva.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AMVA.h 3 | // 4 | // Desc: DirectShowMotionComp include file. 5 | // 6 | // Copyright (c) 1997 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __AMVA_INCLUDED__ 11 | #define __AMVA_INCLUDED__ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | 18 | #define AMVA_TYPEINDEX_OUTPUTFRAME 0xFFFFFFFF 19 | 20 | // Flags for QueryRenderStatus 21 | #define AMVA_QUERYRENDERSTATUSF_READ 0x00000001 // Query for read 22 | // set this bit to 0 23 | // if query for update 24 | 25 | typedef struct _tag_AMVAUncompBufferInfo 26 | { 27 | DWORD dwMinNumSurfaces; // IN min number of surfaces to be allocated 28 | DWORD dwMaxNumSurfaces; // IN max number of surfaces to be allocated 29 | DDPIXELFORMAT ddUncompPixelFormat; // IN pixel format of surfaces to be allocated 30 | } AMVAUncompBufferInfo, *LPAMVAUncompBufferInfo; 31 | 32 | typedef struct _tag_AMVAUncompDataInfo 33 | { 34 | DWORD dwUncompWidth; // [in] width of uncompressed data 35 | DWORD dwUncompHeight; // [in] height of uncompressed data 36 | DDPIXELFORMAT ddUncompPixelFormat; // [in] pixel-format of uncompressed data 37 | } AMVAUncompDataInfo, *LPAMVAUncompDataInfo; 38 | 39 | typedef struct _tag_AMVAInternalMemInfo 40 | { 41 | DWORD dwScratchMemAlloc; // [out] amount of scratch memory will the hal allocate for its private use 42 | } AMVAInternalMemInfo, *LPAMVAInternalMemInfo; 43 | 44 | 45 | typedef struct _tag_AMVACompBufferInfo 46 | { 47 | DWORD dwNumCompBuffers; // [out] number of buffers reqd for compressed data 48 | DWORD dwWidthToCreate; // [out] Width of surface to create 49 | DWORD dwHeightToCreate; // [out] Height of surface to create 50 | DWORD dwBytesToAllocate; // [out] Total number of bytes used by each surface 51 | DDSCAPS2 ddCompCaps; // [out] caps to create surfaces to store compressed data 52 | DDPIXELFORMAT ddPixelFormat; // [out] fourcc to create surfaces to store compressed data 53 | } AMVACompBufferInfo, *LPAMVACompBufferInfo; 54 | 55 | 56 | // Note that you are NOT allowed to store any pointer in pMiscData 57 | typedef struct _tag_AMVABeginFrameInfo 58 | { 59 | DWORD dwDestSurfaceIndex; // IN destination buffer in which to decoding this frame 60 | LPVOID pInputData; // IN pointer to misc data 61 | DWORD dwSizeInputData; // IN size of other misc data to begin frame 62 | LPVOID pOutputData; // OUT pointer to data which the VGA is going to fill 63 | DWORD dwSizeOutputData; // IN size of data which the VGA is going to fill 64 | } AMVABeginFrameInfo, *LPAMVABeginFrameInfo; 65 | 66 | // Note that you are NOT allowed to store any pointer in pMiscData 67 | typedef struct _tag_AMVAEndFrameInfo 68 | { 69 | DWORD dwSizeMiscData; // [in] size of other misc data to begin frame 70 | LPVOID pMiscData; // [in] pointer to misc data 71 | } AMVAEndFrameInfo, *LPAMVAEndFrameInfo; 72 | 73 | typedef struct _tag_AMVABUFFERINFO 74 | { 75 | DWORD dwTypeIndex; // [in] Type of buffer 76 | DWORD dwBufferIndex; // [in] Buffer index 77 | DWORD dwDataOffset; // [in] offset of relevant data from the beginning of buffer 78 | DWORD dwDataSize; // [in] size of relevant data 79 | } AMVABUFFERINFO, *LPAMVABUFFERINFO; 80 | 81 | #ifdef __cplusplus 82 | }; 83 | #endif 84 | 85 | #endif // _AMVA_INCLUDED 86 | -------------------------------------------------------------------------------- /include/memory.h: -------------------------------------------------------------------------------- 1 | // Memory.h: interface for the Memory class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MEMORY_H__A8396EA1_6860_4A73_87B0_B68FAECE64F3__INCLUDED_) 6 | #define AFX_MEMORY_H__A8396EA1_6860_4A73_87B0_B68FAECE64F3__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | #define A2MEMSIZE 0x20000 // 128K 12 | #define A2ROMSIZE 0x4000 // 16k 13 | 14 | #define KEYBOARD 0xC000 15 | #define CLR80STORE 0xC000 16 | #define SET80STORE 0xC001 17 | #define RDMAINRAM 0xC002 18 | #define RDCARDRAM 0xC003 19 | #define WRMAINRAM 0xC004 20 | #define WRCARDRAM 0xC005 21 | #define SETSLOTCXROM 0xC006 22 | #define SETINTCXROM 0xC007 23 | #define SETSTDZP 0xC008 24 | #define SETALTZP 0xC009 25 | #define SETINTC3ROM 0xC00A 26 | #define SETSLOTC3ROM 0xC00B 27 | #define CLR80VID 0xC00C 28 | #define SET80VID 0xC00D 29 | #define CLRALTCHAR 0xC00E 30 | #define SETALTCHAR 0xC00F 31 | 32 | #define KBDSTRB 0xC010 33 | #define RDLCBNK2 0xC011 34 | #define RDLCRAM 0xC012 35 | #define RDRAMRD 0xC013 36 | #define RDRAMWRT 0xC014 37 | #define RDINTCXROM 0xC015 38 | #define RDALTZP 0xC016 39 | #define RDSLOTC3ROM 0xC017 40 | #define RD80STORE 0xC018 41 | #define RDVBLBAR 0xC019 42 | #define RDTEXT 0xC01A 43 | #define RDMIXED 0xC01B 44 | #define RDPAGE2 0xC01C 45 | #define RDHIRES 0xC01D 46 | #define RDALTCHAR 0xC01E 47 | #define RD80COL 0xC01F 48 | 49 | #define TAPEOUT 0xC020 50 | #define PRNTOUT 0xC021 /* Virtual printer */ 51 | #define SPKR 0xC030 52 | 53 | #define TXTCLR 0xC050 54 | #define TXTSET 0xC051 55 | #define MIXCLR 0xC052 56 | #define MIXSET 0xC053 57 | #define LOWSCR 0xC054 58 | #define HISCR 0xC055 59 | #define LOWRES 0xC056 60 | #define HIRES 0xC057 61 | #define CLRAN0 0xC058 62 | #define SETAN0 0xC059 63 | #define CLRAN1 0xC05A 64 | #define SETAN1 0xC05B 65 | #define CLRAN2 0xC05C 66 | #define SETAN2 0xC05D 67 | #define CLRAN3 0xC05E 68 | #define SETDHIRES 0xC05E 69 | #define SETAN3 0xC05F 70 | #define CLRDHIRES 0xC05F 71 | 72 | #define TAPEIN 0xC060 73 | #define BUTN0 0xC061 74 | #define BUTN1 0xC062 75 | #define BUTN2 0xC063 76 | #define PADDL0 0xC064 77 | #define PADDL1 0xC065 78 | #define PADDL2 0xC066 79 | #define PADDL3 0xC067 80 | 81 | #define PTRIG 0xC070 82 | #define SETIOUDIS 0xC07E 83 | #define RDIOUDIS 0xC07E 84 | #define CLRIOUDIS 0xC07F 85 | #define RDDHIRES 0xC07F 86 | 87 | #define CLRROM 0xCFFF 88 | 89 | // Language Card setting 90 | #define MS_WRITERAM ( 1 << 0 ) 91 | #define MS_READSAME ( 1 << 1 ) 92 | #define MS_BANK1 ( 1 << 3 ) 93 | #define MS_READAUX ( 1 << 4 ) 94 | #define MS_WRITEAUX ( 1 << 5 ) 95 | #define MS_RWAUXZP ( 1 << 6 ) 96 | #define MS_INTCXROM ( 1 << 9 ) 97 | #define MS_SLOTC3ROM ( 1 << 10 ) 98 | #define MS_80STORE ( 1 << 7 ) 99 | #define MS_HISCR ( 1 << 8 ) 100 | #define MS_INTCXROM2 ( 1 << 11 ) 101 | 102 | #include "arch/frame/screen.h" 103 | #include "keyboard.h" // Added by ClassView 104 | #include "iou.h" 105 | 106 | class CAppleClock; 107 | 108 | class CAppleIOU : public CIou 109 | { 110 | public: 111 | DECLARE_SERIAL( CAppleIOU ); 112 | CAppleIOU(); 113 | virtual ~CAppleIOU(); 114 | 115 | void AppleIOWrite(WORD addr, BYTE data); 116 | void InitMemory(int nMachineType); 117 | BOOL ReadRomFile(); 118 | 119 | void Serialize(CArchive& ar); 120 | 121 | 122 | BYTE* m_pReadMap[0x10]; 123 | BYTE* m_pWriteMap[0x10]; 124 | 125 | protected: 126 | BYTE* m_pMem; // current memory ( main or aux ) 127 | BYTE* m_pROM; // 16k 128 | 129 | int m_nMachineType; 130 | 131 | public: 132 | BOOL m_bMemTest; 133 | 134 | int m_iMemMode; 135 | int m_iLastMemMode; 136 | BOOL m_bLastWriteRamFlag; 137 | BYTE CheckMode(WORD addr); 138 | void SwitchAuxMemory(WORD addr); 139 | void Init(); 140 | void InitMemoryMap(void); 141 | void UpdateMemoryMap(void); 142 | 143 | // CIou Overrides 144 | BYTE ReadMem8(int nAddr); 145 | void WriteMem8(int nAddr, BYTE byData); 146 | WORD ReadMem16(int nAddr); 147 | void WriteMem16(int nAddr, WORD wData); 148 | }; 149 | 150 | extern BYTE MemReturnRandomData(BYTE highbit); 151 | 152 | #endif // !defined(AFX_MEMORY_H__A8396EA1_6860_4A73_87B0_B68FAECE64F3__INCLUDED_) 153 | -------------------------------------------------------------------------------- /src/arch/frame/dlgconfighdd.cpp: -------------------------------------------------------------------------------- 1 | // DlgConfigDisk.cpp : implementation file 2 | // 3 | 4 | #include "arch/frame/stdafx.h" 5 | #include "arch/frame/aipc.h" 6 | #include "arch/frame/dlgconfighdd.h" 7 | #include "hdd.h" 8 | #include "aipcdefs.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | CDlgConfigHDD::CDlgConfigHDD(CHDDInterface* pInterface, CWnd* pParent /*=NULL*/) 17 | : CDialog(CDlgConfigHDD::IDD, pParent) 18 | { 19 | m_strDisk1Image = _T(""); 20 | m_pInterface = pInterface; 21 | } 22 | 23 | 24 | void CDlgConfigHDD::DoDataExchange(CDataExchange* pDX) 25 | { 26 | CDialog::DoDataExchange(pDX); 27 | DDX_Control(pDX, IDC_CHK_DISK1, m_btnEnableDisk1); 28 | DDX_Control(pDX, IDC_BTN_BROWSE1, m_btnBrowseDisk1); 29 | DDX_Control(pDX, IDC_EDIT_FILENAME1, m_cDisk1Path); 30 | } 31 | 32 | 33 | BEGIN_MESSAGE_MAP(CDlgConfigHDD, CDialog) 34 | ON_BN_CLICKED(IDC_BTN_BROWSE1, OnBtnBrowse1) 35 | ON_BN_CLICKED(IDC_CHK_DISK1, OnChkDisk1) 36 | ON_EN_SETFOCUS(IDC_EDIT_FILENAME1, &CDlgConfigHDD::OnSetfocusEditFilename) 37 | ON_EN_KILLFOCUS(IDC_EDIT_FILENAME1, &CDlgConfigHDD::OnKillfocusEditFilename) 38 | END_MESSAGE_MAP() 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | // CDlgConfigHDD message handlers 42 | 43 | BOOL CDlgConfigHDD::OnInitDialog() 44 | { 45 | CDialog::OnInitDialog(); 46 | 47 | m_btnEnableDisk1.SetCheck(1); 48 | m_strDisk1Image = m_pInterface->GetDrive(0)->GetFileName(); 49 | SetFileName(&m_cDisk1Path, m_strDisk1Image); 50 | 51 | UpdateData(FALSE); 52 | 53 | return TRUE; // return TRUE unless you set the focus to a control 54 | // EXCEPTION: OCX Property Pages should return FALSE 55 | } 56 | 57 | void CDlgConfigHDD::OnBtnBrowse1() 58 | { 59 | const TCHAR* pFileName = NULL; 60 | TCHAR buffer[4096] = TEXT(""); 61 | TCHAR** lppPart = { NULL }; 62 | 63 | if (m_strDisk1Image.IsEmpty()) 64 | { 65 | pFileName = NULL; 66 | } 67 | else 68 | { 69 | if (GetFullPathName(m_strDisk1Image, 4096, buffer, lppPart) != 0) 70 | pFileName = buffer; 71 | else 72 | pFileName = (const TCHAR*)m_strDisk1Image; 73 | } 74 | 75 | CFileDialog dlgFile(TRUE, TEXT("hdv"), pFileName, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "DSK Files (*.hdv;*.2mg;*.2img)|*.hdv;*.2mg;*.2img|All Files (*.*)|*.*||"); 76 | 77 | if (dlgFile.DoModal() == IDOK) 78 | { 79 | m_strDisk1Image = dlgFile.GetPathName(); 80 | SetFileName(&m_cDisk1Path, m_strDisk1Image); 81 | } 82 | } 83 | 84 | void CDlgConfigHDD::OnChkDisk1() 85 | { 86 | if (m_btnEnableDisk1.GetCheck() == 0) 87 | { 88 | m_cDisk1Path.EnableWindow(FALSE); 89 | m_btnBrowseDisk1.EnableWindow(FALSE); 90 | } 91 | else 92 | { 93 | m_cDisk1Path.EnableWindow(); 94 | m_btnBrowseDisk1.EnableWindow(); 95 | } 96 | } 97 | 98 | void CDlgConfigHDD::OnOK() 99 | { 100 | UpdateData(TRUE); 101 | m_btnEnableDisk1.SetFocus(); 102 | 103 | if ( m_btnEnableDisk1.GetCheck() && m_strDisk1Image != "" ) 104 | { 105 | if ( m_pInterface->GetDrive(0)->Mount( m_strDisk1Image ) != E_SUCCESS ) 106 | { 107 | CString str; 108 | str.Format( "Could not open the image.\nDisk: %s", m_strDisk1Image ); 109 | ::AfxGetMainWnd()->MessageBox( str, _T("aipc information") ) ; 110 | return; 111 | } 112 | else if ( m_pInterface->GetDrive(0)->IsWriteProtected() ) 113 | { 114 | CString str; 115 | str.Format( "Open write protected disk.\nDisk1: %s", m_strDisk1Image ); 116 | ::AfxGetMainWnd()->MessageBox( str, _T("aipc information") ) ; 117 | } 118 | } 119 | else 120 | { 121 | m_pInterface->GetDrive(0)->Umount(); 122 | } 123 | 124 | CDialog::OnOK(); 125 | } 126 | 127 | void CDlgConfigHDD::OnSetfocusEditFilename() 128 | { 129 | // TODO: Add your control notification handler code here 130 | m_cDisk1Path.SetWindowText(m_strDisk1Image); 131 | } 132 | 133 | 134 | void CDlgConfigHDD::OnKillfocusEditFilename() 135 | { 136 | // TODO: Add your control notification handler code here 137 | m_cDisk1Path.GetWindowText(m_strDisk1Image); 138 | SetFileName(&m_cDisk1Path, m_strDisk1Image); 139 | } 140 | 141 | void CDlgConfigHDD::SetFileName(CEdit *edit, CString path) 142 | { 143 | edit->SetWindowText(path.Mid(path.ReverseFind('\\') + 1)); 144 | } 145 | -------------------------------------------------------------------------------- /dx80/include/mpegtype.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: MPEGType.h 3 | // 4 | // Desc: MPEG system stream compound type definition 5 | // 6 | // Copyright (c) 1996 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __MPEGTYPE__ 11 | #define __MPEGTYPE__ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif // __cplusplus 16 | 17 | // 18 | // AM_MPEGSYSTEMTYPE defines the format block contents for 19 | // data of type MEDIATYPE_MPEG1System when the format 20 | // block GUID is FORMAT_MPEG1System 21 | // 22 | // The format block consists of elements of type 23 | // AM_MPEGSYSTEMTYPE up to the length of the format block 24 | // Each format block is 8-byte aligned from the start of 25 | // the format block 26 | // 27 | 28 | typedef struct tagAM_MPEGSTREAMTYPE 29 | { 30 | DWORD dwStreamId; // Stream id of stream to process 31 | DWORD dwReserved; // 8-byte alignment 32 | AM_MEDIA_TYPE mt; // Type for substream - pbFormat is NULL 33 | BYTE bFormat[1]; // Format data 34 | } AM_MPEGSTREAMTYPE; 35 | 36 | typedef struct tagAM_MPEGSYSTEMTYPE 37 | { 38 | DWORD dwBitRate; // Bits per second 39 | DWORD cStreams; // Number of streams 40 | AM_MPEGSTREAMTYPE Streams[1]; 41 | } AM_MPEGSYSTEMTYPE; 42 | 43 | // 44 | // Helper macros for AM_MPEGSTREAMTYPE 45 | // 46 | #define AM_MPEGSTREAMTYPE_ELEMENTLENGTH(pStreamType) \ 47 | FIELD_OFFSET(AM_MPEGSTREAMTYPE, bFormat[(pStreamType)->mt.cbFormat]) 48 | #define AM_MPEGSTREAMTYPE_NEXT(pStreamType) \ 49 | ((AM_MPEGSTREAMTYPE *)((PBYTE)(pStreamType) + \ 50 | ((AM_MPEGSTREAMTYPE_ELEMENTLENGTH(pStreamType) + 7) & ~7))) 51 | 52 | // 53 | // IMpegAudioDecoder 54 | // 55 | 56 | // Values for DualMode 57 | #define AM_MPEG_AUDIO_DUAL_MERGE 0 58 | #define AM_MPEG_AUDIO_DUAL_LEFT 1 59 | #define AM_MPEG_AUDIO_DUAL_RIGHT 2 60 | 61 | DECLARE_INTERFACE_(IMpegAudioDecoder, IUnknown) { 62 | 63 | STDMETHOD(get_FrequencyDivider) (THIS_ 64 | unsigned long *pDivider /* [out] */ 65 | ) PURE; 66 | 67 | STDMETHOD(put_FrequencyDivider) (THIS_ 68 | unsigned long Divider /* [in] */ 69 | ) PURE; 70 | 71 | STDMETHOD(get_DecoderAccuracy) (THIS_ 72 | unsigned long *pAccuracy /* [out] */ 73 | ) PURE; 74 | 75 | STDMETHOD(put_DecoderAccuracy) (THIS_ 76 | unsigned long Accuracy /* [in] */ 77 | ) PURE; 78 | 79 | STDMETHOD(get_Stereo) (THIS_ 80 | unsigned long *pStereo /* [out] */ 81 | ) PURE; 82 | 83 | STDMETHOD(put_Stereo) (THIS_ 84 | unsigned long Stereo /* [in] */ 85 | ) PURE; 86 | 87 | STDMETHOD(get_DecoderWordSize) (THIS_ 88 | unsigned long *pWordSize /* [out] */ 89 | ) PURE; 90 | 91 | STDMETHOD(put_DecoderWordSize) (THIS_ 92 | unsigned long WordSize /* [in] */ 93 | ) PURE; 94 | 95 | STDMETHOD(get_IntegerDecode) (THIS_ 96 | unsigned long *pIntDecode /* [out] */ 97 | ) PURE; 98 | 99 | STDMETHOD(put_IntegerDecode) (THIS_ 100 | unsigned long IntDecode /* [in] */ 101 | ) PURE; 102 | 103 | STDMETHOD(get_DualMode) (THIS_ 104 | unsigned long *pIntDecode /* [out] */ 105 | ) PURE; 106 | 107 | STDMETHOD(put_DualMode) (THIS_ 108 | unsigned long IntDecode /* [in] */ 109 | ) PURE; 110 | 111 | STDMETHOD(get_AudioFormat) (THIS_ 112 | MPEG1WAVEFORMAT *lpFmt /* [out] */ 113 | ) PURE; 114 | }; 115 | 116 | #ifdef __cplusplus 117 | } 118 | #endif // __cplusplus 119 | #endif // __MPEGTYPE__ 120 | -------------------------------------------------------------------------------- /dx80/include/il21dec.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: IL21Dec.h 3 | // 4 | // Desc: Line 21 Decoder related definitions and interfaces for ActiveMovie. 5 | // 6 | // Copyright (c) 1992 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __IL21DEC__ 11 | #define __IL21DEC__ 12 | 13 | 14 | // 15 | // Some enum data types used as line 21 decoder params by the interface 16 | // 17 | typedef enum _AM_LINE21_CCLEVEL { // should we use TC1, TC2 in stead? 18 | AM_L21_CCLEVEL_TC2 = 0 19 | } AM_LINE21_CCLEVEL, *PAM_LINE21_CCLEVEL ; 20 | 21 | typedef enum _AM_LINE21_CCSERVICE { 22 | AM_L21_CCSERVICE_None = 0, 23 | AM_L21_CCSERVICE_Caption1, 24 | AM_L21_CCSERVICE_Caption2, 25 | AM_L21_CCSERVICE_Text1, 26 | AM_L21_CCSERVICE_Text2, 27 | AM_L21_CCSERVICE_XDS, 28 | AM_L21_CCSERVICE_DefChannel = 10, 29 | AM_L21_CCSERVICE_Invalid 30 | } AM_LINE21_CCSERVICE, *PAM_LINE21_CCSERVICE ; 31 | 32 | typedef enum _AM_LINE21_CCSTATE { 33 | AM_L21_CCSTATE_Off = 0, 34 | AM_L21_CCSTATE_On 35 | } AM_LINE21_CCSTATE, *PAM_LINE21_CCSTATE ; 36 | 37 | typedef enum _AM_LINE21_CCSTYLE { 38 | AM_L21_CCSTYLE_None = 0, 39 | AM_L21_CCSTYLE_PopOn, 40 | AM_L21_CCSTYLE_PaintOn, 41 | AM_L21_CCSTYLE_RollUp 42 | } AM_LINE21_CCSTYLE, *PAM_LINE21_CCSTYLE ; 43 | 44 | typedef enum _AM_LINE21_DRAWBGMODE { 45 | AM_L21_DRAWBGMODE_Opaque, 46 | AM_L21_DRAWBGMODE_Transparent 47 | } AM_LINE21_DRAWBGMODE, *PAM_LINE21_DRAWBGMODE ; 48 | 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif // __cplusplus 53 | 54 | // 55 | // Line 21 Decoder standard COM interface 56 | // 57 | DECLARE_INTERFACE_(IAMLine21Decoder, IUnknown) 58 | { 59 | public: 60 | // 61 | // Decoder options to be used by apps 62 | // 63 | 64 | // What is the decoder's level 65 | STDMETHOD(GetDecoderLevel)(THIS_ AM_LINE21_CCLEVEL *lpLevel) PURE ; 66 | // supported level value is AM_L21Level_TC2 only 67 | // skipping the SetDecoderLevel( ) 68 | 69 | // Which of the services is being currently used 70 | STDMETHOD(GetCurrentService)(THIS_ AM_LINE21_CCSERVICE *lpService) PURE ; 71 | STDMETHOD(SetCurrentService)(THIS_ AM_LINE21_CCSERVICE Service) PURE ; 72 | // supported service values are AM_L21Service_Caption1, 73 | // AM_L21Service_Caption2, AM_L21Service_Text1, AM_L21Service_Text2, 74 | // AM_L21Service_XDS, AM_L21Service_None) 75 | 76 | // Query/Set the service state (On/Off) 77 | // supported state values are AM_L21State_On and AM_L21State_Off 78 | STDMETHOD(GetServiceState)(THIS_ AM_LINE21_CCSTATE *lpState) PURE ; 79 | STDMETHOD(SetServiceState)(THIS_ AM_LINE21_CCSTATE State) PURE ; 80 | 81 | // 82 | // Output options to be used by downstream filters 83 | // 84 | 85 | // What size, bitdepth etc should the output video be 86 | STDMETHOD(GetOutputFormat)(THIS_ LPBITMAPINFOHEADER lpbmih) PURE ; 87 | // GetOutputFormat() method, if successful, returns 88 | // 1. S_FALSE if no output format has so far been defined by downstream filters 89 | // 2. S_OK if an output format has already been defined by downstream filters 90 | STDMETHOD(SetOutputFormat)(THIS_ LPBITMAPINFO lpbmi) PURE ; 91 | 92 | // Specify physical color to be used in colorkeying the background 93 | // for overlay mixing 94 | STDMETHOD(GetBackgroundColor)(THIS_ DWORD *pdwPhysColor) PURE ; 95 | STDMETHOD(SetBackgroundColor)(THIS_ DWORD dwPhysColor) PURE ; 96 | 97 | // Specify if whole output bitmap should be redrawn for each sample 98 | STDMETHOD(GetRedrawAlways)(THIS_ LPBOOL lpbOption) PURE ; 99 | STDMETHOD(SetRedrawAlways)(THIS_ BOOL bOption) PURE ; 100 | 101 | // Specify if the caption text background should be opaque/transparent 102 | STDMETHOD(GetDrawBackgroundMode)(THIS_ AM_LINE21_DRAWBGMODE *lpMode) PURE ; 103 | STDMETHOD(SetDrawBackgroundMode)(THIS_ AM_LINE21_DRAWBGMODE Mode) PURE ; 104 | // supported mode values are AM_L21_DrawBGMode_Opaque and 105 | // AM_L21_DrawBGMode_Transparent 106 | 107 | } ; 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif // __cplusplus 112 | #endif // __IL21DEC__ 113 | -------------------------------------------------------------------------------- /dx80/include/dmoreg.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DMOReg.h 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __DMOREG_H__ 11 | #define __DMOREG_H__ 12 | 13 | #include "mediaobj.h" 14 | 15 | 16 | // 57f2db8b-e6bb-4513-9d43-dcd2a6593125 17 | DEFINE_GUID(DMOCATEGORY_AUDIO_DECODER, 0x57f2db8b,0xe6bb,0x4513,0x9d,0x43,0xdc,0xd2,0xa6,0x59,0x31,0x25); 18 | // 33D9A761-90C8-11d0-BD43-00A0C911CE86 19 | DEFINE_GUID(DMOCATEGORY_AUDIO_ENCODER, 0x33D9A761,0x90C8,0x11d0,0xBD,0x43,0x00,0xA0,0xC9,0x11,0xCE,0x86); 20 | // 4a69b442-28be-4991-969c-b500adf5d8a8 21 | DEFINE_GUID(DMOCATEGORY_VIDEO_DECODER, 0x4a69b442,0x28be,0x4991,0x96,0x9c,0xb5,0x00,0xad,0xf5,0xd8,0xa8); 22 | // 33D9A760-90C8-11d0-BD43-00A0C911CE86 23 | DEFINE_GUID(DMOCATEGORY_VIDEO_ENCODER, 0x33D9A760,0x90C8,0x11d0,0xBD,0x43,0x00,0xA0,0xC9,0x11,0xCE,0x86); 24 | // f3602b3f-0592-48df-a4cd-674721e7ebeb 25 | DEFINE_GUID(DMOCATEGORY_AUDIO_EFFECT, 0xf3602b3f,0x0592,0x48df,0xa4,0xcd,0x67,0x47,0x21,0xe7,0xeb,0xeb); 26 | // d990ee14-776c-4723-be46-3da2f56f10b9 27 | DEFINE_GUID(DMOCATEGORY_VIDEO_EFFECT, 0xd990ee14,0x776c,0x4723,0xbe,0x46,0x3d,0xa2,0xf5,0x6f,0x10,0xb9); 28 | // f665aaba-3e09-4920-aa5f-219811148f09 29 | DEFINE_GUID(DMOCATEGORY_AUDIO_CAPTURE_EFFECT, 0xf665aaba,0x3e09,0x4920,0xaa,0x5f,0x21,0x98,0x11,0x14,0x8f,0x09); 30 | 31 | // Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1} 32 | // Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h 33 | DEFINE_GUID(DMOCATEGORY_ACOUSTIC_ECHO_CANCEL, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1); 34 | 35 | // Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5} 36 | // Matches KSNODETYPE_AUDIO_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h 37 | DEFINE_GUID(DMOCATEGORY_AUDIO_NOISE_SUPPRESS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5); 38 | 39 | // Automatic Gain Control {E88C9BA0-C557-11D0-8A2B-00A0C9255AC1} 40 | // Matches KSNODETYPE_AGC in ksmedia.h 41 | DEFINE_GUID(DMOCATEGORY_AGC, 0xE88C9BA0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1); 42 | 43 | typedef struct _DMO_PARTIAL_MEDIATYPE { 44 | GUID type; 45 | GUID subtype; 46 | } DMO_PARTIAL_MEDIATYPE, *PDMO_PARTIAL_MEDIATYPE; 47 | 48 | enum DMO_REGISTER_FLAGS { 49 | DMO_REGISTERF_IS_KEYED = 0x00000001 50 | }; 51 | 52 | enum DMO_ENUM_FLAGS { 53 | DMO_ENUMF_INCLUDE_KEYED = 0x00000001 54 | }; 55 | 56 | STDAPI DMORegister( 57 | LPCWSTR szName, 58 | REFCLSID clsidDMO, 59 | REFGUID guidCategory, 60 | DWORD dwFlags, // DMO_REGISTERF_XXX 61 | // 62 | // Register all mediatypes supported by the object. This carries no 63 | // information about which combinations of input/output types would 64 | // actually work. 65 | // 66 | DWORD cInTypes, 67 | const DMO_PARTIAL_MEDIATYPE *pInTypes, 68 | DWORD cOutTypes, 69 | const DMO_PARTIAL_MEDIATYPE *pOutTypes 70 | ); 71 | 72 | STDAPI DMOUnregister( 73 | REFCLSID clsidDMO, 74 | REFGUID guidCategory // optional - GUID_NULL means unregister from all 75 | ); 76 | 77 | STDAPI DMOEnum( 78 | REFGUID guidCategory, // GUID_NULL for "all" 79 | DWORD dwFlags, // DMO_ENUMF_XXX 80 | // 81 | // Enumerate only objects that support at least one of the specified input types 82 | // and at least one of the specified output types. If no input types are specified, 83 | // enumerate objects regardless of what input types they support. Same for 84 | // output types. 85 | // 86 | DWORD cInTypes, 87 | const DMO_PARTIAL_MEDIATYPE *pInTypes, // can be NULL only of ulInTypes = 0 88 | DWORD cOutTypes, 89 | const DMO_PARTIAL_MEDIATYPE *pOutTypes, // can be NULL only of ulOutTypes = 0 90 | // 91 | // Output parameter - this receives a pointer to the DMO CLSID enumerator 92 | // 93 | IEnumDMO **ppEnum 94 | ); 95 | 96 | STDAPI DMOGetTypes( 97 | REFCLSID clsidDMO, 98 | unsigned long ulInputTypesRequested, 99 | unsigned long *pulInputTypesSupplied, 100 | DMO_PARTIAL_MEDIATYPE *pInputTypes, 101 | unsigned long ulOutputTypesRequested, 102 | unsigned long *pulOutputTypesSupplied, 103 | DMO_PARTIAL_MEDIATYPE *pOutputTypes 104 | ); 105 | 106 | STDAPI DMOGetName( 107 | REFCLSID clsidDMO, 108 | WCHAR szName[80] 109 | ); 110 | #endif //__DMOREG_H__ 111 | --------------------------------------------------------------------------------