trunk/src/mess/includes/gba.h
| r20537 | r20538 | |
| 2 | 2 | #define _GBA_H_ |
| 3 | 3 | |
| 4 | 4 | #include "machine/intelfsh.h" |
| 5 | #include "sound/dac.h" |
| 5 | 6 | |
| 6 | 7 | #define DISPSTAT_VBL 0x0001 |
| 7 | 8 | #define DISPSTAT_HBL 0x0002 |
| r20537 | r20538 | |
| 138 | 139 | public: |
| 139 | 140 | gba_state(const machine_config &mconfig, device_type type, const char *tag) |
| 140 | 141 | : driver_device(mconfig, type, tag), |
| 142 | m_maincpu(*this, "maincpu"), |
| 141 | 143 | m_gba_pram(*this, "gba_pram"), |
| 142 | 144 | m_gba_vram(*this, "gba_vram"), |
| 143 | | m_gba_oam(*this, "gba_oam") { } |
| 145 | m_gba_oam(*this, "gba_oam"), |
| 146 | m_ladac(*this, "direct_a_left"), |
| 147 | m_radac(*this, "direct_a_right"), |
| 148 | m_lbdac(*this, "direct_b_left"), |
| 149 | m_rbdac(*this, "direct_b_right"), |
| 150 | m_gbsound(*this, "custom"){ } |
| 144 | 151 | |
| 152 | required_device<cpu_device> m_maincpu; |
| 145 | 153 | required_shared_ptr<UINT32> m_gba_pram; |
| 146 | 154 | required_shared_ptr<UINT32> m_gba_vram; |
| 147 | 155 | required_shared_ptr<UINT32> m_gba_oam; |
| 156 | required_device<dac_device> m_ladac; |
| 157 | required_device<dac_device> m_radac; |
| 158 | required_device<dac_device> m_lbdac; |
| 159 | required_device<dac_device> m_rbdac; |
| 160 | required_device<device_t> m_gbsound; |
| 148 | 161 | |
| 162 | void request_irq(UINT32 int_type); |
| 163 | void dma_exec(FPTR ch); |
| 164 | void audio_tick(int ref); |
| 165 | |
| 166 | // video-related |
| 149 | 167 | virtual void video_start(); |
| 150 | | |
| 151 | 168 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 152 | | |
| 153 | 169 | bitmap_ind16 m_bitmap; |
| 154 | 170 | |
| 155 | 171 | UINT32 m_DISPSTAT; |
| r20537 | r20538 | |
| 187 | 203 | INT32 m_gfxBG3X; |
| 188 | 204 | INT32 m_gfxBG3Y; |
| 189 | 205 | |
| 206 | // DMA |
| 207 | emu_timer *m_dma_timer[4]; |
| 208 | UINT32 m_dma_regs[16]; |
| 209 | UINT32 m_dma_src[4]; |
| 210 | UINT32 m_dma_dst[4]; |
| 211 | UINT32 m_dma_cnt[4]; |
| 212 | UINT32 m_dma_srcadd[4]; |
| 213 | UINT32 m_dma_dstadd[4]; |
| 190 | 214 | |
| 191 | | |
| 192 | | UINT32 m_dma_regs[16]; |
| 193 | | UINT32 m_dma_src[4], m_dma_dst[4], m_dma_cnt[4], m_dma_srcadd[4], m_dma_dstadd[4]; |
| 215 | // Timers |
| 194 | 216 | UINT32 m_timer_regs[4]; |
| 195 | 217 | UINT16 m_timer_reload[4]; |
| 196 | 218 | int m_timer_recalc[4]; |
| 197 | 219 | |
| 220 | // Storage |
| 198 | 221 | UINT32 m_gba_sram[0x10000/4]; |
| 199 | 222 | UINT8 m_gba_eeprom[0x2000]; |
| 200 | 223 | UINT32 m_flash_size; |
| 201 | 224 | UINT32 m_flash_mask; |
| 202 | 225 | intelfsh8_device *m_mFlashDev; |
| 203 | | int m_eeprom_state, m_eeprom_command, m_eeprom_count, m_eeprom_addr, m_eeprom_bits, m_eeprom_addr_bits; |
| 226 | int m_eeprom_state; |
| 227 | int m_eeprom_command; |
| 228 | int m_eeprom_count; |
| 229 | int m_eeprom_addr; |
| 230 | int m_eeprom_bits; |
| 231 | int m_eeprom_addr_bits; |
| 204 | 232 | UINT8 m_eep_data; |
| 205 | 233 | |
| 206 | 234 | /* nvram-specific for MESS */ |
| r20537 | r20538 | |
| 208 | 236 | UINT32 m_nvsize; |
| 209 | 237 | device_t *m_nvimage; |
| 210 | 238 | |
| 211 | | emu_timer *m_dma_timer[4], *m_tmr_timer[4], *m_irq_timer; |
| 239 | emu_timer *m_tmr_timer[4], *m_irq_timer; |
| 212 | 240 | emu_timer *m_scan_timer, *m_hbl_timer; |
| 213 | 241 | |
| 214 | 242 | double m_timer_hz[4]; |
| 215 | 243 | |
| 216 | | int m_fifo_a_ptr, m_fifo_b_ptr, m_fifo_a_in, m_fifo_b_in; |
| 217 | | UINT8 m_fifo_a[20], m_fifo_b[20]; |
| 244 | int m_fifo_a_ptr; |
| 245 | int m_fifo_b_ptr; |
| 246 | int m_fifo_a_in; |
| 247 | int m_fifo_b_in; |
| 248 | UINT8 m_fifo_a[20]; |
| 249 | UINT8 m_fifo_b[20]; |
| 218 | 250 | UINT32 m_xferscan[7][240+2048]; |
| 219 | 251 | |
| 220 | 252 | UINT32 m_bios_last_address; |