trunk/src/mame/includes/cd32.h
| r30709 | r30710 | |
| 1 | | /*************************************************************************** |
| 2 | | |
| 3 | | CuboCD32 definitions |
| 4 | | |
| 5 | | ***************************************************************************/ |
| 6 | | |
| 7 | | #ifndef __CUBOCD32_H__ |
| 8 | | #define __CUBOCD32_H__ |
| 9 | | |
| 10 | | #include "includes/amiga.h" |
| 11 | | #include "machine/microtch.h" |
| 12 | | #include "sound/cdda.h" |
| 13 | | #include "machine/i2cmem.h" |
| 14 | | |
| 15 | | class cd32_state : public amiga_state |
| 16 | | { |
| 17 | | public: |
| 18 | | cd32_state(const machine_config &mconfig, device_type type, const char *tag) |
| 19 | | : amiga_state(mconfig, type, tag), |
| 20 | | m_microtouch(*this, "microtouch"), |
| 21 | | m_p1_port(*this, "P1"), |
| 22 | | m_p2_port(*this, "P2"), |
| 23 | | m_cdda(*this, "cdda") |
| 24 | | { |
| 25 | | } |
| 26 | | |
| 27 | | required_device<microtouch_device> m_microtouch; |
| 28 | | optional_ioport m_p1_port; |
| 29 | | optional_ioport m_p2_port; |
| 30 | | required_device<cdda_device> m_cdda; |
| 31 | | |
| 32 | | DECLARE_WRITE8_MEMBER(microtouch_tx); |
| 33 | | UINT16 m_potgo_value; |
| 34 | | int m_cd32_shifter[2]; |
| 35 | | void (*m_input_hack)(running_machine &machine); |
| 36 | | int m_oldstate[2]; |
| 37 | | DECLARE_CUSTOM_INPUT_MEMBER(cubo_input); |
| 38 | | DECLARE_CUSTOM_INPUT_MEMBER(cd32_sel_mirror_input); |
| 39 | | |
| 40 | | DECLARE_WRITE32_MEMBER(aga_overlay_w); |
| 41 | | DECLARE_WRITE8_MEMBER(cd32_cia_0_porta_w); |
| 42 | | DECLARE_READ8_MEMBER(cd32_cia_0_portb_r); |
| 43 | | DECLARE_WRITE8_MEMBER(cd32_cia_0_portb_w); |
| 44 | | DECLARE_DRIVER_INIT(cd32); |
| 45 | | DECLARE_DRIVER_INIT(mgprem11); |
| 46 | | DECLARE_DRIVER_INIT(odeontw2); |
| 47 | | DECLARE_DRIVER_INIT(cndypuzl); |
| 48 | | DECLARE_DRIVER_INIT(haremchl); |
| 49 | | DECLARE_DRIVER_INIT(mgnumber); |
| 50 | | DECLARE_DRIVER_INIT(lsrquiz2); |
| 51 | | DECLARE_DRIVER_INIT(lasstixx); |
| 52 | | DECLARE_DRIVER_INIT(lsrquiz); |
| 53 | | }; |
| 54 | | |
| 55 | | /*----------- defined in machine/cd32.c -----------*/ |
| 56 | | |
| 57 | | class akiko_device : public device_t |
| 58 | | { |
| 59 | | public: |
| 60 | | akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 61 | | ~akiko_device() {} |
| 62 | | |
| 63 | | DECLARE_READ32_MEMBER( read ); |
| 64 | | DECLARE_WRITE32_MEMBER( write ); |
| 65 | | |
| 66 | | protected: |
| 67 | | // device-level overrides |
| 68 | | virtual void device_config_complete(); |
| 69 | | virtual void device_start(); |
| 70 | | virtual void device_stop(); |
| 71 | | virtual void device_reset(); |
| 72 | | |
| 73 | | private: |
| 74 | | // internal state |
| 75 | | address_space *m_space; |
| 76 | | |
| 77 | | /* chunky to planar converter */ |
| 78 | | UINT32 m_c2p_input_buffer[8]; |
| 79 | | UINT32 m_c2p_output_buffer[8]; |
| 80 | | UINT32 m_c2p_input_index; |
| 81 | | UINT32 m_c2p_output_index; |
| 82 | | |
| 83 | | /* i2c bus */ |
| 84 | | int m_i2c_scl_out; |
| 85 | | int m_i2c_scl_dir; |
| 86 | | int m_i2c_sda_out; |
| 87 | | int m_i2c_sda_dir; |
| 88 | | |
| 89 | | /* cdrom */ |
| 90 | | UINT32 m_cdrom_status[2]; |
| 91 | | UINT32 m_cdrom_address[2]; |
| 92 | | UINT32 m_cdrom_track_index; |
| 93 | | UINT32 m_cdrom_lba_start; |
| 94 | | UINT32 m_cdrom_lba_end; |
| 95 | | UINT32 m_cdrom_lba_cur; |
| 96 | | UINT16 m_cdrom_readmask; |
| 97 | | UINT16 m_cdrom_readreqmask; |
| 98 | | UINT32 m_cdrom_dmacontrol; |
| 99 | | UINT32 m_cdrom_numtracks; |
| 100 | | UINT8 m_cdrom_speed; |
| 101 | | UINT8 m_cdrom_cmd_start; |
| 102 | | UINT8 m_cdrom_cmd_end; |
| 103 | | UINT8 m_cdrom_cmd_resp; |
| 104 | | cdda_device *m_cdda; |
| 105 | | cdrom_file *m_cdrom; |
| 106 | | UINT8 * m_cdrom_toc; |
| 107 | | emu_timer *m_dma_timer; |
| 108 | | emu_timer *m_frame_timer; |
| 109 | | i2cmem_device *m_i2cmem; |
| 110 | | |
| 111 | | int m_cdrom_is_device; |
| 112 | | |
| 113 | | void nvram_write(UINT32 data); |
| 114 | | UINT32 nvram_read(); |
| 115 | | |
| 116 | | void c2p_write(UINT32 data); |
| 117 | | UINT32 c2p_read(); |
| 118 | | |
| 119 | | void cdda_stop(); |
| 120 | | void cdda_play(UINT32 lba, UINT32 num_blocks); |
| 121 | | void cdda_pause(int pause); |
| 122 | | UINT8 cdda_getstatus(UINT32 *lba); |
| 123 | | void set_cd_status(UINT32 status); |
| 124 | | |
| 125 | | TIMER_CALLBACK_MEMBER(frame_proc); |
| 126 | | TIMER_CALLBACK_MEMBER(dma_proc); |
| 127 | | |
| 128 | | void start_dma(); |
| 129 | | void setup_response( int len, UINT8 *r1 ); |
| 130 | | |
| 131 | | TIMER_CALLBACK_MEMBER( cd_delayed_cmd ); |
| 132 | | void update_cdrom(); |
| 133 | | }; |
| 134 | | |
| 135 | | extern const device_type AKIKO; |
| 136 | | |
| 137 | | |
| 138 | | #endif /* __CUBOCD32_H__ */ |