📄 metalb.c
字号:
/******************************************************************************//* *//* METAL BLACK (C) 1991 TAITO CORPORATION (PROJECT: GUN FRONTIER 2) *//* *//******************************************************************************/#include "gameinc.h"#include "metalb.h"#include "f3system.h"#include "tc006vcu.h"#include "tc200obj.h"#include "tc220ioc.h"#include "taitosnd.h"#include "debug.h"#include "sasound.h" // sample support routinesstatic struct DIR_INFO metal_black_dirs[] ={ { "metal_black", }, { "metalb", }, { NULL, },};static struct ROM_INFO metal_black_roms[] ={ { "d12-01.rom", 0x00100000, 0xb81523b9, 0, 0, 0, }, { "d12-02.rom", 0x00100000, 0x79263e74, 0, 0, 0, }, { "d12-03.rom", 0x00080000, 0x46b498c0, 0, 0, 0, }, { "d12-04.rom", 0x00080000, 0xab66d141, 0, 0, 0, }, { "d12-05.rom", 0x00080000, 0x7fd036c5, 0, 0, 0, }, { "d12-06.rom", 0x00020000, 0x131df731, 0, 0, 0, }, { "d12-07.rom", 0x00020000, 0xe07f5136, 0, 0, 0, }, { "d16-18.rom", 0x00040000, 0x5216d092, 0, 0, 0, }, { "d16-16.rom", 0x00040000, 0x3150be61, 0, 0, 0, }, { "d12-13.rom", 0x00020000, 0xbcca2649, 0, 0, 0, }, { NULL, 0, 0, 0, 0, 0, },};static struct INPUT_INFO metal_black_inputs[] ={ { KB_DEF_COIN1, MSG_COIN1, 0x00000E, 0x04, BIT_ACTIVE_0 }, { KB_DEF_COIN2, MSG_COIN2, 0x00000E, 0x08, BIT_ACTIVE_0 }, { KB_DEF_TILT, MSG_TILT, 0x00000E, 0x01, BIT_ACTIVE_0 }, { KB_DEF_SERVICE, MSG_SERVICE, 0x00000E, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P1_START, MSG_P1_START, 0x000004, 0x80, BIT_ACTIVE_0 }, { KB_DEF_P1_UP, MSG_P1_UP, 0x000004, 0x01, BIT_ACTIVE_0 }, { KB_DEF_P1_DOWN, MSG_P1_DOWN, 0x000004, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P1_LEFT, MSG_P1_LEFT, 0x000004, 0x04, BIT_ACTIVE_0 }, { KB_DEF_P1_RIGHT, MSG_P1_RIGHT, 0x000004, 0x08, BIT_ACTIVE_0 }, { KB_DEF_P1_B1, MSG_P1_B1, 0x000004, 0x10, BIT_ACTIVE_0 }, { KB_DEF_P1_B2, MSG_P1_B2, 0x000004, 0x20, BIT_ACTIVE_0 }, { KB_DEF_P1_B3, MSG_P1_B3, 0x000004, 0x40, BIT_ACTIVE_0 }, { KB_DEF_P2_START, MSG_P2_START, 0x000006, 0x80, BIT_ACTIVE_0 }, { KB_DEF_P2_UP, MSG_P2_UP, 0x000006, 0x01, BIT_ACTIVE_0 }, { KB_DEF_P2_DOWN, MSG_P2_DOWN, 0x000006, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P2_LEFT, MSG_P2_LEFT, 0x000006, 0x04, BIT_ACTIVE_0 }, { KB_DEF_P2_RIGHT, MSG_P2_RIGHT, 0x000006, 0x08, BIT_ACTIVE_0 }, { KB_DEF_P2_B1, MSG_P2_B1, 0x000006, 0x10, BIT_ACTIVE_0 }, { KB_DEF_P2_B2, MSG_P2_B2, 0x000006, 0x20, BIT_ACTIVE_0 }, { KB_DEF_P2_B3, MSG_P2_B3, 0x000006, 0x40, BIT_ACTIVE_0 }, { 0, NULL, 0, 0, 0 },};static struct DSW_DATA dsw_data_metal_black_0[] ={ { MSG_DSWA_BIT1, 0x01, 0x02 }, { MSG_OFF, 0x01, 0x00 }, { MSG_ON, 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_metal_black_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_ON, 0x08, 0x00 }, { MSG_OFF, 0x00, 0x00 }, { "Lives", 0x30, 0x04 }, { "3", 0x30, 0x00 }, { "5", 0x20, 0x00 }, { "2", 0x10, 0x00 }, { "1", 0x00, 0x00 }, { "Continue Mode", 0x40, 0x02 }, { MSG_OFF, 0x40, 0x00 }, { MSG_ON, 0x00, 0x00 }, { "Simultaneous Play", 0x80, 0x02 }, { MSG_OFF, 0x80, 0x00 }, { MSG_ON, 0x00, 0x00 }, { NULL, 0, 0, },};static struct DSW_INFO metal_black_dsw[] ={ { 0x000000, 0xFF, dsw_data_metal_black_0 }, { 0x000002, 0xFF, dsw_data_metal_black_1 }, { 0, 0, NULL, },};static struct ROMSW_DATA romsw_data_metal_black_0[] ={ { "Taito Japan", 0x01 }, { "Taito America", 0x02 }, { "Taito", 0x03 }, { NULL, 0 },};static struct ROMSW_INFO metal_black_romsw[] ={ { 0x07FFFF, 0x03, romsw_data_metal_black_0 }, { 0, 0, NULL },};static struct VIDEO_INFO metal_black_video ={ DrawMetalBlack, 320, 224, 48, VIDEO_ROTATE_NORMAL | VIDEO_ROTATABLE,};struct GAME_MAIN game_metal_black ={ metal_black_dirs, metal_black_roms, metal_black_inputs, metal_black_dsw, metal_black_romsw, LoadMetalBlack, ClearMetalBlack, &metal_black_video, ExecuteMetalBlackFrame, "metalb", "Metal Black", NULL, COMPANY_ID_TAITO, "D16", 1991, taito_ym2610_sound, GAME_SHOOT,};static struct DIR_INFO metal_black_japanese_dirs[] ={ { "metal_black_japanese", }, { "metalbj", }, { ROMOF("metalb"), }, { CLONEOF("metalb"), }, { NULL, },};static struct ROM_INFO metal_black_japanese_roms[] ={ { "d12-01.rom", 0x00100000, 0xb81523b9, 0, 0, 0, }, { "d12-02.rom", 0x00100000, 0x79263e74, 0, 0, 0, }, { "d12-03.rom", 0x00080000, 0x46b498c0, 0, 0, 0, }, { "d12-04.rom", 0x00080000, 0xab66d141, 0, 0, 0, }, { "d12-05.rom", 0x00080000, 0x7fd036c5, 0, 0, 0, }, { "d12-06.rom", 0x00020000, 0x131df731, 0, 0, 0, }, { "d12-07.rom", 0x00020000, 0xe07f5136, 0, 0, 0, }, { "d12-11.rom", 0x00040000, 0xaf9ee28d, 0, 0, 0, }, { "d12-12.rom", 0x00040000, 0x556f82b2, 0, 0, 0, }, { "d12-13.rom", 0x00020000, 0xbcca2649, 0, 0, 0, }, { NULL, 0, 0, 0, 0, 0, },};static struct ROMSW_INFO metal_black_japanese_romsw[] ={ { 0x07FFFF, 0x01, romsw_data_metal_black_0 }, { 0, 0, NULL },};struct GAME_MAIN game_metal_black_japanese ={ metal_black_japanese_dirs, metal_black_japanese_roms, metal_black_inputs, metal_black_dsw, metal_black_japanese_romsw, LoadMetalBlack, ClearMetalBlack, &metal_black_video, ExecuteMetalBlackFrame, "metalbj", "Metal Black Japanese", NULL, COMPANY_ID_TAITO, "D12", 1991, taito_ym2610_sound, GAME_SHOOT,};static UINT8 *RAM_BG0;static UINT8 *RAM_BG1;static UINT8 *RAM_BG2;static UINT8 *RAM_BG3;//static UINT8 *RAM_BG4;static UINT8 *RAM_SCR0;static UINT8 *RAM_SCR1;static UINT8 *RAM_SCR2;static UINT8 *RAM_SCR3;static UINT8 *RAM_SCR4;static UINT32 SCR0_XOFS;static UINT32 SCR1_XOFS;static UINT32 SCR2_XOFS;static UINT32 SCR3_XOFS;static UINT32 SCR4_XOFS;static UINT32 SCR0_YOFS;static UINT32 SCR1_YOFS;static UINT32 SCR2_YOFS;static UINT32 SCR3_YOFS;static UINT32 SCR4_YOFS;static UINT8 *GFX_BG0;static UINT8 *GFX_BG0_SOLID;static UINT8 *GFX_SPR;static UINT8 *GFX_SPR_SOLID;static UINT8 *RAM_OBJECT;static UINT8 *RAM_INPUT;static void BadWriteWord(UINT32 address, UINT16 data){#ifdef RAINE_DEBUG if(address!=0x600000) print_debug("Ww(%06x,%04x) [%06x]\n",address,data,s68000context.pc);#endif}void LoadMetalBlack(void){ int ta,tb; if(!(GFX=AllocateMem(0x400000))) return; if(!(RAM=AllocateMem(0x100000))) return; GFX_BG0 = GFX+0x000000; GFX_SPR = GFX+0x200000; tb=0; if(!load_rom_index(0, RAM, 0x100000)) return; // 16x16 SPRITES ($2000) for(ta=0;ta<0x100000;ta++,tb+=2){ GFX_SPR[tb+0]=RAM[ta]&15; GFX_SPR[tb+1]=RAM[ta]>>4; } tb=0; if(!load_rom_index(2, RAM, 0x80000)) return; // 16x16 TILES ($2000) for(ta=0;ta<0x80000;ta+=2,tb+=8){ GFX_BG0[tb+0]=RAM[ta]&15; GFX_BG0[tb+1]=RAM[ta]>>4; GFX_BG0[tb+2]=RAM[ta+1]&15; GFX_BG0[tb+3]=RAM[ta+1]>>4; } tb=4; if(!load_rom_index(3, RAM, 0x80000)) return; // 16x16 TILES for(ta=0;ta<0x80000;ta+=2,tb+=8){ GFX_BG0[tb+0]=RAM[ta]&15; GFX_BG0[tb+1]=RAM[ta]>>4; GFX_BG0[tb+2]=RAM[ta+1]&15;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -