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

📄 megasys1.c

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 C
📖 第 1 页 / 共 5 页
字号:
/******************************************************************************//*                                                                            *//*                        JALECO MEGA SYSTEM-1/1B/1C                          *//*                        ------------------------                          *//*   CPU: 68000                                                               *//* SOUND: 68000 YM2151 M6295x2                                                *//* VIDEO: 256x224 JALECO CUSTOM <3xBG0 1xSPR+CHAIN>                           *//*                                                                            *//*                            LEGEND OF MAKAI                                 *//*                            ---------------                                 *//*   CPU: 68000                                                               *//* SOUND: Z80 YM2203                                                          *//* VIDEO: 256x224 JALECO CUSTOM <2xBG0 1xSPR>                                 *//*                                                                            *//******************************************************************************/// Note : YM2151 does not start in 64thstreet... Must be related to the// latch system.#include "gameinc.h"#include "megasys1.h"#include "taitosnd.h"#include "decode.h"#include "sasound.h"#include "debug.h"#define ROM_COUNT       22/* Supported romsets:  0 - Rodland Japanese     - 1990 - MS1  1 - Saint Dragon         - 1989 - MS1  2 - P47 Japanese         - 1988 - MS1  3 - Phantasm             - 1991 - MS1  4 - Kick Off             - 1988 - MS1  5 - Hachoo               - 1989 - MS1  6 - Plus Alpha           - 1989 - MS1  7 - Avenging Spirit      - 1991 - MS1B  8 - Cybattler            - 1993 - MS1C  9 - 64th Street American - 1991 - MS1C 10 - Earth Defence Force  - 1991 - MS1B 11 - Shingen              - 1988 - MS1 12 - Legend of Makai      - 1988 - Pre MS1 13 - Astyanax             - 1989 - MS1 [The Lord of King] 14 - P47 American         - 1988 - MS1 15 - Rodland American     - 1990 - MS1 16 - Peek a Boo           - 1988 - MSx 17 - 64th Street Japanese - 1991 - MS1C 18 - Chimera Beast        - 1993 - MS1 19 - The Lord of King     - 1988 - MS1 20 - Iga Ninjyutsuden     - 1988 - MS1 21 - Soldam               - 1990 - MS1 Todo: - Sprite Mosaic <only used in Jaleco logo in P47>. - Sprite-Sprite Priorities <eg. Shingen, Kick Off, Hachoo>. - Kick Off seems unplayable. - What is YM3014 (M6295 compatible? Rodland uses one). - I think there might be volume control for the M6295, instruments   are ok volume in Rodland, but explosions are too quiet. Or maybe   the M6295 need different volume settings? Changes: 08-02-99: - Fixed bug in Cybattler and 64th Street sub cpu memory map. 24-01-99: - Added Rodland English Version - Changed AddMS1SoundCPU(), so it supports games with no M6295 samples (check   PCMROM==NULL) and also support Cybattler and 64th Street (soundread from diff   address).*/// By luck input port are all at the same place#define coins_r(a) ReadWord(&RAM[0x40000])#define player1_r(a) ReadWord(&RAM[0x14000])//ReadWord68k(&RAM[0x10002])#define player2_r(a) ReadWord(&RAM[0x14002])//ReadWord68k(&RAM[0X10004])#define dsw1_r(a) RAM[0X30000]#define dsw2_r(a) RAM[0X30001]#define dsw_r(a)  ReadWord(&RAM[0x30000])static struct DIR_INFO _64th_street_dirs[] ={   { "64th_street", },   { "64street", },   { NULL, },};static struct ROM_INFO _64th_street_roms[] ={   {  "64th_01.rom", 0x00080000, 0x06222f90, 0, 0, 0, },   {  "64th_02.rom", 0x00040000, 0x0621ed1d, 0, 0, 0, },   {  "64th_03.rom", 0x00040000, 0xed6c6942, 0, 0, 0, },   {  "64th_04.rom", 0x00080000, 0x98f83ef6, 0, 0, 0, },   {  "64th_05.rom", 0x00080000, 0xa89a7020, 0, 0, 0, },   {  "64th_06.rom", 0x00080000, 0x2bfcdc75, 0, 0, 0, },   {  "64th_07.rom", 0x00010000, 0x13595d01, 0, 0, 0, },   {  "64th_08.rom", 0x00010000, 0x632be0c1, 0, 0, 0, },   {  "64th_09.rom", 0x00020000, 0xa4a97db4, 0, 0, 0, },   {  "64th_10.rom", 0x00040000, 0xa3390561, 0, 0, 0, },   {  "64th_11.rom", 0x00020000, 0xb0b8a65c, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};static struct INPUT_INFO megasys_1_inputs[] ={   { KB_DEF_COIN1,        MSG_COIN1,               0x010000, 0x40, BIT_ACTIVE_0 },   { KB_DEF_COIN2,        MSG_COIN2,               0x010000, 0x80, BIT_ACTIVE_0 },   { KB_DEF_SERVICE,      MSG_SERVICE,             0x010000, 0x3C, BIT_ACTIVE_0 },   { KB_DEF_P1_START,     MSG_P1_START,            0x010000, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_UP,        MSG_P1_UP,               0x010002, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P1_DOWN,      MSG_P1_DOWN,             0x010002, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P1_LEFT,      MSG_P1_LEFT,             0x010002, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P1_RIGHT,     MSG_P1_RIGHT,            0x010002, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_B1,        MSG_P1_B1,               0x010002, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P1_B2,        MSG_P1_B2,               0x010002, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P1_B3,        MSG_P1_B3,               0x010002, 0x40, BIT_ACTIVE_0 },   { KB_DEF_P2_START,     MSG_P2_START,            0x010000, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P2_UP,        MSG_P2_UP,               0x010004, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P2_DOWN,      MSG_P2_DOWN,             0x010004, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P2_LEFT,      MSG_P2_LEFT,             0x010004, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P2_RIGHT,     MSG_P2_RIGHT,            0x010004, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P2_B1,        MSG_P2_B1,               0x010004, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P2_B2,        MSG_P2_B2,               0x010004, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P2_B3,        MSG_P2_B3,               0x010004, 0x40, BIT_ACTIVE_0 },   { 0,                   NULL,                    0,        0,    0            },};static struct DSW_DATA dsw_data_64street_1[] ={   { "Flip screen" ,	      0x01, 0x02 },   { MSG_OFF,		      0x01, 0x00 },   { MSG_ON,		      0x00, 0x00 },   { MSG_DEMO_SOUND,          0x02, 0x02 },   { MSG_OFF,                 0x02, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { "Allow continue",        0x04, 0x02 },   { MSG_OFF,                 0x00, 0x00 },   { MSG_ON,                  0x04, 0x00 },   { MSG_DIFFICULTY,          0x18, 0x04 },   { MSG_EASY,                0x10, 0x00 },   { MSG_NORMAL,              0x18, 0x00 },   { MSG_HARD,                0x08, 0x00 },   { MSG_HARDEST,             0x00, 0x00 },   { "Lives",                 0x20, 0x04 },   { "1",                     0x40, 0x00 },   { "2",                     0x60, 0x00 },   { "3",                     0x20, 0x00 },   { "5",                     0x00, 0x00 },   { MSG_SERVICE,             0x80, 0x02 },   { MSG_OFF,                 0x80, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { NULL,                    0,    0,   },};struct DSW_INFO _64th_street_dsw[] ={   { 0x010006, 0xFF, dsw_data_64street_1 },   { 0,        0,    NULL,      },};static struct VIDEO_INFO megasys2_video ={   DrawMegaSystem2,   256,   224,   32,   VIDEO_ROTATE_NORMAL |   VIDEO_ROTATABLE,};static struct VIDEO_INFO megasys2_r90_video ={   DrawMegaSystem2,   256,   224,   32,   VIDEO_ROTATE_90 |   VIDEO_ROTATABLE,};static struct YM2151interface ym2151_interface ={  1,                    // 1 chip  3500000,              // 3.5 MHz  { YM3012_VOL(220,OSD_PAN_LEFT,220,OSD_PAN_RIGHT) },  { NULL },             // sorry, but the adpcm seemed too loud at 96 - Antiriad  { NULL }              // maybe i tried the wrong games? :).};static struct OKIM6295interface m6295_interface ={   2,					// 1 chip   { 30000,     30000 },				// rate   { 0,     0 },		// rom list   { 120, 120 }, // volumes};static struct SOUND_INFO jaleco_ym2151_m6295x2_sound[] ={   { SOUND_YM2151S, &ym2151_interface,  },   { SOUND_M6295,   &m6295_interface,   },   { 0,             NULL,               },};struct GAME_MAIN game_64th_street ={   _64th_street_dirs,   _64th_street_roms,   megasys_1_inputs,   _64th_street_dsw,   NULL,   Load64thStreet,   Clear64thStreet,   &megasys2_video,   ExecuteMegaSystem2Frame,   "64street",   "64th Street",   "俇係髟奨 American",   COMPANY_ID_JALECO,   NULL,   1991,   jaleco_ym2151_m6295x2_sound,   GAME_BEAT,};static struct DIR_INFO _64th_street_japanese_dirs[] ={   { "64th_street_japanese", },   { "64streej", },   { ROMOF("64street"), },   { CLONEOF("64street"), },   { NULL, },};static struct ROM_INFO _64th_street_japanese_roms[] ={   {  "64th_01.rom", 0x00080000, 0x06222f90, 0, 0, 0, },   {  "91105-2.bin", 0x00040000, 0x27c1f436, 0, 0, 0, },   {  "91105-3.bin", 0x00040000, 0xa211a83b, 0, 0, 0, },   {  "64th_04.rom", 0x00080000, 0x98f83ef6, 0, 0, 0, },   {  "64th_05.rom", 0x00080000, 0xa89a7020, 0, 0, 0, },   {  "64th_06.rom", 0x00080000, 0x2bfcdc75, 0, 0, 0, },   {  "64th_07.rom", 0x00010000, 0x13595d01, 0, 0, 0, },   {  "64th_08.rom", 0x00010000, 0x632be0c1, 0, 0, 0, },   {  "64th_09.rom", 0x00020000, 0xa4a97db4, 0, 0, 0, },   {  "64th_10.rom", 0x00040000, 0xa3390561, 0, 0, 0, },   {  "64th_11.rom", 0x00020000, 0xb0b8a65c, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};struct GAME_MAIN game_64th_street_japanese ={   _64th_street_japanese_dirs,   _64th_street_japanese_roms,   megasys_1_inputs,   _64th_street_dsw,   NULL,   Load64thStreetJ,   Clear64thStreetJ,   &megasys2_video,   ExecuteMegaSystem2Frame,   "64streej",   "64th Street Japanese",   "俇係髟奨",   COMPANY_ID_JALECO,   NULL,   1991,   jaleco_ym2151_m6295x2_sound,   GAME_BEAT,};static struct DIR_INFO astyanax_dirs[] ={   { "astyanax", },   { NULL, },};static struct ROM_INFO astyanax_roms[] ={   {  "astyan1.bin", 0x00020000, 0x1a1ad3cf, 0, 0, 0, },   {  "astyan2.bin", 0x00020000, 0x1b598dcc, 0, 0, 0, },   {  "astyan3.bin", 0x00010000, 0x097b53a6, 0, 0, 0, },   {  "astyan4.bin", 0x00010000, 0x1e1cbdb2, 0, 0, 0, },   {  "astyan5.bin", 0x00010000, 0x11c74045, 0, 0, 0, },   {  "astyan6.bin", 0x00010000, 0xeecd4b16, 0, 0, 0, },   {  "astyan7.bin", 0x00020000, 0x319418cc, 0, 0, 0, },   {  "astyan8.bin", 0x00020000, 0x5e5d2a22, 0, 0, 0, },   {  "astyan9.bin", 0x00020000, 0xa10b3f17, 0, 0, 0, },   { "astyan10.bin", 0x00020000, 0x4f704e7a, 0, 0, 0, },   { "astyan11.bin", 0x00020000, 0x5593fec9, 0, 0, 0, },   { "astyan12.bin", 0x00020000, 0xe8b313ec, 0, 0, 0, },   { "astyan13.bin", 0x00020000, 0x5f3496c6, 0, 0, 0, },   { "astyan14.bin", 0x00020000, 0x29a09ec2, 0, 0, 0, },   { "astyan15.bin", 0x00020000, 0x0d316615, 0, 0, 0, },   { "astyan16.bin", 0x00020000, 0xba96e8d9, 0, 0, 0, },   { "astyan17.bin", 0x00020000, 0xbe60ba06, 0, 0, 0, },   { "astyan18.bin", 0x00020000, 0x3668da3d, 0, 0, 0, },   { "astyan19.bin", 0x00020000, 0x98158623, 0, 0, 0, },   { "astyan20.bin", 0x00020000, 0xc1ad9aa0, 0, 0, 0, },   { "astyan21.bin", 0x00020000, 0x0bf498ee, 0, 0, 0, },   { "astyan22.bin", 0x00020000, 0x5f04d9b1, 0, 0, 0, },   { "astyan23.bin", 0x00020000, 0x7bd4d1e7, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};static struct DSW_DATA dsw_data_astyanax_0[] ={   { MSG_COIN1,               0x07, 0x08 },   { MSG_1COIN_1PLAY,         0x07, 0x00 },   { MSG_1COIN_2PLAY,         0x06, 0x00 },   { MSG_1COIN_3PLAY,         0x05, 0x00 },   { MSG_1COIN_4PLAY,         0x04, 0x00 },   { MSG_1COIN_5PLAY,         0x03, 0x00 },   { MSG_2COIN_1PLAY,         0x02, 0x00 },   { MSG_3COIN_1PLAY,         0x01, 0x00 },   { MSG_4COIN_1PLAY,         0x00, 0x00 },   { MSG_COIN2,               0x38, 0x08 },   { MSG_1COIN_1PLAY,         0x38, 0x00 },   { MSG_1COIN_2PLAY,         0x30, 0x00 },   { MSG_1COIN_3PLAY,         0x28, 0x00 },   { MSG_1COIN_4PLAY,         0x20, 0x00 },   { MSG_1COIN_5PLAY,         0x18, 0x00 },   { MSG_2COIN_1PLAY,         0x10, 0x00 },   { MSG_3COIN_1PLAY,         0x08, 0x00 },   { MSG_4COIN_1PLAY,         0x00, 0x00 },   { MSG_DEMO_SOUND,          0x40, 0x02 },   { MSG_OFF,                 0x40, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { MSG_TEST_MODE,           0x80, 0x02 },   { MSG_OFF,                 0x80, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_DATA dsw_data_astyanax_1[] ={   { "Extra Life",            0x04, 0x02 },   { "30k 70k..",             0x04, 0x00 },   { "50k 100k..",            0x00, 0x00 },   { "Lives",                 0x18, 0x04 },   { "3",                     0x18, 0x00 },   { "2",                     0x10, 0x00 },   { "4",                     0x08, 0x00 },   { "5",                     0x00, 0x00 },   { "Skill",                 0x20, 0x02 },   { MSG_NORMAL,              0x20, 0x00 },   { MSG_HARD,                0x00, 0x00 },   { "Control Flip",          0x40, 0x02 },   { MSG_OFF,                 0x40, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { MSG_SCREEN,              0x80, 0x02 },   { MSG_NORMAL,              0x80, 0x00 },   { MSG_INVERT,              0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_INFO astyanax_dsw[] ={   { 0x010007, 0xFF, dsw_data_astyanax_0 },   { 0x010006, 0xFF, dsw_data_astyanax_1 },   { 0,        0,    NULL,      },};static struct VIDEO_INFO megasys1_video ={   DrawMegaSystem1,   256,   224,   32,   VIDEO_ROTATE_NORMAL |   VIDEO_ROTATABLE,};static struct VIDEO_INFO megasys1_r270_video ={   DrawMegaSystem1,   256,   224,   32,   VIDEO_ROTATE_270 |   VIDEO_ROTATABLE,};struct GAME_MAIN game_astyanax ={   astyanax_dirs,   astyanax_roms,   megasys_1_inputs,   astyanax_dsw,   NULL,   load_astyanax,   ClearAstyanax,   &megasys1_video,   ExecuteMegaSystem1Frame,   "astyanax",   "Astyanax",   "僓丒儘乕僪丒僆僽丒僉儞僌 American",   COMPANY_ID_JALECO,   NULL,   1989,   jaleco_ym2151_m6295x2_sound,   GAME_BEAT,};static struct DIR_INFO the_lord_of_king_dirs[] ={   { "the_lord_of_king", },   { "lord_of_king", },   { "lordofk", },   { ROMOF("astyanax"), },   { CLONEOF("astyanax"), },   { NULL, },};static struct ROM_INFO the_lord_of_king_roms[] ={   {   "lokj01.bin", 0x00020000, 0xbed3cb93, 0, 0, 0, },   {   "lokj02.bin", 0x00020000, 0x0d7f9b4a, 0, 0, 0, },   {   "lokj03.bin", 0x00020000, 0xd8702c91, 0, 0, 0, },   {   "lokj04.bin", 0x00020000, 0xeccbf8c9, 0, 0, 0, },   {  "astyan5.bin", 0x00010000, 0x11c74045, 0, 0, 0, },

⌨️ 快捷键说明

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