Previous 199869 Revisions Next

r24032 Monday 1st July, 2013 at 16:23:54 UTC by Angelo Salese
Some harmless mods to DC GD-Rom
[src/mess/drivers]dccons.c
[src/mess/includes]dccons.h
[src/mess/machine]dccons.c

trunk/src/mess/machine/dccons.c
r24031r24032
1111
1212    cfffee0 - stack location when bad happens
1313
14   TODO:
15   - gdrom_alt_status is identical to normal status except that "but it does not clear DMA status information when it is accessed"
16
1417*/
1518
1619#include "emu.h"
r24031r24032
267270      atapi_data[atapi_data_ptr++] = data & 0xff;
268271      atapi_data[atapi_data_ptr++] = data >> 8;
269272
273      //printf("%02x %02x %d\n",data & 0xff, data >> 8,atapi_data_ptr);
274
270275      if (atapi_cdata_wait)
271276      {
272277//                  printf("ATAPI: waiting, ptr %d wait %d\n", atapi_data_ptr, atapi_cdata_wait);
r24031r24032
651656   return reg;
652657}
653658
654READ64_MEMBER(dc_cons_state::dc_mess_g1_ctrl_r )
659READ32_MEMBER(dc_cons_state::dc_mess_g1_ctrl_r )
655660{
656   int reg;
657   UINT64 shift;
658
659   reg = decode_reg32_64(offset, mem_mask, &shift);
660   mame_printf_verbose("G1CTRL:  Unmapped read %08x\n", 0x5f7400+reg*4);
661   return (UINT64)g1bus_regs[reg] << shift;
661   switch(offset)
662   {
663      case SB_GDST:
664         break;
665      case SB_GDLEND:
666         //debugger_break(machine());
667         return atapi_xferlen; // TODO: check me
668      default:
669         printf("G1CTRL:  Unmapped read %08x\n", 0x5f7400+offset*4);
670         debugger_break(machine());
671   }
672   return g1bus_regs[offset];
662673}
663674
664WRITE64_MEMBER(dc_cons_state::dc_mess_g1_ctrl_w )
675WRITE32_MEMBER(dc_cons_state::dc_mess_g1_ctrl_w )
665676{
666   int reg;
667   UINT64 shift;
668   UINT32 dat; //, old
669
670   reg = decode_reg32_64(offset, mem_mask, &shift);
671   dat = (UINT32)(data >> shift);
672//  old = g1bus_regs[reg];
673
674   g1bus_regs[reg] = dat; // 5f7400+reg*4=dat
675   mame_printf_verbose("G1CTRL: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x5f7400+reg*4, dat, data, offset, mem_mask);
676   switch (reg)
677   g1bus_regs[offset] = data; // 5f7400+reg*4=dat
678//   mame_printf_verbose("G1CTRL: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x5f7400+reg*4, dat, data, offset, mem_mask);
679   switch (offset)
677680   {
678681   case SB_GDST:
679      if (dat & 1 && g1bus_regs[SB_GDEN] == 1) // 0 -> 1
682      if (data & 1 && g1bus_regs[SB_GDEN] == 1) // 0 -> 1
680683      {
681684         if (g1bus_regs[SB_GDDIR] == 0)
682685         {
trunk/src/mess/includes/dccons.h
r24031r24032
3030   inline int decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift);
3131   READ64_MEMBER( dc_mess_gdrom_r );
3232   WRITE64_MEMBER( dc_mess_gdrom_w );
33   READ64_MEMBER( dc_mess_g1_ctrl_r );
34   WRITE64_MEMBER( dc_mess_g1_ctrl_w );
33   READ32_MEMBER( dc_mess_g1_ctrl_r );
34   WRITE32_MEMBER( dc_mess_g1_ctrl_w );
3535
3636private:
3737   UINT64 PDTRA, PCTRA;
trunk/src/mess/drivers/dccons.c
r24031r24032
116116   AM_RANGE(0x005f6800, 0x005f69ff) AM_READWRITE(dc_sysctrl_r, dc_sysctrl_w )
117117   AM_RANGE(0x005f6c00, 0x005f6cff) AM_DEVICE32( "maple_dc", maple_dc_device, amap, U64(0xffffffffffffffff) )
118118   AM_RANGE(0x005f7000, 0x005f70ff) AM_READWRITE(dc_mess_gdrom_r, dc_mess_gdrom_w )
119   AM_RANGE(0x005f7400, 0x005f74ff) AM_READWRITE(dc_mess_g1_ctrl_r, dc_mess_g1_ctrl_w )
119   AM_RANGE(0x005f7400, 0x005f74ff) AM_READWRITE32(dc_mess_g1_ctrl_r, dc_mess_g1_ctrl_w, U64(0xffffffffffffffff) )
120120   AM_RANGE(0x005f7800, 0x005f78ff) AM_READWRITE(dc_g2_ctrl_r, dc_g2_ctrl_w )
121121   AM_RANGE(0x005f7c00, 0x005f7cff) AM_DEVICE32("powervr2", powervr2_device, pd_dma_map, U64(0xffffffffffffffff))
122122   AM_RANGE(0x005f8000, 0x005f9fff) AM_DEVICE32("powervr2", powervr2_device, ta_map, U64(0xffffffffffffffff))

Previous 199869 Revisions Next


© 1997-2024 The MAME Team