示例#1
0
        public override int start(Mame.MachineSound msound)
        {
            int i;

            if (Mame.sndintf[Mame.SOUND_AY8910].start(msound) != 0) return 1;

            intf = (YM2203interface)msound.sound_interface;

            /* Timer Handler set */
            FMTimerInit();
            /* stream system initialize */
            for (i = 0; i < intf.num; i++)
            {
                int volume;
                string name = Mame.sprintf("%s #%d FM", Mame.sound_name(msound), i);
                volume = intf.mixing_level[i] >> 16; /* high 16 bit */
                stream[i] = Mame.stream_init(name, volume, Mame.Machine.sample_rate, i, FM.YM2203UpdateOne/*YM2203UpdateCallback*/);
            }
            /* Initialize FM emurator */
            if (FM.YM2203Init(intf.num, intf.baseclock, Mame.Machine.sample_rate, TimerHandler, IRQHandler) == 0)
            {
                /* Ready */
                return 0;
            }
            /* error */
            /* stream close */
            return 1;
        }
示例#2
0
 public POKEYinterface(int num, int baseclock, int[] mixing_level,
     pot_delegate[] pot0_r, pot_delegate[] pot1_r, pot_delegate[] pot2_r,
     pot_delegate[] pot3_r, pot_delegate[] pot4_r, pot_delegate[] pot5_r,
     pot_delegate[] pot6_r, pot_delegate[] pot7_r, pot_delegate[] allpot_r,
     pot_delegate[] serin_r = null, pokey_serout[] serout_w = null, Mame.irqcallback[] interrupt_cb = null)
 {
     this.num = num; this.baseclock = baseclock; this.mixing_level = mixing_level;
     this.pot0_r = pot0_r;
     this.pot1_r = pot1_r;
     this.pot2_r = pot2_r;
     this.pot3_r = pot3_r;
     this.pot4_r = pot4_r;
     this.pot5_r = pot5_r;
     this.pot6_r = pot6_r;
     this.pot7_r = pot7_r;
     this.allpot_r = allpot_r;
     if (serin_r == null)
         this.serin_r = new pot_delegate[] { null };
     else
         this.serin_r = serin_r;
     if (serout_w == null)
         this.serout_w = new pokey_serout[] { null };
     else
         this.serout_w = serout_w;
     if (interrupt_cb == null)
         this.interrupt_cb = new Mame.irqcallback[] { null };
     else
         this.interrupt_cb = interrupt_cb;
 }
示例#3
0
        public override int start(Mame.MachineSound msound)
        {
            /* save a global pointer to our interface */
            msm5205_intf = (MSM5205_interface)msound.sound_interface;

            /* compute the difference tables */
            ComputeTables();

            /* initialize the voices */
            //memset (msm5205, 0, sizeof (msm5205));

            /* stream system initialize */
            for (int i = 0; i < msm5205_intf.num; i++)
            {
                MSM5205Voice voice = msm5205[i];
                string name = Mame.sprintf("MSM5205 #%d", i);
                voice.stream = Mame.stream_init(name, msm5205_intf.mixing_level[i],
                                        Mame.Machine.sample_rate, i,
                                        MSM5205_update);
            }
            /* initialize */
            MSM5205_sh_reset();
            /* success */
            return 0;
        }
示例#4
0
 public static void cinemat_select_artwork(int monitor_type, int overlay_req, int backdrop_req, Mame.artwork_element simple_overlay)
 {
     cinemat_monitor_type = monitor_type;
     cinemat_overlay_req = overlay_req;
     cinemat_backdrop_req = backdrop_req;
     cinemat_simple_overlay = simple_overlay;
 }
示例#5
0
        public override int start(Mame.MachineSound msound)
        {
            string snd_name = "K005289";
            //k005289_sound_channel voice=channel_list;
            k005289_interface intf = (k005289_interface)msound.sound_interface;

            /* get stream channels */
            stream = Mame.stream_init(snd_name, intf.volume, Mame.Machine.sample_rate, 0, K005289_update);
            mclock = intf.master_clock;
            rate = Mame.Machine.sample_rate;

            /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
            mixer_buffer = new _ShortPtr(2 * sizeof(short) * Mame.Machine.sample_rate);

            /* build the mixer table */
            if (make_mixer_table(2) != 0)
            {
                mixer_buffer = null;
                return 1;
            }

            sound_prom = Mame.memory_region(intf.region);

            /* reset all the voices */
            channel_list[0].frequency = 0;
            channel_list[0].volume = 0;
            channel_list[0].wave = new _BytePtr(sound_prom);
            channel_list[0].counter = 0;
            channel_list[1].frequency = 0;
            channel_list[1].volume = 0;
            channel_list[1].wave = new _BytePtr(sound_prom, 0x100);
            channel_list[1].counter = 0;

            return 0;
        }
示例#6
0
 public YM2151interface(int num, int baseclock, int[] volume, YM2151irqhandler[] irqhandler, Mame.mem_write_handler[] writehandler)
 {
     this.num = num;
     this.volume = volume;
     this.baseclock = baseclock;
     this.irqhandler = irqhandler;
     this.portwritehandler = writehandler;
 }
示例#7
0
 public override int start(Mame.MachineSound msound)
 {
     SEGAPCMinterface intf = (SEGAPCMinterface)msound.sound_interface;
     if (Mame.Machine.sample_rate == 0) return 0;
     if (SEGAPCMInit(msound, intf.bank & 0x00ffffff, intf.mode, Mame.memory_region(intf.region), intf.volume) != 0)
         return 1;
     return 0;
 }
示例#8
0
        int SEGAPCMInit(Mame.MachineSound msound, int banksize, int mode, _BytePtr inpcm, int volume)
        {
            int i;
            int rate = Mame.Machine.sample_rate;
            buffer_len = (int)(rate / Mame.Machine.drv.frames_per_second);
            emulation_rate = (int)(buffer_len * Mame.Machine.drv.frames_per_second);
            sample_rate = SEGAPCM_samples[mode][0];
            sample_shift = SEGAPCM_samples[mode][1];
            pcm_rom = inpcm;

            //printf( "segaPCM in\n" );

            /**** interface init ****/
            spcm.bankshift = banksize & 0xffffff;
            if ((banksize >> 16) == 0x00)
            {
                spcm.bankmask = (BANK_MASK7 >> 16) & 0x00ff;	/* default */
            }
            else
            {
                spcm.bankmask = (banksize >> 16) & 0x00ff;
            }

            for (i = 0; i < SEGAPCM_MAX; i++)
            {
                spcm.gain[i, L_PAN] = spcm.gain[i, R_PAN] = 0;
                spcm.vol[i, L_PAN] = spcm.vol[i, R_PAN] = 0;
                spcm.addr_l[i] = 0;
                spcm.addr_h[i] = 0;
                spcm.bank[i] = 0;
                spcm.end_h[i] = 0;
                spcm.delta_t[i] = 0x80;
                spcm.flag[i] = 1;
                spcm.add_addr[i] = 0;
                spcm.step[i] = (uint)(((float)sample_rate / (float)emulation_rate) * (float)(0x80 << 5));
                spcm.pcmd[i] = 0;
            }
            //printf( "segaPCM work init end\n" );

            {
                string[] name = new string[LR_PAN];
                int[] vol = new int[2];
                name[0] = Mame.sprintf("%s L", Mame.sound_name(msound));
                name[1] = Mame.sprintf("%s R", Mame.sound_name(msound));
                vol[0] = (Mame.MIXER_PAN_LEFT << 8) | (volume & 0xff);
                vol[1] = (Mame.MIXER_PAN_RIGHT << 8) | (volume & 0xff);
                stream = Mame.stream_init_multi(LR_PAN, name, vol, rate, 0, SEGAPCMUpdate);
            }
            //printf( "segaPCM end\n" );
            return 0;
        }
示例#9
0
        public override int start(Mame.MachineSound msound)
        {
            int chip;
            Mame.SN76496interface intf = (Mame.SN76496interface)msound.sound_interface;


            for (chip = 0; chip < intf.num; chip++)
            {
                if (SN76496_init(msound, chip, intf.baseclock[chip], intf.volume[chip] & 0xff, Mame.Machine.sample_rate) != 0)
                    return 1;

                SN76496_set_gain(chip, (intf.volume[chip] >> 8) & 0xff);
            }
            return 0;
        }
示例#10
0
        public override int start(Mame.MachineSound msound)
        {

            intf = (K007232_interface)msound.sound_interface;

            /* Set up the chips */
            for (int j = 0; j < intf.num_chips; j++)
            {
                //char buf[2][40];
                string[] name = new string[2];
                int[] vol = new int[2];
                kpcm[j] = new kdacApcm();
                kpcm[j].pcmbuf[0] = Mame.memory_region(intf.bank[j]);
                kpcm[j].pcmbuf[1] = Mame.memory_region(intf.bank[j]);

                for (int i = 0; i < KDAC_A_PCM_MAX; i++)
                {
                    kpcm[j].start[i] = 0;
                    kpcm[j].step[i] = 0;
                    kpcm[j].play[i] = 0;
                    kpcm[j].loop[i] = 0;
                }
                kpcm[j].vol[0][0] = 255;	/* channel A output to output A */
                kpcm[j].vol[0][1] = 0;
                kpcm[j].vol[1][0] = 0;
                kpcm[j].vol[1][1] = 255;	/* channel B output to output B */

                for (int i = 0; i < 0x10; i++) kpcm[j].wreg[i] = 0;

                for (int i = 0; i < 2; i++)
                {
                    name[i] = Mame.sprintf("007232 #%d Ch %c", j, 'A' + i);
                }

                vol[0] = intf.volume[j] & 0xffff;
                vol[1] = intf.volume[j] >> 16;

                pcm_chan[j] = Mame.stream_init_multi(2, name, vol, Mame.Machine.sample_rate, j, KDAC_A_update);
            }

            KDAC_A_make_fncode();

            return 0;
        }
示例#11
0
 public pia6821_interface( Mame.mem_read_handler in_a_func,  Mame.mem_read_handler in_b_func,
  Mame.mem_read_handler in_ca1_func, Mame.mem_read_handler  in_cb1_func, Mame.mem_read_handler  in_ca2_func,  Mame.mem_read_handler in_cb2_func,
  Mame.mem_write_handler out_a_func,Mame.mem_write_handler  out_b_func,
  Mame.mem_write_handler out_ca2_func, Mame.mem_write_handler out_cb2_func,
  irqcallfunc irq_a_func, irqcallfunc irq_b_func)
 {
     this.in_a_func = in_a_func;
     this.in_b_func = in_b_func;
     this.in_ca1_func = in_ca1_func;
     this.in_cb1_func = in_cb1_func;
     this.in_ca2_func = in_ca2_func;
     this.in_cb2_func = in_cb2_func;
     this.irq_a_func = irq_a_func;
     this.irq_b_func = irq_b_func;
     this.out_a_func = out_a_func;
     this.out_b_func = out_b_func;
     this.out_ca2_func = out_ca2_func;
     this.out_cb2_func = out_cb2_func;
 }
示例#12
0
        public override int start(Mame.MachineSound msound)
        {
            Mame.DACinterface intf = (Mame.DACinterface)msound.sound_interface;


            DAC_build_voltable();

            for (int i = 0; i < intf.num; i++)
            {
                string name = Mame.sprintf("DAC #%d", i);
                channel[i] = Mame.stream_init(name, intf.mixing_level[i], Mame.Machine.sample_rate,
                        i, DAC_update);

                if (channel[i] == -1)
                    return 1;

                output[i] = 0;
            }

            return 0;
        }
示例#13
0
        public override int start(Mame.MachineSound msound)
        {
            intf = (TMS5220interface)msound.sound_interface;

            /* reset the 5220 */
            tms5220_reset();
            tms5220_set_irq(intf.irq);

            /* set the initial frequency */
            stream = -1;
            tms5220_set_frequency(intf.baseclock);
            source_pos = 0;
            last_sample = curr_sample = 0;

            /* initialize a stream */
            stream = Mame.stream_init("TMS5220", intf.mixing_level, Mame.Machine.sample_rate, 0, tms5220_update);
            if (stream == -1)
                return 1;

            /* request a sound channel */
            return 0;
        }
示例#14
0
        public override int start(Mame.MachineSound msound)
        {
	for (int i=0; i<Mame.MAX_2413; i++)
	{
		/* Reset the chip state to 0 */
        ym2413_state[i] = new YM2413_state();

		/*
		Copy default values for the user instument. This is not strictly necessary,
		but will allow altering of the extra OPL settings that aren't
		set by the 2413 (feedback and wave select).
		*/
		for (int j=0; j<ym2413_parameter_count; j++)
		{
			ym2413_state[i].user_instrument[j]=ym2413_instruments[0][j];
		}
	}
    return YM3812.YM3812_sh_start(msound);
        }
示例#15
0
        static void copy_pixels_8(Mame.osd_bitmap bitmap, Mame.rectangle clip)
        {
            ushort[] pens = Mame.Machine.pens;
            int pairs = (clip.max_x - clip.min_x + 1) / 2;
            int xoffset = clip.min_x;
            int x, y;

            /* standard case */
            if ((Mame.Machine.orientation & Mame.ORIENTATION_SWAP_XY) == 0)
            {
                /* loop over rows */
                for (y = clip.min_y; y <= clip.max_y; y++)
                {
                    _BytePtr source = new _BytePtr(williams_videoram, y + 256 * (xoffset / 2));
                    _BytePtr dest;

                    /* skip if not dirty */
                    if (scanline_dirty[y] == 0) continue;
                    scanline_dirty[y] = 0;
                    mark_dirty(clip.min_x, y, clip.max_x, y);

                    /* compute starting destination pixel based on flip */
                    if ((Mame.Machine.orientation & Mame.ORIENTATION_FLIP_Y) == 0)
                        dest = new _BytePtr(bitmap.line[y]);
                    else
                        dest = new _BytePtr(bitmap.line[bitmap.height - 1 - y]);

                    /* non-X-flipped case */
                    if ((Mame.Machine.orientation & Mame.ORIENTATION_FLIP_X) == 0)
                    {
                        dest.offset += xoffset;
                        for (x = 0; x < pairs; x++, source.offset += 256, dest.offset += 2)
                        {
                            int pix = source[0];
                            dest[0] = (byte)pens[pix >> 4];
                            dest[1] = (byte)pens[pix & 0x0f];
                        }
                    }

                    /* X-flipped case */
                    else
                    {
                        dest.offset += bitmap.width - xoffset;
                        for (x = 0; x < pairs; x++, source.offset += 256, dest.offset -= 2)
                        {
                            int pix = source[0];
                            dest[-1] = (byte)pens[pix >> 4];
                            dest[-2] = (byte)pens[pix & 0x0f];
                        }
                    }
                }
            }

            /* X/Y swapped case */
            else
            {
                int dy = (bitmap.line[1].offset - bitmap.line[0].offset);

                /* loop over rows */
                for (y = clip.min_y; y <= clip.max_y; y++)
                {
                    _BytePtr source = new _BytePtr(williams_videoram, y + 256 * (xoffset / 2));
                    _BytePtr dest;

                    /* skip if not dirty */
                    if (scanline_dirty[y] == 0) continue;
                    scanline_dirty[y] = 0;
                    mark_dirty(clip.min_x, y, clip.max_x, y);

                    /* compute starting destination pixel based on flip */
                    if ((Mame.Machine.orientation & Mame.ORIENTATION_FLIP_X) == 0)
                        dest = new _BytePtr(bitmap.line[0], y);
                    else
                        dest = new _BytePtr(bitmap.line[0], bitmap.width - 1 - y);

                    /* non-Y-flipped case */
                    if ((Mame.Machine.orientation & Mame.ORIENTATION_FLIP_Y) == 0)
                    {
                        dest.offset += xoffset * dy;
                        for (x = 0; x < pairs; x++, source.offset += 256, dest.offset += dy + dy)
                        {
                            int pix = source[0];
                            dest[0] = (byte)pens[pix >> 4];
                            dest[dy] = (byte)pens[pix & 0x0f];
                        }
                    }

                    /* Y-flipped case */
                    else
                    {
                        dest.offset += (bitmap.height - xoffset) * dy;
                        for (x = 0; x < pairs; x++, source.offset += 256, dest.offset -= dy + dy)
                        {
                            int pix = source[0];
                            dest[-dy] = (byte)pens[pix >> 4];
                            dest[-dy - dy] = (byte)pens[pix & 0x0f];
                        }
                    }
                }
            }
        }
示例#16
0
 public override int chips_clock(Mame.MachineSound msound)
 {
     return ((YM2413interface)msound.sound_interface).baseclock; 
 }
示例#17
0
 public override int chips_num(Mame.MachineSound msound)
 {
     return (( YM2413interface)msound.sound_interface).num; 
 }
示例#18
0
        public override int start(Mame.MachineSound msound)
        {
            AY8910interface intf = (AY8910interface)msound.sound_interface;

            for (int chip = 0; chip < intf.num; chip++)
            {
                if (AY8910_init(msound, chip, intf.baseclock,
                        intf.mixing_level[chip] & 0xffff,
                        Mame.Machine.sample_rate,
                        intf.portAread[chip], intf.portBread[chip],
                        intf.portAwrite[chip], intf.portBwrite[chip]) != 0)
                    return 1;
                build_mixer_table(chip);
            }
            return 0;
        }
示例#19
0
        int AY8910_init(Mame.MachineSound msound, int chip, int clock, int volume, int sample_rate, AY8910portRead portAread, AY8910portRead portBread, AY8910portWrite portAwrite, AY8910portWrite portBwrite)
        {
            //AY8910 PSG = AYPSG[chip];

            string[] name = new string[3];
            int[] vol = new int[3];

            AYPSG[chip].SampleRate = sample_rate;
            AYPSG[chip].PortAread = portAread;
            AYPSG[chip].PortBread = portBread;
            AYPSG[chip].PortAwrite = portAwrite;
            AYPSG[chip].PortBwrite = portBwrite;
            for (int i = 0; i < 3; i++)
            {
                vol[i] = volume;
                name[i] = Mame.sprintf("%s #%d Ch %c", Mame.sound_name(msound), chip, 'A' + i);
            }
            AYPSG[chip].Channel = Mame.stream_init_multi(3, name, vol, sample_rate, chip, AY8910Update);

            if (AYPSG[chip].Channel == -1)
                return 1;

            AY8910_set_clock(chip, clock);
            AY8910_reset(chip);

            return 0;
        }
示例#20
0
 public override int start(Mame.MachineSound msound)
 {
     chiptype = FMOPL.OPL_TYPE_YM3812;
     return OPL_sh_start(msound);
 }
示例#21
0
 public static void cinemat_vh_screenrefresh(Mame.osd_bitmap bitmap, int full_refresh)
 {
     if (backdrop != null && overlay != null)
         Vector.vector_vh_update_artwork(bitmap, overlay, backdrop, full_refresh);
     else if (overlay != null)
         Vector.vector_vh_update_overlay(bitmap, overlay, full_refresh);
     else if (backdrop != null)
         Vector.vector_vh_update_backdrop(bitmap, backdrop, full_refresh);
     else
         Vector.vector_vh_update(bitmap, full_refresh);
     Vector.vector_clear_list();
 }
示例#22
0
 public static int YM3812_sh_start(Mame.MachineSound msound)
 {
     chiptype = FMOPL.OPL_TYPE_YM3812;
     return OPL_sh_start(msound);
 }
示例#23
0
        public static int emu_YM3812_sh_start(Mame.MachineSound msound)
        {
            int rate = Mame.Machine.sample_rate;

            intf = (YM3812interface)msound.sound_interface;
            if (intf.num > Mame.MAX_3812) return 1;

            /* Timer state clear */
            for (int i = 0; i < Timer.Length; i++) Timer[i] = null;

            /* stream system initialize */
            for (int i = 0; i < intf.num; i++)
            {
                /* stream setup */
                string name;
                int vol = intf.mixing_level[i];
                /* emulator create */
                
                F3812[i] = FMOPL.OPLCreate(chiptype, intf.baseclock, rate);
                if (F3812[i] == null) return 1;
                /* stream setup */
                name = Mame.sprintf("%s #%d", Mame.sound_name(msound), i);
#if HAS_Y8950
		/* ADPCM ROM DATA */
		if(chiptype == OPL_TYPE_Y8950)
		{
			F3812[i].deltat.memory = (unsigned char *)(memory_region(intf.rom_region[i]));
			F3812[i].deltat.memory_size = memory_region_length(intf.rom_region[i]);
			stream[i] = stream_init(name,vol,rate,i,Y8950UpdateHandler);
			/* port and keyboard handler */
			OPLSetPortHandler(F3812[i],Y8950PortHandler_w,Y8950PortHandler_r,i);
			OPLSetKeyboardHandler(F3812[i],Y8950KeyboardHandler_w,Y8950KeyboardHandler_r,i);
		}
		else
#endif
                stream[i] = Mame.stream_init(name, vol, rate, i, YM3812UpdateHandler);
                /* YM3812 setup */
                FMOPL.OPLSetTimerHandler(F3812[i], TimerHandler, i * 2);
                FMOPL.OPLSetIRQHandler(F3812[i], IRQHandler, i);
                FMOPL.OPLSetUpdateHandler(F3812[i], Mame.stream_update, stream[i]);
            }
            return 0;
        }
示例#24
0
 static void copy_pixels_16(Mame.osd_bitmap bitmap, Mame.rectangle clip)
 {
     throw new Exception();
 }
示例#25
0
 public override int chips_num(Mame.MachineSound msound)
 {
     return 1;
 }
示例#26
0
        /* support non use tilemap system draw routine */

        static _BytePtr get_gfx_pointer(Mame.GfxElement gfxelement, int c, int line)
        {
            return new _BytePtr(gfxelement.gfxdata, (c * gfxelement.height + line) * gfxelement.line_modulo);
        }
示例#27
0
 public static void dvg_screenrefresh(Mame.osd_bitmap bitmap, int full_refresh)
 {
     if (backdrop != null)
         Vector.vector_vh_update_backdrop(bitmap, backdrop, full_refresh);
     else
         Vector.vector_vh_update(bitmap, full_refresh);
 }
示例#28
0
        static int OPL_sh_start(Mame.MachineSound msound)
        {

                sh_stop = emu_YM3812_sh_stop;
                status_port_r = emu_YM3812_status_port_r;
                control_port_w = emu_YM3812_control_port_w;
                write_port_w = emu_YM3812_write_port_w;
                read_port_r = emu_YM3812_read_port_r;
                return emu_YM3812_sh_start(msound);
        }
示例#29
0
            public static void pengo_vh_screenrefresh(Mame.osd_bitmap bitmap, int full_refresh)
            {
                for (int offs = Generic.videoram_size[0] - 1; offs > 0; offs--)
                {
                    if (Generic.dirtybuffer[offs])
                    {
                        int mx, my, sx, sy;

                        Generic.dirtybuffer[offs] = false;
                        mx = offs % 32;
                        my = offs / 32;

                        if (my < 2)
                        {
                            if (mx < 2 || mx >= 30) continue; /* not visible */
                            sx = my + 34;
                            sy = mx - 2;
                        }
                        else if (my >= 30)
                        {
                            if (mx < 2 || mx >= 30) continue; /* not visible */
                            sx = my - 30;
                            sy = mx - 2;
                        }
                        else
                        {
                            sx = mx + 2;
                            sy = my - 2;
                        }

                        if (flipscreen)
                        {
                            sx = 35 - sx;
                            sy = 27 - sy;
                        }

                        Mame.drawgfx(Generic.tmpbitmap, Mame.Machine.gfx[gfx_bank * 2],
                                Generic.videoram[offs],
                                (uint)Generic.colorram[offs] & 0x1f,
                                flipscreen, flipscreen,
                                sx * 8, sy * 8,
                                Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);
                    }
                }

                Mame.copybitmap(bitmap, Generic.tmpbitmap, false, false, 0, 0, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);

                /* Draw the sprites. Note that it is important to draw them exactly in this */
                /* order, to have the correct priorities. */
                for (int offs = Generic.spriteram_size[0] - 2; offs > 2 * 2; offs -= 2)
                {
                    int sx = 272 - Generic.spriteram_2[offs + 1];
                    int sy = Generic.spriteram_2[offs] - 31;

                    Mame.drawgfx(bitmap, Mame.Machine.gfx[gfx_bank * 2 + 1],
                            (uint)Generic.spriteram[offs] >> 2,
                            (uint)Generic.spriteram[offs + 1] & 0x1f,
                            (Generic.spriteram[offs] & 1)!=0, (Generic.spriteram[offs] & 2)!=0,
                            sx, sy,
                            spritevisiblearea, Mame.TRANSPARENCY_COLOR, 0);

                    /* also plot the sprite with wraparound (tunnel in Crush Roller) */
                    Mame.drawgfx(bitmap, Mame.Machine.gfx[gfx_bank * 2 + 1],
                            (uint)Generic.spriteram[offs] >> 2,
                            (uint)Generic.spriteram[offs + 1] & 0x1f,
                            (Generic.spriteram[offs] & 1)!=0, (Generic.spriteram[offs] & 2)!=0,
                            sx - 256, sy,
                            spritevisiblearea, Mame.TRANSPARENCY_COLOR, 0);
                }
                /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
                /* one pixel to the left to get a more correct placement */
                for (int offs = 2 * 2; offs >= 0; offs -= 2)
                {
                    int sx = 272 - Generic.spriteram_2[offs + 1];
                    int sy = Generic.spriteram_2[offs] - 31;

                    Mame.drawgfx(bitmap, Mame.Machine.gfx[gfx_bank * 2 + 1],
                            (uint)Generic.spriteram[offs] >> 2,
                            (uint)Generic.spriteram[offs + 1] & 0x1f,
                            (Generic.spriteram[offs] & 1)!=0, (Generic.spriteram[offs] & 2)!=0,
                            sx, sy + xoffsethack,
                            spritevisiblearea, Mame.TRANSPARENCY_COLOR, 0);

                    /* also plot the sprite with wraparound (tunnel in Crush Roller) */
                    Mame.drawgfx(bitmap, Mame.Machine.gfx[gfx_bank * 2 + 1],
                            (uint)Generic.spriteram[offs] >> 2,
                            (uint)Generic.spriteram[offs + 1] & 0x1f,
                            (Generic.spriteram[offs] & 2)!=0, (Generic.spriteram[offs] & 1)!=0,
                            sx - 256, sy + xoffsethack,
                            spritevisiblearea, Mame.TRANSPARENCY_COLOR, 0);
                }
            }
示例#30
0
 public override int chips_num(Mame.MachineSound msound)
 {
     return 0;// throw new NotImplementedException();
 }