Exemplo n.º 1
0
        public static void PGMInit()
        {
            Machine.bRom   = true;
            mainbiosrom    = Properties.Resources.pgmmainbios;
            videobios      = Properties.Resources.pgmvideobios;
            audiobios      = Properties.Resources.pgmaudiobios;
            ICS2115.icsrom = audiobios;
            byte[] bb1, bb2;
            int    i3, n1, n2, n3;

            bb1 = Machine.GetRom("ics.rom");
            bb2 = Machine.GetRom("tiles.rom");
            if (bb1 == null)
            {
                bb1 = new byte[0];
            }
            n1             = bb1.Length;
            n2             = bb2.Length;
            ICS2115.icsrom = new byte[0x400000 + n1];
            Array.Copy(audiobios, ICS2115.icsrom, 0x200000);
            Array.Copy(bb1, 0, ICS2115.icsrom, 0x400000, n1);
            tilesrom = new byte[0x400000 + n2];
            Array.Copy(videobios, tilesrom, 0x200000);
            Array.Copy(bb2, 0, tilesrom, 0x400000, n2);
            n3        = tilesrom.Length;
            tiles1rom = new byte[n3 * 2];
            for (i3 = 0; i3 < n3; i3++)
            {
                tiles1rom[i3 * 2]     = (byte)(tilesrom[i3] & 0x0f);
                tiles1rom[i3 * 2 + 1] = (byte)(tilesrom[i3] >> 4);
            }
            Memory.mainrom = Machine.GetRom("maincpu.rom");
            sprmaskrom     = Machine.GetRom("sprmask.rom");
            sprcolrom      = Machine.GetRom("sprcol.rom");
            expand_32x32x5bpp();
            expand_colourdata();
            Memory.mainram     = new byte[0x20000];
            pgm_bg_videoram    = new byte[0x4000];
            pgm_tx_videoram    = new byte[0x2000];
            pgm_rowscrollram   = new byte[0x800];
            Video.paletteram16 = new byte[0x1200];
            pgm_videoregs      = new byte[0x10000];
            Memory.audioram    = new byte[0x10000];
            if (Memory.mainrom == null || sprmaskrom == null || pgm_sprite_a_region == null)
            {
                Machine.bRom = false;
            }
            if (Machine.bRom)
            {
                Machine.FORM.Text = "MAME.NET: " + Machine.sDescription + " [" + Machine.sName + "]";
            }
        }
Exemplo n.º 2
0
        public static void M72Init()
        {
            int i1, i2, i3, n1, n2, n3;

            Generic.paletteram16   = new ushort[0x600];
            Generic.paletteram16_2 = new ushort[0x600];
            Generic.spriteram16    = new ushort[0x200];
            Machine.bRom           = true;
            Timer.setvector        = setvector_callback;
            protection_ram         = new byte[0x1000];
            Memory.mainrom         = Machine.GetRom("maincpu.rom");
            Memory.audiorom        = Machine.GetRom("soundcpu.rom");
            spritesrom             = Machine.GetRom("sprites.rom");
            n1          = spritesrom.Length;
            sprites1rom = new byte[n1 * 2];
            for (i1 = 0; i1 < n1; i1++)
            {
                sprites1rom[i1 * 2]     = (byte)(spritesrom[i1] >> 4);
                sprites1rom[i1 * 2 + 1] = (byte)(spritesrom[i1] & 0x0f);
            }
            gfx2rom  = Machine.GetRom("gfx2.rom");
            n2       = gfx2rom.Length;
            gfx21rom = new byte[n2 * 2];
            for (i2 = 0; i2 < n2; i2++)
            {
                gfx21rom[i2 * 2]     = (byte)(gfx2rom[i2] >> 4);
                gfx21rom[i2 * 2 + 1] = (byte)(gfx2rom[i2] & 0x0f);
            }
            gfx3rom = Machine.GetRom("gfx3.rom");
            if (gfx3rom != null)
            {
                n3       = gfx3rom.Length;
                gfx31rom = new byte[n3 * 2];
                for (i3 = 0; i3 < n3; i3++)
                {
                    gfx31rom[i3 * 2]     = (byte)(gfx3rom[i3] >> 4);
                    gfx31rom[i3 * 2 + 1] = (byte)(gfx3rom[i3] & 0x0f);
                }
            }
            samplesrom      = Machine.GetRom("samples.rom");
            Memory.mainram  = new byte[0x4000];
            Memory.audioram = new byte[0x10000];
            dsw             = 0xffbf;
            if (Memory.mainrom == null || Memory.audiorom == null || sprites1rom == null || gfx21rom == null || samplesrom == null)
            {
                Machine.bRom = false;
            }
        }
Exemplo n.º 3
0
 public static void IGS011Init()
 {
     Machine.bRom          = true;
     Generic.generic_nvram = new byte[0x4000];
     priority_ram          = new ushort[0x800];
     paletteram16          = new ushort[0x1000];
     igs003_reg            = new ushort[2];
     vbowl_trackball       = new ushort[2];
     Memory.mainrom        = Machine.GetRom("maincpu.rom");
     gfx1rom        = Machine.GetRom("gfx1.rom");
     gfx2rom        = Machine.GetRom("gfx2.rom");
     OKI6295.okirom = Machine.GetRom("oki.rom");
     dsw1           = 0xff;
     dsw2           = 0xff;
     dsw3           = 0xff;
     if (Memory.mainrom == null || gfx1rom == null || OKI6295.okirom == null)
     {
         Machine.bRom = false;
     }
 }
Exemplo n.º 4
0
        public static void Namcos1Init()
        {
            Machine.bRom    = true;
            user1rom_offset = new int[2, 8];
            audiorom        = Machine.GetRom("audiocpu.rom");
            gfx1rom         = Machine.GetRom("gfx1.rom");
            gfx2rom         = Machine.GetRom("gfx2.rom");
            gfx3rom         = ByteTo2byte(Machine.GetRom("gfx3.rom"));
            user1rom        = Machine.GetRom("user1.rom");
            mcurom          = Properties.Resources.mcu;
            voicerom        = new byte[0xc0000];
            byte[] bb1 = Machine.GetRom("voice.rom");
            Array.Copy(bb1, voicerom, bb1.Length);
            bank_ram20            = new byte[0x2000];
            bank_ram30            = new byte[0x80];
            Namco.namco_wavedata  = new byte[0x400];
            Generic.generic_nvram = new byte[0x800];
            cus117_offset         = new int[2, 8];
            key = new byte[8];
            if (audiorom == null || gfx1rom == null || gfx2rom == null || gfx3rom == null || user1rom == null || voicerom == null)
            {
                Machine.bRom = false;
            }
            if (Machine.bRom)
            {
                Machine.FORM.Text = "MAME.NET: " + Machine.sDescription + " [" + Machine.sName + "]";
                switch (Machine.sName)
                {
                case "quester":
                case "questers":
                    dipsw = 0xfb;
                    break;

                default:
                    dipsw = 0xff;
                    break;
                }
            }
        }
Exemplo n.º 5
0
        public static void NeogeoInit()
        {
            audio_cpu_banks   = new byte[4];
            pvc_cartridge_ram = new byte[0x2000];
            Memory.mainram    = new byte[0x10000];
            mainram2          = new byte[0x10000];
            Memory.audioram   = new byte[0x800];
            Machine.bRom      = true;
            dsw                     = 0xff;
            fixedbiosrom            = Properties.Resources.sfix;
            zoomyrom                = Properties.Resources._000_lo;
            audiobiosrom            = Properties.Resources.sm1;
            mainbiosrom             = Properties.Resources.mainbios;
            Memory.mainrom          = Machine.GetRom("maincpu.rom");
            Memory.audiorom         = Machine.GetRom("audiocpu.rom");
            fixedrom                = Machine.GetRom("fixed.rom");
            FM.ymsndrom             = Machine.GetRom("ymsnd.rom");
            YMDeltat.ymsnddeltatrom = Machine.GetRom("ymsnddeltat.rom");
            spritesrom              = Machine.GetRom("sprites.rom");
            if (fixedbiosrom == null || zoomyrom == null || audiobiosrom == null || mainbiosrom == null || Memory.mainrom == null || Memory.audiorom == null || fixedrom == null || FM.ymsndrom == null || spritesrom == null)
            {
                Machine.bRom = false;
            }
            if (Machine.bRom)
            {
                Machine.FORM.Text = "MAME.NET: " + Machine.sDescription + " [" + Machine.sName + "]";
                switch (Machine.sName)
                {
                case "irrmaze":
                case "kizuna4p":
                    mainbiosrom = Machine.GetRom("mainbios.rom");
                    break;

                case "kof99":
                case "kof99h":
                case "kof99e":
                case "kof99k":
                case "garou":
                case "garouh":
                case "mslug3":
                case "mslug3h":
                case "mslug4":
                case "mslug4h":
                case "ms4plus":
                case "ganryu":
                case "s1945p":
                case "preisle2":
                case "bangbead":
                case "nitd":
                case "zupapa":
                case "sengoku3":
                case "rotd":
                case "rotdh":
                case "pnyaa":
                case "mslug5":
                case "mslug5h":
                case "ms5plus":
                case "samsho5":
                case "samsho5h":
                case "samsho5b":
                case "samsh5sp":
                case "samsh5sph":
                case "samsh5spho":
                case "jockeygp":
                case "jockeygpa":
                    neogeo_fixed_layer_bank_type = 1;
                    break;

                case "kof2000":
                case "kof2000n":
                case "matrim":
                case "matrimbl":
                case "svc":
                case "kof2003":
                case "kof2003h":
                    neogeo_fixed_layer_bank_type = 2;
                    break;

                default:
                    neogeo_fixed_layer_bank_type = 0;
                    break;
                }
            }
        }
Exemplo n.º 6
0
        public static void M92Init()
        {
            int i1, i2, n1, n2;

            byte[] bb1;
            Machine.bRom      = true;
            Timer.setvector   = setvector_callback;
            pf_master_control = new ushort[4];
            M92.pf_layer      = new M92.pf_layer_info[3];
            for (i1 = 0; i1 < 3; i1++)
            {
                pf_layer[i1].control = new ushort[4];
            }
            Generic.paletteram16         = new ushort[0x800];
            Generic.spriteram16          = new ushort[0x400];
            Generic.buffered_spriteram16 = new ushort[0x400];
            m92_vram_data     = new byte[0x10000];
            m92_spritecontrol = new byte[0x10];
            bb1            = Machine.GetRom("maincpu.rom");
            Memory.mainrom = new byte[0x190000];
            Array.Copy(bb1, Memory.mainrom, bb1.Length);
            Memory.audiorom  = Machine.GetRom("soundcpu.rom");
            Iremga20.iremrom = Machine.GetRom("irem.rom");
            Memory.mainram   = new byte[0x10000];
            Memory.audioram  = new byte[0x4000];
            gfx1rom          = Machine.GetRom("gfx1.rom");
            n1       = gfx1rom.Length;
            gfx11rom = new byte[n1 * 2];
            for (i1 = 0; i1 < n1; i1++)
            {
                gfx11rom[i1 * 2]     = (byte)(gfx1rom[i1] >> 4);
                gfx11rom[i1 * 2 + 1] = (byte)(gfx1rom[i1] & 0x0f);
            }
            gfx2rom  = Machine.GetRom("gfx2.rom");
            n2       = gfx2rom.Length;
            gfx21rom = new byte[n2 * 2];
            for (i2 = 0; i2 < n2; i2++)
            {
                gfx21rom[i2 * 2]     = (byte)(gfx2rom[i2] >> 4);
                gfx21rom[i2 * 2 + 1] = (byte)(gfx2rom[i2] & 0x0f);
            }
            eeprom                 = Machine.GetRom("eeprom.rom");
            m92_game_kludge        = 0;
            m92_irq_vectorbase     = 0x80;
            m92_sprite_buffer_busy = 1;
            bankaddress            = 0xa0000;
            sound_status           = 0;
            dsw = 0xffbf;
            switch (Machine.sName)
            {
            case "lethalth":
            case "thndblst":
                bankaddress        = 0;
                m92_irq_vectorbase = 0x20;
                break;

            case "majtitl2":
            case "majtitl2a":
            case "majtitl2b":
            case "majtitl2j":
            case "skingame":
            case "skingame2":
                m92_game_kludge = 2;
                dsw             = 0xfd9f;
                break;

            case "rtypeleo":
            case "rtypeleoj":
                m92_irq_vectorbase = 0x20;
                break;

            case "ssoldier":
            case "psoldier":
                sound_status       = 0x80;
                m92_irq_vectorbase = 0x20;
                break;
            }
            if (Memory.mainrom == null || Memory.audiorom == null || gfx11rom == null || gfx21rom == null)
            {
                Machine.bRom = false;
            }
        }
Exemplo n.º 7
0
        public static void CPSInit()
        {
            int i, n;

            cps_a_regs      = new ushort[0x20];
            cps_b_regs      = new ushort[0x20];
            gfxram          = new byte[0x30000];
            Memory.mainram  = new byte[0x100000];
            Memory.audioram = new byte[0x800];
            Machine.bRom    = true;
            Memory.mainrom  = Machine.GetRom("maincpu.rom");
            gfxrom          = Machine.GetRom("gfx.rom");
            n       = gfxrom.Length;
            gfx1rom = new byte[n * 2];
            for (i = 0; i < n; i++)
            {
                gfx1rom[i * 2]     = (byte)(gfxrom[i] & 0x0f);
                gfx1rom[i * 2 + 1] = (byte)(gfxrom[i] >> 4);
            }
            Memory.audiorom = Machine.GetRom("audiocpu.rom");
            switch (Machine.sBoard)
            {
            case "CPS-1":
                cps_version = 1;
                starsrom    = Machine.GetRom("stars.rom");
                //OKI6295.okirom = Machine.GetRom("oki.rom");
                if (Memory.mainrom == null || gfxrom == null /*|| Memory.audiorom == null || OKI6295.okirom == null*/)
                {
                    Machine.bRom = false;
                }
                break;

            case "CPS-1(QSound)":
                cps_version       = 1;
                qsound_sharedram1 = new byte[0x1000];
                qsound_sharedram2 = new byte[0x1000];
                audioromop        = Machine.GetRom("audiocpuop.rom");
                user1rom          = Machine.GetRom("user1.rom");
                //QSound.qsoundrom = ByteToSbyte(Machine.GetRom("qsound.rom"));
                if (Memory.mainrom == null || audioromop == null || gfxrom == null || Memory.audiorom == null /*|| QSound.qsoundrom == null*/)
                {
                    Machine.bRom = false;
                }
                break;

            case "CPS2":
                cps_version        = 2;
                cps2_objram1       = new ushort[0x1000];
                cps2_objram2       = new ushort[0x1000];
                cps2_output        = new ushort[0x06];
                cps2networkpresent = 0;
                cps2_objram_bank   = 0;
                scancount          = 0;
                cps1_scanline1     = 262;
                cps1_scanline2     = 262;
                cps1_scancalls     = 0;
                qsound_sharedram1  = new byte[0x1000];
                qsound_sharedram2  = new byte[0x1000];
                if (Machine.sManufacturer != "bootleg")
                {
                    mainromop = Machine.GetRom("maincpuop.rom");
                }
                audioromop = Machine.GetRom("audiocpu.rom");
                //QSound.qsoundrom = ByteToSbyte(Machine.GetRom("qsound.rom"));
                if (Memory.mainrom == null || (Machine.sManufacturer != "bootleg" && mainromop == null) || audioromop == null || gfxrom == null || Memory.audiorom == null /*|| QSound.qsoundrom == null*/)
                {
                    Machine.bRom = false;
                }
                break;
            }
            if (Machine.bRom)
            {
                scrollxoff = 0x00;
                scrollyoff = 0x100;
                switch (Machine.sName)
                {
                case "ffight":
                case "ffighta":
                case "ffightu":
                case "ffightu1":
                case "ffightj":
                    cpsb_addr      = 0x20;
                    cpsb_value     = 0x0004;
                    mult_factor1   = -1;
                    mult_factor2   = -1;
                    mult_result_lo = -1;
                    mult_result_hi = -1;
                    layer_control  = 0x2e;
                    priority       = new int[4] {
                        0x26, 0x30, 0x28, 0x32
                    };
                    palette_control   = 0x2a;
                    layer_enable_mask = new int[5] {
                        0x02, 0x04, 0x08, 0x00, 0x00
                    };
                    in2_addr       = 0x00;
                    in3_addr       = 0x00;
                    out2_addr      = 0x00;
                    bootleg_kludge = 0;
                    dswa           = 0xff;
                    dswb           = 0xf4;
                    dswc           = 0x9f;
                    lsRange0       = new List <gfx_range>();
                    lsRange0.Add(new gfx_range(0x4400, 0x4bff, 0));
                    lsRange1 = new List <gfx_range>();
                    lsRange1.Add(new gfx_range(0x3000, 0x3fff, 0));
                    lsRange2 = new List <gfx_range>();
                    lsRange2.Add(new gfx_range(0x0980, 0x0bff, 0));
                    lsRangeS = new List <gfx_range>();
                    lsRangeS.Add(new gfx_range(0x0000, 0x21ff, 0));
                    break;
                }
                if (cps_version == 2)
                {
                    cpsb_addr      = 0x32;
                    cpsb_value     = -1;
                    mult_factor1   = 0x00;
                    mult_factor2   = 0x02;
                    mult_result_lo = 0x04;
                    mult_result_hi = 0x06;
                    layer_control  = 0x26;
                    priority       = new int[4] {
                        0x28, 0x2a, 0x2c, 0x2e
                    };
                    palette_control   = 0x30;
                    layer_enable_mask = new int[5] {
                        0x02, 0x04, 0x08, 0x30, 0x30
                    };
                    in2_addr       = 0x00;
                    in3_addr       = 0x00;
                    out2_addr      = 0x00;
                    bootleg_kludge = 0;
                    lsRange0       = new List <gfx_range>();
                    lsRange0.Add(new gfx_range(0x0000, 0x1ffff, 0x20000));
                    lsRange1 = new List <gfx_range>();
                    lsRange1.Add(new gfx_range(0x0000, 0xffff, 0x10000));
                    lsRange2 = new List <gfx_range>();
                    lsRange2.Add(new gfx_range(0x0000, 0x3fff, 0x4000));
                    lsRangeS = new List <gfx_range>();
                    lsRangeS.Add(new gfx_range(0x0000, 0xffff, 0));
                }
            }
        }