public static void postload() { int i; switch (Machine.sBoard) { case "CPS-1": for (i = 0; i < 3; i++) { CPS.ttmap[i].all_tiles_dirty = true; } YM2151.ym2151_postload(); break; case "CPS-1(QSound)": case "CPS2": for (i = 0; i < 3; i++) { CPS.ttmap[i].all_tiles_dirty = true; } break; case "Neo Geo": Neogeo.regenerate_pens(); FM.ym2610_postload(); break; case "Namco System 1": for (i = 0; i < 6; i++) { Namcos1.ttmap[i].all_tiles_dirty = true; } YM2151.ym2151_postload(); break; case "IGS011": break; case "PGM": PGM.pgm_tx_tilemap.all_tiles_dirty = true; PGM.pgm_bg_tilemap.all_tiles_dirty = true; break; case "M72": M72.bg_tilemap.all_tiles_dirty = true; M72.fg_tilemap.all_tiles_dirty = true; break; case "M92": for (i = 0; i < 3; i++) { M92.pf_layer[i].tmap.all_tiles_dirty = true; M92.pf_layer[i].wide_tmap.all_tiles_dirty = true; } break; } }
public static void nvram_save() { switch (Machine.sBoard) { case "Neo Geo": Neogeo.nvram_handler_save_neogeo(); break; } }
public static void nvram_save() { switch (Machine.sBoard) { case "Neo Geo": Neogeo.nvram_handler_save_neogeo(); break; /*case "Namco System 1": * Namcos1.nvram_handler_save_namcos1(); * break;*/ } }
public static void postload() { int i; switch (Machine.sBoard) { case "CPS-1": Tmap.ttmap[0].all_tiles_dirty = true; Tmap.ttmap[1].all_tiles_dirty = true; Tmap.ttmap[2].all_tiles_dirty = true; YM2151.ym2151_postload(); break; case "CPS-1(QSound)": Tmap.ttmap[0].all_tiles_dirty = true; Tmap.ttmap[1].all_tiles_dirty = true; Tmap.ttmap[2].all_tiles_dirty = true; break; case "CPS2": Tmap.ttmap[0].all_tiles_dirty = true; Tmap.ttmap[1].all_tiles_dirty = true; Tmap.ttmap[2].all_tiles_dirty = true; break; case "Neo Geo": Neogeo.regenerate_pens(); FM.ym2610_postload(); break; case "Namco System 1": for (i = 0; i < 6; i++) { Tmap.ttmap[i].all_tiles_dirty = true; } YM2151.ym2151_postload(); break; case "IGS011": break; case "PGM": Tmap.pgm_tx_tilemap.all_tiles_dirty = true; Tmap.pgm_bg_tilemap.all_tiles_dirty = true; break; } }
public static void machine_start() { switch (Machine.sBoard) { case "CPS-1": case "CPS-1(QSound)": case "CPS2": Palette.palette_init(); Tilemap.tilemap_init(); Eeprom.eeprom_init(); CPS.video_start_cps(); machine_reset_callback = CPS.machine_reset_cps; break; case "Neo Geo": Neogeo.nvram_handler_load_neogeo(); Neogeo.machine_start_neogeo(); Neogeo.video_start_neogeo(); machine_reset_callback = Neogeo.machine_reset_neogeo; break; case "Namco System 1": Palette.palette_init(); Tilemap.tilemap_init(); Namcos1.driver_init(); Namcos1.video_start_namcos1(); machine_reset_callback = Namcos1.machine_reset_namcos1; break; case "IGS011": Palette.palette_init(); IGS011.video_start_igs011(); machine_reset_callback = IGS011.machine_reset_igs011; break; case "PGM": Palette.palette_init(); Tilemap.tilemap_init(); PGM.device_init(); PGM.video_start_pgm(); machine_reset_callback = PGM.machine_reset_pgm; break; } }
public static Bitmap GetSprite() { int i, x, x2, y, rows, zoom_x, zoom_y, scanline, attr_and_code_offs, code, gfx_offset; int sprite_y, tile, zoom_x_table_offset, line_pens_offset, sprite_line, zoom_line, x_inc; ushort y_control, zoom_control, attr, x_2, code_2; byte sprite_y_and_tile; bool invert; Machine.FORM.neogeoform.tbResult.Clear(); Bitmap bm1; bm1 = new Bitmap(384, 264); BitmapData bmData; bmData = bm1.LockBits(new Rectangle(0, 0, bm1.Width, bm1.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); unsafe { byte *ptr = (byte *)(bmData.Scan0); byte *ptr2 = (byte *)0; y = 0; x = 0; rows = 0; zoom_y = 0; zoom_x = 0; foreach (int sprite_number in lSprite) { y_control = Neogeo.neogeo_videoram[0x8200 | sprite_number]; zoom_control = Neogeo.neogeo_videoram[0x8000 | sprite_number]; x_2 = Neogeo.neogeo_videoram[0x8400 | sprite_number]; code_2 = Neogeo.neogeo_videoram[sprite_number << 6]; if (sprite_number == 0x03 || sprite_number == 0xfa || sprite_number == 0x113 || sprite_number == 0x117 || sprite_number == 0x12b) { int i1 = 1; } if ((y_control & 0x40) != 0) { x = (x + zoom_x + 1) & 0x01ff; zoom_x = (zoom_control >> 8) & 0x0f; } else { y = 0x200 - (y_control >> 7); x = Neogeo.neogeo_videoram[0x8400 | sprite_number] >> 7; zoom_y = zoom_control & 0xff; zoom_x = (zoom_control >> 8) & 0x0f; rows = y_control & 0x3f; } Machine.FORM.neogeoform.tbResult.AppendText(sprite_number.ToString("X3") + " " + x_2.ToString("X4") + " " + y_control.ToString("X4") + " " + code_2.ToString("X4") + " " + zoom_control.ToString("X4") + "\r\n"); if (((x >= 0x140) && (x <= 0x1f0)) || rows == 0) { continue; } if (x == 0) { int i1 = 1; } for (scanline = 0; scanline < 264; scanline++) { if (Neogeo.sprite_on_scanline(scanline, y, rows)) { sprite_line = (scanline - y) & 0x1ff; zoom_line = sprite_line & 0xff; invert = ((sprite_line & 0x100) != 0) ? true : false; if (invert) { zoom_line ^= 0xff; } if (rows > 0x20) { zoom_line = zoom_line % ((zoom_y + 1) << 1); if (zoom_line > zoom_y) { zoom_line = ((zoom_y + 1) << 1) - 1 - zoom_line; invert = !invert; } } sprite_y_and_tile = Neogeo.zoomyrom[(zoom_y << 8) | zoom_line]; sprite_y = sprite_y_and_tile & 0x0f; tile = sprite_y_and_tile >> 4; if (invert) { sprite_y ^= 0x0f; tile ^= 0x1f; } attr_and_code_offs = (sprite_number << 6) | (tile << 1); attr = Neogeo.neogeo_videoram[attr_and_code_offs + 1]; code = ((attr << 12) & 0x70000) | Neogeo.neogeo_videoram[attr_and_code_offs]; if (Neogeo.auto_animation_disabled == 0) { if ((attr & 0x0008) != 0) { code = (code & ~0x07) | (Neogeo.auto_animation_counter & 0x07); } else if ((attr & 0x0004) != 0) { code = (code & ~0x03) | (Neogeo.auto_animation_counter & 0x03); } } if ((attr & 0x0002) != 0) { sprite_y ^= 0x0f; } zoom_x_table_offset = 0; gfx_offset = (int)(((code << 8) | (sprite_y << 4)) & Neogeo.sprite_gfx_address_mask); line_pens_offset = attr >> 8 << 4; if ((attr & 0x0001) != 0) { gfx_offset = gfx_offset + 0x0f; x_inc = -1; } else { x_inc = 1; } if (x <= 0x01f0) { x2 = x + 30; for (i = 0; i < 0x10; i++) { if (Neogeo.zoom_x_tables[zoom_x, zoom_x_table_offset] != 0) { if (Neogeo.sprite_gfx[gfx_offset] != 0) { ptr2 = ptr + (scanline * 384 + x2) * 4; *ptr2 = (byte)(Neogeo.pens[line_pens_offset + Neogeo.sprite_gfx[gfx_offset]] & 0xff); *(ptr2 + 1) = (byte)((Neogeo.pens[line_pens_offset + Neogeo.sprite_gfx[gfx_offset]] & 0xff00) >> 8); *(ptr2 + 2) = (byte)((Neogeo.pens[line_pens_offset + Neogeo.sprite_gfx[gfx_offset]] & 0xff0000) >> 16); *(ptr2 + 3) = 0xff; } x2++; } zoom_x_table_offset++; gfx_offset += x_inc; } } else { int i1 = 1; } } } } } bm1.UnlockBits(bmData); return(bm1); }