📄 opwolf3.c
字号:
/******************************************************************************//* *//* OPERATION WOLF 3 (C) 1994 TAITO CORPORATION *//* *//******************************************************************************/#include "gameinc.h"#include "opwolf3.h"#include "taitosnd.h"#include "f3system.h"#include "tc006vcu.h"#include "tc200obj.h"#ifdef RAINE_DEBUG#include "debug.h"#endif#include "sasound.h" // sample support routinesstatic struct DIR_INFO operation_wolf_3_dirs[] ={ { "operation_wolf_3", }, { "opwolf3", }, { NULL, },};static struct ROM_INFO operation_wolf_3_roms[] ={ { "opw3_01.rom", 0x00200000, 0x115313e0, 0, 0, 0, }, { "opw3_02.rom", 0x00200000, 0xaab86332, 0, 0, 0, }, { "opw3_03.rom", 0x00200000, 0x3f398916, 0, 0, 0, }, { "opw3_04.rom", 0x00200000, 0x2f385638, 0, 0, 0, }, { "opw3_05.rom", 0x00200000, 0x85ea64cc, 0, 0, 0, }, { "opw3_06.rom", 0x00200000, 0x2fa1e08d, 0, 0, 0, }, { "opw3_16.rom", 0x00080000, 0x198ff1f6, 0, 0, 0, }, { "opw3_17.rom", 0x00080000, 0xac35a672, 0, 0, 0, }, { "opw3_18.rom", 0x00080000, 0xbd5d7cdb, 0, 0, 0, }, { "opw3_21.rom", 0x00080000, 0xc61c558b, 0, 0, 0, }, { "opw3_22.rom", 0x00010000, 0x118374a6, 0, 0, 0, }, { NULL, 0, 0, 0, 0, 0, },};static struct INPUT_INFO operation_wolf_3_inputs[] ={ { KB_DEF_COIN1, MSG_COIN1, 0x069006, 0xFF, BIT_ACTIVE_0 }, { KB_DEF_COIN2, MSG_COIN2, 0x069007, 0xFF, BIT_ACTIVE_0 }, { KB_DEF_TILT, MSG_TILT, 0x069003, 0x01, BIT_ACTIVE_0 }, { KB_DEF_SERVICE, MSG_SERVICE, 0x069003, 0x0E, BIT_ACTIVE_0 }, { KB_DEF_TEST, MSG_TEST, 0x069008, 0xFF, BIT_ACTIVE_0 }, { KB_DEF_P1_START, MSG_P1_START, 0x069005, 0x08, BIT_ACTIVE_0 }, { KB_DEF_P1_UP, MSG_P1_UP, 0x069027, 0x01, BIT_ACTIVE_1 }, { KB_DEF_P1_DOWN, MSG_P1_DOWN, 0x069027, 0x02, BIT_ACTIVE_1 }, { KB_DEF_P1_LEFT, MSG_P1_LEFT, 0x069027, 0x04, BIT_ACTIVE_1 }, { KB_DEF_P1_RIGHT, MSG_P1_RIGHT, 0x069027, 0x08, BIT_ACTIVE_1 }, { KB_DEF_P1_B1, MSG_P1_B1, 0x069005, 0x01, BIT_ACTIVE_0 }, { KB_DEF_P1_B2, MSG_P1_B2, 0x069005, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P1_B3, MSG_P1_B3, 0x069005, 0x04, BIT_ACTIVE_0 }, { KB_DEF_P2_START, MSG_P2_START, 0x069005, 0x80, BIT_ACTIVE_0 }, { KB_DEF_P2_UP, MSG_P2_UP, 0x069025, 0x01, BIT_ACTIVE_1 }, { KB_DEF_P2_DOWN, MSG_P2_DOWN, 0x069025, 0x02, BIT_ACTIVE_1 }, { KB_DEF_P2_LEFT, MSG_P2_LEFT, 0x069025, 0x04, BIT_ACTIVE_1 }, { KB_DEF_P2_RIGHT, MSG_P2_RIGHT, 0x069025, 0x08, BIT_ACTIVE_1 }, { KB_DEF_P2_B1, MSG_P2_B1, 0x069005, 0x10, BIT_ACTIVE_0 }, { KB_DEF_P2_B2, MSG_P2_B2, 0x069005, 0x20, BIT_ACTIVE_0 }, { KB_DEF_P2_B3, MSG_P2_B3, 0x069005, 0x40, BIT_ACTIVE_0 }, { 0, NULL, 0, 0, 0 },};static struct DSW_DATA dsw_data_operation_wolf_3_0[] ={ { MSG_DSWA_BIT1, 0x01, 0x02 }, { MSG_OFF, 0x01, 0x00 }, { MSG_ON, 0x00, 0x00 }, { MSG_DSWA_BIT2, 0x02, 0x02 }, { MSG_OFF, 0x02, 0x00 }, { MSG_ON, 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_DSWA_BIT5, 0x10, 0x02 }, { MSG_OFF, 0x10, 0x00 }, { MSG_ON, 0x00, 0x00 }, { MSG_DSWA_BIT6, 0x20, 0x02 }, { MSG_OFF, 0x20, 0x00 }, { MSG_ON, 0x00, 0x00 }, { MSG_DSWA_BIT7, 0x40, 0x02 }, { MSG_OFF, 0x40, 0x00 }, { MSG_ON, 0x00, 0x00 }, { MSG_DSWA_BIT8, 0x80, 0x02 }, { MSG_OFF, 0x80, 0x00 }, { MSG_ON, 0x00, 0x00 }, { NULL, 0, 0, },};static struct DSW_INFO operation_wolf_3_dsw[] ={ { 0x069000, 0xFF, dsw_data_operation_wolf_3_0 }, { 0x069001, 0xFF, dsw_data_default_1 }, { 0, 0, NULL, },};static struct ROMSW_DATA romsw_data_operation_wolf_3_0[] ={ { "Taito World?", 0x00 }, { "Taito America", 0x01 }, { "Taito Japan", 0x02 }, { NULL, 0 },};static struct ROMSW_INFO operation_wolf_3_romsw[] ={ { 0x000063, 0x02, romsw_data_operation_wolf_3_0 }, { 0, 0, NULL },};static struct VIDEO_INFO operation_wolf_3_video ={ DrawOperationWolf3, 320, 224, 48, VIDEO_ROTATE_NORMAL | VIDEO_ROTATABLE,};struct GAME_MAIN game_operation_wolf_3 ={ operation_wolf_3_dirs, operation_wolf_3_roms, operation_wolf_3_inputs, operation_wolf_3_dsw, operation_wolf_3_romsw, LoadOperationWolf3, ClearOperationWolf3, &operation_wolf_3_video, ExecuteOperationWolf3Frame, "opwolf3", "Operation Wolf 3", NULL, COMPANY_ID_TAITO, NULL, // "D??" 1994, taito_ym2610_sound, GAME_SHOOT,};static void BadWriteByte(UINT32 address, UINT8 data){#ifdef RAINE_DEBUG if(address!=0xB00000) print_debug("Wb(%06x,%02x) [%06x]\n",address,data,s68000context.pc);#endif}static void BadWriteWord(UINT32 address, UINT16 data){ #ifdef RAINE_DEBUG if(address!=0xC00000) print_debug("Ww(%06x,%04x) [%06x]\n",address,data,s68000context.pc); #endif}static void opwolf3_colour_ram_wb(UINT32 address, UINT8 data){ WriteByte((RAM + 0x60000 + (address & 0x7FFF)), data);}static void opwolf3_colour_ram_ww(UINT32 address, UINT16 data){ WriteWord68k((RAM + 0x60000 + (address & 0x7FFE)), data);}static UINT8 opwolf3_colour_ram_rb(UINT32 address){ return ReadByte((RAM + 0x60000 + (address & 0x7FFF)));}static UINT16 opwolf3_colour_ram_rw(UINT32 address){ return ReadWord68k((RAM + 0x60000 + (address & 0x7FFE)));}static UINT8 *RAM_BG0;static UINT8 *RAM_BG1;static UINT8 *RAM_BG2;static UINT8 *RAM_BG3;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;void LoadOperationWolf3(void){ int ta,tb,tc; RAMSize=0x80000+0x10000; if(!(ROM=AllocateMem(0x200000))) return; if(!(RAM=AllocateMem(RAMSize))) return; if(!(GFX=AllocateMem(0x800000+0x800000))) return; GFX_BG0 = GFX+0x000000; GFX_SPR = GFX+0x800000; tb=0; if(!load_rom("opw3_02.rom", ROM, 0x200000)) return; // 16x16 SPRITES for(ta=0;ta<0x200000;ta++){ GFX_SPR[tb++]=ROM[ta]&15; GFX_SPR[tb++]=ROM[ta]>>4; tb+=2; } tb=2; if(!load_rom("opw3_03.rom", ROM, 0x200000)) return; // 16x16 SPRITES for(ta=0;ta<0x200000;ta++){ GFX_SPR[tb++]=ROM[ta]&15; GFX_SPR[tb++]=ROM[ta]>>4; tb+=2; } tb=0; if(!load_rom("opw3_04.rom", ROM, 0x200000)) return; // 16x16 SPRITES (MASK) for(ta=0;ta<0x200000;ta++){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -