⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dariusg.c

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 C
📖 第 1 页 / 共 2 页
字号:
/******************************************************************************//*                                                                            *//*                 DARIUS GAIDEN (C) 1994 TAITO CORPORATION                   *//*                                                                            *//******************************************************************************/#include "gameinc.h"#include "dariusg.h"#include "f3system.h"#include "tc003vcu.h"#include "tc200obj.h"#include "savegame.h"#include "debug.h"#include "sasound.h"static struct DIR_INFO darius_gaiden_dirs[] ={   { "darius_gaiden", },   { "dariusg", },   { NULL, },};static struct ROM_INFO darius_gaiden_roms[] ={   {   "d87-01.bin", 0x00200000, 0x3848a110, 0, 0, 0, },   {   "d87-02.bin", 0x00200000, 0x9250abae, 0, 0, 0, },   {   "d87-03.bin", 0x00200000, 0x4be1666e, 0, 0, 0, },   {   "d87-04.bin", 0x00200000, 0x2616002c, 0, 0, 0, },   {   "d87-05.bin", 0x00200000, 0x4e5891a9, 0, 0, 0, },   {   "d87-06.bin", 0x00200000, 0x3b97a07c, 0, 0, 0, },   {   "d87-08.bin", 0x00200000, 0x76d23602, 0, 0, 0, },   {   "d87-09.bin", 0x00080000, 0x6170382d, 0, 0, 0, },   {   "d87-10.bin", 0x00080000, 0x4149f66f, 0, 0, 0, },   {   "d87-11.bin", 0x00080000, 0xf7bed18e, 0, 0, 0, },   {   "d87-12.bin", 0x00080000, 0xde78f328, 0, 0, 0, },   {   "d87-13.bin", 0x00040000, 0x15b1fff4, REGION_ROM2, 0x000000, LOAD_8_16, },   {   "d87-14.bin", 0x00040000, 0xeecda29a, REGION_ROM2, 0x000001, LOAD_8_16, },   {   "d87-17.bin", 0x00200000, 0xe601d63e, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};static struct ROMSW_DATA romsw_data_darius_gaiden_0[] ={   { "Taito Japan",           0x01 },   { "Taito America",         0x02 },   { NULL,                    0    },};static struct ROMSW_INFO darius_gaiden_romsw[] ={   { 0x1FFFFF, 0x01, romsw_data_darius_gaiden_0 },   { 0,        0,    NULL },};static struct VIDEO_INFO darius_gaiden_video ={   draw_darius_gaiden,   320,   232,   64,   VIDEO_ROTATE_NORMAL,};struct GAME_MAIN game_darius_gaiden ={   darius_gaiden_dirs,   darius_gaiden_roms,   f3_system_inputs,   NULL,   darius_gaiden_romsw,   load_darius_gaiden,   clear_darius_gaiden,   &darius_gaiden_video,   execute_darius_gaiden_frame,   "dariusg",   "Darius Gaiden",   "僟儔僀傾僗奜揱",   COMPANY_ID_TAITO,   "D87",   1994,   f3_sound,   GAME_SHOOT,};static struct DIR_INFO darius_gaiden_extra_dirs[] ={   { "darius_gaiden_extra", },   { "dariusgx", },   { ROMOF("dariusg"), },   { CLONEOF("dariusg"), },   { NULL, },};static struct ROM_INFO darius_gaiden_extra_roms[] ={   {   "d87-01.bin", 0x00200000, 0x3848a110, 0, 0, 0, },   {   "d87-02.bin", 0x00200000, 0x9250abae, 0, 0, 0, },   {   "d87-03.bin", 0x00200000, 0x4be1666e, 0, 0, 0, },   {   "d87-04.bin", 0x00200000, 0x2616002c, 0, 0, 0, },   {   "d87-05.bin", 0x00200000, 0x4e5891a9, 0, 0, 0, },   {   "d87-06.bin", 0x00200000, 0x3b97a07c, 0, 0, 0, },   {   "d87-08.bin", 0x00200000, 0x76d23602, 0, 0, 0, },   { "dge_mpr0.bin", 0x00080000, 0xc5bd135c, 0, 0, 0, },   { "dge_mpr1.bin", 0x00080000, 0xbc030f6f, 0, 0, 0, },   { "dge_mpr2.bin", 0x00080000, 0x7be23e23, 0, 0, 0, },   { "dge_mpr3.bin", 0x00080000, 0x1c1e24a7, 0, 0, 0, },   {   "d87-13.bin", 0x00040000, 0x15b1fff4, REGION_ROM2, 0x000000, LOAD_8_16, },   {   "d87-14.bin", 0x00040000, 0xeecda29a, REGION_ROM2, 0x000001, LOAD_8_16, },   {   "d87-17.bin", 0x00200000, 0xe601d63e, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};struct GAME_MAIN game_darius_gaiden_extra ={   darius_gaiden_extra_dirs,   darius_gaiden_extra_roms,   f3_system_inputs,   NULL,   darius_gaiden_romsw,   load_darius_gaiden,   clear_darius_gaiden,   &darius_gaiden_video,   execute_darius_gaiden_frame,   "dariusgx",   "Darius Gaiden Extra",   "僟儔僀傾僗奜揱 Extra",   COMPANY_ID_TAITO,   "D87",   1994,   f3_sound,   GAME_SHOOT,};static UINT8 *RAM_BG0;static UINT8 *RAM_BG1;static UINT8 *RAM_BG2;static UINT8 *RAM_BG3;static UINT8 *RAM_SCR0;static UINT8 *RAM_SCR1;static UINT8 *RAM_SCR2;static UINT8 *RAM_SCR3;static UINT32 SCR0_XOFS;static UINT32 SCR1_XOFS;static UINT32 SCR2_XOFS;static UINT32 SCR3_XOFS;static UINT32 SCR0_YOFS;static UINT32 SCR1_YOFS;static UINT32 SCR2_YOFS;static UINT32 SCR3_YOFS;static UINT8 *GFX_BG0;static UINT8 *GFX_BG0_SOLID;static UINT8 *GFX_SPR;static UINT8 *GFX_SPR_SOLID;void load_darius_gaiden(void){   int ta,tb,tc;   RAMSize=0x80000;   if(!(RAM=AllocateMem(0x80000))) return;   if(!(ROM=AllocateMem(0x200000))) return;   if(!(GFX=AllocateMem(0x7EF000+0x7F3600))) return;   GFX_BG0 = GFX+0x7EF000;   GFX_SPR = GFX+0x000000;   tb=0;   if(!load_rom("d87-03.bin", ROM, 0x1FBC00)) return;	// 16x16 SPRITES ($7EF0)   for(ta=0;ta<0x1FBC00;ta++){      GFX[tb++]=ROM[ta]&15;      GFX[tb++]=ROM[ta]>>4;      tb+=2;   }   tb=2;   if(!load_rom("d87-04.bin", ROM, 0x1FBC00)) return;	// 16x16 SPRITES   for(ta=0;ta<0x1FBC00;ta++){      GFX[tb++]=ROM[ta]&15;      GFX[tb++]=ROM[ta]>>4;      tb+=2;   }   tb=0;   if(!load_rom("d87-05.bin", ROM, 0x1FBC00)) return;	// 16x16 SPRITES (MASK)   for(ta=0;ta<0x1FBC00;ta++){      tc=ROM[ta];      GFX[tb+3]|=((tc&0x40)>>6)<<4;      GFX[tb+2]|=((tc&0x10)>>4)<<4;      GFX[tb+1]|=((tc&0x04)>>2)<<4;      GFX[tb+0]|=((tc&0x01)>>0)<<4;      tb+=4;   }   tb=0;   if(!load_rom("d87-06.bin", ROM, 0x1FCD80)) return;	// 16x16 TILES ($7F36)   for(ta=0;ta<0x1FCD80;ta+=2){      GFX_BG0[tb++]=ROM[ta]&15;      GFX_BG0[tb++]=ROM[ta]>>4;      GFX_BG0[tb++]=ROM[ta+1]&15;      GFX_BG0[tb++]=ROM[ta+1]>>4;      tb+=4;   }   tb=4;   if(!load_rom("d87-17.bin", ROM, 0x1FCD80)) return;	// 16x16 TILES   for(ta=0;ta<0x1FCD80;ta+=2){      GFX_BG0[tb++]=ROM[ta]&15;      GFX_BG0[tb++]=ROM[ta]>>4;      GFX_BG0[tb++]=ROM[ta+1]&15;      GFX_BG0[tb++]=ROM[ta+1]>>4;      tb+=4;   }   tb=0;   if(!load_rom("d87-08.bin", ROM, 0x1FCD80)) return;	// 16x16 TILES (MASK)   for(ta=0;ta<0x1FCD80;ta+=2){      tc=ROM[ta];      GFX_BG0[tb+7]|=((tc&0x80)>>7)<<4;      GFX_BG0[tb+6]|=((tc&0x40)>>6)<<4;      GFX_BG0[tb+5]|=((tc&0x20)>>5)<<4;      GFX_BG0[tb+4]|=((tc&0x10)>>4)<<4;      GFX_BG0[tb+3]|=((tc&0x08)>>3)<<4;      GFX_BG0[tb+2]|=((tc&0x04)>>2)<<4;      GFX_BG0[tb+1]|=((tc&0x02)>>1)<<4;      GFX_BG0[tb+0]|=((tc&0x01)>>0)<<4;      tb+=8;   }   GFX_BG0_SOLID = MakeSolidTileMap16x16(GFX_BG0, 0x7F36);   GFX_SPR_SOLID = make_solid_mask_16x16(GFX_SPR, 0x7EF0);   // Setup 68020 Memory Map   // ----------------------   AddF3MemoryMap(0x200000);   RAM_BG0=RAM+0x33000;   RAM_BG1=RAM+0x32000;   RAM_BG2=RAM+0x31000;   RAM_BG3=RAM+0x30000;   RAM_SCR0=RAM+0x6A006;   RAM_SCR1=RAM+0x6A004;   RAM_SCR2=RAM+0x6A002;   RAM_SCR3=RAM+0x6A000;   SCR3_XOFS=0xF600;   SCR2_XOFS=0xF700;   SCR1_XOFS=0xF800;   SCR0_XOFS=0xF900;   SCR3_YOFS=0xFF80;   SCR2_YOFS=0xF400;   SCR1_YOFS=0xF400;   SCR0_YOFS=0xFF80;   if(!load_rom_index(10, RAM, 0x80000)) return;   for(ta=0;ta<0x80000;ta++){      ROM[(ta<<2)+0]=RAM[ta];   }   if(!load_rom_index(9, RAM, 0x80000)) return;   for(ta=0;ta<0x80000;ta++){      ROM[(ta<<2)+1]=RAM[ta];   }   if(!load_rom_index(8, RAM, 0x80000)) return;   for(ta=0;ta<0x80000;ta++){      ROM[(ta<<2)+2]=RAM[ta];   }   if(!load_rom_index(7, RAM, 0x80000)) return;   for(ta=0;ta<0x80000;ta++){      ROM[(ta<<2)+3]=RAM[ta];   }   // 68000 code      M68000ROM = load_region[REGION_ROM2];   if(!(PCMROM=AllocateMem(0xa00000))) return;      load_be("d87-01.bin",PCMROM,0x200000);   load_be("d87-02.bin",PCMROM+0x400000,0x200000);   max_banks_this_game=3; //=memory_region_length(REGION_SOUND1)/0x400000;   memset(PCMROM+0x800000,0,0x1fffff);      memset(RAM+0x00000,0x00,0x80000);   memset(RAM+0x69000,0xFF,0x01000);   if(is_current_game("dariusg")){   // EEPROM HACKS   WriteWord68k(&ROM[0x047C0],0x7F00);		//	raine	#$00 <eeprom access>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -