[BUILD][CMAKE] Enable to build: FM-7/77/AV series, BABBAGE2nd, tk80bs and X1 series.
project (emubabbage2nd)
-
set(EXEC_TARGET emubabbage2nd)
-
-set(LOCAL_LIBS qt_babbage2nd
- qt_gui
- qt_osd
- vm_babbage2nd
- vm_vm
- common_common
- )
-
+set(VM_NAME babbage2nd)
+set(USE_FMGEN OFF)
set(VMFILES_BASE
z80.cpp
z80ctc.cpp
set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/babbage2nd.qrc)
-#include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/babbage2nd)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/machines/babbage2nd)
-
include(config_commonsource)
-
-
-add_subdirectory(../../src/vm/babbage2nd vm/babbage2nd)
-add_subdirectory(../../src/qt/machines/babbage2nd qt/bababge2nd)
-
-add_subdirectory(../../src/qt/common qt/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/${VM_NAME})
if(USE_FMGEN)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/fmgen)
+ set(FMGEN_LIB vm_fmgen)
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/machines/${VM_NAME})
endif()
qt_${VM_NAME}
qt_gui
vm_${VM_NAME}
+ ${VM_APPEND_LIBS}
vm_vm
- vm_fmgen
+ ${FMGEN_LIB}
qt_osd
${DEBUG_LIBS}
common_common
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
-project (emux1turboz)
-
-set(EXEC_TARGET emux1turboz)
-
-set(LOCAL_LIBS
- qt_osd
- vm_x1
- vm_vm
- common_common
- vm_fmgen
- qt_x1turboz
- qt_gui
- )
-
+set(VM_NAME x1)
+set(USE_FMGEN ON)
set(VMFILES
z80.cpp
mcs48.cpp
if(USE_CMT_SOUND)
-add_definitions(-DDATAREC_SOUND)
+ add_definitions(-DDATAREC_SOUND)
endif()
-
-#include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/x1)
if(BUILD_X1TWIN)
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/pcengine)
+ set(VM_APPEND_LIBS vm_pcengine)
endif()
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/fmgen)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/machines/x1turboz)
include(config_commonsource)
+if(BUILD_X1TWIN)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/pcengine)
+ add_subdirectory(../../src/vm/pcengine vm/pcengine)
+endif()
+
set(BUILD_FM77 ON CACHE BOOL "Build for FM77")
include(config_emufm7)
-
include(config_commonsource)
-
-add_subdirectory(../../src/vm/fm7 vm/fm7)
-add_subdirectory(../../src/vm/fmgen vm/fmgen)
-add_subdirectory(../../src/qt/machines/fm7 qt/fm7)
-
-add_subdirectory(../../src/qt/common qt/common)
project (emufm77av)
-
set(BUILD_FM77AV ON CACHE BOOL "Build for FM77AV")
include(config_emufm7)
-
include(config_commonsource)
-
-add_subdirectory(../../src/vm/fm7 vm/fm7)
-add_subdirectory(../../src/vm/fmgen vm/fmgen)
-add_subdirectory(../../src/qt/machines/fm7 qt/fm7)
-
-add_subdirectory(../../src/qt/common qt/common)
-
set(BUILD_FM77AV40 ON CACHE BOOL "Build for FM77AV40")
include(config_emufm7)
-
include(config_commonsource)
-
-add_subdirectory(../../src/vm/fm7 vm/fm7)
-add_subdirectory(../../src/vm/fmgen vm/fmgen)
-add_subdirectory(../../src/qt/machines/fm7 qt/fm7)
-
-add_subdirectory(../../src/qt/common qt/common)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
-
project (emutk80bs)
-set(LOCAL_LIBS qt_osd
- qt_tk80bs
- qt_gui
- vm_tk80bs
- vm_vm
- common_common
- )
+set(VM_NAME tk80bs)
+set(USE_FMGEN OFF)
set(VMFILES_BASE
i8080.cpp
set(BUILD_SHARED_LIBS OFF)
set(USE_OPENMP ON CACHE BOOL "Build using OpenMP")
set(USE_OPENGL ON CACHE BOOL "Build using OpenGL")
-set(XM7_VERSION 3)
set(WITH_DEBUGGER ON CACHE BOOL "Build with debugger.")
include(detect_target_cpu)
set(EXEC_TARGET emutk80bs)
set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/tk80bs.qrc)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/tk80bs)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/machines/tk80bs)
-
include(config_commonsource)
-
-add_subdirectory(../../src/vm/tk80bs vm/tk80bs)
-add_subdirectory(../../src/qt/machines/tk80bs qt/tk80bs)
-
-add_subdirectory(../../src/qt/common qt/common)
project (emux1)
set(BUILD_X1 ON CACHE BOOL "Build for X1")
+
include(config_x1)
-add_subdirectory(../../src/vm/x1 vm/x1)
-add_subdirectory(../../src/vm/fmgen vm/fmgen)
-add_subdirectory(../../src/qt/machines/x1turboz qt/x1turboz)
-if(BUILD_X1TWIN)
- add_subdirectory(../../src/vm/pcengine vm/pcengine)
-endif()
-
-add_subdirectory(../../src/qt/common qt/common)
set(BUILD_X1TURBO ON CACHE BOOL "Build for X1 Turbo")
include(config_x1)
-add_subdirectory(../../src/vm/x1 vm/x1)
-add_subdirectory(../../src/vm/fmgen vm/fmgen)
-add_subdirectory(../../src/qt/machines/x1turboz qt/x1turboz)
-if(BUILD_X1TWIN)
- add_subdirectory(../../src/vm/pcengine vm/pcengine)
-endif()
-
-add_subdirectory(../../src/qt/common qt/common)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
-
project (emux1turboz)
set(BUILD_X1TURBOZ ON CACHE BOOL "Build for X1 TurboZ")
include(config_x1)
-
-add_subdirectory(../../src/vm/x1 vm/x1)
-add_subdirectory(../../src/vm/fmgen vm/fmgen)
-add_subdirectory(../../src/qt/machines/x1turboz qt/x1turboz)
-if(BUILD_X1TWIN)
- add_subdirectory(../../src/vm/pcengine vm/pcengine)
-endif()
-
-add_subdirectory(../../src/qt/common qt/common)
set(BUILD_X1TWIN ON CACHE BOOL "Build for X1 Twin")
include(config_x1)
-
-add_subdirectory(../../src/vm/x1 vm/x1)
-add_subdirectory(../../src/vm/fmgen vm/fmgen)
-add_subdirectory(../../src/qt/machines/x1turboz qt/x1turboz)
-if(BUILD_X1TWIN)
- add_subdirectory(../../src/vm/pcengine vm/pcengine)
-endif()
-
-add_subdirectory(../../src/qt/common qt/common)
#endif
#if defined(MAX_BUTTONS)
updateButtonTexture();
- }
#endif
redraw_required = true;
AGAR_DebugLog(AGAR_LOG_DEBUG, "ResizeGL: %dx%d", width , height);
main_shader = new QOpenGLShaderProgram(this);
if(main_shader != NULL) {
main_shader->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/vertex_shader.glsl");
-#if defined(ONE_BOARD_MICRO_COMPUTER) || defined(MAX_BUTTONS)
- main_shader->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/chromakey_fragment_shader.glsl");
-#else
+//#if defined(ONE_BOARD_MICRO_COMPUTER) || defined(MAX_BUTTONS)
+// main_shader->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/chromakey_fragment_shader.glsl");
+//#else
main_shader->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/fragment_shader.glsl");
//main_shader->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/filtered_fragment_shader.glsl");
-#endif
+//#endif
main_shader->link();
}
grids_shader_horizonal = new QOpenGLShaderProgram(this);
else()
QT4_WRAP_CPP(s_qt_x1turboz_headers_MOC ${s_qt_x1turboz_headers})
endif()
-add_library(qt_x1turboz
+add_library(qt_x1
MainWindow.cpp
${s_qt_x1turboz_headers_MOC}
)
void OSD::do_close_debugger_thread()
{
+#if defined(USE_DEBUGGER)
emu->close_debugger();
+#endif
}
*
*/
-//#include "../beep.h"
#include "../pcm1bit.h"
#include "../datarec.h"
#include "../ym2203.h"
for(j = 0; j < 3; j++) {
opn[i]->SetReg(0x28, j | 0xfe);
}
- //opn[i]->write_signal(SIG_YM2203_PORT_A, 0xff, 0xff);
- //opn[i]->write_signal(SIG_YM2203_PORT_B, 0xff, 0xff);
}
}
opn_data[index] = val;
switch(opn_cmdreg[index]){
case 0: // High inpedance
- break;
case 1: // Read Data
break;
case 2: // Write Data
write_opn_reg(index, opn_address[index], opn_data[index]);
break;
case 3: // Register address
- if(index != 3) {
- opn_address[index] = val & 0xff;
- } else {
+ if(index == 3) {
opn_address[index] = val & 0x0f;
+ } else {
+ opn_address[index] = val;
+ if((val > 0x2c) && (val < 0x30)) {
+ opn_data[index] = 0;
+ opn[index]->write_io8(0, val);
+ opn[index]->write_io8(1, 0);
+ }
}
- if((val > 0x2c) && (val < 0x30)) {
- opn_data[index] = 0;
- opn[index]->write_io8(0, opn_address[index]);
- opn[index]->write_io8(1, 0);
- }
- //opn[index]->write_io8(0, opn_address[index]);
- //printf("OPN %d REG ADDR=%02x\n", index, opn_address[index]);
break;
}
if(opn[index] == NULL) return val;
switch(opn_cmdreg[index]) {
case 0:
- //val = 0xff;
- //break;
case 1:
case 2:
case 3:
}
break;
case 2:
- //opn[index]->SetReg(opn_address[index], opn_data[index]);
write_opn_reg(index, opn_address[index], opn_data[index]);
break;
- case 3:
- if(index != 3) {
- opn_address[index] = val & 0xff;
- } else {
+ case 3: // Register address
+ if(index == 3) {
opn_address[index] = val & 0x0f;
- }
- if((val > 0x2c) && (val < 0x30)) {
- opn_data[index] = 0;
- opn[index]->write_io8(0, opn_address[index]);
- opn[index]->write_io8(1, 0);
+ } else {
+ opn_address[index] = val;
+ if((val > 0x2c) && (val < 0x30)) {
+ opn_data[index] = 0;
+ opn[index]->write_io8(0, val);
+ opn[index]->write_io8(1, 0);
+ }
}
break;
case 4:
opn_stat[index] = opn[index]->read_io8(0) & 0x03;
- //if(index != 3) val = opn_stat[index];
break;
default:
break;
2,2, 2,0, 2,1, 2,3, 1,1, 1,3, 1,2, 1,0,
};
static uint8 table2[4] = { 0, 0, 31, 31 };
- static uint8 table3[4] = { 0, 1, 255, 0 }; // -1 will embed bugs except some compilers.
+ //static uint8 table3[4] = { 0, 1, 255, 0 }; // -1 will embed bugs except some compilers.
+ static uint8 table3[4] = { 0, 1, -1, 0 }; // -1 will embed bugs except some compilers.
uint* ptr = enveloptable[0];
#define TMS9918A_VRAM_SIZE 0x4000
#define TMS9918A_LIMIT_SPRITES
#define MAX_DRIVE 1
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT SCREEN_WIDTH
-#define WINDOW_HEIGHT_ASPECT SCREEN_HEIGHT
-
// device informations for win32
#define USE_CART1
#define TMS9918A_VRAM_SIZE 0x4000
#define TMS9918A_LIMIT_SPRITES
///#define MAX_DRIVE 1
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT SCREEN_WIDTH
-#define WINDOW_HEIGHT_ASPECT SCREEN_HEIGHT
// device informations for win32
#define USE_CART1
return fdc_tf20->disk_inserted(drv);
}
-
void VM::set_disk_protected(int drv, bool value)
{
fdc_tf20->set_disk_protected(drv, value);
return memory->tape_inserted();
}
-
bool VM::now_skip()
{
return event->now_skip();
void rec_tape(const _TCHAR* file_path);
void close_tape();
bool tape_inserted();
-
bool now_skip();
void update_config();
d_cpu->write_signal(SIG_MC6801_SIO_RECV, val, 0xff);
}
-
void MEMORY::play_tape(const _TCHAR* file_path)
{
close_tape();
{
// if vt_disp == 0, raise vblank for one line
bool new_vblank = ((v < vt_disp) || (v == 0 && vt_disp == 0));
- //printf("VBLANK: LINE=%d BLANK=%d\n", v, (new_vblank) ? 1: 0);
+
// display
if(outputs_disp.count) {
set_display(new_vblank);
return false;
}
state_fio->Fread(opaque, sizeof(h6280_Regs), 1);
-
+
// post process
h6280_Regs *cpustate = (h6280_Regs *)opaque;
cpustate->program = d_mem;
/* Highly useful macro for compile-time knowledge of an array size */
#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
-
#if defined(HAS_I86) || defined(HAS_I88) || defined(HAS_I186) || defined(HAS_V30)
#define cpu_state i8086_state
#include "mame/emu/cpu/i86/i86.c"
}
state_fio->Fread(opaque, sizeof(cpu_state), 1);
- // post process
+ // post process
cpu_state *cpustate = (cpu_state *)opaque;
cpustate->pic = d_pic;
cpustate->program = d_mem;
return cpustate->shutdown;
}
-
#define STATE_VERSION 1
void I386::save_state(FILEIO* state_fio)
return true;
}
-
#endif
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
-
+
// unique function
void set_context_mem(DEVICE* device)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
__assume(0);
-#else
- default:
- break;
#endif
}
}
}
#endif
-
#define STATE_VERSION 1
void I8080::save_state(FILEIO* state_fio)
void debug_regs_info(_TCHAR *buffer, size_t buffer_len);
int debug_dasm(uint32 pc, _TCHAR *buffer, size_t buffer_len);
#endif
-
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
+
// unique function
void set_context_mem(DEVICE* device)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
__assume(0);
-#else
- default:
- //__assume(0);
- break;
#endif
}
} else {
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
__assume(0);
-#else
- default:
- //__assume(0);
- break;
#endif
}
}
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
__assume(0);
-#else
- default:
- //__assume(0);
- break;
#endif
}
} else {
PutbackRMWord(ModRM, dst);
break;
default:
- //__assume(0);
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
break;
+#endif
}
}
}
case 0xfd: _std(); break;
case 0xfe: _fepre(); break;
case 0xff: _ffpre(); break;
- default: _add_br8(); break;
- //default: __assume(0);
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+ default: __assume(0);
+#endif
}
}
SUBB(dst, src);
icount -= (ModRM >= 0xc0) ? timing.alu_ri8 : timing.alu_mi8_ro;
break;
- default:
- //__assume(0);
- break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+ default:
+ __assume(0);
+#endif
}
}
SUBW(dst, src);
icount -= (ModRM >= 0xc0) ? timing.alu_ri16 : timing.alu_mi16_ro;
break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
- //__assume(0);
- break;
+ __assume(0);
+#endif
}
}
SUBB(dst, src);
icount -= (ModRM >= 0xc0) ? timing.alu_ri8 : timing.alu_mi8_ro;
break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
- //__assume(0);
- break;
+ __assume(0);
+#endif
}
}
SUBW(dst, src);
icount -= (ModRM >= 0xc0) ? timing.alu_r16i8 : timing.alu_m16i8_ro;
break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
- //__assume(0);
- break;
+ __assume(0);
+#endif
}
}
case 6:
case 7:
break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
- //__assume(0);
- break;
+ __assume(0);
+#endif
}
}
}
break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
- //__assume(0);
- break;
+ __assume(0);
+#endif
}
}
}
break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
- //__assume(0);
- break;
+ __assume(0);
+#endif
}
}
case 7: /* invalid ??? */
icount -= 10;
break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
default:
- //__assume(0);
- break;
+ __assume(0);
+#endif
}
}
#include "../emu.h"
#include "device.h"
-#ifndef TRUE
-# define TRUE 1
-#endif
-#ifndef FALSE
-# define FALSE 0
-#endif
-
#define SIG_I86_TEST 0
#ifdef USE_DEBUGGER
unsigned ea;
uint16 eo; /* effective offset of the address (before segment is added) */
uint8 ea_seg; /* effective segment of the address */
-
+
/* ---------------------------------------------------------------------------
opecode
--------------------------------------------------------------------------- */
}
#ifdef _IO_DEBUG_LOG
cpu_index = 0;
-#endif
+#endif
}
~IO() {}
return NULL;
}
-
-void VM::register_frame_event(DEVICE* dev)
-{
- this->event->register_frame_event(dev);
-}
-
// ----------------------------------------------------------------------------
// drive virtual machine
// ----------------------------------------------------------------------------
bool now_skip();
void update_config();
- void register_frame_event(DEVICE* dev);
// ----------------------------------------
// for each device
cmd_param->clear();
cmd_byte = 0x00;
kbic_status = 0x12;
- cmd_byte = 0x00;
}
void KEYBOARD::write_io8(uint32 addr, uint32 data)
FIFO* cmd_param;
uint8 cmd_byte;
uint8 kbic_status;
-
+
void process_cmd();
+
public:
KEYBOARD(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
~KEYBOARD() {}
void write_io8(uint32 addr, uint32 data);
uint32 read_io8(uint32 addr);
void event_frame();
- void process_cmd();
// unique functions
void set_context_pic(DEVICE* device)
#include "../../emu.h"
#include "../device.h"
-#define SIG_SYSTEM_TC2O 0
+#define SIG_SYSTEM_TC2O 0
class SYSTEM : public DEVICE
{
drec->set_remote(true);
}
-
bool VM::now_skip()
{
return event->now_skip();
void DISPLAY::initialize()
{
-
// create pc palette
for(int i = 0; i < 16; i++) {
int val = (i & 8) ? 127 : 0;
status = 0x04;
}
-
void DISPLAY::write_io8(uint32 addr, uint32 data)
{
switch(addr) {
for(int i = 0; i < 0x1000; i++) {
char *top = (char *)(buffer + i), tmp[128];
- if(_strnicmp(top, "chapter:", 8) == 0) {
+ if(_strnicmp(top, "chapter:", 8) == 0) {
top += 8;
for(int j = 0;;) {
char c = *top++;
emu->out_debug_log("LD700: TRACK %d: %d\n", track, track_frame_raw[track]);
}
} else if(_strnicmp(top, "stop:", 5) == 0) {
- top += 5;
+ top += 5;
for(int j = 0;;) {
char c = *top++;
if(c >= '0' && c <= '9') {
num_pauses++;
}
} else if(_strnicmp(top, "ENCODER=", 8) == 0) {
- break;
+ break;
}
}
}
{
return prev_pc;
}
-
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
+
// unique functions
void set_context_mem(DEVICE* device)
{
#define MMXOP(XX) mmx_##XX
#define SSEOP(XX) sse_##XX
-
extern int i386_dasm_one(char *buffer, UINT32 pc, const UINT8 *oprom, int mode);
enum SREGS { ES, CS, SS, DS, FS, GS };
#include "i86time.c"
-
/***************************************************************************/
/* cpu state */
/***************************************************************************/
vtlb_fill - rcalled by the CPU core in
response to an unmapped access
-------------------------------------------------*/
-static int cpu_translate_i386(void *cpudevice, address_spacenum space, int intention, offs_t *address);
+//static int cpu_translate_i386(void *cpudevice, address_spacenum space, int intention, offs_t *address);
int vtlb_fill(vtlb_state *vtlb, offs_t address, int intention)
{
/* return a pointer to the base of the linear VTLB lookup table */
const vtlb_entry *vtlb_table(vtlb_state *vtlb);
+
#endif /* __VTLB_H__ */
seektrk = datareg;
seektrk = (seektrk > 83) ? 83 : (seektrk < 0) ? 0 : seektrk;
seekvct = !(datareg > trkreg);
-
+
register_seek_event();
}
track >>= 1;
}
}
-#endif
+#endif
if(!disk[drvreg]->get_track(track, sidereg)) {
return FDC_ST_RECNFND;
}
position = (position + disk[drvreg]->get_bytes_per_usec(DELAY_TIME)) % disk[drvreg]->get_track_size();
}
int bytes = fdc[drvreg].next_trans_position - position;
- // Is it right?
if(fdc[drvreg].next_am1_position < position || bytes < 0) {
bytes += disk[drvreg]->get_track_size();
}
- //if(bytes < 0) {
- // bytes += disk[drvreg]->get_track_size();
- //}
double time = disk[drvreg]->get_usec_per_bytes(bytes);
if(delay) {
time += DELAY_TIME;
#define SIG_MB8877_DRIVEREG 0
#define SIG_MB8877_SIDEREG 1
#define SIG_MB8877_MOTOR 2
-//#define SIG_MB8877_CMDPHASE 3
-//#define SIG_MB8877_READ_DRIVE_REG 4
class DISK;
uint8 drvreg;
uint8 sidereg;
uint8 cmdtype;
+
// event
int register_id[8];
WM16(EAD, &pX);
}
-
#define STATE_VERSION 1
void MC6800::save_state(FILEIO* state_fio)
#include "mc6809.h"
#include "mc6809_consts.h"
-#include "common.h"
+//#include "common.h"
#ifdef USE_DEBUGGER
#include "debugger.h"
#endif
ops[i] = d_mem_stored->read_data8(pc + i);
}
int length = cpu_disassemble_m6809(buffer_tmp, pc, ops, ops);
- //memset(buffer_tmp, 0x00, sizeof(buffer_tmp));
my_strcpy_s(buffer, buffer_len, buffer_tmp);
- //strncpy(buffer, buffer_tmp, (buffer_len >= 1024) ? 1023 : buffer_len);
return length;
}
#endif
}
break;
case 1:
- case 3:
+ case 3:
if(data & 0x20) {
port[ch].ctrl &= ~0x40;
}
#define MCS48_PORT_BUS 0x120 /* DB0-DB7 */
#define MCS48_PORT_PROG 0x121 /* PROG line to 8243 expander */
-#ifndef TRUE
-# define TRUE 1
-#endif
-#ifndef FALSE
-# define FALSE 0
-#endif
-
#ifdef USE_DEBUGGER
class DEBUGGER;
#endif
#if !defined(_PX7)
static const struct {
int sectors;
- uint8 heads, names, per_track, per_fat, per_cluster;
+ byte heads, names, per_track, per_fat, per_cluster;
} info[8] = {
{ 720, 1, 112, 9, 2, 2 },
{ 1440, 2, 112, 9, 3, 2 },
return memory->disk_inserted(drv);
}
-
void VM::set_disk_protected(int drv, bool value)
{
memory->set_disk_protected(drv, value);
return memory->get_disk_protected(drv);
}
-//int VM::access_lamp()
-//{
-// //uint32 status = fdc->read_signal(0);
-// //return (status & (1 | 4)) ? 1 : (status & (2 | 8)) ? 2 : 0;
-// return 0;
-//}
#endif
bool VM::now_skip()
// for Flappy Limited '85
#define YM2203_PORT_MODE 0x80
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT SCREEN_WIDTH
-#define WINDOW_HEIGHT_ASPECT SCREEN_HEIGHT
-
// device informations for win32
#define USE_CART1
#define USE_CART2
#define USE_TAPE
-#define USE_TAPE_PTR
+//#define USE_TAPE_PTR
#if defined(_PX7)
#define USE_LASER_DISC
#define USE_MOVIE_PLAYER
bool disk_inserted(int drv);
void set_disk_protected(int drv, bool value);
bool get_disk_protected(int drv);
- //int access_lamp();
#endif
bool now_skip();
// max 256kbytes
#define BUFFER_SIZE 0x40000
-
class CMT : public DEVICE
{
private:
void DISPLAY::initialize()
{
-
// load rom image
FILEIO* fio = new FILEIO();
if(fio->Fopen(create_local_path(_T("FONT.ROM")), FILEIO_READ_BINARY)) {
register_frame_event(this);
}
-
void DISPLAY::write_io8(uint32 addr, uint32 data)
{
// $01: vram data
}
}
-
-
#define STATE_VERSION 1
void DISPLAY::save_state(FILEIO* state_fio)
// common functions
void initialize();
-
void write_io8(uint32 addr, uint32 data);
uint32 read_io8(uint32 addr);
void write_signal(int id, uint32 data, uint32 mask);
//#define DATAREC_FF_REW_SPEED 10
#define SUPPORT_VARIABLE_TIMING
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT 640
-#define WINDOW_HEIGHT_ASPECT 480
-
// memory wait
#define Z80_MEMORY_WAIT
#define Z80_IO_WAIT
#define I8259_MAX_CHIPS 1
#endif
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT 640
-#define WINDOW_HEIGHT_ASPECT 480
-
// memory wait
#define Z80_MEMORY_WAIT
#define Z80_IO_WAIT
void push_apss_forward() {}
void push_apss_rewind() {}
bool now_skip();
+
void update_config();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
-
+
// ----------------------------------------
// for each device
// ----------------------------------------
pio1->set_context_port_a(crtc, SIG_CRTC_COLUMN_SIZE, 0x20, 0);
pio1->set_context_port_a(keyboard, SIG_KEYBOARD_COLUMN, 0xff, 0);
sio->set_context_intr(pic, SIG_I8259_CHIP0 | SIG_I8259_IR2);
- sio->set_context_dtr(0, mouse, SIG_MOUSE_DTR, 1);
+ sio->set_context_dtr(1, mouse, SIG_MOUSE_DTR, 1);
crtc->set_context_pic(pic);
crtc->set_context_pio(pio0);
#endif
qd = new QUICKDISK(this, emu);
#endif
- event->set_context_sound(drec);
// set contexts
event->set_context_cpu(cpu);
event->set_context_sound(psg_l);
event->set_context_sound(psg_r);
#endif
-#if defined(DATAREC_SOUND)
event->set_context_sound(drec);
-#endif
// VRAM/PCG wait
memory->set_context_cpu(cpu);
#if defined(_MZ800) || defined(_MZ1500)
int VM::access_lamp()
{
- uint32 status = fdc->read_signal(0) | qd->read_signal(0); // 4 + 1: Nagative
- return (status & (1 | 4)) ? 1 : (status & (2 | 8)) ? 2 : 0;
+ uint32 status = fdc->read_signal(0) | qd->read_signal(0);
+ return (status & (1 | 4)) ? 1 : (status & (2 | 8)) ? 2 : 0;
}
#endif
void VM::play_tape(const _TCHAR* file_path)
{
drec->play_tape(file_path);
- drec->write_signal(SIG_DATAREC_REMOTE, 1, 1);
+ drec->set_remote(true);
}
void VM::rec_tape(const _TCHAR* file_path)
{
drec->rec_tape(file_path);
- drec->write_signal(SIG_DATAREC_REMOTE, 1, 1);
+ drec->set_remote(true);
}
void VM::close_tape()
#define MAX_DRIVE 4
#define HAS_MB8876
#endif
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT 640
-#define WINDOW_HEIGHT_ASPECT 480
// device informations for win32
#if defined(_MZ700)
#define USE_BOOT_MODE 2
#endif
#define USE_TAPE
-#define USE_TAPE_PTR
+//#define USE_TAPE_PTR
#define USE_TAPE_BUTTON
#if defined(_MZ800) || defined(_MZ1500)
#define USE_QD1
//#endif
#if defined(_MZ800) || defined(_MZ1500)
#define USE_ACCESS_LAMP
-#define USE_DISK_WRITE_PROTECT
+//#define USE_DISK_WRITE_PROTECT
#endif
#define USE_DEBUGGER
#define USE_STATE
return fdc->disk_inserted(drv);
}
+void VM::set_disk_protected(int drv, bool value)
+{
+ fdc->set_disk_protected(drv, value);
+}
+
+bool VM::get_disk_protected(int drv)
+{
+ return fdc->get_disk_protected(drv);
+}
+
#endif
void VM::play_tape(const _TCHAR* file_path)
return drec->tape_inserted();
}
-#if defined(SUPPORT_MZ80AIF) || defined(SUPPORT_MZ80FIO)
-void VM::set_disk_protected(int drv, bool value)
-{
- fdc->set_disk_protected(drv, value);
-}
-
-bool VM::get_disk_protected(int drv)
-{
- return fdc->get_disk_protected(drv);
-}
-#endif
-
bool VM::tape_playing()
{
return drec->tape_playing();
#define MAX_DRIVE 4
#endif
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT 640
-#define WINDOW_HEIGHT_ASPECT 480
-
// device informations for win32
#define USE_TAPE
-#define USE_TAPE_PTR
+//#define USE_TAPE_PTR
#define USE_TAPE_BUTTON
#define NOTIFY_KEY_DOWN
#define USE_SHIFT_NUMPAD_KEY
#define USE_FD3
#define USE_FD4
#define USE_ACCESS_LAMP
-#define USE_DISK_WRITE_PROTECT
+//#define USE_DISK_WRITE_PROTECT
#endif
#if defined(_MZ80K)
#define USE_MONITOR_TYPE 2
bool tape_playing();
bool tape_recording();
int tape_position();
-
void push_play();
void push_stop();
void push_fast_forward();
#include "../../emu.h"
#include "../device.h"
-#if defined(_USE_QT) || defined(_USE_AGAR)
-typedef uint8_t byte;
-#endif
-
class DISK;
class FLOPPY : public DEVICE
{ 0x8000, 0xc000, 0x0000, 0x4000 }
};
uint16 port=(addr & 0x00ff);
- uint8 Value=data;
+ byte Value=data;
switch(port)
{
#ifdef _PC6001
#include "../../emu.h"
#include "../device.h"
-#if defined(_USE_QT) || defined(_USE_AGAR)
-typedef uint8_t byte;
-#endif
-
#define SIG_MEMORY_PIO_PORT_C 0
#ifndef _PC6001
uint8 *VRAM;
// uint8 EmptyRAM[0x2000];
uint8 EnWrite[4]; // MEMORY MAPPING WRITE ENABLE [N60/N66]
- uint8 CGSW93;
+ byte CGSW93;
bool inserted;
#ifndef _PC6001
byte CRTKILL;
#ifdef USE_DEBUGGER
cpu_sub->set_context_debugger(new DEBUGGER(this, emu));
#endif
-#ifdef DATAREC_SOUND
- event->set_context_sound(drec);
-#endif
+//#ifdef DATAREC_SOUND
+// event->set_context_sound(drec);
+//#endif
sub->set_context_pio(pio_sub);
sub->set_context_drec(drec);
sub->set_context_timer(timer);
#define SCREEN_HEIGHT 400
#define CPU_CLOCKS 3580000
#endif
-// 4:3
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT 640
-#define WINDOW_HEIGHT_ASPECT 480
// device informations for virtual machine
#define FRAMES_PER_SEC 60
#define USE_FD4
#endif
#define USE_TAPE
-#define USE_TAPE_PTR
+//#define USE_TAPE_PTR
#define TAPE_PC6001
#define USE_SHIFT_NUMPAD_KEY
#define USE_ALT_F10_KEY
#define USE_SCANLINE
#endif
#define USE_ACCESS_LAMP
-#define USE_DISK_WRITE_PROTECT
+//#define USE_DISK_WRITE_PROTECT
#define USE_DEBUGGER
#define USE_STATE
class FILEIO;
-#if defined(_USE_QT) || defined(_USE_AGAR)
-typedef uint8 byte;
-#endif
-
class PSUB : public DEVICE
{
private:
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
};
+
void SUB::initialize()
{
fio = new FILEIO();
#endif
}
-void PC88::update_config(void)
-{
-#if defined(DATAREC_SOUND) && defined(USE_MULTIPLE_SOUNDCARDS)
- int vv;
- cmt_mix = config.tape_sound;
- vv = (config.sound_device_level[0] + 0x8000) >> 2;
- if(vv >= 0x4000) {
- cmt_volume = 0x4000;
- } else if(vv <= 0) {
- cmt_volume = 0;
- } else {
- cmt_volume = vv;
- }
-#endif
-}
-
-#ifdef DATAREC_SOUND
-void PC88::mix(int32* buffer, int cnt)
-{
- int vol = 0;
- if(!cmt_mix) return;
- if(cmt_play || cmt_rec) {
- if(cmt_level_flag) {
- vol = cmt_volume;
- } else {
- vol = -cmt_volume;
- }
- if(!cmt_sound_flag) vol = 0;
- } else {
- return;
- }
- for(int i = 0; i < cnt; i++) {
- *buffer++ += vol;
- *buffer++ += vol;
- }
-}
-#endif
-
void PC88::event_callback(int event_id, int err)
{
switch(event_id) {
case EVENT_CMT_DCD:
// send data to sio
usart_dcd = false;
-#ifdef DATAREC_SOUND
- cmt_sound_data = cmt_buffer[cmt_bufptr];
- cmt_sound_count = 0;
- cmt_local_count = 0;
-#endif
-#ifdef DATAREC_SOUND
- register_event(this, EVENT_CMT_SOUND, 1000000.0 / 4800.0, false, NULL);
-#endif
if(cmt_play && cmt_bufptr < cmt_bufcnt && Port30_MTON) {
d_sio->write_signal(SIG_I8251_RECV, cmt_buffer[cmt_bufptr++], 0xff);
if(cmt_bufptr < cmt_bufcnt) {
register_event(this, EVENT_CMT_SEND, 5000, false, &cmt_register_id);
break;
}
- } else {
-#ifdef DATAREC_SOUND
- //cmt_level_flag = false;
- //cmt_sound_flag = false;
-#endif
}
usart_dcd = true; // Jackie Chan no Spartan X
cmt_register_id = -1;
break;
- case EVENT_CMT_SOUND:
-#ifdef DATAREC_SOUND
- if(cmt_sound_count < 8) {
- if((cmt_sound_data & 0x80) != 0) {
- cmt_sound_flag = true;
- cmt_level_flag = ((cmt_local_count & 0x01) != 0);
- if(cmt_local_count & 0x01 != 0) {
- cmt_sound_data <<= 1;
- cmt_sound_count++;
- cmt_local_count = 0;
- }
- } else {
- cmt_sound_flag = true;
- cmt_level_flag = ((cmt_local_count & 0x02) != 0);
- if((cmt_local_count & 0x03) == 3) {
- cmt_sound_data <<= 1;
- cmt_sound_count++;
- cmt_local_count = 0;
- }
- }
- cmt_local_count++;
- register_event(this, EVENT_CMT_SOUND, 1000000.0 / 4800.0, false, NULL);
- } else if(cmt_sound_count < 11) {
- // STOP BIT = 1.5
- cmt_sound_flag = true;
- cmt_level_flag = true;
- cmt_sound_count++;
- register_event(this, EVENT_CMT_SOUND, 1000000.0 / 4800.0, false, NULL);
-
- } else if(cmt_sound_count == 12) {
- // Fall down
- cmt_sound_flag = true;
- cmt_level_flag = false;
- cmt_sound_count++;
- register_event(this, EVENT_CMT_SOUND, 1000000.0 / 4800.0, false, NULL);
- } else {
- cmt_sound_flag = false;
- cmt_level_flag = false;
- cmt_sound_count = 0;
- cmt_local_count = 0;
- }
-#endif
- break;
case EVENT_BEEP:
beep_signal = !beep_signal;
d_pcm->write_signal(SIG_PCM1BIT_SIGNAL, ((beep_on && beep_signal) || sing_signal) ? 1 : 0, 1);
if(cmt_register_id != -1) {
cancel_event(this, cmt_register_id);
}
-#ifdef DATAREC_SOUND
- cmt_sound_count = 0;
- cmt_sound_data = 0;
- cmt_level_flag = false;
- cmt_sound_flag = true;
-#endif
+//#ifdef DATAREC_SOUND
+// cmt_sound_count = 0;
+// cmt_sound_data = 0;
+// cmt_level_flag = false;
+// cmt_sound_flag = true;
+//#endif
register_event(this, EVENT_CMT_SEND, 5000, false, &cmt_register_id);
}
}
}
}
-
#define STATE_VERSION 5
void PC88::save_state(FILEIO* state_fio)
#define SIG_PC88_DATAREC_MIX 4
#define SIG_PC88_DATAREC_VOLUME 5
-#if defined(_USE_QT)
-#define MAX_PATH PATH_MAX
-#endif
#define CMT_BUFFER_SIZE 0x40000
// beep/sing
bool beep_on, beep_signal, sing_signal;
-#ifdef DATAREC_SOUND
- bool cmt_mix;
- int cmt_volume;
- bool cmt_level_flag, cmt_sound_flag;
- int cmt_sound_count;
- int cmt_local_count;
- uint8 cmt_sound_data;
-#endif
#ifdef SUPPORT_PC88_PCG8100
// pcg
uint16 pcg_addr;
#endif
public:
- PC88(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {
-#ifdef DATAREC_SOUND
- cmt_mix = false;
- cmt_volume = 0x1800;
-#endif
- }
+ PC88(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
~PC88() {}
// common functions
void event_frame();
void event_vline(int v, int clock);
uint32 intr_ack();
-#ifdef DATAREC_SOUND
- void mix(int32 *buffer, int cnt);
-#endif
void intr_ei();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
- void update_config(void);
// unique functions
bool is_sr_mr()
pc88event->set_context_sound(pc88pcm1);
pc88event->set_context_sound(pc88pcm2);
#endif
-#ifdef DATAREC_SOUND
- pc88event->set_context_sound(pc88);
-#endif
pc88->set_context_cpu(pc88cpu);
pc88->set_context_opn(pc88opn);
#ifdef SUPPORT_PC88_SB2
device->update_config();
}
}
-#ifdef SUPPORT_PC88_HIGH_CLOCK
- pc88event->set_cpu_clock(pc88cpu, (config.cpu_type != 0) ? 3993624 : 7987248);
-#endif
-
}
#define STATE_VERSION 4
#if defined(_PC8801MA)
#define SUPPORT_PC88_DICTIONARY
#define SUPPORT_PC88_HIGH_CLOCK
-# ifndef _CONFIGURE_WITH_CMAKE
-# define SUPPORT_PC88_SB2
-# define SUPPORT_PC88_OPNA
-# define PC88_EXRAM_BANKS 4
-# endif
+#define SUPPORT_PC88_SB2
+#define SUPPORT_PC88_OPNA
+#define PC88_EXRAM_BANKS 4
#define HAS_UPD4990A
#endif
#define SUPPORT_PC88_JOYSTICK
-# ifndef _CONFIGURE_WITH_CMAKE
-# define SUPPORT_PC88_PCG8100
-# endif
+#define SUPPORT_PC88_PCG8100
+
// device informations for virtual machine
#define FRAMES_PER_SEC 62.422
#define LINES_PER_FRAME 260
#define OVERRIDE_SOUND_FREQ_48000HZ 55467
#define SUPPORT_VARIABLE_TIMING
-// 4:3
-#define SCREEN_WIDTH_ASPECT 640
-#define SCREEN_HEIGHT_ASPECT 400
-#define WINDOW_WIDTH_ASPECT 640
-#define WINDOW_HEIGHT_ASPECT 480
-// device informations for win32
// device informations for win32
#if defined(_PC8001SR)
#define USE_BOOT_MODE 3
#define USE_FD1
#define USE_FD2
#define USE_TAPE
-#define USE_TAPE_PTR
+//#define USE_TAPE_PTR
#define TAPE_BINARY_ONLY
#define NOTIFY_KEY_DOWN
#define USE_SHIFT_NUMPAD_KEY
#define USE_ACCESS_LAMP
#define USE_DISK_WRITE_PROTECT
-#ifdef SUPPORT_PC88_SB2
-# define USE_SOUND_DEVICE_TYPE 3
-#elif defined(SUPPORT_PC88_OPNA)
-# define USE_SOUND_DEVICE_TYPE 2
+#ifdef SUPPORT_PC88_OPNA
+ #ifdef SUPPORT_PC88_SB2
+ #define USE_SOUND_DEVICE_TYPE 3
+ #else
+ #define USE_SOUND_DEVICE_TYPE 2
#endif
-#if defined(DATAREC_SOUND)
-# if defined(SUPPORT_PC88_OPNA)
-# define USE_MULTIPLE_SOUNDCARDS 3
-# else
-# define USE_MULTIPLE_SOUNDCARDS 2
-# endif
+#if defined(SUPPORT_PC88_OPNA)
+# define USE_MULTIPLE_SOUNDCARDS 2
#else
-# if defined(SUPPORT_PC88_OPNA)
-# define USE_MULTIPLE_SOUNDCARDS 2
-# else
-# define USE_MULTIPLE_SOUNDCARDS 1
-# endif
+# define USE_MULTIPLE_SOUNDCARDS 1
#endif
//#define USE_DEBUGGER
#define USE_STATE
{
fio = new FILEIO();
play = rec = remote = false;
- buffer_size = BUFFER_SIZE;
}
void CMT::release()
int size = (fio->Ftell() + 9) & (BUFFER_SIZE - 1);
fio->Fseek(0, FILEIO_SEEK_SET);
memset(buffer, 0, sizeof(buffer));
- buffer_size = size;
fio->Fread(buffer, sizeof(buffer), 1);
// send data to sio
{
// close file
release_tape();
- buffer_size = BUFFER_SIZE;
+
// clear sio buffer
d_sio->write_signal(SIG_I8251_CLEAR, 0, 0);
}
play = rec = false;
}
-#ifdef DATAREC_SOUND
-void CMT::mix(int32 *buffer, int cnt)
-{
- if(!cmt_mix) return;
- // Not implemented yet :)
-}
-#endif
-
#define STATE_VERSION 1
void CMT::save_state(FILEIO* state_fio)
FILEIO* fio;
int bufcnt;
- int buffer_size;
uint8 buffer[BUFFER_SIZE];
bool play, rec, remote;
-#ifdef DATAREC_SOUND
- bool cmt_mix;
- int cmt_volume;
-#endif
void release_tape();
public:
- CMT(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {
-#ifdef DATAREC_SOUND
- cmt_mix = false;
- cmt_volume = 0x1800;
-#endif
- }
+ CMT(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
~CMT() {}
// common functions
void reset();
void write_io8(uint32 addr, uint32 data);
void write_signal(int id, uint32 data, uint32 mask);
-#ifdef DATAREC_SOUND
- void mix(int32 *buffer, int cnt);
-#endif
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
timer_id = -1;
}
-
#define STATE_VERSION 1
void FLOPPY::save_state(FILEIO* state_fio)
void event_callback(int event_id, int err);
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
+
// unique functions
#if defined(SUPPORT_2HD_FDD_IF)
void set_context_fdc_2hd(UPD765A* device)
pit_clock_8mhz = false;
#endif
#if defined(_PC9801E)
- cpu_type = config.cpu_type;
if(config.cpu_type != 0) {
// 8MHz -> 5MHz
cpu_clocks = 4992030;
pit_clock_8mhz = false;
}
#elif defined(_PC9801VM) || defined(_PC98DO)
- cpu_type = config.cpu_type;
if(config.cpu_type != 0) {
// 10MHz -> 8MHz
cpu_clocks = 7987248;
} else if(sound_device_type == 2 || sound_device_type == 3) {
event->set_context_sound(tms3631);
}
-#if defined(SUPPORT_CMT_IF)
- event->set_context_sound(cmt);
-#endif
-#if defined(_PC98DO)
- //event->set_context_sound(pc88);
-#endif
dma->set_context_memory(memory);
// dma ch.0: sasi
// dma ch.1: memory refresh
return false;
}
-
void VM::set_disk_protected(int drv, bool value)
{
#if defined(_PC9801) || defined(_PC9801E)
return cmt->tape_inserted();
#endif
}
-
-
-#endif
-
-void VM::set_mix_cmt(bool flag)
-{
-#ifdef DATAREC_SOUND
-# if defined(_PC98DO)
- if(flag) {
- pc88->write_signal(SIG_PC88_DATAREC_MIX, 1, 1);
- } else {
- pc88->write_signal(SIG_PC88_DATAREC_MIX, 0, 1);
- }
-# else
- if(flag) {
- cmt->write_signal(SIG_CMT_MIX, 1, 1);
- } else {
- cmt->write_signal(SIG_CMT_MIX, 0, 1);
- }
-# endif
-#endif
-}
-void VM::set_volume_cmt(uint32 volume)
-{
-#ifdef DATAREC_SOUND
-# if defined(_PC98DO)
- pc88->write_signal(SIG_PC88_DATAREC_VOLUME, volume, 0xffffffff);
-# else // _PC98DO
- cmt->write_signal(SIG_CMT_VOLUME, volume, 0xffffffff);
-# endif // _PC98DO
-#endif
-}
-
-
-
bool VM::now_skip()
{
#if defined(_PC98DO)
- if(boot_mode != 0) {
-// return pc88event->now_skip();
- return pc88->now_skip();
- } else
-#endif
- return event->now_skip();
-}
-
-void VM::update_config()
-{
-#if defined(_PC9801E) || defined(_PC9801VM) || defined(_PC98DO)
- if(cpu_type != config.cpu_type) {
- uint32 pit_clocks;
- int cpu_clocks = CPU_CLOCKS;
-#if defined(_PC9801E)
- if(config.cpu_type != 0) {
- // 8MHz -> 5MHz
- cpu_clocks = 4992030;
- pit_clock_8mhz = false;
- } else {
- // 5MHz -> 8MHz
- cpu_clocks = CPU_CLOCKS;
- pit_clock_8mhz = true;
- }
-#elif defined(_PC9801VM) || defined(_PC98DO)
- if(config.cpu_type != 0) {
- // 10MHz -> 8MHz
- cpu_clocks = 7987248;
- pit_clock_8mhz = true;
- } else {
- cpu_clocks = CPU_CLOCKS;
- pit_clock_8mhz = false;
- }
-#endif
- uint8 prn_b = pio_prn->read_signal(SIG_I8255_PORT_B);
- if(pit_clock_8mhz) {
- prn_b |= 0x20; // system clock is 8MHz
- pit_clocks = 1996812;
- } else {
- prn_b &= ~0x20;
- pit_clocks = 2457600;
- }
- pio_prn->write_signal(SIG_I8255_PORT_B, prn_b, 0xff);
- pit->set_constant_clock(0, pit_clocks);
- pit->set_constant_clock(1, pit_clocks);
- pit->set_constant_clock(2, pit_clocks);
- event->set_cpu_clock(cpu, cpu_clocks);
-#if defined(_PC98DO)
- pc88event->set_cpu_clock(pc88cpu, (config.cpu_type != 0) ? 3993624 : 7987248);
-#endif
- cpu_type = config.cpu_type;
- }
-#endif
-
-#if defined(_PC98DO)
if(boot_mode != config.boot_mode) {
// boot mode is changed !!!
boot_mode = config.boot_mode;
#else
#endif
-// 4:3
-#define SCREEN_WIDTH_ASPECT 640
-#define SCREEN_HEIGHT_ASPECT 400
-#define WINDOW_WIDTH_ASPECT 640
-#define WINDOW_HEIGHT_ASPECT 480
-
#if defined(_PC9801) || defined(_PC9801E)
#define SUPPORT_CMT_IF
#define SUPPORT_2HD_FDD_IF
#define SUPPORT_VARIABLE_TIMING
// device informations for win32
-
#if defined(_PC98DO)
#define USE_BOOT_MODE 5
#define USE_DIPSWITCH
#define USE_CRT_FILTER
#define USE_SCREEN_ROTATE
#define USE_ACCESS_LAMP
-#define USE_DISK_WRITE_PROTECT
#define USE_SOUND_DEVICE_TYPE 4
#define USE_DEBUGGER
#define USE_STATE
uint8 fd_bios_2dd[0x1000];
#endif
bool pit_clock_8mhz;
- int cpu_type;
+
// sound
int sound_device_type;
bool tape_inserted();
#endif
bool now_skip();
- void set_mix_cmt(bool flag);
- void set_volume_cmt(uint32 volume);
void update_config();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
-
// ----------------------------------------
// for each device
public:
FLOPPY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
~FLOPPY() {}
+
// common functions
void reset();
void write_io8(uint32 addr, uint32 data);
return fdc->disk_inserted(drv);
}
-
void VM::set_disk_protected(int drv, bool value)
{
fdc->set_disk_protected(drv, value);
#define USE_AUTO_KEY 5
#define USE_AUTO_KEY_RELEASE 6
#define USE_ACCESS_LAMP
-//#define USE_DEBUGGER
+#define USE_DEBUGGER
#define USE_STATE
#include "../../common.h"
void set_disk_protected(int drv, bool value);
bool get_disk_protected(int drv);
bool now_skip();
+
void update_config();
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
#define USE_AUTO_KEY 6
#define USE_AUTO_KEY_RELEASE 10
#define USE_AUTO_KEY_NO_CAPS
-//#define USE_DEBUGGER
+#define USE_DEBUGGER
#define USE_STATE
#include "../../common.h"
void DISPLAY::draw_screen()
{
// draw screen
- scrntype color_w = (mode & 2) ? RGB_COLOR(255, 255, 255) : 0;
- scrntype color_b = (mode & 2) ? 0 : RGB_COLOR(255, 255, 255);
+// scrntype color_w = (mode & 2) ? RGB_COLOR(255, 255, 255) : 0;
+// scrntype color_b = (mode & 2) ? 0 : RGB_COLOR(255, 255, 255);
+ scrntype color_w = (mode & 2) ? RGB_COLOR(255, 255, 255) : RGB_COLOR(0, 0, 0);
+ scrntype color_b = (mode & 2) ? RGB_COLOR(0, 0, 0) : RGB_COLOR(255, 255, 255);
int code_ofs = (mode & 1) << 8;
int ptr = 0;
#define MEMORY_ADDR_MAX 0x10000
#define MEMORY_BANK_SIZE 0x200
#define IO_ADDR_MAX 0x10000
-#define SCREEN_WIDTH_ASPECT SCREEN_WIDTH
-#define SCREEN_HEIGHT_ASPECT SCREEN_HEIGHT
-#define WINDOW_WIDTH_ASPECT 256
-#define WINDOW_HEIGHT_ASPECT 192
// device informations for win32
#define ONE_BOARD_MICRO_COMPUTER
void TMS9918A::draw_screen()
{
#ifdef TMS9918A_SUPER_IMPOSE
-# ifndef _USE_QT // WILLFIX
- if(now_super_impose) {
+//# ifndef _USE_QT // WILLFIX
+ if(now_super_impose) {
emu->get_video_buffer();
}
-# endif
+//# endif
#endif
// update screen buffer
#if SCREEN_WIDTH == 512
register_event(this, 0, 1000000.0, true, ®ister_id);
}
-
#define STATE_VERSION 1
void UPD4991A::save_state(FILEIO* state_fio)
typedef int D7752_SAMPLE;
typedef int D7752_FIXED;
-#if defined(_USE_AGAR) || defined(_USE_SDL) || defined(_USE_QT)
-typedef uint8_t byte;
-#endif
#define D7752_ERR_SUCCESS (0)
#define D7752_ERR_PARAM (-1)
case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7:
case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff: // jr
PC -= 0x20 - (ope & 0x1f); break;
- default: // NOP?
- //__assume(0);
- break;
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+ default:
+ __assume(0);
+#endif
}
PSW &= ~(F_L0 | F_L1);
}
//#define Z80_NMI 0x0066
#define MD_BPP 32
-#if defined(USE_QT) || defined(_USE_QT) // Using Shader
-# define md_maprgb15(R,G,B) RGB_COLOR((R << 3), (G << 3), (B << 3))
-#else
-# define md_maprgb15(R,G,B) (((R)<<19)|((G)<<11)|((B)<<3))
-#endif
+#define md_maprgb15(R,G,B) RGB_COLOR((R << 3), (G << 3), (B << 3))
#define md_video_pixbytes(n) (n*32/8)
#define md_refresh_sync() (TRUE)
#define md_video_defaultopt() (0)
#define V99X8_NREG 48
#define V99X8_NSTAT 10
-#ifndef TRUE
-# define TRUE 1
-#endif
-#ifndef FALSE
-# define FALSE 0
-#endif
enum
{
#include "fm7/fm7.h"
#endif
-// FUJITSU FM-NEW7
-#ifdef _FMNEW7
+// FUJITSU FM-7
+#ifdef _FM7
#include "fm7/fm7.h"
#endif
-// FUJITSU FM-7
-#ifdef _FM7
+// FUJITSU FM-NEW7
+#ifdef _FMNEW7
#include "fm7/fm7.h"
#endif
#include "fm7/fm7.h"
#endif
-// FUJITSU FM77AV40SX
-#ifdef _FM77AV40SX
-#include "fm7/fm7.h"
-#endif
-
// FUJITSU FM-77AV40SX
#ifdef _FM77AV40SX
#include "fm7/fm7.h"
#endif
// SHARP MZ-2200
-#ifdef _MZ2000
-#include "mz2500/mz80b.h"
-#endif
-
-// SHARP MZ-2200
#ifdef _MZ2200
#include "mz2500/mz80b.h"
#endif
hireso = (vt_total > 400);
}
#endif
- //printf("IO WRITE:%04x %02x CPU_PC=%04x\n", addr, data & 0xff, d_cpu->get_pc());
if(is_dma) {
d_io->write_dma_io8(addr, data & 0xff);
} else {
}
vdisp = val;
}
- //printf("IO READ:%04x %02x CPU_PC=%04x\n", addr, val, d_cpu->get_pc());
switch(addr & 0xff00) {
case 0x1900: // sub cpu
case 0x1b00: // psg
first_device = last_device = NULL;
dummy = new DEVICE(this, emu); // must be 1st device
event = new EVENT(this, emu); // must be 2nd device
-
+
drec = new DATAREC(this, emu);
crtc = new HD46505(this, emu);
pio = new I8255(this, emu);
event->set_context_cpu(cpu_sub, 6000000);
event->set_context_cpu(cpu_kbd, 6000000);
}
- if(sound_device_type >= 1) {
+ if(sound_device_type >= 1) {
event->set_context_sound(opm1);
}
if(sound_device_type == 2) {
}
event->set_context_sound(psg);
event->set_context_sound(drec);
-
+
drec->set_context_ear(pio, SIG_I8255_PORT_B, 0x02);
crtc->set_context_vblank(display, SIG_DISPLAY_VBLANK, 1);
crtc->set_context_vblank(pio, SIG_I8255_PORT_B, 0x80);
// sio->set_rx_clock(0, 9600 * 16); // clock is from Z-80CTC ch1 (2MHz/13)
// sio->set_tx_clock(1, 4800 * 16); // 4800 baud for mouse
// sio->set_rx_clock(1, 4800 * 16); // clock is from Z-80CTC ch2 (2MHz/26)
-
+
if(sound_device_type >= 1) {
ctc1->set_context_zc0(ctc1, SIG_Z80CTC_TRIG_3, 1);
// ctc1->set_constant_clock(1, CPU_CLOCKS >> 1);
{
return fdc->disk_inserted(drv);
}
-
+
void VM::set_disk_protected(int drv, bool value)
{
fdc->set_disk_protected(drv, value);
#define PCE_CPU_CLOCKS 7159090
#endif
-// 4:3
-#define SCREEN_WIDTH_ASPECT 640
-#define SCREEN_HEIGHT_ASPECT 400
-#define WINDOW_WIDTH_ASPECT 640
-#define WINDOW_HEIGHT_ASPECT 480
-
// device informations for win32
#define USE_SPECIAL_RESET
#ifdef _X1TURBO_FEATURE
#define FD_BASE_NUMBER 0
#define USE_TAPE
#define USE_TAPE_BUTTON
-#define USE_TAPE_PTR
#ifdef _X1TWIN
#define USE_CART1
#endif
#define USE_CRT_FILTER
#define USE_SCANLINE
#define USE_ACCESS_LAMP
-#define USE_DISK_WRITE_PROTECT
-#define USE_SOUND_DEVICE_TYPE 3
#define USE_SOUND_DEVICE_TYPE 3
// CZ-8BS1 x1
#define SOUND_DEVICE_TYPE_DEFAULT 1
-//#define USE_DEBUGGER
+#define USE_DEBUGGER
#define USE_STATE
#include "../../common.h"
// devices for x1
EVENT* event;
-
+
DATAREC* drec;
HD46505* crtc;
I8255* pio;
clock_busy = state_fio->FgetUint32();
timer_event_id = state_fio->FgetInt32();
busy = state_fio->FgetBool();
-
+
#ifdef SUPPORT_MAME_FM_DLL
// post process
if(dllchip) {
uint8 *psub = SZHVC_sub;
uint8 *psbc = SZHVC_sub + 256 * 256;
- for(int oldval = 0; oldval < 256; oldval++) {
+ for(int oldval = 0; oldval < 256; oldval++) {
for(int newval = 0; newval < 256; newval++) {
/* add or adc w/o carry set */
int val = newval - oldval;
restart:
#endif
while(enabled && now_ready() && !(upcount == blocklen || found)) {
- uint32 data = 0;
- int wait_r = 0, wait_w = 0;
if(dma_stop) {
if(upcount < blocklen) {
upcount++;
request_bus();
// read
+ uint32 data = 0;
+ int wait_r = 0, wait_w = 0;
if(PORTA_IS_SOURCE) {
if(PORTA_MEMORY) {
#define EVENT_SEND 2
#define EVENT_RECV 4
-
//#define SIO_DEBUG
#define MONOSYNC(ch) ((port[ch].wr[4] & 0x3c) == 0x00)
}
break;
case 0x18:
+ // channel reset
CANCEL_SEND_EVENT(ch);
CANCEL_RECV_EVENT(ch);
port[ch].nextrecv_intr = false;