class VM;
class FILEIO;
+namespace FM7 {
+
enum {
BUBBLE_DATA_REG = 0,
BUBBLE_CMD_REG,
class BUBBLECASETTE: public DEVICE {
protected:
- EMU *p_emu;
- VM *p_vm;
-
FILEIO* fio;
bool is_wrote;
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;
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
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();
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;
}
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()
{
}
};
+
+}
+
#endif