Previous 15994 Revisions Next

r9367 Tuesday 12th October, 2010 at 22:39:59 UTC by Angelo Salese
Fix for MAME side of things
[src/mame/drivers]megadriv.c

src/mame/drivers/megadriv.c
r9366r9367
270270#include "includes/megadriv.h"
271271#include "cpu/sh2/sh2.h"
272272#include "cpu/sh2/sh2comn.h"
273#include "sound/cdda.h"
274#ifdef MESS
273275#include "devices/chd_cd.h"
274#include "sound/cdda.h"
276#endif
275277
276278#define MEGADRIV_VDP_VRAM(address) megadrive_vdp_vram[(address)&0x7fff]
277279
r9366r9367
396398   UINT8 ext;
397399   UINT8 ctrl;
398400}segacd_cdd;
401#ifdef MESS
399402static struct
400403{
401404   UINT32   current_frame;
r9366r9367
405408   cdrom_file   *cd;
406409   const cdrom_toc*   toc;
407410}segacd;
411#endif
408412
409413static void segacd_mark_tiles_dirty(running_machine* machine, int offset);
410414
r9366r9367
869873      {
870874         source -= 2; // the SVP introduces some kind of DMA 'lag', which we have to compensate for, this is obvious even on gfx DMAd from ROM (the Speedometer)
871875      }
872     
876
873877      // likewise segaCD, at least when reading wordram?
874878      // we might need to check what mode we're in here..
875879      if (segacd_wordram_mapped)
r9366r9367
46444648   memory_set_bankptr(space->machine,  "scd_4m_prgbank", segacd_4meg_prgram + segacd_4meg_prgbank * 0x20000 );
46454649   memory_install_write16_handler (space, 0x0020000, 0x003ffff, 0, 0, scd_4m_prgbank_ram_w );
46464650   segacd_wordram_mapped = 1;
4647   
46484651
4652
46494653   memory_install_readwrite16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x200000, 0x23ffff, 0, 0, segacd_main_dataram_part1_r, segacd_main_dataram_part1_w); // RAM shared with sub
46504654
46514655   memory_install_readwrite16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa12000, 0xa12001, 0, 0, scd_a12000_halt_reset_r, scd_a12000_halt_reset_w); // sub-cpu control
r9366r9367
47174721
47184722   /* init cd-rom device */
47194723
4724   #ifdef MESS
47204725   {
47214726      running_device *device;
47224727
r9366r9367
47344739         }
47354740      }
47364741   }
4742   #endif
47374743}
47384744
47394745
r9366r9367
49514957   "Invalid 0xF",
49524958};
49534959
4960#ifdef MESS
49544961static void segacd_cdd_get_status(running_machine *machine)
49554962{
49564963   // ...
r9366r9367
50335040   cdd_hock_irq(machine,1);
50345041}
50355042
5043#endif
5044
50365045static WRITE8_HANDLER( segacd_cdd_tx_w )
50375046{
50385047   //printf("CDD Communication write %02x -> [%02x]\n",data,offset);
50395048   segacd_cdd_tx[offset] = data & 0xf;
50405049
5050   #ifdef MESS
50415051   if(offset == 9) //execute the command when crc is sent (TODO: I wonder if we need to check if crc is valid. Plus obviously this shouldn't be instant)
50425052   {
50435053      logerror("CDD: command %s issued\n",segacd_cdd_cmd[segacd_cdd_tx[0] & 0xf]);
r9366r9367
50505060         //default: logerror("CDD: unhandled command %s issued\n",segacd_cdd_cmd[segacd_cdd_tx[0] & 0xf]);
50515061      }
50525062   }
5063   #endif
50535064}
50545065
50555066
r9366r9367
51125123      segacd_mark_stampmaps_dirty();
51135124
51145125      segacd_conversion_active = 1;
5115     
5126
51165127      // todo: proper time calculation
51175128      timer_adjust_oneshot(segacd_gfx_conversion_timer, ATTOTIME_IN_HZ(1000), 0);
51185129
r9366r9367
51425153         x = BITMAP_ADDR16(srcbitmap,10,10);
51435154         UINT16 datax;
51445155         datax = x[0];
5145         
5156
51465157         // I don't quite understand what happens if the lower bits of hdotsize are set.. do we end up rounding up?
51475158         // this 'buffersize' clearly fills the frame for the SegaCD logo screen at least
51485159         int buffersize = ((segacd_imagebuffer_vcell_size+1) * (segacd_imagebuffer_hdot_size>>3)*0x20)/2;  // 0x20 = 8x8x4 tile, /2 due to word offset
51495160         //buffersize -= 8;
5150         
5161
51515162         for (int i=0;i< buffersize ;i++)
51525163         {
51535164            int offsetx = ((segacd_imagebuffer_start_address&0xfff8)*2)+i;
r9366r9367
52255236static READ16_HANDLER( segacd_imagebuffer_vcell_size_r )
52265237{
52275238   return segacd_imagebuffer_vcell_size;
5228}   
5239}
52295240
52305241static WRITE16_HANDLER( segacd_imagebuffer_vcell_size_w )
52315242{
r9366r9367
52365247static READ16_HANDLER( segacd_imagebuffer_hdot_size_r )
52375248{
52385249   return segacd_imagebuffer_hdot_size;
5239}   
5250}
52405251
52415252static WRITE16_HANDLER( segacd_imagebuffer_hdot_size_w )
52425253{
r9366r9367
82238234   MDRV_SOUND_ROUTE( 0, "lspeaker", 1.00 )
82248235   MDRV_SOUND_ROUTE( 1, "rspeaker", 1.00 )
82258236
8237   #ifdef MESS
82268238   MDRV_CDROM_ADD( "cdrom" )
8239   #endif
82278240MACHINE_CONFIG_END
82288241
82298242MACHINE_CONFIG_DERIVED( genesis_32x_scd, genesis_32x )
r9366r9367
82358248   MDRV_SOUND_ROUTE( 0, "lspeaker", 1.00 )
82368249   MDRV_SOUND_ROUTE( 1, "rspeaker", 1.00 )
82378250
8251   #ifdef MESS
82388252   MDRV_CDROM_ADD( "cdrom" )
8253   #endif
82398254MACHINE_CONFIG_END
82408255
82418256

Previous 15994 Revisions Next


© 1998-2018 The MESS Team