X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=source%2Fsrc%2Fvm%2Ffm7%2Fbubblecasette.h;h=1ad3e28da5883f5c83a78d57c5b3551643dfe620;hb=9657068762e0ebc1ed5a42638db31cdcdda7c9db;hp=22c6040469a3f42e6ecb6af9a841e89948942b01;hpb=6ec5dcd5d489b2cb0d4576f66233c85497f505ba;p=csp-qt%2Fcommon_source_project-fm7.git diff --git a/source/src/vm/fm7/bubblecasette.h b/source/src/vm/fm7/bubblecasette.h index 22c604046..1ad3e28da 100644 --- a/source/src/vm/fm7/bubblecasette.h +++ b/source/src/vm/fm7/bubblecasette.h @@ -18,6 +18,8 @@ class EMU; class VM; class FILEIO; +namespace FM7 { + enum { BUBBLE_DATA_REG = 0, BUBBLE_CMD_REG, @@ -44,9 +46,6 @@ typedef struct { class BUBBLECASETTE: public DEVICE { protected: - EMU *p_emu; - VM *p_vm; - FILEIO* fio; bool is_wrote; @@ -54,7 +53,7 @@ protected: bool header_changed; // if change header: e.g:change write protection flag. bool read_access; bool write_access; - bool write_protect; + uint8_t offset_reg; // FD10(RW) uint8_t data_reg; @@ -65,6 +64,9 @@ protected: bool cmd_error; // bit7 : Command error bool stat_tdra; // bit6: Ready to write. bool stat_rda; // bit5: Ready to read. + bool not_ready; // bit4: Not Ready(Slot empty). + // bit3 : NOOP + bool write_protect; // bit2 bool stat_error; // bit 1 bool stat_busy; // bit 0 @@ -100,7 +102,7 @@ private: bool read_one_page(void); bool write_one_page(void); public: - BUBBLECASETTE(VM* parent_vm, EMU* parent_emu); + BUBBLECASETTE(VM_TEMPLATE* parent_vm, EMU* parent_emu); ~BUBBLECASETTE(); void initialize(); @@ -111,15 +113,11 @@ public: uint32_t read_signal(int id); void write_signal(int id, uint32_t data, uint32_t mask); - void open(_TCHAR* file_path, int bank); + bool open(_TCHAR* file_path, int bank); void close(); 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("FM Bubble Casette"); - } + bool process_state(FILEIO *state_fio, bool loading); + bool is_bubble_inserted() { return bubble_inserted; @@ -130,8 +128,10 @@ public: } void set_bubble_protect(bool flag) { - write_protect = flag; - header_changed = true; + if(write_protect != flag) { + write_protect = flag; + header_changed = true; + } } bool get_access_lamp() { @@ -139,4 +139,7 @@ public: } }; + +} + #endif