This commit is contained in:
AZO234 2020-05-19 22:12:45 +09:00
parent 0cffe94389
commit a2e570773b
84 changed files with 12 additions and 24170 deletions

View File

@ -693,10 +693,10 @@ if(CMAKE_CROSSCOMPILING)
else()
if(MSVC_VERSION)
add_library(NP2kai_windows_932 SHARED "windows/resources/932/np2jp.rc")
add_library(NP2kai_windows_936 SHARED "windows/resources/936/np2.rc")
add_library(NP2kai_windows_950 SHARED "windows/resources/950/np2.rc")
add_library(NP2kai_windows_1252 SHARED "windows/resources/1252/np2.rc")
add_library(NP2kai_windows_932 MODULE "windows/resources/932/np2jp.rc")
add_library(NP2kai_windows_936 MODULE "windows/resources/936/np2.rc")
add_library(NP2kai_windows_950 MODULE "windows/resources/950/np2.rc")
add_library(NP2kai_windows_1252 MODULE "windows/resources/1252/np2.rc")
add_library(NP2kai_Windows_base INTERFACE)
if(CMAKE_BUILD_TYPE EQUAL "Debug")

View File

@ -107,6 +107,14 @@ VisualStudio 2019
3. Build -> Build all.
4. Output np21kai_windows.exe in out directory.
- CMake options of VisualStudio 2019 port (*=default)
|name|value|work|output|
|:---:|:---:|:---:|:---:|
|BUILD_I286|ON|Build i286|NP2kai_windows|
|BUILD_I286|OFF*|Build IA-32|NP21kai_windows|
|BUILD_HAXM|ON|Build IA-32 HAXM|NP21kai_HAXM_windows|
#### Install binary
1. Locate .exe file anywhere.
2. Locate BIOS files to .exe same filder.

File diff suppressed because it is too large Load Diff

View File

@ -1,126 +0,0 @@
/**
* @file compiler.h
* @brief include file for standard system include files,
* or project specific include files that are used frequently,
* but are changed infrequently
*/
#pragma once
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
#include <stdio.h>
#include <stddef.h>
#include <SDL2/SDL.h>
#define BYTESEX_LITTLE
#define OSLANG_UTF8
#define OSLINEBREAK_CRLF
#define RESOURCE_US
typedef signed int SINT;
typedef unsigned int UINT;
typedef signed char SINT8;
typedef unsigned char UINT8;
typedef signed short SINT16;
typedef unsigned short UINT16;
typedef signed int SINT32;
typedef unsigned int UINT32;
typedef signed long int SINT64;
typedef signed long int INT64;
typedef unsigned long int UINT64;
#define BRESULT UINT
#define OEMCHAR char
#define OEMTEXT(string) string
#define OEMSPRINTF sprintf
#define OEMSTRLEN strlen
#if defined(SUPPORT_LARGE_HDD)
typedef SINT64 FILEPOS;
typedef SINT64 FILELEN;
#define NHD_MAXSIZE 8000
#define NHD_MAXSIZE2 32000
#else
typedef SINT32 FILEPOS;
typedef SINT32 FILELEN;
#define NHD_MAXSIZE 2000
#define NHD_MAXSIZE2 2000
#endif
#define NP2_SIZE_VGA
#if !defined(NP2_SIZE_VGA)
#define RGB16 UINT32
#define NP2_SIZE_QVGA
#endif
//#if !defined(OBJC_BOOL_DEFINED)
//typedef unsigned char BOOL;
//#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef MAX_PATH
#define MAX_PATH 256
#endif
#ifndef __cplusplus
#ifndef np2max
#define np2max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef np2min
#define np2min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif /* __cplusplus */
#ifndef ZeroMemory
#define ZeroMemory(d,n) memset((d), 0, (n))
#endif
#ifndef CopyMemory
#define CopyMemory(d,s,n) memcpy((d), (s), (n))
#endif
#ifndef FillMemory
#define FillMemory(a, b, c) memset((a), (c), (b))
#endif
#include "common.h"
#include <common/milstr.h>
#include "_memory.h"
#include "rect.h"
#include "lstarray.h"
#include <trace.h>
#define GETTICK() SDL_GetTicks()
#define __ASSERT(s)
#define SPRINTF sprintf
#define STRLEN strlen
#define VERMOUTH_LIB
// #define SOUND_CRITICAL
#define SUPPORT_UTF8
#define SUPPORT_16BPP
#define MEMOPTIMIZE 2
#define SOUND_CRITICAL
#define SOUNDRESERVE 100
#define SUPPORT_CRT15KHZ
#define SUPPORT_HOSTDRV
#define SUPPORT_SWSEEKSND
#define SUPPORT_SASI
#define SUPPORT_SCSI
#define SUPPORT_EXTERNALCHIP
#define SCREEN_BPP 16

View File

@ -1,29 +0,0 @@
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw9840\paperh8400
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0\b\fs24 \cf0 Engineering:
\b0 \
Some people\
\
\b Human Interface Design:
\b0 \
Some other people\
\
\b Testing:
\b0 \
Hopefully not nobody\
\
\b Documentation:
\b0 \
Whoever\
\
\b With special thanks to:
\b0 \
Mom\
}

View File

@ -1,2 +0,0 @@
/* Localized versions of Info.plist keys */

View File

@ -1,39 +0,0 @@
/**
* @file main.m
* @brief
*/
#include <compiler.h>
#include "../../np2.h"
#include "../../dosio.h"
/**
*
* @param[in] argc
* @param[in] argv
* @return
*/
int main(int argc, char * argv[])
{
NSString *pstrBundlePath = [[NSBundle mainBundle] bundlePath];
file_setcd([pstrBundlePath UTF8String]);
char** q = &argv[1];
for (int i = 1; i < argc; i++)
{
if (strncmp(argv[i], "-psn_", 5) == 0)
{
}
else if (strcasecmp(argv[i], "-NSDocumentRevisionsDebugMode") == 0)
{
i++;
}
else
{
*q++ = argv[i];
}
}
*q = NULL;
return np2_main((int)(q - argv), argv);
}

View File

@ -1,30 +0,0 @@
/*!
* @file guard.h
* @brief
*/
#pragma once
#include <pthread.h>
/*!
* @brief
*/
class CGuard
{
public:
/*! コンストラクタ */
CGuard() { ::pthread_mutex_init(&m_cs, NULL); }
/*! デストラクタ */
~CGuard() { ::pthread_mutex_destroy(&m_cs); }
/*! クリティカル セクション開始 */
void Enter() { ::pthread_mutex_lock(&m_cs); }
/*! クリティカル セクション終了 */
void Leave() { ::pthread_mutex_unlock(&m_cs); }
private:
pthread_mutex_t m_cs; //!< クリティカル セクション情報
};

View File

@ -1,83 +0,0 @@
/**
* @file threadbase.cpp
* @brief
*/
#include <compiler.h>
#include "threadbase.h"
/**
*
*/
CThreadBase::CThreadBase()
: m_bCreated(false)
, m_bDone(false)
, m_stack_size(0)
{
}
/**
*
*/
CThreadBase::~CThreadBase()
{
Stop();
}
/**
*
* @retval true
*/
bool CThreadBase::Start()
{
if (m_bCreated)
{
return false;
}
/* スタック サイズ調整 */
pthread_attr_t tattr;
::pthread_attr_init(&tattr);
if (m_stack_size != 0)
{
::pthread_attr_setstacksize(&tattr, m_stack_size);
}
m_bDone = false;
if (::pthread_create(&m_thread, &tattr, StartRoutine, this) != 0)
{
return false;
}
m_bCreated = true;
return true;
}
/**
*
* @retval true
*/
void CThreadBase::Stop()
{
if (m_bCreated)
{
m_bDone = true;
::pthread_join(m_thread, NULL);
m_bCreated = false;
}
}
/**
*
* @param[in] arg this
* @retval 0 0
*/
void* CThreadBase::StartRoutine(void* arg)
{
CThreadBase& obj = *(static_cast<CThreadBase*>(arg));
while ((!obj.m_bDone) && (obj.Task()))
{
}
return 0;
}

View File

@ -1,52 +0,0 @@
/**
* @file threadbase.h
* @brief
*/
#pragma once
#include <pthread.h>
#include <unistd.h>
/**
* @brief
*/
class CThreadBase
{
public:
CThreadBase();
virtual ~CThreadBase();
bool Start();
void Stop();
void SetStackSize(size_t stack_size);
static void Delay(unsigned int usec);
protected:
virtual bool Task()=0; //!< スレッド タスク
private:
pthread_t m_thread; //!< スレッド フラグ
bool m_bCreated; //!< スレッド作成フラグ
bool m_bDone; //!< 終了フラグ
size_t m_stack_size; //!< スタック サイズ
static void* StartRoutine(void* arg);
};
/**
*
* @param[in] stack_size
*/
inline void CThreadBase::SetStackSize(size_t stack_size)
{
m_stack_size = stack_size;
}
/**
*
* @param[in] usec
*/
inline void CThreadBase::Delay(unsigned int usec)
{
::usleep(usec);
}

View File

@ -1,269 +0,0 @@
/**
* @file tty.cpp
* @brief
*/
#include <compiler.h>
#include "tty.h"
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <IOKit/serial/ioss.h>
/**
*
*/
CTty::CTty()
: m_fd(-1)
{
}
/**
*
*/
CTty::~CTty()
{
Close();
}
/**
*
* @param[in] bsdPath
* @param[in] speed
* @param[in] param
* @retval true
* @retval false
*/
bool CTty::Open(const char* bsdPath, unsigned int speed, const char* param)
{
Close();
// Open the serial port read/write, with no controlling terminal, and don't wait for a connection.
// The O_NONBLOCK flag also causes subsequent I/O on the device to be non-blocking.
int fd = ::open(bsdPath, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (fd < 0)
{
return false;
}
do
{
// Note that open() follows POSIX semantics: multiple open() calls to the same file will succeed
// unless the TIOCEXCL ioctl is issued. This will prevent additional opens except by root-owned processes.
if (::ioctl(fd, TIOCEXCL) == -1)
{
printf("Error setting TIOCEXCL on %s - %s(%d).\n", bsdPath, strerror(errno), errno);
break;
}
// Now that the device is open, clear the O_NONBLOCK flag so subsequent I/O will block.
if (::fcntl(fd, F_SETFL, 0) == -1)
{
printf("Error clearing O_NONBLOCK %s - %s(%d).\n", bsdPath, strerror(errno), errno);
break;
}
// Get the current options and save them so we can restore the default settings later.
struct termios options;
if (::tcgetattr(fd, &options) == -1)
{
printf("Error getting tty attributes %s - %s(%d).\n", bsdPath, strerror(errno), errno);
break;
}
// Print the current input and output baud rates.
printf("Current input baud rate is %d\n", (int) cfgetispeed(&options));
printf("Current output baud rate is %d\n", (int) cfgetospeed(&options));
tcflush(fd, TCIFLUSH);
// Set raw input (non-canonical) mode, with reads blocking until either a single character
// has been received or a one second timeout expires.
cfmakeraw(&options);
options.c_cc[VMIN] = 0;
options.c_cc[VTIME] = 10;
options.c_cflag |= (CLOCAL | CREAD);
options.c_cflag &= ~PARENB;
options.c_cflag &= ~CSTOPB;
options.c_cflag &= ~CSIZE;
options.c_cflag |= CS8;
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
options.c_iflag &= ~(IXON | IXOFF | IXANY);
options.c_oflag &= ~OPOST;
// The baud rate, word length, and handshake options can be set as follows:
cfsetspeed(&options, B19200); // Set 19200 baud
if (!SetParam(param, &options.c_cflag))
{
break;
}
// Print the new input and output baud rates. Note that the IOSSIOSPEED ioctl interacts with the serial driver
// directly bypassing the termios struct. This means that the following two calls will not be able to read
// the current baud rate if the IOSSIOSPEED ioctl was used but will instead return the speed set by the last call
// to cfsetspeed.
printf("Input baud rate changed to %d\n", (int) cfgetispeed(&options));
printf("Output baud rate changed to %d\n", (int) cfgetospeed(&options));
// Cause the new options to take effect immediately.
if (::tcsetattr(fd, TCSANOW, &options) == -1)
{
printf("Error setting tty attributes %s - %s(%d).\n", bsdPath, strerror(errno), errno);
break;
}
// The IOSSIOSPEED ioctl can be used to set arbitrary baud rates
// other than those specified by POSIX. The driver for the underlying serial hardware
// ultimately determines which baud rates can be used. This ioctl sets both the input
// and output speed.
speed_t setSpeed = speed;
if (::ioctl(fd, IOSSIOSPEED, &setSpeed) == -1)
{
printf("Error calling ioctl(..., IOSSIOSPEED, ...) %s - %s(%d).\n", bsdPath, strerror(errno), errno);
break;
}
printf("speed=%d\n", speed);
m_fd = fd;
return true;
} while (0 /*CONSTCOND*/);
::close(fd);
return false;
}
/**
*
*/
void CTty::Close()
{
if (m_fd >= 0)
{
::close(m_fd);
m_fd = -1;
}
}
/**
*
* @param[in] data_ptr
* @param[in] data_size
* @return
*/
ssize_t CTty::Read(void* data_ptr, ssize_t data_size)
{
if (m_fd < 0)
{
return 0;
}
if ((data_ptr == NULL) || (data_size <= 0))
{
return 0;
}
return ::read(m_fd, data_ptr, data_size);
}
/**
*
* @param[in] data_ptr
* @param[in] data_size
* @return
*/
ssize_t CTty::Write(const void* data_ptr, ssize_t data_size)
{
if (m_fd < 0)
{
return 0;
}
if ((data_ptr == NULL) || (data_size <= 0))
{
return 0;
}
return ::write(m_fd, data_ptr, data_size);
}
/**
*
* @param[in] param
* @param[out] cflag_ptr
* @retval true
* @retval false
*/
bool CTty::SetParam(const char* param, tcflag_t* cflag_ptr)
{
tcflag_t cflag = 0;
if (cflag_ptr != NULL)
{
cflag = *cflag_ptr;
}
if (param != NULL)
{
cflag &= ~CSIZE;
switch (param[0])
{
case '5':
cflag |= CS5;
break;
case '6':
cflag |= CS6;
break;
case '7':
cflag |= CS7;
break;
case '8':
cflag |= CS8;
break;
case '4':
default:
return false;
}
switch (param[1])
{
case 'N': // for no parity
cflag &= ~(PARENB | PARODD);
break;
case 'E': // for even parity
cflag |= PARENB;
break;
case 'O': // for odd parity
cflag |= PARENB | PARODD;
break;
case 'M': // for mark parity
case 'S': // for for space parity
default:
return false;
}
if (::strcmp(param + 2, "1") == 0)
{
cflag &= ~CSTOPB;
}
else if (::strcmp(param + 2, "2") == 0)
{
cflag |= CSTOPB;
}
else
{
return false;
}
}
if (cflag_ptr != NULL)
{
*cflag_ptr = cflag;
}
return true;
}

View File

@ -1,37 +0,0 @@
/**
* @file tty.h
* @brief
*/
#pragma once
#include <termios.h>
/**
* @brief
*/
class CTty
{
public:
CTty();
~CTty();
bool Open(const char* dev, unsigned int speed = 0, const char* param = NULL);
void Close();
ssize_t Read(void* data_ptr, ssize_t data_size);
ssize_t Write(const void* data_ptr, ssize_t data_size);
bool IsOpened() const;
private:
int m_fd; //!< ファイル ディスクリプタ
static bool SetParam(const char* param, tcflag_t* cflag_ptr);
};
/**
* ?
* @retval true
* @retval false
*/
inline bool CTty::IsOpened() const
{
return (m_fd >= 0);
}

View File

@ -1,406 +0,0 @@
/**
* @file usbdev.cpp
* @brief USB
*/
#include <compiler.h>
#include "usbdev.h"
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/usb/USBSpec.h>
/**
*
*/
CUsbDev::CUsbDev()
: m_device(NULL)
, m_interface(NULL)
{
}
/**
*
*/
CUsbDev::~CUsbDev()
{
Close();
}
/**
* USB
* @param[in] vid VID
* @param[in] pid PID
* @param[in] nIndex
* @retval true
* @retval false
*/
bool CUsbDev::Open(unsigned int vid, unsigned int pid, unsigned int nIndex)
{
// 探すデバイス
const SInt32 usbVendor = vid;
const SInt32 usbProduct = pid;
if (nIndex != 0)
{
return false;
}
// Set up matching dictionary for class IOUSBDevice and its subclasses
CFMutableDictionaryRef matchingDict = IOServiceMatching(kIOUSBDeviceClassName);
if (matchingDict == NULL)
{
printf("Couldn't create a USB matching dictionary\n");
return false;
}
// Add the vendor and product IDs to the matching dictionary.
// This is the second key in the table of device-matching keys of the
// USB Common Class Specification
CFDictionarySetValue(matchingDict, CFSTR(kUSBVendorName), CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &usbVendor));
CFDictionarySetValue(matchingDict, CFSTR(kUSBProductName), CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &usbProduct));
// インタフェイスを得る
io_iterator_t iterator = 0;
IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, &iterator);
io_service_t usbDevice = IOIteratorNext(iterator);
if (usbDevice == 0)
{
printf("Device not found\n");
return false;
}
IOObjectRelease(iterator);
// Create an intermediate plug-in
IOCFPlugInInterface** plugInInterface = NULL;
SInt32 score = 0;
IOReturn kr = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score);
kr = IOObjectRelease(usbDevice);
if ((kr != kIOReturnSuccess) || (plugInInterface == NULL))
{
printf("Unable to create a plug-in (%08x)\n", kr);
return false;
}
// Now create the device interface
IOUSBDeviceInterface** dev = NULL;
HRESULT result = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID*)&dev);
(*plugInInterface)->Release(plugInInterface);
if ((result != S_OK) || (dev == NULL))
{
printf("Couldn't create a device interface (%08x)\n", (int)result);
return false;
}
// Open the device to change its state
kr = (*dev)->USBDeviceOpen(dev);
if (kr != kIOReturnSuccess)
{
printf("Unable to open device: %08x\n", kr);
(*dev)->Release(dev);
return false;
}
// Configure device
kr = ConfigureDevice(dev);
if (kr != kIOReturnSuccess)
{
printf("Unable to configure device: %08x\n", kr);
(*dev)->USBDeviceClose(dev);
(*dev)->Release(dev);
return false;
}
// Placing the constant kIOUSBFindInterfaceDontCare into the following
// fields of the IOUSBFindInterfaceRequest structure will allow you
// to find all the interfaces
IOUSBFindInterfaceRequest request;
request.bInterfaceClass = kIOUSBFindInterfaceDontCare;
request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
request.bAlternateSetting = kIOUSBFindInterfaceDontCare;
// Get an iterator for the interfaces on the device
io_iterator_t iterator2;
kr = (*dev)->CreateInterfaceIterator(dev, &request, &iterator2);
while (1 /*EVER*/)
{
io_service_t usbInterface = IOIteratorNext(iterator2);
if (usbInterface == 0)
{
break;
}
// Create an intermediate plug-in
IOCFPlugInInterface** plugInInterface = NULL;
SInt32 score;
kr = IOCreatePlugInInterfaceForService(usbInterface, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score);
kr = IOObjectRelease(usbInterface);
if ((kr != kIOReturnSuccess) || (plugInInterface == NULL))
{
printf("Unable to create a plug-in (%08x)\n", kr);
continue;
}
// Now create the device interface for the interface
IOUSBInterfaceInterface** interface = NULL;
HRESULT result = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID*)&interface);
(*plugInInterface)->Release(plugInInterface);
if ((result != S_OK) || (interface == NULL))
{
printf("Couldn't create a device interface for the interface(%08x)\n", (int) result);
continue;
}
// Get interface class and subclass
UInt8 interfaceClass;
kr = (*interface)->GetInterfaceClass(interface, &interfaceClass);
UInt8 interfaceSubClass;
kr = (*interface)->GetInterfaceSubClass(interface, &interfaceSubClass);
printf("Interface class: %d, subclass: %d\n", interfaceClass, interfaceSubClass);
// Now open the interface. This will cause the pipes associated with
// the endpoints in the interface descriptor to be instantiated
kr = (*interface)->USBInterfaceOpen(interface);
if (kr != kIOReturnSuccess)
{
printf("Unable to open interface (%08x)\n", kr);
(*interface)->Release(interface);
continue;
}
// Get the number of endpoints associated with this interface
UInt8 interfaceNumEndpoints;
kr = (*interface)->GetNumEndpoints(interface, &interfaceNumEndpoints);
if (kr != kIOReturnSuccess)
{
printf("Unable to get number of endpoints (%08x)\n", kr);
(*interface)->USBInterfaceClose(interface);
(*interface)->Release(interface);
continue;
}
printf("Interface has %d endpoints\n", interfaceNumEndpoints);
// Access each pipe in turn, starting with the pipe at index 1
// The pipe at index 0 is the default control pipe and should be
// accessed using (*usbDevice)->DeviceRequest() instead
for (int pipeRef = 1; pipeRef <= interfaceNumEndpoints; pipeRef++)
{
printf(" PipeRef %d: ", pipeRef);
UInt8 direction;
UInt8 number;
UInt8 transferType;
UInt16 maxPacketSize;
UInt8 interval;
kr = (*interface)->GetPipeProperties(interface, pipeRef, &direction, &number, &transferType, &maxPacketSize, &interval);
if (kr != kIOReturnSuccess)
{
printf("Unable to get properties of pipe(%08x)\n", kr);
continue;
}
const char* message;
switch (direction)
{
case kUSBOut:
message = "out";
break;
case kUSBIn:
message = "in";
break;
case kUSBNone:
message = "none";
break;
case kUSBAnyDirn:
message = "any";
break;
default:
message = "???";
break;
}
printf("direction %s, ", message);
switch (transferType)
{
case kUSBControl:
message = "control";
break;
case kUSBIsoc:
message = "isoc";
break;
case kUSBBulk:
message = "bulk";
break;
case kUSBInterrupt:
message = "interrupt";
break;
case kUSBAnyType:
message = "any";
break;
default:
message = "???";
break;
}
printf("transfer type %s, maxPacketSize %d\n", message, maxPacketSize);
}
// Query G.I.M.I.C module info.
m_device = dev;
m_interface = interface;
return true;
}
(*dev)->USBDeviceClose(dev);
(*dev)->Release(dev);
return false;
}
/**
*
* @param[in] dev Device interface
* @return IOReturn
*/
IOReturn CUsbDev::ConfigureDevice(IOUSBDeviceInterface** dev)
{
// Get the number of configurations. The sample code always chooses
// the first configuration (at index 0) but your code may need a
// different one
UInt8 numConfig = 0;
IOReturn kr = (*dev)->GetNumberOfConfigurations(dev, &numConfig);
if (!numConfig)
{
return -1;
}
//Get the configuration descriptor for index 0
IOUSBConfigurationDescriptorPtr configDesc;
kr = (*dev)->GetConfigurationDescriptorPtr(dev, 0, &configDesc);
if (kr != kIOReturnSuccess)
{
printf("Couldn't get configuration descriptor for index %d (err = %08x)\n", 0, kr);
return kr;
}
// Set the device's configuration. The configuration value is found in
// the bConfigurationValue field of the configuration descriptor
kr = (*dev)->SetConfiguration(dev, configDesc->bConfigurationValue);
if (kr != kIOReturnSuccess)
{
printf("Couldn't set configuration to value %d (err = %08x)\n", 0, kr);
return kr;
}
return kIOReturnSuccess;
}
/**
* USB
*/
void CUsbDev::Close()
{
if (m_interface)
{
(*m_interface)->USBInterfaceClose(m_interface);
(*m_interface)->Release(m_interface);
m_interface = NULL;
}
if (m_device)
{
(*m_device)->USBDeviceClose(m_device);
(*m_device)->Release(m_device);
m_device = NULL;
}
}
/**
*
* @param[in] nType
* @param[in] nRequest
* @param[in] nValue
* @param[in] nIndex
* @param[out] lpBuffer
* @param[in] cbBuffer
* @return
*/
int CUsbDev::CtrlXfer(int nType, int nRequest, int nValue, int nIndex, void* lpBuffer, int cbBuffer)
{
if (m_interface == NULL)
{
return -1;
}
IOUSBDevRequest req;
req.bmRequestType = nType;
req.bRequest = nRequest;
req.wValue = nValue;
req.wIndex = nIndex;
req.wLength = cbBuffer;
req.pData = lpBuffer;
req.wLenDone = 0;
IOReturn kr = (*m_interface)->ControlRequest(m_interface, 0, &req);
if (kr != kIOReturnSuccess)
{
::printf("Unable to perform control request (%08x)\n", kr);
return -1;
}
return static_cast<int>(req.wLenDone);
}
/**
*
* @param[in] lpBuffer
* @param[in] cbBuffer
* @return
*/
int CUsbDev::WriteBulk(const void* lpBuffer, int cbBuffer)
{
if (m_interface == NULL)
{
return -1;
}
IOReturn kr = (*m_interface)->WritePipe(m_interface, 1, const_cast<void*>(lpBuffer), static_cast<UInt32>(cbBuffer));
if (kr != kIOReturnSuccess)
{
::printf("Unable to perform bulk write (%08x)\n", kr);
return -1;
}
return static_cast<int>(cbBuffer);
}
/**
*
* @param[out] lpBuffer
* @param[in] cbBuffer
* @return
*/
int CUsbDev::ReadBulk(void* lpBuffer, int cbBuffer)
{
if (m_interface == NULL)
{
return -1;
}
UInt32 numBytesRead = static_cast<UInt32>(cbBuffer);
IOReturn kr = (*m_interface)->ReadPipe(m_interface, 2, lpBuffer, &numBytesRead);
if (kr != kIOReturnSuccess)
{
::printf("Unable to perform bulk read (%08x)\n", kr);
return -1;
}
return static_cast<int>(numBytesRead);
}

View File

@ -1,39 +0,0 @@
/**
* @file usbdev.h
* @brief USB
*/
#pragma once
#include <IOKit/usb/IOUSBLib.h>
/**
* @brief USB
*/
class CUsbDev
{
public:
CUsbDev();
~CUsbDev();
bool Open(unsigned int vid, unsigned int pid, unsigned int nIndex = 0);
void Close();
int CtrlXfer(int nType, int nRequest, int nValue = 0, int nIndex = 0, void* lpBuffer = NULL, int cbBuffer = 0);
int WriteBulk(const void* lpBuffer, int cbBuffer);
int ReadBulk(void* lpBuffer, int cbBuffer);
bool IsOpened() const;
private:
IOUSBDeviceInterface** m_device; /*!< デバイス */
IOUSBInterfaceInterface** m_interface; /*!< インタフェイス */
static IOReturn ConfigureDevice(IOUSBDeviceInterface** dev);
};
/**
* ?
* @retval true
* @retval false
*/
inline bool CUsbDev::IsOpened() const
{
return (m_interface != NULL);
}

Binary file not shown.

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>np2.icns</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright ツゥ 2014蟷エ Yui. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -1,106 +0,0 @@
# set ODCONFIG=gcw0 or ODCONFIG=rx90
CC=/opt/$(ODCONFIG)-toolchain/usr/bin/mipsel-linux-cc
AR=/opt/$(ODCONFIG)-toolchain/usr/bin/mipsel-linux-ar
CXX=/opt/$(ODCONFIG)-toolchain/usr/bin/mipsel-linux-g++
DEBUG ?= 0
SUPPORT_NP2_THREAD ?= 1
SUPPORT_NP2_TICKCOUNT ?= 1
SUPPORT_NET ?= 1
SUPPORT_ASYNC_CPU ?= 0
SDL_VERSION ?= 1
GIT_VERSION := "$(shell git rev-parse --short HEAD)"
ifeq ($($(ODCONFIG), rx90)
SDL_VERSION ?= 2
else ifeq ($($(ODCONFIG), gcw0)
SDL_VERSION ?= 1
endif
ifeq ($(SDL_VERSION), 1)
SDL_CONFIG ?= /opt/$(ODCONFIG)-toolchain/usr/mipsel-$(ODCONFIG)-linux-uclibc/sysroot/usr/bin/sdl-config
SDL_OTHER_LIBS ?= -lSDL_ttf -lSDL_mixer
SUPPORT_ASYNC_CPU ?=
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -DUSE_SDL_CONFIG
#SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
SDL_LIBS := -lSDL
else
SDL_CONFIG ?= /opt/$(ODCONFIG)-toolchain/usr/mipsel-$(ODCONFIG)-linux-uclibc/sysroot/usr/bin/sdl2-config
SDL_OTHER_LIBS ?= -lSDL2_ttf -lSDL2_mixer
SUPPORT_ASYNC_CPU ?= -DSUPPORT_ASYNC_CPU
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -DUSE_SDL_CONFIG
#SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
SDL_LIBS := -lSDL2
endif
TARGET_NAME := np2kai
TARGET := $(TARGET_NAME)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
LDFLAGS := -L/opt/$(ODCONFIG)-toolchain/usr/lib
fpic = -fPIC
ifeq ($(DEBUG), 1)
COMMONFLAGS += -O0 -g -DDEBUG -D_DEBUG -DTRACE
else
COMMONFLAGS += -O2 -DNDEBUG -D_NDEBUG
endif
CORE_DIR := ..
INCFLAGS :=
SOURCES_C :=
SOURCES_CXX :=
include Makefile.common
INCFLAGS := $(SDL_CFLAGS) $(INCFLAGS)
INCFLAGS += -I$(NP2_PATH)/sdl2/opendingux
SOURCES_C += $(NP2_PATH)/sdl2/opendingux/main.c
INCFLAGS += -I$(NP2_PATH)/i286c
SOURCES_C += $(wildcard $(NP2_PATH)/i286c/*.c)
NP2SDLDEFINE := -DNP2_SDL -DSUPPORT_SDL_AUDIO -DSUPPORT_SDL_MIXER
OBJECTS = $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
CXXFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) -D__OPENDINGUX__ $(NP2SDLDEFINE) -DSUPPORT_NP2_TICKCOUNT -DSUPPORT_NP2_THREAD -std=gnu++11
CFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) -D__OPENDINGUX__ $(NP2SDLDEFINE) -DSUPPORT_NP2_TICKCOUNT -DSUPPORT_NP2_THREAD -std=gnu11
LDFLAGS += $(fpic) -lm -lpthread $(SDL_LIBS) $(SDL_OTHER_LIBS) -L/opt/$(ODCONFIG)-toolchain/usr/lib
all: buildopk
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $^ -o $@
clean:
rm -f $(OBJECTS) $(TARGET)
rm -f *.opk
rm -f opk/$(TARGET)
rm -f opk/default.$(ODCONFIG).desktop
cppcheck: compile_commands.json
cppcheck --project=compile_commands.json --xml 2> cppcheck.xml
compile_commands.json:
bear make -f Makefile.opendingux
buildopk: $(TARGET)
cp -f $(TARGET) ./opk
cp ./opk/default_opendingux_$(TARGET)_desktop ./opk/default.$(ODCONFIG).desktop
mksquashfs ./opk $(TARGET).opk -all-root -noappend -no-exports
uninstall:
rm /usr/local/bin/$(TARGET)

View File

@ -1,87 +0,0 @@
DEBUG ?= 0
SUPPORT_NP2_THREAD ?= 1
SUPPORT_NP2_TICKCOUNT ?= 1
SUPPORT_NET ?= 1
SUPPORT_ASYNC_CPU ?= 0
SDL_VERSION ?= 2
GIT_VERSION := "$(shell git rev-parse --short HEAD)"
ifeq ($(SDL_VERSION), 1)
SDL_CONFIG ?= sdl-config
SDL_OTHER_LIBS ?= -lSDL_ttf -lSDL_mixer
SUPPORT_ASYNC_CPU ?=
else
SDL_CONFIG ?= sdl2-config
SDL_OTHER_LIBS ?= -lSDL2_ttf -lSDL2_mixer
SUPPORT_ASYNC_CPU ?= -DSUPPORT_ASYNC_CPU
endif
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -DUSE_SDL_CONFIG
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
TARGET_NAME := np2kai
TARGET := $(TARGET_NAME)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
fpic = -fPIC
ifeq ($(DEBUG), 1)
COMMONFLAGS += -O0 -g -DDEBUG -D_DEBUG -DTRACE
else
COMMONFLAGS += -O2 -DNDEBUG -D_NDEBUG
endif
CORE_DIR := ..
INCFLAGS :=
SOURCES_C :=
SOURCES_CXX :=
include Makefile.common
INCFLAGS := $(SDL_CFLAGS) $(INCFLAGS)
INCFLAGS += -I$(NP2_PATH)/i286c \
-I$(NP2_PATH)/sdl2/unix
SOURCES_C += $(wildcard $(NP2_PATH)/i286c/*.c) \
$(NP2_PATH)/sdl2/unix/main.c
NP2SDLDEFINE := -DNP2_SDL -DSUPPORT_SDL_AUDIO -DSUPPORT_SDL_MIXER -DSUPPORT_NVL_IMAGES -DSUPPORT_NP2_THREAD -DSUPPORT_NVL_IMAGES -DSUPPORT_LGY98 -DSUPPORT_NET -DSUPPORT_NP2_TICKCOUNT
OBJECTS = $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
CXXFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP2SDLDEFINE)
CFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP2SDLDEFINE)
LDFLAGS += $(fpic) -lm -lpthread $(SDL_LIBS) $(SDL_OTHER_LIBS) -ldl
all: $(TARGET)
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $^ -o $@
clean:
rm -f $(OBJECTS) $(TARGET)
cppcheck: compile_commands.json
cppcheck --project=compile_commands.json --xml 2> cppcheck.xml
compile_commands.json:
bear make -f Makefile.unix
install:
strip $(TARGET)
cp $(TARGET) /usr/local/bin/
uninstall:
rm /usr/local/bin/$(TARGET)

View File

@ -1,89 +0,0 @@
DEBUG ?= 0
SUPPORT_NP2_THREAD ?= 1
SUPPORT_NP2_TICKCOUNT ?= 1
SUPPORT_NET ?= 1
SUPPORT_ASYNC_CPU ?= 0
SDL_VERSION ?= 2
GIT_VERSION := "$(shell git rev-parse --short HEAD)"
ifeq ($(SDL_VERSION), 1)
SDL_CONFIG ?= sdl-config
SDL_OTHER_LIBS ?= -lSDL_ttf -lSDL_mixer
SUPPORT_ASYNC_CPU ?=
else
SDL_CONFIG ?= sdl2-config
SDL_OTHER_LIBS ?= -lSDL2_ttf -lSDL2_mixer
SUPPORT_ASYNC_CPU ?= -DSUPPORT_ASYNC_CPU
endif
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -DUSE_SDL_CONFIG
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
CC=gcc
TARGET_NAME := np2kai
TARGET := $(TARGET_NAME)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
fpic = -fPIC
ifeq ($(DEBUG), 1)
COMMONFLAGS += -O0 -g -DDEBUG -D_DEBUG -DTRACE
else
COMMONFLAGS += -O2 -DNDEBUG -D_NDEBUG
endif
CORE_DIR := ..
INCFLAGS :=
SOURCES_C :=
SOURCES_CXX :=
include Makefile.common
INCFLAGS := $(SDL_CFLAGS) $(INCFLAGS)
INCFLAGS += -I$(NP2_PATH)/i286c \
-I$(NP2_PATH)/sdl2/win32
# -I$(NP2_PATH)/sdl2/win32/misc
SOURCES_C += $(wildcard $(NP2_PATH)/i286c/*.c) \
$(NP2_PATH)/sdl2/win32/main.c
NP2SDLDEFINE := -DNP2_SDL -DSUPPORT_SDL_AUDIO -DSUPPORT_SDL_MIXER -DSUPPORT_NVL_IMAGES -DSUPPORT_NP2_THREAD -DSUPPORT_NVL_IMAGES -DSUPPORT_LGY98 -DSUPPORT_NET -DSUPPORT_NP2_TICKCOUNT
OBJECTS = $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
CXXFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP2SDLDEFINE)
CFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP2SDLDEFINE)
LDFLAGS += $(fpic) -lm $(SDL_LIBS) $(SDL_OTHER_LIBS) -lwinmm
all: $(TARGET)
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $^ -o $@
clean:
rm -f $(OBJECTS) $(TARGET)
cppcheck: compile_commands.json
cppcheck --project=compile_commands.json --xml 2> cppcheck.xml
compile_commands.json:
bear make -f Makefile.win
install:
strip $(TARGET)
cp $(TARGET) /usr/local/bin/
uninstall:
rm /usr/local/bin/$(TARGET)

View File

@ -1,128 +0,0 @@
# set ODCONFIG=gcw0 or ODCONFIG=rx90
CC=/opt/$(ODCONFIG)-toolchain/usr/bin/mipsel-linux-cc
AR=/opt/$(ODCONFIG)-toolchain/usr/bin/mipsel-linux-ar
CXX=/opt/$(ODCONFIG)-toolchain/usr/bin/mipsel-linux-g++
DEBUG ?= 0
SUPPORT_NP2_THREAD ?= 1
SUPPORT_NP2_TICKCOUNT ?= 1
SUPPORT_NET ?= 1
SUPPORT_ASYNC_CPU ?= 0
SDL_VERSION ?= 1
GIT_VERSION := "$(shell git rev-parse --short HEAD)"
ifeq ($($(ODCONFIG), rx90)
SDL_VERSION ?= 2
else ifeq ($($(ODCONFIG), gcw0)
SDL_VERSION ?= 1
endif
ifeq ($(SDL_VERSION), 1)
SDL_CONFIG ?= /opt/$(ODCONFIG)-toolchain/usr/mipsel-$(ODCONFIG)-linux-uclibc/sysroot/usr/bin/sdl-config
SDL_OTHER_LIBS ?= -lSDL_ttf -lSDL_mixer
SUPPORT_ASYNC_CPU ?=
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -DUSE_SDL_CONFIG
#SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
SDL_LIBS := -lSDL
else
SDL_CONFIG ?= /opt/$(ODCONFIG)-toolchain/usr/mipsel-$(ODCONFIG)-linux-uclibc/sysroot/usr/bin/sdl2-config
SDL_OTHER_LIBS ?= -lSDL2_ttf -lSDL2_mixer
SUPPORT_ASYNC_CPU ?= -DSUPPORT_ASYNC_CPU
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -DUSE_SDL_CONFIG
#SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
SDL_LIBS := -lSDL2
endif
TARGET_NAME := np21kai
TARGET := $(TARGET_NAME)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
LDFLAGS := -L/opt/$(ODCONFIG)-toolchain/usr/lib
fpic = -fPIC
ifeq ($(DEBUG), 1)
COMMONFLAGS += -O0 -g -DDEBUG -D_DEBUG -DTRACE
else
COMMONFLAGS += -O2 -DNDEBUG -D_NDEBUG
endif
CORE_DIR := ..
INCFLAGS :=
SOURCES_C :=
SOURCES_CXX :=
include Makefile.common
INCFLAGS := $(SDL_CFLAGS) $(INCFLAGS)
INCFLAGS += -I$(NP2_PATH)/sdl2/opendingux
SOURCES_C += $(NP2_PATH)/sdl2/opendingux/main.c
INCFLAGS += -I$(NP2_PATH)/i386c \
-I$(NP2_PATH)/i386c/ia32 \
-I$(NP2_PATH)/i386c/ia32/instructions \
-I$(NP2_PATH)/i386c/ia32/instructions/fpu \
-I$(NP2_PATH)/i386c/ia32/instructions/fpu/softfloat \
-I$(NP2_PATH)/i386c/ia32/instructions/mmx \
-I$(NP2_PATH)/i386c/ia32/instructions/sse
SOURCES_C += $(wildcard $(NP2_PATH)/i386c/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/*.c) \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpdummy.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_dosbox.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_dosbox2.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_softfloat.c \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/fpu/softfloat/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/mmx/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse2/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse3/*.c)
ifeq ($(SUPPORT_NET), 1)
CXXFLAGS += -DSUPPORT_NET -DSUPPORT_LGY98 -L/opt/$(ODCONFIG)-toolchain/usr/lib
CFLAGS += -DSUPPORT_NET -DSUPPORT_LGY98
endif
NP2SDLDEFINE := -DNP2_SDL -DSUPPORT_SDL_AUDIO -DSUPPORT_SDL_MIXER
OBJECTS = $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
CXXFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP21DEFINE) -D__OPENDINGUX__ $(NP2SDLDEFINE) -DSUPPORT_NP2_TICKCOUNT -DSUPPORT_NP2_THREAD -std=gnu++11
CFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP21DEFINE) -D__OPENDINGUX__ $(NP2SDLDEFINE) -DSUPPORT_NP2_TICKCOUNT -DSUPPORT_NP2_THREAD -std=gnu11
LDFLAGS += $(fpic) -lm -lpthread $(SDL_LIBS) $(SDL_OTHER_LIBS) -L/opt/$(ODCONFIG)-toolchain/usr/lib
all: buildopk
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $^ -o $@
clean:
rm -f $(OBJECTS) $(TARGET)
rm -f *.opk
rm -f opk/$(TARGET)
rm -f opk/default.$(ODCONFIG).desktop
cppcheck: compile_commands.json
cppcheck --project=compile_commands.json --xml 2> cppcheck.xml
compile_commands.json:
bear make -f Makefile.opendingux
buildopk: $(TARGET)
cp -f $(TARGET) ./opk
cp ./opk/default_opendingux_$(TARGET)_desktop ./opk/default.$(ODCONFIG).desktop
mksquashfs ./opk $(TARGET).opk -all-root -noappend -no-exports
uninstall:
rm /usr/local/bin/$(TARGET)

View File

@ -1,115 +0,0 @@
DEBUG ?= 0
SUPPORT_NP2_THREAD ?= 1
SUPPORT_NP2_TICKCOUNT ?= 1
SUPPORT_NET ?= 1
SUPPORT_ASYNC_CPU ?= 0
SUPPORT_HAXM ?= 0
SDL_VERSION ?= 2
GIT_VERSION := "$(shell git rev-parse --short HEAD)"
ifeq ($(SDL_VERSION), 1)
SDL_CONFIG ?= sdl-config
SDL_OTHER_LIBS ?= -lSDL_ttf -lSDL_mixer
SUPPORT_ASYNC_CPU ?=
else
SDL_CONFIG ?= sdl2-config
SDL_OTHER_LIBS ?= -lSDL2_ttf -lSDL2_mixer
SUPPORT_ASYNC_CPU ?= -DSUPPORT_ASYNC_CPU
endif
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -DUSE_SDL_CONFIG
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
ifeq ($(SUPPORT_HAXM), 1)
TARGET_NAME := np21kai_haxm
else
TARGET_NAME := np21kai
endif
TARGET := $(TARGET_NAME)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
fpic = -fPIC
ifeq ($(DEBUG), 1)
COMMONFLAGS += -O0 -g -DDEBUG -D_DEBUG -DTRACE
else
COMMONFLAGS += -O2 -DNDEBUG -D_NDEBUG
endif
CORE_DIR := ..
INCFLAGS :=
SOURCES_C :=
SOURCES_CXX :=
include Makefile.common
INCFLAGS := $(SDL_CFLAGS) $(INCFLAGS)
INCFLAGS += -I$(NP2_PATH)/i386c \
-I$(NP2_PATH)/i386c/ia32 \
-I$(NP2_PATH)/i386c/ia32/instructions \
-I$(NP2_PATH)/i386c/ia32/instructions/fpu \
-I$(NP2_PATH)/i386c/ia32/instructions/fpu/softfloat \
-I$(NP2_PATH)/i386c/ia32/instructions/mmx \
-I$(NP2_PATH)/i386c/ia32/instructions/sse \
-I$(NP2_PATH)/sdl2/unix
SOURCES_C += $(wildcard $(NP2_PATH)/i386c/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/*.c) \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpdummy.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_dosbox.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_dosbox2.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_softfloat.c \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/fpu/softfloat/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/mmx/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse2/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse3/*.c) \
$(NP2_PATH)/sdl2/unix/main.c
NP2SDLDEFINE := -DNP2_SDL -DSUPPORT_SDL_AUDIO -DSUPPORT_SDL_MIXER -DSUPPORT_NVL_IMAGES -DSUPPORT_NP2_THREAD -DSUPPORT_NVL_IMAGES -DSUPPORT_LGY98 -DSUPPORT_NET -DSUPPORT_NP2_TICKCOUNT
ifeq ($(SUPPORT_HAXM), 1)
INCFLAGS += -I$(NP2_PATH)/i386hax
SOURCES_C += $(wildcard $(NP2_PATH)/i386hax/*.c)
DEFINES += -DSUPPORT_IA32_HAXM -DUSE_CUSTOM_HOOKINST
endif
OBJECTS = $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
CXXFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP21DEFINE) $(NP2SDLDEFINE)
CFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP21DEFINE) $(NP2SDLDEFINE)
LDFLAGS += $(fpic) -lm -lpthread $(SDL_LIBS) $(SDL_OTHER_LIBS) -ldl
all: $(TARGET)
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $^ -o $@
clean:
rm -f $(OBJECTS) $(TARGET)
cppcheck: compile_commands.json
cppcheck --project=compile_commands.json --xml 2> cppcheck.xml
compile_commands.json:
bear make -f Makefile21.unix
install:
strip $(TARGET)
cp $(TARGET) /usr/local/bin/
uninstall:
rm /usr/local/bin/$(TARGET)

View File

@ -1,117 +0,0 @@
DEBUG ?= 0
SUPPORT_NP2_THREAD ?= 1
SUPPORT_NP2_TICKCOUNT ?= 1
SUPPORT_NET ?= 1
SUPPORT_ASYNC_CPU ?= 0
SUPPORT_HAXM ?= 0
SDL_VERSION ?= 2
GIT_VERSION := "$(shell git rev-parse --short HEAD)"
ifeq ($(SDL_VERSION), 1)
SDL_CONFIG ?= sdl-config
SDL_OTHER_LIBS ?= -lSDL_ttf -lSDL_mixer
SUPPORT_ASYNC_CPU ?=
else
SDL_CONFIG ?= sdl2-config
SDL_OTHER_LIBS ?= -lSDL2_ttf -lSDL2_mixer
SUPPORT_ASYNC_CPU ?= -DSUPPORT_ASYNC_CPU
endif
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -DUSE_SDL_CONFIG
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
CC=gcc
ifeq ($(SUPPORT_HAXM), 1)
TARGET_NAME := np21kai_haxm
else
TARGET_NAME := np21kai
endif
TARGET := $(TARGET_NAME)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
fpic = -fPIC
ifeq ($(DEBUG), 1)
COMMONFLAGS += -O0 -g -DDEBUG -D_DEBUG -DTRACE
else
COMMONFLAGS += -O2 -DNDEBUG -D_NDEBUG
endif
CORE_DIR := ..
INCFLAGS :=
SOURCES_C :=
SOURCES_CXX :=
include Makefile.common
INCFLAGS := $(SDL_CFLAGS) $(INCFLAGS)
INCFLAGS += -I$(NP2_PATH)/i386c \
-I$(NP2_PATH)/i386c/ia32 \
-I$(NP2_PATH)/i386c/ia32/instructions \
-I$(NP2_PATH)/i386c/ia32/instructions/fpu \
-I$(NP2_PATH)/i386c/ia32/instructions/fpu/softfloat \
-I$(NP2_PATH)/i386c/ia32/instructions/mmx \
-I$(NP2_PATH)/i386c/ia32/instructions/sse \
-I$(NP2_PATH)/sdl2/win32
# -I$(NP2_PATH)/sdl2/win32/misc
SOURCES_C += $(wildcard $(NP2_PATH)/i386c/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/*.c) \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpdummy.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_dosbox.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_dosbox2.c \
$(NP2_PATH)/i386c/ia32/instructions/fpu/fpemul_softfloat.c \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/fpu/softfloat/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/mmx/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse2/*.c) \
$(wildcard $(NP2_PATH)/i386c/ia32/instructions/sse3/*.c) \
$(NP2_PATH)/sdl2/win32/main.c
NP2SDLDEFINE := -DNP2_SDL -DSUPPORT_SDL_AUDIO -DSUPPORT_SDL_MIXER -DSUPPORT_NVL_IMAGES -DSUPPORT_NP2_THREAD -DSUPPORT_NVL_IMAGES -DSUPPORT_LGY98 -DSUPPORT_NET -DSUPPORT_NP2_TICKCOUNT
ifeq ($(SUPPORT_HAXM), 1)
INCFLAGS += -I$(NP2_PATH)/i386hax
SOURCES_C += $(wildcard $(NP2_PATH)/i386hax/*.c)
DEFINES += -DSUPPORT_IA32_HAXM -DUSE_CUSTOM_HOOKINST
endif
OBJECTS = $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
CXXFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP21DEFINE) $(NP2SDLDEFINE)
CFLAGS += $(fpic) $(INCFLAGS) $(COMMONFLAGS) $(NP2DEFINE) $(NP21DEFINE) $(NP2SDLDEFINE)
LDFLAGS += $(fpic) -lm $(SDL_LIBS) $(SDL_OTHER_LIBS) -lwinmm
all: $(TARGET)
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $^ -o $@
clean:
rm -f $(OBJECTS) $(TARGET)
cppcheck: compile_commands.json
cppcheck --project=compile_commands.json --xml 2> cppcheck.xml
compile_commands.json:
bear make -f Makefile21.win
install:
strip $(TARGET)
cp $(TARGET) /usr/local/bin/
uninstall:
rm /usr/local/bin/$(TARGET)

View File

@ -1,323 +0,0 @@
/**
* @file c86ctl.h
* @brief Defines of C86CTL
*/
#pragma once
namespace c86ctl
{
/**
* Status code
*/
enum C86CtlErr
{
C86CTL_ERR_NONE = 0, /*!< Succeeded */
C86CTL_ERR_UNKNOWN = -1, /*!< Unknown */
C86CTL_ERR_INVALID_PARAM = -2, /*!< Invalid parameter */
C86CTL_ERR_UNSUPPORTED = -3, /*!< Unspported */
C86CTL_ERR_NODEVICE = -1000, /*!< No devices */
C86CTL_ERR_NOT_IMPLEMENTED = -9999, /*!< Not implemented */
};
/**
* Chip type
*/
enum ChipType
{
CHIP_UNKNOWN = 0, /*!< Unknown */
CHIP_OPNA = 0x0001, /*!< OPNA */
CHIP_OPM = 0x0002, /*!< OPM */
CHIP_OPN3L = 0x0003, /*!< OPN3L */
CHIP_OPL3 = 0x0004, /*!< OPL3 */
CHIP_OPLL = 0x0005, /*!< OPLL */
CHIP_SN76489 = 0x0006,
CHIP_AY38910 = 0x0007,
CHIP_YM2203 = 0x0008,
CHIP_YM2612 = 0x0009,
CHIP_YM3526 = 0x000a,
CHIP_YM3812 = 0x000b,
CHIP_YMF271 = 0x000c,
CHIP_YMF278B = 0x000d,
CHIP_YMZ280B = 0x000e,
CHIP_YMF297 = 0x000f,
CHIP_YM2610B = 0x0010,
CHIP_Y8950 = 0x0020,
CHIP_YM3438 = 0x0021,
CHIP_YM2608NOADPCM = 0x10000 | CHIP_OPNA,
CHIP_SN76496 = 0x10000 | CHIP_SN76489,
CHIP_YM2149 = 0x10000 | CHIP_AY38910,
CHIP_Y8950ADPCM = 0x10020 | CHIP_Y8950
};
/**
* The type of CBUS boards
*/
enum CBUS_BOARD_TYPE
{
CBUS_BOARD_UNKNOWN = 0, /*!< Unknown */
CBUS_BOARD_14 = 0x0001, /*!< NEC PC-9801-14 */
CBUS_BOARD_AMD98 = 0x0011, /*!< SYSTEM SACOM AMD-98 */
CBUS_BOARD_26 = 0x0002, /*!< NEC PC-9801-26, 26K */
CBUS_BOARD_SOUND_ORCHESTRA = 0x0012, /*!< SNE Sound Orchestra */
CBUS_BOARD_SOUND_ORCHESTRA_L = 0x0022, /*!< SNE Sound Orchestra L */
CBUS_BOARD_SOUND_ORCHESTRA_V = 0x0032, /*!< SNE Sound Orchestra V */
CBUS_BOARD_SOUND_ORCHESTRA_VS = 0x0042, /*!< SNE Sound Orchestra VS */
CBUS_BOARD_SOUND_ORCHESTRA_LS = 0x0052, /*!< SNE Sound Orchestra LS */
CBUS_BOARD_SOUND_ORCHESTRA_MATE = 0x0062, /*!< SNE Sound Orchestra MATE */
CBUS_BOARD_MULTIMEDIA_ORCHESTRA = 0x0072, /*!< SNE Multimedia Orchestra */
CBUS_BOARD_LITTLE_ORCHESTRA = 0x0082, /*!< SNE Litte Orchestra */
CBUS_BOARD_LITTLE_ORCHESTRA_L = 0x0092, /*!< SNE Litte Orchestra L */
CBUS_BOARD_LITTLE_ORCHESTRA_RS = 0x00a2, /*!< SNE Litte Orchestra RS */
CBUS_BOARD_LITTLE_ORCHESTRA_LS = 0x00b2, /*!< SNE Litte Orchestra LS */
CBUS_BOARD_LITTLE_ORCHESTRA_SS = 0x00c2, /*!< SNE Litte Orchestra SS */
CBUS_BOARD_LITTLE_ORCHESTRA_MATE = 0x00d2, /*!< SNE Litte Orchestra MATE */
CBUS_BOARD_LITTLE_ORCHESTRA_FELLOW = 0x00e2, /*!< SNE Litte Orchestra FELLOW */
CBUS_BOARD_JOY2 = 0x00f2, /*!< SNE JOY-2 */
CBUS_BOARD_SOUND_GRANPRI = 0x0102, /*!< SNE SOUND GRANPRI */
CBUS_BOARD_TN_F3FM = 0x0112, /*!< TOKYO NEEDS TN-F3FM */
CBUS_BOARD_73 = 0x0003, /*!< NEC PC-9801-73 */
CBUS_BOARD_86 = 0x0023, /*!< NEC PC-9801-86 */
CBUS_BOARD_ASB01 = 0x0043, /*!< SIS Amusement Sound Board ASB-01 */
CBUS_BOARD_SPEAKBOARD = 0x0053, /*!< IDOL JAPAN SpeakBoard */
CBUS_BOARD_SOUNDPLAYER98 = 0x0063, /*!< SPB-98 */
CBUS_BOARD_SECONDBUS86 = 0x0073, /*!< second-bus86 */
CBUS_BOARD_SOUNDEDGE = 0x0083, /*!< sound-edge */
CBUS_BOARD_WINDUO = 0x0093, /*!< win-duo */
CBUS_BOARD_OTOMI = 0x00a3, /*!< MAD FACTORY OTOMI */
CBUS_BOARD_WAVEMASTER = 0x00b3, /*!< Q-Vision WaveMaster */
CBUS_BOARD_WAVESMIT = 0x00c3, /*!< Q-Vision WaveSMIT */
CBUS_BOARD_WAVESTAR = 0x00d3, /*!< Q-Vision WaveStar */
CBUS_BOARD_WSN_A4F = 0x00e3, /*!< Buffalo WSN-A4F/A2F */
CBUS_BOARD_SXM_F = 0x00f3, /*!< SXM-F */
CBUS_BOARD_SRN_F = 0x0103, /*!< SRN-F */
CBUS_BOARD_SB16 = 0x0004, /*!< sound-blaster 16 (CT2720) */
CBUS_BOARD_SB16_2203 = 0x0014, /*!< sound-blaster 16 with YM2203 (CT2720) */
CBUS_BOARD_SB16VALUE = 0x0024, /*!< sound-blaster 16Value (CT3720) */
CBUS_BOARD_POWERWINDOW_T64S = 0x0034, /*!< canopus PowerWindow T64S */
CBUS_BOARD_PCSB2 = 0x0044, /*!< EPSON PCSB2 */
CBUS_BOARD_WGS98S = 0x0054, /*!< COM.TECH WGS-98S */
CBUS_BOARD_SRB_G = 0x0064, /*!< buffalo SRB-G */
CBUS_BOARD_MIDI_ORCHESTRA_MIDI3 = 0x0074, /*!< SNE MIDI ORCHESTRA MIDI-3 */
CBUS_BOARD_SB_AWE32 = 0x0005, /*!< SoundBlaster AWE32 (CT3610) */
CBUS_BOARD_118 = 0x0006 /*!< NEC PC-9801-118 */
};
/**
* @brief Device information structure
*/
struct Devinfo
{
char Devname[16]; /*!< Device name */
char Rev; /*!< Revision */
char Serial[15]; /*!< Serial */
};
/**
* The interface ID
*/
enum IID
{
IID_IRealChipBase = 0,
IID_IRealChip,
IID_IRealChip2,
IID_IRealChip3,
IID_IGimic,
IID_IGimic2,
IID_IC86Usb
};
/**
* @brief The class of IUnknown
*/
class IRealUnknown
{
public:
/**
* Increments the reference count
* @return The new reference count
*/
virtual size_t AddRef() = 0;
/**
* Decrements the reference count
* @return The new reference count
*/
virtual size_t Release() = 0;
};
/**
* @brief The class of IRealChipBase
*/
class IRealChipBase : public IRealUnknown
{
public:
/**
* Initialize
* @return C86CTL_ERR
*/
virtual C86CtlErr initialize() = 0;
/**
* Deinitialize
* @return C86CTL_ERR
*/
virtual C86CtlErr deinitialize() = 0;
/**
* Gets the count of chips
* @return The chips
*/
virtual size_t getNumberOfChip() = 0;
/**
* Gets interfaces
* @param[in] id ID
* @param[in] riid The interface ID
* @param[out] ppi The pointer of the interface
* @return C86CTL_ERR
*/
virtual C86CtlErr getChipInterface(size_t id, IID riid, void** ppi) = 0;
};
/**
* @brief The class of IRealChip
*/
class IRealChip : public IRealUnknown
{
public:
/**
* Reset
* @return C86CTL_ERR
*/
virtual C86CtlErr reset() = 0;
/**
* Output
* @param[in] nAddr The address
* @param[in] cData The data
*/
virtual void out(UINT nAddr, UINT8 cData) = 0;
/**
* Input
* @param[in] nAddr The address of registers
* @return The data
*/
virtual UINT8 in(UINT nAddr) = 0;
};
/**
* @brief The class of IRealChip2
*/
class IRealChip2 : public IRealChip
{
public:
/**
* Gets the current status
* @param[in] nAddr The address
* @param[out] pcStatus The status
* @return C86CTL_ERR
*/
virtual C86CtlErr getChipStatus(UINT nAddr, UINT8* pcStatus) = 0;
/**
* Output
* @param[in] nAddr The address
* @param[in] cData The data
*/
virtual void directOut(UINT nAddr, UINT8 cData) = 0;
};
/**
* @brief The class of IRealChip3
*/
class IRealChip3 : public IRealChip2
{
public:
/**
* Gets the type of the chip
* @param[out] pnType A pointer of type
* @return C86CTL_ERR
*/
virtual C86CtlErr getChipType(ChipType* pnType) = 0;
};
/**
* @brief The class of IGimic
*/
class IGimic : public IRealUnknown
{
public:
/**
* Gets the informations of firm
* @param[out] pnMajor A pointer to the major
* @param[out] pnMinor A pointer to the minor
* @param[out] pnRev A pointer to the revision
* @param[out] pnBuild A pointer to the number of build
* @return C86CTL_ERR
*/
virtual C86CtlErr getFWVer(UINT* pnMajor, UINT* pnMinor, UINT* pnRev, UINT* pnBuild) = 0;
/**
* Gets the informations of the mother
* @param[out] pInfo A pointer to the informations
* @return C86CTL_ERR
*/
virtual C86CtlErr getMBInfo(Devinfo* pInfo) = 0;
/**
* Gets the informations of modules
* @param[out] pInfo A pointer to the informations
* @return C86CTL_ERR
*/
virtual C86CtlErr getModuleInfo(Devinfo* pInfo) = 0;
/**
* Sets the volumes of SSG
* @param[in] cVolume The volume
* @return C86CTL_ERR
*/
virtual C86CtlErr setSSGVolume(UINT8 cVolume) = 0;
/**
* Gets the volume of SSG
* @param[out] pcVolume A pointer of the volume
* @return C86CTL_ERR
*/
virtual C86CtlErr getSSGVolume(UINT8* pcVolume) = 0;
/**
* Sets the clock
* @param[in] nClock The clock
* @return C86CTL_ERR
*/
virtual C86CtlErr setPLLClock(UINT nClock) = 0;
/**
* Gets the clock
* @param[out] pnClock A pointer to the clock
* @return C86CTL_ERR
*/
virtual C86CtlErr getPLLClock(UINT* pnClock) = 0;
};
/**
* @brief The class of IGimic2
*/
class IGimic2 : public IGimic
{
public:
/**
* Gets the type of the modules
* @param[out] pnType The type
* @return C86CTL_ERR
*/
virtual C86CtlErr getModuleType(ChipType* pnType) = 0;
};
C86CtlErr CreateInstance(IID riid, void** ppi);
}

View File

@ -1,506 +0,0 @@
/**
* @file c86ctlc86box.cpp
* @brief Implementation of C86BOX
*/
#include <compiler.h>
#include "c86ctlc86box.h"
#include <algorithm>
namespace c86ctl
{
//! The maximum chips
#define NMAXCHIPS 4
/**
* @brief The information of sound baords
*/
struct BOARD_INFO
{
UINT type; //!< The type of boards
UINT nchips; //!< The numbers of chips
ChipType chiptype[NMAXCHIPS]; //!< The type of chips
};
/**
* @brief The board's names
*/
struct BoardName
{
CBUS_BOARD_TYPE nId; //!< The type of boards
const char* lpName; //!< The name of boards
};
/**
* The tables of baords
*/
static const BoardName s_names[] =
{
{CBUS_BOARD_14, "PC-9801-14"},
{CBUS_BOARD_26, "PC-9801-26K"},
{CBUS_BOARD_SOUND_ORCHESTRA, "ORCHESTRA"},
{CBUS_BOARD_SOUND_ORCHESTRA_L, "ORCHESTRA-L"},
{CBUS_BOARD_SOUND_ORCHESTRA_V, "ORCHESTRA-V"},
{CBUS_BOARD_SOUND_ORCHESTRA_VS, "ORCHESTRA-VS"},
{CBUS_BOARD_SOUND_ORCHESTRA_LS, "ORCHESTRA-LS"},
{CBUS_BOARD_SOUND_ORCHESTRA_MATE, "ORCHESTRA-MATE"},
{CBUS_BOARD_MULTIMEDIA_ORCHESTRA, "MMO"},
{CBUS_BOARD_LITTLE_ORCHESTRA, "LITTLE"},
{CBUS_BOARD_LITTLE_ORCHESTRA_L, "LITTLE-L"},
{CBUS_BOARD_LITTLE_ORCHESTRA_RS, "LITTLE-RS"},
{CBUS_BOARD_LITTLE_ORCHESTRA_LS, "LITTLE-LS"},
{CBUS_BOARD_LITTLE_ORCHESTRA_SS, "LITTLE-SS"},
{CBUS_BOARD_LITTLE_ORCHESTRA_MATE, "LITTLE-MATE"},
{CBUS_BOARD_LITTLE_ORCHESTRA_FELLOW, "LITTLE-FELLOW"},
{CBUS_BOARD_JOY2, "JOY2"},
{CBUS_BOARD_SOUND_GRANPRI, "GRANPRI"},
{CBUS_BOARD_TN_F3FM, "TN-F3FM"},
{CBUS_BOARD_73, "PC-9801-73"},
{CBUS_BOARD_86, "PC-9801-86"},
{CBUS_BOARD_ASB01, "ASB-01"},
{CBUS_BOARD_SPEAKBOARD, "SPEAKBOARD"},
{CBUS_BOARD_SOUNDPLAYER98, "SPB98"},
{CBUS_BOARD_SECONDBUS86, "SB86"},
{CBUS_BOARD_SOUNDEDGE, "SOUNDEDGE"},
{CBUS_BOARD_WINDUO, "WINDUO"},
{CBUS_BOARD_OTOMI, "OTOMI"},
{CBUS_BOARD_WAVEMASTER, "WAVEMASTER"},
{CBUS_BOARD_WAVESMIT, "WAVESIMIT"},
{CBUS_BOARD_WAVESTAR, "WAVESTAR"},
{CBUS_BOARD_WSN_A4F, "WSN-A4F"},
{CBUS_BOARD_SB16, "SB16"},
{CBUS_BOARD_SB16_2203, "SB16"},
{CBUS_BOARD_SB16VALUE, "SB16VALUE"},
{CBUS_BOARD_POWERWINDOW_T64S, "PW-T64S"},
{CBUS_BOARD_PCSB2, "PC-SB2"},
{CBUS_BOARD_WGS98S, "WGS-98S"},
{CBUS_BOARD_SXM_F, "SXM-F"},
{CBUS_BOARD_SRB_G, "SRB-G"},
{CBUS_BOARD_MIDI_ORCHESTRA_MIDI3 , "MIDI-3"},
{CBUS_BOARD_SB_AWE32, "SB-AWE32"},
{CBUS_BOARD_118, "PC-9801-118"},
};
/**
* Gets the name from type of boards
* @param[in] nType The type of boards
* @return The name of boards
*/
static const char* GetBoardName(CBUS_BOARD_TYPE nType)
{
const CBUS_BOARD_TYPE nId = static_cast<CBUS_BOARD_TYPE>(nType & 0xffff);
for (UINT i = 0; i < NELEMENTS(s_names); i++)
{
if (s_names[i].nId == nId)
{
return s_names[i].lpName;
}
}
return "UNKNOWN";
}
/**
* Constructor
* @param[in] nIndex The index
*/
CC86Box::CC86Box(UINT nIndex)
: m_nRef(1)
, m_nIndex(nIndex)
, m_nQueIndex(0)
, m_nQueCount(0)
{
}
/**
* Destructor
*/
CC86Box::~CC86Box()
{
}
/**
* Increments the reference count
* @return The new reference count
*/
size_t CC86Box::AddRef()
{
m_nRef++;
return m_nRef;
}
/**
* Decrements the reference count
* @return The new reference count
*/
size_t CC86Box::Release()
{
m_nRef--;
return m_nRef;
}
/**
* Initialize
* @return C86CTL_ERR
*/
C86CtlErr CC86Box::initialize()
{
if (!m_usb.Open(0x16c0, 0x27d8, m_nIndex))
{
return C86CTL_ERR_NODEVICE;
}
for (UINT i = 0; i < 2; i++)
{
BOARD_INFO info;
if (m_usb.CtrlXfer(0xc0, 0x81, 0, i, &info, sizeof(info)) != sizeof(info))
{
continue;
}
printf("Found %s in C86BOX-Slot#%c / chips: %d\n", GetBoardName(static_cast<CBUS_BOARD_TYPE>(info.type)), 'A' + i, info.nchips);
for (UINT j = 0; j < info.nchips; j++)
{
const UINT nDevId = (i << 3) | j;
m_chips.push_back(new Chip3(this, nDevId, info.chiptype[j]));
}
}
if (m_chips.empty())
{
m_usb.Close();
return C86CTL_ERR_NODEVICE;
}
m_nQueIndex = 0;
m_nQueCount = 0;
Start();
return C86CTL_ERR_NONE;
}
/**
* Deinitialize
* @return C86CTL_ERR
*/
C86CtlErr CC86Box::deinitialize()
{
Stop();
m_usb.Close();
for (std::vector<Chip3*>::iterator it = m_chips.begin(); it != m_chips.end(); ++it)
{
delete *it;
}
m_chips.clear();
return C86CTL_ERR_NONE;
}
/**
* Gets the count of chips
* @return The chips
*/
size_t CC86Box::getNumberOfChip()
{
return m_chips.size();
}
/**
* Gets interfaces
* @param[in] id ID
* @param[in] riid The interface ID
* @param[out] ppi The pointer of the interface
* @return C86CTL_ERR
*/
C86CtlErr CC86Box::getChipInterface(size_t id, IID riid, void** ppi)
{
if (ppi == NULL)
{
return C86CTL_ERR_INVALID_PARAM;
}
if (id >= m_chips.size())
{
return C86CTL_ERR_NODEVICE;
}
IRealUnknown* pUnknown = NULL;
switch (riid)
{
case IID_IRealChip:
case IID_IRealChip2:
case IID_IRealChip3:
pUnknown = m_chips[id];
break;
default:
break;
}
if (pUnknown == NULL)
{
return C86CTL_ERR_UNSUPPORTED;
}
pUnknown->AddRef();
*ppi = pUnknown;
return C86CTL_ERR_NONE;
}
/**
* Sends and receives data from USB
* @param[in] lpOutput A pointer to the buffer that sends the data
* @param[in] cbOutput The number of bytes to be written
* @param[out] lpInput A pointer to the buffer that receives the data
* @param[in] cbInput The maximum number of bytes to be read
* @return C86CTL_ERR
*/
C86CtlErr CC86Box::Transaction(const void* lpOutput, int cbOutput, void* lpInput, int cbInput)
{
if (!m_usb.IsOpened())
{
return C86CTL_ERR_NODEVICE;
}
char sBuffer[64];
if ((lpOutput == NULL) || (cbOutput <= 0) || (cbOutput >= sizeof(sBuffer)))
{
return C86CTL_ERR_INVALID_PARAM;
}
::memcpy(sBuffer, lpOutput, cbOutput);
if (cbOutput < sizeof(sBuffer))
{
::memset(sBuffer + cbOutput, 0xff, sizeof(sBuffer) - cbOutput);
}
m_usbGuard.Enter();
int nResult = m_usb.WriteBulk(sBuffer, sizeof(sBuffer));
if ((nResult == sizeof(sBuffer)) && (cbInput > 0))
{
nResult = m_usb.ReadBulk(sBuffer, sizeof(sBuffer));
}
m_usbGuard.Leave();
if (nResult != sizeof(sBuffer))
{
return C86CTL_ERR_UNKNOWN;
}
if ((lpInput != NULL) && (cbInput > 0))
{
cbInput = (std::min)(cbInput, static_cast<int>(sizeof(sBuffer)));
::memcpy(lpInput, sBuffer, cbInput);
}
return C86CTL_ERR_NONE;
}
/**
* Reset
* @return C86CTL_ERR
*/
C86CtlErr CC86Box::Reset()
{
m_queGuard.Enter();
m_nQueIndex = 0;
m_nQueCount = 0;
m_queGuard.Leave();
m_usbGuard.Enter();
const int r = m_usb.CtrlXfer(0x40, 0x11);
m_usbGuard.Leave();
return (r >= 0) ? C86CTL_ERR_NONE : C86CTL_ERR_UNKNOWN;
}
/**
* Output
* @param[in] nDevId The id of chips
* @param[in] nAddr The address of registers
* @param[in] cData The data
*/
void CC86Box::Out(UINT nDevId, UINT nAddr, UINT8 cData)
{
m_queGuard.Enter();
while (m_nQueCount >= NELEMENTS(m_que))
{
m_queGuard.Leave();
Delay(1000);
m_queGuard.Enter();
}
m_que[(m_nQueIndex + m_nQueCount) % NELEMENTS(m_que)] = (nDevId << 17) | ((nAddr & 0x1ff) << 8) | cData;
m_nQueCount++;
m_queGuard.Leave();
}
/**
* Thread
* @retval true Cont.
*/
bool CC86Box::Task()
{
/* builds data */
UINT8 sData[64];
int nIndex = 0;
m_queGuard.Enter();
while ((m_nQueCount) && ((nIndex + 8) < NELEMENTS(sData)))
{
const UINT data = m_que[m_nQueIndex];
m_nQueIndex = (m_nQueIndex + 1) % NELEMENTS(m_que);
m_nQueCount--;
sData[nIndex++] = static_cast<UINT8>(data >> 0);
sData[nIndex++] = static_cast<UINT8>(data >> 8);
sData[nIndex++] = static_cast<UINT8>(data >> 16);
sData[nIndex++] = static_cast<UINT8>(data >> 24);
}
m_queGuard.Leave();
/* writes */
if (nIndex > 0)
{
Transaction(sData, nIndex);
}
else
{
Delay(1000);
}
return true;
}
/* IRealChip3 */
/**
* Constructor
* @param[in] pC86Box The instance of the device
* @param[in] nDevId The id of the chip
* @param[in] nChipType The type of the chip
*/
CC86Box::Chip3::Chip3(CC86Box* pC86Box, UINT nDevId, ChipType nChipType)
: m_pC86Box(pC86Box)
, m_nDevId(nDevId)
, m_nChipType(nChipType)
{
}
/**
* Get the instance of the device
* @return The instance
*/
inline CC86Box* CC86Box::Chip3::GetDevice()
{
return m_pC86Box;
}
/**
* Increments the reference count
* @return The new reference count
*/
size_t CC86Box::Chip3::AddRef()
{
return GetDevice()->AddRef();
}
/**
* Decrements the reference count
* @return The new reference count
*/
size_t CC86Box::Chip3::Release()
{
return GetDevice()->Release();
}
/**
* Reset
* @return C86CTL_ERR
*/
C86CtlErr CC86Box::Chip3::reset()
{
memset(m_sReg, 0, sizeof(m_sReg));
return GetDevice()->Reset();
}
/**
* Output
* @param[in] nAddr The address of registers
* @param[in] cData The data
*/
void CC86Box::Chip3::out(UINT nAddr, UINT8 cData)
{
if (nAddr >= sizeof(m_sReg))
{
return;
}
m_sReg[nAddr] = cData;
GetDevice()->Out(m_nDevId, nAddr, cData);
}
/**
* Input
* @param[in] nAddr The address of registers
* @return The data
*/
UINT8 CC86Box::Chip3::in(UINT nAddr)
{
if (nAddr < sizeof(m_sReg))
{
return m_sReg[nAddr];
}
return 0xff;
}
/**
* Gets the current status
* @param[in] nAddr The address
* @param[out] pcStatus The status
* @return C86CTL_ERR
*/
C86CtlErr CC86Box::Chip3::getChipStatus(UINT nAddr, UINT8* pcStatus)
{
return C86CTL_ERR_NOT_IMPLEMENTED;
}
/**
* Output
* @param[in] nAddr The address
* @param[in] cData The data
*/
void CC86Box::Chip3::directOut(UINT nAddr, UINT8 cData)
{
if (nAddr >= sizeof(m_sReg))
{
return;
}
m_sReg[nAddr] = cData;
const UINT data = (m_nDevId << 17) | ((nAddr & 0x1ff) << 8) | cData;
UINT8 sData[4];
sData[0] = static_cast<UINT8>(data >> 0);
sData[1] = static_cast<UINT8>(data >> 8);
sData[2] = static_cast<UINT8>(data >> 16);
sData[3] = static_cast<UINT8>(data >> 24);
GetDevice()->Transaction(sData, sizeof(sData));
}
/**
* Gets the type of the chip
* @param[out] pnType A pointer of type
* @return C86CTL_ERR
*/
C86CtlErr CC86Box::Chip3::getChipType(ChipType* pnType)
{
if (pnType != NULL)
{
*pnType = m_nChipType;
}
return C86CTL_ERR_NONE;
}
} // namespace c86ctl

View File

@ -1,90 +0,0 @@
/**
* @file c86ctlc86box.h
* @brief Interface of C86BOX
*/
#pragma once
#include <vector>
#include "c86ctlrealchipbase.h"
#include "misc/guard.h"
#include "misc/threadbase.h"
#include "misc/usbdev.h"
namespace c86ctl
{
/**
* @brief The class of C86BOX
*/
class CC86Box : public CRealChipBase::CDevice, protected CThreadBase
{
public:
CC86Box(UINT nIndex);
virtual ~CC86Box();
// IRealUnknown
virtual size_t AddRef();
virtual size_t Release();
// IRealChipBase
virtual C86CtlErr initialize();
virtual C86CtlErr deinitialize();
virtual size_t getNumberOfChip();
virtual C86CtlErr getChipInterface(size_t id, IID riid, void** ppi);
protected:
virtual bool Task();
private:
/**
* @brief The class of the chip
*/
class Chip3 : public IRealChip3
{
public:
Chip3(CC86Box* pC86Box, UINT nDevId, ChipType nChipType);
// IRealUnknown
virtual size_t AddRef();
virtual size_t Release();
// IRealChip
virtual C86CtlErr reset();
virtual void out(UINT nAddr, UINT8 cData);
virtual UINT8 in(UINT nAddr);
// IRealChip2
virtual C86CtlErr getChipStatus(UINT nAddr, UINT8* pcStatus);
virtual void directOut(UINT nAddr, UINT8 cData);
// IRealChip3
virtual C86CtlErr getChipType(ChipType* pnType);
private:
CC86Box* m_pC86Box; /*!< The instance of the device */
UINT m_nDevId; /*!< The type of devices */
ChipType m_nChipType; /*!< The type of chip */
UINT8 m_sReg[0x200]; /*!< register */
CC86Box* GetDevice();
};
size_t m_nRef; /*!< The reference counter */
UINT m_nIndex; /*!< The index of devices */
CUsbDev m_usb; /*!< USB */
CGuard m_usbGuard; /*!< The quard of accessing USB */
CGuard m_queGuard; /*!< The quard of que */
UINT m_nQueIndex; /*!< The position in que */
UINT m_nQueCount; /*!< The count in que */
UINT m_que[0x400]; /*!< que */
std::vector<Chip3*> m_chips; /*!< The list of chips */
C86CtlErr Transaction(const void* lpOutput, int cbOutput, void* lpInput = NULL, int cbInput = 0);
C86CtlErr Reset();
void Out(UINT nDevId, UINT nAddr, UINT8 cData);
friend class Chip3;
};
} // namespace c86ctl

View File

@ -1,709 +0,0 @@
/**
* @file c86ctlgimic.cpp
* @brief Implementation of G.I.M.I.C
*/
#include <compiler.h>
#include "c86ctlgimic.h"
#include <algorithm>
namespace c86ctl
{
/**
* Constructor
* @param[in] nIndex The index
*/
CGimic::CGimic(UINT nIndex)
: m_nRef(1)
, m_nIndex(nIndex)
, m_nChipType(CHIP_UNKNOWN)
, m_nQueIndex(0)
, m_nQueCount(0)
, m_gimic2(this)
, m_chip3(this)
{
}
/**
* Destructor
*/
CGimic::~CGimic()
{
}
/**
* Increments the reference count
* @return The new reference count
*/
size_t CGimic::AddRef()
{
m_nRef++;
return m_nRef;
}
/**
* Decrements the reference count
* @return The new reference count
*/
size_t CGimic::Release()
{
m_nRef--;
return m_nRef;
}
/**
* Initialize
* @return C86CTL_ERR
*/
C86CtlErr CGimic::initialize()
{
if (!m_usb.Open(0x16c0, 0x05e5, m_nIndex))
{
return C86CTL_ERR_NODEVICE;
}
// Query G.I.M.I.C module info.
Devinfo info;
::memset(&info, 0, sizeof(info));
if (m_gimic2.getModuleInfo(&info) != 0)
{
m_usb.Close();
return C86CTL_ERR_NODEVICE;
}
printf("Found G.I.M.I.C!\n");
printf("Devname: %s\n", info.Devname);
printf(" Rev: %d\n", info.Rev);
printf(" Serial: %s\n", info.Serial);
if (!::memcmp(info.Devname, "GMC-OPN3L", 9))
{
m_nChipType = CHIP_OPN3L;
}
else if (!::memcmp(info.Devname, "GMC-OPM", 7))
{
m_nChipType = CHIP_OPM;
}
else if (!::memcmp(info.Devname, "GMC-OPNA", 8))
{
m_nChipType = CHIP_OPNA;
}
else if (!::memcmp(info.Devname, "GMC-OPL3", 8))
{
m_nChipType = CHIP_OPL3;
}
m_nQueIndex = 0;
m_nQueCount = 0;
Start();
return C86CTL_ERR_NONE;
}
/**
* Deinitialize
* @return C86CTL_ERR
*/
C86CtlErr CGimic::deinitialize()
{
Stop();
m_usb.Close();
m_nChipType = CHIP_UNKNOWN;
return C86CTL_ERR_NONE;
}
/**
* Gets the count of chips
* @return The chips
*/
size_t CGimic::getNumberOfChip()
{
return (m_nChipType != CHIP_UNKNOWN) ? 1 : 0;
}
/**
* Gets interfaces
* @param[in] id ID
* @param[in] riid The interface ID
* @param[out] ppi The pointer of the interface
* @return C86CTL_ERR
*/
C86CtlErr CGimic::getChipInterface(size_t id, IID riid, void** ppi)
{
if (ppi == NULL)
{
return C86CTL_ERR_INVALID_PARAM;
}
if (id != 0)
{
return C86CTL_ERR_NODEVICE;
}
switch (riid)
{
case IID_IRealChip:
case IID_IRealChip2:
case IID_IRealChip3:
m_chip3.AddRef();
*ppi = &m_chip3;
return C86CTL_ERR_NONE;
case IID_IGimic:
case IID_IGimic2:
m_gimic2.AddRef();
*ppi = &m_gimic2;
return C86CTL_ERR_NONE;
default:
break;
}
return C86CTL_ERR_UNSUPPORTED;
}
/**
* Sends and receives data from USB
* @param[in] lpOutput A pointer to the buffer that sends the data
* @param[in] cbOutput The number of bytes to be written
* @param[out] lpInput A pointer to the buffer that receives the data
* @param[in] cbInput The maximum number of bytes to be read
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Transaction(const void* lpOutput, int cbOutput, void* lpInput, int cbInput)
{
if (!m_usb.IsOpened())
{
return C86CTL_ERR_NODEVICE;
}
char sBuffer[64];
if ((lpOutput == NULL) || (cbOutput <= 0) || (cbOutput >= sizeof(sBuffer)))
{
return C86CTL_ERR_INVALID_PARAM;
}
::memcpy(sBuffer, lpOutput, cbOutput);
::memset(sBuffer + cbOutput, 0xff, sizeof(sBuffer) - cbOutput);
m_usbGuard.Enter();
int nResult = m_usb.WriteBulk(sBuffer, sizeof(sBuffer));
if ((nResult == sizeof(sBuffer)) && (cbInput > 0))
{
nResult = m_usb.ReadBulk(sBuffer, sizeof(sBuffer));
}
m_usbGuard.Leave();
if (nResult != sizeof(sBuffer))
{
return C86CTL_ERR_UNKNOWN;
}
if ((lpInput != NULL) && (cbInput > 0))
{
cbInput = (std::min)(cbInput, static_cast<int>(sizeof(sBuffer)));
::memcpy(lpInput, sBuffer, cbInput);
}
return C86CTL_ERR_NONE;
}
/**
* Gets the informations
* @param[in] cParam The parameter
* @param[out] pInfo A pointer to the informations
* @return C86CTL_ERR
*/
C86CtlErr CGimic::GetInfo(UINT8 cParam, Devinfo* pInfo)
{
UINT8 sData[3];
sData[0] = 0xfd;
sData[1] = 0x91;
sData[2] = cParam;
const C86CtlErr ret = Transaction(sData, sizeof(sData), pInfo, sizeof(*pInfo));
if ((ret == C86CTL_ERR_NONE) && (pInfo != NULL))
{
TailZeroFill(pInfo->Devname, sizeof(pInfo->Devname));
TailZeroFill(pInfo->Serial, sizeof(pInfo->Serial));
}
return ret;
}
/**
* Sets ZeroFill
* @param[in] lpBuffer A pointer to the buffer
* @param[in] cbBuffer The number of bytes
*/
void CGimic::TailZeroFill(char* lpBuffer, size_t cbBuffer)
{
while (cbBuffer > 0)
{
cbBuffer--;
if (lpBuffer[cbBuffer] == -1)
{
lpBuffer[cbBuffer] = '\0';
}
else if (lpBuffer[cbBuffer] != '\0')
{
break;
}
}
}
/**
* Reset
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Reset()
{
m_queGuard.Enter();
m_nQueIndex = 0;
m_nQueCount = 0;
m_queGuard.Leave();
static const UINT8 sData[2] = {0xfd, 0x82};
return Transaction(sData, sizeof(sData));
}
/**
* Remaps address
* @param[in] nAddr The address
* @return The remapped address
*/
UINT CGimic::GetChipAddr(UINT nAddr) const
{
switch (m_nChipType)
{
case CHIP_OPNA:
case CHIP_OPN3L:
if ((nAddr >= 0x100) && (nAddr <= 0x110))
{
nAddr -= 0x40;
}
break;
case CHIP_OPM:
if ((nAddr >= 0xfc) && (nAddr <= 0xff))
{
nAddr -= 0xe0;
}
break;
default:
break;
}
return nAddr;
}
/**
* Output
* @param[in] nAddr The address of registers
* @param[in] cData The data
*/
void CGimic::Out(UINT nAddr, UINT8 cData)
{
m_queGuard.Enter();
while (m_nQueCount >= NELEMENTS(m_que))
{
m_queGuard.Leave();
Delay(1000);
m_queGuard.Enter();
}
FMDATA& data = m_que[(m_nQueIndex + m_nQueCount) % NELEMENTS(m_que)];
data.wAddr = static_cast<UINT16>(nAddr);
data.cData = cData;
m_nQueCount++;
m_queGuard.Leave();
}
/**
* Thread
* @retval true Cont.
*/
bool CGimic::Task()
{
/* builds data */
UINT8 sData[64];
int nIndex = 0;
m_queGuard.Enter();
while (m_nQueCount)
{
const FMDATA& data = m_que[m_nQueIndex];
const UINT nAddr = data.wAddr;
const UINT8 cData = data.cData;
if (nAddr < 0xfc)
{
if ((nIndex + 2 + 1) >= NELEMENTS(sData))
{
break;
}
sData[nIndex++] = static_cast<UINT8>(nAddr & 0xff);
sData[nIndex++] = cData;
}
else if ((nAddr >= 0x100) && (nAddr <= 0x1fb))
{
if ((nIndex + 3 + 1) >= NELEMENTS(sData))
{
break;
}
sData[nIndex++] = 0xfe;
sData[nIndex++] = static_cast<UINT8>(nAddr & 0xff);
sData[nIndex++] = cData;
}
m_nQueIndex = (m_nQueIndex + 1) % NELEMENTS(m_que);
m_nQueCount--;
}
m_queGuard.Leave();
/* writes */
if (nIndex > 0)
{
Transaction(sData, nIndex);
}
else
{
Delay(1000);
}
return true;
}
/* IGimic2 */
/**
* Constructor
* @param[in] pDevice The instance of the device
*/
CGimic::Gimic2::Gimic2(CGimic* pDevice)
: m_pDevice(pDevice)
{
}
/**
* Get the instance of the device
* @return The instance
*/
inline CGimic* CGimic::Gimic2::GetDevice()
{
return m_pDevice;
}
/**
* Increments the reference count
* @return The new reference count
*/
size_t CGimic::Gimic2::AddRef()
{
return GetDevice()->AddRef();
}
/**
* Decrements the reference count
* @return The new reference count
*/
size_t CGimic::Gimic2::Release()
{
return GetDevice()->Release();
}
/**
* Gets the informations of firm
* @param[out] pnMajor A pointer to the major
* @param[out] pnMinor A pointer to the minor
* @param[out] pnRev A pointer to the revision
* @param[out] pnBuild A pointer to the number of build
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Gimic2::getFWVer(UINT* pnMajor, UINT* pnMinor, UINT* pnRev, UINT* pnBuild)
{
static const UINT8 sData[2] = {0xfd, 0x92};
UINT8 sRecv[16];
const C86CtlErr ret = GetDevice()->Transaction(sData, sizeof(sData), sRecv, sizeof(sRecv));
if (ret == C86CTL_ERR_NONE)
{
if (pnMajor != NULL)
{
*pnMajor = (sRecv[0] << 0) | (sRecv[1] << 8) | (sRecv[2] << 16) | (sRecv[3] << 24);
}
if (pnMinor != NULL)
{
*pnMinor = (sRecv[4] << 0) | (sRecv[5] << 8) | (sRecv[6] << 16) | (sRecv[7] << 24);
}
if (pnRev != NULL)
{
*pnRev = (sRecv[8] << 0) | (sRecv[9] << 8) | (sRecv[10] << 16) | (sRecv[11] << 24);
}
if (pnBuild != NULL)
{
*pnBuild = (sRecv[12] << 0) | (sRecv[13] << 8) | (sRecv[14] << 16) | (sRecv[15] << 24);
}
}
return ret;
}
/**
* Gets the informations of the mother
* @param[out] pInfo A pointer to the informations
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Gimic2::getMBInfo(Devinfo* pInfo)
{
return GetDevice()->GetInfo(0xff, pInfo);
}
/**
* Gets the informations of modules
* @param[out] pInfo A pointer to the informations
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Gimic2::getModuleInfo(Devinfo* pInfo)
{
return GetDevice()->GetInfo(0, pInfo);
}
/**
* Sets the volumes of SSG
* @param[in] cVolume The volume
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Gimic2::setSSGVolume(UINT8 cVolume)
{
if (GetDevice()->m_nChipType != CHIP_OPNA)
{
return C86CTL_ERR_UNSUPPORTED;
}
UINT8 sData[3];
sData[0] = 0xfd;
sData[1] = 0x84;
sData[2] = cVolume;
return GetDevice()->Transaction(sData, sizeof(sData));
}
/**
* Gets the volume of SSG
* @param[out] pcVolume A pointer of the volume
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Gimic2::getSSGVolume(UINT8* pcVolume)
{
if (GetDevice()->m_nChipType != CHIP_OPNA)
{
return C86CTL_ERR_UNSUPPORTED;
}
static const UINT8 sData[2] = {0xfd, 0x86};
return GetDevice()->Transaction(sData, sizeof(sData), pcVolume, sizeof(*pcVolume));
}
/**
* Sets the clock
* @param[in] nClock The clock
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Gimic2::setPLLClock(UINT nClock)
{
const ChipType nChipType = GetDevice()->m_nChipType;
if ((nChipType != CHIP_OPNA) && (nChipType != CHIP_OPM) && (nChipType != CHIP_OPL3))
{
return C86CTL_ERR_UNSUPPORTED;
}
UINT8 sData[6];
sData[0] = 0xfd;
sData[1] = 0x83;
sData[2] = static_cast<UINT8>((nClock >> 0) & 0xff);
sData[3] = static_cast<UINT8>((nClock >> 8) & 0xff);
sData[4] = static_cast<UINT8>((nClock >> 16) & 0xff);
sData[5] = static_cast<UINT8>((nClock >> 24) & 0xff);
return GetDevice()->Transaction(sData, sizeof(sData));
}
/**
* Gets the clock
* @param[out] pnClock A pointer to the clock
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Gimic2::getPLLClock(UINT* pnClock)
{
const ChipType nChipType = GetDevice()->m_nChipType;
if ((nChipType != CHIP_OPNA) && (nChipType != CHIP_OPM) && (nChipType != CHIP_OPL3))
{
return C86CTL_ERR_UNSUPPORTED;
}
static const UINT8 sData[2] = {0xfd, 0x85};
UINT8 sRecv[4];
const C86CtlErr ret = GetDevice()->Transaction(sData, sizeof(sData), sRecv, sizeof(sRecv));
if ((ret == C86CTL_ERR_NONE) && (pnClock != NULL))
{
*pnClock = (sRecv[0] << 0) | (sRecv[1] << 8) | (sRecv[2] << 16) | (sRecv[3] << 24);
}
return ret;
}
/**
* Gets the type of the modules
* @param[out] pnType The type
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Gimic2::getModuleType(ChipType* pnType)
{
if (pnType != NULL)
{
*pnType = GetDevice()->m_nChipType;
}
return C86CTL_ERR_NONE;
}
/* IRealChip3 */
/**
* Constructor
* @param[in] pDevice The instance of the device
*/
CGimic::Chip3::Chip3(CGimic* pDevice)
: m_pDevice(pDevice)
{
}
/**
* Get the instance of the device
* @return The instance
*/
inline CGimic* CGimic::Chip3::GetDevice()
{
return m_pDevice;
}
/**
* Increments the reference count
* @return The new reference count
*/
size_t CGimic::Chip3::AddRef()
{
return GetDevice()->AddRef();
}
/**
* Decrements the reference count
* @return The new reference count
*/
size_t CGimic::Chip3::Release()
{
return GetDevice()->Release();
}
/**
* Reset
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Chip3::reset()
{
memset(m_sReg, 0, sizeof(m_sReg));
return GetDevice()->Reset();
}
/**
* Output
* @param[in] nAddr The address
* @param[in] cData The data
*/
void CGimic::Chip3::out(UINT nAddr, UINT8 cData)
{
if (nAddr >= sizeof(m_sReg))
{
return;
}
m_sReg[nAddr] = cData;
GetDevice()->Out(nAddr, cData);
}
/**
* Input
* @param[in] nAddr The address of registers
* @return The data
*/
UINT8 CGimic::Chip3::in(UINT nAddr)
{
if (nAddr < sizeof(m_sReg))
{
return m_sReg[nAddr];
}
return 0xff;
}
/**
* Gets the current status
* @param[in] nAddr The address
* @param[out] pcStatus The status
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Chip3::getChipStatus(UINT nAddr, UINT8* pcStatus)
{
UINT8 sData[3];
sData[0] = 0xfd;
sData[1] = 0x93;
sData[2] = static_cast<UINT8>(nAddr & 1);
UINT8 sRecv[4];
const C86CtlErr ret = GetDevice()->Transaction(sData, sizeof(sData), sRecv, sizeof(sRecv));
if ((ret == C86CTL_ERR_NONE) && (pcStatus != NULL))
{
*pcStatus = sRecv[0];
}
return ret;
}
/**
* Output
* @param[in] nAddr The address
* @param[in] cData The data
*/
void CGimic::Chip3::directOut(UINT nAddr, UINT8 cData)
{
if (nAddr >= sizeof(m_sReg))
{
return;
}
m_sReg[nAddr] = cData;
nAddr = GetDevice()->GetChipAddr(nAddr);
if (nAddr < 0xfc)
{
UINT8 sData[2];
sData[0] = static_cast<UINT8>(nAddr & 0xff);
sData[1] = cData;
GetDevice()->Transaction(sData, sizeof(sData));
}
else if ((nAddr >= 0x100) && (nAddr <= 0x1fb))
{
UINT8 sData[3];
sData[0] = 0xfe;
sData[1] = static_cast<UINT8>(nAddr & 0xff);
sData[2] = cData;
GetDevice()->Transaction(sData, sizeof(sData));
}
}
/**
* Gets the type of the chip
* @param[out] pnType A pointer of type
* @return C86CTL_ERR
*/
C86CtlErr CGimic::Chip3::getChipType(ChipType* pnType)
{
if (pnType != NULL)
{
*pnType = GetDevice()->m_nChipType;
}
return C86CTL_ERR_NONE;
}
} // namespace c86ctl

View File

@ -1,131 +0,0 @@
/**
* @file c86ctlgimic.h
* @brief Interface of G.I.M.I.C
*/
#pragma once
#include "c86ctlrealchipbase.h"
#include "misc/guard.h"
#include "misc/threadbase.h"
#include "misc/usbdev.h"
namespace c86ctl
{
/**
* @brief The class of G.I.M.I.C
*/
class CGimic : public CRealChipBase::CDevice, protected CThreadBase
{
public:
CGimic(UINT nIndex);
virtual ~CGimic();
// IRealUnknown
virtual size_t AddRef();
virtual size_t Release();
// IRealChipBase
virtual C86CtlErr initialize();
virtual C86CtlErr deinitialize();
virtual size_t getNumberOfChip();
virtual C86CtlErr getChipInterface(size_t id, IID riid, void** ppi);
protected:
virtual bool Task();
private:
/**
* @brief FM data
*/
struct FMDATA
{
UINT16 wAddr; /*!< address */
UINT8 cData; /*!< data */
UINT8 cPadding; /*!< padding */
};
/**
* @brief The class of the gimic
*/
class Gimic2 : public IGimic2
{
public:
Gimic2(CGimic* pDevice);
// IRealUnknown
virtual size_t AddRef();
virtual size_t Release();
// IGimic
C86CtlErr getFWVer(UINT* pnMajor, UINT* pnMinor, UINT* pnRev, UINT* pnBuild);
C86CtlErr getMBInfo(Devinfo* pInfo);
C86CtlErr getModuleInfo(Devinfo* pInfo);
C86CtlErr setSSGVolume(UINT8 cVolume);
C86CtlErr getSSGVolume(UINT8* pcVolume);
C86CtlErr setPLLClock(UINT nClock);
C86CtlErr getPLLClock(UINT* pnClock);
// IGimic2
C86CtlErr getModuleType(ChipType* pnType);
private:
CGimic* m_pDevice; /*!< device */
CGimic* GetDevice();
};
/**
* @brief The class of the chip
*/
class Chip3 : public IRealChip3
{
public:
Chip3(CGimic* pDevice);
// IRealUnknown
virtual size_t AddRef();
virtual size_t Release();
// IRealChip
virtual C86CtlErr reset();
virtual void out(UINT nAddr, UINT8 cData);
virtual UINT8 in(UINT nAddr);
// IRealChip2
virtual C86CtlErr getChipStatus(UINT nAddr, UINT8* pcStatus);
virtual void directOut(UINT nAddr, UINT8 cData);
// IRealChip3
virtual C86CtlErr getChipType(ChipType* pnType);
private:
CGimic* m_pDevice; /*!< device */
UINT8 m_sReg[0x200]; /*!< register */
CGimic* GetDevice();
};
size_t m_nRef; /*!< The reference counter */
UINT m_nIndex; /*!< The index of devices */
ChipType m_nChipType; /*!< The type of chip */
UINT m_nQueIndex; /*!< The position in que */
UINT m_nQueCount; /*!< The count in que */
CUsbDev m_usb; /*!< USB */
CGuard m_usbGuard; /*!< The guard of accessing USB */
CGuard m_queGuard; /*!< The guard of que */
Gimic2 m_gimic2; /*!< gimic2 */
Chip3 m_chip3; /*!< chip3 */
FMDATA m_que[0x400]; /*!< que */
C86CtlErr Transaction(const void* lpOutput, int cbOutput, void* lpInput = NULL, int cbInput = 0);
C86CtlErr Reset();
C86CtlErr GetInfo(UINT8 cParam, c86ctl::Devinfo* pInfo);
static void TailZeroFill(char* lpBuffer, size_t cbBuffer);
UINT GetChipAddr(UINT nAddr) const;
void Out(UINT nAddr, UINT8 cData);
friend class Gimic2;
friend class Chip3;
};
} // namespace c86ctl

View File

@ -1,289 +0,0 @@
/**
* @file c86ctlif.cpp
* @brief G.I.M.I.C
*/
#include <compiler.h>
#include "c86ctlif.h"
#include "c86ctl.h"
using namespace c86ctl;
/**
*
*/
C86CtlIf::C86CtlIf()
: m_pChipBase(NULL)
{
}
/**
*
*/
C86CtlIf::~C86CtlIf()
{
Deinitialize();
}
/**
*
* @retval true
* @retval false
*/
bool C86CtlIf::Initialize()
{
if (m_pChipBase)
{
return false;
}
do
{
/* インスタンス作成 */
CreateInstance(IID_IRealChipBase, reinterpret_cast<void**>(&m_pChipBase));
if (m_pChipBase == NULL)
{
break;
}
/* 初期化 */
if (m_pChipBase->initialize() != C86CTL_ERR_NONE)
{
break;
}
return true;
} while (0 /*CONSTCOND*/);
Deinitialize();
return false;
}
/**
*
*/
void C86CtlIf::Deinitialize()
{
if (m_pChipBase)
{
while (!m_chips.empty())
{
std::map<int, Chip*>::iterator it = m_chips.begin();
delete it->second;
}
m_pChipBase->deinitialize();
m_pChipBase = NULL;
}
}
/**
*
*/
void C86CtlIf::Reset()
{
}
/**
*
* @param[in] nChipType
* @param[in] nClock
* @return
*/
IExternalChip* C86CtlIf::GetInterface(IExternalChip::ChipType nChipType, UINT nClock)
{
const bool bInitialized = Initialize();
do
{
if (m_pChipBase == NULL)
{
break;
}
/* 音源を探す */
const int nDeviceCount = static_cast<int>(m_pChipBase->getNumberOfChip());
for (int i = 0; i < nDeviceCount; i++)
{
/* 使用中? */
if (m_chips.find(i) != m_chips.end())
{
continue;
}
/* チップを探す */
IRealChip* pRealChip = NULL;
m_pChipBase->getChipInterface(i, IID_IRealChip, reinterpret_cast<void**>(&pRealChip));
if (pRealChip == NULL)
{
continue;
}
/* G.I.M.I.C 判定 */
IGimic* pGimic = NULL;
m_pChipBase->getChipInterface(i, IID_IGimic, reinterpret_cast<void**>(&pGimic));
if (pGimic)
{
Devinfo info;
if (pGimic->getModuleInfo(&info) == C86CTL_ERR_NONE)
{
IExternalChip::ChipType nRealChipType = IExternalChip::kNone;
if (!memcmp(info.Devname, "GMC-OPN3L", 9))
{
nRealChipType = IExternalChip::kYMF288;
}
else if (!memcmp(info.Devname, "GMC-OPNA", 8))
{
nRealChipType = IExternalChip::kYM2608;
}
else if (!memcmp(info.Devname, "GMC-OPL3", 8))
{
nRealChipType = IExternalChip::kYMF262;
}
else if (!memcmp(info.Devname, "GMC-OPM", 7))
{
nRealChipType = IExternalChip::kYM2151;
}
if (nChipType == nRealChipType)
{
/* サウンドチップ取得できた */
Chip* pChip = new Chip(this, pRealChip, pGimic, nRealChipType, nClock);
m_chips[i] = pChip;
return pChip;
}
}
}
/* その他の判定 */
IRealChip3* pChip3 = NULL;
m_pChipBase->getChipInterface(i, IID_IRealChip3, reinterpret_cast<void**>(&pChip3));
if (pChip3 != NULL)
{
c86ctl::ChipType nType = CHIP_UNKNOWN;
pChip3->getChipType(&nType);
IExternalChip::ChipType nRealChipType = IExternalChip::kNone;
if (nType == CHIP_YM2203)
{
nRealChipType = IExternalChip::kYM2203;
}
else if (nType == CHIP_OPNA)
{
nRealChipType = IExternalChip::kYM2608;
}
else if ((nType == CHIP_YM2608NOADPCM) || (nType == CHIP_OPN3L))
{
nRealChipType = IExternalChip::kYMF288;
}
else if (nType == CHIP_Y8950ADPCM)
{
nRealChipType = IExternalChip::kY8950;
}
if (nChipType == nRealChipType)
{
/* サウンドチップ取得できた */
Chip* pChip = new Chip(this, pChip3, NULL, nRealChipType, nClock);
m_chips[i] = pChip;
return pChip;
}
}
}
} while (false /*CONSTCOND*/);
if (bInitialized)
{
// Deinitialize();
}
return NULL;
}
/**
*
* @param[in] pChip
*/
void C86CtlIf::Detach(C86CtlIf::Chip* pChip)
{
std::map<int, Chip*>::iterator it = m_chips.begin();
while (it != m_chips.end())
{
if (it->second == pChip)
{
it = m_chips.erase(it);
}
else
{
++it;
}
}
}
/* ---- チップ */
/**
*
* @param[in] pC86CtlIf C86CtlIf
* @param[in] pRealChip
* @param[in] pGimic G.I.M.I.C
* @param[in] nChipType
* @param[in] nClock
*/
C86CtlIf::Chip::Chip(C86CtlIf* pC86CtlIf, c86ctl::IRealChip* pRealChip, c86ctl::IGimic* pGimic, ChipType nChipType, UINT nClock)
: m_pC86CtlIf(pC86CtlIf)
, m_pRealChip(pRealChip)
, m_pGimic(pGimic)
, m_nChipType(nChipType)
, m_nClock(nClock)
{
}
/**
*
*/
C86CtlIf::Chip::~Chip()
{
m_pC86CtlIf->Detach(this);
}
/**
* Get chip type
* @return The type of the chip
*/
IExternalChip::ChipType C86CtlIf::Chip::GetChipType()
{
return m_nChipType;
}
/**
*
*/
void C86CtlIf::Chip::Reset()
{
m_pRealChip->reset();
if (m_pGimic)
{
m_pGimic->setPLLClock(m_nClock);
m_pGimic->setSSGVolume(31);
}
}
/**
*
* @param[in] nAddr
* @param[in] cData
*/
void C86CtlIf::Chip::WriteRegister(UINT nAddr, UINT8 cData)
{
m_pRealChip->out(nAddr, cData);
}
/**
*
* @param[in] nMessage
* @param[in] nParameter
* @return
*/
INTPTR C86CtlIf::Chip::Message(UINT nMessage, INTPTR nParameter)
{
return 0;
}

View File

@ -1,58 +0,0 @@
/**
* @file c86ctlif.h
* @brief G.I.M.I.C
*/
#pragma once
#include <map>
#include "../externalchip.h"
namespace c86ctl
{
class IRealChipBase;
class IGimic;
class IRealChip;
}
/**
* @brief G.I.M.I.C
*/
class C86CtlIf
{
public:
C86CtlIf();
~C86CtlIf();
bool Initialize();
void Deinitialize();
void Reset();
IExternalChip* GetInterface(IExternalChip::ChipType nChipType, UINT nClock);
private:
c86ctl::IRealChipBase* m_pChipBase; /*!< チップ ベース インスタンス */
/**
* @brief
*/
class Chip : public IExternalChip
{
public:
Chip(C86CtlIf* pC86CtlIf, c86ctl::IRealChip* pRealChip, c86ctl::IGimic* pGimic, ChipType nChipType, UINT nClock);
virtual ~Chip();
virtual ChipType GetChipType();
virtual void Reset();
virtual void WriteRegister(UINT nAddr, UINT8 cData);
virtual INTPTR Message(UINT nMessage, INTPTR nParameter = 0);
private:
C86CtlIf* m_pC86CtlIf; /*!< C86Ctl インスタンス */
c86ctl::IRealChip* m_pRealChip; /*!< チップ インスタンス */
c86ctl::IGimic* m_pGimic; /*!< G.I.M.I.C インスタンス */
ChipType m_nChipType; /*!< チップ タイプ */
UINT m_nClock; /*!< チップ クロック */
};
std::map<int, Chip*> m_chips; /*!< チップ */
void Detach(Chip* pChip);
friend class Chip;
};

View File

@ -1,174 +0,0 @@
/**
* @file c86ctlrealchipbase.cpp
* @brief Implementation of IRealChipBase
*/
#include <compiler.h>
#include "c86ctlrealchipbase.h"
#include "c86ctlc86box.h"
#include "c86ctlgimic.h"
namespace c86ctl
{
/*! instance */
CRealChipBase CRealChipBase::sm_instance;
/**
* Gets interfaces
* @param[in] riid The interface ID
* @param[out] ppi The pointer of the interface
* @return C86CTL_ERR
*/
C86CtlErr CreateInstance(IID riid, void** ppi)
{
if (ppi == NULL)
{
return C86CTL_ERR_INVALID_PARAM;
}
if (riid != IID_IRealChipBase)
{
return C86CTL_ERR_UNSUPPORTED;
}
CRealChipBase* pBase = CRealChipBase::GetInstance();
pBase->AddRef();
*ppi = pBase;
return C86CTL_ERR_NONE;
}
/**
* Constructor
*/
CRealChipBase::CRealChipBase()
: m_nRef(0)
{
}
/**
* Destructor
*/
CRealChipBase::~CRealChipBase()
{
}
/**
* Increments the reference count
* @return The new reference count
*/
size_t CRealChipBase::AddRef()
{
m_nRef++;
return m_nRef;
}
/**
* Decrements the reference count
* @return The new reference count
*/
size_t CRealChipBase::Release()
{
m_nRef--;
return m_nRef;
}
/**
* Initialize
* @return C86CTL_ERR
*/
C86CtlErr CRealChipBase::initialize()
{
for (UINT i = 0; i < 1; i++)
{
CGimic* pGimic = new CGimic(i);
if (pGimic->initialize() != C86CTL_ERR_NONE)
{
pGimic->deinitialize();
delete pGimic;
continue;
}
m_devices.push_back(pGimic);
}
for (UINT i = 0; i < 1; i++)
{
CC86Box* pC86Box = new CC86Box(i);
if (pC86Box->initialize() != C86CTL_ERR_NONE)
{
pC86Box->deinitialize();
delete pC86Box;
continue;
}
m_devices.push_back(pC86Box);
}
return C86CTL_ERR_NONE;
}
/**
* Deinitialize
* @return C86CTL_ERR
*/
C86CtlErr CRealChipBase::deinitialize()
{
for (std::vector<CDevice*>::iterator it = m_devices.begin(); it != m_devices.end(); ++it)
{
CDevice* pDevice = *it;
pDevice->deinitialize();
delete pDevice;
}
m_devices.clear();
return C86CTL_ERR_NONE;
}
/**
* Gets the count of chips
* @return The chips
*/
size_t CRealChipBase::getNumberOfChip()
{
size_t nChips = 0;
for (std::vector<CDevice*>::iterator it = m_devices.begin(); it != m_devices.end(); ++it)
{
nChips += (*it)->getNumberOfChip();
}
return nChips;
}
/**
* Gets interfaces
* @param[in] id ID
* @param[in] riid The interface ID
* @param[out] ppi The pointer of the interface
* @return C86CTL_ERR
*/
C86CtlErr CRealChipBase::getChipInterface(size_t id, IID riid, void** ppi)
{
if (ppi == NULL)
{
return C86CTL_ERR_INVALID_PARAM;
}
for (std::vector<CDevice*>::iterator it = m_devices.begin(); it != m_devices.end(); ++it)
{
CDevice* pDevice = *it;
const size_t nChips = pDevice->getNumberOfChip();
if (id < nChips)
{
return pDevice->getChipInterface(id, riid, ppi);
}
id -= nChips;
}
return C86CTL_ERR_NODEVICE;
}
/**
* Destructor
*/
CRealChipBase::CDevice::~CDevice()
{
}
} // namespace c86ctl

View File

@ -1,59 +0,0 @@
/**
* @file c86ctlrealchipbase.h
* @brief Interface of IRealChipBase
*/
#pragma once
#include <vector>
#include "c86ctl.h"
namespace c86ctl
{
/**
* @brief The class of the chip base
*/
class CRealChipBase : public IRealChipBase
{
public:
/**
* @brief The class of the device
*/
class CDevice : public IRealChipBase
{
public:
virtual ~CDevice();
};
static CRealChipBase* GetInstance();
CRealChipBase();
virtual ~CRealChipBase();
// IRealUnknown
virtual size_t AddRef();
virtual size_t Release();
// IRealChipBase
virtual C86CtlErr initialize();
virtual C86CtlErr deinitialize();
virtual size_t getNumberOfChip();
virtual C86CtlErr getChipInterface(size_t id, IID riid, void** ppi);
private:
static CRealChipBase sm_instance; /*!< instance */
size_t m_nRef; /*!< The reference counter */
std::vector<CDevice*> m_devices; /*!< The instance of devices */
};
/**
* Gets instance
* @return The instance of sound manager
*/
inline CRealChipBase* CRealChipBase::GetInstance()
{
return &sm_instance;
}
} // namespace c86ctl

View File

@ -1,75 +0,0 @@
/**
* @file externalchip.h
* @brief Interface of thg external modules
*/
#pragma once
/**
* @brief The interface of thg external modules
*/
class IExternalChip
{
public:
/**
* ChipType
*/
enum ChipType
{
kNone = 0, /*!< None */
kAY8910, /*!< AY-3-8910 */
kYM2203, /*!< OPN */
kYM2608, /*!< OPNA */
kYM3438, /*!< OPN2 */
kYMF288, /*!< OPN3 */
kYM3812, /*!< OPL2 */
kYMF262, /*!< OPL3 */
kY8950, /*!< Y8950 */
kYM2151 /*!< OPM */
};
/**
* MessageType
*/
enum
{
kMute = 0,
kBusy
};
/**
* Destructor
*/
virtual ~IExternalChip()
{
}
/**
* Get chip type
* @return The type of the chip
*/
virtual ChipType GetChipType() = 0;
/**
* Reset
*/
virtual void Reset() = 0;
/**
* Writes register
* @param[in] nAddr The address
* @param[in] cData The data
*/
virtual void WriteRegister(UINT nAddr, UINT8 cData) = 0;
/**
* Message
* @param[in] nMessage The message
* @param[in] nParameter The parameter
* @return Result
*/
virtual INTPTR Message(UINT nMessage, INTPTR nParameter = 0) = 0;
};

View File

@ -1,188 +0,0 @@
/**
* @file externalchipmanager.cpp
* @brief
*/
#include <compiler.h>
#include "externalchipmanager.h"
#include <algorithm>
#include "externalopl3.h"
#include "externalopm.h"
#include "externalopna.h"
/*! 唯一のインスタンスです */
CExternalChipManager CExternalChipManager::sm_instance;
/**
*
*/
CExternalChipManager::CExternalChipManager()
{
}
/**
*
*/
void CExternalChipManager::Initialize()
{
}
/**
*
*/
void CExternalChipManager::Deinitialize()
{
std::vector<IExternalChip*>::iterator it = m_chips.begin();
while (it != m_chips.end())
{
IExternalChip* pChip = *it;
it = m_chips.erase(it);
pChip->Reset();
delete pChip;
}
m_c86ctl.Deinitialize();
m_scci.Deinitialize();
}
/**
*
* @param[in] nChipType
* @param[in] nClock
* @return
*/
IExternalChip* CExternalChipManager::GetInterface(IExternalChip::ChipType nChipType, UINT nClock)
{
IExternalChip* pChip = GetInterfaceInner(nChipType, nClock);
if (pChip == NULL)
{
switch (nChipType)
{
case IExternalChip::kAY8910:
pChip = GetInterface(IExternalChip::kYM2203, nClock);
break;
case IExternalChip::kYM2203:
pChip = GetInterface(IExternalChip::kYMF288, nClock * 2);
break;
case IExternalChip::kYMF288:
pChip = GetInterface(IExternalChip::kYM2608, nClock);
break;
case IExternalChip::kYM3438:
pChip = GetInterface(IExternalChip::kYMF288, nClock);
break;
case IExternalChip::kY8950:
pChip = GetInterface(IExternalChip::kYM3812, nClock);
break;
case IExternalChip::kYM3812:
pChip = GetInterface(IExternalChip::kYMF262, nClock * 4);
break;
default:
break;
}
}
return pChip;
}
/**
* (Inner)
* @param[in] nChipType
* @param[in] nClock
* @return
*/
IExternalChip* CExternalChipManager::GetInterfaceInner(IExternalChip::ChipType nChipType, UINT nClock)
{
IExternalChip* pChip = NULL;
/* G.I.M.I.C / C86BOX */
if (pChip == NULL)
{
pChip = m_c86ctl.GetInterface(nChipType, nClock);
}
/* SPFM Light */
if (pChip == NULL)
{
pChip = m_scci.GetInterface(nChipType, nClock);
}
/* ラッピング */
if (pChip)
{
switch (nChipType)
{
case IExternalChip::kAY8910:
pChip = new CExternalPsg(pChip);
break;
case IExternalChip::kYM2203:
case IExternalChip::kYM2608:
case IExternalChip::kYM3438:
case IExternalChip::kYMF288:
pChip = new CExternalOpna(pChip);
break;
case IExternalChip::kYM3812:
case IExternalChip::kYMF262:
case IExternalChip::kY8950:
pChip = new CExternalOpl3(pChip);
break;
case IExternalChip::kYM2151:
pChip = new CExternalOpm(pChip);
break;
default:
break;
}
}
if (pChip)
{
m_chips.push_back(pChip);
}
return pChip;
}
/**
*
* @param[in] pChip
*/
void CExternalChipManager::Release(IExternalChip* pChip)
{
std::vector<IExternalChip*>::iterator it = std::find(m_chips.begin(), m_chips.end(), pChip);
if (it != m_chips.end())
{
m_chips.erase(it);
pChip->Reset();
delete pChip;
}
}
/**
*
*/
void CExternalChipManager::Reset()
{
for (std::vector<IExternalChip*>::iterator it = m_chips.begin(); it != m_chips.end(); ++it)
{
(*it)->Reset();
}
}
/**
*
* @param[in] bMute
*/
void CExternalChipManager::Mute(bool bMute)
{
for (std::vector<IExternalChip*>::iterator it = m_chips.begin(); it != m_chips.end(); ++it)
{
(*it)->Message(IExternalChip::kMute, static_cast<INTPTR>(bMute));
}
}

View File

@ -1,45 +0,0 @@
/**
* @file externalchipmanager.h
* @brief
*/
#pragma once
#include <vector>
#include "externalchip.h"
#include "c86ctl/c86ctlif.h"
#include "scci/scciif.h"
/**
* @brief
*/
class CExternalChipManager
{
public:
static CExternalChipManager* GetInstance();
CExternalChipManager();
void Initialize();
void Deinitialize();
IExternalChip* GetInterface(IExternalChip::ChipType nChipType, UINT nClock);
void Release(IExternalChip* pChip);
void Reset();
void Mute(bool bMute);
private:
static CExternalChipManager sm_instance; /*!< 唯一のインスタンスです */
std::vector<IExternalChip*> m_chips; /*!< モジュール */
C86CtlIf m_c86ctl; /*!< C86Ctl インスタンス */
CScciIf m_scci; /*!< SCCI インスタンス */
IExternalChip* GetInterfaceInner(IExternalChip::ChipType nChipType, UINT nClock);
};
/**
*
* @return
*/
inline CExternalChipManager* CExternalChipManager::GetInstance()
{
return &sm_instance;
}

View File

@ -1,105 +0,0 @@
/**
* @file externalopl3.cpp
* @brief OPL3
*/
#include <compiler.h>
#include "externalopl3.h"
/**
*
* @param[in] pChip
*/
CExternalOpl3::CExternalOpl3(IExternalChip* pChip)
: m_pChip(pChip)
{
memset(m_cKon, 0x00, sizeof(m_cKon));
}
/**
*
*/
CExternalOpl3::~CExternalOpl3()
{
delete m_pChip;
}
/**
*
* @return
*/
IExternalChip::ChipType CExternalOpl3::GetChipType()
{
return m_pChip->GetChipType();
}
/**
*
*/
void CExternalOpl3::Reset()
{
m_pChip->Reset();
}
/**
*
* @param[in] nAddr
* @param[in] cData
*/
void CExternalOpl3::WriteRegister(UINT nAddr, UINT8 cData)
{
if ((nAddr & 0xf0) == 0xb0)
{
m_cKon[(nAddr & 0x100) >> 8][nAddr & 0x0f] = cData;
}
WriteRegisterInner(nAddr, cData);
}
/**
*
* @param[in] nMessage
* @param[in] nParameter
* @return
*/
INTPTR CExternalOpl3::Message(UINT nMessage, INTPTR nParameter)
{
switch (nMessage)
{
case kMute:
Mute(nParameter != 0);
break;
}
return 0;
}
/**
*
* @param[in] bMute
*/
void CExternalOpl3::Mute(bool bMute)
{
if (bMute)
{
for (UINT i = 0; i < 2; i++)
{
for (UINT j = 0; j < 9; j++)
{
if (m_cKon[i][j] & 0x20)
{
m_cKon[i][j] &= 0xdf;
WriteRegisterInner((i * 0x100) + j + 0xb0, m_cKon[i][j]);
}
}
}
}
}
/**
* ()
* @param[in] nAddr
* @param[in] cData
*/
void CExternalOpl3::WriteRegisterInner(UINT nAddr, UINT8 cData) const
{
m_pChip->WriteRegister(nAddr, cData);
}

View File

@ -1,29 +0,0 @@
/**
* @file externalopl3.h
* @brief OPL3
*/
#pragma once
#include "externalchip.h"
/**
* @brief OPL3
*/
class CExternalOpl3 : public IExternalChip
{
public:
CExternalOpl3(IExternalChip* pChip);
virtual ~CExternalOpl3();
virtual ChipType GetChipType();
virtual void Reset();
virtual void WriteRegister(UINT nAddr, UINT8 cData);
virtual INTPTR Message(UINT nMessage, INTPTR nParameter);
protected:
IExternalChip* m_pChip; /*!< チップ*/
UINT8 m_cKon[2][16]; /*!< KON テーブル */
void Mute(bool bMute);
void WriteRegisterInner(UINT nAddr, UINT8 cData) const;
};

View File

@ -1,135 +0,0 @@
/**
* @file externalopm.cpp
* @brief OPM
*/
#include <compiler.h>
#include "externalopm.h"
/**
*
* @param[in] pChip
*/
CExternalOpm::CExternalOpm(IExternalChip* pChip)
: m_pChip(pChip)
{
memset(m_cAlgorithm, 0, sizeof(m_cAlgorithm));
memset(m_cTtl, 0x7f, sizeof(m_cTtl));
}
/**
*
*/
CExternalOpm::~CExternalOpm()
{
delete m_pChip;
}
/**
*
* @return
*/
IExternalChip::ChipType CExternalOpm::GetChipType()
{
return m_pChip->GetChipType();
}
/**
*
*/
void CExternalOpm::Reset()
{
memset(m_cAlgorithm, 0, sizeof(m_cAlgorithm));
memset(m_cTtl, 0x7f, sizeof(m_cTtl));
m_pChip->Reset();
}
/**
*
* @param[in] nAddr
* @param[in] cData
*/
void CExternalOpm::WriteRegister(UINT nAddr, UINT8 cData)
{
if ((nAddr & 0xe0) == 0x60) // ttl
{
m_cTtl[nAddr & 0x1f] = cData;
}
else if ((nAddr & 0xf8) == 0x20) // algorithm
{
m_cAlgorithm[nAddr & 7] = cData;
}
WriteRegisterInner(nAddr, cData);
}
/**
*
* @param[in] nMessage
* @param[in] nParameter
* @return
*/
INTPTR CExternalOpm::Message(UINT nMessage, INTPTR nParameter)
{
switch (nMessage)
{
case kMute:
Mute(nParameter != 0);
break;
}
return 0;
}
/**
*
* @param[in] bMute
*/
void CExternalOpm::Mute(bool bMute) const
{
const int nVolume = (bMute) ? -127 : 0;
for (UINT ch = 0; ch < 8; ch++)
{
SetVolume(ch, nVolume);
}
}
/**
* ()
* @param[in] nAddr
* @param[in] cData
*/
void CExternalOpm::WriteRegisterInner(UINT nAddr, UINT8 cData) const
{
m_pChip->WriteRegister(nAddr, cData);
}
/**
*
* @param[in] nChannel
* @param[in] nVolume
*/
void CExternalOpm::SetVolume(UINT nChannel, int nVolume) const
{
/*! アルゴリズム スロット マスク */
static const UINT8 s_opmask[] = {0x08, 0x08, 0x08, 0x08, 0x0c, 0x0e, 0x0e, 0x0f};
UINT8 cMask = s_opmask[m_cAlgorithm[nChannel] & 7];
int nOffset = nChannel;
do
{
if (cMask & 1)
{
int nTtl = (m_cTtl[nOffset] & 0x7f) - nVolume;
if (nTtl < 0)
{
nTtl = 0;
}
else if (nTtl > 0x7f)
{
nTtl = 0x7f;
}
WriteRegisterInner(0x60 + nOffset, static_cast<UINT8>(nTtl));
}
nOffset += 8;
cMask >>= 1;
} while (cMask != 0);
}

View File

@ -1,31 +0,0 @@
/**
* @file externalopm.h
* @brief OPM
*/
#pragma once
#include "externalchip.h"
/**
* @brief OPM
*/
class CExternalOpm : public IExternalChip
{
public:
CExternalOpm(IExternalChip* pChip);
virtual ~CExternalOpm();
virtual ChipType GetChipType();
virtual void Reset();
virtual void WriteRegister(UINT nAddr, UINT8 cData);
virtual INTPTR Message(UINT nMessage, INTPTR nParameter);
protected:
IExternalChip* m_pChip; /*!< チップ */
UINT8 m_cAlgorithm[8]; /*!< アルゴリズム テーブル */
UINT8 m_cTtl[8 * 4]; /*!< TTL テーブル */
void Mute(bool bMute) const;
void WriteRegisterInner(UINT nAddr, UINT8 cData) const;
void SetVolume(UINT nChannel, int nVolume) const;
};

View File

@ -1,171 +0,0 @@
/**
* @file externalopna.cpp
* @brief OPNA
*/
#include <compiler.h>
#include "externalopna.h"
/**
*
* @param[in] pChip
*/
CExternalOpna::CExternalOpna(IExternalChip* pChip)
: CExternalPsg(pChip)
, m_bHasPsg(false)
, m_bHasExtend(false)
, m_bHasRhythm(false)
, m_bHasADPCM(false)
, m_cMode(0)
{
memset(m_cAlgorithm, 0, sizeof(m_cAlgorithm));
memset(m_cTtl, 0x7f, sizeof(m_cTtl));
switch (GetChipType())
{
case IExternalChip::kYM2203:
m_bHasPsg = true;
break;
case IExternalChip::kYM2608:
m_bHasPsg = true;
m_bHasExtend = true;
m_bHasRhythm = true;
m_bHasADPCM = true;
break;
case IExternalChip::kYM3438:
m_bHasExtend = true;
break;
case IExternalChip::kYMF288:
m_bHasPsg = true;
m_bHasExtend = true;
m_bHasRhythm = true;
break;
default:
break;
}
}
/**
*
*/
CExternalOpna::~CExternalOpna()
{
}
/**
*
*/
void CExternalOpna::Reset()
{
m_cMode = 0;
memset(m_cAlgorithm, 0, sizeof(m_cAlgorithm));
memset(m_cTtl, 0x7f, sizeof(m_cTtl));
if (m_bHasPsg)
{
CExternalPsg::Reset();
}
else
{
m_pChip->Reset();
}
}
/**
*
* @param[in] nAddr
* @param[in] cData
*/
void CExternalOpna::WriteRegister(UINT nAddr, UINT8 cData)
{
if (nAddr < 0x10)
{
if (m_bHasPsg)
{
CExternalPsg::WriteRegister(nAddr, cData);
}
}
else
{
if (nAddr == 0x27)
{
cData &= 0xc0;
if (m_cMode == cData)
{
return;
}
m_cMode = cData;
}
else if ((nAddr & 0xf0) == 0x40)
{
// ttl
m_cTtl[((nAddr & 0x100) >> 4) + (nAddr & 15)] = cData;
}
else if ((nAddr & 0xfc) == 0xb0)
{
// algorithm
m_cAlgorithm[((nAddr & 0x100) >> 6) + (nAddr & 3)] = cData;
}
WriteRegisterInner(nAddr, cData);
}
}
/**
*
* @param[in] bMute
*/
void CExternalOpna::Mute(bool bMute) const
{
if (m_bHasPsg)
{
CExternalPsg::Mute(bMute);
}
const int nVolume = (bMute) ? -127 : 0;
for (UINT ch = 0; ch < 3; ch++)
{
SetVolume(ch + 0, nVolume);
if (m_bHasExtend)
{
SetVolume(ch + 4, nVolume);
}
}
}
/**
*
* @param[in] nChannel
* @param[in] nVolume
*/
void CExternalOpna::SetVolume(UINT nChannel, int nVolume) const
{
const UINT nBaseReg = (nChannel & 4) ? 0x140 : 0x40;
/*! アルゴリズム スロット マスク */
static const UINT8 s_opmask[] = {0x08, 0x08, 0x08, 0x08, 0x0c, 0x0e, 0x0e, 0x0f};
UINT8 cMask = s_opmask[m_cAlgorithm[nChannel & 7] & 7];
const UINT8* pTtl = m_cTtl + ((nChannel & 4) << 2);
int nOffset = nChannel & 3;
do
{
if (cMask & 1)
{
int nTtl = (pTtl[nOffset] & 0x7f) - nVolume;
if (nTtl < 0)
{
nTtl = 0;
}
else if (nTtl > 0x7f)
{
nTtl = 0x7f;
}
WriteRegisterInner(nBaseReg + nOffset, static_cast<UINT8>(nTtl));
}
nOffset += 4;
cMask >>= 1;
} while (cMask != 0);
}

View File

@ -1,65 +0,0 @@
/**
* @file externalopna.h
* @brief OPNA
*/
#pragma once
#include "externalpsg.h"
/**
* @brief OPNA
*/
class CExternalOpna : public CExternalPsg
{
public:
CExternalOpna(IExternalChip* pChip);
virtual ~CExternalOpna();
bool HasPsg() const;
bool HasRhythm() const;
bool HasADPCM() const;
virtual void Reset();
virtual void WriteRegister(UINT nAddr, UINT8 cData);
protected:
bool m_bHasPsg; /*!< PSG */
bool m_bHasExtend; /*!< Extend */
bool m_bHasRhythm; /*!< Rhythm */
bool m_bHasADPCM; /*!< ADPCM */
UINT8 m_cMode; /*!< モード */
UINT8 m_cAlgorithm[8]; /*!< アルゴリズム テーブル */
UINT8 m_cTtl[8 * 4]; /*!< TTL テーブル */
virtual void Mute(bool bMute) const;
void SetVolume(UINT nChannel, int nVolume) const;
};
/**
* PSG ?
* @retval true
* @retval false
*/
inline bool CExternalOpna::HasPsg() const
{
return m_bHasPsg;
}
/**
* Rhythm ?
* @retval true
* @retval false
*/
inline bool CExternalOpna::HasRhythm() const
{
return m_bHasRhythm;
}
/**
* ADPCM ?
* @retval true
* @retval false
*/
inline bool CExternalOpna::HasADPCM() const
{
return m_bHasADPCM;
}

View File

@ -1,102 +0,0 @@
/**
* @file externalpsg.cpp
* @brief PSG
*/
#include <compiler.h>
#include "externalpsg.h"
/**
*
* @param[in] pChip
*/
CExternalPsg::CExternalPsg(IExternalChip* pChip)
: m_pChip(pChip)
, m_cPsgMix(0x3f)
{
}
/**
*
*/
CExternalPsg::~CExternalPsg()
{
delete m_pChip;
}
/**
*
* @return
*/
IExternalChip::ChipType CExternalPsg::GetChipType()
{
return m_pChip->GetChipType();
}
/**
*
*/
void CExternalPsg::Reset()
{
m_cPsgMix = 0x3f;
m_pChip->Reset();
}
/**
*
* @param[in] nAddr
* @param[in] cData
*/
void CExternalPsg::WriteRegister(UINT nAddr, UINT8 cData)
{
if (nAddr < 0x0e)
{
if (nAddr == 0x07)
{
// psg mix
cData &= 0x3f;
if (m_cPsgMix == cData)
{
return;
}
m_cPsgMix = cData;
}
WriteRegisterInner(nAddr, cData);
}
}
/**
*
* @param[in] nMessage
* @param[in] nParameter
* @return
*/
INTPTR CExternalPsg::Message(UINT nMessage, INTPTR nParameter)
{
switch (nMessage)
{
case kMute:
Mute(nParameter != 0);
break;
}
return 0;
}
/**
*
* @param[in] bMute
*/
void CExternalPsg::Mute(bool bMute) const
{
WriteRegisterInner(0x07, (bMute) ? 0x3f : m_cPsgMix);
}
/**
* ()
* @param[in] nAddr
* @param[in] cData
*/
void CExternalPsg::WriteRegisterInner(UINT nAddr, UINT8 cData) const
{
m_pChip->WriteRegister(nAddr, cData);
}

View File

@ -1,29 +0,0 @@
/**
* @file externalpsg.h
* @brief PSG
*/
#pragma once
#include "externalchip.h"
/**
* @brief PSG
*/
class CExternalPsg : public IExternalChip
{
public:
CExternalPsg(IExternalChip* pChip);
virtual ~CExternalPsg();
virtual ChipType GetChipType();
virtual void Reset();
virtual void WriteRegister(UINT nAddr, UINT8 cData);
virtual INTPTR Message(UINT nMessage, INTPTR nParameter);
protected:
IExternalChip* m_pChip; //!< チップ
UINT8 m_cPsgMix; //!< PSG ミキサー
virtual void Mute(bool bMute) const;
void WriteRegisterInner(UINT nAddr, UINT8 cData) const;
};

View File

@ -1,381 +0,0 @@
/**
* @file opl3.cpp
* @brief Implementation of OPL3
*/
#include <compiler.h>
#include "sound/opl3.h"
#include <pccore.h>
#include <io/iocore.h>
#include <sound/fmboard.h>
#include <generic/keydisp.h>
#include "externalchipmanager.h"
#include "externalopl3.h"
static void writeRegister(POPL3 opl3, UINT nAddress, REG8 cData);
static void writeExtendedRegister(POPL3 opl3, UINT nAddress, REG8 cData);
/**
* Initialize instance
* @param[in] opl3 The instance
*/
void opl3_construct(POPL3 opl3)
{
memset(opl3, 0, sizeof(*opl3));
}
/**
* Deinitialize instance
* @param[in] opl3 The instance
*/
void opl3_destruct(POPL3 opl3)
{
CExternalOpl3* pExt = reinterpret_cast<CExternalOpl3*>(opl3->userdata);
CExternalChipManager::GetInstance()->Release(pExt);
opl3->userdata = 0;
}
/**
* Reset
* @param[in] opl3 The instance
* @param[in] cCaps
*/
void opl3_reset(POPL3 opl3, REG8 cCaps)
{
memset(&opl3->s, 0, sizeof(opl3->s));
opl3->s.cCaps = cCaps;
for (UINT i = 0; i < 2; i++)
{
memset(opl3->s.reg + (i * 0x100) + 0x20, 0xff, 0x80);
}
if (cCaps == 0)
{
CExternalOpl3* pExt = reinterpret_cast<CExternalOpl3*>(opl3->userdata);
if (pExt)
{
CExternalChipManager::GetInstance()->Release(pExt);
opl3->userdata = 0;
}
}
}
/**
* Restore
* @param[in] opl3 The instance
*/
static void restore(POPL3 opl3)
{
writeExtendedRegister(opl3, 0x05, opl3->s.reg[0x105]);
writeExtendedRegister(opl3, 0x04, opl3->s.reg[0x104]);
writeExtendedRegister(opl3, 0x08, opl3->s.reg[0x108]);
for (UINT i = 0x20; i < 0x100; i++)
{
if (((i & 0xe0) == 0xa0) || ((i & 0xe0) == 0xc0))
{
continue;
}
if (((i & 0x1f) >= 0x18) || ((i & 0x07) >= 0x06))
{
continue;
}
writeRegister(opl3, i, opl3->s.reg[i]);
writeExtendedRegister(opl3, i, opl3->s.reg[i + 0x100]);
}
for (UINT i = 0xa0; i < 0xa9; i++)
{
writeRegister(opl3, i, opl3->s.reg[i]);
writeRegister(opl3, i + 0x10, opl3->s.reg[i + 0x10] & 0xdf);
writeRegister(opl3, i + 0x20, opl3->s.reg[i + 0x20]);
writeExtendedRegister(opl3, i, opl3->s.reg[i + 0x100]);
writeExtendedRegister(opl3, i + 0x10, opl3->s.reg[i + 0x110] & 0xdf);
writeExtendedRegister(opl3, i + 0x20, opl3->s.reg[i + 0x120]);
}
writeExtendedRegister(opl3, 0xbd, opl3->s.reg[0xbd]);
}
/**
* Bind
* @param[in] opl3 The instance
*/
void opl3_bind(POPL3 opl3)
{
UINT nBaseClock = 3579545;
UINT8 cCaps = opl3->s.cCaps;
nBaseClock = (cCaps & OPL3_HAS_OPL3) ? 3579545 : 3993600;
CExternalOpl3* pExt = reinterpret_cast<CExternalOpl3*>(opl3->userdata);
if (pExt == NULL)
{
IExternalChip::ChipType nChipType = IExternalChip::kNone;
UINT nClock = nBaseClock;
if (cCaps & OPL3_HAS_OPL3)
{
nChipType = IExternalChip::kYMF262;
nClock *= 4;
}
else if (cCaps & OPL3_HAS_OPL2)
{
nChipType = IExternalChip::kYM3812;
}
else
{
nChipType = IExternalChip::kY8950;
}
pExt = static_cast<CExternalOpl3*>(CExternalChipManager::GetInstance()->GetInterface(nChipType, nClock));
opl3->userdata = reinterpret_cast<INTPTR>(pExt);
}
if (pExt)
{
pExt->Reset();
}
else
{
oplgen_reset(&opl3->oplgen, nBaseClock);
}
restore(opl3);
if (pExt == NULL)
{
sound_streamregist(&opl3->oplgen, (SOUNDCB)oplgen_getpcm);
}
keydisp_bindopl3(opl3->s.reg, (cCaps & OPL3_HAS_OPL3) ? 18 : 9, nBaseClock);
}
/**
* Status
* @param[in] opl3 The instance
* @return Status
*/
REG8 opl3_readStatus(POPL3 opl3)
{
return 0;
}
/**
* Writes register
* @param[in] opl3 The instance
* @param[in] nAddress The address
* @param[in] cData The data
*/
void opl3_writeRegister(POPL3 opl3, UINT nAddress, REG8 cData)
{
opl3->s.reg[nAddress] = cData;
writeRegister(opl3, nAddress, cData);
}
/**
* Writes register (Inner)
* @param[in] opl3 The instance
* @param[in] nAddress The address
* @param[in] cData The data
*/
static void writeRegister(POPL3 opl3, UINT nAddress, REG8 cData)
{
const UINT8 cCaps = opl3->s.cCaps;
switch (nAddress & 0xe0)
{
case 0x20:
case 0x40:
case 0x60:
case 0x80:
if (((nAddress & 0x1f) >= 0x18) || ((nAddress & 7) >= 6))
{
return;
}
break;
case 0xa0:
if (nAddress == 0xbd)
{
break;
}
if ((nAddress & 0x0f) >= 9)
{
return;
}
if (nAddress & 0x10)
{
keydisp_opl3keyon(opl3->s.reg, nAddress & 0x0f, cData);
}
break;
case 0xc0:
if ((nAddress & 0x1f) >= 9)
{
return;
}
if (!(cCaps & OPL3_HAS_OPL3))
{
cData |= 0x30;
}
break;
case 0xe0:
if (!(cCaps & OPL3_HAS_OPL2))
{
return;
}
if (((nAddress & 0x1f) >= 0x18) || ((nAddress & 7) >= 6))
{
return;
}
break;
default:
return;
}
CExternalOpl3* pExt = reinterpret_cast<CExternalOpl3*>(opl3->userdata);
if (pExt)
{
pExt->WriteRegister(nAddress, cData);
}
else
{
sound_sync();
oplgen_setreg(&opl3->oplgen, nAddress, cData);
}
}
/**
* Writes extended register
* @param[in] opl3 The instance
* @param[in] nAddress The address
* @param[in] cData The data
*/
void opl3_writeExtendedRegister(POPL3 opl3, UINT nAddress, REG8 cData)
{
opl3->s.reg[nAddress + 0x100] = cData;
writeExtendedRegister(opl3, nAddress, cData);
}
/**
* Writes extended register (Inner)
* @param[in] opl3 The instance
* @param[in] nAddress The address
* @param[in] cData The data
*/
static void writeExtendedRegister(POPL3 opl3, UINT nAddress, REG8 cData)
{
const UINT8 cCaps = opl3->s.cCaps;
if (!(cCaps & OPL3_HAS_OPL3))
{
return;
}
switch (nAddress & 0xe0)
{
case 0x20:
case 0x40:
case 0x60:
case 0x80:
case 0xe0:
if (((nAddress & 0x1f) >= 0x18) || ((nAddress & 7) >= 6))
{
return;
}
break;
case 0xa0:
if ((nAddress & 0x0f) >= 9)
{
return;
}
if (nAddress & 0x10)
{
keydisp_opl3keyon(opl3->s.reg, (nAddress & 0x0f) + 9, cData);
}
break;
case 0xc0:
if ((nAddress & 0x1f) >= 9)
{
return;
}
break;
default:
if ((nAddress == 0x04) || (nAddress == 0x05) || (nAddress == 0x08))
{
break;
}
return;
}
CExternalOpl3* pExt = reinterpret_cast<CExternalOpl3*>(opl3->userdata);
if (pExt)
{
pExt->WriteRegister(nAddress + 0x100, cData);
}
#if 0
else
{
sound_sync();
oplgen_setreg(&opl3->oplgen, nAddress + 0x100, cData);
}
#endif
}
/**
* Reads register
* @param[in] opl3 The instance
* @param[in] nAddress The address
* @return data
*/
REG8 opl3_readRegister(POPL3 opl3, UINT nAddress)
{
return 0xff;
}
/**
* Reads extended register
* @param[in] opl3 The instance
* @param[in] nAddress The address
* @return data
*/
REG8 opl3_readExtendedRegister(POPL3 opl3, UINT nAddress)
{
return 0xff;
}
// ---- statsave
/**
* Save
* @param[in] opl3 The instance
* @param[in] sfh The handle of statsave
* @param[in] tbl The item of statsave
* @return Error
*/
int opl3_sfsave(PCOPL3 opl3, STFLAGH sfh, const SFENTRY *tbl)
{
int ret = statflag_write(sfh, &opl3->s, sizeof(opl3->s));
if (opl3->s.cCaps & OPL3_HAS_8950ADPCM)
{
}
return ret;
}
/**
* Load
* @param[in] opl3 The instance
* @param[in] sfh The handle of statsave
* @param[in] tbl The item of statsave
* @return Error
*/
int opl3_sfload(POPL3 opl3, STFLAGH sfh, const SFENTRY *tbl)
{
int ret = statflag_read(sfh, &opl3->s, sizeof(opl3->s));
if (opl3->s.cCaps & OPL3_HAS_8950ADPCM)
{
}
return ret;
}

View File

@ -1,597 +0,0 @@
/**
* @file opna.cpp
* @brief Implementation of OPNA
*/
#include <compiler.h>
#include "sound/opna.h"
#include <pccore.h>
#include <io/iocore.h>
#include <sound/fmboard.h>
#include <sound/sound.h>
#include <sound/s98.h>
#include <generic/keydisp.h>
#include "externalchipmanager.h"
#include "externalopna.h"
static void writeRegister(POPNA opna, UINT nAddress, REG8 cData);
static void writeExtendedRegister(POPNA opna, UINT nAddress, REG8 cData);
/**
* Initialize instance
* @param[in] opna The instance
*/
void opna_construct(POPNA opna)
{
memset(opna, 0, sizeof(*opna));
}
/**
* Deinitialize instance
* @param[in] opna The instance
*/
void opna_destruct(POPNA opna)
{
CExternalOpna* pExt = reinterpret_cast<CExternalOpna*>(opna->userdata);
CExternalChipManager::GetInstance()->Release(pExt);
opna->userdata = 0;
}
/**
* Reset
* @param[in] opna The instance
* @param[in] cCaps
*/
void opna_reset(POPNA opna, REG8 cCaps)
{
memset(&opna->s, 0, sizeof(opna->s));
opna->s.adpcmmask = ~(0x1c);
opna->s.cCaps = cCaps;
opna->s.irq = 0xff;
opna->s.reg[0x07] = 0xbf;
opna->s.reg[0x0e] = 0xff;
opna->s.reg[0x0f] = 0xff;
opna->s.reg[0xff] = (cCaps & OPNA_HAS_RHYTHM) ? 0x01 : 0x00;
for (UINT i = 0; i < 2; i++)
{
memset(opna->s.reg + (i * 0x100) + 0x30, 0xff, 0x60);
memset(opna->s.reg + (i * 0x100) + 0xb4, 0xc0, 0x04);
}
for (UINT i = 0; i < 7; i++)
{
opna->s.keyreg[i] = i & 7;
}
opngen_reset(&opna->opngen);
psggen_reset(&opna->psg);
rhythm_reset(&opna->rhythm);
adpcm_reset(&opna->adpcm);
if (cCaps == 0)
{
CExternalOpna* pExt = reinterpret_cast<CExternalOpna*>(opna->userdata);
if (pExt)
{
CExternalChipManager::GetInstance()->Release(pExt);
opna->userdata = 0;
}
}
}
/**
* Restore
* @param[in] opna The instance
*/
static void restore(POPNA opna)
{
// FM
writeRegister(opna, 0x22, opna->s.reg[0x22]);
for (UINT i = 0x30; i < 0xa0; i++)
{
if ((i & 3) == 3)
{
continue;
}
writeRegister(opna, i, opna->s.reg[i]);
writeExtendedRegister(opna, i, opna->s.reg[i + 0x100]);
}
for (UINT i = 0xb0; i < 0xb8; i++)
{
if ((i & 3) == 3)
{
continue;
}
writeRegister(opna, i, opna->s.reg[i]);
writeExtendedRegister(opna, i, opna->s.reg[i + 0x100]);
}
for (UINT i = 0; i < 8; i++)
{
if ((i & 3) == 3)
{
continue;
}
writeRegister(opna, i + 0xa4, opna->s.reg[i + 0xa4]);
writeRegister(opna, i + 0xa0, opna->s.reg[i + 0xa0]);
writeExtendedRegister(opna, i + 0xa4, opna->s.reg[i + 0x1a4]);
writeExtendedRegister(opna, i + 0xa0, opna->s.reg[i + 0x1a0]);
}
for (UINT i = 0; i < 8; i++)
{
if ((i & 3) == 3)
{
continue;
}
writeRegister(opna, 0x28, opna->s.keyreg[i]);
}
// PSG
for (UINT i = 0; i < 0x10; i++)
{
writeRegister(opna, i, opna->s.reg[i]);
}
// Rhythm
writeRegister(opna, 0x11, opna->s.reg[0x11]);
for (UINT i = 0x18; i < 0x1e; i++)
{
writeRegister(opna, i, opna->s.reg[i]);
}
}
/**
* Bind
* @param[in] opna The instance
*/
void opna_bind(POPNA opna)
{
UINT8 cCaps = opna->s.cCaps;
UINT nClock = 3993600;
keydisp_bindopna(opna->s.reg, (cCaps & OPNA_HAS_EXTENDEDFM) ? 6 : 3, nClock);
if (cCaps & OPNA_HAS_PSG)
{
keydisp_bindpsg(opna->s.reg, nClock);
}
CExternalOpna* pExt = reinterpret_cast<CExternalOpna*>(opna->userdata);
if (pExt == NULL)
{
IExternalChip::ChipType nChipType = IExternalChip::kYM2203;
if (cCaps & OPNA_HAS_EXTENDEDFM)
{
nChipType = IExternalChip::kYMF288;
nClock *= 2;
if (cCaps & OPNA_HAS_ADPCM)
{
nChipType = IExternalChip::kYM2608;
}
else if (cCaps == OPNA_MODE_3438)
{
nChipType = IExternalChip::kYM3438;
}
}
pExt = static_cast<CExternalOpna*>(CExternalChipManager::GetInstance()->GetInterface(nChipType, nClock));
opna->userdata = reinterpret_cast<INTPTR>(pExt);
}
if (pExt)
{
pExt->Reset();
pExt->WriteRegister(0x22, 0x00);
pExt->WriteRegister(0x29, 0x80);
pExt->WriteRegister(0x10, 0xbf);
pExt->WriteRegister(0x11, 0x30);
pExt->WriteRegister(0x27, opna->s.reg[0x27]);
}
else
{
opna->opngen.opnch[2].extop = opna->s.reg[0x27] & 0xc0;
}
restore(opna);
if (pExt)
{
if ((cCaps & OPNA_HAS_PSG) && (pExt->HasPsg()))
{
cCaps &= ~OPNA_HAS_PSG;
}
if ((cCaps & OPNA_HAS_RHYTHM) && (pExt->HasRhythm()))
{
cCaps &= ~OPNA_HAS_RHYTHM;
}
if ((cCaps & OPNA_HAS_ADPCM) && (pExt->HasADPCM()))
{
sound_streamregist(&opna->adpcm, (SOUNDCB)adpcm_getpcm_dummy);
cCaps &= ~OPNA_HAS_ADPCM;
}
}
if (cCaps & OPNA_HAS_PSG)
{
sound_streamregist(&opna->psg, (SOUNDCB)psggen_getpcm);
}
if (cCaps & OPNA_HAS_VR)
{
sound_streamregist(&opna->opngen, (SOUNDCB)opngen_getpcmvr);
}
else
{
sound_streamregist(&opna->opngen, (SOUNDCB)opngen_getpcm);
}
if (cCaps & OPNA_HAS_RHYTHM)
{
rhythm_bind(&opna->rhythm);
}
if (cCaps & OPNA_HAS_ADPCM)
{
sound_streamregist(&opna->adpcm, (SOUNDCB)adpcm_getpcm);
}
}
/**
* Status
* @param[in] opna The instance
* @return Status
*/
REG8 opna_readStatus(POPNA opna)
{
if (opna->s.cCaps & OPNA_HAS_TIMER)
{
return opna->s.status;
}
return 0;
}
/**
* Status
* @param[in] opna The instance
* @return Status
*/
REG8 opna_readExtendedStatus(POPNA opna)
{
const UINT8 cCaps = opna->s.cCaps;
REG8 ret = 0;
if (cCaps & OPNA_HAS_ADPCM)
{
ret = adpcm_status(&opna->adpcm);
}
else
{
ret = opna->s.adpcmmask & 8;
}
if (cCaps & OPNA_HAS_TIMER)
{
ret |= opna->s.status;
}
return ret;
}
/**
* Writes register
* @param[in] opna The instance
* @param[in] nAddress The address
* @param[in] cData The data
*/
void opna_writeRegister(POPNA opna, UINT nAddress, REG8 cData)
{
opna->s.reg[nAddress] = cData;
if (opna->s.cCaps & OPNA_S98)
{
S98_put(NORMAL2608, nAddress, cData);
}
writeRegister(opna, nAddress, cData);
}
/**
* Writes register (Inner)
* @param[in] opna The instance
* @param[in] nAddress The address
* @param[in] cData The data
*/
static void writeRegister(POPNA opna, UINT nAddress, REG8 cData)
{
const UINT8 cCaps = opna->s.cCaps;
CExternalOpna* pExt = reinterpret_cast<CExternalOpna*>(opna->userdata);
if (nAddress < 0x10)
{
if (cCaps & OPNA_HAS_PSG)
{
keydisp_psg(opna->s.reg, nAddress);
if ((!pExt) || (!pExt->HasPsg()))
{
psggen_setreg(&opna->psg, nAddress, cData);
}
else
{
pExt->WriteRegister(nAddress, cData);
}
}
}
else if (nAddress < 0x20)
{
if (cCaps & OPNA_HAS_RHYTHM)
{
if ((cCaps & OPNA_HAS_VR) && (nAddress >= 0x18) && (nAddress <= 0x1d))
{
switch (cData & 0xc0)
{
case 0x40:
case 0x80:
cData ^= 0xc0;
break;
}
}
if ((!pExt) || (!pExt->HasRhythm()))
{
rhythm_setreg(&opna->rhythm, nAddress, cData);
}
else
{
pExt->WriteRegister(nAddress, cData);
}
}
}
else if (nAddress < 0x30)
{
if (nAddress == 0x28)
{
REG8 cChannel = cData & 0x0f;
if (cChannel < 8)
{
opna->s.keyreg[cChannel] = cData;
}
if (cChannel < 3)
{
}
else if ((cCaps & OPNA_HAS_EXTENDEDFM) && (cChannel >= 4) && (cChannel < 7))
{
cChannel--;
}
else
{
return;
}
if (!pExt)
{
opngen_keyon(&opna->opngen, cChannel, cData);
}
else
{
pExt->WriteRegister(nAddress, cData);
}
keydisp_opnakeyon(opna->s.reg, cData);
}
else if (nAddress == 0x27)
{
if (cCaps & OPNA_HAS_TIMER)
{
opna_settimer(opna, cData);
}
if (pExt)
{
pExt->WriteRegister(nAddress, cData);
}
else
{
opna->opngen.opnch[2].extop = cData & 0xc0;
}
}
else if (nAddress == 0x22)
{
if (pExt)
{
pExt->WriteRegister(nAddress, cData);
}
}
}
else if (nAddress < 0xc0)
{
if ((cCaps & OPNA_HAS_VR) && ((nAddress & 0xfc) == 0xb4))
{
switch (cData & 0xc0)
{
case 0x40:
case 0x80:
cData ^= 0xc0;
break;
}
}
if (!pExt)
{
opngen_setreg(&opna->opngen, 0, nAddress, cData);
}
else
{
pExt->WriteRegister(nAddress, cData);
}
}
}
/**
* Writes extended register
* @param[in] opna The instance
* @param[in] nAddress The address
* @param[in] cData The data
*/
void opna_writeExtendedRegister(POPNA opna, UINT nAddress, REG8 cData)
{
opna->s.reg[nAddress + 0x100] = cData;
if (opna->s.cCaps & OPNA_S98)
{
S98_put(EXTEND2608, nAddress, cData);
}
writeExtendedRegister(opna, nAddress, cData);
}
/**
* Writes extended register (Inner)
* @param[in] opna The instance
* @param[in] nAddress The address
* @param[in] cData The data
*/
static void writeExtendedRegister(POPNA opna, UINT nAddress, REG8 cData)
{
const UINT8 cCaps = opna->s.cCaps;
CExternalOpna* pExt = reinterpret_cast<CExternalOpna*>(opna->userdata);
if (nAddress < 0x12)
{
if (cCaps & OPNA_HAS_ADPCM)
{
if ((cCaps & OPNA_HAS_VR) && (nAddress == 0x01))
{
switch (cData & 0xc0)
{
case 0x40:
case 0x80:
cData ^= 0xc0;
break;
}
}
adpcm_setreg(&opna->adpcm, nAddress, cData);
if ((pExt) && (pExt->HasADPCM()))
{
pExt->WriteRegister(nAddress + 0x100, cData);
}
}
else
{
if (nAddress == 0x10)
{
if (!(cData & 0x80))
{
opna->s.adpcmmask = ~(cData & 0x1c);
}
}
}
}
else if (nAddress >= 0x30)
{
if (cCaps & OPNA_HAS_EXTENDEDFM)
{
if ((cCaps & OPNA_HAS_VR) && ((nAddress & 0xfc) == 0xb4))
{
switch (cData & 0xc0)
{
case 0x40:
case 0x80:
cData ^= 0xc0;
break;
}
}
if (!pExt)
{
opngen_setreg(&opna->opngen, 3, nAddress, cData);
}
else
{
pExt->WriteRegister(nAddress + 0x100, cData);
}
}
}
}
/**
* Reads register
* @param[in] opna The instance
* @param[in] nAddress The address
* @return data
*/
REG8 opna_readRegister(POPNA opna, UINT nAddress)
{
if (nAddress < 0x10)
{
if (!(opna->s.cCaps & OPNA_HAS_PSG))
{
return 0xff;
}
}
else if (nAddress < 0x20)
{
if (!(opna->s.cCaps & OPNA_HAS_RHYTHM))
{
return 0xff;
}
}
else if (nAddress == 0xff)
{
return (opna->s.cCaps & OPNA_HAS_RHYTHM) ? 1 : 0;
}
return opna->s.reg[nAddress];
}
/**
* Reads extended register
* @param[in] opna The instance
* @param[in] nAddress The address
* @return data
*/
REG8 opna_readExtendedRegister(POPNA opna, UINT nAddress)
{
if ((opna->s.cCaps & OPNA_HAS_ADPCM) && (nAddress == 0x08))
{
return adpcm_readsample(&opna->adpcm);
}
return opna->s.reg[nAddress + 0x100];
}
/**
* Reads 3438 extended register
* @param[in] opna The instance
* @param[in] nAddress The address
* @return data
*/
REG8 opna_read3438ExtRegister(POPNA opna, UINT nAddress)
{
return opna->s.reg[nAddress];
}
// ---- statsave
/**
* Save
* @param[in] opna The instance
* @param[in] sfh The handle of statsave
* @param[in] tbl The item of statsave
* @return Error
*/
int opna_sfsave(PCOPNA opna, STFLAGH sfh, const SFENTRY *tbl)
{
int ret = statflag_write(sfh, &opna->s, sizeof(opna->s));
if (opna->s.cCaps & OPNA_HAS_ADPCM)
{
ret |= statflag_write(sfh, &opna->adpcm, sizeof(opna->adpcm));
}
return ret;
}
/**
* Load
* @param[in] opna The instance
* @param[in] sfh The handle of statsave
* @param[in] tbl The item of statsave
* @return Error
*/
int opna_sfload(POPNA opna, STFLAGH sfh, const SFENTRY *tbl)
{
int ret = statflag_read(sfh, &opna->s, sizeof(opna->s));
if (opna->s.cCaps & OPNA_HAS_ADPCM)
{
ret |= statflag_read(sfh, &opna->adpcm, sizeof(opna->adpcm));
adpcm_update(&opna->adpcm);
}
return ret;
}

View File

@ -1,65 +0,0 @@
/**
* @file SCCIDefines.h
* @brief SCCI Sound Interfaces defines
*/
#pragma once
namespace scci
{
/**
* Sound chip list
*/
enum SC_CHIP_TYPE
{
SC_TYPE_NONE = 0,
SC_TYPE_YM2608,
SC_TYPE_YM2151,
SC_TYPE_YM2610,
SC_TYPE_YM2203,
SC_TYPE_YM2612,
SC_TYPE_AY8910,
SC_TYPE_SN76489,
SC_TYPE_YM3812,
SC_TYPE_YMF262,
SC_TYPE_YM2413,
SC_TYPE_YM3526,
SC_TYPE_YMF288,
SC_TYPE_SCC,
SC_TYPE_SCCS,
SC_TYPE_Y8950,
SC_TYPE_MAX
};
/**
* Sound chip clock list
*/
enum SC_CHIP_CLOCK
{
SC_CLOCK_1789773 = 1789773, //!< SSG,OPN,OPM,SN76489 etc
SC_CLOCK_2000000 = 2000000, //!< SSG,OPN,OPM,SN76489 etc
SC_CLOCK_3579545 = 3579545, //!< SSG,OPN,OPM,SN76489 etc
SC_CLOCK_3993600 = 3993600, //!< OPN(88)
SC_CLOCK_4000000 = 4000000, //!< SSF,OPN,OPM etc
SC_CLOCK_7670454 = 7670454, //!< YM-2612 etc
SC_CLOCK_7987200 = 7987200, //!< OPNA(88)
SC_CLOCK_8000000 = 8000000, //!< OPNB etc
SC_CLOCK_12500000 = 12500000, //!< RF5C164
SC_CLOCK_14318180 = 14318180, //!< OPL2
SC_CLOCK_16934400 = 16934400, //!< YMF271
SC_CLOCK_23011361 = 23011361, //!< PWM
};
/**
* Sound chip location
*/
enum SC_CHIP_LOCATION
{
SC_LOCATION_MONO = 0,
SC_LOCATION_LEFT = 1,
SC_LOCATION_RIGHT = 2,
SC_LOCATION_STEREO = 3
};
} // namespace scci

View File

@ -1,231 +0,0 @@
/**
* @file scci.h
* @brief Sound Chip common Interface
*/
#pragma once
#include "SCCIDefines.h"
namespace scci
{
class SoundChip;
/**
* @brief Sound Interface Infomation
*/
struct SCCI_INTERFACE_INFO
{
OEMCHAR cInterfaceName[64]; /*!< Interface Name */
size_t iSoundChipCount; /*!< Sound Chip Count */
};
/**
* @brief Sound Chip Infomation
*/
struct SCCI_SOUND_CHIP_INFO
{
OEMCHAR cSoundChipName[64]; /*!< Sound Chip Name */
SC_CHIP_TYPE iSoundChip; /*!< Sound Chip ID */
SC_CHIP_TYPE iCompatibleSoundChip[2]; /*!< Compatible Sound Chip ID */
UINT dClock; /*!< Sound Chip clock */
UINT dCompatibleClock[2]; /*!< Sound Chip clock */
bool bIsUsed; /*!< Sound Chip Used Check */
UINT dBusID; /*!< 接続バスID */
SC_CHIP_LOCATION dSoundLocation; /*!< サウンドロケーション */
};
class SoundInterface;
/**
* @brief Sound Interface Manager
*/
class SoundInterfaceManager
{
public:
/**
* Gets the count of interfaces
* @return The count of interfaces
*/
virtual size_t getInterfaceCount() = 0;
/**
* Gets the information of the interface
* @param[in] iInterfaceNo The index of interfaces
* @return The information
*/
virtual const SCCI_INTERFACE_INFO* getInterfaceInfo(size_t iInterfaceNo) = 0;
/**
* Gets interface instance
* @param[in] iInterfaceNo The index of interfaces
* @return The instance
*/
virtual SoundInterface* getInterface(size_t iInterfaceNo) = 0;
/**
* Releases interface instance
* @param[in] pSoundInterface The instance of the interface
* @retval true If succeeded
* @retval false If failed
*/
virtual bool releaseInterface(SoundInterface* pSoundInterface) = 0;
/**
* Release all interface instance
* @retval true If succeeded
* @retval false If failed
*/
virtual bool releaseAllInterface() = 0;
/**
* Gets instance of the sound chip
* @param[in] iSoundChipType The type of the chip
* @param[in] dClock The clock of the chip
* @return The interface
*/
virtual SoundChip* getSoundChip(SC_CHIP_TYPE iSoundChipType, UINT dClock) = 0;
/**
* Releases the instance of the sound chip
* @param[in] pSoundChip The instance of the sound chip
* @retval true If succeeded
* @retval false If failed
*/
virtual bool releaseSoundChip(SoundChip* pSoundChip) = 0;
/**
* Releases all instances of the sound chip
* @retval true If succeeded
* @retval false If failed
*/
virtual bool releaseAllSoundChip() = 0;
/**
* Sets delay time
* @param[in] dMSec delay time
* @retval true If succeeded
* @retval false If failed
*/
virtual bool setDelay(UINT dMSec) = 0;
/**
* Gets delay time
* @return delay time
*/
virtual UINT getDelay() = 0;
/**
* Resets all interfaces
* @retval true If succeeded
* @retval false If failed
*/
virtual bool reset() = 0;
/**
* Sound Interface instance initialize
* @retval true If succeeded
* @retval false If failed
*/
virtual bool initializeInstance() = 0;
/**
* Sound Interface instance release
* @retval true If succeeded
* @retval false If failed
*/
virtual bool releaseInstance() = 0;
};
/**
* @brief Sound Interface(LOW level APIs)
*/
class SoundInterface
{
public:
/**
* Is supported low level API
* @retval true yes
* @retval false no
*/
virtual bool isSupportLowLevelApi() = 0;
/**
* Sends data to the interface
* @param[in] pData The buffer of data
* @param[in] dSendDataLen The length of data
* @retval true If succeeded
* @retval false If failed
*/
virtual bool setData(const unsigned char* pData, size_t dSendDataLen) = 0;
/**
* Gets data from the interface
* @param[out] pData The buffer of data
* @param[in] dGetDataLen The length of data
* @return The size of read
*/
virtual size_t getData(unsigned char* pData, size_t dGetDataLen) = 0;
/**
* Sets delay time
* @param[in] dDelay delay time
* @retval true If succeeded
* @retval false If failed
*/
virtual bool setDelay(UINT dDelay) = 0;
/**
* Gets delay time
* @return delay time
*/
virtual UINT getDelay() = 0;
/**
* Resets the interface
* @retval true If succeeded
* @retval false If failed
*/
virtual bool reset() = 0;
};
/**
* @brief Sound Chip
*/
class SoundChip
{
public:
/**
* Gets the informations of the sound chip
* @return The pointer of informations
*/
virtual const SCCI_SOUND_CHIP_INFO* getSoundChipInfo() = 0;
/**
* Gets sound chip type
* @return The type of the chip
*/
virtual SC_CHIP_TYPE getSoundChipType() = 0;
/**
* Sets Register data
* Writes the register
* @param[in] dAddr The address of register
* @param[in] dData The data
* @retval true If succeeded
* @retval false If failed
*/
virtual bool setRegister(UINT dAddr, UINT dData) = 0;
/**
* Initializes sound chip(clear registers)
* @retval true If succeeded
* @retval false If failed
*/
virtual bool init() = 0;
};
SoundInterfaceManager* GetSoundInterfaceManager();
} // namespace scci

View File

@ -1,287 +0,0 @@
/**
* @file scciif.cpp
* @brief SCCI
*/
#include <compiler.h>
#include "scciif.h"
#include "scci.h"
using namespace scci;
/**
*
*/
CScciIf::CScciIf()
: m_pManager(NULL)
{
}
/**
*
*/
CScciIf::~CScciIf()
{
Deinitialize();
}
/**
*
* @retval true
* @retval false
*/
bool CScciIf::Initialize()
{
if (m_pManager)
{
return false;
}
do
{
/* サウンドインターフェースマネージャー取得 */
m_pManager = GetSoundInterfaceManager();
if (m_pManager == NULL)
{
break;
}
/* サウンドインターフェースマネージャーインスタンス初期化 */
/* 必ず最初に実行してください */
if (!m_pManager->initializeInstance())
{
break;
}
/* リセットを行う */
Reset();
return true;
} while (false /*CONSTCOND*/);
Deinitialize();
return false;
}
/**
*
*/
void CScciIf::Deinitialize()
{
if (m_pManager)
{
/* 一括開放する場合(チップ一括開放の場合) */
m_pManager->releaseAllSoundChip();
/* サウンドインターフェースマネージャーインスタンス開放 */
/* FreeLibraryを行う前に必ず呼び出ししてください */
m_pManager->releaseInstance();
m_pManager = NULL;
}
}
/**
*
*/
void CScciIf::Reset()
{
if (m_pManager)
{
/* リセットを行う */
m_pManager->reset();
}
}
/**
*
* @param[in] nChipType
* @param[in] nClock
* @return
*/
IExternalChip* CScciIf::GetInterface(IExternalChip::ChipType nChipType, UINT nClock)
{
const bool bInitialized = Initialize();
do
{
if (m_pManager == NULL)
{
break;
}
SC_CHIP_TYPE iSoundChipType = SC_TYPE_NONE;
switch (nChipType)
{
case IExternalChip::kAY8910:
iSoundChipType = SC_TYPE_AY8910;
break;
case IExternalChip::kYM2203:
iSoundChipType = SC_TYPE_YM2203;
break;
case IExternalChip::kYM2608:
iSoundChipType = SC_TYPE_YM2608;
break;
case IExternalChip::kYM3438:
iSoundChipType = SC_TYPE_YM2612;
break;
case IExternalChip::kYMF288:
iSoundChipType = SC_TYPE_YMF288;
break;
case IExternalChip::kYM3812:
iSoundChipType = SC_TYPE_YM3812;
break;
case IExternalChip::kYMF262:
iSoundChipType = SC_TYPE_YMF262;
break;
case IExternalChip::kY8950:
iSoundChipType = SC_TYPE_Y8950;
break;
case IExternalChip::kYM2151:
iSoundChipType = SC_TYPE_YM2151;
break;
default:
break;
}
SoundChip* pSoundChip = m_pManager->getSoundChip(iSoundChipType, nClock);
if (pSoundChip != NULL)
{
/* サウンドチップ取得できた */
return new Chip(this, pSoundChip);
}
} while (false /*CONSTCOND*/);
if (bInitialized)
{
// Deinitialize();
}
return NULL;
}
/**
*
* @param[in] pChip
*/
void CScciIf::Detach(CScciIf::Chip* pChip)
{
/* チップの開放(チップ単位で開放の場合) */
if (m_pManager)
{
m_pManager->releaseSoundChip(*pChip);
}
}
/* ---- チップ */
/**
*
* @param[in] pScciIf
* @param[in] pSoundChip
*/
CScciIf::Chip::Chip(CScciIf* pScciIf, SoundChip* pSoundChip)
: m_pScciIf(pScciIf)
, m_pSoundChip(pSoundChip)
{
}
/**
*
*/
CScciIf::Chip::~Chip()
{
m_pScciIf->Detach(this);
}
/**
*
*/
CScciIf::Chip::operator SoundChip*()
{
return m_pSoundChip;
}
/**
* Get chip type
* @return The type of the chip
*/
IExternalChip::ChipType CScciIf::Chip::GetChipType()
{
int iSoundChip = m_pSoundChip->getSoundChipType();
const SCCI_SOUND_CHIP_INFO* pInfo = m_pSoundChip->getSoundChipInfo();
if (pInfo)
{
iSoundChip = pInfo->iSoundChip;
}
switch (iSoundChip)
{
case SC_TYPE_AY8910:
return IExternalChip::kAY8910;
case SC_TYPE_YM2203:
return IExternalChip::kYM2203;
case SC_TYPE_YM2608:
return IExternalChip::kYM2608;
case SC_TYPE_YM2612:
return IExternalChip::kYM3438;
case SC_TYPE_YM3812:
return IExternalChip::kYM3812;
case SC_TYPE_YMF262:
return IExternalChip::kYMF262;
case SC_TYPE_YMF288:
return IExternalChip::kYMF288;
case SC_TYPE_Y8950:
return IExternalChip::kY8950;
case SC_TYPE_YM2151:
return IExternalChip::kYM2151;
default:
break;
}
return IExternalChip::kNone;
}
/**
*
*/
void CScciIf::Chip::Reset()
{
}
/**
*
* @param[in] nAddr
* @param[in] cData
*/
void CScciIf::Chip::WriteRegister(UINT nAddr, UINT8 cData)
{
m_pSoundChip->setRegister(nAddr, cData);
}
/**
*
* @param[in] nMessage
* @param[in] nParameter
* @return
*/
INTPTR CScciIf::Chip::Message(UINT nMessage, INTPTR nParameter)
{
return 0;
}

View File

@ -1,53 +0,0 @@
/**
* @file scciif.h
* @brief SCCI
*/
#pragma once
#include "../externalchip.h"
namespace scci
{
class SoundChip;
class SoundInterfaceManager;
}
/**
* @brief SCCI
*/
class CScciIf
{
public:
CScciIf();
~CScciIf();
bool Initialize();
void Deinitialize();
void Reset();
IExternalChip* GetInterface(IExternalChip::ChipType nChipType, UINT nClock);
private:
scci::SoundInterfaceManager* m_pManager; /*!< マネージャ */
/**
* @brief
*/
class Chip : public IExternalChip
{
public:
Chip(CScciIf* pScciIf, scci::SoundChip* pSoundChip);
virtual ~Chip();
operator scci::SoundChip*();
virtual ChipType GetChipType();
virtual void Reset();
virtual void WriteRegister(UINT nAddr, UINT8 cData);
virtual INTPTR Message(UINT nMessage, INTPTR nParameter = 0);
private:
CScciIf* m_pScciIf; /*!< 親インスタンス */
scci::SoundChip* m_pSoundChip; /*!< チップ インスタンス */
};
void Detach(Chip* pChip);
friend class Chip;
};

View File

@ -1,93 +0,0 @@
/**
* @file sccisoundchip.cpp
* @brief Implementation of sound chip
*/
#include <compiler.h>
#include "sccisoundchip.h"
#include "sccisoundinterface.h"
namespace scci
{
/**
* Constructor
* @param[in] pInterface The instance of the sound interface
* @param[in] info The information
*/
CSoundChip::CSoundChip(CSoundInterface* pInterface, const SCCI_SOUND_CHIP_INFO& info)
: m_pInterface(pInterface)
, m_info(info)
{
}
/**
* Destructor
*/
CSoundChip::~CSoundChip()
{
Release();
m_pInterface->Delete(m_info.dBusID);
}
/**
* Release the chip
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundChip::Release()
{
if (m_info.bIsUsed)
{
m_info.bIsUsed = false;
m_pInterface->Release();
return true;
}
else
{
return false;
}
}
/**
* Is macthed?
* @param[in] iSoundChipType The type of the chip
* @param[in] dClock The clock of the chip
* @retval true Yes
* @retval false No
*/
bool CSoundChip::IsMatch(SC_CHIP_TYPE iSoundChipType, UINT dClock) const
{
if ((m_info.iSoundChip == iSoundChipType) && (m_info.dClock == dClock))
{
return true;
}
for (UINT i = 0; i < 2; i++)
{
if ((m_info.iCompatibleSoundChip[i] == iSoundChipType) && (m_info.dCompatibleClock[i] == dClock))
{
return true;
}
}
return false;
}
/**
* Gets the informations of the sound chip
* @return The pointer of informations
*/
const SCCI_SOUND_CHIP_INFO* CSoundChip::getSoundChipInfo()
{
return &m_info;
}
/**
* Gets sound chip type
* @return The type of the chip
*/
SC_CHIP_TYPE CSoundChip::getSoundChipType()
{
return m_info.iSoundChip;
}
} // namespace scci

View File

@ -1,45 +0,0 @@
/**
* @file sccisoundchip.h
* @brief Interface of sound chip
*/
#pragma once
#include "scci.h"
namespace scci
{
class CSoundInterface;
/**
* @brief The class of chip
*/
class CSoundChip : public SoundChip
{
public:
CSoundChip(CSoundInterface* pInterface, const SCCI_SOUND_CHIP_INFO& info);
virtual ~CSoundChip();
bool Release();
SCCI_SOUND_CHIP_INFO* GetSoundChipInfo();
bool IsMatch(SC_CHIP_TYPE iSoundChipType, UINT dClock) const;
// SoundChip
virtual const SCCI_SOUND_CHIP_INFO* getSoundChipInfo();
virtual SC_CHIP_TYPE getSoundChipType();
protected:
CSoundInterface* m_pInterface; /*!< Interface */
SCCI_SOUND_CHIP_INFO m_info; /*!< The information */
};
/**
* Gets the informations of the sound chip
* @return The pointer of informations
*/
inline SCCI_SOUND_CHIP_INFO* CSoundChip::GetSoundChipInfo()
{
return &m_info;
}
} // namespace scci

View File

@ -1,117 +0,0 @@
/**
* @file sccisoundinterface.cpp
* @brief Implementation of sound interfaces
*/
#include <compiler.h>
#include "sccisoundinterface.h"
#include "sccisoundchip.h"
#include "sccisoundinterfacemanager.h"
namespace scci
{
/**
* Constructor
* @param[in] pManager The instance of the manager
* @param[in] deviceName The information
*/
CSoundInterface::CSoundInterface(CSoundInterfaceManager* pManager, const std::oemstring& deviceName)
: m_nRef(0)
, m_pManager(pManager)
{
memset(&m_info, 0, sizeof(m_info));
milstr_ncpy(m_info.cInterfaceName, deviceName.c_str(), NELEMENTS(m_info.cInterfaceName));
m_info.iSoundChipCount = 0;
}
/**
* Destructor
*/
CSoundInterface::~CSoundInterface()
{
while (!m_chips.empty())
{
delete m_chips.begin()->second;
}
m_pManager->Delete(this);
}
/**
* Increments the reference count
* @return The new reference count
*/
size_t CSoundInterface::AddRef()
{
m_nRef++;
return m_nRef;
}
/**
* Decrements the reference count
* @return The new reference count
*/
size_t CSoundInterface::Release()
{
if (m_nRef)
{
m_nRef--;
}
return m_nRef;
}
/**
* Release
*/
void CSoundInterface::ReleaseAllChips()
{
for (std::map<UINT, CSoundChip*>::iterator it = m_chips.begin(); it != m_chips.end(); ++it)
{
it->second->Release();
}
}
/**
* Get the chip
* @param[in] iSoundChipType The type of the chip
* @param[in] dClock The clock of the chip
* @return The instance of the chip
*/
SoundChip* CSoundInterface::GetSoundChip(SC_CHIP_TYPE iSoundChipType, UINT dClock)
{
for (std::map<UINT, CSoundChip*>::iterator it = m_chips.begin(); it != m_chips.end(); ++it)
{
CSoundChip* pChip = it->second;
if (!pChip->IsMatch(iSoundChipType, dClock))
{
continue;
}
SCCI_SOUND_CHIP_INFO* pInfo = pChip->GetSoundChipInfo();
if (pInfo->bIsUsed)
{
continue;
}
pInfo->bIsUsed = true;
AddRef();
return pChip;
}
return NULL;
}
/**
* Delete
* @param[in] dBusID Then number of the slot
*/
void CSoundInterface::Delete(UINT dBusID)
{
std::map<UINT, CSoundChip*>::iterator it = m_chips.find(dBusID);
if (it != m_chips.end())
{
m_chips.erase(it);
m_info.iSoundChipCount--;
}
}
} // namespace scci

View File

@ -1,69 +0,0 @@
/**
* @file sccisoundinterface.h
* @brief Interface of sound interfaces
*/
#pragma once
#include <map>
#include "scci.h"
#include "oemtext.h"
namespace scci
{
class CSoundChip;
class CSoundInterfaceManager;
/**
* @brief The class of interface
*/
class CSoundInterface : public SoundInterface
{
public:
CSoundInterface(CSoundInterfaceManager* pManager, const std::oemstring& deviceName);
virtual ~CSoundInterface();
virtual size_t AddRef();
virtual size_t Release();
void ReleaseAllChips();
const SCCI_INTERFACE_INFO* GetInfo() const;
SoundChip* GetSoundChip(SC_CHIP_TYPE iSoundChipType, UINT dClock);
/**
* Initialize
* @retval true If succeeded
* @retval false If failed
*/
virtual bool Initialize() = 0;
/**
* Deinitialize
*/
virtual void Deinitialize() = 0;
/**
* Add
* @param[in] info The information
*/
virtual void Add(const SCCI_SOUND_CHIP_INFO& info) = 0;
protected:
size_t m_nRef; /*!< The reference counter */
CSoundInterfaceManager* m_pManager; /*!< Manager */
SCCI_INTERFACE_INFO m_info; /*!< The information */
std::map<UINT, CSoundChip*> m_chips; /*!< The interfaces */
void Delete(UINT dBusID);
friend class CSoundChip;
};
/**
* Gets the informations of the sound interface
* @return The poitner of the information
*/
inline const SCCI_INTERFACE_INFO* CSoundInterface::GetInfo() const
{
return &m_info;
}
} // namespace scci

View File

@ -1,337 +0,0 @@
/**
* @file sccisoundinterfacemanager.cpp
* @brief Implementation of manager
*/
#include <compiler.h>
#include "sccisoundinterfacemanager.h"
#include <algorithm>
#include "sccisoundinterface.h"
#include "sccispfmlight.h"
#include <dosio.h>
#include <common/profile.h>
namespace scci
{
//! Singleton instance
CSoundInterfaceManager CSoundInterfaceManager::sm_instance;
/**
* Gets instance
* @return The instance of sound manager
*/
SoundInterfaceManager* GetSoundInterfaceManager()
{
return CSoundInterfaceManager::GetInstance();
}
/**
* Constructor
*/
CSoundInterfaceManager::CSoundInterfaceManager()
: m_nDelayTime(0)
{
}
/**
* Destructor
*/
CSoundInterfaceManager::~CSoundInterfaceManager()
{
}
/**
* Delete
* @param[in] pInterface The instance of the sound interface
*/
void CSoundInterfaceManager::Delete(CSoundInterface* pInterface)
{
std::vector<CSoundInterface*>::iterator it = std::find(m_interfaces.begin(), m_interfaces.end(), pInterface);
if (it != m_interfaces.end())
{
m_interfaces.erase(it);
}
}
/**
* Get the count of interfaces
* @return The count of interfaces
*/
size_t CSoundInterfaceManager::getInterfaceCount()
{
return m_interfaces.size();
}
/**
* Get the information of the interface
* @param[in] iInterfaceNo The index of interfaces
* @return The information
*/
const SCCI_INTERFACE_INFO* CSoundInterfaceManager::getInterfaceInfo(size_t iInterfaceNo)
{
if (iInterfaceNo < m_interfaces.size())
{
return m_interfaces[iInterfaceNo]->GetInfo();
}
else
{
return NULL;
}
}
/**
* Gets interface instance
* @param[in] iInterfaceNo The index of interfaces
* @return The instance
*/
SoundInterface* CSoundInterfaceManager::getInterface(size_t iInterfaceNo)
{
if (iInterfaceNo < m_interfaces.size())
{
CSoundInterface* pInterface = m_interfaces[iInterfaceNo];
m_attachedInterfaces.push_back(pInterface);
pInterface->AddRef();
return pInterface;
}
else
{
return NULL;
}
}
/**
* Releases the sound interface
* @param[in] pSoundInterface The instance of the sound interface
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundInterfaceManager::releaseInterface(SoundInterface* pSoundInterface)
{
std::vector<CSoundInterface*>::iterator it = std::find(m_attachedInterfaces.begin(), m_attachedInterfaces.end(), pSoundInterface);
if (it != m_attachedInterfaces.end())
{
m_attachedInterfaces.erase(it);
static_cast<CSoundInterface*>(pSoundInterface)->Release();
return true;
}
else
{
return false;
}
}
/**
* Releases all interfaces
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundInterfaceManager::releaseAllInterface()
{
while (!m_attachedInterfaces.empty())
{
releaseInterface(m_attachedInterfaces.back());
}
return true;
}
/**
* Gets sound chip instance
* @param[in] iSoundChipType The type of the chip
* @param[in] dClock The clock of the chip
* @return The interface
*/
SoundChip* CSoundInterfaceManager::getSoundChip(SC_CHIP_TYPE iSoundChipType, UINT dClock)
{
if (iSoundChipType == SC_TYPE_NONE)
{
return NULL;
}
for (std::vector<CSoundInterface*>::iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it)
{
SoundChip* pChip = (*it)->GetSoundChip(iSoundChipType, dClock);
if (pChip)
{
return pChip;
}
}
return NULL;
}
/**
* Releases the instance of the sound chip
* @param[in] pSoundChip The instance of the sound chip
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundInterfaceManager::releaseSoundChip(SoundChip* pSoundChip)
{
delete static_cast<CSoundChip*>(pSoundChip);
return true;
}
/**
* Releases all instances of the sound chip
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundInterfaceManager::releaseAllSoundChip()
{
return releaseAllInterface();
}
/**
* Sets delay time
* @param[in] dMSec delay time
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundInterfaceManager::setDelay(UINT dMSec)
{
if (dMSec > 10000)
{
return false;
}
m_nDelayTime = dMSec;
for (std::vector<CSoundInterface*>::iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it)
{
(*it)->setDelay(dMSec);
}
return true;
}
/**
* Gets delay time
* @return delay time
*/
UINT CSoundInterfaceManager::getDelay()
{
return m_nDelayTime;
}
/**
* Resets all interfaces
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundInterfaceManager::reset()
{
bool err = false;
for (std::vector<CSoundInterface*>::iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it)
{
if (!(*it)->reset())
{
err = true;
}
}
return !err;
}
/**
* Sound Interface instance initialize
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundInterfaceManager::initializeInstance()
{
OEMCHAR szPath[MAX_PATH];
milstr_ncpy(szPath, file_getcd(OEMTEXT("SCCI.ini")), NELEMENTS(szPath));
PFILEH pfh = profile_open(szPath, PFILEH_READONLY);
m_nDelayTime = profile_readint(OEMTEXT("scci"), OEMTEXT("DelayTime"), 0, pfh);
OEMCHAR szSections[4096];
if (profile_getsectionnames(szSections, NELEMENTS(szSections), pfh))
{
OEMCHAR* lpSections = szSections;
while (*lpSections != '\0')
{
OEMCHAR* lpKeyName = lpSections;
const size_t cchKeyName = OEMSTRLEN(lpSections);
lpSections += cchKeyName + 1;
if (milstr_memcmp(lpKeyName, OEMTEXT("SPFM Light")) != 0)
{
continue;
}
if ((lpKeyName[10] != '(') || (lpKeyName[cchKeyName - 1] != ')'))
{
continue;
}
if (profile_readint(lpKeyName, OEMTEXT("ACTIVE"), 0, pfh) == 0)
{
continue;
}
std::string deviceName(lpKeyName + 11, lpKeyName + cchKeyName - 1);
CSoundInterface* pInterface = new CSpfmLight(this, deviceName, m_nDelayTime);
if (!pInterface->Initialize())
{
delete pInterface;
continue;
}
for (UINT i = 0; i < 4; i++)
{
SCCI_SOUND_CHIP_INFO info;
memset(&info, 0, sizeof(info));
info.dBusID = i;
OEMCHAR szAppName[32];
OEMSPRINTF(szAppName, OEMTEXT("SLOT_%02d_CHIP_NAME"), i);
profile_read(lpKeyName, szAppName, OEMTEXT(""), info.cSoundChipName, NELEMENTS(info.cSoundChipName), pfh);
OEMSPRINTF(szAppName, OEMTEXT("SLOT_%02d_CHIP_ID"), i);
info.iSoundChip = static_cast<SC_CHIP_TYPE>(profile_readint(lpKeyName, szAppName, 0, pfh));
OEMSPRINTF(szAppName, OEMTEXT("SLOT_%02d_CHIP_CLOCK"), i);
info.dClock = profile_readint(lpKeyName, szAppName, 0, pfh);
if (info.iSoundChip == 0)
{
continue;
}
for (UINT j = 0; j < 2; j++)
{
OEMSPRINTF(szAppName, OEMTEXT("SLOT_%02d_CHIP_ID_CMP%d"), i, j + 1);
info.iCompatibleSoundChip[j] = static_cast<SC_CHIP_TYPE>(profile_readint(lpKeyName, szAppName, 0, pfh));
OEMSPRINTF(szAppName, OEMTEXT("SLOT_%02d_CHIP_CLOCK_CMP%d"), i, j + 1);
info.dCompatibleClock[j] = profile_readint(lpKeyName, szAppName, 0, pfh);
}
OEMSPRINTF(szAppName, OEMTEXT("SLOT_%02d_CHIP_LOCATION"), i);
info.dSoundLocation = static_cast<SC_CHIP_LOCATION>(profile_readint(lpKeyName, szAppName, 0, pfh));
pInterface->Add(info);
}
m_interfaces.push_back(pInterface);
}
}
profile_close(pfh);
return true;
}
/**
* Sound Interface instance release
* @retval true If succeeded
* @retval false If failed
*/
bool CSoundInterfaceManager::releaseInstance()
{
while (!m_interfaces.empty())
{
CSoundInterface* pInterface = m_interfaces.back();
m_interfaces.pop_back();
delete pInterface;
}
return true;
}
} // namespace scci

View File

@ -1,60 +0,0 @@
/**
* @file sccisoundinterfacemanager.h
* @brief Interface of the SCCI manager
*/
#pragma once
#include <vector>
#include "scci.h"
namespace scci
{
class CSoundInterface;
/**
* @brief The class of the sound interface manager
*/
class CSoundInterfaceManager : public SoundInterfaceManager
{
public:
static CSoundInterfaceManager* GetInstance();
virtual size_t getInterfaceCount();
virtual const SCCI_INTERFACE_INFO* getInterfaceInfo(size_t iInterfaceNo);
virtual SoundInterface* getInterface(size_t iInterfaceNo);
virtual bool releaseInterface(SoundInterface* pSoundInterface);
virtual bool releaseAllInterface();
virtual SoundChip* getSoundChip(SC_CHIP_TYPE iSoundChipType, UINT dClock);
virtual bool releaseSoundChip(SoundChip* pSoundChip);
virtual bool releaseAllSoundChip();
virtual bool setDelay(UINT dMSec);
virtual UINT getDelay();
virtual bool reset();
virtual bool initializeInstance();
virtual bool releaseInstance();
private:
static CSoundInterfaceManager sm_instance; /*!< Singleton */
UINT m_nDelayTime; /*!< Delay time */
std::vector<CSoundInterface*> m_interfaces; /*!< The list of interfaces */
std::vector<CSoundInterface*> m_attachedInterfaces; /*!< The list of attached interfaces */
CSoundInterfaceManager();
~CSoundInterfaceManager();
void Delete(CSoundInterface* pInterface);
friend class CSoundInterface;
};
/**
* Gets instance
* @return The instance of sound manager
*/
inline CSoundInterfaceManager* CSoundInterfaceManager::GetInstance()
{
return &sm_instance;
}
} // namespace scci

View File

@ -1,396 +0,0 @@
/**
* @file sccispfmlight.cpp
* @brief Implementation of accessing SPFM Light
*/
#include <compiler.h>
#include "sccispfmlight.h"
#include "sccisoundchip.h"
#include "misc/threadbase.h"
namespace scci
{
/**
* Constructor
* @param[in] pManager The instance of the manager
* @param[in] deviceName The name of the device
* @param[in] nDelay delay time
*/
CSpfmLight::CSpfmLight(CSoundInterfaceManager* pManager, const std::oemstring& deviceName, UINT nDelay)
: CSoundInterface(pManager, deviceName)
, m_nDelay(nDelay)
, m_bReseted(false)
, m_nQueIndex(0)
, m_nQueCount(0)
{
}
/**
* Destructor
*/
CSpfmLight::~CSpfmLight()
{
}
/**
* Initialize
* @retval true If succeeded
* @retval false If failed
*/
bool CSpfmLight::Initialize()
{
if (!m_serial.Open(m_info.cInterfaceName, 1500000, OEMTEXT("8N1")))
{
return false;
}
bool bResult = false;
m_ttyGuard.Enter();
const UINT nUntil = GETTICK() + 3000;
const unsigned char query[1] = {0xff};
if (Write(query, sizeof(query), nUntil) == sizeof(query))
{
unsigned char buffer[2];
bResult = (Read(buffer, sizeof(buffer), nUntil) == sizeof(buffer)) && (buffer[0] == 'L') && (buffer[1] == 'T');
}
m_ttyGuard.Leave();
if (bResult)
{
reset();
}
m_serial.Close();
m_bReseted = false;
return bResult;
}
/**
* Deinitialize
*/
void CSpfmLight::Deinitialize()
{
m_serial.Close();
}
/**
* Increments the reference count
* @return The new reference count
*/
size_t CSpfmLight::AddRef()
{
const size_t nRef = CSoundInterface::AddRef();
if (nRef == 1)
{
if (m_serial.Open(m_info.cInterfaceName, 1500000, OEMTEXT("8N1")))
{
Start();
}
}
return nRef;
}
/**
* Decrements the reference count
* @return The new reference count
*/
size_t CSpfmLight::Release()
{
const size_t nRef = CSoundInterface::Release();
if (nRef == 0)
{
Stop();
m_serial.Close();
}
return nRef;
}
/**
* Add
* @param[in] info The information
*/
void CSpfmLight::Add(const SCCI_SOUND_CHIP_INFO& info)
{
std::map<UINT, CSoundChip*>::iterator it = m_chips.find(info.dBusID);
if (it == m_chips.end())
{
m_chips[info.dBusID] = new Chip(this, info);
m_info.iSoundChipCount++;
}
}
/**
* Is supported low level API
* @retval true yes
*/
bool CSpfmLight::isSupportLowLevelApi()
{
return true;
}
/**
* Sends data to the interface
* @param[in] pData The buffer of data
* @param[in] dSendDataLen The length of data
* @retval true If succeeded
* @retval false If failed
*/
bool CSpfmLight::setData(const unsigned char* pData, size_t dSendDataLen)
{
m_ttyGuard.Enter();
m_bReseted = false;
const size_t r = m_serial.Write(pData, dSendDataLen);
m_ttyGuard.Leave();
return (r == dSendDataLen);
}
/**
* Gets data from the interface
* @param[out] pData The buffer of data
* @param[in] dGetDataLen The length of data
* @return The size of read
*/
size_t CSpfmLight::getData(unsigned char* pData, size_t dGetDataLen)
{
m_ttyGuard.Enter();
const ssize_t r = m_serial.Read(pData, dGetDataLen);
m_ttyGuard.Leave();
return r;
}
/**
* Sets delay time
* @param[in] dDelay delay time
* @retval true If succeeded
* @retval false If failed
*/
bool CSpfmLight::setDelay(UINT dDelay)
{
if (dDelay > 10000)
{
return false;
}
m_nDelay = dDelay;
return true;
}
/**
* Gets delay time
* @return delay time
*/
UINT CSpfmLight::getDelay()
{
return m_nDelay;
}
/**
* Resets the interface
* @retval true If succeeded
* @retval false If failed
*/
bool CSpfmLight::reset()
{
if (m_bReseted)
{
return true;
}
if (!m_serial.IsOpened())
{
return false;
}
m_queGuard.Enter();
m_nQueIndex = 0;
m_nQueCount = 0;
m_queGuard.Leave();
m_ttyGuard.Enter();
const UINT nUntil = GETTICK() + 3000;
const unsigned char reset[1] = {0xfe};
if (Write(reset, sizeof(reset), nUntil) == sizeof(reset))
{
unsigned char buffer[2];
m_bReseted = (Read(buffer, sizeof(buffer), nUntil) == sizeof(buffer)) && (buffer[0] == 'O') && (buffer[1] == 'K');
}
m_ttyGuard.Leave();
return m_bReseted;
}
/**
* Read
* @param[out] lpBuffer The pointer of the buffer
* @param[in] cbBuffer The size of the buffer
* @param[in] nUntil until
* @return The read size
*/
ssize_t CSpfmLight::Read(unsigned char* lpBuffer, ssize_t cbBuffer, UINT nUntil)
{
ssize_t nRead = m_serial.Read(lpBuffer, cbBuffer);
if (nRead == -1)
{
return -1;
}
while ((nRead < cbBuffer) && ((static_cast<SINT>(nUntil) - static_cast<SINT>(GETTICK())) > 0))
{
Delay(1000);
const ssize_t r = m_serial.Read(lpBuffer + nRead, cbBuffer - nRead);
if (r == -1)
{
return -1;
}
nRead += r;
}
return nRead;
}
/**
* Write
* @param[out] lpBuffer The pointer of the buffer
* @param[in] cbBuffer The size of the buffer
* @param[in] nUntil until
* @return The written size
*/
ssize_t CSpfmLight::Write(const unsigned char* lpBuffer, ssize_t cbBuffer, UINT nUntil)
{
ssize_t nWritten = m_serial.Write(lpBuffer, cbBuffer);
if (nWritten == -1)
{
return -1;
}
while ((nWritten < cbBuffer) && ((static_cast<SINT>(nUntil) - static_cast<SINT>(GETTICK())) > 0))
{
Delay(1000);
const ssize_t w = m_serial.Write(lpBuffer + nWritten, cbBuffer - nWritten);
if (w == -1)
{
return -1;
}
nWritten += w;
}
return nWritten;
}
/**
* Adds the event
* @param[in] nData data
* @retval true If succeeded
* @retval false If failed
*/
bool CSpfmLight::AddEvent(UINT nData)
{
const UINT nNow = GETTICK();
m_queGuard.Enter();
m_bReseted = false;
while (m_nQueCount >= NELEMENTS(m_que))
{
m_queGuard.Leave();
Delay(1000);
m_queGuard.Enter();
}
QueData& que = m_que[(m_nQueIndex + m_nQueCount) % NELEMENTS(m_que)];
m_nQueCount++;
que.nTimestamp = nNow + m_nDelay;
que.nData = nData;
m_queGuard.Leave();
return true;
}
/**
* Thread
* @retval true Cont.
*/
bool CSpfmLight::Task()
{
/* builds data */
UINT8 sData[64];
UINT nIndex = 0;
const UINT nNow = GETTICK();
m_queGuard.Enter();
while (m_nQueCount)
{
const QueData& que = m_que[m_nQueIndex];
if ((static_cast<SINT>(que.nTimestamp) - static_cast<SINT>(nNow)) > 0)
{
break;
}
if ((nIndex + 4) > NELEMENTS(sData))
{
break;
}
sData[nIndex++] = static_cast<UINT8>(que.nData >> 24);
sData[nIndex++] = static_cast<UINT8>(que.nData >> 16);
sData[nIndex++] = static_cast<UINT8>(que.nData >> 8);
sData[nIndex++] = static_cast<UINT8>(que.nData >> 0);
m_nQueIndex = (m_nQueIndex + 1) % NELEMENTS(m_que);
m_nQueCount--;
}
m_queGuard.Leave();
/* writes */
if (nIndex > 0)
{
m_ttyGuard.Enter();
Write(sData, nIndex, nNow + 3000);
m_ttyGuard.Leave();
}
else
{
Delay(1000);
}
return true;
}
/**
* Constructor
* @param[in] pInterface The instance of the sound interface
* @param[in] info The information
*/
CSpfmLight::Chip::Chip(CSoundInterface* pInterface, const SCCI_SOUND_CHIP_INFO& info)
: CSoundChip(pInterface, info)
{
}
/**
* Sets Register data
* Writes the register
* @param[in] dAddr The address of register
* @param[in] dData The data
* @retval true If succeeded
* @retval false If failed
*/
bool CSpfmLight::Chip::setRegister(UINT dAddr, UINT dData)
{
UINT nData = (m_info.dBusID & 0x0f) << 24;
nData |= (dAddr & 0x100) << 9;
nData |= (dAddr & 0xff) << 8;
nData |= (dData & 0xff) << 0;
return (static_cast<CSpfmLight*>(m_pInterface))->AddEvent(nData);
}
/**
* Initializes sound chip(clear registers)
* @retval true If succeeded
* @retval false If failed
*/
bool CSpfmLight::Chip::init()
{
return m_pInterface->reset();
}
} // namespace scci

View File

@ -1,79 +0,0 @@
/**
* @file sccispfmlight.h
* @brief Interface of accessing SPFM Light
*/
#pragma once
#include "sccisoundchip.h"
#include "sccisoundinterface.h"
#include "misc/guard.h"
#include "misc/threadbase.h"
#include "misc/tty.h"
namespace scci
{
/**
* @brief The class of SPFM Light
*/
class CSpfmLight : public CSoundInterface, protected CThreadBase
{
public:
CSpfmLight(CSoundInterfaceManager* pManager, const std::oemstring& deviceName, UINT nDelay);
virtual ~CSpfmLight();
virtual bool Initialize();
virtual void Deinitialize();
virtual size_t AddRef();
virtual size_t Release();
virtual void Add(const SCCI_SOUND_CHIP_INFO& info);
virtual bool isSupportLowLevelApi();
virtual bool setData(const unsigned char* pData, size_t dSendDataLen);
virtual size_t getData(unsigned char* pData, size_t dGetDataLen);
virtual bool setDelay(UINT dDelay);
virtual UINT getDelay();
virtual bool reset();
protected:
virtual bool Task();
private:
/**
* @brief event
*/
struct QueData
{
UINT nTimestamp; /*!< Timestamp */
UINT nData; /*!< data */
};
/**
* @brief The class of Chip
*/
class Chip : public CSoundChip
{
public:
Chip(CSoundInterface* pInterface, const SCCI_SOUND_CHIP_INFO& info);
virtual bool setRegister(UINT dAddr, UINT dData);
virtual bool init();
};
UINT m_nDelay; /*!< delay time */
bool m_bReseted; /*!< Reset flag */
CTty m_serial; /*!< Serial */
CGuard m_ttyGuard; /*!< The quard of accessing USB */
CGuard m_queGuard; /*!< The quard of que */
UINT m_nQueIndex; /*!< The position in que */
UINT m_nQueCount; /*!< The count in que */
QueData m_que[0x400]; /*!< que */
ssize_t Read(unsigned char* lpBuffer, ssize_t cbBuffer, UINT nUntil);
ssize_t Write(const unsigned char* lpBuffer, ssize_t cbBuffer, UINT nUntil);
bool AddEvent(UINT nData);
friend class Chip;
};
} // namespace scci

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon-72.png</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon-72.png</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -1,107 +0,0 @@
/**
* @file compiler.h
* @brief include file for standard system include files,
* or project specific include files that are used frequently,
* but are changed infrequently
*/
#pragma once
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#include <stdio.h>
#include <stddef.h>
#include "SDL.h"
#define BYTESEX_LITTLE
#define OSLANG_UTF8
#define OSLINEBREAK_CRLF
#define RESOURCE_US
typedef signed int SINT;
typedef unsigned int UINT;
typedef signed char SINT8;
typedef unsigned char UINT8;
typedef signed short SINT16;
typedef unsigned short UINT16;
typedef signed int SINT32;
typedef unsigned int UINT32;
#define BRESULT UINT
#define OEMCHAR char
#define OEMTEXT(string) string
#define OEMSPRINTF sprintf
#define OEMSTRLEN strlen
#define NP2_SIZE_VGA
#if !defined(NP2_SIZE_VGA)
#define RGB16 UINT32
#define NP2_SIZE_QVGA
#endif
#if !defined(OBJC_BOOL_DEFINED)
typedef signed char BOOL;
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef MAX_PATH
#define MAX_PATH 256
#endif
#ifndef np2max
#define np2max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef np2min
#define np2min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef ZeroMemory
#define ZeroMemory(d,n) memset((d), 0, (n))
#endif
#ifndef CopyMemory
#define CopyMemory(d,s,n) memcpy((d), (s), (n))
#endif
#ifndef FillMemory
#define FillMemory(a, b, c) memset((a), (c), (b))
#endif
#include "common.h"
#include <common/milstr.h>
#include "_memory.h"
#include "rect.h"
#include "lstarray.h"
#include <trace.h>
#define GETTICK() SDL_GetTicks()
#define __ASSERT(s)
#define SPRINTF sprintf
#define STRLEN strlen
#define VERMOUTH_LIB
// #define SOUND_CRITICAL
#define SUPPORT_UTF8
#define SUPPORT_16BPP
#define MEMOPTIMIZE 2
#define SOUND_CRITICAL
#define SOUNDRESERVE 100
#define SUPPORT_CRT15KHZ
#define SUPPORT_HOSTDRV
#define SUPPORT_SWSEEKSND
#define SUPPORT_SASI
#define SUPPORT_SCSI
#define SCREEN_BPP 16

View File

@ -1,21 +0,0 @@
/*
* @file main.m
*/
#import <compiler.h>
#include "../np2.h"
#include "../dosio.h"
int SDL_main(int argc, char *argv[])
{
NSArray *paths;
NSString *DocumentsDirPath;
paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
DocumentsDirPath = [paths objectAtIndex:0];
NSString *current = [DocumentsDirPath stringByAppendingString:@"/"];
file_setcd([current UTF8String]);
return np2_main(argc, argv);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
// compiler.cpp : 標準インクルード np2sdl2.pch のみを
// 含むソース ファイルは、プリコンパイル済みヘッダーになります。
// compiler.obj にはプリコンパイル済み型情報が含まれます。
#include <compiler.h>
// TODO: このファイルではなく、compiler.h で必要な
// 追加ヘッダーを参照してください。

View File

@ -1,28 +0,0 @@
/*!
* @file guard.h
* @brief
*/
#pragma once
/*!
* @brief
*/
class CGuard
{
public:
/*! コンストラクタ */
CGuard() { ::InitializeCriticalSection(&m_cs); }
/*! デストラクタ */
~CGuard() { ::DeleteCriticalSection(&m_cs); }
/*! クリティカル セクション開始 */
void Enter() { ::EnterCriticalSection(&m_cs); }
/*! クリティカル セクション終了 */
void Leave() { ::LeaveCriticalSection(&m_cs); }
private:
CRITICAL_SECTION m_cs; //!< クリティカル セクション情報
};

View File

@ -1,100 +0,0 @@
/*!
* @file threadbase.cpp
* @brief
*/
#include <compiler.h>
#include "threadbase.h"
#include <process.h>
/*!
* @brief
*/
CThreadBase::CThreadBase()
: m_hThread(INVALID_HANDLE_VALUE)
, m_dwThreadId(0)
, m_bAbort(false)
, m_bDone(false)
, m_nStackSize(0)
{
}
/*!
* @brief
*/
CThreadBase::~CThreadBase()
{
Stop();
}
/*!
* @brief
*
* @retval true
*/
bool CThreadBase::Start()
{
if (m_hThread != INVALID_HANDLE_VALUE)
{
return false;
}
m_bAbort = false;
m_bDone = false;
unsigned int nThreadId = 0;
HANDLE hThread = reinterpret_cast<HANDLE>(::_beginthreadex(NULL, static_cast<unsigned>(m_nStackSize), &ThreadProc, this, 0, &nThreadId));
if (hThread == INVALID_HANDLE_VALUE)
{
return false;
}
m_hThread = hThread;
m_dwThreadId = nThreadId;
return true;
}
/*!
* @brief
*
* @retval true
*/
void CThreadBase::Stop()
{
if (m_hThread != INVALID_HANDLE_VALUE)
{
m_bAbort = true;
::WaitForSingleObject(m_hThread, INFINITE);
::CloseHandle(m_hThread);
m_hThread = INVALID_HANDLE_VALUE;
}
}
/*!
* @brief
*
* @retval true
*/
bool CThreadBase::Restart()
{
if ((m_hThread != INVALID_HANDLE_VALUE) && (m_bDone))
{
Stop();
}
return Start();
}
/*!
*
* @param[in] pParam this
* @retval 0 0
*/
unsigned __stdcall CThreadBase::ThreadProc(LPVOID pParam)
{
CThreadBase& obj = *(static_cast<CThreadBase*>(pParam));
while ((!obj.m_bAbort) && (obj.Task()))
{
}
obj.m_bDone = true;
return 0;
}

View File

@ -1,51 +0,0 @@
/*!
* @file threadbase.h
* @brief
*/
#pragma once
/*!
* @brief
*/
class CThreadBase
{
public:
CThreadBase();
virtual ~CThreadBase();
bool Start();
void Stop();
bool Restart();
void SetStackSize(size_t nStackSize);
static void Delay(unsigned int usec);
protected:
virtual bool Task() = 0; //!< スレッド タスク
private:
HANDLE m_hThread; //!< スレッド ハンドル
DWORD m_dwThreadId; //!< スレッド ID
bool m_bAbort; //!< 中断フラグ
bool m_bDone; //!< 完了フラグ
size_t m_nStackSize; //!< スタック サイズ
static unsigned __stdcall ThreadProc(LPVOID pParam);
};
/**
*
* @param[in] nStackSize
*/
inline void CThreadBase::SetStackSize(size_t nStackSize)
{
m_nStackSize = nStackSize;
}
/**
*
* @param[in] usec
*/
inline void CThreadBase::Delay(unsigned int usec)
{
::Sleep((usec + 999) / 1000);
}

View File

@ -1,228 +0,0 @@
/**
* @file ttyl.cpp
* @brief
*/
#include <compiler.h>
#include "tty.h"
//#include <algorithm>
#include <setupapi.h>
#include <tchar.h>
#include <codecnv/codecnv.h>
#pragma comment(lib, "setupapi.lib")
/**
*
*/
CTty::CTty()
: m_hFile(INVALID_HANDLE_VALUE)
{
}
/**
*
*/
CTty::~CTty()
{
Close();
}
/**
*
* @param[in] lpDevName
* @param[in] nSpeed
* @param[in] lpcszParam
* @retval true
* @retval false
*/
bool CTty::Open(LPCSTR lpDevName, UINT nSpeed, LPCSTR lpcszParam)
{
wchar_t wDevName[MAX_PATH];
Close();
if (!SetParam(lpcszParam, NULL))
{
return false;
}
codecnv_utf8toucs2(wDevName, MAX_PATH, lpDevName, -1);
HANDLE hFile = ::CreateFileW(wDevName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
return false;
}
DCB dcb;
::GetCommState(hFile, &dcb);
if (nSpeed != 0)
{
dcb.BaudRate = nSpeed;
}
SetParam(lpcszParam, &dcb);
dcb.fOutxCtsFlow = FALSE;
dcb.fRtsControl = RTS_CONTROL_ENABLE;
if (!::SetCommState(hFile, &dcb))
{
::CloseHandle(hFile);
return false;
}
m_hFile = hFile;
return true;
}
/**
*
*/
void CTty::Close()
{
if (m_hFile != INVALID_HANDLE_VALUE)
{
::CloseHandle(m_hFile);
m_hFile = INVALID_HANDLE_VALUE;
}
}
/**
*
* @param[in] lpcvData
* @param[in] nDataSize
* @return
*/
ssize_t CTty::Read(LPVOID lpcvData, ssize_t nDataSize)
{
if (m_hFile == INVALID_HANDLE_VALUE)
{
return -1;
}
if ((lpcvData == NULL) || (nDataSize <= 0))
{
return 0;
}
DWORD dwErrors;
COMSTAT stat;
if (!::ClearCommError(m_hFile, &dwErrors, &stat))
{
return -1;
}
DWORD dwReadLength = MIN(stat.cbInQue, static_cast<DWORD>(nDataSize));
if (dwReadLength == 0)
{
return 0;
}
DWORD dwReadSize = 0;
if (!::ReadFile(m_hFile, lpcvData, dwReadLength, &dwReadSize, NULL))
{
return -1;
}
return static_cast<ssize_t>(dwReadSize);
}
/**
*
* @param[in] lpcvData
* @param[in] nDataSize
* @return
*/
ssize_t CTty::Write(LPCVOID lpcvData, ssize_t nDataSize)
{
if (m_hFile == INVALID_HANDLE_VALUE)
{
return -1;
}
if ((lpcvData == NULL) || (nDataSize <= 0))
{
return 0;
}
DWORD dwWrittenSize = 0;
if (!::WriteFile(m_hFile, lpcvData, nDataSize, &dwWrittenSize, NULL))
{
// DEBUGLOG(_T("Failed to write."));
return -1;
}
return static_cast<ssize_t>(dwWrittenSize);
}
/**
*
* @param[in] lpcszParam
* @param[in, out] dcb DCB
* @retval true
* @retval false
*/
bool CTty::SetParam(LPCSTR lpcszParam, DCB* dcb)
{
BYTE cByteSize = 8;
BYTE cParity = NOPARITY;
BYTE cStopBits = ONESTOPBIT;
if (lpcszParam != NULL)
{
char c = lpcszParam[0];
if ((c < '4') || (c > '8'))
{
return false;
}
cByteSize = static_cast<BYTE>(c - '0');
c = lpcszParam[1];
switch (c & (~0x20))
{
case 'N': // for no parity
cParity = NOPARITY;
break;
case 'E': // for even parity
cParity = EVENPARITY;
break;
case 'O': // for odd parity
cParity = ODDPARITY;
break;
case 'M': // for mark parity
cParity = MARKPARITY;
break;
case 'S': // for for space parity
cParity = SPACEPARITY;
break;
default:
return false;
}
if (strcmp(lpcszParam + 2, "1") == 0)
{
cStopBits = ONESTOPBIT;
}
else if (strcmp(lpcszParam + 2, "1.5") == 0)
{
cStopBits = ONE5STOPBITS;
}
else if (strcmp(lpcszParam + 2, "2") == 0)
{
cStopBits = TWOSTOPBITS;
}
else
{
return false;
}
}
if (dcb != NULL)
{
dcb->ByteSize = cByteSize;
dcb->Parity = cParity;
dcb->StopBits = cStopBits;
}
return true;
}

View File

@ -1,36 +0,0 @@
/**
* @file tty.h
* @brief
*/
#pragma once
/**
* @brief
*/
class CTty
{
public:
CTty();
~CTty();
bool Open(LPCSTR lpDevName, UINT nSpeed = 0, LPCSTR lpcszParam = NULL);
bool IsOpened() const;
void Close();
ssize_t Read(LPVOID lpcvData, ssize_t nDataSize);
ssize_t Write(LPCVOID lpcvData, ssize_t nDataSize);
private:
HANDLE m_hFile; /*!< ファイル ハンドル */
bool OpenPort(LPCSTR lpPortName, UINT nSpeed, LPCSTR lpcszParam);
static bool SetParam(LPCSTR lpcszParam, DCB* dcb = NULL);
};
/**
* ?
* @retval true
* @retval false
*/
inline bool CTty::IsOpened() const
{
return (m_hFile != INVALID_HANDLE_VALUE);
}

View File

@ -1,306 +0,0 @@
/**
* @file usbdev.cpp
* @brief USB
*/
#include <compiler.h>
#include "usbdev.h"
#include <setupapi.h>
#include <codecnv/codecnv.h>
#pragma comment(lib, "setupapi.lib")
#pragma comment(lib, "winusb.lib")
// デバイスドライバのinf内で定義したGUID
// (WinUSB.sys使用デバイスに対する識別子
// {63275336-530B-4069-92B6-5F8AE3465462}
DEFINE_GUID(GUID_DEVINTERFACE_WINUSB_GIMIC,
0x63275336, 0x530b, 0x4069, 0x92, 0xb6, 0x5f, 0x8a, 0xe3, 0x46, 0x54, 0x62);
// デバイスドライバのinf内で定義したGUID
// (WinUSB.sys使用デバイスに対する識別子
// {b0320d09-0791-4c3f-a741-9ef97c8885d6}
DEFINE_GUID(GUID_DEVINTERFACE_WINUSB_C86BOX,
0xb0320d09, 0x0791, 0x4c3f, 0xa7, 0x41, 0x9e, 0xf9, 0x7c, 0x88, 0x85, 0xd6);
/**
*
*/
CUsbDev::CUsbDev()
: m_hDev(INVALID_HANDLE_VALUE)
, m_hWinUsb(NULL)
, m_cOutPipeId(0)
, m_cInPipeId(0)
{
}
/**
*
*/
CUsbDev::~CUsbDev()
{
Close();
}
/**
* USB
* @param[in] vid ID
* @param[in] pid ID
* @param[in] nIndex
* @retval true
* @retval false
*/
bool CUsbDev::Open(unsigned int vid, unsigned int pid, unsigned int nIndex)
{
if (nIndex != 0)
{
return false;
}
if (vid == 0x16c0)
{
if (pid == 0x05e5)
{
return Open(GUID_DEVINTERFACE_WINUSB_GIMIC);
}
else if (pid == 0x27d8)
{
return Open(GUID_DEVINTERFACE_WINUSB_C86BOX);
}
}
return false;
}
/**
* USB
* @param[in] InterfaceGuid
* @retval true
* @retval false
*/
bool CUsbDev::Open(const GUID& InterfaceGuid)
{
wchar_t wDevicePath[512];
LPWSTR lpwDevicePath = GetDevicePath(InterfaceGuid, wDevicePath, 512);
return OpenDevice(lpwDevicePath);
}
/**
*
* @param[in] InterfaceGuid GUID
* @param[out] lpDevicePath
* @param[in] cchDevicePath
* @return
*/
LPWSTR CUsbDev::GetDevicePath(const GUID& InterfaceGuid, LPSTR lpDevicePath, int cchDevicePath)
{
HDEVINFO hDeviceInfo = ::SetupDiGetClassDevs(&InterfaceGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
if (hDeviceInfo == NULL)
{
printf("error device\n");
return NULL;
}
LPSTR lpRet = NULL;
for (DWORD i = 0; lpRet == NULL ; i++)
{
PSP_DEVICE_INTERFACE_DATA interfaceData;
interfaceData.cbSize = sizeof(interfaceData);
if (!::SetupDiEnumDeviceInterfaces(hDeviceInfo, NULL, &InterfaceGuid, i, &interfaceData))
{
break;
}
ULONG nRequiredLength = 0;
::SetupDiGetDeviceInterfaceDetail(hDeviceInfo, &interfaceData, NULL, 0, &nRequiredLength, NULL);
PSP_DEVICE_INTERFACE_DETAIL_DATA_W pDetailData = static_cast<PSP_DEVICE_INTERFACE_DETAIL_DATA_W>(::LocalAlloc(LMEM_FIXED, nRequiredLength));
if (pDetailData == NULL)
{
continue;
}
pDetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
ULONG nLength = nRequiredLength;
if (::SetupDiGetDeviceInterfaceDetailW(hDeviceInfo, &interfaceData, pDetailData, nLength, &nRequiredLength, NULL))
{
codecnv_ucs2toutf8(lpDevicePath, MAX_PATH, pDetailData->DevicePath, -1);
lpRet = lpDevicePath;
}
::LocalFree(pDetailData);
}
::SetupDiDestroyDeviceInfoList(hDeviceInfo);
return lpRet;
}
/**
*
* @param[in] lpDevicePath
* @retval true
* @retval false
*/
bool CUsbDev::OpenDevice(LPCWSTR wDevicePath)
{
HANDLE hDev = ::CreateFileW(wDevicePath, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
if (hDev == INVALID_HANDLE_VALUE)
{
return false;
}
HANDLE hWinUsb = NULL;
if (!::WinUsb_Initialize(hDev, &hWinUsb))
{
::CloseHandle(hDev);
return false;
}
USB_INTERFACE_DESCRIPTOR desc;
if (!::WinUsb_QueryInterfaceSettings(hWinUsb, 0, &desc))
{
::WinUsb_Free(hWinUsb);
::CloseHandle(hDev);
return false;
}
UCHAR cOutPipeId = 0;
UCHAR cInPipeId = 0;
for (int i = 0; i < desc.bNumEndpoints; i++)
{
WINUSB_PIPE_INFORMATION pipeInfo;
if (::WinUsb_QueryPipe(hWinUsb, 0, (UCHAR)i, &pipeInfo))
{
if (pipeInfo.PipeType == UsbdPipeTypeBulk)
{
if (USB_ENDPOINT_DIRECTION_OUT(pipeInfo.PipeId))
{
cOutPipeId = pipeInfo.PipeId;
// outPipeMaxPktSize = pipeInfo.MaximumPacketSize;
}
else if (USB_ENDPOINT_DIRECTION_IN(pipeInfo.PipeId))
{
cInPipeId = pipeInfo.PipeId;
// inPipeMaxPktSize = pipeInfo.MaximumPacketSize;
}
}
}
}
if (cOutPipeId != 0)
{
ULONG nTimeOut = 500;
::WinUsb_SetPipePolicy(hWinUsb, cOutPipeId, PIPE_TRANSFER_TIMEOUT, sizeof(nTimeOut), &nTimeOut);
::WinUsb_FlushPipe(hWinUsb, cOutPipeId);
}
if (cInPipeId != 0)
{
ULONG nTimeOut = 500;
::WinUsb_SetPipePolicy(hWinUsb, cInPipeId, PIPE_TRANSFER_TIMEOUT, sizeof(nTimeOut), &nTimeOut);
::WinUsb_FlushPipe(hWinUsb, cInPipeId);
}
m_hDev = hDev;
m_hWinUsb = hWinUsb;
m_cOutPipeId = cOutPipeId;
m_cInPipeId = cInPipeId;
return true;
}
/**
* USB
*/
void CUsbDev::Close()
{
if (m_hDev != INVALID_HANDLE_VALUE)
{
::WinUsb_Free(m_hWinUsb);
::CloseHandle(m_hDev);
m_hDev = INVALID_HANDLE_VALUE;
m_hWinUsb = NULL;
m_cOutPipeId = 0;
m_cInPipeId = 0;
}
}
/**
*
* @param[in] nType
* @param[in] nRequest
* @param[in] nValue
* @param[in] nIndex
* @param[out] lpBuffer
* @param[in] cbBuffer
* @return
*/
int CUsbDev::CtrlXfer(int nType, int nRequest, int nValue, int nIndex, void* lpBuffer, int cbBuffer)
{
if (m_hWinUsb == NULL)
{
return -1;
}
WINUSB_SETUP_PACKET setup;
setup.RequestType = nType;
setup.Request = nRequest;
setup.Value = nValue;
setup.Index = nIndex;
setup.Length = cbBuffer;
ULONG nTransferred = 0;
if (!::WinUsb_ControlTransfer(m_hWinUsb, setup, static_cast<PUCHAR>(lpBuffer), cbBuffer, &nTransferred, NULL))
{
return -1;
}
return static_cast<int>(nTransferred);
}
/**
*
* @param[in] lpBuffer
* @param[in] cbBuffer
* @return
*/
int CUsbDev::WriteBulk(const void* lpBuffer, int cbBuffer)
{
if (m_cOutPipeId == 0)
{
return -1;
}
DWORD dwLength = 0;
while (!::WinUsb_WritePipe(m_hWinUsb, m_cOutPipeId, static_cast<PUCHAR>(const_cast<void*>(lpBuffer)), static_cast<ULONG>(cbBuffer), &dwLength, 0))
{
if (GetLastError() == ERROR_SEM_TIMEOUT)
{
::Sleep(1);
continue;
}
Close();
return -1;
}
return static_cast<int>(dwLength);
}
/**
*
* @param[out] lpBuffer
* @param[in] cbBuffer
* @return
*/
int CUsbDev::ReadBulk(void* lpBuffer, int cbBuffer)
{
if (m_cInPipeId == 0)
{
return -1;
}
DWORD dwLength = 0;
if (!::WinUsb_ReadPipe(m_hWinUsb, m_cInPipeId, static_cast<PUCHAR>(lpBuffer), static_cast<ULONG>(cbBuffer), &dwLength, 0))
{
Close();
return -1;
}
return static_cast<int>(dwLength);
}

View File

@ -1,46 +0,0 @@
/**
* @file usbdev.h
* @brief USB
*/
#pragma once
#undef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WINXP
#include <WinUsb.h>
#include <wchar.h>
/**
* @brief USB
*/
class CUsbDev
{
public:
CUsbDev();
~CUsbDev();
bool Open(unsigned int vid, unsigned int pid, unsigned int nIndex = 0);
void Close();
int CtrlXfer(int nType, int nRequest, int nValue = 0, int nIndex = 0, void* lpBuffer = NULL, int cbBuffer = 0);
int WriteBulk(const void* lpBuffer, int cbBuffer);
int ReadBulk(void* lpBuffer, int cbBuffer);
bool IsOpened() const;
private:
HANDLE m_hDev; /*!< デバイス ハンドル */
WINUSB_INTERFACE_HANDLE m_hWinUsb; /*!< WinUSB */
UCHAR m_cOutPipeId; /*!< パイプ ID */
UCHAR m_cInPipeId; /*!< パイプ id */
static LPSTR GetDevicePath(const GUID& InterfaceGuid, LPSTR lpDevicePath, int cchDevicePath);
bool Open(const GUID& InterfaceGuid);
bool OpenDevice(LPWCSTR wDevicePath);
};
/**
* ?
* @retval true
* @retval false
*/
inline bool CUsbDev::IsOpened() const
{
return (m_hDev != INVALID_HANDLE_VALUE);
}

View File

@ -1,26 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np2sdl2", "np2sdl2.vcproj", "{C06A88AB-EB80-471D-B316-6FB61A9D17C6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C06A88AB-EB80-471D-B316-6FB61A9D17C6}.Debug|Win32.ActiveCfg = Debug|Win32
{C06A88AB-EB80-471D-B316-6FB61A9D17C6}.Debug|Win32.Build.0 = Debug|Win32
{C06A88AB-EB80-471D-B316-6FB61A9D17C6}.Debug|x64.ActiveCfg = Debug|x64
{C06A88AB-EB80-471D-B316-6FB61A9D17C6}.Debug|x64.Build.0 = Debug|x64
{C06A88AB-EB80-471D-B316-6FB61A9D17C6}.Release|Win32.ActiveCfg = Release|Win32
{C06A88AB-EB80-471D-B316-6FB61A9D17C6}.Release|Win32.Build.0 = Release|Win32
{C06A88AB-EB80-471D-B316-6FB61A9D17C6}.Release|x64.ActiveCfg = Release|x64
{C06A88AB-EB80-471D-B316-6FB61A9D17C6}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29519.87
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np2kaiw", "np2vs2019.vcxproj", "{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np21kaiw", "np21vs2019.vcxproj", "{CA040333-3357-4598-A480-57C957DA24B5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseHAXM|Win32 = ReleaseHAXM|Win32
ReleaseHAXM|x64 = ReleaseHAXM|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.Debug|Win32.ActiveCfg = Debug|Win32
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.Debug|Win32.Build.0 = Debug|Win32
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.Debug|x64.ActiveCfg = Debug|x64
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.Debug|x64.Build.0 = Debug|x64
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.Release|Win32.ActiveCfg = Release|Win32
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.Release|Win32.Build.0 = Release|Win32
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.Release|x64.ActiveCfg = Release|x64
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.Release|x64.Build.0 = Release|x64
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.ReleaseHAXM|Win32.ActiveCfg = Release|Win32
{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}.ReleaseHAXM|x64.ActiveCfg = Release|x64
{CA040333-3357-4598-A480-57C957DA24B5}.Debug|Win32.ActiveCfg = Debug|Win32
{CA040333-3357-4598-A480-57C957DA24B5}.Debug|Win32.Build.0 = Debug|Win32
{CA040333-3357-4598-A480-57C957DA24B5}.Debug|x64.ActiveCfg = Debug|x64
{CA040333-3357-4598-A480-57C957DA24B5}.Debug|x64.Build.0 = Debug|x64
{CA040333-3357-4598-A480-57C957DA24B5}.Release|Win32.ActiveCfg = Release|Win32
{CA040333-3357-4598-A480-57C957DA24B5}.Release|Win32.Build.0 = Release|Win32
{CA040333-3357-4598-A480-57C957DA24B5}.Release|x64.ActiveCfg = Release|x64
{CA040333-3357-4598-A480-57C957DA24B5}.Release|x64.Build.0 = Release|x64
{CA040333-3357-4598-A480-57C957DA24B5}.ReleaseHAXM|Win32.ActiveCfg = ReleaseHAXM|Win32
{CA040333-3357-4598-A480-57C957DA24B5}.ReleaseHAXM|Win32.Build.0 = ReleaseHAXM|Win32
{CA040333-3357-4598-A480-57C957DA24B5}.ReleaseHAXM|x64.ActiveCfg = ReleaseHAXM|x64
{CA040333-3357-4598-A480-57C957DA24B5}.ReleaseHAXM|x64.Build.0 = ReleaseHAXM|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {48E9DA0A-6575-4E97-AAA5-591C3A8F917F}
EndGlobalSection
EndGlobal

View File

@ -1,919 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D0AC326F-CEFF-492D-839A-27D6CDA7EF64}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>np2vs2019</RootNamespace>
<ProjectName>np2kai</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<NP2kaiCommonDefines>NP2_WIN;_CRT_SECURE_NO_WARNINGS;</NP2kaiCommonDefines>
<NP2kaiDebugDefines>_DEBUG;DEBUG;TRACE;</NP2kaiDebugDefines>
<NP2kaiNDebugDefines>_NDEBUG;NDEBUG;</NP2kaiNDebugDefines>
<NP2kaiDefines>ALLOW_MULTIRUN;BIOS_IO_EMULATION;HOOK_SYSKEY;MT32SOUND_DLL;NP2_THREAD_WIN;OSLANG_UTF8;OSLINEBREAK_CRLF;SOUND_CRITICAL;SOUNDRESERVE=20;SUPPORT_16BPP;SUPPORT_24BPP;SUPPORT_32BPP;SUPPORT_8BPP;SUPPORT_ARC;SUPPORT_ASIO;SUPPORT_ASYNC_CPU;SUPPORT_CL_GD5430;SUPPORT_CRT15KHZ;SUPPORT_DCLOCK;SUPPORT_FAST_MEMORYCHECK;SUPPORT_FMGEN;SUPPORT_GPIB;SUPPORT_HOSTDRV;SUPPORT_HRTIMER;SUPPORT_IDEIO;SUPPORT_KAI_IMAGES;SUPPORT_KEYDISP;SUPPORT_LARGE_HDD;SUPPORT_LGY98;SUPPORT_NAMED_PIPE;SUPPORT_NET;SUPPORT_NP2_THREAD;SUPPORT_NORMALDISP;SUPPORT_NVL_IMAGES;SUPPORT_PC9861K;SUPPORT_PHYSICAL_CDDRV;SUPPORT_PX;SUPPORT_RECVIDEO;SUPPORT_RESUME;SUPPORT_ROMEO;SUPPORT_RS232C_FIFO;SUPPORT_S98;SUPPORT_SCRN_DIRECT3D;SUPPORT_SCSI;SUPPORT_SMPU98;SUPPORT_SOFTKBD=0;SUPPORT_SOUND_SB16;SUPPORT_SWSEEKSND;SUPPORT_SWWABRLYSND;SUPPORT_SJIS;SUPPORT_STATSAVE=10;SUPPORT_UTF8;SUPPORT_V30EXT;SUPPORT_V30ORIGINAL;SUPPORT_VPCVHD;SUPPORT_WAB;SUPPORT_WACOM_TABLET;SUPPORT_WAVEREC;SUPPORT_NP2_TICKCOUNT;USE_MAME;USE_RESOURCE_BMP;VAEG_FIX;VERMOUTH_LIB;</NP2kaiDefines>
<!-- SUPPORT_BMS SUPPORT_SASI SUPPORT_VSTi -->
<NP2kaiDefines32>_WIN32;SUPPORT_WIN2000HOST;</NP2kaiDefines32>
<NP2kaiDefines64>_WIN64;</NP2kaiDefines64>
<NP2kaiCommonInludes>.\;..\;</NP2kaiCommonInludes>
<!-- \VST_SDK -->
<NP2kaiIncludes>..\i286c;</NP2kaiIncludes>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="x86\vs2019\x86.props" />
<Import Project="x64\vs2019\x64.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\bin\$(SolutionName)\$(PlatformName)\$(Configuration)\</OutDir>
<IntDir>..\obj\$(SolutionName)\$(PlatformName)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<TargetName>$(ProjectName)_i386</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\bin\$(SolutionName)\$(PlatformName)\$(Configuration)\</OutDir>
<IntDir>..\obj\$(SolutionName)\$(PlatformName)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<TargetName>$(ProjectName)_x86_64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\bin\$(SolutionName)\$(PlatformName)\$(Configuration)\</OutDir>
<IntDir>..\obj\$(SolutionName)\$(PlatformName)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<TargetName>$(ProjectName)_i386</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\bin\$(SolutionName)\$(PlatformName)\$(Configuration)\</OutDir>
<IntDir>..\obj\$(SolutionName)\$(PlatformName)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<TargetName>$(ProjectName)_x86_64</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>$(NP2kaiCommonDefines);$(NP2kaiDefines32);$(NP2kaiDebugDefines);$(NP2kaiDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(NP2kaiCommonInludes);$(NP2kaiIncludes);</AdditionalIncludeDirectories>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4828</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>d3d9.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>$(NP2kaiCommonDefines);$(NP2kaiDefines32);$(NP2kaiDebugDefines);$(NP2kaiDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<PreBuildEvent>
<Command>powershell.exe -ExecutionPolicy RemoteSigned -File "$(SolutionDir)\version_info.ps1" server "$(ProjectDir)\" "$(SolutionDir)\"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>$(NP2kaiCommonDefines);$(NP2kaiDefines64);$(NP2kaiDebugDefines);$(NP2kaiDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(NP2kaiCommonInludes);$(NP2kaiIncludes);</AdditionalIncludeDirectories>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4828</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LargeAddressAware>false</LargeAddressAware>
<DelayLoadDLLs>d3d9.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>$(NP2kaiCommonDefines);$(NP2kaiDefines64);$(NP2kaiDebugDefines);$(NP2kaiDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<PreBuildEvent>
<Command>powershell.exe -ExecutionPolicy RemoteSigned -File "$(SolutionDir)\version_info.ps1" server "$(ProjectDir)\" "$(SolutionDir)\"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>$(NP2kaiCommonDefines);$(NP2kaiDefines32);$(NP2kaiNDebugDefines);$(NP2kaiDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(NP2kaiCommonInludes);$(NP2kaiIncludes);</AdditionalIncludeDirectories>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
<DebugInformationFormat>None</DebugInformationFormat>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4828</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<DelayLoadDLLs>d3d9.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>$(NP2kaiCommonDefines);$(NP2kaiDefines32);$(NP2kaiNDebugDefines);$(NP2kaiDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<PreBuildEvent>
<Command>powershell.exe -ExecutionPolicy RemoteSigned -File "$(SolutionDir)\version_info.ps1" server "$(ProjectDir)\" "$(SolutionDir)\"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>$(NP2kaiCommonDefines);$(NP2kaiDefines64);$(NP2kaiNDebugDefines);$(NP2kaiDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(NP2kaiCommonInludes);$(NP2kaiIncludes);</AdditionalIncludeDirectories>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
<DebugInformationFormat>None</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4828</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LargeAddressAware>false</LargeAddressAware>
<DelayLoadDLLs>d3d9.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>$(NP2kaiCommonDefines);$(NP2kaiDefines64);$(NP2kaiNDebugDefines);$(NP2kaiDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<PreBuildEvent>
<Command>powershell.exe -ExecutionPolicy RemoteSigned -File "$(SolutionDir)\version_info.ps1" server "$(ProjectDir)\" "$(SolutionDir)\"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\bios\bios.c" />
<ClCompile Include="..\bios\bios09.c" />
<ClCompile Include="..\bios\bios0c.c" />
<ClCompile Include="..\bios\bios12.c" />
<ClCompile Include="..\bios\bios13.c" />
<ClCompile Include="..\bios\bios18.c" />
<ClCompile Include="..\bios\bios19.c" />
<ClCompile Include="..\bios\bios1a.c" />
<ClCompile Include="..\bios\bios1b.c" />
<ClCompile Include="..\bios\bios1c.c" />
<ClCompile Include="..\bios\bios1f.c" />
<ClCompile Include="..\bios\sxsibios.c" />
<ClCompile Include="..\calendar.c" />
<ClCompile Include="..\cbus\amd98.c" />
<ClCompile Include="..\cbus\atapicmd.c" />
<ClCompile Include="..\cbus\board118.c" />
<ClCompile Include="..\cbus\board14.c" />
<ClCompile Include="..\cbus\board26k.c" />
<ClCompile Include="..\cbus\board86.c" />
<ClCompile Include="..\cbus\boardlol.c" />
<ClCompile Include="..\cbus\boardmo.c" />
<ClCompile Include="..\cbus\boardpx.c" />
<ClCompile Include="..\cbus\boardsb16.c" />
<ClCompile Include="..\cbus\boardso.c" />
<ClCompile Include="..\cbus\boardspb.c" />
<ClCompile Include="..\cbus\boardx2.c" />
<ClCompile Include="..\cbus\cbuscore.c" />
<ClCompile Include="..\cbus\cs4231io.c" />
<ClCompile Include="..\cbus\ct1741io.c" />
<ClCompile Include="..\cbus\ct1745io.c" />
<ClCompile Include="..\cbus\gpibio.c" />
<ClCompile Include="..\cbus\ideio.c" />
<ClCompile Include="..\cbus\mpu98ii.c" />
<ClCompile Include="..\cbus\pc9861k.c" />
<ClCompile Include="..\cbus\pcm86io.c" />
<ClCompile Include="..\cbus\sasiio.c" />
<ClCompile Include="..\cbus\scsicmd.c" />
<ClCompile Include="..\cbus\scsiio.c" />
<ClCompile Include="..\cbus\smpu98.c" />
<ClCompile Include="..\codecnv\jisucs2.c" />
<ClCompile Include="..\codecnv\tcswap16.c" />
<ClCompile Include="..\codecnv\ucs2sjis.c" />
<ClCompile Include="..\codecnv\ucs2ucs4.c" />
<ClCompile Include="..\codecnv\ucs2utf8.c" />
<ClCompile Include="..\codecnv\ucs4ucs2.c" />
<ClCompile Include="..\codecnv\ucs4utf8.c" />
<ClCompile Include="..\codecnv\utf8ucs2.c" />
<ClCompile Include="..\codecnv\utf8ucs4.c" />
<ClCompile Include="..\common\bmpdata.c" />
<ClCompile Include="..\common\lstarray.c" />
<ClCompile Include="..\common\milstr.c" />
<ClCompile Include="..\common\mimpidef.c" />
<ClCompile Include="..\common\parts.c" />
<ClCompile Include="..\common\profile.c" />
<ClCompile Include="..\common\rect.c" />
<ClCompile Include="..\common\resize.c" />
<ClCompile Include="..\common\strres.c" />
<ClCompile Include="..\common\textfile.c" />
<ClCompile Include="..\common\wavefile.c" />
<ClCompile Include="..\common\_memory.c" />
<ClCompile Include="..\debugsub.c" />
<ClCompile Include="..\diskimage\cddfile.c" />
<ClCompile Include="..\diskimage\cd\cdd_ccd.c" />
<ClCompile Include="..\diskimage\cd\cdd_cue.c" />
<ClCompile Include="..\diskimage\cd\cdd_iso.c" />
<ClCompile Include="..\diskimage\cd\cdd_mds.c" />
<ClCompile Include="..\diskimage\cd\cdd_nrg.c" />
<ClCompile Include="..\diskimage\cd\cdd_real.c" />
<ClCompile Include="..\diskimage\fddfile.c" />
<ClCompile Include="..\diskimage\fd\fdd_bkdsk.c" />
<ClCompile Include="..\diskimage\fd\fdd_d88.c" />
<ClCompile Include="..\diskimage\fd\fdd_dcp.c" />
<ClCompile Include="..\diskimage\fd\fdd_nfd.c" />
<ClCompile Include="..\diskimage\fd\fdd_vfdd.c" />
<ClCompile Include="..\diskimage\fd\fdd_xdf.c" />
<ClCompile Include="..\diskimage\img_strres.c" />
<ClCompile Include="..\fdd\diskdrv.c" />
<ClCompile Include="..\fdd\fdd_mtr.c" />
<ClCompile Include="..\fdd\newdisk.c" />
<ClCompile Include="..\fdd\sxsi.c" />
<ClCompile Include="..\fdd\sxsicd.c" />
<ClCompile Include="..\fdd\sxsihdd.c" />
<ClCompile Include="..\fdd\sxsihdd_nvl.c" />
<ClCompile Include="..\font\font.c" />
<ClCompile Include="..\font\fontdata.c" />
<ClCompile Include="..\font\fontfm7.c" />
<ClCompile Include="..\font\fontmake.c" />
<ClCompile Include="..\font\fontpc88.c" />
<ClCompile Include="..\font\fontpc98.c" />
<ClCompile Include="..\font\fontv98.c" />
<ClCompile Include="..\font\fontx1.c" />
<ClCompile Include="..\font\fontx68k.c" />
<ClCompile Include="..\generic\cmjasts.c" />
<ClCompile Include="..\generic\cmndraw.c" />
<ClCompile Include="..\generic\dipswbmp.c" />
<ClCompile Include="..\generic\hostdrv.c" />
<ClCompile Include="..\generic\hostdrvs.c" />
<ClCompile Include="..\generic\keydisp.c" />
<ClCompile Include="..\generic\np2info.c" />
<ClCompile Include="..\generic\softkbd.c" />
<ClCompile Include="..\generic\unasm.c" />
<ClCompile Include="..\i286c\cpumem.c" />
<ClCompile Include="..\i286c\i286c.c" />
<ClCompile Include="..\i286c\i286c_0f.c" />
<ClCompile Include="..\i286c\i286c_8x.c" />
<ClCompile Include="..\i286c\i286c_ea.c" />
<ClCompile Include="..\i286c\i286c_f6.c" />
<ClCompile Include="..\i286c\i286c_fe.c" />
<ClCompile Include="..\i286c\i286c_mn.c" />
<ClCompile Include="..\i286c\i286c_rp.c" />
<ClCompile Include="..\i286c\i286c_sf.c" />
<ClCompile Include="..\i286c\v30patch.c" />
<ClCompile Include="..\io\artic.c" />
<ClCompile Include="..\io\bmsio.c" />
<ClCompile Include="..\io\cgrom.c" />
<ClCompile Include="..\io\cpuio.c" />
<ClCompile Include="..\io\crtc.c" />
<ClCompile Include="..\io\dipsw.c" />
<ClCompile Include="..\io\dmac.c" />
<ClCompile Include="..\io\egc.c" />
<ClCompile Include="..\io\emsio.c" />
<ClCompile Include="..\io\epsonio.c" />
<ClCompile Include="..\io\fdc.c" />
<ClCompile Include="..\io\fdd320.c" />
<ClCompile Include="..\io\gdc.c" />
<ClCompile Include="..\io\gdc_pset.c" />
<ClCompile Include="..\io\gdc_sub.c" />
<ClCompile Include="..\io\iocore.c" />
<ClCompile Include="..\io\mouseif.c" />
<ClCompile Include="..\io\necio.c" />
<ClCompile Include="..\io\nmiio.c" />
<ClCompile Include="..\io\np2sysp.c" />
<ClCompile Include="..\io\pcidev.c" />
<ClCompile Include="..\io\pci\98graphbridge.c" />
<ClCompile Include="..\io\pci\cbusbridge.c" />
<ClCompile Include="..\io\pegc.c" />
<ClCompile Include="..\io\pic.c" />
<ClCompile Include="..\io\pit.c" />
<ClCompile Include="..\io\printif.c" />
<ClCompile Include="..\io\serial.c" />
<ClCompile Include="..\io\sysport.c" />
<ClCompile Include="..\io\upd4990.c" />
<ClCompile Include="..\keystat.c" />
<ClCompile Include="..\lio\gcircle.c" />
<ClCompile Include="..\lio\gline.c" />
<ClCompile Include="..\lio\gpset.c" />
<ClCompile Include="..\lio\gput1.c" />
<ClCompile Include="..\lio\gscreen.c" />
<ClCompile Include="..\lio\lio.c" />
<ClCompile Include="..\mem\dmav30.c" />
<ClCompile Include="..\mem\dmax86.c" />
<ClCompile Include="..\mem\memegc.c" />
<ClCompile Include="..\mem\memems.c" />
<ClCompile Include="..\mem\memepp.c" />
<ClCompile Include="..\mem\memtram.c" />
<ClCompile Include="..\mem\memvga.c" />
<ClCompile Include="..\mem\memvram.c" />
<ClCompile Include="..\network\lgy98.c" />
<ClCompile Include="..\network\net.c" />
<ClCompile Include="..\nevent.c" />
<ClCompile Include="..\np2_thread.c" />
<ClCompile Include="..\np2_tickcount.c" />
<ClCompile Include="..\pccore.c" />
<ClCompile Include="..\sound\adpcmc.c" />
<ClCompile Include="..\sound\adpcmg.c" />
<ClCompile Include="..\sound\beepc.c" />
<ClCompile Include="..\sound\beepg.c" />
<ClCompile Include="..\sound\cs4231c.c" />
<ClCompile Include="..\sound\cs4231g.c" />
<ClCompile Include="..\sound\fmboard.c" />
<ClCompile Include="..\sound\fmgen\fmgen_file.cpp" />
<ClCompile Include="..\sound\fmgen\fmgen_fmgen.cpp" />
<ClCompile Include="..\sound\fmgen\fmgen_fmgwrap.cpp" />
<ClCompile Include="..\sound\fmgen\fmgen_fmtimer.cpp" />
<ClCompile Include="..\sound\fmgen\fmgen_opm.cpp" />
<ClCompile Include="..\sound\fmgen\fmgen_opna.cpp" />
<ClCompile Include="..\sound\fmgen\fmgen_psg.cpp" />
<ClCompile Include="..\sound\getsnd\getsmix.c" />
<ClCompile Include="..\sound\getsnd\getsnd.c" />
<ClCompile Include="..\sound\getsnd\getwave.c" />
<ClCompile Include="..\sound\mame\fmopl.c" />
<ClCompile Include="..\sound\mame\ymdeltat.c" />
<ClCompile Include="..\sound\mame\ymf262.c" />
<ClCompile Include="..\sound\opl3.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\sound\oplgenc.c" />
<ClCompile Include="..\sound\oplgeng.c" />
<ClCompile Include="..\sound\opngenc.c" />
<ClCompile Include="..\sound\opngeng.c" />
<ClCompile Include="..\sound\opntimer.c" />
<ClCompile Include="..\sound\pcm86c.c" />
<ClCompile Include="..\sound\pcm86g.c" />
<ClCompile Include="..\sound\pcmmix.c" />
<ClCompile Include="..\sound\psggenc.c" />
<ClCompile Include="..\sound\psggeng.c" />
<ClCompile Include="..\sound\rhythmc.c" />
<ClCompile Include="..\sound\s98.c" />
<ClCompile Include="..\sound\sndcsec.c" />
<ClCompile Include="..\sound\sound.c" />
<ClCompile Include="..\sound\soundrom.c" />
<ClCompile Include="..\sound\tms3631c.c" />
<ClCompile Include="..\sound\tms3631g.c" />
<ClCompile Include="..\sound\vermouth\midimod.c" />
<ClCompile Include="..\sound\vermouth\midinst.c" />
<ClCompile Include="..\sound\vermouth\midiout.c" />
<ClCompile Include="..\sound\vermouth\midtable.c" />
<ClCompile Include="..\sound\vermouth\midvoice.c" />
<ClCompile Include="..\statsave.c" />
<ClCompile Include="..\timing.c" />
<ClCompile Include="..\trap\inttrap.c" />
<ClCompile Include="..\trap\steptrap.c" />
<ClCompile Include="..\vram\dispsync.c" />
<ClCompile Include="..\vram\makegrex.c" />
<ClCompile Include="..\vram\makegrph.c" />
<ClCompile Include="..\vram\maketext.c" />
<ClCompile Include="..\vram\maketgrp.c" />
<ClCompile Include="..\vram\palettes.c" />
<ClCompile Include="..\vram\scrndraw.c" />
<ClCompile Include="..\vram\scrnsave.c" />
<ClCompile Include="..\vram\sdraw.c" />
<ClCompile Include="..\vram\sdrawq16.c" />
<ClCompile Include="..\vram\vram.c" />
<ClCompile Include="..\wab\cirrus_vga.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Disabled</Optimization>
</ClCompile>
<ClCompile Include="..\wab\wab.c" />
<ClCompile Include="..\wab\wab_rly.c" />
<ClCompile Include="commng.cpp" />
<ClCompile Include="commng\cmbase.cpp" />
<ClCompile Include="commng\cmmidi.cpp" />
<ClCompile Include="commng\cmmidiin32.cpp" />
<ClCompile Include="commng\cmmidiout32.cpp" />
<ClCompile Include="commng\cmmidioutmt32sound.cpp" />
<ClCompile Include="commng\cmmidioutvermouth.cpp" />
<ClCompile Include="commng\cmmidioutvst.cpp" />
<ClCompile Include="commng\cmnull.cpp" />
<ClCompile Include="commng\cmpara.cpp" />
<ClCompile Include="commng\cmpipe.cpp" />
<ClCompile Include="commng\cmserial.cpp" />
<ClCompile Include="commng\cmwacom.cpp" />
<ClCompile Include="commng\vsthost\vstbuffer.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="commng\vsthost\vsteditwnd.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="commng\vsthost\vsteffect.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="commng\vsthost\vstmidievent.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="commng\wintab\Utils.cpp" />
<ClCompile Include="compiler.cpp" />
<ClCompile Include="debuguty\view1mb.cpp" />
<ClCompile Include="debuguty\viewasm.cpp" />
<ClCompile Include="debuguty\viewer.cpp" />
<ClCompile Include="debuguty\viewitem.cpp" />
<ClCompile Include="debuguty\viewmem.cpp" />
<ClCompile Include="debuguty\viewreg.cpp" />
<ClCompile Include="debuguty\viewseg.cpp" />
<ClCompile Include="debuguty\viewsnd.cpp" />
<ClCompile Include="dialog\c_combodata.cpp" />
<ClCompile Include="dialog\c_dipsw.cpp" />
<ClCompile Include="dialog\c_midi.cpp" />
<ClCompile Include="dialog\c_slidervalue.cpp" />
<ClCompile Include="dialog\d_about.cpp" />
<ClCompile Include="dialog\d_bmp.cpp" />
<ClCompile Include="dialog\d_cfgload.cpp" />
<ClCompile Include="dialog\d_cfgsave.cpp" />
<ClCompile Include="dialog\d_clnd.cpp" />
<ClCompile Include="dialog\d_config.cpp" />
<ClCompile Include="dialog\d_disk.cpp" />
<ClCompile Include="dialog\d_font.cpp" />
<ClCompile Include="dialog\d_hostdrv.cpp" />
<ClCompile Include="dialog\d_ide.cpp" />
<ClCompile Include="dialog\d_mpu98.cpp" />
<ClCompile Include="dialog\d_network.cpp" />
<ClCompile Include="dialog\d_screen.cpp" />
<ClCompile Include="dialog\d_serial.cpp" />
<ClCompile Include="dialog\d_sound.cpp" />
<ClCompile Include="dialog\d_soundlog.cpp" />
<ClCompile Include="dialog\d_txt.cpp" />
<ClCompile Include="dialog\d_wab.cpp" />
<ClCompile Include="dialog\np2class.cpp" />
<ClCompile Include="dialog\winfiledlg.c" />
<ClCompile Include="dosio.cpp" />
<ClCompile Include="ext\c86ctl\c86ctlif.cpp" />
<ClCompile Include="ext\externalchipmanager.cpp" />
<ClCompile Include="ext\externalopl3.cpp" />
<ClCompile Include="ext\externalopm.cpp" />
<ClCompile Include="ext\externalopna.cpp" />
<ClCompile Include="ext\externalpsg.cpp" />
<ClCompile Include="ext\mt32snd.cpp" />
<ClCompile Include="ext\opl3.cpp" />
<ClCompile Include="ext\opna.cpp" />
<ClCompile Include="ext\romeo\juliet.cpp" />
<ClCompile Include="ext\scci\scciif.cpp" />
<ClCompile Include="fontmng.cpp" />
<ClCompile Include="ini.cpp" />
<ClCompile Include="joymng.cpp" />
<ClCompile Include="menu.cpp" />
<ClCompile Include="misc\DlgProc.cpp" />
<ClCompile Include="misc\extrom.cpp" />
<ClCompile Include="misc\PropProc.cpp" />
<ClCompile Include="misc\threadbase.cpp" />
<ClCompile Include="misc\tickcounter.cpp" />
<ClCompile Include="misc\trace.cpp" />
<ClCompile Include="misc\tstring.cpp" />
<ClCompile Include="misc\WndProc.cpp" />
<ClCompile Include="mousemng.cpp" />
<ClCompile Include="np2.cpp" />
<ClCompile Include="np2arg.cpp" />
<ClCompile Include="oemtext.cpp" />
<ClCompile Include="recvideo.cpp" />
<ClCompile Include="scrnmng.cpp" />
<ClCompile Include="scrnmng_d3d.cpp" />
<ClCompile Include="scrnmng_dd.cpp" />
<ClCompile Include="soundmng.cpp" />
<ClCompile Include="soundmng\asio\asiodriverlist.cpp" />
<ClCompile Include="soundmng\sdasio.cpp" />
<ClCompile Include="soundmng\sddsound3.cpp" />
<ClCompile Include="soundmng\sdwasapi.cpp" />
<ClCompile Include="sstp.cpp" />
<ClCompile Include="sstpmsg.cpp" />
<ClCompile Include="subwnd\dclock.cpp" />
<ClCompile Include="subwnd\dd2.cpp" />
<ClCompile Include="subwnd\kdispwnd.cpp" />
<ClCompile Include="subwnd\mdbgwnd.cpp" />
<ClCompile Include="subwnd\skbdwnd.cpp" />
<ClCompile Include="subwnd\subwnd.cpp" />
<ClCompile Include="subwnd\toolwnd.cpp" />
<ClCompile Include="sysmng.cpp" />
<ClCompile Include="taskmng.cpp" />
<ClCompile Include="timemng.cpp" />
<ClCompile Include="winkbd.cpp" />
<ClCompile Include="winloc.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\bios\bios.h" />
<ClInclude Include="..\bios\biosmem.h" />
<ClInclude Include="..\bios\fdfmt.h" />
<ClInclude Include="..\bios\rsbios.h" />
<ClInclude Include="..\bios\sxsibios.h" />
<ClInclude Include="..\calendar.h" />
<ClInclude Include="..\cbus\amd98.h" />
<ClInclude Include="..\cbus\atapicmd.h" />
<ClInclude Include="..\cbus\board118.h" />
<ClInclude Include="..\cbus\board14.h" />
<ClInclude Include="..\cbus\board26k.h" />
<ClInclude Include="..\cbus\board86.h" />
<ClInclude Include="..\cbus\boardlol.h" />
<ClInclude Include="..\cbus\boardmo.h" />
<ClInclude Include="..\cbus\boardpx.h" />
<ClInclude Include="..\cbus\boardsb16.h" />
<ClInclude Include="..\cbus\boardso.h" />
<ClInclude Include="..\cbus\boardspb.h" />
<ClInclude Include="..\cbus\boardx2.h" />
<ClInclude Include="..\cbus\cbuscore.h" />
<ClInclude Include="..\cbus\cs4231io.h" />
<ClInclude Include="..\cbus\ct1741io.h" />
<ClInclude Include="..\cbus\ct1745io.h" />
<ClInclude Include="..\cbus\gpibio.h" />
<ClInclude Include="..\cbus\ideio.h" />
<ClInclude Include="..\cbus\mpu98ii.h" />
<ClInclude Include="..\cbus\pc9861k.h" />
<ClInclude Include="..\cbus\pcm86io.h" />
<ClInclude Include="..\cbus\sasiio.h" />
<ClInclude Include="..\cbus\scsicmd.h" />
<ClInclude Include="..\cbus\scsiio.h" />
<ClInclude Include="..\cbus\smpu98.h" />
<ClInclude Include="..\codecnv\codecnv.h" />
<ClInclude Include="..\common.h" />
<ClInclude Include="..\common\bmpdata.h" />
<ClInclude Include="..\common\lstarray.h" />
<ClInclude Include="..\common\milstr.h" />
<ClInclude Include="..\common\mimpidef.h" />
<ClInclude Include="..\common\parts.h" />
<ClInclude Include="..\common\profile.h" />
<ClInclude Include="..\common\rect.h" />
<ClInclude Include="..\common\resize.h" />
<ClInclude Include="..\common\strres.h" />
<ClInclude Include="..\common\textfile.h" />
<ClInclude Include="..\common\wavefile.h" />
<ClInclude Include="..\common\_memory.h" />
<ClInclude Include="..\debugsub.h" />
<ClInclude Include="..\diskimage\cddfile.h" />
<ClInclude Include="..\diskimage\cd\cdd_ccd.h" />
<ClInclude Include="..\diskimage\cd\cdd_cue.h" />
<ClInclude Include="..\diskimage\cd\cdd_iso.h" />
<ClInclude Include="..\diskimage\cd\cdd_mds.h" />
<ClInclude Include="..\diskimage\cd\cdd_nrg.h" />
<ClInclude Include="..\diskimage\cd\cdd_real.h" />
<ClInclude Include="..\diskimage\fddfile.h" />
<ClInclude Include="..\diskimage\fd\fdd_bkdsk.h" />
<ClInclude Include="..\diskimage\fd\fdd_d88.h" />
<ClInclude Include="..\diskimage\fd\fdd_dcp.h" />
<ClInclude Include="..\diskimage\fd\fdd_head_d88.h" />
<ClInclude Include="..\diskimage\fd\fdd_head_dcp.h" />
<ClInclude Include="..\diskimage\fd\fdd_head_nfd.h" />
<ClInclude Include="..\diskimage\fd\fdd_head_vfdd.h" />
<ClInclude Include="..\diskimage\fd\fdd_nfd.h" />
<ClInclude Include="..\diskimage\fd\fdd_vfdd.h" />
<ClInclude Include="..\diskimage\fd\fdd_xdf.h" />
<ClInclude Include="..\diskimage\img_common.h" />
<ClInclude Include="..\diskimage\img_strres.h" />
<ClInclude Include="..\fdd\d88head.h" />
<ClInclude Include="..\fdd\diskdrv.h" />
<ClInclude Include="..\fdd\fdd_mtr.h" />
<ClInclude Include="..\fdd\hdd_vhd.h" />
<ClInclude Include="..\fdd\hdd_vpc.h" />
<ClInclude Include="..\fdd\newdisk.h" />
<ClInclude Include="..\fdd\sxsi.h" />
<ClInclude Include="..\fdd\sxsicd.h" />
<ClInclude Include="..\fdd\sxsihdd.h" />
<ClInclude Include="..\font\font.h" />
<ClInclude Include="..\font\fontdata.h" />
<ClInclude Include="..\font\fontmake.h" />
<ClInclude Include="..\generic\cmjasts.h" />
<ClInclude Include="..\generic\cmndraw.h" />
<ClInclude Include="..\generic\dipswbmp.h" />
<ClInclude Include="..\generic\hostdrv.h" />
<ClInclude Include="..\generic\hostdrvs.h" />
<ClInclude Include="..\generic\keydisp.h" />
<ClInclude Include="..\generic\np2info.h" />
<ClInclude Include="..\generic\softkbd.h" />
<ClInclude Include="..\generic\unasm.h" />
<ClInclude Include="..\i286c\cpucore.h" />
<ClInclude Include="..\i286c\cpumem.h" />
<ClInclude Include="..\i286c\i286c.h" />
<ClInclude Include="..\i286c\v30patch.h" />
<ClInclude Include="..\io\artic.h" />
<ClInclude Include="..\io\cgrom.h" />
<ClInclude Include="..\io\cpuio.h" />
<ClInclude Include="..\io\crtc.h" />
<ClInclude Include="..\io\dipsw.h" />
<ClInclude Include="..\io\dmac.h" />
<ClInclude Include="..\io\egc.h" />
<ClInclude Include="..\io\emsio.h" />
<ClInclude Include="..\io\epsonio.h" />
<ClInclude Include="..\io\fdc.h" />
<ClInclude Include="..\io\fdd320.h" />
<ClInclude Include="..\io\gdc.h" />
<ClInclude Include="..\io\gdc_cmd.h" />
<ClInclude Include="..\io\gdc_pset.h" />
<ClInclude Include="..\io\gdc_sub.h" />
<ClInclude Include="..\io\iocore.h" />
<ClInclude Include="..\io\lsidef.h" />
<ClInclude Include="..\io\mouseif.h" />
<ClInclude Include="..\io\necio.h" />
<ClInclude Include="..\io\nmiio.h" />
<ClInclude Include="..\io\np2sysp.h" />
<ClInclude Include="..\io\pcidev.h" />
<ClInclude Include="..\io\pci\98graphbridge.h" />
<ClInclude Include="..\io\pci\cbusbridge.h" />
<ClInclude Include="..\io\pegc.h" />
<ClInclude Include="..\io\pic.h" />
<ClInclude Include="..\io\pit.h" />
<ClInclude Include="..\io\printif.h" />
<ClInclude Include="..\io\serial.h" />
<ClInclude Include="..\io\sysport.h" />
<ClInclude Include="..\io\upd4990.h" />
<ClInclude Include="..\keystat.h" />
<ClInclude Include="..\lio\lio.h" />
<ClInclude Include="..\mem\dmav30.h" />
<ClInclude Include="..\mem\dmax86.h" />
<ClInclude Include="..\mem\memegc.h" />
<ClInclude Include="..\mem\memems.h" />
<ClInclude Include="..\mem\memepp.h" />
<ClInclude Include="..\mem\memtram.h" />
<ClInclude Include="..\mem\memvga.h" />
<ClInclude Include="..\mem\memvram.h" />
<ClInclude Include="..\network\lgy98.h" />
<ClInclude Include="..\network\lgy98dev.h" />
<ClInclude Include="..\network\net.h" />
<ClInclude Include="..\nevent.h" />
<ClInclude Include="..\np2_thread.h" />
<ClInclude Include="..\np2_tickcount.h" />
<ClInclude Include="..\np2ver.h" />
<ClInclude Include="..\pccore.h" />
<ClInclude Include="..\sound\adpcm.h" />
<ClInclude Include="..\sound\beep.h" />
<ClInclude Include="..\sound\cs4231.h" />
<ClInclude Include="..\sound\fmboard.h" />
<ClInclude Include="..\sound\fmgen\fmgen_diag.h" />
<ClInclude Include="..\sound\fmgen\fmgen_file.h" />
<ClInclude Include="..\sound\fmgen\fmgen_fmgen.h" />
<ClInclude Include="..\sound\fmgen\fmgen_fmgeninl.h" />
<ClInclude Include="..\sound\fmgen\fmgen_fmgwrap.h" />
<ClInclude Include="..\sound\fmgen\fmgen_fmtimer.h" />
<ClInclude Include="..\sound\fmgen\fmgen_headers.h" />
<ClInclude Include="..\sound\fmgen\fmgen_misc.h" />
<ClInclude Include="..\sound\fmgen\fmgen_opm.h" />
<ClInclude Include="..\sound\fmgen\fmgen_opna.h" />
<ClInclude Include="..\sound\fmgen\fmgen_psg.h" />
<ClInclude Include="..\sound\fmgen\fmgen_types.h" />
<ClInclude Include="..\sound\getsnd\getsnd.h" />
<ClInclude Include="..\sound\mame\driver.h" />
<ClInclude Include="..\sound\mame\fm.h" />
<ClInclude Include="..\sound\mame\fmopl.h" />
<ClInclude Include="..\sound\mame\ymdeltat.h" />
<ClInclude Include="..\sound\mame\ymf262.h" />
<ClInclude Include="..\sound\opl3.h" />
<ClInclude Include="..\sound\oplgen.h" />
<ClInclude Include="..\sound\oplgencfg.h" />
<ClInclude Include="..\sound\opna.h" />
<ClInclude Include="..\sound\opngen.h" />
<ClInclude Include="..\sound\opngencfg.h" />
<ClInclude Include="..\sound\opntimer.h" />
<ClInclude Include="..\sound\pcm86.h" />
<ClInclude Include="..\sound\pcmmix.h" />
<ClInclude Include="..\sound\psggen.h" />
<ClInclude Include="..\sound\rhythm.h" />
<ClInclude Include="..\sound\s98.h" />
<ClInclude Include="..\sound\sndcsec.h" />
<ClInclude Include="..\sound\sound.h" />
<ClInclude Include="..\sound\soundrom.h" />
<ClInclude Include="..\sound\tms3631.h" />
<ClInclude Include="..\sound\vermouth\midimod.h" />
<ClInclude Include="..\sound\vermouth\midinst.h" />
<ClInclude Include="..\sound\vermouth\midiout.h" />
<ClInclude Include="..\sound\vermouth\midtable.h" />
<ClInclude Include="..\sound\vermouth\midvoice.h" />
<ClInclude Include="..\sound\vermouth\vermouth.h" />
<ClInclude Include="..\statsave.h" />
<ClInclude Include="..\timing.h" />
<ClInclude Include="..\trap\inttrap.h" />
<ClInclude Include="..\trap\steptrap.h" />
<ClInclude Include="..\vram\dispsync.h" />
<ClInclude Include="..\vram\makegrex.h" />
<ClInclude Include="..\vram\makegrph.h" />
<ClInclude Include="..\vram\maketext.h" />
<ClInclude Include="..\vram\maketgrp.h" />
<ClInclude Include="..\vram\palettes.h" />
<ClInclude Include="..\vram\scrndraw.h" />
<ClInclude Include="..\vram\scrnsave.h" />
<ClInclude Include="..\vram\sdraw.h" />
<ClInclude Include="..\vram\vram.h" />
<ClInclude Include="commng.h" />
<ClInclude Include="commng\cmbase.h" />
<ClInclude Include="commng\cmmidi.h" />
<ClInclude Include="commng\cmmidiin32.h" />
<ClInclude Include="commng\cmmidiout.h" />
<ClInclude Include="commng\cmmidiout32.h" />
<ClInclude Include="commng\cmmidioutmt32sound.h" />
<ClInclude Include="commng\cmmidioutvermouth.h" />
<ClInclude Include="commng\cmmidioutvst.h" />
<ClInclude Include="commng\cmnull.h" />
<ClInclude Include="commng\cmpara.h" />
<ClInclude Include="commng\cmpipe.h" />
<ClInclude Include="commng\cmserial.h" />
<ClInclude Include="commng\cmwacom.h" />
<ClInclude Include="commng\vsthost\vstbuffer.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="commng\vsthost\vsteditwnd.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="commng\vsthost\vsteditwndbase.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="commng\vsthost\vsteffect.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="commng\vsthost\vstmidievent.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="commng\wintab\MSGPACK.H" />
<ClInclude Include="commng\wintab\PKTDEF.H" />
<ClInclude Include="commng\wintab\Utils.h" />
<ClInclude Include="commng\wintab\WINTAB.H" />
<ClInclude Include="compiler.h" />
<ClInclude Include="debuguty\view1mb.h" />
<ClInclude Include="debuguty\viewasm.h" />
<ClInclude Include="debuguty\viewer.h" />
<ClInclude Include="debuguty\viewitem.h" />
<ClInclude Include="debuguty\viewmem.h" />
<ClInclude Include="debuguty\viewreg.h" />
<ClInclude Include="debuguty\viewseg.h" />
<ClInclude Include="debuguty\viewsnd.h" />
<ClInclude Include="dialog\c_combodata.h" />
<ClInclude Include="dialog\c_dipsw.h" />
<ClInclude Include="dialog\c_midi.h" />
<ClInclude Include="dialog\c_slidervalue.h" />
<ClInclude Include="dialog\dialog.h" />
<ClInclude Include="dialog\np2class.h" />
<ClInclude Include="dialog\winfiledlg.h" />
<ClInclude Include="dosio.h" />
<ClInclude Include="ext\c86ctl\c86ctl.h" />
<ClInclude Include="ext\c86ctl\c86ctlif.h" />
<ClInclude Include="ext\c86ctl\cbus_boardtype.h" />
<ClInclude Include="ext\externalchip.h" />
<ClInclude Include="ext\externalchipmanager.h" />
<ClInclude Include="ext\externalopl3.h" />
<ClInclude Include="ext\externalopm.h" />
<ClInclude Include="ext\externalopna.h" />
<ClInclude Include="ext\externalpsg.h" />
<ClInclude Include="ext\mt32snd.h" />
<ClInclude Include="ext\romeo\juliet.h" />
<ClInclude Include="ext\romeo\romeo.h" />
<ClInclude Include="ext\scci\scci.h" />
<ClInclude Include="ext\scci\SCCIDefines.h" />
<ClInclude Include="ext\scci\scciif.h" />
<ClInclude Include="fontmng.h" />
<ClInclude Include="ini.h" />
<ClInclude Include="joymng.h" />
<ClInclude Include="menu.h" />
<ClInclude Include="misc\DlgProc.h" />
<ClInclude Include="misc\extrom.h" />
<ClInclude Include="misc\guard.h" />
<ClInclude Include="misc\PropProc.h" />
<ClInclude Include="misc\threadbase.h" />
<ClInclude Include="misc\tickcounter.h" />
<ClInclude Include="misc\trace.h" />
<ClInclude Include="misc\tstring.h" />
<ClInclude Include="misc\vc6macros.h" />
<ClInclude Include="misc\WndBase.h" />
<ClInclude Include="misc\WndProc.h" />
<ClInclude Include="mousemng.h" />
<ClInclude Include="np2.h" />
<ClInclude Include="np2arg.h" />
<ClInclude Include="np2_git_version.h" />
<ClInclude Include="oemtext.h" />
<ClInclude Include="recvideo.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="scrnmng.h" />
<ClInclude Include="scrnmng_d3d.h" />
<ClInclude Include="scrnmng_dd.h" />
<ClInclude Include="soundmng.h" />
<ClInclude Include="soundmng\asio\asiodriverlist.h" />
<ClInclude Include="soundmng\asio\asiosdk.h" />
<ClInclude Include="soundmng\sdasio.h" />
<ClInclude Include="soundmng\sdbase.h" />
<ClInclude Include="soundmng\sddsound3.h" />
<ClInclude Include="soundmng\sdwasapi.h" />
<ClInclude Include="sstp.h" />
<ClInclude Include="sstpmsg.h" />
<ClInclude Include="sstpres.h" />
<ClInclude Include="subwnd\dclock.h" />
<ClInclude Include="subwnd\dd2.h" />
<ClInclude Include="subwnd\kdispwnd.h" />
<ClInclude Include="subwnd\mdbgwnd.h" />
<ClInclude Include="subwnd\skbdwnd.h" />
<ClInclude Include="subwnd\subwnd.h" />
<ClInclude Include="subwnd\toolwnd.h" />
<ClInclude Include="sysmng.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="taskmng.h" />
<ClInclude Include="timemng.h" />
<ClInclude Include="winkbd.h" />
<ClInclude Include="winloc.h" />
<ClInclude Include="x86\cputype.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resources\1252\np2.rc" />
</ItemGroup>
<ItemGroup>
<None Include="..\i286c\i286c.mcr" />
<None Include="..\i286c\i286c_sf.mcr" />
<None Include="..\i286c\x64\cpucore.inc" />
<None Include="..\i286c\x86\cpucore.inc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="x86\vs2019\x86.targets" />
<Import Project="x64\vs2019\x64.targets" />
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +0,0 @@
Param (
[String]$Namespace,
[String]$Project,
[String]$GitRoot,
[String]$HeaderFile="np2_git_version.h",
[String]$VerPrefix="https://github.com/AZO234/NP2kai/commit/"
)
Push-Location -LiteralPath $GitRoot
$VerFileHead = "`#ifndef _NP2_VERGIT_H_`n`#define _NP2_VERGIT_H_`n`n"
$VerFileTail = "`n`#endif // _NP2_VERGIT_H_"
$VerBy = (git log -n 1 --format=format:"`#define VER_AUTHER `\`"%an `<%ae`>`\`"%n") | Out-String
$VerUrl = (git log -n 1 --format=format:"`#define VER_URL `\`"$VerPrefix%H`\`"%n") | Out-String
$VerDate = (git log -n 1 --format=format:"`#define VER_DATE `\`"%ai`\`"%n") | Out-String
$VerSubj = (git log -n 1 --format=format:"`#define VER_SUBJECT `\`"%f`\`"%n") | Out-String
$VerHash = ("`#define VER_HASH `"" + (git rev-parse HEAD) + "`"") | Out-String
$VerSHash = ("`#define VER_SHASH `"" + (git rev-parse --short HEAD) + "`"") | Out-String
$VerChgs = ((git ls-files --exclude-standard -d -m -o -k) | Measure-Object -Line).Lines
if ($VerChgs -gt 0) {
$VerDirty = "`#define VER_DIRTY TRUE`n"
$VerDStr = "#define VER_DSTR `"Dirty`"`n" | Out-String
} else {
$VerDirty = "`#define VER_DIRTY FALSE`n"
$VerDStr = "`#define VER_DSTR `"`"`n" | Out-String
}
"Written $Project\" + (
New-Item -Force -Path "$Project" -Name "$HeaderFile" -ItemType "file" -Value "$VerFileHead$VerUrl$VerDate$VerSubj$VerBy$VerHash$VerSHash$VerDirty$VerDStr$VerFileTail"
).Name + " as:"
""
Get-Content "$Project\$HeaderFile"
""

View File

@ -1,764 +0,0 @@
GIT_VERSION := "$(shell git rev-parse --short HEAD)"
real_topsrcdir= $(top_srcdir)/..
dist_pkgdata_DATA= $(real_topsrcdir)/x11/resources/fddseek.wav \
$(real_topsrcdir)/x11/resources/fddseek1.wav \
$(real_topsrcdir)/x11/resources/relay1.wav
dist_pkgdata_DATA+= $(real_topsrcdir)/np2tool/np2tool.d88
#EMUFM_SOURCES= $(real_topsrcdir)/sound/opl3.c \
# $(real_topsrcdir)/sound/opna.c
# CAVEAT:
# sccisoundinterfacemanager.cpp must be linked before externalchipmanager.cpp.
# Otherwise, it will take the curse of destructor calls the order of the
# global instances.
EXTFM_SOURCES= $(real_topsrcdir)/x11/ext/opl3.cpp \
$(real_topsrcdir)/x11/ext/opna.cpp \
$(real_topsrcdir)/x11/ext/c86ctl/c86ctlc86box.cpp \
$(real_topsrcdir)/x11/ext/c86ctl/c86ctlgimic.cpp \
$(real_topsrcdir)/x11/ext/c86ctl/c86ctlif.cpp \
$(real_topsrcdir)/x11/ext/c86ctl/c86ctlrealchipbase.cpp \
$(real_topsrcdir)/x11/ext/scci/scciif.cpp \
$(real_topsrcdir)/x11/ext/scci/sccisoundchip.cpp \
$(real_topsrcdir)/x11/ext/scci/sccisoundinterface.cpp \
$(real_topsrcdir)/x11/ext/scci/sccisoundinterfacemanager.cpp \
$(real_topsrcdir)/x11/ext/scci/sccispfmlight.cpp \
$(real_topsrcdir)/x11/ext/externalchipmanager.cpp \
$(real_topsrcdir)/x11/ext/externalopl3.cpp \
$(real_topsrcdir)/x11/ext/externalopm.cpp \
$(real_topsrcdir)/x11/ext/externalopna.cpp \
$(real_topsrcdir)/x11/ext/externalpsg.cpp
COMMON_SOURCES= $(real_topsrcdir)/x11/main.c \
$(real_topsrcdir)/x11/np2.c \
$(real_topsrcdir)/x11/dosio.c \
$(real_topsrcdir)/x11/ini.c \
$(real_topsrcdir)/x11/oemtext.c \
$(real_topsrcdir)/x11/trace.c \
$(real_topsrcdir)/x11/kdispwin.c \
$(real_topsrcdir)/x11/skbdwin.c \
$(real_topsrcdir)/x11/cmmidi.c \
$(real_topsrcdir)/x11/cmserial.c \
$(real_topsrcdir)/x11/drawmng.c \
$(real_topsrcdir)/x11/fontmng.c \
$(real_topsrcdir)/x11/kbdmng.c \
$(real_topsrcdir)/x11/commng.c \
$(real_topsrcdir)/x11/joymng.c \
$(real_topsrcdir)/x11/soundmng.c \
$(real_topsrcdir)/x11/sysmng.c \
$(real_topsrcdir)/x11/taskmng.c \
$(real_topsrcdir)/x11/timemng.c \
$(real_topsrcdir)/x11/gtk2/dialog_about.c \
$(real_topsrcdir)/x11/gtk2/dialog_calendar.c \
$(real_topsrcdir)/x11/gtk2/dialog_config.c \
$(real_topsrcdir)/x11/gtk2/dialog_hostdrv.c \
$(real_topsrcdir)/x11/gtk2/dialog_ide.c \
$(real_topsrcdir)/x11/gtk2/dialog_midi.c \
$(real_topsrcdir)/x11/gtk2/dialog_network.c \
$(real_topsrcdir)/x11/gtk2/dialog_newdisk.c \
$(real_topsrcdir)/x11/gtk2/dialog_pci.c \
$(real_topsrcdir)/x11/gtk2/dialog_screen.c \
$(real_topsrcdir)/x11/gtk2/dialog_serial.c \
$(real_topsrcdir)/x11/gtk2/dialog_sound.c \
$(real_topsrcdir)/x11/gtk2/dialog_wab.c \
$(real_topsrcdir)/x11/gtk2/window_keydisp.c \
$(real_topsrcdir)/x11/gtk2/window_softkbd.c \
$(real_topsrcdir)/x11/gtk2/gtk_drawmng.c \
$(real_topsrcdir)/x11/gtk2/gtk_screen.c \
$(real_topsrcdir)/x11/gtk2/gtk_keyboard.c \
$(real_topsrcdir)/x11/gtk2/gtk_menu.c \
$(real_topsrcdir)/x11/gtk2/gtk_mouse.c \
$(real_topsrcdir)/x11/gtk2/gtk_main.c \
$(real_topsrcdir)/x11/gtk2/gtk_wrapper.c \
$(real_topsrcdir)/x11/debug/viewmem.c \
$(real_topsrcdir)/x11/misc/threadbase.cpp \
$(real_topsrcdir)/x11/misc/tty.cpp \
$(real_topsrcdir)/x11/misc/usbdev.cpp \
\
$(EXTFM_SOURCES) \
\
$(real_topsrcdir)/pccore.c \
$(real_topsrcdir)/nevent.c \
$(real_topsrcdir)/calendar.c \
$(real_topsrcdir)/timing.c \
$(real_topsrcdir)/statsave.c \
$(real_topsrcdir)/keystat.c \
$(real_topsrcdir)/np2_thread.c \
$(real_topsrcdir)/np2_tickcount.c \
\
$(real_topsrcdir)/common/strres.c \
$(real_topsrcdir)/common/milstr.c \
$(real_topsrcdir)/common/_memory.c \
$(real_topsrcdir)/common/textfile.c \
$(real_topsrcdir)/common/profile.c \
$(real_topsrcdir)/common/rect.c \
$(real_topsrcdir)/common/lstarray.c \
$(real_topsrcdir)/common/bmpdata.c \
$(real_topsrcdir)/common/mimpidef.c \
$(real_topsrcdir)/common/parts.c \
$(real_topsrcdir)/common/wavefile.c \
\
$(real_topsrcdir)/codecnv/eucsjis.c \
$(real_topsrcdir)/codecnv/eucucs2.c \
$(real_topsrcdir)/codecnv/jisucs2.c \
$(real_topsrcdir)/codecnv/sjiseuc.c \
$(real_topsrcdir)/codecnv/sjisucs2.c \
$(real_topsrcdir)/codecnv/tcswap16.c \
$(real_topsrcdir)/codecnv/tcswap32.c \
$(real_topsrcdir)/codecnv/textcnv.c \
$(real_topsrcdir)/codecnv/ucs2sjis.c \
$(real_topsrcdir)/codecnv/ucs2ucs4.c \
$(real_topsrcdir)/codecnv/ucs2utf8.c \
$(real_topsrcdir)/codecnv/ucs4ucs2.c \
$(real_topsrcdir)/codecnv/ucs4utf8.c \
$(real_topsrcdir)/codecnv/utf8ucs2.c \
$(real_topsrcdir)/codecnv/utf8ucs4.c \
\
$(real_topsrcdir)/bios/bios.c \
$(real_topsrcdir)/bios/bios09.c \
$(real_topsrcdir)/bios/bios0c.c \
$(real_topsrcdir)/bios/bios12.c \
$(real_topsrcdir)/bios/bios13.c \
$(real_topsrcdir)/bios/bios18.c \
$(real_topsrcdir)/bios/bios19.c \
$(real_topsrcdir)/bios/bios1a.c \
$(real_topsrcdir)/bios/bios1b.c \
$(real_topsrcdir)/bios/bios1c.c \
$(real_topsrcdir)/bios/bios1f.c \
$(real_topsrcdir)/bios/sxsibios.c \
\
$(real_topsrcdir)/cbus/cbuscore.c \
$(real_topsrcdir)/cbus/pc9861k.c \
$(real_topsrcdir)/cbus/mpu98ii.c \
$(real_topsrcdir)/cbus/amd98.c \
$(real_topsrcdir)/cbus/board118.c \
$(real_topsrcdir)/cbus/board14.c \
$(real_topsrcdir)/cbus/board26k.c \
$(real_topsrcdir)/cbus/board86.c \
$(real_topsrcdir)/cbus/boardpx.c \
$(real_topsrcdir)/cbus/boardsb16.c \
$(real_topsrcdir)/cbus/boardso.c \
$(real_topsrcdir)/cbus/boardlol.c \
$(real_topsrcdir)/cbus/boardmo.c \
$(real_topsrcdir)/cbus/boardspb.c \
$(real_topsrcdir)/cbus/boardx2.c \
$(real_topsrcdir)/cbus/cs4231io.c \
$(real_topsrcdir)/cbus/ct1741io.c \
$(real_topsrcdir)/cbus/ct1745io.c \
$(real_topsrcdir)/cbus/gpibio.c \
$(real_topsrcdir)/cbus/pcm86io.c \
$(real_topsrcdir)/cbus/sasiio.c \
$(real_topsrcdir)/cbus/scsiio.c \
$(real_topsrcdir)/cbus/scsicmd.c \
$(real_topsrcdir)/cbus/ideio.c \
$(real_topsrcdir)/cbus/atapicmd.c \
$(real_topsrcdir)/cbus/smpu98.c \
\
$(real_topsrcdir)/fdd/diskdrv.c \
$(real_topsrcdir)/fdd/newdisk.c \
$(real_topsrcdir)/fdd/fdd_mtr.c \
$(real_topsrcdir)/fdd/sxsi.c \
$(real_topsrcdir)/fdd/sxsihdd.c \
$(real_topsrcdir)/fdd/sxsicd.c \
$(real_topsrcdir)/fdd/sxsihdd_nvl.c \
\
$(real_topsrcdir)/font/font.c \
$(real_topsrcdir)/font/fontdata.c \
$(real_topsrcdir)/font/fontmake.c \
$(real_topsrcdir)/font/fontpc88.c \
$(real_topsrcdir)/font/fontpc98.c \
$(real_topsrcdir)/font/fontv98.c \
$(real_topsrcdir)/font/fontfm7.c \
$(real_topsrcdir)/font/fontx1.c \
$(real_topsrcdir)/font/fontx68k.c \
\
$(real_topsrcdir)/generic/cmndraw.c \
$(real_topsrcdir)/generic/keydisp.c \
$(real_topsrcdir)/generic/cmjasts.c \
$(real_topsrcdir)/generic/hostdrv.c \
$(real_topsrcdir)/generic/hostdrvs.c \
$(real_topsrcdir)/generic/unasm.c \
$(real_topsrcdir)/generic/np2info.c \
$(real_topsrcdir)/generic/memdbg32.c \
$(real_topsrcdir)/generic/softkbd.c \
\
$(real_topsrcdir)/io/iocore.c \
$(real_topsrcdir)/io/artic.c \
$(real_topsrcdir)/io/bmsio.c \
$(real_topsrcdir)/io/cgrom.c \
$(real_topsrcdir)/io/cpuio.c \
$(real_topsrcdir)/io/crtc.c \
$(real_topsrcdir)/io/dipsw.c \
$(real_topsrcdir)/io/dmac.c \
$(real_topsrcdir)/io/egc.c \
$(real_topsrcdir)/io/emsio.c \
$(real_topsrcdir)/io/fdc.c \
$(real_topsrcdir)/io/fdd320.c \
$(real_topsrcdir)/io/gdc.c \
$(real_topsrcdir)/io/gdc_sub.c \
$(real_topsrcdir)/io/gdc_pset.c \
$(real_topsrcdir)/io/mouseif.c \
$(real_topsrcdir)/io/nmiio.c \
$(real_topsrcdir)/io/np2sysp.c \
$(real_topsrcdir)/io/pic.c \
$(real_topsrcdir)/io/pit.c \
$(real_topsrcdir)/io/printif.c \
$(real_topsrcdir)/io/serial.c \
$(real_topsrcdir)/io/sysport.c \
$(real_topsrcdir)/io/upd4990.c \
$(real_topsrcdir)/io/necio.c \
$(real_topsrcdir)/io/epsonio.c \
$(real_topsrcdir)/io/pcidev.c \
$(real_topsrcdir)/io/pegc.c \
$(real_topsrcdir)/io/pci/98graphbridge.c \
$(real_topsrcdir)/io/pci/cbusbridge.c \
\
$(real_topsrcdir)/lio/lio.c \
$(real_topsrcdir)/lio/gscreen.c \
$(real_topsrcdir)/lio/gpset.c \
$(real_topsrcdir)/lio/gline.c \
$(real_topsrcdir)/lio/gcircle.c \
$(real_topsrcdir)/lio/gput1.c \
\
$(real_topsrcdir)/mem/dmav30.c \
$(real_topsrcdir)/mem/dmax86.c \
$(real_topsrcdir)/mem/memegc.c \
$(real_topsrcdir)/mem/memems.c \
$(real_topsrcdir)/mem/memepp.c \
$(real_topsrcdir)/mem/memtram.c \
$(real_topsrcdir)/mem/memvga.c \
$(real_topsrcdir)/mem/memvram.c \
\
$(real_topsrcdir)/sound/sound.c \
$(real_topsrcdir)/sound/soundrom.c \
$(real_topsrcdir)/sound/s98.c \
$(real_topsrcdir)/sound/adpcmc.c \
$(real_topsrcdir)/sound/adpcmg.c \
$(real_topsrcdir)/sound/beepc.c \
$(real_topsrcdir)/sound/beepg.c \
$(real_topsrcdir)/sound/cs4231c.c \
$(real_topsrcdir)/sound/cs4231g.c \
$(real_topsrcdir)/sound/fmboard.c \
$(real_topsrcdir)/sound/oplgenc.c \
$(real_topsrcdir)/sound/oplgeng.c \
$(real_topsrcdir)/sound/opngenc.c \
$(real_topsrcdir)/sound/opngeng.c \
$(real_topsrcdir)/sound/opntimer.c \
$(real_topsrcdir)/sound/pcm86c.c \
$(real_topsrcdir)/sound/pcm86g.c \
$(real_topsrcdir)/sound/pcmmix.c \
$(real_topsrcdir)/sound/psggenc.c \
$(real_topsrcdir)/sound/psggeng.c \
$(real_topsrcdir)/sound/rhythmc.c \
$(real_topsrcdir)/sound/sndcsec.c \
$(real_topsrcdir)/sound/tms3631c.c \
$(real_topsrcdir)/sound/tms3631g.c \
$(real_topsrcdir)/sound/getsnd/getsnd.c \
$(real_topsrcdir)/sound/getsnd/getsmix.c \
$(real_topsrcdir)/sound/getsnd/getmp3.c \
$(real_topsrcdir)/sound/getsnd/getogg.c \
$(real_topsrcdir)/sound/getsnd/getwave.c \
$(real_topsrcdir)/sound/vermouth/midiout.c \
$(real_topsrcdir)/sound/vermouth/midimod.c \
$(real_topsrcdir)/sound/vermouth/midinst.c \
$(real_topsrcdir)/sound/vermouth/midvoice.c \
$(real_topsrcdir)/sound/vermouth/midtable.c \
$(real_topsrcdir)/sound/fmgen/fmgen_file.cpp \
$(real_topsrcdir)/sound/fmgen/fmgen_fmgen.cpp \
$(real_topsrcdir)/sound/fmgen/fmgen_fmgwrap.cpp \
$(real_topsrcdir)/sound/fmgen/fmgen_fmtimer.cpp \
$(real_topsrcdir)/sound/fmgen/fmgen_opm.cpp \
$(real_topsrcdir)/sound/fmgen/fmgen_opna.cpp \
$(real_topsrcdir)/sound/fmgen/fmgen_psg.cpp \
$(real_topsrcdir)/sound/mame/fmopl.c \
$(real_topsrcdir)/sound/mame/ymdeltat.c \
$(real_topsrcdir)/sound/mame/ymf262.c \
\
$(real_topsrcdir)/vram/vram.c \
$(real_topsrcdir)/vram/scrndraw.c \
$(real_topsrcdir)/vram/sdraw.c \
$(real_topsrcdir)/vram/dispsync.c \
$(real_topsrcdir)/vram/palettes.c \
$(real_topsrcdir)/vram/maketext.c \
$(real_topsrcdir)/vram/maketgrp.c \
$(real_topsrcdir)/vram/makegrph.c \
$(real_topsrcdir)/vram/makegrex.c \
$(real_topsrcdir)/vram/scrnsave.c \
\
$(real_topsrcdir)/diskimage/cd/cdd_ccd.c \
$(real_topsrcdir)/diskimage/cd/cdd_cue.c \
$(real_topsrcdir)/diskimage/cd/cdd_iso.c \
$(real_topsrcdir)/diskimage/cd/cdd_mds.c \
$(real_topsrcdir)/diskimage/cd/cdd_nrg.c \
$(real_topsrcdir)/diskimage/fd/fdd_bkdsk.c \
$(real_topsrcdir)/diskimage/fd/fdd_d88.c \
$(real_topsrcdir)/diskimage/fd/fdd_dcp.c \
$(real_topsrcdir)/diskimage/fd/fdd_nfd.c \
$(real_topsrcdir)/diskimage/fd/fdd_vfdd.c \
$(real_topsrcdir)/diskimage/fd/fdd_xdf.c \
$(real_topsrcdir)/diskimage/cddfile.c \
$(real_topsrcdir)/diskimage/fddfile.c \
$(real_topsrcdir)/diskimage/img_strres.c \
\
$(real_topsrcdir)/network/lgy98.c \
$(real_topsrcdir)/network/net.c \
\
$(real_topsrcdir)/wab/cirrus_vga.c \
$(real_topsrcdir)/wab/wab_rly.c \
$(real_topsrcdir)/wab/wab.c
AM_CPPFLAGS= -I$(real_topsrcdir) \
-I$(real_topsrcdir)/x11 \
-I$(real_topsrcdir)/x11/gtk2 \
-I$(real_topsrcdir)/x11/debug \
-I$(real_topsrcdir)/common \
-I$(real_topsrcdir)/cbus \
-I$(real_topsrcdir)/fdd \
-I$(real_topsrcdir)/generic \
-I$(real_topsrcdir)/io \
-I$(real_topsrcdir)/io/pci \
-I$(real_topsrcdir)/mem \
-I$(real_topsrcdir)/network \
-I$(real_topsrcdir)/sound \
-I$(real_topsrcdir)/sound/fmgen \
-I$(real_topsrcdir)/vram \
-I$(real_topsrcdir)/wab \
$(GTK_CFLAGS) $(GDK_CFLAGS) $(GDK_PIXBUF_CFLAGS) $(SDL_CFLAGS) $(LIBUSB1_CFLAGS) \
$(X11_CFLAGS) $(XEXT_CFLAGS) \
-DGIT_VERSION=\"$(GIT_VERSION)\" -DNP2_X -DSUPPORT_SDL_AUDIO -DSUPPORT_SDL_MIXER -DBIOS_IO_EMULATION -DOSLANG_UTF8 -DOSLINEBREAK_LF -DSOUND_CRITICAL -DSUPPORT_16BPP -DSUPPORT_24BPP -DSUPPORT_32BPP -DSUPPORT_8BPP -DSUPPORT_BMS -DSUPPORT_CL_GD5430 -DSUPPORT_CRT15KHZ -DSUPPORT_FAST_MEMORYCHECK -DSUPPORT_FMGEN -DSUPPORT_GPIB -DSUPPORT_HOSTDRV -DSUPPORT_HRTIMER -DSUPPORT_IDEIO -DSUPPORT_KAI_IMAGES -DSUPPORT_LARGE_HDD -DSUPPORT_LGY98 -DSUPPORT_NET -DSUPPORT_NORMALDISP -DSUPPORT_NVL_IMAGES -DSUPPORT_PC9861K -DSUPPORT_PX -DSUPPORT_RESUME -DSUPPORT_RS232C_FIFO -DSUPPORT_S98 -DSUPPORT_SCSI -DSUPPORT_SMPU98 -DSUPPORT_SOFTKBD=0 -DSUPPORT_SOUND_SB16 -DSUPPORT_SWSEEKSND -DSUPPORT_SWWABRLYSND -DSUPPORT_STATSAVE=10 -DSUPPORT_UTF8 -DSUPPORT_V30EXT -DSUPPORT_V30ORIGINAL -DSUPPORT_VPCVHD -DSUPPORT_WAB -DUSE_MAME -DVAEG_FIX -DVERMOUTH_LIB -DSUPPORT_ASYNC_CPU -DSUPPORT_NP2_THREAD -DNP2_THREAD_POSIX -DSUPPORT_NP2_TICKCOUNT -DUSE_RESOURCE_BMP
if BUILD_ALL
AM_CPPFLAGS+= -DX11_BUILD_ALL
endif
if HAVE_GCC
AM_CFLAGS= -fsigned-char
AM_CFLAGS+= -fno-strict-aliasing
AM_CXXFLAGS= $(AM_CFLAGS)
AM_CXXFLAGS+= -std=c++11
endif
LDADD= $(GTK_LIBS) $(GDK_LIBS) $(GDK_PIXBUF_LIBS) $(SDL_LIBS) $(LIBUSB1_LIBS) \
$(X11_LIBS) $(XEXT_LIBS) \
$(X_LIBS) $(X_PRE_LIBS) $(XLIB) $(X_EXTRA_LIBS) -ldl -lpthread
DEFS= @DEFS@ -DSYSRESPATH=\""$(pkgdatadir)"\"
I286C_SOURCES= $(real_topsrcdir)/i286c/i286c.c \
$(real_topsrcdir)/i286c/cpumem.c \
$(real_topsrcdir)/i286c/i286c_mn.c \
$(real_topsrcdir)/i286c/i286c_ea.c \
$(real_topsrcdir)/i286c/i286c_0f.c \
$(real_topsrcdir)/i286c/i286c_8x.c \
$(real_topsrcdir)/i286c/i286c_sf.c \
$(real_topsrcdir)/i286c/i286c_f6.c \
$(real_topsrcdir)/i286c/i286c_fe.c \
$(real_topsrcdir)/i286c/i286c_rp.c \
$(real_topsrcdir)/i286c/v30patch.c \
$(real_topsrcdir)/debugsub.c
I286C_CPPFLAGS= -I$(real_topsrcdir)/i286c
IA32_SOURCES= $(real_topsrcdir)/i386c/cpucore.c \
$(real_topsrcdir)/i386c/cpumem.c \
$(real_topsrcdir)/i386c/ia32/interface.c \
$(real_topsrcdir)/i386c/ia32/ia32.c \
$(real_topsrcdir)/i386c/ia32/cpu.c \
$(real_topsrcdir)/i386c/ia32/cpu_io.c \
$(real_topsrcdir)/i386c/ia32/cpu_mem.c \
$(real_topsrcdir)/i386c/ia32/ctrlxfer.c \
$(real_topsrcdir)/i386c/ia32/debug.c \
$(real_topsrcdir)/i386c/ia32/disasm.c \
$(real_topsrcdir)/i386c/ia32/exception.c \
$(real_topsrcdir)/i386c/ia32/groups.c \
$(real_topsrcdir)/i386c/ia32/inst_table.c \
$(real_topsrcdir)/i386c/ia32/paging.c \
$(real_topsrcdir)/i386c/ia32/resolve.c \
$(real_topsrcdir)/i386c/ia32/segments.c \
$(real_topsrcdir)/i386c/ia32/task.c \
$(real_topsrcdir)/i386c/ia32/instructions/bin_arith.c \
$(real_topsrcdir)/i386c/ia32/instructions/bit_byte.c \
$(real_topsrcdir)/i386c/ia32/instructions/ctrl_trans.c \
$(real_topsrcdir)/i386c/ia32/instructions/data_trans.c \
$(real_topsrcdir)/i386c/ia32/instructions/dec_arith.c \
$(real_topsrcdir)/i386c/ia32/instructions/flag_ctrl.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu.c \
$(real_topsrcdir)/i386c/ia32/instructions/logic_arith.c \
$(real_topsrcdir)/i386c/ia32/instructions/misc_inst.c \
$(real_topsrcdir)/i386c/ia32/instructions/seg_reg.c \
$(real_topsrcdir)/i386c/ia32/instructions/shift_rotate.c \
$(real_topsrcdir)/i386c/ia32/instructions/string_inst.c \
$(real_topsrcdir)/i386c/ia32/instructions/system_inst.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/fpdummy.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/fpemul_dosbox.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/fpemul_dosbox2.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/fpemul_softfloat.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_eq128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_le128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_lt128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shortShiftLeft128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shortShiftRight128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shortShiftRightJam64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shortShiftRightJam64Extra.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shortShiftRightJam128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shortShiftRightJam128Extra.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shiftRightJam32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shiftRightJam64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shiftRightJam64Extra.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shiftRightJam128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shiftRightJam128Extra.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_shiftRightJam256M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_countLeadingZeros8.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_countLeadingZeros16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_countLeadingZeros32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_countLeadingZeros64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_add128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_add256M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_sub128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_sub256M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_mul64ByShifted32To128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_mul64To128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_mul128By32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_mul128To256M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_approxRecip_1Ks.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_approxRecip32_1.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_approxRecipSqrt_1Ks.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_approxRecipSqrt32_1.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundToUI32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundToUI64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundToI32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundToI64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normSubnormalF16Sig.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundPackToF16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normRoundPackToF16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_addMagsF16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_subMagsF16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_mulAddF16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normSubnormalF32Sig.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundPackToF32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normRoundPackToF32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_addMagsF32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_subMagsF32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_mulAddF32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normSubnormalF64Sig.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundPackToF64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normRoundPackToF64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_addMagsF64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_subMagsF64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_mulAddF64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normSubnormalExtF80Sig.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundPackToExtF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normRoundPackToExtF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_addMagsExtF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_subMagsExtF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normSubnormalF128Sig.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_roundPackToF128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_normRoundPackToF128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_addMagsF128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_subMagsF128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_mulAddF128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/softfloat_state.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui32_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui32_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui32_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui32_to_extF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui32_to_extF80M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui32_to_f128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui32_to_f128M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui64_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui64_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui64_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui64_to_extF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui64_to_extF80M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui64_to_f128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/ui64_to_f128M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i32_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i32_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i32_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i32_to_extF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i32_to_extF80M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i32_to_f128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i32_to_f128M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i64_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i64_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i64_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i64_to_extF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i64_to_extF80M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i64_to_f128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/i64_to_f128M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_ui32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_ui64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_i32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_i64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_ui32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_ui64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_i32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_i64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_extF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_extF80M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_f128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_to_f128M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_roundToInt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_add.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_sub.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_mul.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_mulAdd.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_div.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_rem.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_sqrt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_eq.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_le.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_lt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_eq_signaling.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_le_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_lt_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f16_isSignalingNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_ui32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_ui64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_i32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_i64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_ui32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_ui64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_i32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_i64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_extF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_extF80M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_f128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_to_f128M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_roundToInt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_add.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_sub.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_mul.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_mulAdd.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_div.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_rem.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_sqrt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_eq.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_le.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_lt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_eq_signaling.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_le_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_lt_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f32_isSignalingNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_ui32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_ui64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_i32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_i64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_ui32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_ui64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_i32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_i64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_extF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_extF80M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_f128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_to_f128M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_roundToInt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_add.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_sub.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_mul.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_mulAdd.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_div.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_rem.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_sqrt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_eq.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_le.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_lt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_eq_signaling.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_le_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_lt_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f64_isSignalingNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_ui32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_ui64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_i32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_i64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_ui32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_ui64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_i32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_i64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_to_f128.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_roundToInt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_add.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_sub.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_mul.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_div.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_rem.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_sqrt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_eq.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_le.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_lt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_eq_signaling.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_le_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_lt_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80_isSignalingNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_ui32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_ui64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_i32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_i64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_ui32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_ui64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_i32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_i64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_to_f128M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_roundToInt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_add.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_sub.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_mul.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_div.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_rem.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_sqrt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_eq.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_le.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_lt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_eq_signaling.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_le_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_lt_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_ui32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_ui64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_i32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_i64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_ui32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_ui64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_i32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_i64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_extF80.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_roundToInt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_add.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_sub.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_mul.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_mulAdd.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_div.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_rem.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_sqrt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_eq.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_le.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_lt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_eq_signaling.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_le_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_lt_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128_isSignalingNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_ui32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_ui64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_i32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_i64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_ui32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_ui64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_i32_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_i64_r_minMag.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_f16.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_f32.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_extF80M.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_to_f64.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_roundToInt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_add.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_sub.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_mul.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_mulAdd.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_div.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_rem.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_sqrt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_eq.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_le.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_lt.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_eq_signaling.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_le_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_lt_quiet.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/softfloat_raiseFlags.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_f16UIToCommonNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_commonNaNToF16UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_propagateNaNF16UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_f32UIToCommonNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_commonNaNToF32UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_propagateNaNF32UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_f64UIToCommonNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_commonNaNToF64UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_propagateNaNF64UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/extF80M_isSignalingNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_extF80UIToCommonNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_commonNaNToExtF80UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_propagateNaNExtF80UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/f128M_isSignalingNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_f128UIToCommonNaN.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_commonNaNToF128UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat/s_propagateNaNF128UI.c \
$(real_topsrcdir)/i386c/ia32/instructions/mmx/3dnow.c \
$(real_topsrcdir)/i386c/ia32/instructions/mmx/mmx.c \
$(real_topsrcdir)/i386c/ia32/instructions/sse/sse.c \
$(real_topsrcdir)/i386c/ia32/instructions/sse2/sse2.c \
$(real_topsrcdir)/i386c/ia32/instructions/sse3/sse3.c \
$(real_topsrcdir)/debugsub386.c
IA32_CPPFLAGS= -I$(real_topsrcdir)/i386c \
-I$(real_topsrcdir)/i386c/ia32 \
-I$(real_topsrcdir)/i386c/ia32/instructions \
-I$(real_topsrcdir)/i386c/ia32/instructions/fpu \
-I$(real_topsrcdir)/i386c/ia32/instructions/fpu/softfloat \
-I$(real_topsrcdir)/i386c/ia32/instructions/mmx \
-I$(real_topsrcdir)/i386c/ia32/instructions/sse \
-I$(real_topsrcdir)/i386c/ia32/instructions/sse2 \
-I$(real_topsrcdir)/i386c/ia32/instructions/sse3 \
-DCPUCORE_IA32 -DIA32_PAGING_EACHSIZE -DIA32_REBOOT_ON_PANIC -DSUPPORT_CRT31KHZ -DSUPPORT_FPU_DOSBOX -DSUPPORT_FPU_DOSBOX2 -DSUPPORT_FPU_SOFTFLOAT -DSUPPORT_GAMEPORT -DSUPPORT_MEMDBG32 -DSUPPORT_LARGE_MEMORY -DSUPPORT_PC9801_119 -DSUPPORT_PC9821 -DSUPPORT_PCI -DSUPPORT_PEGC -DSUPPORT_SOUND_SB16 -DSUPPORT_VGA_MODEX -DUSE_3DNOW -DUSE_FASTPAGING -DUSE_FPU -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -DUSE_SSE3 -DUSE_TSC -DUSE_VME
HAXM_SOURCES= $(real_topsrcdir)/i386hax/haxcore.c \
$(real_topsrcdir)/i386hax/haxfunc.c
HAXM_CPPFLAGS= -I$(real_topsrcdir)/i386hax -DSUPPORT_IA32_HAXM -DUSE_CUSTOM_HOOKINST
if BUILD_ALL
bin_PROGRAMS= xnp2kai xnp21kai xnp21kai_haxm
nodist_man1_MANS= xnp2kai.1 xnp2kai.1j xnp21kai.1 xnp21kai.1j
xnp21kai_haxm_SOURCES= $(COMMON_SOURCES) $(IA32_SOURCES) $(HAXM_SOURCES)
xnp21kai_haxm_CPPFLAGS= $(AM_CPPFLAGS) $(IA32_CPPFLAGS) $(HAXM_CPPFLAGS)
xnp21kai_SOURCES= $(COMMON_SOURCES) $(IA32_SOURCES)
xnp21kai_CPPFLAGS= $(AM_CPPFLAGS) $(IA32_CPPFLAGS)
xnp2kai_SOURCES= $(COMMON_SOURCES) $(I286C_SOURCES)
xnp2kai_CPPFLAGS= $(AM_CPPFLAGS) $(I286C_CPPFLAGS)
else # BUILD_ALL
if CPUCORE_IA32
if HAXM
bin_PROGRAMS= xnp21kai_haxm
nodist_man1_MANS= xnp21kai.1 xnp21kai.1j
xnp21kai_haxm_SOURCES= $(COMMON_SOURCES) $(IA32_SOURCES) $(HAXM_SOURCES)
xnp21kai_haxm_CPPFLAGS= $(AM_CPPFLAGS) $(IA32_CPPFLAGS) $(HAXM_CPPFLAGS)
else # HAXM
bin_PROGRAMS= xnp21kai
nodist_man1_MANS= xnp21kai.1 xnp21kai.1j
xnp21kai_SOURCES= $(COMMON_SOURCES) $(IA32_SOURCES)
xnp21kai_CPPFLAGS= $(AM_CPPFLAGS) $(IA32_CPPFLAGS)
endif # HAXM
else # CPUCORE_IA32
bin_PROGRAMS= xnp2kai
nodist_man1_MANS= xnp2kai.1 xnp2kai.1j
xnp2kai_SOURCES= $(COMMON_SOURCES) $(I286C_SOURCES)
xnp2kai_CPPFLAGS= $(AM_CPPFLAGS) $(I286C_CPPFLAGS)
endif # CPUCORE_IA32
endif # BUILD_ALL
CLEANFILES= $(nodist_man1_MANS) make.log
cleandir:: distclean
.man1.1 .jman1.1j:
@sed -e 's;@PKGDATADIR@;${DESTDIR}${pkgdatadir};' < $< > $@
cppcheck: compile_commands.json
cppcheck --project=compile_commands.json --xml 2> cppcheck.xml
compile_commands.json:
bear make -f Makefile

View File

@ -1,10 +0,0 @@
#!/bin/sh
aclocal
autoheader
automake -aci --foreign
autoconf
rm -f config.h.in~
./configure "$@"
rm -f ../np2tool/np2tool.d88
( cd ../np2tool && unzip -j -o np2tool.zip )
make maintainer-clean > /dev/null 2>&1

View File

@ -1,335 +0,0 @@
dnl
dnl Configure for Xnp2kai
dnl
AC_PREREQ(2.69)
AC_INIT(Xnp2kai,0.86,nonakap@gmail.com,xnp2kai)
AM_INIT_AUTOMAKE([no-define no-dist no-installinfo subdir-objects])
AC_CONFIG_SRCDIR([../np2ver.h])
AC_CONFIG_HEADERS(config.h)
AC_CANONICAL_HOST
dnl
dnl Checks for programs.
dnl
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_GCC_TRADITIONAL
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
dnl
dnl Checks for header files.
dnl
AC_STDC_HEADERS
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h termios.h unistd.h])
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
AC_CHECK_TYPES([ptrdiff_t])
AC_SYS_LARGEFILE
AC_C_CHAR_UNSIGNED
dnl
dnl Check GCC
dnl
AM_CONDITIONAL(HAVE_GCC,test x"$GCC" = "xyes")
dnl
dnl Checks for library functions.
dnl
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gettimeofday memset mkdir strcasecmp strdup strerror strtol])
dnl
dnl Checks for math library functions.
dnl
AC_CHECK_FUNCS(floor,,AC_CHECK_LIB(m,floor))
AC_CHECK_FUNCS(pow,,AC_CHECK_LIB(m,pow))
AC_CHECK_FUNCS(sqrt,,AC_CHECK_LIB(m,sqrt))
dnl
dnl Checks for pthread
dnl
ACX_PTHREAD
LIBS="$LIBS $PTHREAD_LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
dnl
dnl Checks for X
dnl
AC_PATH_X
AC_PATH_XTRA
dnl
dnl Xnp2kai configure options.
dnl
AC_ARG_ENABLE(gtk3,
AC_HELP_STRING([--enable-gtk3],[Use GTK+-3 library [default=no]]),,
[enable_gtk3="no"])
AC_ARG_ENABLE(sdl,
AC_HELP_STRING([--enable-sdl],[Use SDL library [default=no]]),,
[enable_sdl="no"])
AC_ARG_ENABLE(sdlmixer,
AC_HELP_STRING([--enable-sdlmixer],[Use SDL_mixer library [default=no]]),,
[enable_sdlmixer="no"])
AC_ARG_ENABLE(sdlttf,
AC_HELP_STRING([--enable-sdlttf],[Use SDL_ttf library [default=no]]),,
[enable_sdlttf="no"])
AC_ARG_ENABLE(sdl2,
AC_HELP_STRING([--enable-sdl2],[Use SDL2 library [default=yes]]),,
[enable_sdl2="yes"])
AC_ARG_ENABLE(sdl2ttf,
AC_HELP_STRING([--enable-sdl2ttf],[Use SDL2_ttf library [default=yes]]),,
[enable_sdl2ttf="yes"])
AC_ARG_ENABLE(sdl2mixer,
AC_HELP_STRING([--enable-sdl2mixer],[Use SDL2_mixer library [default=yes]]),,
[enable_sdl2mixer="yes"])
AC_ARG_ENABLE(libusb1,
AC_HELP_STRING([--enable-libusb1],[Use libusb-1.0 library [default=yes]]),,
[enable_libusb1="yes"])
AC_ARG_ENABLE(xf86vidmode,
AC_HELP_STRING([--enable-xf86vidmode],[Use XF86VidMode extension [default=yes]]),,
[enable_xf86vidmode="yes"])
AC_ARG_ENABLE(ia32,
AC_HELP_STRING([--enable-ia32],[Build xnp21kai(IA-32 emulation) [default=no]]),,
[enable_ia32="no"])
AC_ARG_ENABLE(haxm,
AC_HELP_STRING([--enable-haxm],[Build xnp21kai_haxm(IA-32 emulation + HAXM) [default=no]]),,
[enable_haxm="no"])
AC_ARG_ENABLE(build-all,
AC_HELP_STRING([--enable-build-all],[Build xnp2kai(i286 emulation) and xnp21kai(IA-32 emulation) and xnp21kai_haxm programs [default=no]]),,
[enable_build_all="no"])
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],[Enable debugging [default=no]]),,
[enable_debug="no"])
AC_ARG_ENABLE(warning,
AC_HELP_STRING([--enable-warning],[Enable warning [default=no]]),,
[enable_warning="no"])
AC_ARG_ENABLE(gtk-deprecated-api,
AC_HELP_STRING([--enable-gtk-deprecated-api],[Enable GTK+ deprecated API [default=yes]]),,
[enable_gtk_deprecated_api="yes"])
dnl
dnl Checks for X11
dnl
PKG_CHECK_MODULES([X11],[x11],,[AC_MSG_ERROR(Xnp2kai needs X11)])
AC_SUBST(X11_CFLAGS)
AC_SUBST(X11_LIBS)
PKG_CHECK_MODULES([XEXT],[xext])
AC_SUBST(XEXT_CFLAGS)
AC_SUBST(XEXT_LIBS)
dnl
dnl Checks for GTK+
dnl
AS_IF([test x"$enable_gtk3" = "xyes"],
[
PKG_CHECK_MODULES([GTK], [gtk+-3.0],
[
AC_DEFINE(USE_GTK2,1,[Define to 1 if you have the GTK+-2 library.])
AC_DEFINE(USE_GTK3,1,[Define to 1 if you have the GTK+-3 library.])
],
enable_gtk3=no
)
]
)
AS_IF([test x"$enable_gtk3" != "xyes"],
[
PKG_CHECK_MODULES([GTK], [gtk+-2.0],
[AC_DEFINE(USE_GTK2,1,[Define to 1 if you have the GTK+-2 library.])]
)
]
)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
dnl
dnl Checks for SDL and SDL_mixer and SDL_ttf
dnl
no_sdl=yes
if test x"$enable_sdl" = "xyes"; then
AM_PATH_SDL(1.2.0)
if test x"$no_sdl" != "xyes"; then
AC_DEFINE(SUPPORT_SDL_AUDIO,,[Define if you have the SDL library.])
if test x"$enable_sdlmixer" = "xyes"; then
AC_CHECK_LIB(SDL_mixer,Mix_OpenAudio,
AC_DEFINE(SUPPORT_SDL_MIXER,,[Define if you have the SDL_mixer library.])
SDL_LIBS="$SDL_LIBS -lSDL_mixer",,$SDL_LIBS)
fi
if test x"$enable_sdlttf" = "xyes"; then
AC_CHECK_LIB(SDL_ttf,TTF_Quit,
AC_DEFINE(USE_SDLTTF,,[Define if you have the SDL_ttf library.])
SDL_LIBS="$SDL_LIBS -lSDL_ttf",,$SDL_LIBS)
fi
fi
else
if test x"$enable_sdl2" = "xyes"; then
AM_PATH_SDL2(2.0.0)
if test x"$no_sdl" != "xyes"; then
AC_DEFINE(USE_SDL2AUDIO,,[Define if you have the SDL2 library.])
if test x"$enable_sdl2mixer" = "xyes"; then
AC_CHECK_LIB(SDL2_mixer,Mix_OpenAudio,
AC_DEFINE(USE_SDL2MIXER,,[Define if you have the SDL2_mixer library.])
SDL_LIBS="$SDL_LIBS -lSDL2_mixer",,$SDL_LIBS)
fi
dnl if test x"$enable_sdlmixer" = "xyes"; then
dnl AC_CHECK_LIB(SDL_mixer,Mix_OpenAudio,
dnl AC_DEFINE(SUPPORT_SDL_MIXER,,[Define if you have the SDL_mixer library.])
dnl SDL_LIBS="$SDL_LIBS -lSDL_mixer",,$SDL_LIBS)
dnl fi
if test x"$enable_sdl2ttf" = "xyes"; then
AC_CHECK_LIB(SDL2_ttf,TTF_Quit,
AC_DEFINE(USE_SDL2TTF,,[Define if you have the SDL2_ttf library.])
SDL_LIBS="$SDL_LIBS -lSDL2_ttf",,$SDL_LIBS)
fi
fi
fi
fi
dnl
dnl Checks for libusb-1.0
dnl
if test x"$enable_libusb1" = "xyes"; then
PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0],
[AC_DEFINE(USE_LIBUSB1,1,[Define to 1 if you have the libusb-1.0 library.])]
)
fi
AC_SUBST(LIBUSB1_CFLAGS)
AC_SUBST(LIBUSB1_LIBS)
dnl
dnl Checks for XF86VidMode extension
dnl
if test x"$enable_xf86vidmode" = "xyes"; then
ac_cv_save_cflags=$CFLAGS
CFLAGS="$CFLAGS $X_CFLAGS"
AC_CHECK_LIB(Xext,XextCreateExtension,
XLIB="-lXext $XLIB",,[$X_LIBS $X_PRE_LIBS $XLIB $X_EXTRA_LIBS])
AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
[AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,
[X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
AC_DEFINE(HAVE_XF86VIDMODE,1,[Define to 1 if you have the libXxf86vm library.])],,
[$X_LIBS $X_PRE_LIBS $XLIB $X_EXTRA_LIBS])],
,
[#include <X11/Xlib.h>])
CFLAGS=$ac_cv_save_cflags
fi
dnl
dnl Checks for nasm
dnl
AC_CHECK_PROGS(nasm,[nasm nasmw],no)
dnl
dnl Checks for build all programs
dnl
AC_MSG_CHECKING([whether to build all programs])
AM_CONDITIONAL(BUILD_ALL,test x"$enable_build_all" = "xyes")
if test x"$enable_build_all" = "xyes"; then
if test x"$enable_ia32" != "xyes"; then
enable_ia32="yes"
fi
if test x"$enable_haxm" != "xyes"; then
enable_haxm="yes"
fi
fi
AC_MSG_RESULT($enable_build_all)
dnl
dnl Checks for HAXM programs
dnl
AC_MSG_CHECKING([whether to build HAXM programs])
AM_CONDITIONAL(HAXM,test x"$enable_haxm" = "xyes")
if test x"$enable_haxm" = "xyes"; then
enable_ia32="yes"
fi
AC_MSG_RESULT($enable_haxm)
dnl
dnl Checks for IA-32 CPU emulation
dnl
AC_MSG_CHECKING([whether to use IA-32 emulation])
AM_CONDITIONAL(CPUCORE_IA32,test x"$enable_ia32" = "xyes")
AC_MSG_RESULT($enable_ia32)
dnl
dnl Checks for debug mode
dnl
AC_MSG_CHECKING([whether to enable debugging])
if test x"$enable_debug" = "xyes"; then
CPPFLAGS="$CPPFLAGS -g -DDEBUG -D_DEBUG -DTRACE"
CFLAGS="$CFLAGS -Wstack-protector -fstack-protector --param ssp-buffer-size=1"
CXXFLAGS="$CXXFLAGS -Wstack-protector -fstack-protector --param ssp-buffer-size=1"
enable_warning=yes
else
CPPFLAGS="$CPPFLAGS -DNDEBUG -D_NDEBUG"
fi
AC_MSG_RESULT($enable_debug)
dnl
dnl Checks for warning
dnl
AC_MSG_CHECKING([whether to enable warning])
if test x"$enable_warning" = "xyes"; then
CFLAGS="$CFLAGS -Wall -Wextra"
CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith"
CFLAGS="$CFLAGS -Wreturn-type -Wswitch -Wshadow"
CFLAGS="$CFLAGS -Wcast-qual -Wwrite-strings"
CFLAGS="$CFLAGS -Wno-unused-parameter -Wno-missing-field-initializers"
CFLAGS="$CFLAGS -Wformat=2"
CXXFLAGS="$CXXFLAGS -Wall -Wextra"
CXXFLAGS="$CXXFLAGS -Wpointer-arith"
CXXFLAGS="$CXXFLAGS -Wreturn-type -Wswitch -Wshadow"
CXXFLAGS="$CXXFLAGS -Wcast-qual -Wwrite-strings"
CXXFLAGS="$CXXFLAGS -Wno-unused-parameter -Wno-missing-field-initializers"
CXXFLAGS="$CXXFLAGS -Wformat=2"
fi
AC_MSG_RESULT($enable_warning)
dnl
dnl Checks for gtk-deprecated-api
dnl
AC_MSG_CHECKING([whether to enable GTK+ deprecated API])
if test x"$enable_gtk_deprecated_api" != "xyes"; then
GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_DEPRECATED"
GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATED"
GTK_CFLAGS="$GTK_CFLAGS -DGLIB_DISABLE_DEPRECATED"
CPPFLAGS="$CPPFLAGS -Werror=deprecated-declarations"
fi
AC_MSG_RESULT($enable_gtk_deprecated_api)
dnl
dnl Checks for Xnp2kai version
dnl
NP2VER_X11=`echo $PACKAGE_VERSION | $AWK 'BEGIN {FS="-"} NF==2 {print $2}'`
if test x"$NP2VER_X11" != "x"; then
NP2VER_X11="\"-$NP2VER_X11\""
AC_DEFINE_UNQUOTED(NP2VER_X11,$NP2VER_X11,[Define if Xnp2kai version is available])
fi
dnl
dnl Output Makefiles
dnl
AC_CONFIG_FILES([Makefile])
AC_OUTPUT