Previous 199869 Revisions Next

r21291 Thursday 21st February, 2013 at 22:33:10 UTC by Angelo Salese
Default for ISM, there were some spurious irqs at boot ...
[src/mame/drivers]saturn.c
[src/mame/includes]stv.h

trunk/src/mame/drivers/saturn.c
r21290r21291
191191#define DRUP(_lv_)                    (m_scu_regs[5+(_lv_*8)] & 0x00010000)
192192#define DWUP(_lv_)                    (m_scu_regs[5+(_lv_*8)] & 0x00000100)
193193
194#define DMA_STATUS              (m_scu_regs[31])
195194/*These macros sets the various DMA status flags.*/
196#define DnMV_1(_ch_) DMA_STATUS|=(0x10 << 4 * _ch_)
197#define DnMV_0(_ch_) DMA_STATUS&=~(0x10 << 4 * _ch_)
195#define DnMV_1(_ch_) m_scu.status|=(0x10 << 4 * _ch_)
196#define DnMV_0(_ch_) m_scu.status&=~(0x10 << 4 * _ch_)
198197
199198/*For area checking*/
200199#define BIOS_BUS(var)   (var & 0x07000000) == 0
r21290r21291
258257      case 0x5c/4:
259258      //  Super Major League and Shin Megami Tensei - Akuma Zensho reads from there (undocumented), DMA status mirror?
260259         if(LOG_SCU && !space.debugger_access()) logerror("(PC=%08x) DMA status reg read\n",space.device().safe_pc());
261         res = m_scu_regs[0x7c/4];
260         res = m_scu.status;
262261         break;
263262      case 0x7c/4:
264263         if(LOG_SCU && !space.debugger_access()) logerror("(PC=%08x) DMA status reg read\n",space.device().safe_pc());
265         res = m_scu_regs[offset];
264         res = m_scu.status;
266265         break;
267266      case 0x80/4:
268267         res = dsp_prg_ctrl_r(space);
r21290r21291
366365         m_scu.ist &= m_scu_regs[offset];
367366         scu_test_pending_irq();
368367         break;
369      case 0xa8/4: if(LOG_SCU) logerror("A-Bus IRQ ACK %08x\n",m_scu_regs[42]); break;
368      case 0xa8/4:
369         /* This sends an irq signal to the extra devices connected to the A-Bus, not really needed for now. */
370         //if(LOG_SCU) logerror("A-Bus IRQ ACK %08x\n",m_scu_regs[42]);
371         break;
370372      case 0xc4/4: if(LOG_SCU) logerror("SCU SDRAM set: %02x\n",m_scu_regs[49]); break;
371373      default: if(LOG_SCU) logerror("Warning: unused SCU reg set %d = %08x\n",offset,data);
372374   }
r21290r21291
16631665      m_cart_backupram[offset*2+1] = (data & 0x000000ff) >> 0;
16641666}
16651667
1668void saturn_state::scu_reset(void)
1669{
1670   m_scu.ism = 0xbfff;
1671   m_scu.ist = 0;
1672   m_scu.start_factor[0] = 7;
1673   m_scu.start_factor[1] = 7;
1674   m_scu.start_factor[2] = 7;
1675   m_scu.status = 0;
1676}
1677
16661678MACHINE_RESET_MEMBER(saturn_state,saturn)
16671679{
16681680   m_scsp_last_line = 0;
r21290r21291
16731685
16741686   m_smpc.SR = 0x40;   // this bit is always on according to docs
16751687
1688   scu_reset();
1689
16761690   m_en_68k = 0;
16771691   m_NMI_reset = 0;
16781692   m_smpc.slave_on = 0;
16791693
1680   m_scu_regs[31] = 0; //DMA_STATUS = 0;
16811694
16821695   //memset(stv_m_workram_l, 0, 0x100000);
16831696   //memset(stv_m_workram_h, 0, 0x100000);
r21290r21291
17321745      machine().device("slave")->memory().space(AS_PROGRAM).install_readwrite_handler(0x04000000, 0x04000000 | mask, read32_delegate(FUNC(saturn_state::saturn_cs1_r),this), write32_delegate(FUNC(saturn_state::saturn_cs1_w),this));
17331746   }
17341747
1735
1736   /* TODO: default value is probably 7 */
1737   m_scu.start_factor[0] = -1;
1738   m_scu.start_factor[1] = -1;
1739   m_scu.start_factor[2] = -1;
1740
17411748   m_vdp2.old_crmd = -1;
17421749   m_vdp2.old_tvmd = -1;
17431750
r21290r21291
17661773   m_stv_rtc_timer->adjust(attotime::zero, 0, attotime::from_seconds(1));
17671774   m_prev_bankswitch = 0xff;
17681775
1769   /* TODO: default value is probably 7 */
1770   m_scu.start_factor[0] = -1;
1771   m_scu.start_factor[1] = -1;
1772   m_scu.start_factor[2] = -1;
1776   scu_reset();
17731777
17741778   m_vdp2.old_crmd = -1;
17751779   m_vdp2.old_tvmd = -1;
r21290r21291
19131917   m_minit_boost_timeslice = attotime::zero;
19141918   m_sinit_boost_timeslice = attotime::zero;
19151919
1916   m_scu_regs = auto_alloc_array(machine(), UINT32, 0x100/4);
1917   m_scsp_regs = auto_alloc_array(machine(), UINT16, 0x1000/2);
1918   m_cart_dram = auto_alloc_array(machine(), UINT32, 0x400000/4);
1919   m_backupram = auto_alloc_array(machine(), UINT8, 0x8000);
1920   m_cart_backupram = auto_alloc_array(machine(), UINT8, 0x400000);
1920   m_scu_regs = auto_alloc_array_clear(machine(), UINT32, 0x100/4);
1921   m_scsp_regs = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
1922   m_cart_dram = auto_alloc_array_clear(machine(), UINT32, 0x400000/4);
1923   m_backupram = auto_alloc_array_clear(machine(), UINT8, 0x8000);
1924   m_cart_backupram = auto_alloc_array_clear(machine(), UINT8, 0x400000);
19211925}
19221926
19231927DRIVER_INIT_MEMBER(saturn_state,saturnus)
trunk/src/mame/includes/stv.h
r21290r21291
4747      UINT32    ist;
4848      UINT32    ism;
4949      UINT32    illegal_factor[3];
50      UINT32    status;
5051   }m_scu;
5152
53   void scu_reset(void);
54
5255   int       m_minit_boost;
5356   int       m_sinit_boost;
5457   attotime  m_minit_boost_timeslice;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team