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

📄 warriorb.c

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 C
📖 第 1 页 / 共 2 页
字号:
/* ****************************************************************************** *                                                                            * *                 WARRIOR BLADE (C) 1991 TAITO CORPORATION                   * *                                                                            * ****************************************************************************** Aug 04, 2000  - Removed ROM d24-07.bin as it was 100% same as ROM d24-02.bin  - Removed the loading of ROM d24-09.bin with the sound ROMs*/#include "gameinc.h"#include "warriorb.h"#include "tc100scn.h"#include "tc110pcr.h"#include "tc220ioc.h"#include "sasound.h"		// sample support routines#include "taitosnd.h"static struct DIR_INFO warrior_blade_dirs[] ={   { "warrior_blade", },   { "warriorb", },   { NULL, },};static struct ROM_INFO warrior_blade_roms[] ={   {   "d24-01.bin", 0x00100000, 0x326dcca9, 0, 0, 0, },   {   "d24-02.bin", 0x00100000, 0x9f50c271, 0, 0, 0, },   {   "d24-03.bin", 0x00100000, 0x46db9fd7, 0, 0, 0, },   {   "d24-04.bin", 0x00100000, 0x148e0493, 0, 0, 0, },   {   "d24-05.bin", 0x00100000, 0x9f414317, 0, 0, 0, },   {   "d24-06.bin", 0x00100000, 0x918486fe, 0, 0, 0, },   {   "d24-08.bin", 0x00100000, 0x1e6d1528, 0, 0, 0, },   {   "d24-09.bin", 0x00100000, 0xece5cc59, 0, 0, 0, },   {   "d24-10.bin", 0x00100000, 0x0e0c716d, 0, 0, 0, },   {   "d24-11.bin", 0x00100000, 0x15362573, 0, 0, 0, },   {   "d24-12.bin", 0x00100000, 0x279203a1, 0, 0, 0, },   {   "d24-17.bin", 0x00020000, 0xe41e4aae, 0, 0, 0, },   { "d24-18-1.bin", 0x00040000, 0x4502db60, 0, 0, 0, },   { "d24-19-1.bin", 0x00040000, 0x15c16016, 0, 0, 0, },   { "d24-20-1.bin", 0x00040000, 0x4452dc25, 0, 0, 0, },   { "d24-21-1.bin", 0x00040000, 0x783ef8e1, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};static struct INPUT_INFO warrior_blade_inputs[] ={   { KB_DEF_COIN1,        MSG_COIN1,               0x040004, 0x04, BIT_ACTIVE_0 },   { KB_DEF_COIN2,        MSG_COIN2,               0x040004, 0x08, BIT_ACTIVE_0 },   { KB_DEF_TILT,         MSG_TILT,                0x040004, 0x02, BIT_ACTIVE_0 },   { KB_DEF_SERVICE,      MSG_SERVICE,             0x040004, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_START,     MSG_P1_START,            0x040004, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P1_UP,        MSG_P1_UP,               0x040006, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_DOWN,      MSG_P1_DOWN,             0x040006, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P1_LEFT,      MSG_P1_LEFT,             0x040006, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P1_RIGHT,     MSG_P1_RIGHT,            0x040006, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P1_B1,        MSG_P1_B1,               0x04000E, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P1_B2,        MSG_P1_B2,               0x04000E, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P1_B3,        MSG_P1_B3,               0x040004, 0x40, BIT_ACTIVE_0 },   { KB_DEF_P2_START,     MSG_P2_START,            0x040004, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P2_UP,        MSG_P2_UP,               0x040006, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P2_DOWN,      MSG_P2_DOWN,             0x040006, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P2_LEFT,      MSG_P2_LEFT,             0x040006, 0x40, BIT_ACTIVE_0 },   { KB_DEF_P2_RIGHT,     MSG_P2_RIGHT,            0x040006, 0x80, BIT_ACTIVE_0 },   { KB_DEF_P2_B1,        MSG_P2_B1,               0x04000E, 0x40, BIT_ACTIVE_0 },   { KB_DEF_P2_B2,        MSG_P2_B2,               0x04000E, 0x80, BIT_ACTIVE_0 },   { KB_DEF_P2_B3,        MSG_P2_B3,               0x040004, 0x80, BIT_ACTIVE_0 },   { 0,                   NULL,                    0,        0,    0            },};static struct DSW_DATA dsw_data_warrior_blade_0[] ={   { MSG_DSWA_BIT1,           0x01, 0x02 },   { MSG_OFF,                 0x01, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { MSG_DSWA_BIT2,           0x02, 0x02 },   { MSG_OFF,                 0x02, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { MSG_TEST_MODE,           0x04, 0x02 },   { MSG_OFF,                 0x04, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { MSG_DEMO_SOUND,          0x08, 0x02 },   { MSG_ON,                  0x08, 0x00 },   { MSG_OFF,                 0x00, 0x00 },   { MSG_COIN1,               0x30, 0x04 },   { MSG_1COIN_1PLAY,         0x30, 0x00 },   { MSG_1COIN_2PLAY,         0x20, 0x00 },   { MSG_2COIN_1PLAY,         0x10, 0x00 },   { MSG_3COIN_1PLAY,         0x00, 0x00 },   { MSG_COIN2,               0xC0, 0x04 },   { MSG_1COIN_1PLAY,         0xC0, 0x00 },   { MSG_1COIN_2PLAY,         0x80, 0x00 },   { MSG_2COIN_1PLAY,         0x40, 0x00 },   { MSG_3COIN_1PLAY,         0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_DATA dsw_data_warrior_blade_1[] ={   { MSG_DIFFICULTY,          0x03, 0x04 },   { MSG_NORMAL,              0x03, 0x00 },   { MSG_EASY,                0x02, 0x00 },   { MSG_HARD,                0x01, 0x00 },   { MSG_HARDEST,             0x00, 0x00 },   { MSG_DSWB_BIT3,           0x04, 0x02 },   { MSG_OFF,                 0x04, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { MSG_DSWB_BIT4,           0x08, 0x02 },   { MSG_OFF,                 0x08, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { "Power Ups",             0x10, 0x02 },   { MSG_OFF,                 0x10, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { "Magician",              0x20, 0x02 },   { MSG_OFF,                 0x20, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { MSG_CONTINUE_PLAY,       0x40, 0x02 },   { MSG_ON,                  0x40, 0x00 },   { MSG_OFF,                 0x00, 0x00 },   { MSG_DSWB_BIT8,           0x80, 0x02 },   { MSG_OFF,                 0x80, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_INFO warrior_blade_dsw[] ={   { 0x040000, 0xFF, dsw_data_warrior_blade_0 },   { 0x040002, 0xFF, dsw_data_warrior_blade_1 },   { 0,        0,    NULL,      },};static struct ROMSW_DATA romsw_data_warrior_blade_0[] ={   { "Taito Japan",           0x00 },   { "Taito Japan (Notice)",  0x01 },   { "Taito America",         0x02 },   { NULL,                    0    },};static struct ROMSW_INFO warrior_blade_romsw[] ={   { 0x0FFFFF, 0x01, romsw_data_warrior_blade_0 },   { 0,        0,    NULL },};static struct VIDEO_INFO warrior_blade_video ={   DrawWarriorBlade,   640,   240,   32,   VIDEO_ROTATE_NORMAL,};struct GAME_MAIN game_warrior_blade ={   warrior_blade_dirs,   warrior_blade_roms,   warrior_blade_inputs,   warrior_blade_dsw,   warrior_blade_romsw,   LoadWarriorBlade,   ClearWarriorBlade,   &warrior_blade_video,   ExecuteWarriorBladeFrame,   "warriorb",   "Warrior Blade",   "釫釮忤釧黐鈛忸黐鈎",   COMPANY_ID_TAITO,   "D24",   1991,   taito_ym2610b_sound,   GAME_BEAT,};static UINT8 *RAM_INPUT;static UINT8 *GFX_BG0;static UINT8 *GFX_BG0_SOLID;static UINT8 *GFX_BG1;static UINT8 *GFX_BG1_SOLID;static UINT8 *GFX_SPR;static UINT8 *GFX_SPR_SOLID;void LoadWarriorBlade(void){   int ta,tb;   if(!(GFX=AllocateMem(0x1000000))) return;   if(!(RAM=AllocateMem(0x100000))) return;   GFX_BG0 = GFX+0x000000;   GFX_BG1 = GFX+0x400000;   GFX_SPR = GFX+0x800000;   tb=0;   if(!load_rom("D24-02.bin", RAM, 0x100000)) return;		// BG0 GFX (SCREEN 0)   for(ta=0;ta<0x100000;ta+=2){      GFX_BG0[tb++]=RAM[ta+1]>>4;      GFX_BG0[tb++]=RAM[ta+1]&15;      GFX_BG0[tb++]=RAM[ta+0]>>4;      GFX_BG0[tb++]=RAM[ta+0]&15;   }   if(!load_rom("D24-01.bin", RAM, 0x100000)) return;   for(ta=0;ta<0x100000;ta+=2){      GFX_BG0[tb++]=RAM[ta+1]>>4;      GFX_BG0[tb++]=RAM[ta+1]&15;      GFX_BG0[tb++]=RAM[ta+0]>>4;      GFX_BG0[tb++]=RAM[ta+0]&15;   }   tb=0;   if(!load_rom("D24-02.bin", RAM, 0x100000)) return;		// BG0 GFX (SCREEN 1)   for(ta=0;ta<0x100000;ta+=2){					// Was "D24-07.bin" but it's exactly      GFX_BG1[tb++]=RAM[ta+1]>>4;				//  the same as "D24-02.bin"      GFX_BG1[tb++]=RAM[ta+1]&15;      GFX_BG1[tb++]=RAM[ta+0]>>4;      GFX_BG1[tb++]=RAM[ta+0]&15;   }   if(!load_rom("D24-08.bin", RAM, 0x100000)) return;   for(ta=0;ta<0x100000;ta+=2){      GFX_BG1[tb++]=RAM[ta+1]>>4;      GFX_BG1[tb++]=RAM[ta+1]&15;      GFX_BG1[tb++]=RAM[ta+0]>>4;      GFX_BG1[tb++]=RAM[ta+0]&15;   }   tb=0;   if(!load_rom("D24-03.bin", RAM, 0x100000)) return;		// SPRITES   for(ta=0;ta<0x100000;ta+=2){      GFX_SPR[tb+3]=RAM[ta+1]>>4;      GFX_SPR[tb+2]=RAM[ta+1]&15;      GFX_SPR[tb+1]=RAM[ta+0]>>4;      GFX_SPR[tb+0]=RAM[ta+0]&15;      tb+=16;   }   tb=0;   if(!load_rom("D24-06.bin", RAM, 0x100000)) return;   for(ta=0;ta<0x100000;ta+=2){      GFX_SPR[tb+7]=RAM[ta+1]>>4;      GFX_SPR[tb+6]=RAM[ta+1]&15;      GFX_SPR[tb+5]=RAM[ta+0]>>4;      GFX_SPR[tb+4]=RAM[ta+0]&15;      tb+=16;   }   tb=0;   if(!load_rom("D24-05.bin", RAM, 0x100000)) return;   for(ta=0;ta<0x100000;ta+=2){      GFX_SPR[tb+11]=RAM[ta+1]>>4;      GFX_SPR[tb+10]=RAM[ta+1]&15;      GFX_SPR[tb+9]=RAM[ta+0]>>4;      GFX_SPR[tb+8]=RAM[ta+0]&15;      tb+=16;   }   tb=0;   if(!load_rom("D24-04.bin", RAM, 0x100000)) return;   for(ta=0;ta<0x100000;ta+=2){      GFX_SPR[tb+15]=RAM[ta+1]>>4;      GFX_SPR[tb+14]=RAM[ta+1]&15;      GFX_SPR[tb+13]=RAM[ta+0]>>4;      GFX_SPR[tb+12]=RAM[ta+0]&15;      tb+=16;   }   FreeMem(RAM);   GFX_BG0_SOLID = make_solid_mask_8x8  (GFX_BG0, 0x10000);   GFX_BG1_SOLID = make_solid_mask_8x8  (GFX_BG1, 0x10000);   GFX_SPR_SOLID = make_solid_mask_16x16(GFX_SPR, 0x08000);   RAMSize=0x70000+0x20000;   if(!(RAM=AllocateMem(RAMSize))) return;   if(!(ROM=AllocateMem(0x200000))) return;   if(!load_rom("D24-20-1.bin", RAM, 0x40000)) return;   for(ta=0;ta<0x40000;ta++){      ROM[ta+ta]=RAM[ta];   }   if(!load_rom("D24-19-1.bin", RAM, 0x40000)) return;   for(ta=0;ta<0x40000;ta++){      ROM[ta+ta+1]=RAM[ta];   }   if(!load_rom("D24-21-1.bin", RAM, 0x40000)) return;   for(ta=0;ta<0x40000;ta++){      ROM[ta+ta+0x80000]=RAM[ta];   }   if(!load_rom("D24-18-1.bin", RAM, 0x40000)) return;   for(ta=0;ta<0x40000;ta++){      ROM[ta+ta+0x80001]=RAM[ta];   }   if(!load_rom("D24-09.bin",&ROM[0x100000],0x100000)) return;   /*-----[Sound Setup]-----*/   Z80ROM=RAM+0x70000;   if(!load_rom("D24-17.bin", Z80ROM, 0x20000)) return;	// Z80 SOUND ROM   if(!(PCMROM=AllocateMem(0x300000))) return;   if(!load_rom("D24-12.bin",PCMROM+0x000000,0x100000)) return; // ADPCM A rom   if(!load_rom("D24-10.bin",PCMROM+0x100000,0x100000)) return; // ADPCM B rom   if(!load_rom("D24-11.bin",PCMROM+0x200000,0x100000)) return; // ADPCM B rom   YM2610SetBuffers(PCMROM, PCMROM, 0x100000, 0x300000);   AddTaitoYM2610B_OffsetVol(0x01FC, 0x0171, 0x20000, 4);   /*-----------------------*/   memset(RAM+0x00000,0x00,0x70000);   RAM_INPUT = RAM+0x40000;   GFX_FG0   = RAM+0x3C000;   tc0100scn[0].RAM     = RAM+0x21000-0x6000;   tc0100scn[0].GFX_FG0 = GFX_FG0;   init_tc0100scn(0);   tc0110pcr_init_typeb(RAM+0x3A000, 1, 0);   tc0110pcr_init_typeb_2(RAM+0x3B000, 1, 0);   InitPaletteMap(RAM+0x3A000, 0x100, 0x10, 0x8000);   set_colour_mapper(&col_map_xbbb_bbgg_gggr_rrrr);   // 68000 Speed Hacks

⌨️ 快捷键说明

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