X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=source%2Fsrc%2Fvm%2Ftk80bs%2Fcmt.h;h=c772edf1b017ab76df02631ec7c0485a8ff38462;hb=1a7386afa4c2ce25de158ba8285bc795446a8584;hp=3427528690c8d94e6a229ff9792baa445b3b7655;hpb=651bea8d1de06452186be96006d6953407b30294;p=csp-qt%2Fcommon_source_project-fm7.git diff --git a/source/src/vm/tk80bs/cmt.h b/source/src/vm/tk80bs/cmt.h index 342752869..c772edf1b 100644 --- a/source/src/vm/tk80bs/cmt.h +++ b/source/src/vm/tk80bs/cmt.h @@ -1,5 +1,6 @@ /* NEC TK-80BS (COMPO BS/80) Emulator 'eTK-80BS' + NEC TK-80 Emulator 'eTK-80' Author : Takeda.Toshiya Date : 2008.08.26 - @@ -14,16 +15,30 @@ #include "../../emu.h" #include "../device.h" -#define SIG_CMT_OUT 0 +#define SIG_CMT_MIC 0 +#define SIG_CMT_EAR 1 +#if defined(_TK80BS) +#define SIG_CMT_OUT 2 +#endif // max 256kbytes #define BUFFER_SIZE 0x40000 +namespace TK80 { + class CMT : public DEVICE { private: - DEVICE* d_sio; + DEVICE *d_drec, *d_pio; +#if defined(_TK80BS) + DEVICE *d_sio; +#endif + + bool mic, ear; + bool pulse; + int pulse_count; +#if defined(_TK80BS) FILEIO* fio; bool play, rec; _TCHAR rec_file_path[_MAX_PATH]; @@ -31,9 +46,10 @@ private: uint8_t buffer[BUFFER_SIZE]; void release_tape(); +#endif public: - CMT(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) + CMT(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) { set_device_name(_T("CMT I/F")); } @@ -41,25 +57,50 @@ public: // common functions void initialize(); +#if defined(_TK80BS) void release(); void reset(); +#endif void write_signal(int id, uint32_t data, uint32_t mask); - void save_state(FILEIO* state_fio); - bool load_state(FILEIO* state_fio); + void event_callback(int event_id, int err); + bool process_state(FILEIO* state_fio, bool loading); // unique functions - void play_tape(const _TCHAR* file_path); - void rec_tape(const _TCHAR* file_path); - void close_tape(); - bool is_tape_inserted() + void set_context_drec(DEVICE* device) { - return (play || rec); + d_drec = device; } + void set_context_pio(DEVICE* device) + { + d_pio = device; + } +#if defined(_TK80BS) void set_context_sio(DEVICE* device) { d_sio = device; } + bool is_tape_inserted() + { + return (play || rec); + } + bool is_tape_playing() + { + return play; + } + bool is_tape_recording() + { + return rec; + } + int get_tape_position() + { + return 0; + } + void play_tape(const _TCHAR* file_path); + void rec_tape(const _TCHAR* file_path); + void close_tape(); +#endif }; +} #endif