#ifndef _Z80SIO_H_
#define _Z80SIO_H_
-#include "vm.h"
-#include "../emu.h"
+//#include "vm.h"
+//#include "../emu.h"
#include "device.h"
#define SIG_Z80SIO_RECV_CH0 0
bool abort;
bool sync;
uint8_t sync_bit;
-#ifdef HAS_UPD7201
+//#ifdef HAS_UPD7201
uint16_t tx_count;
uint8_t tx_count_hi;
-#endif
+//#endif
double tx_clock, tx_interval;
double rx_clock, rx_interval;
int tx_data_bits;
outputs_t outputs_rxdone;
} port[2];
- void update_tx_timing(int ch);
- void update_rx_timing(int ch);
+ void __FASTCALL update_tx_timing(int ch);
+ void __FASTCALL update_rx_timing(int ch);
// daisy chain
DEVICE *d_cpu, *d_child;
bool iei, oei;
uint32_t intr_bit;
- void update_intr();
+
+ bool __HAS_UPD7201;
+ bool __SIO_DEBUG;
+ void __FASTCALL update_intr();
public:
- Z80SIO(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
+ Z80SIO(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
{
memset(port, 0, sizeof(port));
for(int i = 0; i < 2; i++) {
initialize_output_signals(&port[i].outputs_rxdone);
}
d_cpu = d_child = NULL;
+ __HAS_UPD7201 = false;
+ __SIO_DEBUG = false;
set_device_name(_T("Z80 SIO"));
}
~Z80SIO() {}
void initialize();
void reset();
void release();
- void write_io8(uint32_t addr, uint32_t data);
- uint32_t read_io8(uint32_t addr);
- void write_signal(int id, uint32_t data, uint32_t mask);
+ void __FASTCALL write_io8(uint32_t addr, uint32_t data);
+ uint32_t __FASTCALL read_io8(uint32_t addr);
+ void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
void event_callback(int event_id, int err);
- void save_state(FILEIO* state_fio);
- bool load_state(FILEIO* state_fio);
- const _TCHAR *get_device_name()
- {
- return _T("Z80SIO");
- }
-
+ bool process_state(FILEIO* state_fio, bool loading);
// interrupt common functions
void set_context_intr(DEVICE* device, uint32_t bit)
{
{
d_child = device;
}
+ DEVICE *get_context_child()
+ {
+ return d_child;
+ }
void set_intr_iei(bool val);
uint32_t get_intr_ack();
void notify_intr_reti();