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

📄 rastan.c

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 C
📖 第 1 页 / 共 2 页
字号:
/******************************************************************************//*                                                                            *//*               RASTAN/RASTAN SAGA (C) 1987 TAITO CORPORATION                *//*                                                                            *//******************************************************************************/#include "gameinc.h"#include "rastan.h"#include "rainbow.h"#include "tc100scn.h"#include "tc002obj.h"#include "sasound.h"		// sample support routines#include "taitosnd.h"#include "msm5205.h"#ifdef RAINE_DEBUG#include "debug.h"#endifstatic struct DIR_INFO rastan_dirs[] ={   { "rastan", },   { NULL, },};static struct ROM_INFO rastan_roms[] ={   {  "ic40_01.bin", 0x00020000, 0xcd30de19, REGION_GFX1, 0x000000, LOAD_8_16, },   {  "ic67_02.bin", 0x00020000, 0x54040fec, REGION_GFX1, 0x000001, LOAD_8_16, },   {  "ic39_03.bin", 0x00020000, 0xab67e064, REGION_GFX1, 0x040000, LOAD_8_16, },   {  "ic66_04.bin", 0x00020000, 0x94737e93, REGION_GFX1, 0x040001, LOAD_8_16, },   {  "ic15_05.bin", 0x00020000, 0xc22d94ac, REGION_GFX2, 0x000000, LOAD_8_16, },   {  "ic28_06.bin", 0x00020000, 0x002ccf39, REGION_GFX2, 0x000001, LOAD_8_16, },   {  "ic14_07.bin", 0x00020000, 0xb5632a51, REGION_GFX2, 0x040000, LOAD_8_16, },   {  "ic27_08.bin", 0x00020000, 0xfeafca05, REGION_GFX2, 0x040001, LOAD_8_16, },   {  "ic49_19.bin", 0x00010000, 0xee81fdd8, 0, 0, 0, },   {  "ic76_20.bin", 0x00010000, 0xfd1a34cc, 0, 0, 0, },   {  "ic19_38.bin", 0x00010000, 0x1c91dbb1, REGION_ROM1, 0x000000, LOAD_8_16, },   {  "ic07_37.bin", 0x00010000, 0xecf20bdd, REGION_ROM1, 0x000001, LOAD_8_16, },   {  "ic20_40.bin", 0x00010000, 0x0930d4b3, REGION_ROM1, 0x020000, LOAD_8_16, },   {  "ic08_39.bin", 0x00010000, 0xd95ade5e, REGION_ROM1, 0x020001, LOAD_8_16, },   {  "ic21_42.bin", 0x00010000, 0x1857a7cb, REGION_ROM1, 0x040000, LOAD_8_16, },   {  "ic09_43.bin", 0x00010000, 0xc34b9152, REGION_ROM1, 0x040001, LOAD_8_16, },   {           NULL,          0,          0, 0, 0, 0, },};static struct INPUT_INFO rastan_inputs[] ={   { KB_DEF_COIN1,        MSG_COIN1,               0x01A006, 0x20, BIT_ACTIVE_1 },   { KB_DEF_COIN2,        MSG_COIN2,               0x01A006, 0x40, BIT_ACTIVE_1 },   { KB_DEF_TILT,         MSG_TILT,                0x01A006, 0x04, BIT_ACTIVE_0 },   { KB_DEF_SERVICE,      MSG_SERVICE,             0x01A006, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_START,     MSG_P1_START,            0x01A006, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P1_UP,        MSG_P1_UP,               0x01A000, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_DOWN,      MSG_P1_DOWN,             0x01A000, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P1_LEFT,      MSG_P1_LEFT,             0x01A000, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P1_RIGHT,     MSG_P1_RIGHT,            0x01A000, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P1_B1,        MSG_P1_B1,               0x01A000, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P1_B2,        MSG_P1_B2,               0x01A000, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P2_START,     MSG_P2_START,            0x01A006, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P2_UP,        MSG_P2_UP,               0x01A002, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P2_DOWN,      MSG_P2_DOWN,             0x01A002, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P2_LEFT,      MSG_P2_LEFT,             0x01A002, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P2_RIGHT,     MSG_P2_RIGHT,            0x01A002, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P2_B1,        MSG_P2_B1,               0x01A002, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P2_B2,        MSG_P2_B2,               0x01A002, 0x20, BIT_ACTIVE_0 },   { 0,                   NULL,                    0,        0,    0            },};static struct DSW_DATA dsw_data_rastan_0[] ={   { "Cabinet",               0x01, 0x02 },   { "Upright",               0x01, 0x00 },   { "Cocktail",              0x00, 0x00 },   { MSG_SCREEN,              0x02, 0x02 },   { MSG_NORMAL,              0x02, 0x00 },   { MSG_INVERT,              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_rastan_1[] ={   { MSG_DIFFICULTY,          0x03, 0x04 },   { MSG_NORMAL,              0x03, 0x00 },   { MSG_EASY,                0x02, 0x00 },   { MSG_HARD,                0x01, 0x00 },   { MSG_HARDEST,             0x00, 0x00 },   { "Extra Life",            0x0C, 0x04 },   { "100k",                  0x0C, 0x00 },   { "150k",                  0x08, 0x00 },   { "200k",                  0x04, 0x00 },   { "250k",                  0x00, 0x00 },   { "Lives",                 0x30, 0x04 },   { "3",                     0x30, 0x00 },   { "4",                     0x20, 0x00 },   { "5",                     0x10, 0x00 },   { "6",                     0x00, 0x00 },   { "Continue",              0x40, 0x02 },   { MSG_ON,                  0x40, 0x00 },   { MSG_OFF,                 0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_INFO rastan_dsw[] ={   { 0x01A008, 0xFF, dsw_data_rastan_0 },   { 0x01A00A, 0xFF, dsw_data_rastan_1 },   { 0,        0,    NULL,      },};static struct ROMSW_DATA romsw_data_rastan_0[] ={   { "Taito Japan",           0x01 },   { "Taito America",         0x02 },   { NULL,                    0    },};static struct ROMSW_INFO rastan_romsw[] ={   { 0x05FFFF, 0x01, romsw_data_rastan_0 },   { 0,        0,    NULL },};static struct GFX_LAYOUT rastan_gfx_tiles ={   8,8,   RGN_FRAC(1,1),   4,   {0,1,2,3},   {STEP8(0,4)},   {STEP8(0,8*4)},   8*8*4};static struct GFX_LAYOUT rastan_gfx_object ={   16,16,   RGN_FRAC(1,1),   4,   {0,1,2,3},   {STEP16(0,4)},   {STEP16(0,16*4)},   16*16*4};static struct GFX_LIST rastan_gfx[] ={   { REGION_GFX1, &rastan_gfx_tiles,  },   { REGION_GFX2, &rastan_gfx_object, },   { 0,           NULL,               },};static struct VIDEO_INFO rastan_video ={   draw_rastan,   320,   240,   32,   VIDEO_ROTATE_NORMAL| VIDEO_ROTATABLE,   rastan_gfx,};static struct YM2151interface ym2151_interface ={  1,			// 1 chip  4000000,		// 4 MHz  { YM3012_VOL(160,OSD_PAN_LEFT,160,OSD_PAN_RIGHT) },  { NULL },  { NULL }};static struct msm5205_adpcm_list rastan_adpcm[] ={  { 0x000000,0x0001C0-1 },  { 0x000200,0x0006D4-1 },  { 0x000700,0x002700-1 },  { 0x002800,0x006280-1 },  { 0x006300,0x00B040-1 },  { 0x00B100,0x00C5F0-1 },};static struct MSM5205buffer_interface msm5205_interface ={   1,   { 8000 },   { 160 },   { rastan_adpcm },   { sizeof(rastan_adpcm) / sizeof(struct msm5205_adpcm_list) },   { NULL },   { 0 },   MSM5205_MONO,};static struct SOUND_INFO rastan_sound[] ={   { SOUND_YM2151J, &ym2151_interface,  },   { SOUND_MSM5205, &msm5205_interface, },   { 0,             NULL,               },};struct GAME_MAIN game_rastan ={   rastan_dirs,   rastan_roms,   rastan_inputs,   rastan_dsw,   rastan_romsw,   load_rastan,   clear_rastan,   &rastan_video,   execute_rastan_frame,   "rastan",   "Rastan",   "儔僗僞儞僒乕僈",   COMPANY_ID_TAITO,   "B04",   1987,   rastan_sound,   GAME_BEAT | GAME_PLATFORM,};static struct DIR_INFO rastan_saga_dirs[] ={   { "rastan_saga", },   { "rastsaga", },   { ROMOF("rastan"), },   { CLONEOF("rastan"), },   { NULL, },};static struct ROM_INFO rastan_saga_roms[] ={   {  "ic40_01.bin", 0x00020000, 0xcd30de19, REGION_GFX1, 0x000000, LOAD_8_16, },   {  "ic67_02.bin", 0x00020000, 0x54040fec, REGION_GFX1, 0x000001, LOAD_8_16, },   {  "ic39_03.bin", 0x00020000, 0xab67e064, REGION_GFX1, 0x040000, LOAD_8_16, },   {  "ic66_04.bin", 0x00020000, 0x94737e93, REGION_GFX1, 0x040001, LOAD_8_16, },   {  "ic15_05.bin", 0x00020000, 0xc22d94ac, REGION_GFX2, 0x000000, LOAD_8_16, },   {  "ic28_06.bin", 0x00020000, 0x002ccf39, REGION_GFX2, 0x000001, LOAD_8_16, },   {  "ic14_07.bin", 0x00020000, 0xb5632a51, REGION_GFX2, 0x040000, LOAD_8_16, },   {  "ic27_08.bin", 0x00020000, 0xfeafca05, REGION_GFX2, 0x040001, LOAD_8_16, },   {  "ic49_19.bin", 0x00010000, 0xee81fdd8, 0, 0, 0, },   {  "ic76_20.bin", 0x00010000, 0xfd1a34cc, 0, 0, 0, },   {  "rs19_38.bin", 0x00010000, 0xa38ac909, REGION_ROM1, 0x000000, LOAD_8_16, },   {  "rs07_37.bin", 0x00010000, 0xbad60872, REGION_ROM1, 0x000001, LOAD_8_16, },   {  "rs20_40.bin", 0x00010000, 0x6bcf70dc, REGION_ROM1, 0x020000, LOAD_8_16, },   {  "rs08_39.bin", 0x00010000, 0x8838ecc5, REGION_ROM1, 0x020001, LOAD_8_16, },   {  "rs21_42.bin", 0x00010000, 0xb626c439, REGION_ROM1, 0x040000, LOAD_8_16, },   {  "rs09_43.bin", 0x00010000, 0xc928a516, REGION_ROM1, 0x040001, LOAD_8_16, },   {           NULL,          0,          0, 0, 0, 0, },};static struct DSW_DATA dsw_data_rastan_saga_0[] ={   { "Cabinet",               0x01, 0x02 },   { "Upright",               0x01, 0x00 },   { "Cocktail",              0x00, 0x00 },   { MSG_SCREEN,              0x02, 0x02 },   { MSG_NORMAL,              0x02, 0x00 },   { MSG_INVERT,              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 },	// Alternate coinage in rastan saga   { MSG_2COIN_1PLAY,         0x20, 0x00 },   { MSG_1COIN_2PLAY,         0x10, 0x00 },   { MSG_2COIN_3PLAY,         0x00, 0x00 },   { MSG_COIN2,               0xC0, 0x04 },   { MSG_1COIN_1PLAY,         0xC0, 0x00 },   { MSG_2COIN_1PLAY,         0x80, 0x00 },   { MSG_1COIN_2PLAY,         0x40, 0x00 },   { MSG_2COIN_3PLAY,         0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_INFO rastan_saga_dsw[] ={   { 0x01A008, 0xFF, dsw_data_rastan_saga_0 },   { 0x01A00A, 0xFF, dsw_data_rastan_1 },   { 0,        0,    NULL,      },};static struct ROMSW_DATA romsw_data_rastan_saga_0[] ={   { "Taito Japan",           0xFF },   { "Taito America",         0x00 },   { NULL,                    0    },};static struct ROMSW_INFO rastan_saga_romsw[] ={   { 0x05FFFF, 0xFF, romsw_data_rastan_saga_0 },   { 0,        0,    NULL },};struct GAME_MAIN game_rastan_saga ={   rastan_saga_dirs,   rastan_saga_roms,   rastan_inputs,   rastan_saga_dsw,   rastan_saga_romsw,   load_rastan,   clear_rastan,   &rastan_video,   execute_rastan_frame,   "rastsaga",   "Rastan Saga",   "儔僗僞儞僒乕僈 Saga",   COMPANY_ID_TAITO,   "B04",   1987,   rastan_sound,   GAME_BEAT | GAME_PLATFORM,};static struct DIR_INFO rastan_american_dirs[] ={   { "rastan_american", },   { "rastan_usa", },   { "rastanu", },   { ROMOF("rastan"), },   { CLONEOF("rastan"), },   { NULL, },};static struct ROM_INFO rastan_american_roms[] ={   {  "ic40_01.bin", 0x00020000, 0xcd30de19, REGION_GFX1, 0x000000, LOAD_8_16, },

⌨️ 快捷键说明

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