Previous 199869 Revisions Next

r20650 Friday 1st February, 2013 at 14:04:48 UTC by Angelo Salese
Made the comms hack more useful
[src/mame/drivers]saturn.c
[src/mame/includes]stv.h
[src/mess/machine]psxcd.c

trunk/src/mess/machine/psxcd.c
r20649r20650
88//
99
1010//#define debug_cdrom
11//#define debug_cdrom_registers
11#define debug_cdrom_registers
1212//#define skip_reads
1313//#define dump_subheader
1414//#define disable_xa_prefetch
r20649r20650
226226   }
227227
228228   #ifdef debug_cdrom_registers
229      printf("cdrom: read byte %08x = %02x (PC=%x)\n",offset,ret,m_maincpu->safe_pc());
229      printf("cdrom: read byte %08x = %02x\n",offset,ret);
230230   #endif
231231
232232   return ret;
r20649r20650
239239WRITE8_MEMBER( psxcd_device::write )
240240{
241241   #ifdef debug_cdrom_registers
242      printf("cdrom: write byte %08x = %02x (PC=%x)\n",offset,data,m_maincpu->safe_pc());
242      printf("cdrom: write byte %08x = %02x\n",offset,data);
243243   #endif
244244
245245   switch (offset&3)
trunk/src/mame/drivers/saturn.c
r20649r20650
2323- IC13 games on the dev bios doesn't even load the cartridge / crashes the emulation at start-up,
2424  rom rearrange needed?
2525- SCU DSP still has its fair share of issues, it also needs to be converted to CPU structure;
26- Add the RS232c interface (serial port),needed by fhboxers.
26- Add the RS232c interface (serial port), needed by fhboxers.
2727- Video emulation bugs: check stvvdp2.c file.
2828- Reimplement the idle skip if possible.
2929- Properly emulate the protection chips, used by several games (check stvprot.c for more info)
r20649r20650
386386      case 0xa4/4: /* IRQ control */
387387         if(LOG_SCU) logerror("PC=%08x IRQ status reg set:%08x %08x\n",space.device().safe_pc(),m_scu_regs[41],mem_mask);
388388         m_scu.ist &= m_scu_regs[offset];
389         //scu_test_pending_irq();
389         scu_test_pending_irq();
390390         break;
391391      case 0xa8/4: if(LOG_SCU) logerror("A-Bus IRQ ACK %08x\n",m_scu_regs[42]); break;
392392      case 0xc4/4: if(LOG_SCU) logerror("SCU SDRAM set: %02x\n",m_scu_regs[49]); break;
r20649r20650
639639   sh2_set_frt_input(m_maincpu, PULSE_LINE);
640640}
641641
642/*
643TODO:
644Some games seems to not like either MAME's interleave system and/or SH-2 DRC, causing an hard crash.
645Reported games are:
646Blast Wind (before FMV)
647Choro Q Park (car selection)
648060311E4: MOV.L R14,@-SP ;R14 = 0x60ffba0 / R15 = 0x60ffba0
649060311E6: MOV SP,R14 ;R14 = 0x60ffba0 / R15 = 0x60ffb9c / [0x60ffb9c] <- 0x60ffba0
650060311E8: MOV.L @SP+,R14 ;R14 = 0x60ffb9c / R15 = 0x60ffb9c / [0x60ffb9c] -> R14
651060311EA: RTS ;R14 = 0x60ffba0 / R15 = 0x60ffba0
652060311EC: NOP
65306031734: MULS.W R9, R8 ;R14 = 0x60ffba0 / R15 = 0x60ffba0 / EA = 0x60311E4
654on DRC this becomes:
655R14 0x6031b78 (cause of the crash later on), R15 = 0x60ffba4 and EA = 0
656
657Shinrei Jusatsushi Taromaru (options menu)
658
659*/
660
661WRITE32_MEMBER(saturn_state::saturn_minit_w)
662{
663   //logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space.device().tag(), space.device().safe_pc(),data);
664   if(m_fake_comms->read() & 1)
665      machine().scheduler().synchronize(); // force resync
666   else
667   {
668      machine().scheduler().boost_interleave(m_minit_boost_timeslice, attotime::from_usec(m_minit_boost));
669      machine().scheduler().trigger(1000);
670   }
671
672   sh2_set_frt_input(m_slave, PULSE_LINE);
673}
674
675WRITE32_MEMBER(saturn_state::saturn_sinit_w)
676{
677   //logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space.device().tag(), space.device().safe_pc(),data);
678   if(m_fake_comms->read() & 1)
679      machine().scheduler().synchronize(); // force resync
680   else
681      machine().scheduler().boost_interleave(m_sinit_boost_timeslice, attotime::from_usec(m_sinit_boost));
682
683   sh2_set_frt_input(m_maincpu, PULSE_LINE);
684}
685
686
642687READ8_MEMBER(saturn_state::saturn_backupram_r)
643688{
644689   if(!(offset & 1))
r20649r20650
730775   AM_RANGE(0x00100000, 0x0010007f) AM_READWRITE8(saturn_SMPC_r, saturn_SMPC_w,0xffffffff)
731776   AM_RANGE(0x00180000, 0x0018ffff) AM_READWRITE8(saturn_backupram_r, saturn_backupram_w,0xffffffff) AM_SHARE("share1")
732777   AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_MIRROR(0x20100000) AM_SHARE("workram_l")
733   AM_RANGE(0x01000000, 0x017fffff) AM_WRITE(minit_w)
734   AM_RANGE(0x01800000, 0x01ffffff) AM_WRITE(sinit_w)
778   AM_RANGE(0x01000000, 0x017fffff) AM_WRITE(saturn_minit_w)
779   AM_RANGE(0x01800000, 0x01ffffff) AM_WRITE(saturn_sinit_w)
735780   AM_RANGE(0x02000000, 0x023fffff) AM_ROM AM_SHARE("share7") AM_REGION("maincpu", 0x80000)    // cartridge space
736781//  AM_RANGE(0x02400000, 0x027fffff) AM_RAM //cart RAM area, dynamically allocated
737782//  AM_RANGE(0x04000000, 0x047fffff) AM_RAM //backup RAM area, dynamically allocated
r20649r20650
11871232   PORT_CONFSETTING(0x90,"<unconnected>")
11881233
11891234   PORT_START("fake")
1190   PORT_CONFNAME(0x01,0x00,"Master-Slave Comms Hack")
1191   PORT_CONFSETTING(0x00,"No")
1192   PORT_CONFSETTING(0x01,"Yes")
1235   PORT_CONFNAME(0x01,0x00,"Master-Slave Comms")
1236   PORT_CONFSETTING(0x00,"Normal (400 cycles)")
1237   PORT_CONFSETTING(0x01,"One Shot (Hack)")
11931238INPUT_PORTS_END
11941239
11951240#define STV_PLAYER_INPUTS(_n_, _b1_, _b2_, _b3_,_b4_)                       \
r20649r20650
23642409MACHINE_CONFIG_END
23652410
23662411
2367/* we use a clever hack here. Basically 0x60ffc13 is used for master slave comms, synching there should avoid crashes in several spots. */
2368READ32_MEMBER(saturn_state::workram_h_comms_r)
2369{
2370   if(m_fake_comms->read() & 1)
2371      machine().scheduler().synchronize(); // force resync
23722412
2373   return m_workram_h[0x0ffc10/4];
2374}
2375
2376WRITE32_MEMBER(saturn_state::workram_h_comms_w)
2377{
2378   if(m_fake_comms->read() & 1)
2379      machine().scheduler().synchronize(); // force resync
2380
2381   COMBINE_DATA(&m_workram_h[0x0ffc10/4]);
2382}
2383
2384
23852413void saturn_state::saturn_init_driver(int rgn)
23862414{
23872415   m_saturn_region = rgn;
r20649r20650
23912419   sh2drc_set_options(machine().device("maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
23922420   sh2drc_set_options(machine().device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
23932421
2394   machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x060ffc10, 0x060ffc13, read32_delegate(FUNC(saturn_state::workram_h_comms_r),this));
2395   machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x060ffc10, 0x060ffc13, write32_delegate(FUNC(saturn_state::workram_h_comms_w),this));
2396   machine().device("slave")->memory().space(AS_PROGRAM).install_read_handler(0x060ffc10, 0x060ffc13, read32_delegate(FUNC(saturn_state::workram_h_comms_r),this));
2397   machine().device("slave")->memory().space(AS_PROGRAM).install_write_handler(0x060ffc10, 0x060ffc13, write32_delegate(FUNC(saturn_state::workram_h_comms_w),this));
2398
23992422   /* amount of time to boost interleave for on MINIT / SINIT, needed for communication to work */
24002423   m_minit_boost = 400;
24012424   m_sinit_boost = 400;
trunk/src/mame/includes/stv.h
r20649r20650
4141      UINT8     enable_mask[3];
4242      UINT32    ist;
4343      UINT32    ism;
44      UINT32    illegal_factor[3];
4445   }m_scu;
4546
4647   int       m_minit_boost;
r20649r20650
222223   DECLARE_READ16_MEMBER(saturn_soundram_r);
223224   DECLARE_WRITE32_MEMBER(minit_w);
224225   DECLARE_WRITE32_MEMBER(sinit_w);
226   DECLARE_WRITE32_MEMBER(saturn_minit_w);
227   DECLARE_WRITE32_MEMBER(saturn_sinit_w);
225228   DECLARE_READ8_MEMBER(saturn_backupram_r);
226229   DECLARE_WRITE8_MEMBER(saturn_backupram_w);
227230   DECLARE_READ8_MEMBER(saturn_cart_type_r);
r20649r20650
234237   DECLARE_WRITE32_MEMBER(saturn_cart_dram1_w);
235238   DECLARE_READ32_MEMBER(saturn_cs1_r);
236239   DECLARE_WRITE32_MEMBER(saturn_cs1_w);
237   DECLARE_READ32_MEMBER(workram_h_comms_r);
238   DECLARE_WRITE32_MEMBER(workram_h_comms_w);
239240   WRITE_LINE_MEMBER(scsp_to_main_irq);
240241   void saturn_init_driver(int rgn);
241242

Previous 199869 Revisions Next


© 1997-2024 The MAME Team