Previous 15994 Revisions Next

r9358 Sunday 10th October, 2010 at 23:19:34 UTC by Angelo Salese
[Mega CD]: hooked up irq1 [David Haywood]
[src/mame/drivers]megadriv.c

src/mame/drivers/megadriv.c
r9357r9358
322322static UINT16* _32x_palette_lookup;
323323/* SegaCD! */
324324static cpu_device *_segacd_68k_cpu;
325static emu_timer *segacd_gfx_conversion_timer;
326
325327/* SVP (virtua racing) */
326328static cpu_device *_svp_cpu;
327329
r9357r9358
41104112static int segacd_cdc_regaddress;
41114113static int segacd_cdc_destination_device;
41124114static UINT8 segacd_cdc_registers[0x10];
4115int segacd_conversion_active = 0;
41134116
41144117static WRITE16_HANDLER( segacd_cdc_mode_address_w )
41154118{
r9357r9358
42714274}
42724275
42734276
4277static TIMER_CALLBACK( segacd_gfx_conversion_timer_callback )
4278{
4279   // todo irqmask
4280
4281   printf("segacd_gfx_conversion_timer_callback\n");
4282
4283   if (segacd_irq_mask & 0x02)
4284      cputag_set_input_line(machine, "segacd_68k", 1, HOLD_LINE);
4285   
4286   segacd_conversion_active = 0;
4287}
4288
4289
4290
42744291/* main CPU map set up in INIT */
42754292void segacd_init_main_cpu( running_machine* machine )
42764293{
r9357r9358
43034320
43044321   memory_install_read16_handler (space, 0x0000070, 0x0000073, 0, 0, scd_hint_vector_r );
43054322
4323   segacd_gfx_conversion_timer = timer_alloc(machine, segacd_gfx_conversion_timer_callback, 0);
4324   timer_adjust_oneshot(segacd_gfx_conversion_timer, attotime_never, 0);
43064325
43074326}
43084327
r9357r9358
45794598   }
45804599}
45814600
4601int segacd_stampsize;
45824602
4603static READ16_HANDLER( segacd_stampsize_r )
4604{
4605   UINT16 retdata = 0x0000;
4606
4607   retdata |= segacd_conversion_active<<15;
4608
4609   retdata |= segacd_stampsize & 0x7;
4610
4611   return retdata;
4612
4613}
4614
4615static WRITE16_HANDLER( segacd_stampsize_w )
4616{
4617   printf("segacd_stampsize_w %04x %04x\n",data, mem_mask);
4618   if (ACCESSING_BITS_0_7)
4619   {
4620      segacd_stampsize = data & 0x07;
4621      if (data & 0xf8)
4622         printf("    unused bits (LSB) set in stampsize!\n");
4623
4624      if (data&1) printf("    Repeat On\n");
4625      else printf("    Repeat Off\n");
4626
4627      if (data&2) printf("    32x32 dots\n");
4628      else printf("    16x16 dots\n");
4629
4630      if (data&4) printf("    16x16 screens\n");
4631      else printf("    1x1 screen\n");
4632
4633
4634   }
4635   
4636   if (ACCESSING_BITS_8_15)
4637   {
4638      if (data&0xff00) printf("    unused bits (MSB) set in stampsize!\n");
4639   }
4640}
4641
4642// this triggers the conversion operation, which will cause an IRQ1 when finished
4643WRITE16_HANDLER( segacd_trace_vector_base_address_w )
4644{
4645   if (segacd_ram_mode==1)
4646   {
4647      printf("ILLEGAL: segacd_trace_vector_base_address_w %04x %04x in mode 1!\n",data,mem_mask);
4648   }
4649
4650   printf("segacd_trace_vector_base_address_w %04x %04x\n",data,mem_mask);
4651
4652   segacd_conversion_active = 1;
4653
4654   timer_adjust_oneshot(segacd_gfx_conversion_timer, ATTOTIME_IN_HZ(1), 0);
4655}
4656
45834657static ADDRESS_MAP_START( segacd_map, ADDRESS_SPACE_PROGRAM, 16 )
45844658   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_BASE(&segacd_4meg_prgram)
45854659
r9357r9358
46094683//   AM_RANGE(0xff804c, 0xff804d) // Font Color
46104684//   AM_RANGE(0xff804e, 0xff804f) // Font bit
46114685//   AM_RANGE(0xff8050, 0xff8057) // Font data (read only)
4612//   AM_RANGE(0xff8058, 0xff8059) // Stamp size
4686   AM_RANGE(0xff8058, 0xff8059) AM_READWRITE(segacd_stampsize_r, segacd_stampsize_w) // Stamp size
46134687//   AM_RANGE(0xff805a, 0xff805b) // Stamp map base address
46144688//   AM_RANGE(0xff805c, 0xff805d) // Image buffer V cell size
46154689//   AM_RANGE(0xff805e, 0xff805f) // Image buffer start address
46164690//   AM_RANGE(0xff8060, 0xff8061) // Image buffer offset
46174691//   AM_RANGE(0xff8062, 0xff8063) // Image buffer H dot size
46184692//   AM_RANGE(0xff8064, 0xff8065) // Image buffer V dot size
4619//   AM_RANGE(0xff8066, 0xff8067) // Trace vector base address
4693   AM_RANGE(0xff8066, 0xff8067) AM_WRITE(segacd_trace_vector_base_address_w)// Trace vector base address
46204694//   AM_RANGE(0xff8068, 0xff8069) // Subcode address
46214695
46224696//   AM_RANGE(0xff8100, 0xff817f) // Subcode buffer area

Previous 15994 Revisions Next


© 1998-2018 The MESS Team