2 * BUBBLE CASETTE for FM-8/7? [bubblecasette.h]
4 * Author: K.Ohta <whatisthis.sowhat _at_ gmail.com>
7 * Mar 22, 2016 : Initial
10 #ifndef _VM_FM_BUBBLECASETTE_H_
11 #define _VM_FM_BUBBLECASETTE_H_
34 BUBBLE_TYPE_128KB = 1,
45 class BUBBLECASETTE: public DEVICE {
58 // FD12(RO) : Positive logic
59 bool cmd_error; // bit7 : Command error
60 bool stat_tdra; // bit6: Ready to write.
61 bool stat_rda; // bit5: Ready to read.
62 bool stat_error; // bit 1
63 bool stat_busy; // bit 0
65 // FD13(RO): Maybe positive
66 bool eject_error; // bit7
67 bool povr_error; // bit5 : Page over
68 bool crc_error; // bit4
69 bool transfer_error; // bit3
70 bool bad_loop_over_error; // bit2
71 bool no_marker_error; // bit1
72 bool undefined_cmd_error; // bit0
74 //FD14-FD15: Page address register
75 pair_t page_address; // 16bit, Big ENDIAN
76 // FD16-FD17: Page Count Resister
77 pair_t page_count; // 16bit, Big ENDIAN
82 bbl_header_t bbl_header[16];
83 uint8_t bubble_data[16][0x20000]; // MAX 128KB, normally 32KB at FM-8.
84 _TCHAR image_path[_MAX_PATH];
87 BUBBLECASETTE(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu);
94 uint32_t read_data8(uint32_t addr);
95 void write_data8(uint32_t addr, uint32_t data);
97 uint32_t read_signal(int id);
98 void write_signal(int id, uint32_t data, uint32_t mask);
100 void event_callback(int event_id, int err);
101 void save_state(FILEIO* state_fio);
102 bool load_state(FILEIO* state_fio);
103 const _TCHAR *get_device_name()
105 return _T("FM Bubble Casette");
107 bool insert_bubble(_TCHAR* file_path);
109 bool is_bubble_inserted()
111 return bubble_inserted;
113 bool get_access_lamp()
115 return (read_access | write_access);