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

📄 ninjaw.c

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 C
📖 第 1 页 / 共 4 页
字号:
/******************************************************************************//*                                                                            *//*                  NINJA WARRIORS (C) 1987 TAITO CORPORATION                 *//*                                                                            *//*                     DARIUS 2 (C) 1989 TAITO CORPORATION                    *//*                                                                            *//******************************************************************************/#include "gameinc.h"#include "ninjaw.h"#include "tc100scn.h"#include "tc110pcr.h"#include "tc220ioc.h"#include "sasound.h"		// sample support routines#include "taitosnd.h"/*Todo:- Priorities later in Ninja Warriors (easy)- Line-line scroll (not so easy without losing speed)- Why do the games not use the same ym2610 frame?*//******************   NINJA WARRIORS ******************/static struct DIR_INFO ninja_warriors_dirs[] ={   { "ninja_warriors", },   { "ninjaw", },   { NULL, },};static struct ROM_INFO ninja_warriors_roms[] ={   {       "b31-27", 0x00010000, 0x2f3ff642, 0, 0, 0, },   {       "b31-29", 0x00010000, 0xf2941a37, 0, 0, 0, },   {       "b31-31", 0x00010000, 0x837f47e2, 0, 0, 0, },   {       "b31-32", 0x00010000, 0xe6025fec, 0, 0, 0, },   {       "b31-33", 0x00010000, 0x6ce9af44, 0, 0, 0, },   {       "b31-34", 0x00010000, 0xd6b5fb2a, 0, 0, 0, },   {       "b31-35", 0x00010000, 0x70d9a89f, 0, 0, 0, },   {       "b31-36", 0x00010000, 0xba20b0d4, 0, 0, 0, },   {       "b31-37", 0x00020000, 0x0ca5799d, 0, 0, 0, },   {       "b31-38", 0x00020000, 0xbc68cd99, 0, 0, 0, },   {       "b31-39", 0x00020000, 0xe9197c3c, 0, 0, 0, },   {       "b31-40", 0x00020000, 0x2ce0f24e, 0, 0, 0, },   {       "b31-41", 0x00020000, 0x0daef28a, 0, 0, 0, },   {       "b31-45", 0x00010000, 0x107902c3, 0, 0, 0, },   {       "b31-47", 0x00010000, 0xbd536b1e, 0, 0, 0, },   {       "b31-01", 0x00080000, 0x8e8237a7, 0, 0, 0, },   {       "b31-02", 0x00080000, 0x4c3b4e33, 0, 0, 0, },   {       "b31-04", 0x00080000, 0x2e1e4cb5, 0, 0, 0, },   {       "b31-05", 0x00080000, 0x0a1fc9fb, 0, 0, 0, },   {       "b31-06", 0x00080000, 0x0d59439e, 0, 0, 0, },   {       "b31-07", 0x00080000, 0x33568cdb, 0, 0, 0, },   {       "b31-08", 0x00080000, 0xa0a1f87d, 0, 0, 0, },   {       "b31-09", 0x00080000, 0x60a73382, 0, 0, 0, },   {       "b31-10", 0x00080000, 0xc6434aef, 0, 0, 0, },   {       "b31-11", 0x00080000, 0x8da531d4, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};static struct INPUT_INFO ninja_warriors_inputs[] ={   { KB_DEF_COIN1,        MSG_COIN1,               0x03B004, 0x04, BIT_ACTIVE_1 },   { KB_DEF_COIN2,        MSG_COIN2,               0x03B004, 0x08, BIT_ACTIVE_1 },   { KB_DEF_TILT,         MSG_TILT,                0x03B00E, 0x02, BIT_ACTIVE_0 },   { KB_DEF_SERVICE,      MSG_SERVICE,             0x03B00E, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_START,     MSG_P1_START,            0x03B00E, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P1_UP,        MSG_P1_UP,               0x03B006, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_DOWN,      MSG_P1_DOWN,             0x03B006, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P1_LEFT,      MSG_P1_LEFT,             0x03B006, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P1_RIGHT,     MSG_P1_RIGHT,            0x03B006, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P1_B1,        MSG_P1_B1,               0x03B00E, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P1_B2,        MSG_P1_B2,               0x03B00E, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P2_START,     MSG_P2_START,            0x03B00E, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P2_UP,        MSG_P2_UP,               0x03B006, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P2_DOWN,      MSG_P2_DOWN,             0x03B006, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P2_LEFT,      MSG_P2_LEFT,             0x03B006, 0x80, BIT_ACTIVE_0 },   { KB_DEF_P2_RIGHT,     MSG_P2_RIGHT,            0x03B006, 0x40, BIT_ACTIVE_0 },   { KB_DEF_P2_B1,        MSG_P2_B1,               0x03B00E, 0x40, BIT_ACTIVE_0 },   { KB_DEF_P2_B2,        MSG_P2_B2,               0x03B00E, 0x80, BIT_ACTIVE_0 },   { 0,                   NULL,                    0,        0,    0            },};static struct DSW_DATA dsw_data_ninja_warriors_0[] ={   { MSG_CONTINUE_PLAY,       0x01, 0x02 },   { MSG_ON,                  0x01, 0x00 },   { MSG_OFF,                 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_2COIN_1PLAY,         0x20, 0x00 },   { MSG_3COIN_1PLAY,         0x10, 0x00 },   { MSG_4COIN_1PLAY,         0x00, 0x00 },   { MSG_COIN2,               0xC0, 0x04 },   { MSG_1COIN_2PLAY,         0xC0, 0x00 },   { MSG_1COIN_3PLAY,         0x80, 0x00 },   { MSG_1COIN_4PLAY,         0x40, 0x00 },   { MSG_1COIN_6PLAY,         0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_DATA dsw_data_ninja_warriors_1[] ={   { MSG_DIFFICULTY,          0x03, 0x04 },   { MSG_NORMAL,              0x03, 0x00 },   { MSG_EASY,                0x02, 0x00 },   { MSG_HARD,                0x01, 0x00 },   { MSG_HARDEST,             0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_INFO ninja_warriors_dsw[] ={   { 0x03B000, 0xFF, dsw_data_ninja_warriors_0 },   { 0x03B002, 0xFF, dsw_data_ninja_warriors_1 },   { 0,        0,    NULL,      },};/*static struct ROMSW_DATA romsw_data_ninja_warriors_0[] ={   { "Taito Worldwide",       0x01 },   { "Taito America",         0x02 },   { "Taito Japan",           0x03 },   { NULL,                    0    },};*//*static struct ROMSW_INFO ninja_warriors_romsw[] ={   { 0x01FFFF, 0x03, romsw_data_ninja_warriors_0 },   { 0,        0,    NULL },};*/static struct VIDEO_INFO ninja_warriors_video ={   draw_ninja_warriors,   864,   224,   32,   VIDEO_ROTATE_NORMAL| VIDEO_ROTATABLE,};struct GAME_MAIN game_ninja_warriors ={   ninja_warriors_dirs,   ninja_warriors_roms,   ninja_warriors_inputs,   ninja_warriors_dsw,   NULL,   load_ninja_warriors,   clear_ninja_warriors,   &ninja_warriors_video,   execute_ninja_warriors_frame,   "ninjaw",   "Ninja Warriors",   "鯡囊釫釮黐忤釧黐釿",   COMPANY_ID_TAITO,   "B31",   1987,   taito_ym2610_sound,   GAME_BEAT,};/************************   NINJA WARRIORS JAPAN ************************/static struct DIR_INFO ninja_warriors_jp_dirs[] ={   { "ninja_warriors_jp", },   { "ninjawj", },   { ROMOF("ninjaw"), },   { CLONEOF("ninjaw"), },   { NULL, },};static struct ROM_INFO ninja_warriors_jp_roms[] ={   {       "b31-27", 0x00010000, 0x2f3ff642, 0, 0, 0, },   {       "b31-29", 0x00010000, 0xf2941a37, 0, 0, 0, },   {       "b31-31", 0x00010000, 0x837f47e2, 0, 0, 0, },   {       "b31-32", 0x00010000, 0xe6025fec, 0, 0, 0, },   {       "b31-33", 0x00010000, 0x6ce9af44, 0, 0, 0, },   {       "b31-34", 0x00010000, 0xd6b5fb2a, 0, 0, 0, },   {       "b31-35", 0x00010000, 0x70d9a89f, 0, 0, 0, },   {       "b31-36", 0x00010000, 0xba20b0d4, 0, 0, 0, },   {       "b31-37", 0x00020000, 0x0ca5799d, 0, 0, 0, },   {       "b31-38", 0x00020000, 0xbc68cd99, 0, 0, 0, },   {       "b31-39", 0x00020000, 0xe9197c3c, 0, 0, 0, },   {       "b31-40", 0x00020000, 0x2ce0f24e, 0, 0, 0, },   {       "b31-41", 0x00020000, 0x0daef28a, 0, 0, 0, },   {   "b31-30.bin", 0x00010000, 0x056edd9f, 0, 0, 0, },   {   "b31-28.bin", 0x00010000, 0xcfa7661c, 0, 0, 0, },   {       "b31-01", 0x00080000, 0x8e8237a7, 0, 0, 0, },   {       "b31-02", 0x00080000, 0x4c3b4e33, 0, 0, 0, },   {       "b31-04", 0x00080000, 0x2e1e4cb5, 0, 0, 0, },   {       "b31-05", 0x00080000, 0x0a1fc9fb, 0, 0, 0, },   {       "b31-06", 0x00080000, 0x0d59439e, 0, 0, 0, },   {       "b31-07", 0x00080000, 0x33568cdb, 0, 0, 0, },   {       "b31-08", 0x00080000, 0xa0a1f87d, 0, 0, 0, },   {       "b31-09", 0x00080000, 0x60a73382, 0, 0, 0, },   {       "b31-10", 0x00080000, 0xc6434aef, 0, 0, 0, },   {       "b31-11", 0x00080000, 0x8da531d4, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};static struct DSW_DATA dsw_data_ninja_warriors_jp_0[] ={   { MSG_CONTINUE_PLAY,       0x01, 0x02 },   { MSG_ON,                  0x01, 0x00 },   { MSG_OFF,                 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_2COIN_3PLAY,         0x00, 0x00 },   { MSG_COIN2,               0xC0, 0x04 },   { MSG_1COIN_1PLAY,         0xC0, 0x00 },   { MSG_1COIN_2PLAY,         0x80, 0x00 },   { MSG_2COIN_1PLAY,         0x40, 0x00 },   { MSG_2COIN_3PLAY,         0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_INFO ninja_warriors_jp_dsw[] ={   { 0x03B000, 0xFF, dsw_data_ninja_warriors_jp_0 },   { 0x03B002, 0xFF, dsw_data_ninja_warriors_1 },   { 0,        0,    NULL,      },};struct GAME_MAIN game_ninja_warriors_jp ={   ninja_warriors_jp_dirs,   ninja_warriors_jp_roms,   ninja_warriors_inputs,   ninja_warriors_jp_dsw,   NULL,   load_ninja_warriors,   clear_ninja_warriors,   &ninja_warriors_video,   execute_ninja_warriors_frame,   "ninjawj",   "Ninja Warriors (Japan)",   "鯡囊釫釮黐忤釧黐釿 (Japan)",   COMPANY_ID_TAITO,   "B31",   1987,   taito_ym2610_sound,   GAME_BEAT,};/************   DARIUS 2 ************/static struct DIR_INFO darius_2_dirs[] ={   { "darius_2", },   { "darius2", },   { "darius2d", },   { NULL, },};static struct ROM_INFO darius_2_roms[] ={   {       "c07-01", 0x00080000, 0x3cf0f050, 0, 0, 0, },   {       "c07-02", 0x00080000, 0x75d16d4b, 0, 0, 0, },   {       "c07-03", 0x00080000, 0x189bafce, 0, 0, 0, },   {       "c07-04", 0x00080000, 0x50421e81, 0, 0, 0, },   {       "c07-10", 0x00080000, 0x4bbe0ed9, 0, 0, 0, },   {       "c07-11", 0x00080000, 0x3c815699, 0, 0, 0, },   {       "c07-12", 0x00080000, 0xe0b71258, 0, 0, 0, },   {       "c07-27", 0x00020000, 0x0a6f7b6c, 0, 0, 0, },   {       "c07-25", 0x00020000, 0x059f40ce, 0, 0, 0, },   {       "c07-26", 0x00020000, 0x1f411242, 0, 0, 0, },   {       "c07-24", 0x00020000, 0x486c9c20, 0, 0, 0, },   {       "c07-28", 0x00020000, 0xda304bc5, 0, 0, 0, },   {     "c07-29-1", 0x00010000, 0x48de567f, 0, 0, 0, },   {     "c07-30-1", 0x00010000, 0x6122e400, 0, 0, 0, },   {     "c07-31-1", 0x00010000, 0x8279d2f8, 0, 0, 0, },   {     "c07-32-1", 0x00010000, 0x216c8f6a, 0, 0, 0, },   {     "c07-33-1", 0x00010000, 0x2da03a3f, 0, 0, 0, },   {     "c07-34-1", 0x00010000, 0x296984b8, 0, 0, 0, },   {     "c07-35-1", 0x00010000, 0xdd8c4723, 0, 0, 0, },   {     "c07-36-1", 0x00010000, 0x02cf2b1c, 0, 0, 0, },   {     "c07-37-1", 0x00010000, 0x8b7d461f, 0, 0, 0, },   {     "c07-38-1", 0x00010000, 0x46afb85c, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};static struct DSW_DATA dsw_data_darius_2_0[] ={   { MSG_DSWA_BIT1,           0x01, 0x02 },   { MSG_OFF,                 0x01, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { "Continuous Fire",       0x02, 0x02 },   { MSG_NORMAL,              0x02, 0x00 },   { "Fast",                  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_2COIN_3PLAY,         0x00, 0x00 },   { MSG_COIN2,               0xC0, 0x04 },   { MSG_1COIN_1PLAY,         0xC0, 0x00 },   { MSG_1COIN_2PLAY,         0x80, 0x00 },   { MSG_2COIN_1PLAY,         0x40, 0x00 },   { MSG_2COIN_3PLAY,         0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_DATA dsw_data_darius_2_1[] =

⌨️ 快捷键说明

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