?? darius.c
字號:
/******************************************************************************//* *//* DARIUS (C) 1986 TAITO CORPORATION *//* *//******************************************************************************/#include "gameinc.h"#include "darius.h"#include "taitosnd.h"#include "sasound.h" // sample support routines#include "2203intf.h"#include "msm5205.h"#include "debug.h"void DariusVol( int offset, int data );static struct DIR_INFO darius_dirs[] ={ { "dariusj", }, { ROMOF("darius"), }, { CLONEOF("darius"), }, { NULL, },};static struct DIR_INFO dariuso_dirs[] ={ { "dariuso", }, { ROMOF("darius"), }, { CLONEOF("darius"), }, { NULL, },};static struct ROM_INFO darius_roms[] ={ { "a96_28-1.152", 0x00010000, 0xfb34d400, 0, 0, 0, }, { "a96_29-1.185", 0x00010000, 0x75486f62, 0, 0, 0, }, { "a96_30.154", 0x00010000, 0x9eb5e127, 0, 0, 0, }, { "a96_31.187", 0x00010000, 0xe9bb5d89, 0, 0, 0, }, { "a96_32-1.157", 0x00010000, 0xd9719de8, 0, 0, 0, }, { "a96_33-1.190", 0x00010000, 0xff186048, 0, 0, 0, }, { "a96_34-1.158", 0x00010000, 0xca3b2573, 0, 0, 0, }, { "a96_35-1.191", 0x00010000, 0xb3280193, 0, 0, 0, }, { "a96_36.175", 0x00010000, 0xaf598141, 0, 0, 0, }, { "a96_37.196", 0x00010000, 0xb48137c8, 0, 0, 0, }, { "a96_38.176", 0x00010000, 0xe4f3e3a7, 0, 0, 0, }, { "a96_39.197", 0x00010000, 0xea30920f, 0, 0, 0, }, { "a96_40.177", 0x00010000, 0xb699a51e, 0, 0, 0, }, { "a96_41.198", 0x00010000, 0x97128a3a, 0, 0, 0, }, { "a96_42.178", 0x00010000, 0x7f55ee0f, 0, 0, 0, }, { "a96_43.199", 0x00010000, 0xc7cad469, 0, 0, 0, }, { "a96_44.179", 0x00010000, 0xbbc18878, 0, 0, 0, }, { "a96_45.200", 0x00010000, 0x616cdd8b, 0, 0, 0, }, { "a96_46.180", 0x00010000, 0xfec35418, 0, 0, 0, }, { "a96_47.201", 0x00010000, 0x8df9286a, 0, 0, 0, }, { "a96_48.24", 0x00010000, 0x39c9b3aa, 0, 0, 0, }, { "a96_49.25", 0x00010000, 0x37a7d88a, 0, 0, 0, }, { "a96_50.26", 0x00010000, 0x75d738e4, 0, 0, 0, }, { "a96_51.47", 0x00010000, 0x1bf8f0d3, 0, 0, 0, }, { "a96_52.48", 0x00010000, 0x2d9b2128, 0, 0, 0, }, { "a96_53.49", 0x00010000, 0x0173484c, 0, 0, 0, }, { "a96_54.143", 0x00004000, 0x51c02ae2, 0, 0, 0, }, { "a96_55.144", 0x00004000, 0x771e4d98, 0, 0, 0, }, { "a96_56.18", 0x00010000, 0x292ef55c, 0, 0, 0, }, { "a96_57.33", 0x00010000, 0x33ceb730, 0, 0, 0, }, { NULL, 0, 0, 0, 0, 0, },};static struct ROM_INFO dariuso_roms[] ={ { "a96_28.152", 0x00010000, 0x4721d667, 0, 0, 0, }, { "a96_29.185", 0x00010000, 0xf775162b, 0, 0, 0, }, { "a96_30.154", 0x00010000, 0x9eb5e127, 0, 0, 0, }, { "a96_31.187", 0x00010000, 0xe9bb5d89, 0, 0, 0, }, { "a96_32.157", 0x00010000, 0x044c9848, 0, 0, 0, }, { "a96_33.190", 0x00010000, 0xd2f340d2, 0, 0, 0, }, { "a96_34.158", 0x00010000, 0x7556a660, 0, 0, 0, }, { "a96_35.191", 0x00010000, 0xb8ed718b, 0, 0, 0, }, { "a96_36.175", 0x00010000, 0xaf598141, 0, 0, 0, }, { "a96_37.196", 0x00010000, 0xb48137c8, 0, 0, 0, }, { "a96_38.176", 0x00010000, 0xe4f3e3a7, 0, 0, 0, }, { "a96_39.197", 0x00010000, 0xea30920f, 0, 0, 0, }, { "a96_40.177", 0x00010000, 0xb699a51e, 0, 0, 0, }, { "a96_41.198", 0x00010000, 0x97128a3a, 0, 0, 0, }, { "a96_42.178", 0x00010000, 0x7f55ee0f, 0, 0, 0, }, { "a96_43.199", 0x00010000, 0xc7cad469, 0, 0, 0, }, { "a96_44.179", 0x00010000, 0xbbc18878, 0, 0, 0, }, { "a96_45.200", 0x00010000, 0x616cdd8b, 0, 0, 0, }, { "a96_46.180", 0x00010000, 0xfec35418, 0, 0, 0, }, { "a96_47.201", 0x00010000, 0x8df9286a, 0, 0, 0, }, { "a96_48.24", 0x00010000, 0x39c9b3aa, 0, 0, 0, }, { "a96_49.25", 0x00010000, 0x37a7d88a, 0, 0, 0, }, { "a96_50.26", 0x00010000, 0x75d738e4, 0, 0, 0, }, { "a96_51.47", 0x00010000, 0x1bf8f0d3, 0, 0, 0, }, { "a96_52.48", 0x00010000, 0x2d9b2128, 0, 0, 0, }, { "a96_53.49", 0x00010000, 0x0173484c, 0, 0, 0, }, { "a96_54.143", 0x00004000, 0x51c02ae2, 0, 0, 0, }, { "a96_55.144", 0x00004000, 0x771e4d98, 0, 0, 0, }, { "a96_56.18", 0x00010000, 0x292ef55c, 0, 0, 0, }, { "a96_57.33", 0x00010000, 0x33ceb730, 0, 0, 0, }, { NULL, 0, 0, 0, 0, 0, },};extern int YM2203_get_stream_num(int); // 2203intf.cstatic struct INPUT_INFO darius_inputs[] ={ { KB_DEF_COIN1, MSG_COIN1, 0x04200C, 0x01, BIT_ACTIVE_1 }, { KB_DEF_COIN2, MSG_COIN2, 0x04200C, 0x02, BIT_ACTIVE_1 }, { KB_DEF_TILT, MSG_TILT, 0x04200C, 0x20, BIT_ACTIVE_0 }, { KB_DEF_SERVICE, MSG_SERVICE, 0x04200C, 0x10, BIT_ACTIVE_0 }, { KB_DEF_P1_START, MSG_P1_START, 0x04200C, 0x04, BIT_ACTIVE_0 }, { KB_DEF_P1_UP, MSG_P1_UP, 0x042008, 0x01, BIT_ACTIVE_0 }, { KB_DEF_P1_DOWN, MSG_P1_DOWN, 0x042008, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P1_LEFT, MSG_P1_LEFT, 0x042008, 0x08, BIT_ACTIVE_0 }, { KB_DEF_P1_RIGHT, MSG_P1_RIGHT, 0x042008, 0x04, BIT_ACTIVE_0 }, { KB_DEF_P1_B1, MSG_P1_B1, 0x042008, 0x10, BIT_ACTIVE_0 }, { KB_DEF_P1_B2, MSG_P1_B2, 0x042008, 0x20, BIT_ACTIVE_0 }, { KB_DEF_P2_START, MSG_P2_START, 0x04200C, 0x08, BIT_ACTIVE_0 }, { KB_DEF_P2_UP, MSG_P2_UP, 0x04200A, 0x01, BIT_ACTIVE_0 }, { KB_DEF_P2_DOWN, MSG_P2_DOWN, 0x04200A, 0x02, BIT_ACTIVE_0 }, { KB_DEF_P2_LEFT, MSG_P2_LEFT, 0x04200A, 0x08, BIT_ACTIVE_0 }, { KB_DEF_P2_RIGHT, MSG_P2_RIGHT, 0x04200A, 0x04, BIT_ACTIVE_0 }, { KB_DEF_P2_B1, MSG_P2_B1, 0x04200A, 0x10, BIT_ACTIVE_0 }, { KB_DEF_P2_B2, MSG_P2_B2, 0x04200A, 0x20, BIT_ACTIVE_0 }, { 0, NULL, 0, 0, 0 },};static struct DSW_DATA dsw_data_darius_0[] ={ { MSG_DSWA_BIT1, 0x01, 0x02 }, { MSG_OFF, 0x01, 0x00 }, { MSG_ON, 0x00, 0x00 }, { "Auto Turbo Fire", 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_COIN1, 0x30, 0x04 }, { MSG_1COIN_1PLAY, 0x30, 0x00 }, { MSG_1COIN_2PLAY, 0x20, 0x00 }, { MSG_2COIN_3PLAY, 0x10, 0x00 }, { MSG_2COIN_1PLAY, 0x00, 0x00 }, { MSG_COIN2, 0xC0, 0x04 }, { MSG_1COIN_1PLAY, 0xC0, 0x00 }, { MSG_1COIN_2PLAY, 0x80, 0x00 }, { MSG_2COIN_3PLAY, 0x40, 0x00 }, { MSG_2COIN_1PLAY, 0x00, 0x00 }, { NULL, 0, 0, },};static struct DSW_DATA dsw_data_darius_1[] ={ { MSG_DIFFICULTY, 0x03, 0x04 }, { MSG_NORMAL, 0x03, 0x00 }, { MSG_EASY, 0x02, 0x00 }, { MSG_HARD, 0x01, 0x00 }, { MSG_HARDEST, 0x00, 0x00 }, { "Extra Ship", 0x0C, 0x04 }, { "30k 100k", 0x0C, 0x00 }, { "20k 80k", 0x08, 0x00 }, { "40k 200k", 0x04, 0x00 }, { "50k 250k", 0x00, 0x00 }, { "Ships", 0x30, 0x04 }, { "3", 0x30, 0x00 }, { "5", 0x20, 0x00 }, { "1", 0x10, 0x00 }, { "2", 0x00, 0x00 }, { NULL, 0, 0, },};static struct DSW_INFO darius_dsw[] ={ { 0x042010, 0xFF, dsw_data_darius_0 }, { 0x042011, 0xFF, dsw_data_darius_1 }, { 0, 0, NULL, },};static struct VIDEO_INFO darius_video ={ DrawDarius, 864, 224, 32, VIDEO_ROTATE_NORMAL,};static struct YM2203interface ym2203_interface ={ 2, 4000000, { YM2203_VOL(120,160), YM2203_VOL(120,160) }, // 0x2028 //{ 0x00ff2040, 0x00ff2040 }, { 0 }, { 0 }, { DariusVol, NULL }, { NULL, NULL }, { NULL, NULL }};static struct msm5205_adpcm_list darius_adpcm[] ={ { 0x00000,0x00000 }, /* dummy code */ { 0x0aa97,0x0eaf7 }, { 0x00500,0x01260 }, { 0x01261,0x019d1 }, { 0x019d2,0x02409 }, { 0x0240a,0x02b4a }, { 0x02b4b,0x036fb }, { 0x036fc,0x040d4 }, { 0x040d5,0x04be5 }, { 0x04be6,0x055de }, { 0x055df,0x05e1f }, { 0x05e40,0x06440 }, { 0x06481,0x06a81 }, { 0x06ac2,0x070c2 }, { 0x070e3,0x07603 }, { 0x07604,0x07a82 }, { 0x07a83,0x07dc3 }, { 0x07dc4,0x08284 }, { 0x08285,0x087c5 }, { 0x087c6,0x09006 }, { 0x09007,0x0975b }, { 0x0975c,0x09e94 }, { 0x09e85,0x0a8d5 }, { 0x0a8d6,0x0aa96 }, { 0x08285,0x087c5 }, { 0x00500,0x01260 }, { 0x00500,0x01260 }, { 0x00500,0x01260 }, { 0x00500,0x01260 }, { 0x00500,0x01260 },};static struct MSM5205buffer_interface msm5205_interface ={ 1, { 8000 }, { 255 }, { darius_adpcm }, { sizeof(darius_adpcm) / sizeof(struct msm5205_adpcm_list) }, { NULL }, { 0 }, MSM5205_MONO,};static struct SOUND_INFO darius_sound[] ={ { SOUND_YM2203, &ym2203_interface, }, { SOUND_MSM5205, &msm5205_interface, }, { 0, NULL, },};struct GAME_MAIN game_darius ={ darius_dirs, darius_roms, darius_inputs, darius_dsw, NULL, LoadDarius, ClearDarius, &darius_video, ExecuteDariusFrame, "dariusj", "Darius Japanese", "僟儔僀傾僗", COMPANY_ID_TAITO, "A96", 1986, darius_sound, GAME_SHOOT,};void LoadDariuso();struct GAME_MAIN game_dariuso ={ dariuso_dirs, dariuso_roms, darius_inputs, darius_dsw, NULL, LoadDariuso, ClearDarius, &darius_video, ExecuteDariusFrame, "dariuso", "Darius (Old, JPN Ver.)", "僟儔僀傾僗", COMPANY_ID_TAITO, "A96", 1986, darius_sound, GAME_SHOOT,};static struct DIR_INFO darius_extra_dirs[] ={ { "darius_extra", }, { "dariusex", }, { "dariuse", }, { ROMOF("darius"), }, { CLONEOF("darius"), }, { NULL, },};static struct ROM_INFO darius_extra_roms[] ={ { "darext67.bin", 0x00010000, 0xb99aea8c, 0, 0, 0, }, { "darext68.bin", 0x00010000, 0xed721127, 0, 0, 0, }, { "a96_30.154", 0x00010000, 0x9eb5e127, 0, 0, 0, }, { "darext70.bin", 0x00010000, 0x54590b31, 0, 0, 0, }, { "darext71.bin", 0x00010000, 0x65dd0403, 0, 0, 0, }, { "darext72.bin", 0x00010000, 0x248ca2cc, 0, 0, 0, }, { "darext73.bin", 0x00010000, 0x27036a4d, 0, 0, 0, }, { "darext74.bin", 0x00010000, 0x0ea31f60, 0, 0, 0, }, { "a96_36.175", 0x00010000, 0xaf598141, 0, 0, 0, }, { "a96_37.196", 0x00010000, 0xb48137c8, 0, 0, 0, }, { "a96_38.176", 0x00010000, 0xe4f3e3a7, 0, 0, 0, }, { "a96_39.197", 0x00010000, 0xea30920f, 0, 0, 0, }, { "a96_40.177", 0x00010000, 0xb699a51e, 0, 0, 0, }, { "a96_41.198", 0x00010000, 0x97128a3a, 0, 0, 0, }, { "a96_42.178", 0x00010000, 0x7f55ee0f, 0, 0, 0, }, { "a96_43.199", 0x00010000, 0xc7cad469, 0, 0, 0, }, { "a96_44.179", 0x00010000, 0xbbc18878, 0, 0, 0, }, { "a96_45.200", 0x00010000, 0x616cdd8b, 0, 0, 0, }, { "a96_46.180", 0x00010000, 0xfec35418, 0, 0, 0, }, { "a96_47.201", 0x00010000, 0x8df9286a, 0, 0, 0, }, { "a96_48.24", 0x00010000, 0x39c9b3aa, 0, 0, 0, }, { "a96_49.25", 0x00010000, 0x37a7d88a, 0, 0, 0, }, { "a96_50.26", 0x00010000, 0x75d738e4, 0, 0, 0, }, { "a96_51.47", 0x00010000, 0x1bf8f0d3, 0, 0, 0, }, { "a96_52.48", 0x00010000, 0x2d9b2128, 0, 0, 0, }, { "a96_53.49", 0x00010000, 0x0173484c, 0, 0, 0, }, { "a96_54.143", 0x00004000, 0x51c02ae2, 0, 0, 0, }, { "a96_55.144", 0x00004000, 0x771e4d98, 0, 0, 0, }, { "a96_56.18", 0x00010000, 0x292ef55c, 0, 0, 0, }, { "a96_57.33", 0x00010000, 0x33ceb730, 0, 0, 0, }, { NULL, 0, 0, 0, 0, 0, },};struct GAME_MAIN game_darius_extra ={ darius_extra_dirs, darius_extra_roms, darius_inputs, darius_dsw, NULL, LoadDariusExtra, ClearDarius, &darius_video, ExecuteDariusFrame, "dariuse", "Darius (extra)", "僟儔僀傾僗丂僄僉僗僩儔僶乕僕儑儞", COMPANY_ID_TAITO, "A96", 1986, darius_sound, GAME_SHOOT,};static struct DIR_INFO darius_alt_dirs[] ={ { "darius_alt", }, { "darius", }, { "dariusb", }, { NULL, },};static struct ROM_INFO darius_alt_roms[] ={ { "da-58.cpu", 0x00010000, 0x5f71e697, 0, 0, 0, }, { "da-59.cpu", 0x00010000, 0x11aab4eb, 0, 0, 0, }, { "a96_30.154", 0x00010000, 0x9eb5e127, 0, 0, 0, }, { "a96_31.187", 0x00010000, 0xe9bb5d89, 0, 0, 0, }, { "a96_32-1.157", 0x00010000, 0xd9719de8, 0, 0, 0, }, { "a96_33-1.190", 0x00010000, 0xff186048, 0, 0, 0, }, { "a96_34-1.158", 0x00010000, 0xca3b2573, 0, 0, 0, }, { "a96_35-1.191", 0x00010000, 0xb3280193, 0, 0, 0, }, { "da-62.cpu", 0x00010000, 0x9179862c, 0, 0, 0, }, { "da-63.cpu", 0x00010000, 0xfa19cfff, 0, 0, 0, }, { "da-64.cpu", 0x00010000, 0x814c676f, 0, 0, 0, }, { "da-65.cpu", 0x00010000, 0x14eee326, 0, 0, 0, }, { "a96_40.177", 0x00010000, 0xb699a51e, 0, 0, 0, }, { "a96_41.198", 0x00010000, 0x97128a3a, 0, 0, 0, }, { "a96_42.178", 0x00010000, 0x7f55ee0f, 0, 0, 0, }, { "a96_43.199", 0x00010000, 0xc7cad469, 0, 0, 0, }, { "a96_44.179", 0x00010000, 0xbbc18878, 0, 0, 0, }, { "a96_45.200", 0x00010000, 0x616cdd8b, 0, 0, 0, }, { "a96_46.180", 0x00010000, 0xfec35418, 0, 0, 0, }, { "a96_47.201", 0x00010000, 0x8df9286a, 0, 0, 0, }, { "a96_48.24", 0x00010000, 0x39c9b3aa, 0, 0, 0, }, { "a96_49.25", 0x00010000, 0x37a7d88a, 0, 0, 0, }, { "a96_50.26", 0x00010000, 0x75d738e4, 0, 0, 0, }, { "a96_51.47", 0x00010000, 0x1bf8f0d3, 0, 0, 0, }, { "a96_52.48", 0x00010000, 0x2d9b2128, 0, 0, 0, }, { "a96_53.49", 0x00010000, 0x0173484c, 0, 0, 0, }, { "a96_54.143", 0x00004000, 0x51c02ae2, 0, 0, 0, }, { "a96_55.144", 0x00004000, 0x771e4d98, 0, 0, 0, }, { "a96_56.18", 0x00010000, 0x292ef55c, 0, 0, 0, }, { "a96_57.33", 0x00010000, 0x33ceb730, 0, 0, 0, }, { "da-61.cpu", 0x00010000, 0x4736aa9b, 0, 0, 0, }, { "da-66.cpu", 0x00010000, 0x4ede5f56, 0, 0, 0, }, { NULL, 0, 0, 0, 0, 0, },};struct GAME_MAIN game_darius_alt ={ darius_alt_dirs, darius_alt_roms, darius_inputs, darius_dsw, NULL, LoadDariusAlt, ClearDarius, &darius_video, ExecuteDariusFrame, "darius", "Darius", "僟儔僀傾僗", COMPANY_ID_TAITO, "A96", 1986, darius_sound, GAME_SHOOT,};void DariusYM2203SetFMPan( UINT16 offset, UINT8 data );void DariusYM2203SetAYPan( UINT16 offset, UINT8 data );void DariusMSM5205SetPan( UINT16 offset, UINT8 data );UINT16 DariusRead_YM2203A(UINT16 offset);void DariusWrite_YM2203A(UINT16 offset, UINT8 data);UINT16 DariusRead_YM2203B(UINT16 offset);void DariusWrite_YM2203B(UINT16 offset, UINT8 data);void DariusWrite_ADPCM(UINT16 offset, UINT8 data);static UINT8 *GFX_BG0;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -