📄 gunfront.c
字号:
/******************************************************************************//* *//* GUN FRONTIER (C) 1990 TAITO CORPORATION *//* *//******************************************************************************/#include "gameinc.h"#include "gunfront.h"#include "tc100scn.h"#include "tc200obj.h"#include "tc220ioc.h"#include "taitosnd.h"#include "sasound.h" // sample support routinesstatic struct DIR_INFO gun_frontier_dirs[] ={ { "gun_frontier", }, { "gunfront", }, { NULL, },};static struct ROM_INFO gun_frontier_roms[] ={ { "c71-10.rom", 0x00020000, 0xf39c0a06, 0, 0, 0, }, { "c71-02.rom", 0x00100000, 0x2a600c92, 0, 0, 0, }, { "c71-03.rom", 0x00100000, 0x9133c605, 0, 0, 0, }, { "c71-08.rom", 0x00020000, 0xc17dc0a0, 0, 0, 0, }, { "c71-09.rom", 0x00020000, 0x10a544a2, 0, 0, 0, }, { "c71-01.rom", 0x00100000, 0x0e73105a, 0, 0, 0, }, { "c71-12.rom", 0x00010000, 0x0038c7f8, 0, 0, 0, }, { "c71-14.rom", 0x00020000, 0x312da036, 0, 0, 0, }, { "c71-15.rom", 0x00020000, 0xdf3e00bb, 0, 0, 0, }, { "c71-16.rom", 0x00020000, 0x1bbcc2d4, 0, 0, 0, }, { NULL, 0, 0, 0, 0, 0, },};static struct INPUT_INFO gun_frontier_inputs[] ={ { KB_DEF_COIN1, MSG_COIN1, 0x03200E, 0x04, BIT_ACTIVE_0 }, { KB_DEF_COIN2, MSG_COIN2, 0x03200E, 0x08, BIT_ACTIVE_0 }, { KB_DEF_TILT, MSG_TILT, 0x03200E, 0x01, BIT_ACTIVE_0 }, { KB_DEF_SERVICE, MSG_SERVICE, 0x03200E, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P1_START, MSG_P1_START, 0x032004, 0x80, BIT_ACTIVE_0 }, { KB_DEF_P1_UP, MSG_P1_UP, 0x032004, 0x01, BIT_ACTIVE_0 }, { KB_DEF_P1_DOWN, MSG_P1_DOWN, 0x032004, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P1_LEFT, MSG_P1_LEFT, 0x032004, 0x04, BIT_ACTIVE_0 }, { KB_DEF_P1_RIGHT, MSG_P1_RIGHT, 0x032004, 0x08, BIT_ACTIVE_0 }, { KB_DEF_P1_B1, MSG_P1_B1, 0x032004, 0x10, BIT_ACTIVE_0 }, { KB_DEF_P1_B2, MSG_P1_B2, 0x032004, 0x20, BIT_ACTIVE_0 }, { KB_DEF_P2_START, MSG_P2_START, 0x032006, 0x80, BIT_ACTIVE_0 }, { KB_DEF_P2_UP, MSG_P2_UP, 0x032006, 0x01, BIT_ACTIVE_0 }, { KB_DEF_P2_DOWN, MSG_P2_DOWN, 0x032006, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P2_LEFT, MSG_P2_LEFT, 0x032006, 0x04, BIT_ACTIVE_0 }, { KB_DEF_P2_RIGHT, MSG_P2_RIGHT, 0x032006, 0x08, BIT_ACTIVE_0 }, { KB_DEF_P2_B1, MSG_P2_B1, 0x032006, 0x10, BIT_ACTIVE_0 }, { KB_DEF_P2_B2, MSG_P2_B2, 0x032006, 0x20, BIT_ACTIVE_0 }, { 0, NULL, 0, 0, 0 },};static struct DSW_DATA dsw_data_gun_frontier_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_gun_frontier_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 }, { "1", 0x20, 0x00 }, { "2", 0x10, 0x00 }, { "5", 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 gun_frontier_dsw[] ={ { 0x032000, 0xFF, dsw_data_gun_frontier_0 }, { 0x032002, 0xFF, dsw_data_gun_frontier_1 }, { 0, 0, NULL, },};static struct ROMSW_DATA romsw_data_gun_frontier_0[] ={ { "Taito 1", 0x01 }, { "Taito 2", 0x02 }, { "Taito 3", 0x03 }, { "Taito 4", 0x04 }, { "Taito 5", 0x05 }, { "Taito 6", 0x06 }, { NULL, 0 },};static struct ROMSW_INFO gun_frontier_romsw[] ={ { 0x07FFFF, 0x03, romsw_data_gun_frontier_0 }, { 0, 0, NULL },};static struct VIDEO_INFO gun_frontier_video ={ DrawGunFront, 224, 320, 32, VIDEO_ROTATE_NORMAL| VIDEO_ROTATABLE,};struct GAME_MAIN game_gun_frontier ={ gun_frontier_dirs, gun_frontier_roms, gun_frontier_inputs, gun_frontier_dsw, gun_frontier_romsw, LoadGunFront, ClearGunFront, &gun_frontier_video, ExecuteGunFrontFrame, "gunfront", "Gun Frontier", "僈儞僼儘儞僥傿傾", COMPANY_ID_TAITO, "C71", 1990, taito_ym2610_sound, GAME_SHOOT,};static UINT8 *RAM_VIDEO;static UINT8 *RAM_SCROLL;static UINT8 *RAM_OBJECT;static UINT8 *RAM_INPUT;static UINT8 *GFX_BG0;static UINT8 *GFX_BG0_SOLID;static UINT8 *GFX_SPR;static UINT8 *GFX_SPR_SOLID;void LoadGunFront(void){ int ta,tb; if(!(RAM=AllocateMem(0x100000))) return; if(!(GFX=AllocateMem(0x200000+0x200000))) return; GFX_BG0 = GFX+0x000000; GFX_SPR = GFX+0x200000; tb=0; if(!load_rom("c71-02.rom", RAM, 0x100000)) return; // 8x8 TILES for(ta=0;ta<0x100000;ta+=2){ GFX[tb+0]=RAM[ta+1]>>4; GFX[tb+1]=RAM[ta+1]&15; GFX[tb+2]=RAM[ta+0]>>4; GFX[tb+3]=RAM[ta+0]&15; tb+=4; } tb=0; if(!load_rom("c71-03.rom", RAM, 0x100000)) return; // 16x16 SPRITES for(ta=0;ta<0x100000;ta++){ GFX_SPR[tb++]=RAM[ta]&15; GFX_SPR[tb++]=RAM[ta]>>4; } FreeMem(RAM); Rotate8x8(GFX,0x8000); Flip8x8_X(GFX,0x8000); Rotate16x16(GFX_SPR,0x2000); Flip16x16_X(GFX_SPR,0x2000); RAMSize=0x48000; if(!(RAM=AllocateMem(RAMSize))) return; if(!(ROM=AllocateMem(0xC0000))) return; if(!load_rom("c71-09.rom", RAM, 0x20000)) return; for(ta=0;ta<0x20000;ta++){ ROM[ta+ta]=RAM[ta]; } if(!load_rom("c71-08.rom", RAM, 0x20000)) return; for(ta=0;ta<0x20000;ta++){ ROM[ta+ta+1]=RAM[ta]; } if(!load_rom("c71-10.rom", RAM, 0x20000)) return; for(ta=0;ta<0x20000;ta++){ ROM[ta+ta+0x40000]=RAM[ta]; } if(!load_rom("c71-14.rom", RAM, 0x20000)) return; for(ta=0;ta<0x20000;ta++){ ROM[ta+ta+0x40001]=RAM[ta]; } if(!load_rom("c71-16.rom", RAM, 0x20000)) return; for(ta=0;ta<0x20000;ta++){ ROM[ta+ta+0x80000]=RAM[ta]; } if(!load_rom("c71-15.rom", RAM, 0x20000)) return; for(ta=0;ta<0x20000;ta++){ ROM[ta+ta+0x80001]=RAM[ta]; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -