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

📄 upl.c

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 C
📖 第 1 页 / 共 5 页
字号:
};struct GAME_MAIN game_ninja_kid_2 ={   ninja_kid_2_dirs,   ninja_kid_2_roms,   ninja_kid_2_inputs,   ninja_kid_2_dsw,   NULL,   LoadNinjaKid2,   ClearNinjaKid2,   &upl_video,   ExecuteUPLFrame,   "ninjakd2",   "Ninja Kid 2",   NULL,   COMPANY_ID_UPL,   NULL,   1987,   upl_sound,   GAME_PLATFORM,};/*************************   OMEGA FIGHTER SPECIAL *************************/static struct DIR_INFO omega_fighter_dirs[] ={   { "omega_fighter_special", },   { "omegafs", },   { "omgfigts", },   { ROMOF("omegaf"), },   { CLONEOF("omegaf"), },   { NULL, },};static struct ROM_INFO omega_fighter_roms[] ={   {   "1back2.15b", 0x00080000, 0x6210ddcc, 0, 0, 0, },   {   "2back1.27b", 0x00080000, 0x21f8a32e, 0, 0, 0, },   {    "3back3.5f", 0x00080000, 0xc31cae56, 0, 0, 0, },   {        "4.18h", 0x00008000, 0x9e2d8152, 0, 0, 0, },   {         "5.3l", 0x00020000, 0x503a3e63, 0, 0, 0, },   {         "6.4l", 0x00020000, 0x6277735c, 0, 0, 0, },   {         "7.7m", 0x00010000, 0xd40fc8d5, 0, 0, 0, },   {        "8.23m", 0x00020000, 0x0bd2a5d1, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};static struct INPUT_INFO omega_fighter_inputs[] ={   { KB_DEF_COIN1,        MSG_COIN1,               0x00C000, 0x40, BIT_ACTIVE_0 },   { KB_DEF_COIN2,        MSG_COIN2,               0x00C000, 0x80, BIT_ACTIVE_0 },   { KB_DEF_SERVICE,      MSG_SERVICE,             0x00C000, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P1_START,     MSG_P1_START,            0x00C000, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_UP,        MSG_P1_UP,               0x00C001, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P1_DOWN,      MSG_P1_DOWN,             0x00C001, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P1_LEFT,      MSG_P1_LEFT,             0x00C001, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P1_RIGHT,     MSG_P1_RIGHT,            0x00C001, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P1_B1,        MSG_P1_B1,               0x00C001, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P1_B2,        MSG_P1_B2,               0x00C001, 0x20, BIT_ACTIVE_0 },   { KB_DEF_P2_START,     MSG_P2_START,            0x00C000, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P2_UP,        MSG_P2_UP,               0x00C002, 0x08, BIT_ACTIVE_0 },   { KB_DEF_P2_DOWN,      MSG_P2_DOWN,             0x00C002, 0x04, BIT_ACTIVE_0 },   { KB_DEF_P2_LEFT,      MSG_P2_LEFT,             0x00C002, 0x02, BIT_ACTIVE_0 },   { KB_DEF_P2_RIGHT,     MSG_P2_RIGHT,            0x00C002, 0x01, BIT_ACTIVE_0 },   { KB_DEF_P2_B1,        MSG_P2_B1,               0x00C002, 0x10, BIT_ACTIVE_0 },   { KB_DEF_P2_B2,        MSG_P2_B2,               0x00C002, 0x20, BIT_ACTIVE_0 },   { 0,                   NULL,                    0,        0,    0            },};static struct DSW_DATA dsw_data_omega_fighter_0[] ={   { MSG_SCREEN,              0x01, 0x02 },   { MSG_NORMAL,              0x01, 0x00 },   { MSG_INVERT,              0x00, 0x00 },   { MSG_DIFFICULTY,          0x06, 0x04 },   { MSG_NORMAL,              0x06, 0x00 },   { MSG_HARDEST,             0x04, 0x00 },   { MSG_HARD,                0x02, 0x00 },   { MSG_EASY,                0x00, 0x00 },   { MSG_TEST_MODE,           0x08, 0x02 },   { MSG_OFF,                 0x08, 0x00 },   { MSG_ON,                  0x00, 0x00 },   { MSG_CABINET,             0x10, 0x02 },   { MSG_TABLE,               0x10, 0x00 },   { MSG_UPRIGHT,             0x00, 0x00 },   { MSG_DEMO_SOUND,          0x20, 0x02 },   { MSG_ON,                  0x20, 0x00 },   { MSG_OFF,                 0x00, 0x00 },   { MSG_LIVES,               0xC0, 0x04 },   { "3",                     0xC0, 0x00 },   { "5",                     0x80, 0x00 },   { "4",                     0x40, 0x00 },   { "2",                     0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_DATA dsw_data_omega_fighter_1[] ={   { MSG_EXTRA_LIFE,          0x03, 0x04 },   { "30k",                   0x03, 0x00 },   { "100k",                  0x02, 0x00 },   { "50k",                   0x01, 0x00 },   { "20k",                   0x00, 0x00 },   { MSG_COIN1,               0xE0, 0x08 },   { MSG_1COIN_1PLAY,         0xE0, 0x00 },   { MSG_2COIN_1PLAY,         0xC0, 0x00 },   { MSG_1COIN_3PLAY,         0xA0, 0x00 },   { MSG_4COIN_1PLAY,         0x80, 0x00 },   { MSG_1COIN_2PLAY,         0x60, 0x00 },   { MSG_3COIN_1PLAY,         0x40, 0x00 },   { MSG_1COIN_4PLAY,         0x20, 0x00 },   { MSG_5COIN_1PLAY,         0x00, 0x00 },   { MSG_COIN2,               0x1C, 0x08 },   { MSG_1COIN_1PLAY,         0x1C, 0x00 },   { MSG_1COIN_2PLAY,         0x0C, 0x00 },   { MSG_2COIN_1PLAY,         0x18, 0x00 },   { MSG_1COIN_3PLAY,         0x14, 0x00 },   { MSG_4COIN_1PLAY,         0x10, 0x00 },   { MSG_3COIN_1PLAY,         0x08, 0x00 },   { MSG_1COIN_4PLAY,         0x04, 0x00 },   { MSG_5COIN_1PLAY,         0x00, 0x00 },   { NULL,                    0,    0,   },};static struct DSW_INFO omega_fighter_dsw[] ={   { 0x00C003, 0xF9, dsw_data_omega_fighter_0 },   { 0x00C004, 0xFC, dsw_data_omega_fighter_1 },   { 0,        0,    NULL,      },};struct GAME_MAIN game_omega_fighter ={   omega_fighter_dirs,   omega_fighter_roms,   omega_fighter_inputs,   omega_fighter_dsw,   NULL,   LoadOmegaFighter,   ClearOmegaFighter,   &upl_r270_video,   ExecuteUPLFrame,   "omegafs",   "Omega Fighter Special",   "僆儊僈僼傽僀僞乕 Special",   COMPANY_ID_UPL,   "UPL-89016",   1989,   upl_sound,   GAME_SHOOT,};/*****************   OMEGA FIGHTER *****************/static struct DIR_INFO omega_fighter_japanese_dirs[] ={   { "omega_fighter", },   { "omegaf", },   { "omgfight", },   { NULL, },};static struct ROM_INFO omega_fighter_japanese_roms[] ={   {   "1back2.15b", 0x00080000, 0x6210ddcc, 0, 0, 0, },   {   "2back1.27b", 0x00080000, 0x21f8a32e, 0, 0, 0, },   {    "3back3.5f", 0x00080000, 0xc31cae56, 0, 0, 0, },   {        "4.18h", 0x00008000, 0x9e2d8152, 0, 0, 0, },   {          "1.5", 0x00020000, 0x57a7fd96, 0, 0, 0, },   {         "6.4l", 0x00020000, 0x6277735c, 0, 0, 0, },   {         "7.7m", 0x00010000, 0xd40fc8d5, 0, 0, 0, },   {        "8.23m", 0x00020000, 0x0bd2a5d1, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};struct GAME_MAIN game_omega_fighter_japanese ={   omega_fighter_japanese_dirs,   omega_fighter_japanese_roms,   omega_fighter_inputs,   omega_fighter_dsw,   NULL,   LoadOmegaFighter,   ClearOmegaFighter,   &upl_r270_video,   ExecuteUPLFrame,   "omegaf",   "Omega Fighter",   "僆儊僈僼傽僀僞乕",   COMPANY_ID_UPL,   "UPL-89016",   1989,   upl_sound,   GAME_SHOOT,};/**************   RAD ACTION **************/static struct DIR_INFO rad_action_dirs[] ={   { "rad_action", },   { "radactn", },   { "rdaction", },   { ROMOF("ninjakd2"), },   { CLONEOF("ninjakd2"), },   { NULL, },};static struct ROM_INFO rad_action_roms[] ={   {         "1.3u", 0x00008000, 0x5c475611, 0, 0, 0, },   {   "nk2_10.rom", 0x00010000, 0xc913c4ab, 0, 0, 0, },   {   "nk2_11.rom", 0x00010000, 0x41a714b3, 0, 0, 0, },   {        "12.5n", 0x00008000, 0x0936b365, 0, 0, 0, },   {         "2.3s", 0x00008000, 0xa1e23bd2, 0, 0, 0, },   {   "nk2_03.rom", 0x00008000, 0xad275654, 0, 0, 0, },   {   "nk2_04.rom", 0x00008000, 0xe7692a77, 0, 0, 0, },   {         "5.3m", 0x00008000, 0x960725fb, 0, 0, 0, },   {   "nk2_06.bin", 0x00010000, 0x7bfe6c9e, 0, 0, 0, },   {   "nk2_07.rom", 0x00010000, 0x0be5cd13, 0, 0, 0, },   {   "nk2_08.rom", 0x00010000, 0x1b79c50a, 0, 0, 0, },   {   "nk2_09.rom", 0x00010000, 0xc1d2d170, 0, 0, 0, },   {           NULL,          0,          0, 0, 0, 0, },};struct GAME_MAIN game_rad_action ={   rad_action_dirs,   rad_action_roms,   ninja_kid_2_inputs,   ninja_kid_2_dsw,   NULL,   LoadRadAction,   ClearRadAction,   &upl_video,   ExecuteUPLFrame,   "rdaction",   "Rad Action",   NULL,   COMPANY_ID_UPL,   NULL,   1987,   upl_sound,   GAME_PLATFORM,};static int romset;static UINT8 *RAM2;static UINT8 *ROM2;static UINT8 *RAM_VIDEO;static UINT8 *RAM_FG0;static UINT8 mask_fg0;static UINT8 *RAM_SPR;static UINT8 mask_spr;static UINT8 *GFX_FG0;static UINT8 *FG0_Mask;static UINT8 *GFX_SPR;static UINT8 *SPR_Mask;static UINT8 *GFX_BG1;static UINT8 *BG1_Mask;static UINT8 *GFX_BG0;static UINT8 *BG0_Mask;static UINT8 *GFX_BG2;static UINT8 *BG2_Mask;#define BG_FLIP_NONE	0x00#define BG_FLIP_Y	0x01#define BG_FLIP_X	0x02#define BG_FLIP_XY	0x03typedef struct UPL_BG_LAYER			// Information about 1 layer{   UINT8 *RAM;					// Layer RAM address   UINT8 *SCR;					// Layer SCROLL RAM address   UINT8 *GFX;					// Layer GFX address   UINT8 *MASK;					// Layer GFX SOLID MASK address   UINT32 type;					// Type of layer   UINT8 col_bank;				// Colour Bank Offset} UPL_BG_LAYER;struct UPL_BG_LAYER bg_layers[3];/*UPL Z80 GAMES-------------Supported romsets:0 - Ninja Kid 21 - Rad Action2 - Mutant Night3 - Omega Fighter4 - Ark Area? - XX MissionMutant Night:0000-7FFF BASE ROM8000-BFFF BANK ROMC000-D9FF RAMDA00-DFFF OBJECTE000-E7FF BG0E800-EFFF FG0F000-F7FF COLOURF800-F805 INPUTFA02-FA02 BANK SWITCHOmega Fighter:0000-7FFF BASE ROM8000-BFFF BANK ROMC002-C002 BANK SWITCHD000-D7FF FG0D800-DFFF COLOURE000-F9FF RAMFA00-FFFF OBJECT*//******************************************************************************//* ROBO KID Z80 ROM BANKING                                                   *//******************************************************************************/static UINT8 Z80Bank;static UINT8 Z80BankCount;static UINT8 *ROM_BANK[0x10];void UPLBankWrite(UINT16 offset, UINT8 data){   if(data != Z80Bank){   if(data < Z80BankCount){      Z80Bank = data;      Z80BSetBank( ROM_BANK[Z80Bank] );   }   else{      #ifdef RAINE_DEBUG      print_debug("MAIN Bank: %02x [%04x]\n", data, z80pc);      #endif   }   }}static void init_bank_rom(UINT8 *src, UINT8 *dst, UINT8 bank_skip){   int ta;   for(ta=0;ta<0x10;ta++){      ROM_BANK[ta]=NULL;   }   for(ta=0;ta<Z80BankCount;ta++){      ROM_BANK[ta] = dst+(ta*0xC000);      memcpy(ROM_BANK[ta]+0x0000,src+0x0000,0x8000);      memcpy(ROM_BANK[ta]+0x8000,src+((ta+bank_skip)*0x4000),0x4000);   }}/******************************************************************************//* ROBO KID VIDEO RAM BANKING                                                 *//******************************************************************************/static UINT8 *BG_BANK[4];static void OmegaBG0BankWrite(UINT16 offset, UINT8 data){   BG_BANK[1] = RAM_VIDEO+(1*0x2000)+((data&7)<<10);}static void OmegaBG1BankWrite(UINT16 offset, UINT8 data){   BG_BANK[2] = RAM_VIDEO+(2*0x2000)+((data&7)<<10);}static void OmegaBG2BankWrite(UINT16 offset, UINT8 data){   BG_BANK[3] = RAM_VIDEO+(3*0x2000)+((data&7)<<10);}static void OmegaBG012Write(UINT16 offset, UINT8 data){   BG_BANK[(offset>>10)&3][offset&0x3FF] = data;}static UINT8 OmegaBG012Read(UINT16 offset){   return BG_BANK[(offset>>10)&3][offset&0x3FF];}static void OmegaBG012Init(void){   BG_BANK[0] = RAM_VIDEO+(0*0x2000);   BG_BANK[1] = RAM_VIDEO+(1*0x2000);   BG_BANK[2] = RAM_VIDEO+(2*0x2000);   BG_BANK[3] = RAM_VIDEO+(3*0x2000);}/******************************************************************************//* ROBO KID SOUND COMMUNICATION                                               *//******************************************************************************/

⌨️ 快捷键说明

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