src/mame/audio/dkong.c
| r5891 | r5892 | |
| 335 | 335 | context->r_total[0] = RES_2_PARALLEL(context->r_in[0] + DKONG_CUSTOM_R4, NE555_CV_R); |
| 336 | 336 | context->r_total[1] = RES_2_PARALLEL((context->r_in[1] + DKONG_CUSTOM_R4), NE555_CV_R); |
| 337 | 337 | /* precalculate charging exponents */ |
| 338 | | context->exp[0] = RC_CHARGE_EXP(node, context->r_total[0] * DKONG_CUSTOM_C); |
| 339 | | context->exp[1] = RC_CHARGE_EXP(node, context->r_total[1] * DKONG_CUSTOM_C); |
| 338 | context->exp[0] = RC_CHARGE_EXP(context->r_total[0] * DKONG_CUSTOM_C); |
| 339 | context->exp[1] = RC_CHARGE_EXP(context->r_total[1] * DKONG_CUSTOM_C); |
| 340 | 340 | |
| 341 | 341 | node->output[0] = 0; |
| 342 | 342 | } |
| r5891 | r5892 | |
| 383 | 383 | DISCRETE_DIODE_MIXER2(NODE_20, NODE_17, NODE_13, &dkong_diode_mix_table) /* D1, D2 + D3 */ |
| 384 | 384 | |
| 385 | 385 | DISCRETE_RCINTEGRATE(NODE_22,NODE_20,DK_R5, RES_2_PARALLEL(DK_R4+DK_R3,DK_R6),0,DK_C19,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1) |
| 386 | | DISCRETE_MULTIPLY(DS_OUT_SOUND0,1,NODE_22,DK_R3/R_SERIES(DK_R3,DK_R4)) |
| 386 | DISCRETE_MULTIPLY(DS_OUT_SOUND0,NODE_22,DK_R3/R_SERIES(DK_R3,DK_R4)) |
| 387 | 387 | DISCRETE_TASK_END() |
| 388 | 388 | |
| 389 | 389 | /************************************************/ |
| r5891 | r5892 | |
| 417 | 417 | DISCRETE_DIODE_MIXER2(NODE_38, NODE_35, NODE_29, &dkong_diode_mix_table) |
| 418 | 418 | |
| 419 | 419 | DISCRETE_RCINTEGRATE(NODE_39,NODE_38,DK_R27, RES_2_PARALLEL(DK_R28,DK_R26+DK_R25),0,DK_C16,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1) |
| 420 | | DISCRETE_MULTIPLY(DS_OUT_SOUND1,1,NODE_39,DK_R25/(DK_R26+DK_R25)) |
| 420 | DISCRETE_MULTIPLY(DS_OUT_SOUND1,NODE_39,DK_R25/(DK_R26+DK_R25)) |
| 421 | 421 | DISCRETE_TASK_END() |
| 422 | 422 | |
| 423 | 423 | /************************************************/ |
| r5891 | r5892 | |
| 443 | 443 | DISCRETE_RCDISC_MODULATED(NODE_60,DS_SOUND0_INV,NODE_55,DK_R36,DK_R18,DK_R35,DK_R17,DK_C25,DK_SUP_V) |
| 444 | 444 | /* Filter and divide - omitted C22 */ |
| 445 | 445 | DISCRETE_CRFILTER(NODE_61, 1, NODE_60, DK_R15+DK_R16, DK_C23) |
| 446 | | DISCRETE_MULTIPLY(DS_OUT_SOUND2, 1, NODE_61, DK_R15/(DK_R15+DK_R16)) |
| 446 | DISCRETE_MULTIPLY(DS_OUT_SOUND2, NODE_61, DK_R15/(DK_R15+DK_R16)) |
| 447 | 447 | DISCRETE_TASK_END() |
| 448 | 448 | |
| 449 | 449 | /************************************************/ |
| r5891 | r5892 | |
| 472 | 472 | #if DK_NO_FILTERS |
| 473 | 473 | DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_71, DS_ADJ_DAC) |
| 474 | 474 | #else |
| 475 | | DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_73, DS_ADJ_DAC) |
| 475 | DISCRETE_MULTIPLY(DS_OUT_DAC, NODE_73, DS_ADJ_DAC) |
| 476 | 476 | #endif |
| 477 | 477 | DISCRETE_TASK_END() |
| 478 | 478 | |
| r5891 | r5892 | |
| 648 | 648 | /* SIGNALS */ |
| 649 | 649 | /************************************************/ |
| 650 | 650 | |
| 651 | | DISCRETE_LOGIC_INVERT(DS_SOUND6,1,DS_SOUND6_INV) |
| 652 | | DISCRETE_LOGIC_INVERT(DS_SOUND7,1,DS_SOUND7_INV) |
| 651 | DISCRETE_LOGIC_INVERT(DS_SOUND6,DS_SOUND6_INV) |
| 652 | DISCRETE_LOGIC_INVERT(DS_SOUND7,DS_SOUND7_INV) |
| 653 | 653 | |
| 654 | 654 | /************************************************/ |
| 655 | 655 | /* Noise */ |
| r5891 | r5892 | |
| 674 | 674 | DISCRETE_DIODE_MIXER2(NODE_20, NODE_18, NODE_13, &dkong_diode_mix_table) /* D1, D2 + D3 */ |
| 675 | 675 | |
| 676 | 676 | DISCRETE_RCINTEGRATE(NODE_22,NODE_20,RS_R5, RES_2_PARALLEL(RS_R4+RS_R3,RS_R6),0,RS_C18,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1) |
| 677 | | DISCRETE_MULTIPLY(DS_OUT_SOUND2,1,NODE_22,RS_R3/R_SERIES(RS_R3,RS_R4)) |
| 677 | DISCRETE_MULTIPLY(DS_OUT_SOUND2,NODE_22,RS_R3/R_SERIES(RS_R3,RS_R4)) |
| 678 | 678 | |
| 679 | 679 | /************************************************/ |
| 680 | 680 | /* SOUND1 */ |
| r5891 | r5892 | |
| 689 | 689 | DISCRETE_DIODE_MIXER2(NODE_30, NODE_28, NODE_14, &dkong_diode_mix_table) /* D1, D2 + D3 */ |
| 690 | 690 | |
| 691 | 691 | DISCRETE_RCINTEGRATE(NODE_31,NODE_30,RS_R28, RES_2_PARALLEL(RS_R27+RS_R26,RS_R29),0,RS_C29,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1) |
| 692 | | DISCRETE_MULTIPLY(DS_OUT_SOUND1,1,NODE_31,RS_R26/R_SERIES(RS_R26,RS_R27)) |
| 692 | DISCRETE_MULTIPLY(DS_OUT_SOUND1,NODE_31,RS_R26/R_SERIES(RS_R26,RS_R27)) |
| 693 | 693 | |
| 694 | 694 | /************************************************/ |
| 695 | 695 | /* SOUND0 */ |
| r5891 | r5892 | |
| 703 | 703 | |
| 704 | 704 | DISCRETE_RCDISC_MODULATED(NODE_44,DS_SOUND0_INV,NODE_43,RS_R39,RS_R18,RS_R37,RS_R38,RS_C22,DK_SUP_V) |
| 705 | 705 | DISCRETE_CRFILTER(NODE_45, 1, NODE_44, RS_R15+RS_R16, RS_C33) |
| 706 | | DISCRETE_MULTIPLY(DS_OUT_SOUND0, 1, NODE_45, RS_R15/(RS_R15+RS_R16)) |
| 706 | DISCRETE_MULTIPLY(DS_OUT_SOUND0, NODE_45, RS_R15/(RS_R15+RS_R16)) |
| 707 | 707 | |
| 708 | 708 | /************************************************/ |
| 709 | 709 | /* SOUND7 */ |
| r5891 | r5892 | |
| 720 | 720 | DISCRETE_RCINTEGRATE(NODE_55,NODE_52,RS_R46, RS_R46,0,RS_C45,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1) |
| 721 | 721 | DISCRETE_TRANSFORM4(NODE_56, NODE_55, DS_SOUND7,NODE_54,2.5, "01*23<*") |
| 722 | 722 | DISCRETE_CRFILTER(NODE_57, 1, NODE_56, RS_R43+RS_R44, RS_C46) |
| 723 | | DISCRETE_MULTIPLY(DS_OUT_SOUND7, 1, NODE_57, RS_R44/(RS_R43+RS_R44)) |
| 723 | DISCRETE_MULTIPLY(DS_OUT_SOUND7, NODE_57, RS_R44/(RS_R43+RS_R44)) |
| 724 | 724 | |
| 725 | 725 | /************************************************/ |
| 726 | 726 | /* DAC */ |
| r5891 | r5892 | |
| 740 | 740 | DISCRETE_SALLEN_KEY_FILTER(NODE_173, 1, NODE_171, DISC_SALLEN_KEY_LOW_PASS, &dkong_sallen_key_info) |
| 741 | 741 | |
| 742 | 742 | /* Adjustment VR3 */ |
| 743 | | DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_173, DS_ADJ_DAC) |
| 743 | DISCRETE_MULTIPLY(DS_OUT_DAC, NODE_173, DS_ADJ_DAC) |
| 744 | 744 | |
| 745 | 745 | /************************************************/ |
| 746 | 746 | /* Amplifier */ |
| r5891 | r5892 | |
| 870 | 870 | DISCRETE_INPUT_NOT(DS_SOUND7_INV) |
| 871 | 871 | DISCRETE_INPUT_NOT(DS_SOUND9_INV) |
| 872 | 872 | DISCRETE_INPUT_NOT(DS_DISCHARGE_INV) |
| 873 | | DISCRETE_INPUT_DATA(DS_DAC) |
| 873 | //DISCRETE_INPUT_DATA(DS_DAC) |
| 874 | 874 | |
| 875 | 875 | /************************************************/ |
| 876 | | /* SIGNALS */ |
| 876 | /* SOUND0 / SOUND7 */ |
| 877 | 877 | /************************************************/ |
| 878 | 878 | |
| 879 | | DISCRETE_LOGIC_INVERT(DS_SOUND7,1,DS_SOUND7_INV) |
| 880 | | DISCRETE_LOGIC_INVERT(DS_SOUND9,1,DS_SOUND9_INV) |
| 879 | DISCRETE_TASK_START() |
| 880 | DISCRETE_LOGIC_INVERT(DS_SOUND7,DS_SOUND7_INV) |
| 881 | DISCRETE_COUNTER(NODE_100,1,0,NODE_118,0xFFFF,DISC_COUNT_UP,0,DISC_CLK_BY_COUNT) |
| 881 | 882 | |
| 883 | DISCRETE_BIT_DECODE(NODE_101, NODE_100, 6, 1) /*LS157 2A */ |
| 884 | DISCRETE_BIT_DECODE(NODE_102, NODE_100, 3, 1) /*LS157 2B */ |
| 885 | DISCRETE_BIT_DECODE(NODE_103, NODE_100, 12, 1) /*LS157 3A */ |
| 886 | DISCRETE_BIT_DECODE(NODE_104, NODE_100, 11, 1) /*LS157 3B */ |
| 887 | |
| 888 | /* LS157 Switches */ |
| 889 | DISCRETE_SWITCH(NODE_105, 1, DS_SOUND7_INV, GND, NODE_113) /* Switch 1 from LS624 */ |
| 890 | DISCRETE_SWITCH(NODE_106, 1, DS_SOUND7_INV, NODE_101, NODE_102) /* Switch 2 */ |
| 891 | DISCRETE_SWITCH(NODE_107, 1, DS_SOUND7_INV, NODE_103, NODE_104) /* Switch 3 */ |
| 892 | |
| 893 | DISCRETE_LS123(NODE_110, DS_SOUND0_INV, JR_R8, JR_C14) |
| 894 | DISCRETE_TRANSFORM2(NODE_111, TTL_HIGH, NODE_110, "01-") |
| 895 | DISCRETE_RCFILTER(NODE_112, 1, NODE_111, JR_R10, JR_C17) |
| 896 | DISCRETE_74LS624(NODE_113, NODE_112, DK_SUP_V, JR_C18, DISC_LS624_OUT_ENERGY) |
| 897 | |
| 898 | DISCRETE_LOGIC_XOR(NODE_115, NODE_105, NODE_106) |
| 899 | |
| 900 | DISCRETE_TRANSFORM2(NODE_116, NODE_107, TTL_HIGH, "0!1*") |
| 901 | DISCRETE_RCFILTER(NODE_117, 1, NODE_116, JR_R11, JR_C16) |
| 902 | DISCRETE_74LS624(NODE_118, NODE_117, DK_SUP_V, JR_C19, DISC_LS624_OUT_COUNT_F) |
| 903 | |
| 904 | DISCRETE_LOGIC_NAND(NODE_120, NODE_115, NODE_110) |
| 905 | DISCRETE_MULTIPLY(DS_OUT_SOUND0, NODE_120, TTL_HIGH) |
| 906 | DISCRETE_TASK_END() |
| 907 | |
| 882 | 908 | /************************************************/ |
| 883 | 909 | /* SOUND1 */ |
| 884 | 910 | /************************************************/ |
| 885 | 911 | |
| 912 | DISCRETE_TASK_START() |
| 886 | 913 | DISCRETE_LS123(NODE_10, DS_SOUND1_INV, JR_R9, JR_C15) |
| 887 | 914 | DISCRETE_TRANSFORM2(NODE_11,NODE_104,TTL_HIGH,"0!1*") |
| 888 | | DISCRETE_LOGIC_INVERT(NODE_12,1,NODE_10) |
| 915 | DISCRETE_LOGIC_INVERT(NODE_12,NODE_10) |
| 889 | 916 | DISCRETE_MIXER2(NODE_13, 1, NODE_10, NODE_11, &dkongjr_s1_mixer_desc) |
| 890 | | DISCRETE_74LS624( NODE_14, 1, NODE_13, 0.98*DK_SUP_V, JR_C22, DISC_LS624_OUT_ENERGY) |
| 917 | DISCRETE_74LS624( NODE_14, NODE_13, 0.98*DK_SUP_V, JR_C22, DISC_LS624_OUT_ENERGY) |
| 891 | 918 | DISCRETE_RCDISC_MODULATED(NODE_15, NODE_12, NODE_14, 120, JR_R27, RES_K(0.001), JR_R28, JR_C28, DK_SUP_V) |
| 892 | 919 | /* The following circuit does not match 100%, however works. |
| 893 | 920 | * To be exact, we need a C-R-C-R circuit, we actually do not have. |
| 894 | 921 | */ |
| 895 | 922 | DISCRETE_CRFILTER_VREF(NODE_16, 1, NODE_15, JR_R4, JR_C23, 2.5) |
| 896 | 923 | DISCRETE_RCFILTER(DS_OUT_SOUND1, 1, NODE_16, JR_R19, JR_C21) |
| 924 | DISCRETE_TASK_END() |
| 897 | 925 | |
| 898 | 926 | /************************************************/ |
| 899 | 927 | /* SOUND2 */ |
| 900 | 928 | /************************************************/ |
| 901 | 929 | |
| 902 | | DISCRETE_74LS624( NODE_20, 1, 0, 0.98*DK_SUP_V, JR_C20, DISC_LS624_OUT_COUNT_F) |
| 930 | DISCRETE_TASK_START() |
| 931 | DISCRETE_74LS624(NODE_20, 0, 0.98*DK_SUP_V, JR_C20, DISC_LS624_OUT_COUNT_F) |
| 903 | 932 | DISCRETE_LFSR_NOISE(NODE_21, 1, 1, NODE_20, 1.0, 0, 0.5, &dkongjr_lfsr) |
| 904 | 933 | DISCRETE_LS123_INV(NODE_25, DS_SOUND2_INV, JR_R17, JR_C27) |
| 905 | 934 | DISCRETE_RCDISC_MODULATED(NODE_26, NODE_25, NODE_21, 120, JR_R24, RES_K(0.001), JR_R18, JR_C29, DK_SUP_V) |
| r5891 | r5892 | |
| 908 | 937 | */ |
| 909 | 938 | DISCRETE_CRFILTER_VREF(NODE_27, 1, NODE_26, JR_R6, JR_C30, 2.5) |
| 910 | 939 | DISCRETE_RCFILTER(DS_OUT_SOUND2, 1, NODE_27, JR_R2, JR_C25) |
| 940 | DISCRETE_TASK_END() |
| 911 | 941 | |
| 912 | 942 | /************************************************/ |
| 913 | 943 | /* SOUND9 */ |
| 914 | 944 | /************************************************/ |
| 915 | 945 | |
| 946 | DISCRETE_TASK_START() |
| 947 | DISCRETE_LOGIC_INVERT(DS_SOUND9,DS_SOUND9_INV) |
| 916 | 948 | DISCRETE_RCFILTER(NODE_90, 1, DS_SOUND9_INV, JR_R14, JR_C26) |
| 917 | | DISCRETE_MULTIPLY(NODE_91, 1, NODE_90, TTL_HIGH) |
| 918 | | DISCRETE_74LS624( NODE_92, 1, NODE_91, DK_SUP_V, JR_C37, DISC_LS624_OUT_ENERGY) |
| 949 | DISCRETE_MULTIPLY(NODE_91, NODE_90, TTL_HIGH) |
| 950 | DISCRETE_74LS624( NODE_92, NODE_91, DK_SUP_V, JR_C37, DISC_LS624_OUT_ENERGY) |
| 919 | 951 | DISCRETE_ENERGY_NAND(NODE_93, NODE_92, DS_SOUND9) |
| 920 | | DISCRETE_MULTIPLY(DS_OUT_SOUND9, 1, NODE_93, TTL_HIGH) |
| 952 | DISCRETE_MULTIPLY(DS_OUT_SOUND9, NODE_93, TTL_HIGH) |
| 953 | DISCRETE_TASK_END() |
| 921 | 954 | |
| 922 | 955 | /************************************************/ |
| 923 | | /* SOUND0 / SOUND7 */ |
| 956 | /* DAC */ |
| 924 | 957 | /************************************************/ |
| 925 | 958 | |
| 926 | | DISCRETE_COUNTER(NODE_100,1,0,NODE_118,0xFFFF,DISC_COUNT_UP,0,DISC_CLK_BY_COUNT) |
| 927 | | |
| 928 | | DISCRETE_BIT_DECODE(NODE_101, NODE_100, 6, 1) /*LS157 2A */ |
| 929 | | DISCRETE_BIT_DECODE(NODE_102, NODE_100, 3, 1) /*LS157 2B */ |
| 930 | | DISCRETE_BIT_DECODE(NODE_103, NODE_100, 12, 1) /*LS157 3A */ |
| 931 | | DISCRETE_BIT_DECODE(NODE_104, NODE_100, 11, 1) /*LS157 3B */ |
| 932 | | |
| 933 | | /* LS157 Switches */ |
| 934 | | DISCRETE_SWITCH(NODE_105, 1, DS_SOUND7_INV, GND, NODE_113) /* Switch 1 from LS624 */ |
| 935 | | DISCRETE_SWITCH(NODE_106, 1, DS_SOUND7_INV, NODE_101, NODE_102) /* Switch 2 */ |
| 936 | | DISCRETE_SWITCH(NODE_107, 1, DS_SOUND7_INV, NODE_103, NODE_104) /* Switch 3 */ |
| 937 | | |
| 938 | | DISCRETE_LS123(NODE_110, DS_SOUND0_INV, JR_R8, JR_C14) |
| 939 | | DISCRETE_TRANSFORM2(NODE_111, TTL_HIGH, NODE_110, "01-") |
| 940 | | DISCRETE_RCFILTER(NODE_112, 1, NODE_111, JR_R10, JR_C17) |
| 941 | | DISCRETE_74LS624(NODE_113, 1, NODE_112, DK_SUP_V, JR_C18, DISC_LS624_OUT_ENERGY) |
| 942 | | |
| 943 | | DISCRETE_LOGIC_XOR(NODE_115, 1, NODE_105, NODE_106) |
| 944 | | |
| 945 | | DISCRETE_TRANSFORM2(NODE_116, NODE_107, TTL_HIGH, "0!1*") |
| 946 | | DISCRETE_RCFILTER(NODE_117, 1, NODE_116, JR_R11, JR_C16) |
| 947 | | DISCRETE_74LS624(NODE_118, 1, NODE_117, DK_SUP_V, JR_C19, DISC_LS624_OUT_COUNT_F) |
| 948 | | |
| 949 | | DISCRETE_LOGIC_NAND(NODE_120, 1, NODE_115, NODE_110) |
| 950 | | DISCRETE_MULTIPLY(DS_OUT_SOUND0, 1, NODE_120, TTL_HIGH) |
| 951 | | |
| 952 | | /************************************************/ |
| 953 | | /* DAC */ |
| 954 | | /************************************************/ |
| 959 | DISCRETE_TASK_START() |
| 960 | DISCRETE_INPUT_BUFFER(DS_DAC, 0) |
| 955 | 961 | /* Signal decay circuit Q7, R20, C32 */ |
| 956 | 962 | DISCRETE_RCDISC(NODE_170, DS_DISCHARGE_INV, 1, JR_R20, JR_C32) |
| 957 | 963 | DISCRETE_TRANSFORM4(NODE_171, DS_DAC, DK_SUP_V/256.0, NODE_170, DS_DISCHARGE_INV, "01*3!2+*") |
| r5891 | r5892 | |
| 966 | 972 | */ |
| 967 | 973 | |
| 968 | 974 | DISCRETE_SALLEN_KEY_FILTER(DS_OUT_DAC, 1, NODE_171, DISC_SALLEN_KEY_LOW_PASS, &dkong_sallen_key_info) |
| 975 | DISCRETE_TASK_END() |
| 969 | 976 | |
| 970 | 977 | /************************************************/ |
| 971 | 978 | /* Amplifier */ |
| r5891 | r5892 | |
| 1287 | 1294 | MDRV_LATCH8_ADD( "virtual_p1" ) /* virtual latch for port A */ |
| 1288 | 1295 | MDRV_LATCH8_INVERT( 0x80 ) /* signal is inverted */ |
| 1289 | 1296 | MDRV_LATCH8_DEVREAD(7, "ls259.6h", latch8_r, 3) |
| 1290 | | MDRV_LATCH8_DEVREAD(6, "tms", tms5110_status_r, 0) |
| 1297 | MDRV_LATCH8_DEVREAD(6, "tms", m58817_status_r, 0) |
| 1291 | 1298 | |
| 1292 | 1299 | MDRV_SOUND_ADD("tms", M58817, XTAL_640kHz) |
| 1293 | 1300 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
src/mame/audio/skyraid.c
| r0 | r5892 | |
| 1 | /************************************************************************ |
| 2 | * skyraid Sound System Analog emulation |
| 3 | * Sept 2009, Derrick Renaud |
| 4 | ************************************************************************/ |
| 5 | |
| 6 | #include "driver.h" |
| 7 | #include "skyraid.h" |
| 8 | |
| 9 | |
| 10 | /* Discrete Sound Input Nodes */ |
| 11 | #define SKYRAID_PLANE_SWEEP_EN NODE_01 |
| 12 | #define SKYRAID_MISSILE_EN NODE_02 |
| 13 | #define SKYRAID_EXPLOSION_EN NODE_03 |
| 14 | #define SKYRAID_PLANE_ON_EN NODE_04 |
| 15 | #define SKYRAID_PLANE_ON__IC_E8 SKYRAID_PLANE_ON_EN |
| 16 | #define SKYRAID_ATTRACT_EN NODE_05 |
| 17 | |
| 18 | /* Discrete Sound Output Nodes */ |
| 19 | #define SKYRAID_NOISE NODE_10 |
| 20 | #define SKYRAID_EXPLOSION_SND NODE_11 |
| 21 | #define SKYRAID_JET_A_SND NODE_12 |
| 22 | #define SKYRAID_JET_B_SND NODE_13 |
| 23 | #define SKYRAID_MSL_A_SND NODE_14 |
| 24 | #define SKYRAID_MSL_B_SND NODE_15 |
| 25 | #define SKYRAID_PLANE_SND NODE_16 |
| 26 | |
| 27 | /* Parts List - Resistors */ |
| 28 | #define SKYRAID_R12 RES_K(1) |
| 29 | #define SKYRAID_R13 RES_K(10) |
| 30 | #define SKYRAID_R14 RES_K(100) |
| 31 | #define SKYRAID_R16 RES_M(10) |
| 32 | #define SKYRAID_R18 RES_K(10) |
| 33 | #define SKYRAID_R19 RES_K(10) |
| 34 | #define SKYRAID_R20 RES_K(47) |
| 35 | #define SKYRAID_R24 RES_M(10) |
| 36 | #define SKYRAID_R25 RES_M(3.9) |
| 37 | #define SKYRAID_R27 RES_M(1.5) |
| 38 | #define SKYRAID_R28 RES_M(1.5) |
| 39 | #define SKYRAID_R29 RES_M(4.7) |
| 40 | #define SKYRAID_R30 RES_M(1) |
| 41 | #define SKYRAID_R31 RES_M(1) |
| 42 | #define SKYRAID_R32 RES_M(4.7) |
| 43 | #define SKYRAID_R84 RES_K(22) |
| 44 | #define SKYRAID_R85 RES_K(100) |
| 45 | #define SKYRAID_R86 820 |
| 46 | #define SKYRAID_R110 RES_K(330) |
| 47 | #define SKYRAID_R118 RES_K(470) |
| 48 | #define SKYRAID_R119 RES_K(10) |
| 49 | #define SKYRAID_R120 RES_K(220) |
| 50 | #define SKYRAID_R121 RES_K(1) |
| 51 | #define SKYRAID_R122 RES_K(150) |
| 52 | |
| 53 | /* Parts List - Capacitors */ |
| 54 | #define SKYRAID_C44 CAP_U(4.7) |
| 55 | #define SKYRAID_C45 CAP_U(.0047) |
| 56 | #define SKYRAID_C46 CAP_U(.001) |
| 57 | #define SKYRAID_C48 CAP_U(.0047) |
| 58 | #define SKYRAID_C49 CAP_U(.1) |
| 59 | #define SKYRAID_C50 CAP_U(.001) |
| 60 | #define SKYRAID_C51 CAP_U(.01) |
| 61 | #define SKYRAID_C68 CAP_U(10) |
| 62 | #define SKYRAID_C85 CAP_U(.068) |
| 63 | #define SKYRAID_C86 CAP_U(.1) |
| 64 | #define SKYRAID_C93 CAP_U(.1) |
| 65 | |
| 66 | |
| 67 | static const discrete_lfsr_desc skyraid_lfsr = |
| 68 | { |
| 69 | DISC_CLK_IS_FREQ, |
| 70 | 16, /* Bit Length */ |
| 71 | 0, /* Reset Value */ |
| 72 | 0, /* Use Bit 0 as XOR input 0 */ |
| 73 | 14, /* Use Bit 14 as XOR input 1 */ |
| 74 | DISC_LFSR_XNOR, /* Feedback stage1 is XNOR */ |
| 75 | DISC_LFSR_OR, /* Feedback stage2 is just stage 1 output OR with external feed */ |
| 76 | DISC_LFSR_REPLACE, /* Feedback stage3 replaces the shifted register contents */ |
| 77 | 0x000001, /* Everything is shifted into the first bit only */ |
| 78 | DISC_LFSR_FLAG_RESET_TYPE_H, /* Output is not inverted */ |
| 79 | 15 /* Output bit */ |
| 80 | }; |
| 81 | |
| 82 | static const discrete_op_amp_filt_info skyraid_explosion_filter = |
| 83 | { |
| 84 | SKYRAID_R85, 0, SKYRAID_R86, 0, SKYRAID_R110, /* r1, r2, r3, r4, rF*/ |
| 85 | SKYRAID_C85, SKYRAID_C86, 0, /* c1, c2, c3 */ |
| 86 | 0, 12, -5, /* vRef, vP, vN */ |
| 87 | }; |
| 88 | |
| 89 | static const discrete_566_desc skyraid_566_desc = |
| 90 | { |
| 91 | DISC_566_OUT_LOGIC, |
| 92 | 5, /* v_pos */ |
| 93 | -5, /* v_neg */ |
| 94 | 5 /* v_charge */ |
| 95 | }; |
| 96 | |
| 97 | static const discrete_dac_r1_ladder skyraid_plane_dac = |
| 98 | { |
| 99 | 2, {SKYRAID_R28, SKYRAID_R27}, |
| 100 | 0, 0, 0, 0 /* no vBias, rBias, rGnd, cFilter */ |
| 101 | }; |
| 102 | |
| 103 | static const discrete_mixer_desc skyraid_mixer = |
| 104 | { |
| 105 | DISC_MIXER_IS_RESISTOR, |
| 106 | {SKYRAID_R120, SKYRAID_R32, SKYRAID_R29, SKYRAID_R30, SKYRAID_R31, RES_2_PARALLEL(SKYRAID_R28, SKYRAID_R27)}, |
| 107 | {0, 0, 0, 0, 0, SKYRAID_PLANE_ON__IC_E8}, /* r_nodes */ |
| 108 | {0}, 0, 0, 0, 0, 0, 1 /* no c, rI, rF, cF, cAmp, vRef, gain */ |
| 109 | }; |
| 110 | |
| 111 | |
| 112 | /************************************************************************ |
| 113 | * |
| 114 | * Custom skyraid explosion charge |
| 115 | * |
| 116 | * input[0] - In1 (Logic) |
| 117 | * input[1] - In2 (Logic) |
| 118 | * input[2] - R |
| 119 | * input[3] - C |
| 120 | * |
| 121 | * 5V |
| 122 | * v |
| 123 | * | |
| 124 | * .-------. |
| 125 | * | 4066 | |
| 126 | * In1 >---|c | |
| 127 | * '-------' |
| 128 | * | |
| 129 | * +------------. |
| 130 | * | | |
| 131 | * .-------. --- C |
| 132 | * | 4066 | --- |
| 133 | * In2 >---|c | | |
| 134 | * '-------' gnd |
| 135 | * | |
| 136 | * +----> Node Output |
| 137 | * | |
| 138 | * Z |
| 139 | * Z R |
| 140 | * Z |
| 141 | * | |
| 142 | * gnd |
| 143 | * |
| 144 | ************************************************************************/ |
| 145 | #define SKYRAID_EXPLOSION_CUSTOM_IN1 DISCRETE_INPUT(0) |
| 146 | #define SKYRAID_EXPLOSION_CUSTOM_IN2 DISCRETE_INPUT(1) |
| 147 | #define SKYRAID_EXPLOSION_CUSTOM_R DISCRETE_INPUT(2) |
| 148 | #define SKYRAID_EXPLOSION_CUSTOM_C DISCRETE_INPUT(3) |
| 149 | |
| 150 | #define SKYRAID_4066_R_ON 270 |
| 151 | |
| 152 | struct skyraid_explosion_custom_charge_context |
| 153 | { |
| 154 | double v_cap; |
| 155 | double v_charge_1_2; |
| 156 | double v_drop; |
| 157 | double exp_1; |
| 158 | double exp_1_2; |
| 159 | double exp_2; |
| 160 | }; |
| 161 | |
| 162 | static DISCRETE_STEP( skyraid_explosion_custom_charge ) |
| 163 | { |
| 164 | struct skyraid_explosion_custom_charge_context *context = (struct skyraid_explosion_custom_charge_context *)node->context; |
| 165 | |
| 166 | if (SKYRAID_EXPLOSION_CUSTOM_IN1 == 0) |
| 167 | if (SKYRAID_EXPLOSION_CUSTOM_IN2 == 0) |
| 168 | /* cap is floating and does not change charge */ |
| 169 | /* output is pulled to ground */ |
| 170 | node->output[0] = 0; |
| 171 | else |
| 172 | { |
| 173 | /* cap is discharged */ |
| 174 | context->v_cap -= context->v_cap * context->exp_2; |
| 175 | node->output[0] = context->v_cap * context->v_drop; |
| 176 | } |
| 177 | else |
| 178 | if (SKYRAID_EXPLOSION_CUSTOM_IN2 == 0) |
| 179 | { |
| 180 | /* cap is charged */ |
| 181 | context->v_cap += (5.0 - context->v_cap) * context->exp_1; |
| 182 | /* output is pulled to ground */ |
| 183 | node->output[0] = 0; |
| 184 | } |
| 185 | else |
| 186 | { |
| 187 | /* cap is charged slightly less */ |
| 188 | context->v_cap += (context->v_charge_1_2 - context->v_cap) * context->exp_1_2; |
| 189 | node->output[0] = context->v_cap * context->v_drop; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | static DISCRETE_RESET( skyraid_explosion_custom_charge ) |
| 194 | { |
| 195 | struct skyraid_explosion_custom_charge_context *context = (struct skyraid_explosion_custom_charge_context *)node->context; |
| 196 | |
| 197 | /* the charging voltage across the cap based on in2*/ |
| 198 | context->v_drop = RES_VOLTAGE_DIVIDER(SKYRAID_4066_R_ON, SKYRAID_4066_R_ON + SKYRAID_EXPLOSION_CUSTOM_R); |
| 199 | context->v_charge_1_2 = 5.0 * context->v_drop; |
| 200 | context->v_cap = 0; |
| 201 | |
| 202 | /* precalculate charging exponents */ |
| 203 | /* discharge cap - in1 = 0, in2 = 1*/ |
| 204 | context->exp_2 = RC_CHARGE_EXP((SKYRAID_4066_R_ON + SKYRAID_EXPLOSION_CUSTOM_R) * SKYRAID_EXPLOSION_CUSTOM_C); |
| 205 | /* charge cap - in1 = 1, in2 = 0 */ |
| 206 | context->exp_1 = RC_CHARGE_EXP(SKYRAID_4066_R_ON * SKYRAID_EXPLOSION_CUSTOM_C); |
| 207 | /* charge cap - in1 = 1, in2 = 1 */ |
| 208 | context->exp_1_2 = RC_CHARGE_EXP(RES_2_PARALLEL(SKYRAID_4066_R_ON, SKYRAID_4066_R_ON + SKYRAID_EXPLOSION_CUSTOM_R) * SKYRAID_EXPLOSION_CUSTOM_C); |
| 209 | |
| 210 | /* starts at 0 until cap starts charging */ |
| 211 | node->output[0] = 0; |
| 212 | } |
| 213 | |
| 214 | static const discrete_custom_info skyraid_explosion_custom_charge = |
| 215 | { |
| 216 | DISCRETE_CUSTOM_MODULE(skyraid_explosion_custom_charge, struct skyraid_explosion_custom_charge_context), |
| 217 | NULL |
| 218 | }; |
| 219 | |
| 220 | |
| 221 | /************************************************************************ |
| 222 | * |
| 223 | * Custom skyraid missle charge |
| 224 | * |
| 225 | * input[0] - In1 (Logic) |
| 226 | * input[1] - R1 |
| 227 | * input[2] - R2 |
| 228 | * input[3] - R3 |
| 229 | * input[4] - C |
| 230 | * |
| 231 | * 12V 5V |
| 232 | * v v |
| 233 | * | | |
| 234 | * Z --- |
| 235 | * Z R1 ^ 1N914 |
| 236 | * Z / \ Diode |
| 237 | * | ----- |
| 238 | * | | |
| 239 | * +--------------+ |
| 240 | * | | |
| 241 | * --- Z |
| 242 | * --- C Z R2 |
| 243 | * | Z |
| 244 | * | | |
| 245 | * +--------------+----> Node Output |
| 246 | * | |
| 247 | * Z |
| 248 | * Z R3 |
| 249 | * O.C. Z |
| 250 | * |\ | |
| 251 | * In1 >--| o--+ |
| 252 | * |/ |
| 253 | * |
| 254 | ************************************************************************/ |
| 255 | #define SKYRAID_MISSLE_CUSTOM_IN1 DISCRETE_INPUT(0) |
| 256 | #define SKYRAID_MISSLE_CUSTOM_R1 DISCRETE_INPUT(1) |
| 257 | #define SKYRAID_MISSLE_CUSTOM_R2 DISCRETE_INPUT(2) |
| 258 | #define SKYRAID_MISSLE_CUSTOM_R3 DISCRETE_INPUT(3) |
| 259 | #define SKYRAID_MISSLE_CUSTOM_C DISCRETE_INPUT(4) |
| 260 | |
| 261 | struct skyraid_missle_custom_charge_context |
| 262 | { |
| 263 | double v_charge[2]; |
| 264 | double v_cap; |
| 265 | double exp[2]; |
| 266 | }; |
| 267 | |
| 268 | /* the high charge is clamped by the diode to 0.7V above the 5V line */ |
| 269 | #define SKYRAID_MISSLE_CHARGE_PLUS (5.0 + 0.7) |
| 270 | |
| 271 | static DISCRETE_STEP( skyraid_missle_custom_charge ) |
| 272 | { |
| 273 | struct skyraid_missle_custom_charge_context *context = (struct skyraid_missle_custom_charge_context *)node->context; |
| 274 | |
| 275 | int in_1 = (SKYRAID_MISSLE_CUSTOM_IN1 == 0) ? 0 : 1; |
| 276 | |
| 277 | /* charge/discharge cap */ |
| 278 | context->v_cap += (context->v_charge[in_1] - context->v_cap) * context->exp[in_1]; |
| 279 | |
| 280 | node->output[0] = SKYRAID_MISSLE_CHARGE_PLUS - context->v_cap; |
| 281 | } |
| 282 | |
| 283 | static DISCRETE_RESET( skyraid_missle_custom_charge ) |
| 284 | { |
| 285 | struct skyraid_missle_custom_charge_context *context = (struct skyraid_missle_custom_charge_context *)node->context; |
| 286 | |
| 287 | /* everything is based on the input to the O.C. inverter */ |
| 288 | |
| 289 | /* the charging voltage across the cap */ |
| 290 | context->v_charge[0] = 0; |
| 291 | context->v_charge[1] = SKYRAID_MISSLE_CHARGE_PLUS * RES_VOLTAGE_DIVIDER(SKYRAID_MISSLE_CUSTOM_R1 + SKYRAID_MISSLE_CUSTOM_R2, SKYRAID_MISSLE_CUSTOM_R3); |
| 292 | context->v_charge[1] = SKYRAID_MISSLE_CHARGE_PLUS - context->v_charge[1]; |
| 293 | context->v_cap = 0; |
| 294 | |
| 295 | /* precalculate charging exponents */ |
| 296 | /* discharge cap */ |
| 297 | context->exp[0] = RC_CHARGE_EXP(SKYRAID_MISSLE_CUSTOM_R2 * SKYRAID_MISSLE_CUSTOM_C); |
| 298 | /* charge cap */ |
| 299 | context->exp[1] = RC_CHARGE_EXP(RES_2_PARALLEL(SKYRAID_MISSLE_CUSTOM_R1 + SKYRAID_MISSLE_CUSTOM_R2, SKYRAID_MISSLE_CUSTOM_R3) * SKYRAID_MISSLE_CUSTOM_C); |
| 300 | |
| 301 | /* starts at full voltage until cap starts charging */ |
| 302 | node->output[0] = SKYRAID_MISSLE_CHARGE_PLUS; |
| 303 | } |
| 304 | |
| 305 | static const discrete_custom_info skyraid_missle_custom_charge = |
| 306 | { |
| 307 | DISCRETE_CUSTOM_MODULE( skyraid_missle_custom_charge, struct skyraid_missle_custom_charge_context), |
| 308 | NULL |
| 309 | }; |
| 310 | |
| 311 | |
| 312 | DISCRETE_SOUND_START( skyraid ) |
| 313 | /************************************************ |
| 314 | * Input register mapping |
| 315 | ************************************************/ |
| 316 | /* convert the PLANE_SWEEP line to voltage*/ |
| 317 | DISCRETE_INPUTX_LOGIC(SKYRAID_PLANE_SWEEP_EN, DEFAULT_TTL_V_LOGIC_1 * RES_VOLTAGE_DIVIDER(SKYRAID_R25, SKYRAID_R24), 0, 0) |
| 318 | DISCRETE_INPUT_LOGIC(SKYRAID_MISSILE_EN) |
| 319 | DISCRETE_INPUT_LOGIC(SKYRAID_EXPLOSION_EN) |
| 320 | /* convert PLANE_ON into 4066 Ron value of 270 ohms @ 5V */ |
| 321 | DISCRETE_INPUTX_LOGIC(SKYRAID_PLANE_ON__IC_E8, 270, 0, 0) |
| 322 | DISCRETE_INPUT_LOGIC(SKYRAID_ATTRACT_EN) |
| 323 | |
| 324 | /************************************************ |
| 325 | * Noise Generator, Explosion sound |
| 326 | ************************************************/ |
| 327 | /* Note: the noise reset is not emulated 100% accurate */ |
| 328 | /* According to the schematics, Attract only clears the lower 8 bits. */ |
| 329 | /* I may modify the noise module in the future to properly emulate this, */ |
| 330 | /* but you will never hear the difference. */ |
| 331 | /* It only wrong for 8 cycles of the 555 while no sound is being generated. */ |
| 332 | DISCRETE_LFSR_NOISE(SKYRAID_NOISE, /* IC F7, pin 13 */ |
| 333 | 1, /* ENAB */ |
| 334 | SKYRAID_ATTRACT_EN, /* RESET */ |
| 335 | 1.49 / ((SKYRAID_R20 + 2 * SKYRAID_R19) * SKYRAID_C51), /* CLK - 555 astable source */ |
| 336 | 1, 0, 0.5, &skyraid_lfsr) /* AMPL,FEED,BIAS,LFSRTB */ |
| 337 | |
| 338 | DISCRETE_LOGIC_NOR(NODE_20, SKYRAID_EXPLOSION_EN, SKYRAID_NOISE) |
| 339 | DISCRETE_CUSTOM4(NODE_21, SKYRAID_EXPLOSION_EN, NODE_20, RES_2_PARALLEL(SKYRAID_R84, SKYRAID_R85 + SKYRAID_R86), SKYRAID_C68, &skyraid_explosion_custom_charge) |
| 340 | DISCRETE_OP_AMP_FILTER(NODE_22, |
| 341 | 1, /* ENAB */ |
| 342 | NODE_21, 0, /* INP0,INP1 */ |
| 343 | DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &skyraid_explosion_filter) /* TYPE,INFO */ |
| 344 | /* IC E10, pin 14 gain and clipping */ |
| 345 | DISCRETE_GAIN(NODE_23, NODE_22, SKYRAID_R119 / SKYRAID_R121 + 1) |
| 346 | DISCRETE_CLAMP(SKYRAID_EXPLOSION_SND, 1, NODE_23, -5, 12.0 - 1.5, 0) |
| 347 | |
| 348 | /************************************************ |
| 349 | * Jet, Plane sound |
| 350 | ************************************************/ |
| 351 | DISCRETE_RCFILTER(NODE_30, /* IC J6, pin 5 */ |
| 352 | 1, /* ENAB */ |
| 353 | SKYRAID_PLANE_SWEEP_EN, /* IN0 */ |
| 354 | RES_2_PARALLEL(SKYRAID_R25, SKYRAID_R24), SKYRAID_C49) |
| 355 | DISCRETE_566(NODE_31, /* IC J6, pin 3 */ |
| 356 | NODE_30, /* VMOD */ |
| 357 | SKYRAID_R18, SKYRAID_C48, &skyraid_566_desc) |
| 358 | DISCRETE_LOGIC_SHIFT(NODE_32, /* IC H7, J7 output */ |
| 359 | SKYRAID_NOISE, /* IC H7, J7 pins 1 & 2 */ |
| 360 | 1, NODE_31, 16, /* RESET, CLK, SIZE */ |
| 361 | DISC_LOGIC_SHIFT__RESET_L | DISC_LOGIC_SHIFT__LEFT | DISC_CLK_ON_R_EDGE) |
| 362 | /* move bits together for ease of use */ |
| 363 | DISCRETE_TRANSFORM4(NODE_33, NODE_32, 1, 1 << 14, 2, "01&02/3&|") |
| 364 | DISCRETE_DAC_R1(SKYRAID_PLANE_SND, |
| 365 | NODE_33, /* DATA */ |
| 366 | DEFAULT_TTL_V_LOGIC_1, &skyraid_plane_dac) |
| 367 | DISCRETE_BIT_DECODE(SKYRAID_JET_A_SND, NODE_32, 0, DEFAULT_TTL_V_LOGIC_1) /* IC H7, pin 3 */ |
| 368 | DISCRETE_BIT_DECODE(SKYRAID_JET_B_SND, NODE_32, 15, DEFAULT_TTL_V_LOGIC_1) /* IC J7, pin 13 */ |
| 369 | |
| 370 | /************************************************ |
| 371 | * Missle sound |
| 372 | ************************************************/ |
| 373 | DISCRETE_CUSTOM5(NODE_40, SKYRAID_MISSILE_EN, SKYRAID_R12, SKYRAID_R14, SKYRAID_R13, SKYRAID_C44, &skyraid_missle_custom_charge) |
| 374 | DISCRETE_566(NODE_41, /* IC K6, pin 3 */ |
| 375 | NODE_40, /* VMOD */ |
| 376 | SKYRAID_R16, SKYRAID_C45, &skyraid_566_desc) |
| 377 | DISCRETE_LOGIC_SHIFT(NODE_42, /* IC K7, L7 output */ |
| 378 | SKYRAID_NOISE, /* IC K7, L7 pins 1 & 2 */ |
| 379 | 1, NODE_41, 16, /* RESET, CLK, SIZE */ |
| 380 | DISC_LOGIC_SHIFT__RESET_L | DISC_LOGIC_SHIFT__LEFT | DISC_CLK_ON_R_EDGE) |
| 381 | DISCRETE_BIT_DECODE(SKYRAID_MSL_A_SND, NODE_42, 0, DEFAULT_TTL_V_LOGIC_1) /* IC K7, pin 3 */ |
| 382 | DISCRETE_BIT_DECODE(SKYRAID_MSL_B_SND, NODE_42, 15, DEFAULT_TTL_V_LOGIC_1) /* IC L7, pin 13 */ |
| 383 | |
| 384 | /************************************************ |
| 385 | * Final Mix |
| 386 | ************************************************/ |
| 387 | DISCRETE_LOGIC_INVERT(NODE_91, SKYRAID_ATTRACT_EN) |
| 388 | DISCRETE_MIXER6(NODE_92, |
| 389 | NODE_91, /* ENAB */ |
| 390 | SKYRAID_EXPLOSION_SND, |
| 391 | SKYRAID_JET_A_SND, |
| 392 | SKYRAID_JET_B_SND, |
| 393 | SKYRAID_MSL_A_SND, |
| 394 | SKYRAID_MSL_B_SND, |
| 395 | SKYRAID_PLANE_SND, |
| 396 | &skyraid_mixer) |
| 397 | DISCRETE_CRFILTER(NODE_93, |
| 398 | 1, /* ENAB */ |
| 399 | NODE_92, /* IN0 */ |
| 400 | SKYRAID_R122 + RES_6_PARALLEL(SKYRAID_R120, SKYRAID_R32, SKYRAID_R29, SKYRAID_R30, SKYRAID_R31, RES_2_PARALLEL(SKYRAID_R27, SKYRAID_R28)), |
| 401 | SKYRAID_C93) |
| 402 | /* IC E10, pin 1 gain and clipping */ |
| 403 | DISCRETE_GAIN(NODE_94, NODE_93, - SKYRAID_R118 / (SKYRAID_R122 + RES_5_PARALLEL(SKYRAID_R120, SKYRAID_R32, SKYRAID_R29, SKYRAID_R30, SKYRAID_R31))) |
| 404 | DISCRETE_CLAMP(NODE_95, 1, NODE_94, -5, 12.0 - 1.5, 0) |
| 405 | DISCRETE_OUTPUT(NODE_95, 32700.0/12) |
| 406 | DISCRETE_SOUND_END |
| 407 | |
| 408 | |
| 409 | WRITE8_DEVICE_HANDLER( skyraid_sound_w ) |
| 410 | { |
| 411 | /* BIT0 => PLANE SWEEP */ |
| 412 | /* BIT1 => MISSILE */ |
| 413 | /* BIT2 => EXPLOSION */ |
| 414 | /* BIT3 => START LAMP */ |
| 415 | /* BIT4 => PLANE ON */ |
| 416 | /* BIT5 => ATTRACT */ |
| 417 | |
| 418 | discrete_sound_w(device, SKYRAID_PLANE_SWEEP_EN, data & 0x01); |
| 419 | discrete_sound_w(device, SKYRAID_MISSILE_EN, data & 0x02); |
| 420 | discrete_sound_w(device, SKYRAID_EXPLOSION_EN, data & 0x04); |
| 421 | set_led_status(0, !(data & 0x08)); |
| 422 | discrete_sound_w(device, SKYRAID_PLANE_ON_EN, data & 0x10); |
| 423 | discrete_sound_w(device, SKYRAID_ATTRACT_EN, data & 0x20); |
| 424 | } |
src/mame/drivers/nova2001.c
| r5891 | r5892 | |
| 386 | 386 | PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ninjakun_io_A002_ctrl_r, NULL) |
| 387 | 387 | |
| 388 | 388 | PORT_START("DSW1") |
| 389 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) |
| 389 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1") |
| 390 | 390 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 391 | 391 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) |
| 392 | | PORT_DIPNAME( 0x06, 0x04, DEF_STR( Lives ) ) |
| 392 | PORT_DIPNAME( 0x06, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3") |
| 393 | 393 | PORT_DIPSETTING( 0x02, "2" ) |
| 394 | 394 | PORT_DIPSETTING( 0x04, "3" ) |
| 395 | 395 | PORT_DIPSETTING( 0x06, "4" ) |
| 396 | 396 | PORT_DIPSETTING( 0x00, "5" ) |
| 397 | | PORT_DIPNAME( 0x08, 0x08, "First Bonus" ) |
| 397 | PORT_DIPNAME( 0x08, 0x08, "First Bonus" ) PORT_DIPLOCATION("SW1:4") |
| 398 | 398 | PORT_DIPSETTING( 0x08, "30000" ) |
| 399 | 399 | PORT_DIPSETTING( 0x00, "40000" ) |
| 400 | | PORT_DIPNAME( 0x30, 0x30, "Second Bonus" ) |
| 400 | PORT_DIPNAME( 0x30, 0x30, "Second Bonus" ) PORT_DIPLOCATION("SW1:5,6") |
| 401 | 401 | PORT_DIPSETTING( 0x00, "No Bonus" ) |
| 402 | 402 | PORT_DIPSETTING( 0x10, "Every 30000" ) |
| 403 | 403 | PORT_DIPSETTING( 0x30, "Every 50000" ) |
| 404 | 404 | PORT_DIPSETTING( 0x20, "Every 70000" ) |
| 405 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 405 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 406 | 406 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 407 | 407 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 408 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) ) |
| 408 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:8") |
| 409 | 409 | PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) |
| 410 | 410 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 411 | 411 | |
| 412 | 412 | PORT_START("DSW2") |
| 413 | | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) |
| 413 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3") |
| 414 | 414 | PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) |
| 415 | 415 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 416 | 416 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_2C ) ) |
| r5891 | r5892 | |
| 419 | 419 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_2C ) ) |
| 420 | 420 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) |
| 421 | 421 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) ) |
| 422 | | PORT_DIPNAME( 0x08, 0x08, "High Score Names" ) |
| 422 | PORT_DIPNAME( 0x08, 0x08, "High Score Names" ) PORT_DIPLOCATION("SW2:4") |
| 423 | 423 | PORT_DIPSETTING( 0x00, "3 Letters" ) |
| 424 | 424 | PORT_DIPSETTING( 0x08, "8 Letters" ) |
| 425 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Allow_Continue ) ) |
| 425 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") |
| 426 | 426 | PORT_DIPSETTING( 0x10, DEF_STR( No ) ) |
| 427 | 427 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 428 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )/* Probably Unused */ |
| 429 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 430 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 431 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) |
| 428 | PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:6" ) |
| 429 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:7") |
| 432 | 430 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 433 | 431 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 434 | | PORT_DIPNAME( 0x80, 0x80, "Infinite Lives (If Free Play)" ) |
| 432 | PORT_DIPNAME( 0x80, 0x80, "Infinite Lives (If Free Play)" ) PORT_DIPLOCATION("SW2:8") |
| 435 | 433 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 436 | 434 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 437 | 435 | INPUT_PORTS_END |
| r5891 | r5892 | |
| 458 | 456 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 459 | 457 | |
| 460 | 458 | PORT_START("IN2") |
| 461 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 462 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 463 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 464 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 465 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 466 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 467 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 468 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 469 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 470 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 471 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 472 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 473 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 474 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 475 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 476 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 477 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 478 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 479 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 480 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 481 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 482 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 483 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 484 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 459 | PORT_DIPUNKNOWN_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:1" ) |
| 460 | PORT_DIPUNKNOWN_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW1:2" ) |
| 461 | PORT_DIPUNKNOWN_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW1:3" ) |
| 462 | PORT_DIPUNKNOWN_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW1:4" ) |
| 463 | PORT_DIPUNKNOWN_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW1:5" ) |
| 464 | PORT_DIPUNKNOWN_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:6" ) |
| 465 | PORT_DIPUNKNOWN_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW1:7" ) |
| 466 | PORT_DIPUNKNOWN_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" ) |
| 485 | 467 | |
| 486 | 468 | PORT_START("DSW1") |
| 487 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) |
| 469 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2") |
| 488 | 470 | PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) |
| 489 | 471 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 490 | 472 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) |
| 491 | 473 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 492 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) |
| 474 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:3") |
| 493 | 475 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 494 | 476 | PORT_DIPSETTING( 0x04, DEF_STR( Cocktail ) ) |
| 495 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) |
| 477 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:4") |
| 496 | 478 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 497 | 479 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 498 | | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) |
| 480 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6") |
| 499 | 481 | PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) |
| 500 | 482 | PORT_DIPSETTING( 0x30, DEF_STR( Medium ) ) |
| 501 | 483 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) |
| 502 | 484 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 503 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) |
| 485 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:7") |
| 504 | 486 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 505 | 487 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 506 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) |
| 488 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:8") |
| 507 | 489 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 508 | 490 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 509 | 491 | INPUT_PORTS_END |
| r5891 | r5892 | |
| 530 | 512 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL |
| 531 | 513 | |
| 532 | 514 | PORT_START("IN2") |
| 533 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) |
| 515 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1") |
| 534 | 516 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 535 | 517 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) |
| 536 | | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) ) |
| 518 | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3") |
| 537 | 519 | PORT_DIPSETTING( 0x00, "2" ) |
| 538 | 520 | PORT_DIPSETTING( 0x06, "3" ) |
| 539 | 521 | PORT_DIPSETTING( 0x04, "4" ) |
| 540 | 522 | PORT_DIPSETTING( 0x02, "5" ) |
| 541 | | PORT_DIPNAME( 0x08, 0x08, "1st Bonus" ) |
| 523 | PORT_DIPNAME( 0x08, 0x08, "1st Bonus" ) PORT_DIPLOCATION("SW1:4") |
| 542 | 524 | PORT_DIPSETTING( 0x08, "30000" ) |
| 543 | 525 | PORT_DIPSETTING( 0x00, "40000" ) |
| 544 | | PORT_DIPNAME( 0x30, 0x30, "2nd Bonus" ) |
| 545 | | PORT_DIPSETTING( 0x30, "Every(?) 50000" ) |
| 546 | | PORT_DIPSETTING( 0x20, "Every(?) 70000" ) |
| 547 | | PORT_DIPSETTING( 0x10, "Every(?) 90000" ) |
| 526 | PORT_DIPNAME( 0x30, 0x30, "2nd Bonus" ) PORT_DIPLOCATION("SW1:5,6") |
| 527 | PORT_DIPSETTING( 0x30, "Every 50000" ) |
| 528 | PORT_DIPSETTING( 0x20, "Every 70000" ) |
| 529 | PORT_DIPSETTING( 0x10, "Every 90000" ) |
| 548 | 530 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) |
| 549 | | PORT_DIPNAME( 0x40, 0x40, "Exercise" ) |
| 531 | PORT_DIPNAME( 0x40, 0x40, "Exercise" ) PORT_DIPLOCATION("SW1:7") // Unused in manual |
| 550 | 532 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 551 | 533 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 552 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) ) |
| 534 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:8") |
| 553 | 535 | PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) |
| 554 | 536 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 555 | 537 | |
| 556 | 538 | PORT_START("DSW1") |
| 557 | | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) |
| 539 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3") |
| 558 | 540 | PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) |
| 559 | 541 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 560 | 542 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_2C ) ) |
| r5891 | r5892 | |
| 563 | 545 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_2C ) ) |
| 564 | 546 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) |
| 565 | 547 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) ) |
| 566 | | PORT_DIPNAME( 0x08, 0x08, "High Score Names" ) |
| 548 | PORT_DIPNAME( 0x08, 0x08, "High Score Names" ) PORT_DIPLOCATION("SW2:4") |
| 567 | 549 | PORT_DIPSETTING( 0x00, "3 Letters" ) |
| 568 | 550 | PORT_DIPSETTING( 0x08, "8 Letters" ) |
| 569 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) |
| 551 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") |
| 570 | 552 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 571 | 553 | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 572 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 573 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 574 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 575 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) |
| 554 | PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:6" ) |
| 555 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:7") // Unused in manual |
| 576 | 556 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 577 | 557 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 578 | | PORT_DIPNAME( 0x80, 0x80, "Unlimited Lives (If Free Play)" ) |
| 558 | PORT_DIPNAME( 0x80, 0x80, "Unlimited Lives (If Free Play)" ) PORT_DIPLOCATION("SW2:8") // Unused in manual |
| 579 | 559 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 580 | 560 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 581 | 561 | INPUT_PORTS_END |
src/mame/drivers/amaticmg.c
| r0 | r5892 | |
| 1 | /********************************************************************************** |
| 2 | |
| 3 | |
| 4 | AMATIC - MULTI GAME SYSTEM |
| 5 | -------------------------- |
| 6 | |
| 7 | Preliminary driver by Roberto Fresca. |
| 8 | |
| 9 | |
| 10 | Encrypted gambling hardware based on a custom CPU. |
| 11 | |
| 12 | |
| 13 | *********************************************************************************** |
| 14 | |
| 15 | |
| 16 | Hardware Notes |
| 17 | -------------- |
| 18 | |
| 19 | --------------------------------- |
| 20 | Board #1 (unknown slots game) |
| 21 | --------------------------------- |
| 22 | |
| 23 | 1x 40-pin custom CPU labeled: |
| 24 | |
| 25 | 0288 |
| 26 | 8012 (last digit is hard to read) |
| 27 | 11.12.96 |
| 28 | |
| 29 | 1x Unknown 40-pins IC (maybe 6845). |
| 30 | 1x Altera EPM5130LC (84-pins). |
| 31 | 1x KS82C55A (2x PPI). |
| 32 | 1x Unknown 40-pins IC (maybe another PPI). |
| 33 | |
| 34 | 1x Dallas DS1236-10 (micro manager). |
| 35 | 1x Push button. |
| 36 | |
| 37 | 1x Unknown 24-pin IC labeled SM64. |
| 38 | 1x Unknown 8-pin IC labeled SM65 (looks like a DAC). |
| 39 | 1x Unknown 8-pin IC no labeled (looks like a DAC). |
| 40 | 1x MC14538BCL (Dual precision monostable multivibrator). |
| 41 | 1x TDA2003 Audio Amp. |
| 42 | 1x Pot. |
| 43 | |
| 44 | 1x HY6264ALP-10 (RAM). |
| 45 | 1x HY62256ALP-10 (RAM). |
| 46 | |
| 47 | 1x 1mb ROM, near CPU. |
| 48 | 2x 27C512 ROMs. |
| 49 | 1x N82S147AN bipolar PROM. |
| 50 | |
| 51 | 1x Xtal 16 MHz. |
| 52 | 1x DIP switches bank (x8). |
| 53 | 1x Battery. |
| 54 | |
| 55 | 1x 2x17 male connector (like IDE ones). |
| 56 | 1x 2x8 contacts edge connector. |
| 57 | 1x 2x22 contacts edge connector. |
| 58 | |
| 59 | |
| 60 | ----------------------- |
| 61 | Multi-Game I v2.4 |
| 62 | ----------------------- |
| 63 | |
| 64 | 1x 40-pin custom CPU labeled: |
| 65 | |
| 66 | Amatic Trading GMBH |
| 67 | Lfnd. Nr. 1000 |
| 68 | Type: 801 I |
| 69 | Datum: 12.02.96 |
| 70 | |
| 71 | 1x GoldStar 6845S. |
| 72 | 1x Altera EPM5130LC (84-pins). |
| 73 | 3x PPI 8255AC-2. |
| 74 | |
| 75 | 1x Dallas DS1236-10 (micro manager). |
| 76 | 1x Push button. |
| 77 | |
| 78 | 1x Unknown 24-pin IC labeled K-666 9330. |
| 79 | 1x Unknown 8-pin IC labeled K-664 9432 (looks like a DAC). |
| 80 | 1x LM358P (8-pin). |
| 81 | 1x MC14538BCL (Dual precision monostable multivibrator). |
| 82 | 1x TDA2003 Audio Amp. |
| 83 | 1x Pot. |
| 84 | |
| 85 | 1x KM6264BL-7 (RAM). |
| 86 | 1x HY62256A-10 (RAM). |
| 87 | |
| 88 | 1x 27C2001 ROM labeled MGI V GER 3.9/I/8201. |
| 89 | 1x 27C4000 ROM labeled Multi 2.4 ZG1. |
| 90 | 1x 27C4001 ROM labeled Multi 2.4 ZG2. |
| 91 | 1x 27C4001 ROM labeled Multi 2.4 ZG3. |
| 92 | 2x N82S147AN bipolar PROMs. |
| 93 | |
| 94 | 1x Xtal 16 MHz. |
| 95 | 1x DIP switches bank (x8). |
| 96 | 1x Battery. |
| 97 | |
| 98 | 1x 2x17 male connector (like IDE ones). |
| 99 | 1x 2x36 contacts edge connector. |
| 100 | |
| 101 | |
| 102 | ------------------------- |
| 103 | Multi-Game III v3.5 |
| 104 | ------------------------- |
| 105 | |
| 106 | 1x 40-pin custom CPU labeled: |
| 107 | |
| 108 | Amatic |
| 109 | Lfnd. Nr. 99/5070 467 |
| 110 | Type: 80(1?) I |
| 111 | Datum: 10.01.00 |
| 112 | |
| 113 | 1x F68B45P. |
| 114 | 1x Altera EPM5130LC (84-pins). |
| 115 | 3x PPI NEC D71055C. |
| 116 | |
| 117 | 1x Dallas DS1236-5 (micro manager). |
| 118 | 1x Push button. |
| 119 | |
| 120 | 1x Yamaha YM3812. |
| 121 | 1x Yamaha Y3014B (DAC). |
| 122 | 1x LM358M (8-pin). |
| 123 | 1x MC14538 (Dual precision monostable multivibrator). |
| 124 | 1x TDA2003 (Audio Amp, Heatsinked). |
| 125 | 1x Pot. |
| 126 | |
| 127 | 1x HY6264A (RAM). |
| 128 | 1x KM62256 (RAM). |
| 129 | |
| 130 | 1x 27C2000 ROM labeled 'MG III VGer 3.5/I/8205'. |
| 131 | 1x 27C4000 ROM labeled 'MG III 51 ZG1'. |
| 132 | 1x 27C040 ROM labeled 'MG III 51 ZG2'. |
| 133 | 1x 27C040 ROM labeled 'MG III 51 ZG3'. |
| 134 | 1x 27C1024 labeled 'V' |
| 135 | |
| 136 | 1x Xtal 16 MHz. |
| 137 | 1x DIP switches bank (x8). |
| 138 | 1x Battery. |
| 139 | |
| 140 | 2x 2x17 male connector (like IDE ones). |
| 141 | 1x 2x36 contacts edge connector. |
| 142 | |
| 143 | |
| 144 | *********************************************************************************** |
| 145 | |
| 146 | |
| 147 | Memory Map |
| 148 | ---------- |
| 149 | |
| 150 | $00000 - $FFFFF Still unknown... |
| 151 | |
| 152 | |
| 153 | *********************************************************************************** |
| 154 | |
| 155 | +------------------------------------------------------------------------------+ |
| 156 | | AMATIC Standard Edge Connector (Videomat, Multigame) | |
| 157 | +----------------------------------------+-------------------------------------+ |
| 158 | | Component Side | Solder Side | |
| 159 | +-------------------+---------------+----+----+---------------+----------------+ |
| 160 | | Function | Direction | Nr | Nr | Direction | Function | |
| 161 | +-------------------+---------------+----+----+---------------+----------------+ |
| 162 | | Lamp-HOLD3 | OUTPUT | 36 | r | ------ | N/C | |
| 163 | | REMOTE-PL | OUTPUT | 35 | p | OUTPUT | COIN-INVERTER | |
| 164 | | REMOTE-CLOCK | OUTPUT | 34 | n | OUTPUT | D-OUT | |
| 165 | | D-IN | INPUT | 33 | m | SUPPLY | +5V | |
| 166 | | REMOTE-SELECT | INPUT | 32 | l | INPUT | ??? | |
| 167 | | N/C | ------ | 31 | k | INPUT | ??? | |
| 168 | | Coin-INPUT4 | INPUT | 30 | j | INPUT | ??? | |
| 169 | | GND | SUPPLY | 29 | h | SUPPLY | GND | |
| 170 | | HOPPER-RELAIS | OUTPUT | 28 | f | INPUT | ANTENNE | |
| 171 | | N/C | ------ | 27 | e | ------ | N/C | |
| 172 | | TICKET-OUT | OUTPUT | 26 | d | ------ | N/C | |
| 173 | | N/C | ------ | 25 | c | ------ | N/C | |
| 174 | | KEY-DATA | TTLINPUT | 24 | b | TTLINPUT | KEY-DATA | |
| 175 | | N/C | ------ | 23 | a | INPUT | KEY-CONTACT | |
| 176 | | GND | SUPPLY | 22 | Z | SUPPLY | GND | |
| 177 | | GND | SUPPLY | 21 | Y | SUPPLY | GND | |
| 178 | | GND | SUPPLY | 20 | X | SUPPLY | GND | |
| 179 | | +5V | SUPPLY | 19 | W | SUPPLY | +5V | |
| 180 | | +12V | SUPPLY | 18 | V | SUPPLY | +12V | |
| 181 | | Lamp-HOLD1 | OUTPUT | 17 | U | OUTPUT | Lamp-START | |
| 182 | | Lamp-HOLD2 | OUTPUT | 16 | T | OUTPUT | Lamp-HOLD5 | |
| 183 | | Lamp-CANCEL | OUTPUT | 15 | S | OUTPUT | Lamp-HOLD4 | |
| 184 | | Coin-INPUT1 | INPUT | 14 | R | OUTPUT | HOPPER-OUT | |
| 185 | | Mech. Counter-IN | OUTPUT | 13 | P | INPUT | REMOTE | |
| 186 | | Mech. Counter-OUT | OUTPUT | 12 | N | INPUT | Button-HOLD1 | |
| 187 | | Mech. Counter-EXT | OUTPUT | 11 | M | INPUT | Button-CANCEL | |
| 188 | | Button-HOLD5 | INPUT | 10 | L | INPUT | Button-START | |
| 189 | | Bookkeeping 2 | INPUT | 09 | K | INPUT | Bookkeeping 1 | |
| 190 | | Button-HOLD2 | INPUT | 08 | J | INPUT | Button-HOLD4 | |
| 191 | | Button-HOPPER-OUT | INPUT | 07 | H | INPUT | Button-HOLD3 | |
| 192 | | HOPPER-COUNT | INPUT | 06 | F | ------ | N/C | |
| 193 | | Coin-INPUT3 | INPUT | 05 | E | INPUT | Coin-INPUT2 | |
| 194 | | Monitor-GREEN | TTLOUT-Analog | 04 | D | TTLOUT-Analog | Monitor-RED | |
| 195 | | Monitor-SYNC | TTLOUT-Analog | 03 | C | TTLOUT-Analog | Monitor-BLUE | |
| 196 | | SPEAKER | OUT-Analog | 02 | B | SUPPLY | Monitor-GND | |
| 197 | | CREDIT-CLEAR | INPUT | 01 | A | SUPPLY | SPEAKER-GND | |
| 198 | +-------------------+---------------+----+----+---------------+----------------+ |
| 199 | |
| 200 | *********************************************************************************** |
| 201 | |
| 202 | |
| 203 | Findings about the encryption scheme |
| 204 | ------------------------------------ |
| 205 | |
| 206 | The program ROM is encrypted, but... The programmers left the cow out... |
| 207 | They left some blank spaces that allow see some encryption patterns. |
| 208 | |
| 209 | |
| 210 | Example: |
| 211 | |
| 212 | |
| 213 | 1) A string of 4 consecutive values with relation between them, is repeated once. |
| 214 | Then the whole string is repeated again, but with bit 3 XOR'ed. |
| 215 | |
| 216 | +------------ value1 |
| 217 | | +--------- value2 = value1 ^ 0x88 |
| 218 | | | +------ value3 = value1 ^ 0x22 |
| 219 | | | | +--- value4 = value1 ^ 0x22 ^ 0x88 |
| 220 | | | | | |
| 221 | | | | | |
| 222 | |
| 223 | $E000: AF 27 8D 05 AF 27 8D 05 A7 2F 85 0D A7 2F 85 0D |
| 224 | +-----------+ +-----------+ | | |
| 225 | string1 string1 | | |
| 226 | +-------------------------+ +------------------------+ |
| 227 | string2 string2 ^ 0x08 |
| 228 | +----------------------------------------------------+ |
| 229 | string3 |
| 230 | |
| 231 | |
| 232 | 3) Then, all the E000-E00F range repeats in E010-E01F, but with bit 2 XOR'ed. |
| 233 | |
| 234 | $E010: AB 23 89 01 AB 23 89 01 A3 2B 81 09 A3 2B 81 09 |
| 235 | +-----------------------------------------------+ |
| 236 | string3 ^ 0x04 |
| 237 | |
| 238 | |
| 239 | 4) Then repeat all the E000-E01F range... |
| 240 | |
| 241 | $E000: AF 27 8D 05 AF 27 8D 05 A7 2F 85 0D A7 2F 85 0D |
| 242 | $E010: AB 23 89 01 AB 23 89 01 A3 2B 81 09 A3 2B 81 09 |
| 243 | |
| 244 | $E020: AF 27 8D 05 AF 27 8D 05 A7 2F 85 0D A7 2F 85 0D |
| 245 | $E030: AB 23 89 01 AB 23 89 01 A3 2B 81 09 A3 2B 81 09 |
| 246 | |
| 247 | |
| 248 | 5) Then the original value changes (0xAF -> 0x63), using the same algorithm |
| 249 | (steps 1-4) for the next 0x40 bytes... |
| 250 | |
| 251 | $E040: 63 EB 41 C9 63 EB 41 C9 6B E3 49 C1 6B E3 49 C1 |
| 252 | $E050: 67 EF 45 CD 67 EF 45 CD 6F E7 4D C5 6F E7 4D C5 |
| 253 | $E060: 63 EB 41 C9 63 EB 41 C9 6B E3 49 C1 6B E3 49 C1 |
| 254 | $E070: 67 EF 45 CD 67 EF 45 CD 6F E7 4D C5 6F E7 4D C5 |
| 255 | |
| 256 | Repeat step (5) ...till $E0FF. |
| 257 | |
| 258 | |
| 259 | The encryption pattern repeats for the next 0x100 bytes, so the E000-E0FF range is repeated |
| 260 | in E100-E1FF. Then the original values changes again, creating another block of 0x200 bytes. |
| 261 | |
| 262 | And so on.... |
| 263 | |
| 264 | |
| 265 | *********************************************************************************** |
| 266 | |
| 267 | |
| 268 | [2009/09/11] |
| 269 | |
| 270 | - Initial release. |
| 271 | - Added hardware specs from PCB pictures. Figured out some components. |
| 272 | - Added findings about the encryption scheme. |
| 273 | - Decoded 2 graphics bitplanes. |
| 274 | - Added pre-defined clocks. |
| 275 | - Added technical notes. |
| 276 | |
| 277 | |
| 278 | *** TO DO *** |
| 279 | |
| 280 | - Decrypt the program ROMs. |
| 281 | - Identify the CPU type. |
| 282 | - Memory map. |
| 283 | - Hook the remaining GFX bitplanes. |
| 284 | - CRTC |
| 285 | - Proper inputs. |
| 286 | - Color decode routines. |
| 287 | - Sound support. |
| 288 | |
| 289 | |
| 290 | ***********************************************************************************/ |
| 291 | |
| 292 | |
| 293 | #define MASTER_CLOCK XTAL_16MHz |
| 294 | #define CPU_CLOCK MASTER_CLOCK/4 /* guess */ |
| 295 | #define SND_CLOCK MASTER_CLOCK/4 /* guess */ |
| 296 | #define CRTC_CLOCK MASTER_CLOCK/8 /* guess */ |
| 297 | |
| 298 | |
| 299 | #include "driver.h" |
| 300 | #include "cpu/z80/z80.h" |
| 301 | #include "video/mc6845.h" |
| 302 | #include "machine/8255ppi.h" |
| 303 | #include "sound/3812intf.h" |
| 304 | #include "sound/dac.h" |
| 305 | |
| 306 | |
| 307 | /************************************ |
| 308 | * Video Hardware * |
| 309 | ************************************/ |
| 310 | |
| 311 | static VIDEO_START( amaticmg ) |
| 312 | { |
| 313 | } |
| 314 | |
| 315 | static VIDEO_UPDATE( amaticmg ) |
| 316 | { |
| 317 | return 0; |
| 318 | } |
| 319 | |
| 320 | static PALETTE_INIT( amaticmg ) |
| 321 | { |
| 322 | } |
| 323 | |
| 324 | |
| 325 | /************************************ |
| 326 | * Read/Write Handlers * |
| 327 | ************************************/ |
| 328 | |
| 329 | |
| 330 | |
| 331 | /************************************ |
| 332 | * Memory Map Information * |
| 333 | ************************************/ |
| 334 | |
| 335 | static ADDRESS_MAP_START( amaticmg_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 336 | AM_RANGE(0x00000, 0x3ffff) AM_ROM |
| 337 | // AM_RANGE(0x0000, 0x0000) AM_RAM // AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 338 | // AM_RANGE(0x0000, 0x0000) AM_DEVWRITE("crtc", mc6845_address_w) |
| 339 | // AM_RANGE(0x0000, 0x0000) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) |
| 340 | // AM_RANGE(0x0000, 0x0000) AM_RAM_WRITE(amaticmg_videoram_w) AM_BASE(&videoram) |
| 341 | // AM_RANGE(0x0000, 0x0000) AM_RAM_WRITE(amaticmg_colorram_w) AM_BASE(&colorram) |
| 342 | ADDRESS_MAP_END |
| 343 | |
| 344 | static ADDRESS_MAP_START( amaticmg_portmap, ADDRESS_SPACE_IO, 8 ) |
| 345 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 346 | // AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w) |
| 347 | // AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w) |
| 348 | // AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w) |
| 349 | // AM_RANGE(0x00, 0x00) AM_DEVWRITE("ym", ym3812_w) |
| 350 | // AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac1", dac_signed_w) |
| 351 | // AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac2", dac_signed_w) |
| 352 | |
| 353 | ADDRESS_MAP_END |
| 354 | |
| 355 | /* |
| 356 | Unknown R/W |
| 357 | ----------- |
| 358 | |
| 359 | |
| 360 | */ |
| 361 | |
| 362 | |
| 363 | /************************************ |
| 364 | * Input ports * |
| 365 | ************************************/ |
| 366 | |
| 367 | static INPUT_PORTS_START( amaticmg ) |
| 368 | PORT_START("IN0") |
| 369 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-1") PORT_CODE(KEYCODE_1) |
| 370 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-2") PORT_CODE(KEYCODE_2) |
| 371 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-3") PORT_CODE(KEYCODE_3) |
| 372 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-4") PORT_CODE(KEYCODE_4) |
| 373 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-5") PORT_CODE(KEYCODE_5) |
| 374 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-6") PORT_CODE(KEYCODE_6) |
| 375 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-7") PORT_CODE(KEYCODE_7) |
| 376 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-8") PORT_CODE(KEYCODE_8) |
| 377 | |
| 378 | PORT_START("IN1") |
| 379 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-1") PORT_CODE(KEYCODE_Q) |
| 380 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-2") PORT_CODE(KEYCODE_W) |
| 381 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-3") PORT_CODE(KEYCODE_E) |
| 382 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-4") PORT_CODE(KEYCODE_R) |
| 383 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-5") PORT_CODE(KEYCODE_T) |
| 384 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-6") PORT_CODE(KEYCODE_Y) |
| 385 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-7") PORT_CODE(KEYCODE_U) |
| 386 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-8") PORT_CODE(KEYCODE_I) |
| 387 | |
| 388 | PORT_START("IN2") |
| 389 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-1") PORT_CODE(KEYCODE_A) |
| 390 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-2") PORT_CODE(KEYCODE_S) |
| 391 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-3") PORT_CODE(KEYCODE_D) |
| 392 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-4") PORT_CODE(KEYCODE_F) |
| 393 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-5") PORT_CODE(KEYCODE_G) |
| 394 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-6") PORT_CODE(KEYCODE_H) |
| 395 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-7") PORT_CODE(KEYCODE_J) |
| 396 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-8") PORT_CODE(KEYCODE_K) |
| 397 | |
| 398 | PORT_START("IN3") |
| 399 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-1") PORT_CODE(KEYCODE_Z) |
| 400 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-2") PORT_CODE(KEYCODE_X) |
| 401 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-3") PORT_CODE(KEYCODE_C) |
| 402 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-4") PORT_CODE(KEYCODE_V) |
| 403 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-5") PORT_CODE(KEYCODE_B) |
| 404 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-6") PORT_CODE(KEYCODE_N) |
| 405 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-7") PORT_CODE(KEYCODE_M) |
| 406 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3-8") PORT_CODE(KEYCODE_L) |
| 407 | |
| 408 | PORT_START("SW1") |
| 409 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 410 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 411 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 412 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 413 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 414 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 415 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 416 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 417 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 418 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 419 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 420 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 421 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 422 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 423 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 424 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 425 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 426 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 427 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 428 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 429 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 430 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 431 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 432 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 433 | INPUT_PORTS_END |
| 434 | |
| 435 | |
| 436 | /************************************ |
| 437 | * Graphics Layouts * |
| 438 | ************************************/ |
| 439 | |
| 440 | static const gfx_layout charlayout = |
| 441 | { |
| 442 | /* Only 2 planes are hooked. This need to be fixed */ |
| 443 | |
| 444 | 4,8, |
| 445 | RGN_FRAC(1,2), |
| 446 | 2, |
| 447 | { RGN_FRAC(0,2), RGN_FRAC(0,2) + 4 }, |
| 448 | { 3, 2, 1, 0 }, /* tiles are x-flipped */ |
| 449 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 450 | 8*4*2 |
| 451 | }; |
| 452 | |
| 453 | |
| 454 | /************************************ |
| 455 | * Graphics Decode Information * |
| 456 | ************************************/ |
| 457 | |
| 458 | static GFXDECODE_START( amaticmg ) |
| 459 | GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 16 ) |
| 460 | GFXDECODE_END |
| 461 | |
| 462 | |
| 463 | /************************************ |
| 464 | * Sound Interface * |
| 465 | ************************************/ |
| 466 | |
| 467 | //static const ym3812_interface ym3812_config = |
| 468 | //{ |
| 469 | // sound_irq |
| 470 | //}; |
| 471 | |
| 472 | |
| 473 | /************************************ |
| 474 | * CRTC Interface * |
| 475 | ************************************/ |
| 476 | |
| 477 | //static const mc6845_interface mc6845_intf = |
| 478 | //{ |
| 479 | // "screen", /* screen we are acting on */ |
| 480 | // 8, /* number of pixels per video memory address */ |
| 481 | // NULL, /* before pixel update callback */ |
| 482 | // NULL, /* row update callback */ |
| 483 | // NULL, /* after pixel update callback */ |
| 484 | // DEVCB_NULL, /* callback for display state changes */ |
| 485 | // DEVCB_NULL, /* callback for cursor state changes */ |
| 486 | // DEVCB_NULL, /* HSYNC callback */ |
| 487 | // DEVCB_NULL, /* VSYNC callback */ |
| 488 | // NULL /* update address callback */ |
| 489 | //}; |
| 490 | |
| 491 | |
| 492 | /************************************ |
| 493 | * PPI 8255 (x3) Interface * |
| 494 | ************************************/ |
| 495 | |
| 496 | //static const ppi8255_interface ppi8255_intf[3] = |
| 497 | //{ |
| 498 | // { /* (00-00) Mode X - Port X set as input */ |
| 499 | // DEVCB_NULL, /* Port A read */ |
| 500 | // DEVCB_NULL, /* Port B read */ |
| 501 | // DEVCB_NULL, /* Port C read */ |
| 502 | // DEVCB_NULL, /* Port A write */ |
| 503 | // DEVCB_NULL, /* Port B write */ |
| 504 | // DEVCB_NULL, /* Port C write */ |
| 505 | // }, |
| 506 | // { /* (00-00) Mode X - Port X set as input */ |
| 507 | // DEVCB_NULL, /* Port A read */ |
| 508 | // DEVCB_NULL, /* Port B read */ |
| 509 | // DEVCB_NULL, /* Port C read */ |
| 510 | // DEVCB_NULL, /* Port A write */ |
| 511 | // DEVCB_NULL, /* Port B write */ |
| 512 | // DEVCB_NULL, /* Port C write */ |
| 513 | // }, |
| 514 | // { /* (00-00) Mode X - Port X set as input */ |
| 515 | // DEVCB_NULL, /* Port A read */ |
| 516 | // DEVCB_NULL, /* Port B read */ |
| 517 | // DEVCB_NULL, /* Port C read */ |
| 518 | // DEVCB_NULL, /* Port A write */ |
| 519 | // DEVCB_NULL, /* Port B write */ |
| 520 | // DEVCB_NULL, /* Port C write */ |
| 521 | // } |
| 522 | //}; |
| 523 | |
| 524 | /************************************ |
| 525 | * Machine Drivers * |
| 526 | ************************************/ |
| 527 | |
| 528 | static MACHINE_DRIVER_START( amaticmg ) |
| 529 | /* basic machine hardware */ |
| 530 | MDRV_CPU_ADD("maincpu", Z80, CPU_CLOCK) /* WRONG! */ |
| 531 | MDRV_CPU_PROGRAM_MAP(amaticmg_map) |
| 532 | MDRV_CPU_IO_MAP(amaticmg_portmap) |
| 533 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 534 | |
| 535 | // MDRV_NVRAM_HANDLER(generic_0fill) |
| 536 | |
| 537 | /* 3x 8255 */ |
| 538 | // MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] ) |
| 539 | // MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] ) |
| 540 | // MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] ) |
| 541 | |
| 542 | /* video hardware */ |
| 543 | MDRV_SCREEN_ADD("screen", RASTER) |
| 544 | MDRV_SCREEN_REFRESH_RATE(60) |
| 545 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 546 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 547 | MDRV_SCREEN_SIZE(512, 256) |
| 548 | MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) |
| 549 | |
| 550 | // MDRV_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) |
| 551 | |
| 552 | MDRV_GFXDECODE(amaticmg) |
| 553 | |
| 554 | MDRV_PALETTE_INIT(amaticmg) |
| 555 | MDRV_PALETTE_LENGTH(0x100) |
| 556 | MDRV_VIDEO_START(amaticmg) |
| 557 | MDRV_VIDEO_UPDATE(amaticmg) |
| 558 | |
| 559 | /* sound hardware */ |
| 560 | // MDRV_SPEAKER_STANDARD_MONO("mono") |
| 561 | |
| 562 | // MDRV_SOUND_ADD("ym", YM3812, SND_CLOCK) |
| 563 | // MDRV_SOUND_CONFIG(ym3812_config) |
| 564 | // MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 565 | |
| 566 | // MDRV_SOUND_ADD("dac", DAC, 0) /* Y3014B */ |
| 567 | // MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 568 | |
| 569 | MACHINE_DRIVER_END |
| 570 | |
| 571 | |
| 572 | /************************************ |
| 573 | * Rom Load * |
| 574 | ************************************/ |
| 575 | |
| 576 | ROM_START( am_uslot ) |
| 577 | ROM_REGION( 0x40000, "maincpu", 0 ) /* encrypted program ROM...*/ |
| 578 | ROM_LOAD( "u3.bin", 0x00000, 0x20000, CRC(29bf4a95) SHA1(a73873f7cd1fdf5accc3e79f4619949f261400b8) ) |
| 579 | |
| 580 | ROM_REGION( 0x20000, "gfx1", 0 ) /* There are only slots tiles. No chars inside */ |
| 581 | ROM_LOAD( "u9.bin", 0x00000, 0x10000, CRC(823a736a) SHA1(a5227e3080367736aac1198d9dbb55efc4114624) ) |
| 582 | ROM_LOAD( "u10.bin", 0x00000, 0x10000, CRC(6a811c81) SHA1(af01cd9b1ce6aca92df71febb05fe216b18cf42a) ) |
| 583 | |
| 584 | ROM_REGION( 0x0200, "proms", 0 ) |
| 585 | ROM_LOAD( "n82s147a.bin", 0x0000, 0x0200, CRC(dfeabd11) SHA1(21e8bbcf4aba5e4d672e5585890baf8c5bc77c98) ) |
| 586 | ROM_END |
| 587 | |
| 588 | |
| 589 | ROM_START( am_mg24 ) |
| 590 | ROM_REGION( 0x40000, "maincpu", 0 ) /* encrypted program ROM...*/ |
| 591 | ROM_LOAD( "mgi_vger_3.9-i-8201.i6.bin", 0x00000, 0x40000, CRC(9ce159f7) SHA1(101c277d579a69cb03f879288b2cecf838cf1741) ) |
| 592 | |
| 593 | ROM_REGION( 0x180000, "gfx1", 0 ) |
| 594 | ROM_LOAD( "multi_2.4_zg1.i17.bin", 0x000000, 0x80000, CRC(4a60a718) SHA1(626991abee768da58e87c7cdfc4fcbae86c6ea2a) ) |
| 595 | ROM_LOAD( "multi_2.4_zg2.i18.bin", 0x080000, 0x80000, CRC(b504e1b8) SHA1(ffa17a2c212eb2fffb89b131868e69430cb41203) ) |
| 596 | ROM_LOAD( "multi_2.4_zg3.i33.bin", 0x100000, 0x80000, CRC(9b66bb4d) SHA1(64035d2028a9b68164c87475a1ec9754453ad572) ) |
| 597 | |
| 598 | ROM_REGION( 0x0400, "proms", 0 ) |
| 599 | ROM_LOAD( "n82s147a_1.bin", 0x0000, 0x0200, NO_DUMP ) |
| 600 | ROM_LOAD( "n82s147a_2.bin", 0x0200, 0x0200, NO_DUMP ) |
| 601 | ROM_END |
| 602 | |
| 603 | ROM_START( am_mg3 ) |
| 604 | ROM_REGION( 0x40000, "maincpu", 0 ) /* encrypted program ROM...*/ |
| 605 | ROM_LOAD( "mg_iii_vger_3.5-i-8205.bin", 0x00000, 0x40000, CRC(21d64029) SHA1(d5c3fde02833a96dd7a43481a489bfc4a5c9609d) ) |
| 606 | |
| 607 | ROM_REGION( 0x180000, "gfx1", 0 ) |
| 608 | ROM_LOAD( "mg_iii_51_zg1.bin", 0x000000, 0x80000, CRC(84f86874) SHA1(c483a50df6a9a71ddfdf8530a894135f9b852b89) ) |
| 609 | ROM_LOAD( "mg_iii_51_zg2.bin", 0x080000, 0x80000, CRC(4425e535) SHA1(726c322c5d0b391b82e49dd1797ebf0abfa4a65a) ) |
| 610 | ROM_LOAD( "mg_iii_51_zg3.bin", 0x100000, 0x80000, CRC(36d4c0fa) SHA1(20352dbbb2ce2233be0f4f694ddf49b8f5d6a64f) ) |
| 611 | |
| 612 | ROM_REGION( 0x20000, "other", 0 ) |
| 613 | ROM_LOAD( "v.bin", 0x00000, 0x20000, CRC(524767e2) SHA1(03a108494f42365c820fdfbcba9496bda86f3081) ) |
| 614 | ROM_END |
| 615 | |
| 616 | |
| 617 | /************************************ |
| 618 | * Driver Initialization * |
| 619 | ************************************/ |
| 620 | |
| 621 | static DRIVER_INIT( amaticmg ) |
| 622 | { |
| 623 | |
| 624 | } |
| 625 | |
| 626 | |
| 627 | /************************************ |
| 628 | * Game Drivers * |
| 629 | ************************************/ |
| 630 | |
| 631 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ |
| 632 | GAME( 1996, am_uslot, 0, amaticmg, amaticmg, amaticmg, ROT0, "Amatic Trading GMBH", "Amatic Unknown Slots Game", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING ) |
| 633 | GAME( 2000, am_mg24, 0, amaticmg, amaticmg, amaticmg, ROT0, "Amatic Trading GMBH", "Multi Game I (V.Ger 2.4)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING ) |
| 634 | GAME( 2000, am_mg3, 0, amaticmg, amaticmg, amaticmg, ROT0, "Amatic Trading GMBH", "Multi Game III (V.Ger 3.5)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING ) |
src/mame/drivers/naomi.c
| r5891 | r5892 | |
| 729 | 729 | VGA - 15 pin VGA out connector @ 31.5kHz |
| 730 | 730 | SER - 9 pin Serial connector \ |
| 731 | 731 | VOL - Volume pot / These are on a small daughterboard that plugs into the main PCB via a multi-wire cable. |
| 732 | | CN3 - Unknown 10 pin connector labelled 'CN3' |
| 732 | CN3 - 10 pin Speaker output & Extension serial connector |
| 733 | 733 | 3V_BATT - Panasonic ML2020 3 Volt Coin Battery |
| 734 | 734 | |
| 735 | CN3 Pinout |
| 736 | Pin Function I/O Pin Function I/O |
| 737 | ---------------------------------------------- |
| 738 | 1 Stereo L (+) Out | 2 TXD Out |
| 739 | 3 Stereo L (-) Out | 4 RXD In |
| 740 | 5 Stereo R (+) Out | 6 GND - |
| 741 | 7 Stereo R (-) Out | 8 +5V Out |
| 742 | 9 No Connection | 10 No Connection |
| 743 | |
| 735 | 744 | The bottom of the PCB contains nothing significant except some connectors. One for the game cart, one for special controls |
| 736 | 745 | or I/O, one for a communication module, one for a cooling fan and one for the serial connection daughterboard. |
| 737 | 746 | |
| r5891 | r5892 | |
| 983 | 992 | --------------------------------------------------- |
| 984 | 993 | Extreme Hunting 2 Tournament Edition 317-0445-COM |
| 985 | 994 | |
| 995 | AW-NET Network Board |
| 996 | -------------------- |
| 997 | |
| 998 | Sammy |
| 999 | AM3AJG-01 |
| 1000 | LAN PCB |
| 1001 | 2003 |
| 1002 | SAMLAN Rev: D |
| 1003 | |-----------------------------------| |
| 1004 | | RJ45 | |
| 1005 | |PULSE | |
| 1006 | | 25Mz | |
| 1007 | | | |
| 1008 | | RTL8139CL+* CN* | |
| 1009 | | 315-6310* | |
| 1010 | | | |
| 1011 | | L46R | |
| 1012 | |-----------------------------------| |
| 1013 | Notes: |
| 1014 | * - Denotes those parts are on the other side of the PCB |
| 1015 | RJ45 - RJ45 network connector |
| 1016 | PULSE - Pulse H0011 10/100 LAN Magnetics Module (SOIC16) |
| 1017 | L46R - 93C46 compatible 128x8 EEPROM (SOIC8) |
| 1018 | RTL8139CL+ - Realtek RTL8139CL+ 3.3 volt Single Chip Fast Ethernet Controller with Power Management (QFP120) |
| 1019 | 315-6310 - Sega 315-6310 Custom IC (QFP100) |
| 1020 | CN - This connector plugs into the main board |
| 1021 | |
| 1022 | |
| 1023 | |
| 986 | 1024 | Gun Sub Board |
| 987 | 1025 | ------------- |
| 988 | 1026 | |
| r5891 | r5892 | |
| 2783 | 2821 | ROM_LOAD("mpr-21899.ic19",0x9800000, 0x0800000, CRC(14a4b87d) SHA1(33177dea88c6aec31e2c16c8d0d3f29c7ea772c5) ) |
| 2784 | 2822 | ROM_LOAD("mpr-21900.ic20",0xa000000, 0x0800000, CRC(81901130) SHA1(1573b5c4360e29ba1a4b4901af49d5399fa1e635) ) |
| 2785 | 2823 | ROM_LOAD("mpr-21901.ic21",0xa800000, 0x0800000, BAD_DUMP CRC(55dcbd6d) SHA1(9fec353f9e58016090e177f899a799e2e8fc7c9f) ) // returns bad in Naomi test mode |
| 2786 | | ROM_END |
| 2824 | ROM_END // ROM reads different each time and fails test mode on real h/w, need a new cart |
| 2787 | 2825 | |
| 2788 | 2826 | ROM_START( hotd2 ) |
| 2789 | 2827 | ROM_REGION( 0x200000, "maincpu", 0) |
| r5891 | r5892 | |
| 3005 | 3043 | ROM_LOAD("mpr-23712.ic8", 0x4000000, 0x0800000, CRC(154f10ce) SHA1(67f6ff297f77632efe1965a81ed9f5c7dfa7a6b3) ) |
| 3006 | 3044 | ROM_LOAD("mpr-23713.ic9", 0x4800000, 0x0800000, CRC(2969bac7) SHA1(5f1cf6ac726c2fe183d66e4022962e44592f9ccd) ) |
| 3007 | 3045 | ROM_LOAD("mpr-23714.ic10",0x5000000, 0x0800000, CRC(da462c44) SHA1(ca450b6c07f939f96eba7b44c45b4e38abd598aa) ) |
| 3008 | | ROM_LOAD("mpr-23715.ic11",0x5800000, 0x0800000, BAD_DUMP CRC(59dfd3ad) SHA1(bb8f7a1bcf16038b18f4485a6b6d81fa72ca7bd0) ) |
| 3009 | | |
| 3046 | ROM_LOAD("mpr-23715.ic11",0x5800000, 0x0800000, CRC(c750abbd) SHA1(2a5bedc2b21cd3f991c7145ccfd8c7a9e7f647ae) ) |
| 3010 | 3047 | // trojaned protection data |
| 3011 | 3048 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) |
| 3012 | 3049 | ROM_LOAD( "a3075ac0.bin", 0x000000, 0x00ff04, CRC(440dca2a) SHA1(4e261ff309e7e774fa2061de30174b0e4e967c00) ) |
| r5891 | r5892 | |
| 3230 | 3267 | ROM_LOAD("mpr-22033.ic9", 0x4800000, 0x0800000, CRC(5fe5586e) SHA1(3ff41ae1f81469597684faadd88e62b5e0634352) ) |
| 3231 | 3268 | ROM_LOAD("mpr-22034.ic10",0x5000000, 0x0800000, CRC(3aa5ce5e) SHA1(f00a906235e4522d6fc2ac771324114346875314) ) |
| 3232 | 3269 | |
| 3233 | | // trojaned protection data (filename is address read from) |
| 3234 | | ROM_REGION( 0x4000, "naomibd_prot", ROMREGION_ERASE00 ) |
| 3235 | | ROM_LOAD( "a0309000.bin", 0x000000, 0x000400, CRC(e4f8b4a2) SHA1(a0d54aa6e1ffd5b1db31002ee4a94943c2157a3e) ) |
| 3236 | | ROM_LOAD( "a0309500.bin", 0x001000, 0x000400, CRC(5d3a9b15) SHA1(30d55a686493bb2f5e7d2c7d7df3dedf2f93dff0) ) |
| 3237 | | ROM_LOAD( "a030a000.bin", 0x002000, 0x000400, CRC(22b88804) SHA1(7b53778ddbf360b364376f0358b0acfb689e8713) ) |
| 3238 | | ROM_LOAD( "a030a500.bin", 0x003000, 0x000400, CRC(6a501389) SHA1(c2c75cd8beed6bb9e3fa39722fa01b35f2e7992d) ) |
| 3270 | // protection data (also found in cleartext in the program ROM!) |
| 3271 | ROM_REGION( 0x400000, "naomibd_prot", ROMREGION_ERASE00 ) |
| 3272 | ROM_COPY("user1", 0, 0, 0x400000) |
| 3239 | 3273 | ROM_END |
| 3240 | 3274 | |
| 3241 | 3275 | |
| r5891 | r5892 | |
| 3437 | 3471 | |
| 3438 | 3472 | // trojaned protection data (filename is address read from) |
| 3439 | 3473 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) |
| 3474 | ROM_LOAD( "a2785e20.bin", 0x000000, 0x0072f0, CRC(52912418) SHA1(ec0992eda50953001801d152e09195a17132cb0f) ) |
| 3475 | ROM_LOAD( "a2765e00.bin", 0x010000, 0x00e47c, CRC(d9acaa94) SHA1(6ab7ebc2dd78c0bc007f3656a67f3c24d23d48ae) ) |
| 3476 | ROM_LOAD( "a2774280.bin", 0x020000, 0x00c61c, CRC(8dd9581f) SHA1(f852c44e423effa894769d3e156325a132b2df8e) ) |
| 3477 | ROM_LOAD( "a27808a0.bin", 0x030000, 0x005568, CRC(4f4aee03) SHA1(453c0ec08ca69ad844f24be290e92bf16231a713) ) |
| 3478 | ROM_LOAD( "a154bdc0.bin", 0x040000, 0x00ec9c, CRC(755a7343) SHA1(a4355850e1cb6f81d53d461e70884a5c51083454) ) |
| 3479 | ROM_LOAD( "a155aa60.bin", 0x050000, 0x00951c, CRC(fc7a23d8) SHA1(a428114d89471f4b4c8af6d932376e7b0887c4cc) ) |
| 3480 | ROM_LOAD( "a1563f80.bin", 0x060000, 0x009f3c, CRC(90903b9c) SHA1(da6fcda74710497bab97c4c8342d93b5dfb14184) ) |
| 3481 | ROM_LOAD( "a156dec0.bin", 0x070000, 0x00dbdc, CRC(fb7b0b77) SHA1(ace73e925e5ffa3f805ff0ef68b564119cf4ce41) ) |
| 3482 | ROM_LOAD( "a157baa0.bin", 0x080000, 0x00cb3c, CRC(60e5dad6) SHA1(db8880ebbc3ebb02d861aa3bcf2cc34071d613e8) ) |
| 3483 | ROM_LOAD( "a15885e0.bin", 0x090000, 0x00e91c, CRC(6b2e1400) SHA1(8965e97e3d85a568c2bef2d1d0faf5b8aee289d0) ) |
| 3484 | ROM_LOAD( "a1596f00.bin", 0x0a0000, 0x00a3bc, CRC(cf538afa) SHA1(b7f94195760a0b14c18654823ead2e28fe526b07) ) |
| 3485 | ROM_LOAD( "a15a12c0.bin", 0x0b0000, 0x007f04, CRC(e07d589b) SHA1(60bc7f3e91d1f22b4854777644add346e5df58bb) ) |
| 3486 | ROM_LOAD( "a15a91e0.bin", 0x0c0000, 0x00c91c, CRC(124fce0b) SHA1(8949df4586c736e22c88b7594221ae114848284a) ) |
| 3487 | ROM_LOAD( "a15b5b00.bin", 0x0d0000, 0x00a53c, CRC(453bb126) SHA1(d5251f54e80504f3c427f6cc3443fe56edcd62c0) ) |
| 3488 | ROM_LOAD( "a15c0040.bin", 0x0e0000, 0x0088e0, CRC(7d601fb3) SHA1(ff2aca546e0db05b79f48fdb086f0e8e7e0853e4) ) |
| 3489 | ROM_LOAD( "a16203e0.bin", 0x0f0000, 0x00c61c, CRC(300c8e1e) SHA1(25f9c4af3bed0da5fc9e440096fb5cf4c29a89b3) ) |
| 3490 | ROM_LOAD( "a162ca00.bin", 0x100000, 0x009e9c, CRC(8f0ccd81) SHA1(0ae2209912e31195bb8110e28d0791fc398b49cd) ) |
| 3491 | ROM_LOAD( "a16368a0.bin", 0x110000, 0x00b2dc, CRC(e497f060) SHA1(05d8ffc0ead6c31ddc3197c877466fec354a71d9) ) |
| 3492 | ROM_LOAD( "a1641b80.bin", 0x120000, 0x00ac5c, CRC(e6d81d57) SHA1(97cfe0b14e1e23c7428dad426848de3fe2496ddb) ) |
| 3493 | ROM_LOAD( "a164c7e0.bin", 0x130000, 0x008b7c, CRC(ab6ca421) SHA1(84979f01f82f34a9d708b645e9f2cc45abed03a9) ) |
| 3494 | ROM_LOAD( "a1655360.bin", 0x140000, 0x00c8bc, CRC(c5554803) SHA1(06b712aed14a489d167876217cec48ad0aee495f) ) |
| 3495 | ROM_LOAD( "a1661c20.bin", 0x150000, 0x0083dc, CRC(4f5abf07) SHA1(3d03f8728ce445b6070f182d84f843f08420ad05) ) |
| 3496 | ROM_LOAD( "a166a000.bin", 0x160000, 0x00f73c, CRC(bfddc3bf) SHA1(a89bdebefaffc235e163a022d85b7c3bdbffcaf6) ) |
| 3497 | ROM_LOAD( "a1679740.bin", 0x170000, 0x00fb5c, CRC(ec9889a5) SHA1(d7f04b62a8a78b3bfc9a25f1b21be08dcb986546) ) |
| 3498 | ROM_LOAD( "a1688d00.bin", 0x180000, 0x00e080, CRC(ad7adaf6) SHA1(516858081ebab25ef0561e4b0f8842026504c5dd) ) |
| 3499 | ROM_LOAD( "a1696d80.bin", 0x190000, 0x007c10, CRC(4e0c7365) SHA1(0d564956c8330aa57c504a247aef6a230b1e8884) ) |
| 3440 | 3500 | ROM_END |
| 3441 | 3501 | |
| 3502 | |
| 3442 | 3503 | /* |
| 3443 | 3504 | |
| 3444 | 3505 | SYSTEMID: NAOMI |
| r5891 | r5892 | |
| 5207 | 5268 | ROM_REGION( 0xb800000, "user1", ROMREGION_ERASEFF) |
| 5208 | 5269 | ROM_LOAD( "epr-23785.ic22", 0x0000000, 0x0400000, CRC(9bd98d4b) SHA1(3b0622625317cd6b2736c5b4a23484fb8bf39e4b) ) |
| 5209 | 5270 | ROM_LOAD( "mpr-23774.ic1", 0x0800000, 0x1000000, CRC(0fe7b864) SHA1(357ca3a5d96d7ff27e06367e115ddfd00cb260e3) ) |
| 5210 | | ROM_LOAD( "mpr-23775.ic2", 0x1800000, 0x1000000, BAD_DUMP CRC(6c64d9d9) SHA1(d2033ca3ab9838cad39e17b5c1eb079c6d15b758) ) |
| 5271 | ROM_LOAD( "mpr-23775.ic2", 0x1800000, 0x1000000, CRC(a11cd9e5) SHA1(7fd8f634d0d14a91dfe9f39b5643b9c761dc7053) ) |
| 5211 | 5272 | ROM_LOAD( "mpr-23776.ic3", 0x2800000, 0x1000000, CRC(44b8429e) SHA1(0ec6b6156bef1621700791651903a4589f4b5f84) ) |
| 5212 | 5273 | ROM_LOAD( "mpr-23777.ic4", 0x3800000, 0x1000000, CRC(78a4264e) SHA1(40d045240173f330ac6f108b132f9a87884922be) ) |
| 5213 | 5274 | ROM_LOAD( "mpr-23778.ic5", 0x4800000, 0x1000000, CRC(02dee78b) SHA1(e08ce0fc0b1db2dcef957c2edb6d51db400a38cb) ) |
| 5214 | 5275 | ROM_LOAD( "mpr-23779.ic6", 0x5800000, 0x1000000, CRC(6e458eea) SHA1(4c85fcacf4ff46d4a137afcf5906092fd88fe4b1) ) |
| 5215 | 5276 | ROM_LOAD( "mpr-23780.ic7", 0x6800000, 0x1000000, CRC(a775a51c) SHA1(b3eae20e5e7d74252368fd902c4e94a6ba6cb154) ) |
| 5216 | | ROM_LOAD( "mpr-23781.ic8", 0x7800000, 0x1000000, BAD_DUMP CRC(689457fa) SHA1(734b6b5f2ba78af24a613aef8d4e739f296413f7) ) |
| 5277 | ROM_LOAD( "mpr-23781.ic8", 0x7800000, 0x1000000, CRC(401bca00) SHA1(10c6011fae7076ea0dc5ab0ebca9cb88659a93e9) ) |
| 5217 | 5278 | ROM_LOAD( "mpr-23782.ic9", 0x8800000, 0x1000000, CRC(4f72e901) SHA1(a1d231c446d2c34e5a7e7145754b2313a2d03fd4) ) |
| 5218 | 5279 | ROM_LOAD( "mpr-23783.ic10", 0x9800000, 0x1000000, CRC(c8d4f6f9) SHA1(9e9df605c050b3780d7df34bd5041d30bc084d2d) ) |
| 5219 | | ROM_LOAD( "mpr-23784.ic11", 0xa800000, 0x1000000, BAD_DUMP CRC(3a7ebe78) SHA1(6f414db03761be0d2f995193df8146f3b82c18a8) ) |
| 5280 | ROM_LOAD( "mpr-23784.ic11", 0xa800000, 0x1000000, CRC(f74f2fee) SHA1(84b07baa6d116727e66ef27e24ba6484c3393891) ) |
| 5220 | 5281 | ROM_END |
| 5221 | 5282 | |
| 5222 | 5283 | ROM_START( clubkrte ) |
| r5891 | r5892 | |
| 5226 | 5287 | ROM_LOAD( "epr-23704.ic22", 0x0000000, 0x0400000, CRC(ff700a0d) SHA1(e2db0d2bd7dc88b3a487077e8ce56eb6cfd9b02d) ) |
| 5227 | 5288 | ROM_LOAD( "mpr-23693.ic1", 0x0800000, 0x1000000, CRC(28995764) SHA1(a1457f9935dde2e5aaa5ef245c736c0f2f8c74b7) ) |
| 5228 | 5289 | ROM_LOAD( "mpr-22694.ic2", 0x1800000, 0x1000000, CRC(37d30111) SHA1(4c07df8cd548cac79d48709e61f692d762471f8f) ) |
| 5229 | | ROM_LOAD( "mpr-22695.ic3", 0x2800000, 0x1000000, BAD_DUMP CRC(9fdeaa70) SHA1(2d01a49b8d8d23f61584bec31d75723cee47dc44) ) |
| 5230 | | ROM_LOAD( "mpr-22696.ic4", 0x3800000, 0x1000000, BAD_DUMP CRC(cb12ae00) SHA1(cf94ae123217071c169aa79c842f0a28abba9713) ) |
| 5290 | ROM_LOAD( "mpr-22695.ic3", 0x2800000, 0x1000000, CRC(41ac1510) SHA1(01b889b627fdfc1f12a0c84fcc36debdfb1cf377) ) |
| 5291 | ROM_LOAD( "mpr-22696.ic4", 0x3800000, 0x1000000, CRC(6f2da455) SHA1(b655757bc513398820bfeae07dca8a4f3ea9752c) ) |
| 5231 | 5292 | ROM_LOAD( "mpr-22697.ic5", 0x4800000, 0x1000000, CRC(1383c742) SHA1(6efd17632a277a4bb0e47cc912fbc9865a8b14c3) ) |
| 5232 | | ROM_LOAD( "mpr-22698.ic6", 0x5800000, 0x1000000, BAD_DUMP CRC(1701cd3a) SHA1(e217206745ce9dca51733f77eb093b3ef2a10c5e) ) |
| 5233 | | ROM_LOAD( "mpr-22699.ic7", 0x6800000, 0x1000000, BAD_DUMP CRC(e58cfa77) SHA1(27c421c37d7e3df88cb7b2240bfec1ae460001a3) ) |
| 5293 | ROM_LOAD( "mpr-22698.ic6", 0x5800000, 0x1000000, CRC(da79cd06) SHA1(fdfe068caca1eb764dec28ab327e56b39144f3ae) ) |
| 5294 | ROM_LOAD( "mpr-22699.ic7", 0x6800000, 0x1000000, CRC(ea77f000) SHA1(35aa8ee804d9429e72f516137a3b06c585a57b6d) ) |
| 5234 | 5295 | ROM_LOAD( "mpr-22700.ic8", 0x7800000, 0x1000000, CRC(db9e5c1d) SHA1(db918c0fa1860f4345806e574d44354aba5fcd54) ) |
| 5235 | | ROM_LOAD( "mpr-22701.ic9", 0x8800000, 0x1000000, BAD_DUMP CRC(66ee25be) SHA1(17804308aa63bf58d2bde0b4b202d2bd0974a981) ) |
| 5296 | ROM_LOAD( "mpr-22701.ic9", 0x8800000, 0x1000000, CRC(0fa92fd7) SHA1(67a1cf085101884a17a4783d0d509ab198aa6425) ) |
| 5236 | 5297 | ROM_LOAD( "mpr-22702.ic10", 0x9800000, 0x1000000, CRC(e302b582) SHA1(787192ed9f9a08541eecc3128855485cad802a42) ) |
| 5237 | 5298 | ROM_LOAD( "mpr-22703.ic11", 0xa800000, 0x1000000, CRC(702b8b4a) SHA1(3a8dfde458f341e7db20664382b9fce2b6e5d462) ) |
| 5238 | 5299 | ROM_END |
| r5891 | r5892 | |
| 5496 | 5557 | * |
| 5497 | 5558 | *********************************************/ |
| 5498 | 5559 | |
| 5499 | | typedef struct _atomiswave_key atomiswave_key; |
| 5500 | | struct _atomiswave_key |
| 5560 | typedef struct _sbox_set sbox_set; |
| 5561 | struct _sbox_set |
| 5501 | 5562 | { |
| 5502 | | int P0[16]; |
| 5503 | 5563 | int S0[32]; |
| 5504 | 5564 | int S1[16]; |
| 5505 | 5565 | int S2[16]; |
| 5506 | 5566 | int S3[8]; |
| 5507 | 5567 | }; |
| 5508 | 5568 | |
| 5509 | | static const atomiswave_key ssu_key = { |
| 5569 | static const int permutation_table[4][16] = |
| 5570 | { |
| 5510 | 5571 | {8,10,1,3,7,4,11,2,5,15,6,0,12,13,9,14}, |
| 5511 | | {4,12,8,14,16,30,31,0,23,29,24,21,11,22,27,5,3,20,18,26,10,7,17,1,28,6,15,13,2,9,25,19}, |
| 5512 | | {13,1,0,9,5,12,4,14,3,15,2,10,11,6,8,7}, |
| 5513 | | {7,13,4,6,5,9,3,2,0,15,12,10,8,11,1,14}, |
| 5514 | | {4,0,1,2,5,7,3,6} |
| 5515 | | }; |
| 5516 | | |
| 5517 | | static const atomiswave_key rm_key = { |
| 5518 | 5572 | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, |
| 5519 | | {3,0,14,17,10,15,31,20,13,2,29,28,9,18,25,27,6,19,30,22,7,12,1,16,23,11,24,4,8,26,21,5}, |
| 5520 | | {2,10,6,9,11,13,4,5,3,15,7,14,12,1,0,8}, |
| 5521 | | {1,13,11,3,8,7,9,10,12,15,4,14,0,5,6,2}, |
| 5522 | | {6,5,0,3,7,1,4,2} |
| 5523 | | }; |
| 5524 | | |
| 5525 | | static const atomiswave_key fotns_key = { |
| 5526 | 5573 | {12,7,11,2,0,5,15,6,1,8,14,4,9,13,3,10}, |
| 5527 | | {4,7,9,22,13,8,24,19,10,5,26,27,14,21,30,28,1,20,25,17,0,11,6,23,16,12,31,3,15,29,18,2}, |
| 5528 | | {3,11,7,8,10,12,5,4,2,14,6,15,13,0,1,9}, |
| 5529 | | {10,6,0,8,3,12,2,1,7,4,15,5,11,14,13,9}, |
| 5530 | | {7,4,1,2,6,0,5,3} |
| 5574 | {14,1,11,15,7,3,8,13,0,4,2,12,6,10,5,9} |
| 5531 | 5575 | }; |
| 5532 | 5576 | |
| 5533 | | static const atomiswave_key xh_key = { |
| 5534 | | {12,7,11,2,0,5,15,6,1,8,14,4,9,13,3,10}, |
| 5535 | | {4,12,8,14,16,30,31,0,23,29,24,21,11,22,27,5,3,20,18,26,10,7,17,1,28,6,15,13,2,9,25,19}, |
| 5536 | | {13,1,0,9,5,12,4,14,3,15,2,10,11,6,8,7}, |
| 5537 | | {7,13,4,6,5,9,3,2,0,15,12,10,8,11,1,14}, |
| 5538 | | {4,0,1,2,5,7,3,6} |
| 5577 | static const sbox_set sboxes_table[4] = |
| 5578 | { |
| 5579 | { |
| 5580 | {4,12,8,14,16,30,31,0,23,29,24,21,11,22,27,5,3,20,18,26,10,7,17,1,28,6,15,13,2,9,25,19}, |
| 5581 | {13,1,0,9,5,12,4,14,3,15,2,10,11,6,8,7}, |
| 5582 | {7,13,4,6,5,9,3,2,0,15,12,10,8,11,1,14}, |
| 5583 | {4,0,1,2,5,7,3,6} |
| 5584 | }, |
| 5585 | { |
| 5586 | {3,0,14,17,10,15,31,20,13,2,29,28,9,18,25,27,6,19,30,22,7,12,1,16,23,11,24,4,8,26,21,5}, |
| 5587 | {2,10,6,9,11,13,4,5,3,15,7,14,12,1,0,8}, |
| 5588 | {1,13,11,3,8,7,9,10,12,15,4,14,0,5,6,2}, |
| 5589 | {6,5,0,3,7,1,4,2} |
| 5590 | }, |
| 5591 | { |
| 5592 | {9,15,28,7,13,24,2,23,21,1,22,16,18,8,17,31,27,6,30,12,4,20,5,19,0,25,3,29,10,14,11,26}, |
| 5593 | {5,2,13,11,8,6,12,1,4,3,0,10,14,15,7,9}, |
| 5594 | {11,6,10,0,12,1,8,14,2,9,13,3,7,4,15,5}, |
| 5595 | {1,5,6,2,4,7,3,0} |
| 5596 | }, |
| 5597 | { |
| 5598 | {17,3,31,2,28,10,9,29,6,25,24,8,13,1,19,15,22,0,14,20,16,7,21,4,18,26,27,5,12,23,11,30}, |
| 5599 | {4,8,11,15,3,14,7,12,1,0,9,5,6,13,2,10}, |
| 5600 | {14,0,9,11,4,1,7,5,13,6,8,12,2,3,10,15}, |
| 5601 | {2,1,0,5,4,6,7,3} |
| 5602 | }, |
| 5539 | 5603 | }; |
| 5540 | 5604 | |
| 5541 | | static const atomiswave_key xh2_key = { |
| 5542 | | {14,1,11,15,7,3,8,13,0,4,2,12,6,10,5,9}, |
| 5543 | | {11,3,7,1,31,17,16,15,24,18,23,26,4,25,20,10,12,27,29,21,5,8,30,14,19,9,0,2,13,6,22,28}, |
| 5544 | | {7,11,10,3,15,6,14,4,9,5,8,0,1,12,2,13}, |
| 5545 | | {11,1,8,10,9,5,15,14,12,3,0,6,4,7,13,2}, |
| 5546 | | {4,0,1,2,5,7,3,6} |
| 5547 | | }; |
| 5548 | | |
| 5549 | | static const atomiswave_key dolphin_key = { |
| 5550 | | {8,10,1,3,7,4,11,2,5,15,6,0,12,13,9,14}, |
| 5551 | | {11,8,6,25,2,7,23,28,5,10,21,20,1,26,17,19,14,27,22,30,15,4,9,24,31,3,16,12,0,18,29,13}, |
| 5552 | | {13,5,9,6,4,2,11,10,12,0,8,1,3,14,15,7}, |
| 5553 | | {1,13,11,3,8,7,9,10,12,15,4,14,0,5,6,2}, |
| 5554 | | {3,0,5,6,2,4,1,7} |
| 5555 | | }; |
| 5556 | | |
| 5557 | | static const atomiswave_key demofist_key = { |
| 5558 | | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, |
| 5559 | | {9,15,28,7,13,24,2,23,21,1,22,16,18,8,17,31,27,6,30,12,4,20,5,19,0,25,3,29,10,14,11,26}, |
| 5560 | | {5,2,13,11,8,6,12,1,4,3,0,10,14,15,7,9}, |
| 5561 | | {11,6,10,0,12,1,8,14,2,9,13,3,7,4,15,5}, |
| 5562 | | {1,5,6,2,4,7,3,0} |
| 5563 | | }; |
| 5564 | | |
| 5565 | | static const atomiswave_key rumblef_key = { |
| 5566 | | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, |
| 5567 | | {11,3,7,1,31,17,16,15,24,18,23,26,4,25,20,10,12,27,29,21,5,8,30,14,19,9,0,2,13,6,22,28}, |
| 5568 | | {7,11,10,3,15,6,14,4,9,5,8,0,1,12,2,13}, |
| 5569 | | {11,1,8,10,9,5,15,14,12,3,0,6,4,7,13,2}, |
| 5570 | | {4,0,1,2,5,7,3,6} |
| 5571 | | }; |
| 5572 | | |
| 5573 | | static const atomiswave_key ngbc_key = { |
| 5574 | | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, |
| 5575 | | {17,25,29,27,5,11,10,21,2,8,13,0,30,3,14,16,22,1,7,15,31,18,4,20,9,19,26,24,23,28,12,6}, |
| 5576 | | {15,3,2,11,7,14,6,12,1,13,0,8,9,4,10,5}, |
| 5577 | | {6,12,5,7,4,8,2,3,1,14,13,11,9,10,0,15}, |
| 5578 | | {5,1,0,3,4,6,2,7} |
| 5579 | | }; |
| 5580 | | |
| 5581 | | static const atomiswave_key kofnw_key = { |
| 5582 | | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, |
| 5583 | | {22,16,3,24,18,7,29,8,10,30,9,15,13,23,14,0,4,25,1,19,27,11,26,12,31,6,28,2,21,17,20,5}, |
| 5584 | | {8,15,0,6,5,11,1,12,9,14,13,7,3,2,10,4}, |
| 5585 | | {2,15,3,9,5,8,1,7,11,0,4,10,14,13,6,12}, |
| 5586 | | {4,0,3,7,1,2,6,5} |
| 5587 | | }; |
| 5588 | | |
| 5589 | | static const atomiswave_key kov7sprt_key = { |
| 5590 | | {14,1,11,15,7,3,8,13,0,4,2,12,6,10,5,9}, |
| 5591 | | {17,3,31,2,28,10,9,29,6,25,24,8,13,1,19,15,22,0,14,20,16,7,21,4,18,26,27,5,12,23,11,30}, |
| 5592 | | {4,8,11,15,3,14,7,12,1,0,9,5,6,13,2,10}, |
| 5593 | | {14,0,9,11,4,1,7,5,13,6,8,12,2,3,10,15}, |
| 5594 | | {2,1,0,5,4,6,7,3} |
| 5595 | | }; |
| 5596 | | |
| 5597 | | static const atomiswave_key ggisuka_key = { |
| 5598 | | {12,7,11,2,0,5,15,6,1,8,14,4,9,13,3,10}, |
| 5599 | | {14,6,2,4,26,20,21,10,29,23,18,31,1,28,17,15,9,30,24,16,0,13,27,11,22,12,5,7,8,3,19,25}, |
| 5600 | | {5,9,8,1,13,4,12,6,11,7,10,2,3,14,0,15}, |
| 5601 | | {15,5,12,14,13,1,11,10,8,7,4,2,0,3,9,6}, |
| 5602 | | {1,5,4,7,0,2,6,3} |
| 5603 | | }; |
| 5604 | | |
| 5605 | | static UINT16 atomiswave_decrypt(UINT16 cipherText, int address, const atomiswave_key* key) |
| 5605 | static UINT16 atomiswave_decrypt(UINT16 cipherText, int address, const UINT32 key) |
| 5606 | 5606 | { |
| 5607 | 5607 | int b0,b1,b2,b3; |
| 5608 | 5608 | int aux; |
| 5609 | const int* pbox = permutation_table[key>>18]; |
| 5610 | const sbox_set* ss = &sboxes_table[(key>>16)&3]; |
| 5609 | 5611 | |
| 5610 | 5612 | aux = BITSWAP16(cipherText, |
| 5611 | | key->P0[15],key->P0[14],key->P0[13],key->P0[12],key->P0[11],key->P0[10],key->P0[9],key->P0[8], |
| 5612 | | key->P0[7],key->P0[6],key->P0[5],key->P0[4],key->P0[3],key->P0[2],key->P0[1],key->P0[0]); |
| 5613 | pbox[15],pbox[14],pbox[13],pbox[12],pbox[11],pbox[10],pbox[9],pbox[8], |
| 5614 | pbox[7],pbox[6],pbox[5],pbox[4],pbox[3],pbox[2],pbox[1],pbox[0]); |
| 5613 | 5615 | aux = aux ^ BITSWAP16(address/2, 13,5,2, 14,10,9,4, 15,11,6,1, 12,8,7,3,0); |
| 5614 | 5616 | |
| 5615 | 5617 | b0 = aux&0x1f; |
| r5891 | r5892 | |
| 5617 | 5619 | b2 = (aux>>9)&0xf; |
| 5618 | 5620 | b3 = aux>>13; |
| 5619 | 5621 | |
| 5620 | | b0 = key->S0[b0]; |
| 5621 | | b1 = key->S1[b1]; |
| 5622 | | b2 = key->S2[b2]; |
| 5623 | | b3 = key->S3[b3]; |
| 5622 | b0 = ss->S0[b0]; |
| 5623 | b1 = ss->S1[b1]; |
| 5624 | b2 = ss->S2[b2]; |
| 5625 | b3 = ss->S3[b3]; |
| 5624 | 5626 | |
| 5625 | | return (b3<<13)|(b2<<9)|(b1<<5)|b0; |
| 5627 | return ((b3<<13)|(b2<<9)|(b1<<5)|b0)^(key&0xffff); |
| 5626 | 5628 | } |
| 5627 | 5629 | |
| 5630 | |
| 5631 | /* |
| 5632 | We are using 20 bits keys with the following subfields' structure: |
| 5633 | bits 0-15 is a 16-bits XOR |
| 5634 | bits 17-16 is a index to the sboxes table |
| 5635 | bits 19-18 is a index to the permutation table |
| 5636 | |
| 5637 | These subfields could be differing from the "real" ones in the following ways: |
| 5638 | - Every one of the index subfields could be suffering an arbitrary bitswap and XOR |
| 5639 | - The 16-bits-XOR subfield could suffer an arbitrary XOR which could depend on the 4 index bits (that is: a different XOR per every index combination) |
| 5640 | - Of course, the way in which we are mixing 3 subfields in one only key is arbitrary too. |
| 5641 | */ |
| 5642 | |
| 5643 | |
| 5644 | static const UINT32 sprtshot_key = 0x00000; |
| 5645 | static const UINT32 rangrmsn_key = 0x50000; |
| 5646 | static const UINT32 fotns_key = 0x93627; |
| 5647 | static const UINT32 xtrmhunt_key = 0x80000; |
| 5648 | static const UINT32 xtrmhnt2_key = 0xc194f; |
| 5649 | static const UINT32 dolphin_key = 0x1a1e8; |
| 5650 | static const UINT32 demofist_key = 0x60000; |
| 5651 | static const UINT32 rumblef_key = 0x4194f; |
| 5652 | static const UINT32 ngbc_key = 0x42255; |
| 5653 | static const UINT32 kofnw_key = 0x6b3bf; |
| 5654 | static const UINT32 kov7sprt_key = 0xf0000; |
| 5655 | static const UINT32 ggisuka_key = 0x8b10a; |
| 5656 | static const UINT32 vfurlong_key = 0xa547a; |
| 5657 | static const UINT32 salmankt_key = 0x34b74; |
| 5658 | |
| 5659 | |
| 5628 | 5660 | static DRIVER_INIT( atomiswave ) |
| 5629 | 5661 | { |
| 5630 | 5662 | UINT64 *ROM = (UINT64 *)memory_region(machine, "maincpu"); |
| r5891 | r5892 | |
| 5642 | 5674 | intelflash_init(machine, 0, FLASH_MACRONIX_29L001MC, memory_region(machine, "maincpu")); |
| 5643 | 5675 | } |
| 5644 | 5676 | |
| 5645 | | |
| 5646 | | static DRIVER_INIT(fotns) |
| 5647 | | { |
| 5648 | | int i; |
| 5649 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5650 | | |
| 5651 | | long rom_size = memory_region_length(machine, "user1"); |
| 5652 | | |
| 5653 | | for(i=0; i<rom_size/2; i++) |
| 5654 | | { |
| 5655 | | src[i] = atomiswave_decrypt(src[i], i*2, &fotns_key); |
| 5656 | | } |
| 5657 | | |
| 5658 | | DRIVER_INIT_CALL(atomiswave); |
| 5677 | #define AW_DRIVER_INIT(DRIVER) \ |
| 5678 | static DRIVER_INIT(DRIVER) \ |
| 5679 | { \ |
| 5680 | int i; \ |
| 5681 | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); \ |
| 5682 | int rom_size = memory_region_length(machine, "user1"); \ |
| 5683 | for(i=0; i<rom_size/2; i++) \ |
| 5684 | { \ |
| 5685 | src[i] = atomiswave_decrypt(src[i], i*2, DRIVER##_key); \ |
| 5686 | } \ |
| 5687 | DRIVER_INIT_CALL(atomiswave); \ |
| 5659 | 5688 | } |
| 5660 | 5689 | |
| 5690 | AW_DRIVER_INIT(fotns) |
| 5691 | AW_DRIVER_INIT(demofist) |
| 5692 | AW_DRIVER_INIT(sprtshot) |
| 5693 | AW_DRIVER_INIT(rangrmsn) |
| 5694 | AW_DRIVER_INIT(xtrmhunt) |
| 5695 | AW_DRIVER_INIT(xtrmhnt2) |
| 5696 | AW_DRIVER_INIT(dolphin) |
| 5697 | AW_DRIVER_INIT(rumblef) |
| 5698 | AW_DRIVER_INIT(ngbc) |
| 5699 | AW_DRIVER_INIT(kofnw) |
| 5700 | AW_DRIVER_INIT(kov7sprt) |
| 5701 | AW_DRIVER_INIT(ggisuka) |
| 5702 | AW_DRIVER_INIT(vfurlong) |
| 5703 | AW_DRIVER_INIT(salmankt) |
| 5661 | 5704 | |
| 5662 | | |
| 5663 | | static DRIVER_INIT(demofist) |
| 5664 | | { |
| 5665 | | int i; |
| 5666 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5667 | | |
| 5668 | | long rom_size = memory_region_length(machine, "user1"); |
| 5669 | | |
| 5670 | | for(i=0; i<rom_size/2; i++) |
| 5671 | | { |
| 5672 | | src[i] = atomiswave_decrypt(src[i], i*2, &demofist_key); |
| 5673 | | } |
| 5674 | | |
| 5675 | | DRIVER_INIT_CALL(atomiswave); |
| 5676 | | } |
| 5677 | | |
| 5678 | | static DRIVER_INIT(sprtshot) |
| 5679 | | { |
| 5680 | | int i; |
| 5681 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5682 | | |
| 5683 | | long rom_size = memory_region_length(machine, "user1"); |
| 5684 | | |
| 5685 | | for(i=0; i<rom_size/2; i++) |
| 5686 | | { |
| 5687 | | src[i] = atomiswave_decrypt(src[i], i*2, &ssu_key); |
| 5688 | | } |
| 5689 | | |
| 5690 | | DRIVER_INIT_CALL(atomiswave); |
| 5691 | | } |
| 5692 | | |
| 5693 | | static DRIVER_INIT(rangrmsn) |
| 5694 | | { |
| 5695 | | int i; |
| 5696 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5697 | | |
| 5698 | | long rom_size = memory_region_length(machine, "user1"); |
| 5699 | | |
| 5700 | | for(i=0; i<rom_size/2; i++) |
| 5701 | | { |
| 5702 | | src[i] = atomiswave_decrypt(src[i], i*2, &rm_key); |
| 5703 | | } |
| 5704 | | |
| 5705 | | DRIVER_INIT_CALL(atomiswave); |
| 5706 | | } |
| 5707 | | |
| 5708 | | static DRIVER_INIT(xtrmhunt) |
| 5709 | | { |
| 5710 | | int i; |
| 5711 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5712 | | |
| 5713 | | long rom_size = memory_region_length(machine, "user1"); |
| 5714 | | |
| 5715 | | for(i=0; i<rom_size/2; i++) |
| 5716 | | { |
| 5717 | | src[i] = atomiswave_decrypt(src[i], i*2, &xh_key); |
| 5718 | | } |
| 5719 | | |
| 5720 | | DRIVER_INIT_CALL(atomiswave); |
| 5721 | | } |
| 5722 | | |
| 5723 | | static DRIVER_INIT(xtrmhnt2) |
| 5724 | | { |
| 5725 | | int i; |
| 5726 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5727 | | |
| 5728 | | long rom_size = memory_region_length(machine, "user1"); |
| 5729 | | |
| 5730 | | for(i=0; i<rom_size/2; i++) |
| 5731 | | { |
| 5732 | | src[i] = atomiswave_decrypt(src[i], i*2, &xh2_key); |
| 5733 | | } |
| 5734 | | |
| 5735 | | DRIVER_INIT_CALL(atomiswave); |
| 5736 | | } |
| 5737 | | |
| 5738 | | static DRIVER_INIT(dolphin) |
| 5739 | | { |
| 5740 | | int i; |
| 5741 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5742 | | |
| 5743 | | long rom_size = memory_region_length(machine, "user1"); |
| 5744 | | |
| 5745 | | for(i=0; i<rom_size/2; i++) |
| 5746 | | { |
| 5747 | | src[i] = atomiswave_decrypt(src[i], i*2, &dolphin_key); |
| 5748 | | } |
| 5749 | | |
| 5750 | | DRIVER_INIT_CALL(atomiswave); |
| 5751 | | } |
| 5752 | | |
| 5753 | | static DRIVER_INIT(rumblef) |
| 5754 | | { |
| 5755 | | int i; |
| 5756 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5757 | | |
| 5758 | | long rom_size = memory_region_length(machine, "user1"); |
| 5759 | | |
| 5760 | | for(i=0; i<rom_size/2; i++) |
| 5761 | | { |
| 5762 | | src[i] = atomiswave_decrypt(src[i], i*2, &rumblef_key); |
| 5763 | | } |
| 5764 | | |
| 5765 | | DRIVER_INIT_CALL(atomiswave); |
| 5766 | | } |
| 5767 | | |
| 5768 | | static DRIVER_INIT(ngbc) |
| 5769 | | { |
| 5770 | | int i; |
| 5771 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5772 | | |
| 5773 | | long rom_size = memory_region_length(machine, "user1"); |
| 5774 | | |
| 5775 | | for(i=0; i<rom_size/2; i++) |
| 5776 | | { |
| 5777 | | src[i] = atomiswave_decrypt(src[i], i*2, &ngbc_key); |
| 5778 | | } |
| 5779 | | |
| 5780 | | DRIVER_INIT_CALL(atomiswave); |
| 5781 | | } |
| 5782 | | |
| 5783 | | static DRIVER_INIT(kofnw) |
| 5784 | | { |
| 5785 | | int i; |
| 5786 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5787 | | |
| 5788 | | long rom_size = memory_region_length(machine, "user1"); |
| 5789 | | |
| 5790 | | for(i=0; i<rom_size/2; i++) |
| 5791 | | { |
| 5792 | | src[i] = atomiswave_decrypt(src[i], i*2, &kofnw_key); |
| 5793 | | } |
| 5794 | | |
| 5795 | | DRIVER_INIT_CALL(atomiswave); |
| 5796 | | } |
| 5797 | | |
| 5798 | | static DRIVER_INIT(kov7sprt) |
| 5799 | | { |
| 5800 | | int i; |
| 5801 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5802 | | |
| 5803 | | long rom_size = memory_region_length(machine, "user1"); |
| 5804 | | |
| 5805 | | for(i=0; i<rom_size/2; i++) |
| 5806 | | { |
| 5807 | | src[i] = atomiswave_decrypt(src[i], i*2, &kov7sprt_key); |
| 5808 | | } |
| 5809 | | |
| 5810 | | DRIVER_INIT_CALL(atomiswave); |
| 5811 | | } |
| 5812 | | |
| 5813 | | static DRIVER_INIT(ggisuka) |
| 5814 | | { |
| 5815 | | int i; |
| 5816 | | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); |
| 5817 | | |
| 5818 | | long rom_size = memory_region_length(machine, "user1"); |
| 5819 | | |
| 5820 | | for(i=0; i<rom_size/2; i++) |
| 5821 | | { |
| 5822 | | src[i] = atomiswave_decrypt(src[i], i*2, &ggisuka_key); |
| 5823 | | } |
| 5824 | | |
| 5825 | | DRIVER_INIT_CALL(atomiswave); |
| 5826 | | } |
| 5827 | | |
| 5828 | 5705 | ROM_START( fotns ) |
| 5829 | 5706 | ROM_REGION( 0x200000, "maincpu", 0) |
| 5830 | 5707 | AW_BIOS |
| r5891 | r5892 | |
| 5984 | 5861 | |
| 5985 | 5862 | ROM_REGION( 0x9000000, "user1", ROMREGION_ERASE) |
| 5986 | 5863 | ROM_LOAD( "ax1201p01.ic18", 0x0000000, 0x0800000, CRC(0a78d52c) SHA1(e9006dc43cd11d5ba49a092a1dff31dc10700c28) ) |
| 5864 | ROM_LOAD( "ax1201m01.ic10", 0x0800000, 0x1000000, CRC(df96ce30) SHA1(25a9f743b1c2b11896d0c7a2dc1c198fc977aaca) ) // second half is blank |
| 5987 | 5865 | ROM_LOAD( "ax1202m01.ic11", 0x1000000, 0x1000000, CRC(dfc6fd67) SHA1(f9d35b18a03d22f70feda42d314b0f9dd54eea55) ) |
| 5988 | 5866 | ROM_LOAD( "ax1203m01.ic12", 0x2000000, 0x1000000, CRC(bf623df9) SHA1(8b9a8e8100ff6d2ce9a982ab8eb1d542f1c7af03) ) |
| 5989 | 5867 | ROM_LOAD( "ax1204m01.ic13", 0x3000000, 0x1000000, CRC(c80c3930) SHA1(5c39fde36e2ebbfe72967d7d0202eb454a8d3bbe) ) |
| r5891 | r5892 | |
| 5991 | 5869 | ROM_LOAD( "ax1206m01.ic15", 0x5000000, 0x1000000, CRC(807ab795) SHA1(17c86b1a56333c05b68ff84f83e964d013c1819c) ) |
| 5992 | 5870 | ROM_LOAD( "ax1207m01.ic16", 0x6000000, 0x1000000, CRC(6636d1b8) SHA1(9bd8fc114557f6fbe772f85eeb246f7336d4255e) ) |
| 5993 | 5871 | ROM_LOAD( "ax1208m01.ic17", 0x7000000, 0x1000000, CRC(38bda476) SHA1(0234a6f5fbaf5e958b3ba0db311dff157f80addc) ) |
| 5994 | | ROM_LOAD( "ax1201m01.ic10", 0x8000000, 0x1000000, CRC(df96ce30) SHA1(25a9f743b1c2b11896d0c7a2dc1c198fc977aaca) ) |
| 5995 | 5872 | ROM_END |
| 5996 | 5873 | |
| 5874 | ROM_START( vfurlong ) |
| 5875 | ROM_REGION( 0x200000, "maincpu", 0) |
| 5876 | AW_BIOS |
| 5877 | |
| 5878 | ROM_REGION( 0x9000000, "user1", ROMREGION_ERASE) |
| 5879 | ROM_LOAD( "ax2001p01.ic18", 0x0000000, 0x0800000, CRC(17ea9aa9) SHA1(c68500e9b3407a9d4b20f2678718ce475f179f7d) ) |
| 5880 | ROM_LOAD( "ax2001m01.ic11", 0x1000000, 0x1000000, CRC(64460b24) SHA1(044857d6593897d303622e005a63ca7b3acd7453) ) |
| 5881 | ROM_LOAD( "ax2002m01.ic12", 0x2000000, 0x1000000, CRC(d4da357f) SHA1(c462cddec9a369a1a5595676de76499d56683ea9) ) |
| 5882 | ROM_LOAD( "ax2003m01.ic13", 0x3000000, 0x1000000, CRC(ad046ad7) SHA1(ac7c46e458595714e327526354e1111fb25b44e0) ) |
| 5883 | ROM_LOAD( "ax2004m01.ic14", 0x4000000, 0x1000000, CRC(4d555d7c) SHA1(a5eccc920bdb7ad9cf57c0e1ef6a905c6b9eee45) ) |
| 5884 | ROM_LOAD( "ax2005m01.ic15", 0x5000000, 0x1000000, CRC(785208e2) SHA1(6ba5bd3901c5b1d71abcc8d833a011bd4abae6b6) ) |
| 5885 | ROM_LOAD( "ax2006m01.ic16", 0x6000000, 0x1000000, CRC(8134ec55) SHA1(843e473d4f99237ded641cce9515b7802cfe3742) ) |
| 5886 | ROM_LOAD( "ax2007m01.ic17", 0x7000000, 0x1000000, CRC(d0557e8a) SHA1(df8057597eb690bd18c5d26736f5d4f86e3b1225) ) |
| 5887 | ROM_END |
| 5888 | |
| 5889 | ROM_START( salmankt ) |
| 5890 | ROM_REGION( 0x200000, "maincpu", 0) |
| 5891 | AW_BIOS |
| 5892 | |
| 5893 | ROM_REGION( 0x9000000, "user1", ROMREGION_ERASE) |
| 5894 | ROM_LOAD( "ax1401p01.ic18", 0x0000000, 0x0800000, CRC(28d779e0) SHA1(dab785a595de5f474c18c713e672949176a5b1b5) ) |
| 5895 | ROM_LOAD( "ax1401m01.ic11", 0x1000000, 0x1000000, CRC(fd7af845) SHA1(0c8f5a91662e46d5c187a0758af95082183cdf69) ) |
| 5896 | ROM_LOAD( "ax1402m01.ic12", 0x2000000, 0x1000000, CRC(88d458a7) SHA1(c661196d5a9640013995c8aa6a5bea057d984f87) ) |
| 5897 | ROM_LOAD( "ax1403m01.ic13", 0x3000000, 0x1000000, CRC(074f7c4b) SHA1(4955e4f333d15d5d9cc69bb9658f29a37e912012) ) |
| 5898 | ROM_LOAD( "ax1404m01.ic14", 0x4000000, 0x1000000, CRC(af4e3829) SHA1(18d9e8a8d8e930ad697b686a98f31ea175f5fd4a) ) |
| 5899 | ROM_LOAD( "ax1405m01.ic15", 0x5000000, 0x1000000, CRC(b548446f) SHA1(8b4661e601e36c067dff2530aff4f7ea76e1c21e) ) |
| 5900 | ROM_LOAD( "ax1406m01.ic16", 0x6000000, 0x1000000, CRC(437673e6) SHA1(66f7e5f246ebbb1bdbf074da41ec16bf32720a82) ) |
| 5901 | ROM_LOAD( "ax1407m01.ic17", 0x7000000, 0x1000000, CRC(6b6acc0a) SHA1(a8c692c875271a0806460caa79c67fd756231273) ) |
| 5902 | ROM_END |
| 5903 | |
| 5997 | 5904 | /* Atomiswave */ |
| 5998 | 5905 | GAME( 2001, awbios, 0, aw, aw, 0, ROT0, "Sammy", "Atomiswave Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 5999 | 5906 | |
| 6000 | 5907 | GAME( 2002, sprtshot, awbios, aw, aw, sprtshot, ROT0, "Sammy USA", "Sports Shooting USA", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6001 | 5908 | GAME( 2003, demofist, awbios, aw, aw, demofist, ROT0, "Polygon Magic / Dimps", "Demolish Fist", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6002 | 5909 | GAME( 2003, dolphin, awbios, aw, aw, dolphin, ROT0, "Sammy", "Dolphin Blue", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 6003 | | GAME( 2003, ggisuka, awbios, aw, aw, ggisuka, ROT0, "Sammy / Arc System Works", "Guilty Gear Isuka", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5910 | GAME( 2003, ggisuka, awbios, aw, aw, ggisuka, ROT0, "Sammy / Arc System Works", "Guilty Gear Isuka", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 6004 | 5911 | GAME( 2004, rumblef, awbios, aw, aw, rumblef, ROT0, "Sammy / Dimps", "The Rumble Fish", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 6005 | 5912 | GAME( 2004, rangrmsn, awbios, aw, aw, rangrmsn, ROT0, "Sammy", "Ranger Mission", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5913 | GAME( 2004, salmankt, awbios, aw, aw, salmankt, ROT0, "Sammy", "Salary Man Kintarou", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6006 | 5914 | GAME( 2004, kov7sprt, awbios, aw, aw, kov7sprt, ROT0, "Sammy / IGS", "Knights of Valour - The Seven Spirits", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 5915 | GAME( 2005, vfurlong, awbios, aw, aw, vfurlong, ROT0, "Sammy", "Net Select Keiba Victory Furlong", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6007 | 5916 | GAME( 2005, ngbc, awbios, aw, aw, ngbc, ROT0, "Sammy / SNK Playmore", "Neo-Geo Battle Coliseum", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6008 | 5917 | GAME( 2005, fotns, awbios, aw, aw, fotns, ROT0, "Sega / Arc System Works", "Fist Of The North Star", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6009 | 5918 | GAME( 2005, kofnw, awbios, aw, aw, kofnw, ROT0, "Sammy / SNK Playmore", "The King of Fighters Neowave", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
src/mame/drivers/neodrvr.c
| r5891 | r5892 | |
| 6 | 6 | |
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | |
| 10 | /* Game specific input definitions */ |
| 11 | |
| 9 | 12 | static INPUT_PORTS_START( svcpcb ) |
| 10 | 13 | STANDARD_IN0 |
| 11 | 14 | |
| r5891 | r5892 | |
| 299 | 302 | INPUT_PORTS_END |
| 300 | 303 | |
| 301 | 304 | |
| 305 | /* Neo-Geo bios */ |
| 302 | 306 | |
| 303 | | /******************************************************************************/ |
| 307 | /****************************************************************************** |
| 304 | 308 | |
| 305 | | /**** |
| 306 | 309 | These are the known Bios Roms, Set options.bios to the one you want |
| 307 | 310 | |
| 308 | | the Universe bios roms are supported because they're now used on enough PCBs |
| 311 | The Universe bios roms are supported because they're now used on enough PCBs |
| 309 | 312 | to be considered 'in active arcade use' rather than just homebrew hacks. |
| 310 | 313 | -- some may be missing, there have been multiple CRCs reported for the same |
| 311 | | revision in some cases |
| 314 | revision in some cases (the Universe bios has an option for entering / displaying |
| 315 | a serial number; these should be noted as such if they're added. |
| 312 | 316 | |
| 313 | 317 | The 'japan-hotel' BIOS is a dump of an MVS which could be found in some japanese |
| 314 | 318 | hotels. it is a custom MVS mobo which uses MVS carts but it hasn't jamma |
| 315 | 319 | connector and it's similar to a console with a coin mechanism, so it's a sort |
| 316 | 320 | of little coin op console installed in hotels. |
| 317 | 321 | |
| 318 | | ****/ |
| 322 | *****************************************************************************/ |
| 319 | 323 | |
| 320 | 324 | #define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ |
| 321 | 325 | ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios+1)) /* Note '+1' */ |
| r5891 | r5892 | |
| 369 | 373 | // ROM_SYSTEM_BIOS(22, "jap-aes", "Japan AES" ) |
| 370 | 374 | // ROM_LOAD16_WORD_SWAP_BIOS(22, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */ |
| 371 | 375 | |
| 372 | | |
| 373 | 376 | /* note you'll have to modify the last for lines of each block to use the extra bios roms, |
| 374 | 377 | they're hacks / homebrew / console bios roms so MAME doesn't list them by default */ |
| 375 | 378 | |
| 379 | |
| 376 | 380 | /****************************************************************************** |
| 377 | 381 | |
| 378 | 382 | The current Neo-Geo MVS system set (SFIX/SM1/000-LO) used is from a NEO-MVH MV1FS board. |
| r5891 | r5892 | |
| 490 | 494 | ROM_LOAD( "000-lo.lo", 0x00000, 0x20000, CRC(5a86cff2) SHA1(5992277debadeb64d1c1c64b0a92d9293eaf7e4a) ) |
| 491 | 495 | |
| 492 | 496 | |
| 497 | /* AES and MVS cartridge information */ |
| 498 | |
| 493 | 499 | /*************************************************************************** |
| 494 | 500 | |
| 495 | 501 | Neo-Geo game pcb infos: |
| r5891 | r5892 | |
| 680 | 686 | . Metal Slug 4 (AES) |
| 681 | 687 | . Metal Slug 4 (MVS, 1st revision) |
| 682 | 688 | . Metal Slug 5 (PCB) |
| 683 | | . 98 Best 44 |
| 689 | . Sengoku 3 (alternate revision) |
| 684 | 690 | |
| 685 | | Redump required: |
| 686 | | . All set with BAD_DUMP roms |
| 687 | | . Sets which have a p1h |
| 688 | | |
| 689 | 691 | All rom labels need to be reverified |
| 690 | 692 | |
| 691 | 693 | SMA protected sets: |
| r5891 | r5892 | |
| 694 | 696 | MVS sets confirmed are garou, mslug3, mslug3a and kof2000. |
| 695 | 697 | */ |
| 696 | 698 | |
| 699 | /* |
| 700 | |
| 701 | About supported sets: |
| 702 | |
| 703 | MVS carts (arcade) were released before the AES carts (home) |
| 704 | The actual codepath taken depends entirely on the BIOS rom, not the roms in the cartridge, which (with |
| 705 | a few exceptions) support both codepaths. |
| 706 | |
| 707 | The initial AES releases are therefore later revisions of the game, often with bug fixes over the |
| 708 | initial MVS releases. It isn't uncommon for later production runs and bootlegs to use these newer sets, |
| 709 | so all of them are supported in MAME. |
| 710 | |
| 711 | Likewise, because the MVS carts were released first (and were produced in higher numbers and generally |
| 712 | have a lower cost) it's not uncommon for AES units to operate with converted MVS carts, so, with the |
| 713 | exception of the sets that specifically lock out the AES mode* these sets are all equally suitable |
| 714 | for MESS. |
| 715 | |
| 716 | * nitd, kof2001 (initial release has no AES code), and a number of the hacked bootlegs. |
| 717 | |
| 718 | */ |
| 719 | |
| 720 | /* dummy entry for the dummy bios driver */ |
| 721 | ROM_START( neogeo ) |
| 722 | NEOGEO_BIOS |
| 723 | |
| 724 | ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASEFF ) |
| 725 | |
| 726 | ROM_REGION( 0x20000, "audiobios", 0 ) |
| 727 | ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) |
| 728 | |
| 729 | ROM_REGION( 0x50000, "audiocpu", 0 ) |
| 730 | ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) |
| 731 | |
| 732 | ROM_Y_ZOOM |
| 733 | |
| 734 | ROM_REGION( 0x20000, "fixed", ROMREGION_ERASEFF ) |
| 735 | |
| 736 | ROM_REGION( 0x20000, "fixedbios", 0 ) |
| 737 | ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) ) |
| 738 | |
| 739 | ROM_REGION( 0x10000, "ym", ROMREGION_ERASEFF ) |
| 740 | |
| 741 | NO_DELTAT_REGION |
| 742 | |
| 743 | ROM_REGION( 0x100000, "sprites", ROMREGION_ERASEFF ) |
| 744 | ROM_END |
| 745 | |
| 697 | 746 | ROM_START( nam1975 ) /* MVS AND AES VERSION */ |
| 698 | 747 | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 699 | 748 | ROM_LOAD16_WORD_SWAP( "001-p1.bin", 0x000000, 0x080000, CRC(cc9fc951) SHA1(92f4e6ddeeb825077d92dbb70b50afea985f15c0) ) |
| r5891 | r5892 | |
| 720 | 769 | ROM_LOAD16_BYTE( "001-c6.bin", 0x200001, 0x80000, CRC(e62bed58) SHA1(d05b2903b212a51ee131e52c761b714cb787683e) ) /* Plane 2,3 */ |
| 721 | 770 | ROM_END |
| 722 | 771 | |
| 723 | | ROM_START( bstars ) |
| 772 | ROM_START( bstars ) /* MVS VERSION */ |
| 724 | 773 | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 774 | ROM_LOAD16_WORD_SWAP( "002-pg.p1", 0x000000, 0x080000, CRC(c100b5f5) SHA1(4cea9f29ad67288c3eccfa4cf961ee9782e49165) ) |
| 775 | |
| 776 | NEO_SFIX_128K( "002-s1.bin", CRC(1a7fd0c6) SHA1(3fc701b7afddab369ddf9dedfbc5e1aaf80b8af3) ) |
| 777 | |
| 778 | /* MB832000 */ |
| 779 | NEO_BIOS_AUDIO_256K( "002-m1.bin", CRC(4ecaa4ee) SHA1(50abfb8eed6cb4887393089f9ccc76f306ef69b5) ) |
| 780 | |
| 781 | ROM_REGION( 0x200000, "ym", 0 ) |
| 782 | ROM_LOAD( "002-v11.bin", 0x000000, 0x080000, CRC(b7b925bd) SHA1(644c92fa90e74998e73714f74b1e0680ee372a07) ) |
| 783 | ROM_LOAD( "002-v12.bin", 0x080000, 0x080000, CRC(329f26fc) SHA1(2c8009edc88c6b26f7be5beb2b8d260aac394ee1) ) |
| 784 | ROM_LOAD( "002-v13.bin", 0x100000, 0x080000, CRC(0c39f3c8) SHA1(db8f8670639601215707d918d4fb93221460446a) ) |
| 785 | ROM_LOAD( "002-v14.bin", 0x180000, 0x080000, CRC(c7e11c38) SHA1(5abf2a7877e0162c758a4dcf09f183930fa7ef24) ) |
| 786 | |
| 787 | ROM_REGION( 0x080000, "ym.deltat", 0 ) |
| 788 | ROM_LOAD( "002-v21.bin", 0x000000, 0x080000, CRC(04a733d1) SHA1(84159368c0f6de2c3b8121227201cd3422455cf6) ) |
| 789 | |
| 790 | ROM_REGION( 0x300000, "sprites", 0 ) |
| 791 | ROM_LOAD16_BYTE( "002-c1.bin", 0x000000, 0x080000, CRC(aaff2a45) SHA1(c91ee72d1d74514df8ec44fca703409d92158ae3) ) /* Plane 0,1 */ |
| 792 | ROM_LOAD16_BYTE( "002-c2.bin", 0x000001, 0x080000, CRC(3ba0f7e4) SHA1(f023b134b9c7994f477867307d2732026033501d) ) /* Plane 2,3 */ |
| 793 | ROM_LOAD16_BYTE( "002-c3.bin", 0x100000, 0x080000, CRC(96f0fdfa) SHA1(9f779a1ae46aeda54d69382b074392ade687f62f) ) /* Plane 0,1 */ |
| 794 | ROM_LOAD16_BYTE( "002-c4.bin", 0x100001, 0x080000, CRC(5fd87f2f) SHA1(a5dd6f26f9485f216c2428ae1792c182beb10dbc) ) /* Plane 2,3 */ |
| 795 | ROM_LOAD16_BYTE( "002-c5.bin", 0x200000, 0x080000, CRC(807ed83b) SHA1(3268e7d4602c3f55f1e0da2c80653d5ae461ef67) ) /* Plane 0,1 */ |
| 796 | ROM_LOAD16_BYTE( "002-c6.bin", 0x200001, 0x080000, CRC(5a3cad41) SHA1(c620d18f4ff32ed5489c941dfc641030a54f1c14) ) /* Plane 2,3 */ |
| 797 | ROM_END |
| 798 | |
| 799 | ROM_START( bstarsh ) /* AES VERSION */ |
| 800 | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 725 | 801 | ROM_LOAD16_WORD_SWAP( "002-p1.bin", 0x000000, 0x080000, CRC(3bc7790e) SHA1(50b2fffb1278151bb4849fbe1f8cb23916019815) ) |
| 726 | 802 | |
| 727 | 803 | NEO_SFIX_128K( "002-s1.bin", CRC(1a7fd0c6) SHA1(3fc701b7afddab369ddf9dedfbc5e1aaf80b8af3) ) |
| r5891 | r5892 | |
| 1202 | 1278 | ROM_LOAD16_BYTE( "019-c2.bin", 0x000001, 0x080000, CRC(d4dd0802) SHA1(82069752028c118d42384a95befde45844f0f247) ) /* Plane 2,3 */ |
| 1203 | 1279 | ROM_END |
| 1204 | 1280 | |
| 1205 | | ROM_START( gpilots ) |
| 1281 | ROM_START( gpilots ) /* MVS VERSION */ |
| 1206 | 1282 | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 1207 | 1283 | ROM_LOAD16_WORD_SWAP( "020-p1.bin", 0x000000, 0x080000, CRC(e6f2fe64) SHA1(50ab82517e077727d97668a4df2b9b96d2e78ab6) ) |
| 1208 | 1284 | ROM_LOAD16_WORD_SWAP( "020-p2.bin", 0x080000, 0x020000, CRC(edcb22ac) SHA1(505d2db38ae999b7d436e8f2ff56b81796d62b54) ) |
| r5891 | r5892 | |
| 1747 | 1823 | ROM_START( 3countb ) /* MVS AND AES VERSION */ |
| 1748 | 1824 | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 1749 | 1825 | ROM_LOAD16_WORD_SWAP( "043-p1.bin", 0x000000, 0x100000, CRC(ffbdd928) SHA1(05b24655ca32723661adc5509b450824deb0c176) ) |
| 1750 | | |
| 1751 | 1826 | /* The original p1 is 8mbit; also found sets with p1 / p2 4mbit on eprom. */ |
| 1752 | 1827 | |
| 1753 | 1828 | NEO_SFIX_128K( "043-s1.bin", CRC(c362d484) SHA1(a3c029292572842feabe9aa8c3372628fb63978d) ) |
| r5891 | r5892 | |
| 1846 | 1921 | ROM_END |
| 1847 | 1922 | |
| 1848 | 1923 | /* Old version looked like this; p's on eprom? |
| 1849 | | |
| 1850 | 1924 | ROM_START( samsho ) |
| 1851 | 1925 | ROM_REGION( 0x180000, "maincpu", 0 ) |
| 1852 | 1926 | ROM_LOAD16_WORD_SWAP( "045-p1.bin", 0x000000, 0x080000, CRC(80aa6c97) SHA1(6e07a4aa7b4719ae487a10cee9389cb55a370a7a) ) |
| 1853 | 1927 | ROM_LOAD16_WORD_SWAP( "045-p2.bin", 0x080000, 0x080000, CRC(71768728) SHA1(9ff0e01d3fb73ad04279d4fdf4c53c3160888179) ) |
| 1854 | 1928 | ROM_LOAD16_WORD_SWAP( "045-p3.bin", 0x100000, 0x080000, CRC(38ee9ba9) SHA1(48190699a6be83cb6257365ae81f93fdd23abe09) ) |
| 1855 | | |
| 1856 | 1929 | */ |
| 1857 | 1930 | |
| 1858 | 1931 | ROM_START( tophuntr ) /* MVS VERSION */ |
| r5891 | r5892 | |
| 1883 | 1956 | ROM_LOAD16_BYTE( "046-c8.bin", 0x600001, 0x100000, CRC(c944e03d) SHA1(be23999b8ce09ee15ba500ce4d5e2a82a4f58d9b) ) /* Plane 2,3 */ |
| 1884 | 1957 | ROM_END |
| 1885 | 1958 | |
| 1886 | | ROM_START( tophuntra ) |
| 1959 | ROM_START( tophuntrh ) /* AES VERSION */ |
| 1887 | 1960 | ROM_REGION( 0x200000, "maincpu", 0 ) |
| 1888 | 1961 | ROM_LOAD16_WORD_SWAP( "046-pg1.bin",0x000000, 0x100000, CRC(771e39bc) SHA1(c0e05fd1ca81926438bb75e2fa6894e40ab6521e) ) |
| 1889 | 1962 | ROM_LOAD16_WORD_SWAP( "046-p2.bin", 0x100000, 0x100000, CRC(f182cb3e) SHA1(6b4e0af5d4e623f0682f37ff5c69e5b705e20028) ) |
| 1890 | 1963 | |
| 1891 | | NEO_SFIX_128K( "046-s1.bin", CRC(14b01d7b) SHA1(618ce75c25d6cc86a3b46bd64a0aa34ab82f75ae) ) |
| 1964 | NEO_SFIX_128K( "046-sg1.bin", CRC(92e9ac8c) SHA1(cab5c77c091e8d12d9c3a2cc8d741b74e4386efb) ) |
| 1892 | 1965 | |
| 1893 | 1966 | NEO_BIOS_AUDIO_128K( "046-m1.bin", CRC(3f84bb9f) SHA1(07446040871d11da3c2217ee9d1faf8c3cae7420) ) |
| 1894 | 1967 | |
| r5891 | r5892 | |
| 1962 | 2035 | |
| 1963 | 2036 | NEO_SFIX_128K( "049-s1.bin", CRC(6349de5d) SHA1(bcc44b9576d7bedd9a39294530bb66f707690c72) ) |
| 1964 | 2037 | |
| 1965 | | NEO_BIOS_AUDIO_128K( "049-m1.bin", CRC(1a009f8c) SHA1(7782dfe48e143417f34fba5353e6deb63efeaa8a) ) |
| 2038 | NEO_BIOS_AUDIO_128K( "049-m1.bin", CRC(edd2acf4) SHA1(c4ee6ba834d54b9fc5a854dbc41a05877e090371) ) |
| 1966 | 2039 | |
| 1967 | 2040 | ROM_REGION( 0x100000, "ym", 0 ) |
| 1968 | | ROM_LOAD( "049-v1.bin", 0x000000, 0x080000, CRC(577c85b3) SHA1(2c3072401fe73497dca0e9009ae2ba4053fe936d) ) |
| 1969 | | ROM_LOAD( "049-v2.bin", 0x080000, 0x080000, CRC(e14551c4) SHA1(763a9912b9df55defb190af3f29ae034f6dd78d6) ) |
| 1970 | | /* The MVS version has only v1 rom, size 8mbit. */ |
| 2041 | ROM_LOAD( "049-v1.bin", 0x000000, 0x100000, CRC(ce43cb89) SHA1(47f82e077abb6efc6b1b0490412ae147d5d2acef) ) |
| 1971 | 2042 | |
| 1972 | 2043 | NO_DELTAT_REGION |
| 1973 | 2044 | |
| r5891 | r5892 | |
| 2320 | 2391 | ROM_START( fightfeva ) /* MVS VERSION */ |
| 2321 | 2392 | ROM_REGION( 0x200000, "maincpu", 0 ) |
| 2322 | 2393 | ROM_LOAD16_WORD_SWAP( "060-p1.rom", 0x0000000, 0x100000, CRC(2a104b50) SHA1(3eb663d3df7074e1cdf4c0e450a35c9cf55d8979) ) |
| 2323 | | |
| 2324 | 2394 | /* There was also a copy of the 060-p1.bin with the name 060-p2.bin maybe it should be loaded over the top or this |
| 2325 | 2395 | larger rom is an older revision... */ |
| 2326 | 2396 | |
| r5891 | r5892 | |
| 2558 | 2628 | ROM_LOAD16_BYTE( "067-c2.bin", 0x000001, 0x200000, CRC(9db64084) SHA1(68a43c12f63f5e98d68ad0902a6551c5d30f8543) ) /* Plane 2,3 */ |
| 2559 | 2629 | ROM_END |
| 2560 | 2630 | |
| 2561 | | ROM_START( pspikes2 ) |
| 2631 | ROM_START( pspikes2 ) /* MVS VERSION */ |
| 2562 | 2632 | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 2563 | 2633 | ROM_LOAD16_WORD_SWAP( "068-pg1.bin", 0x000000, 0x100000, CRC(105a408f) SHA1(2ee51defa1c24c66c63a6498ee542ac26de3cfbb) ) |
| 2564 | 2634 | |
| r5891 | r5892 | |
| 2844 | 2914 | |
| 2845 | 2915 | ROM_START( pbobblen ) /* MVS VERSION */ |
| 2846 | 2916 | /* This set uses CHA and PROG board from Power Spikes II. Six Power Spikes II prom's are replaced with |
| 2847 | | Puzzle Bobble prom's. Confirmed on two original carts. Do other layouts also exist? Later production run set? */ |
| 2917 | Puzzle Bobble prom's. Confirmed on several original carts. Do other layouts also exist? */ |
| 2848 | 2918 | |
| 2849 | 2919 | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 2850 | 2920 | ROM_LOAD16_WORD_SWAP( "d96-07.ep1", 0x000000, 0x080000, CRC(6102ca14) SHA1(328429d11de5b327a0654ae0548da4d0025a2ae6) ) |
| r5891 | r5892 | |
| 2870 | 2940 | ROM_LOAD16_BYTE( "d96-03.c6", 0x400001, 0x80000, CRC(4b42d7eb) SHA1 (042ae50a528cea21cf07771d3915c57aa16fd5af) ) /* Plane 2,3 */ |
| 2871 | 2941 | ROM_END |
| 2872 | 2942 | |
| 2873 | | ROM_START( pbobblena ) |
| 2874 | | /* Does this set exist? Layout correct? */ |
| 2875 | | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 2876 | | ROM_LOAD16_WORD_SWAP( "083-p1.bin", 0x000000, 0x080000, CRC(ac1e9ef3) SHA1(a2b125ee70869667431ab125bc29e768500802ad) ) |
| 2877 | | |
| 2878 | | NEO_SFIX_128K( "d96-04.s1", CRC(9caae538) SHA1 (cf2d90a7c1a42107c0bb8b9a61397634286dbe0a) ) |
| 2879 | | |
| 2880 | | NEO_BIOS_AUDIO_128K( "d96-06.m1", CRC(f424368a) SHA1 (5e5bbcaeb82bed2ee17df08f005ca20ad1030723) ) |
| 2881 | | |
| 2882 | | ROM_REGION( 0x380000, "ym", 0 ) |
| 2883 | | /* 0x000000-0x1fffff empty */ |
| 2884 | | ROM_LOAD( "d96-01.v3", 0x200000, 0x100000, CRC(0840cbc4) SHA1 (1adbd7aef44fa80832f63dfb8efdf69fd7256a57) ) |
| 2885 | | ROM_LOAD( "d96-05.v4", 0x300000, 0x080000, CRC(0a548948) SHA1 (e1e4afd17811cb60401c14fbcf0465035165f4fb) ) |
| 2886 | | |
| 2887 | | NO_DELTAT_REGION |
| 2888 | | |
| 2889 | | ROM_REGION( 0x100000, "sprites", 0 ) |
| 2890 | | ROM_LOAD16_BYTE( "d96-02.c5", 0x000000, 0x80000, CRC(e89ad494) SHA1 (69c9ea415773af94ac44c48af05d55ada222b138) ) /* Plane 0,1 */ |
| 2891 | | ROM_LOAD16_BYTE( "d96-03.c6", 0x000001, 0x80000, CRC(4b42d7eb) SHA1 (042ae50a528cea21cf07771d3915c57aa16fd5af) ) /* Plane 2,3 */ |
| 2892 | | ROM_END |
| 2893 | | |
| 2894 | 2943 | ROM_START( kof95 ) |
| 2895 | 2944 | ROM_REGION( 0x200000, "maincpu", 0 ) |
| 2896 | 2945 | ROM_LOAD16_WORD_SWAP( "084-p1.bin",0x100000, 0x100000, CRC(2cba2716) SHA1(f6c2d0537c9c3e0938065c65b1797c47198fcff8) ) |
| r5891 | r5892 | |
| 3977 | 4026 | ROM_LOAD16_BYTE( "232-c6.bin", 0x2000001, 0x400000, CRC(4ff4d47b) SHA1(4d5689ede24a5fe4330bd85d4d3f4eb2795308bb) ) /* Plane 2,3 */ |
| 3978 | 4027 | ROM_END |
| 3979 | 4028 | |
| 3980 | | ROM_START( kof97a ) |
| 4029 | ROM_START( kof97h ) /* AES VERSION */ |
| 3981 | 4030 | ROM_REGION( 0x500000, "maincpu", 0 ) |
| 3982 | 4031 | ROM_LOAD16_WORD_SWAP( "232-pg1.bin",0x000000, 0x100000, CRC(5c2400b7) SHA1(49e23f80c012c62146a1bb8f254a7597823de430) ) |
| 3983 | 4032 | ROM_LOAD16_WORD_SWAP( "232-p2.bin", 0x100000, 0x400000, CRC(158b23f6) SHA1(9744620a70513490aaf9c5eda33e5ec31222be19) ) |
| r5891 | r5892 | |
| 4436 | 4485 | ROM_LOAD16_BYTE( "242-c8.bin", 0x3000001, 0x800000, CRC(c823e045) SHA1(886fbf64bcb58bc4eabb1fc9262f6ac9901a0f28) ) /* Plane 2,3 */ |
| 4437 | 4486 | ROM_END |
| 4438 | 4487 | |
| 4439 | | ROM_START( lastbld2 ) |
| 4488 | ROM_START( lastbld2 ) /* MVS AND AES VERSION */ /* later revision */ |
| 4440 | 4489 | ROM_REGION( 0x500000, "maincpu", 0 ) |
| 4441 | 4490 | ROM_LOAD16_WORD_SWAP( "243-pg1.bin", 0x000000, 0x100000, CRC(af1e6554) SHA1(bd8526f60c2472937728a5d933fbd19d899f2cba) ) |
| 4442 | 4491 | ROM_LOAD16_WORD_SWAP( "243-pg2.bin", 0x100000, 0x400000, CRC(add4a30b) SHA1(7db62564db49fe0218cbb35b119d62582a24d658) ) |
| r5891 | r5892 | |
| 4478 | 4527 | NO_DELTAT_REGION |
| 4479 | 4528 | |
| 4480 | 4529 | ROM_REGION( 0x1000000, "sprites", 0 ) |
| 4481 | | ROM_LOAD16_BYTE( "244-c1.bin", 0x000000, 0x800000, CRC(d2c40ec7) SHA1(989d972aabcc7f190bdd5d861d3e13c09dd0803e) ) /* Plane 0,1 */ |
| 4530 | ROM_LOAD16_BYTE( "244-c1.bin", 0x000000, 0x800000, CRC(c7a62b23) SHA1(4534ecc9ade69c543188c66229dcad89dbc48668) ) /* Plane 0,1 */ |
| 4482 | 4531 | ROM_LOAD16_BYTE( "244-c2.bin", 0x000001, 0x800000, CRC(33aa0f35) SHA1(3443c7765c6aa177003d42bbfcac9f31d1e12575) ) /* Plane 2,3 */ |
| 4483 | 4532 | ROM_END |
| 4484 | 4533 | |
| r5891 | r5892 | |
| 5311 | 5360 | ROM_LOAD16_BYTE( "262-c8-08-e0.bin", 0x3000001, 0x800000, CRC(59289a6b) SHA1(ddfce7c85b2a144975db5bb14b4b51aaf881880e) ) /* Plane 2,3 */ |
| 5312 | 5361 | ROM_END |
| 5313 | 5362 | |
| 5314 | | ROM_START( mslug4 ) /* Original Version - Encrypted GFX */ /* MVS VERSION */ /* 2nd revision */ |
| 5363 | ROM_START( mslug4 ) /* Original Version - Encrypted GFX */ /* MVS VERSION */ |
| 5315 | 5364 | ROM_REGION( 0x500000, "maincpu", 0 ) |
| 5316 | | ROM_LOAD16_WORD_SWAP( "263-pg1.bin", 0x000000, 0x100000, CRC(27e4def3) SHA1(a08785e8145981bb6b5332a3b2df7eb321253cca) ) |
| 5317 | | ROM_LOAD16_WORD_SWAP( "263-p2.bin", 0x100000, 0x400000, CRC(fdb7aed8) SHA1(dbeaec38f44e58ffedba99e70fa1439c2bf0dfa3) ) |
| 5365 | /* There also exist carts where p1 label is pg1; |
| 5366 | The PG1 revision has a Japanese cart label, SN 02Jxxxxx |
| 5367 | The P1 revision has a US/EUR cart label, SN 02Txxxxx |
| 5368 | Rom data on both is identical. |
| 5369 | These carts were manufactured by Mega Enterprise, not SNK. */ |
| 5370 | ROM_LOAD16_WORD_SWAP( "263-p1.bin", 0x000000, 0x100000, CRC(27e4def3) SHA1(a08785e8145981bb6b5332a3b2df7eb321253cca) ) |
| 5371 | ROM_LOAD16_WORD_SWAP( "263-p2.bin", 0x100000, 0x400000, CRC(fdb7aed8) SHA1(dbeaec38f44e58ffedba99e70fa1439c2bf0dfa3) ) |
| 5318 | 5372 | |
| 5319 | 5373 | ROM_Y_ZOOM |
| 5320 | 5374 | |
| r5891 | r5892 | |
| 5344 | 5398 | ROM_LOAD16_BYTE( "263-c6.bin", 0x2000001, 0x800000, CRC(5c8ba116) SHA1(6034db09c8706d4ddbcefc053efbc47a0953eb92) ) /* Plane 2,3 */ |
| 5345 | 5399 | ROM_END |
| 5346 | 5400 | |
| 5401 | ROM_START( mslug4h ) /* Original Version - Encrypted GFX */ /* AES VERSION */ |
| 5402 | ROM_REGION( 0x500000, "maincpu", 0 ) |
| 5403 | ROM_LOAD16_WORD_SWAP( "263-ph1.bin", 0x000000, 0x100000, CRC(c67f5c8d) SHA1(12af74964843f103520d9f0825069ea2f67eeb2f) ) |
| 5404 | ROM_LOAD16_WORD_SWAP( "263-ph2.bin", 0x100000, 0x400000, CRC(bc3ec89e) SHA1(2cb0626bc4fa57e1d25f208e04532b570d87b3fb) ) |
| 5405 | |
| 5406 | ROM_Y_ZOOM |
| 5407 | |
| 5408 | /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ |
| 5409 | ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */ |
| 5410 | ROM_FILL( 0x000000, 0x20000, 0 ) |
| 5411 | ROM_REGION( 0x20000, "fixedbios", 0 ) |
| 5412 | ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) ) |
| 5413 | |
| 5414 | /* Encrypted */ |
| 5415 | NEO_BIOS_AUDIO_ENCRYPTED_128K( "263-m1.bin", CRC(46ac8228) SHA1(5aeea221050c98e4bb0f16489ce772bf1c80f787) ) |
| 5416 | |
| 5417 | ROM_REGION( 0x1000000, "ym", 0 ) |
| 5418 | /* Encrypted */ |
| 5419 | ROM_LOAD( "263-v1.bin", 0x000000, 0x800000, CRC(01e9b9cd) SHA1(0b045c2999449f7dab5ae8a42e957d5b6650431e) ) |
| 5420 | ROM_LOAD( "263-v2.bin", 0x800000, 0x800000, CRC(4ab2bf81) SHA1(77ccfa48f7e3daddef5fe5229a0093eb2f803742) ) |
| 5421 | |
| 5422 | NO_DELTAT_REGION |
| 5423 | |
| 5424 | ROM_REGION( 0x3000000, "sprites", 0 ) |
| 5425 | /* Encrypted */ |
| 5426 | ROM_LOAD16_BYTE( "263-c1.bin", 0x0000000, 0x800000, CRC(84865f8a) SHA1(34467ada896eb7c7ca58658bf2a932936d8b632c) ) /* Plane 0,1 */ |
| 5427 | ROM_LOAD16_BYTE( "263-c2.bin", 0x0000001, 0x800000, CRC(81df97f2) SHA1(2b74493b8ec8fd49216a627aeb3db493f76124e3) ) /* Plane 2,3 */ |
| 5428 | ROM_LOAD16_BYTE( "263-c3.bin", 0x1000000, 0x800000, CRC(1a343323) SHA1(bbbb5232bba538c277ce2ee02e2956ca2243b787) ) /* Plane 0,1 */ |
| 5429 | ROM_LOAD16_BYTE( "263-c4.bin", 0x1000001, 0x800000, CRC(942cfb44) SHA1(d9b46c71726383c4581fb042e63897e5a3c92d1b) ) /* Plane 2,3 */ |
| 5430 | ROM_LOAD16_BYTE( "263-c5.bin", 0x2000000, 0x800000, CRC(a748854f) SHA1(2611bbedf9b5d8e82c6b2c99b88f842c46434d41) ) /* Plane 0,1 */ |
| 5431 | ROM_LOAD16_BYTE( "263-c6.bin", 0x2000001, 0x800000, CRC(5c8ba116) SHA1(6034db09c8706d4ddbcefc053efbc47a0953eb92) ) /* Plane 2,3 */ |
| 5432 | ROM_END |
| 5433 | |
| 5434 | |
| 5347 | 5435 | ROM_START( rotd ) /* Encrypted Set */ /* MVS VERSION */ |
| 5348 | 5436 | ROM_REGION( 0x800000, "maincpu", 0 ) |
| 5349 | 5437 | ROM_LOAD16_WORD_SWAP( "264-p1.bin", 0x000000, 0x800000, CRC(b8cc969d) SHA1(4f2205b4bdd32dd1522106ef4df10ac0eb1b852d) ) |
| r5891 | r5892 | |
| 6723 | 6811 | ROM_LOAD16_BYTE( "268-c8c.bin", 0x3000001, 0x800000, CRC(551d720e) SHA1(ebf69e334fcaba0fda6fd432fd0970283a365d12) ) /* Plane 2,3 */ |
| 6724 | 6812 | ROM_END |
| 6725 | 6813 | |
| 6814 | /* Puzzle Bobble / Bust-A-Move (Neo-Geo) bootleg */ |
| 6815 | |
| 6816 | ROM_START( pbobblenb ) |
| 6817 | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 6818 | ROM_LOAD16_WORD_SWAP( "u7", 0x000000, 0x080000, CRC(ac1e9ef3) SHA1(a2b125ee70869667431ab125bc29e768500802ad) ) |
| 6819 | |
| 6820 | NEO_SFIX_128K( "us1", CRC(9caae538) SHA1 (cf2d90a7c1a42107c0bb8b9a61397634286dbe0a) ) |
| 6821 | |
| 6822 | NEO_BIOS_AUDIO_128K( "um1", CRC(f424368a) SHA1 (5e5bbcaeb82bed2ee17df08f005ca20ad1030723) ) |
| 6823 | |
| 6824 | ROM_REGION( 0x380000, "ym", 0 ) |
| 6825 | /* 0x000000-0x1fffff empty */ |
| 6826 | ROM_LOAD( "u8", 0x200000, 0x100000, CRC(0840cbc4) SHA1 (1adbd7aef44fa80832f63dfb8efdf69fd7256a57) ) |
| 6827 | ROM_LOAD( "u9", 0x300000, 0x080000, CRC(0a548948) SHA1 (e1e4afd17811cb60401c14fbcf0465035165f4fb) ) |
| 6828 | |
| 6829 | NO_DELTAT_REGION |
| 6830 | |
| 6831 | ROM_REGION( 0x100000, "sprites", 0 ) |
| 6832 | ROM_LOAD16_BYTE( "uc5", 0x000000, 0x80000, CRC(e89ad494) SHA1 (69c9ea415773af94ac44c48af05d55ada222b138) ) /* Plane 0,1 */ |
| 6833 | ROM_LOAD16_BYTE( "uc6", 0x000001, 0x80000, CRC(4b42d7eb) SHA1 (042ae50a528cea21cf07771d3915c57aa16fd5af) ) /* Plane 2,3 */ |
| 6834 | ROM_END |
| 6835 | |
| 6726 | 6836 | /* SNK vs. CAPCOM SVC CHAOS bootlegs */ |
| 6727 | 6837 | |
| 6728 | 6838 | ROM_START( svcboot ) |
| r5891 | r5892 | |
| 7107 | 7217 | ROM_END |
| 7108 | 7218 | |
| 7109 | 7219 | |
| 7220 | /* Game specific inits */ |
| 7110 | 7221 | |
| 7111 | | /******************************************************************************/ |
| 7112 | | |
| 7113 | | /* dummy entry for the dummy bios driver */ |
| 7114 | | ROM_START( neogeo ) |
| 7115 | | NEOGEO_BIOS |
| 7116 | | |
| 7117 | | ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASEFF ) |
| 7118 | | |
| 7119 | | ROM_REGION( 0x20000, "audiobios", 0 ) |
| 7120 | | ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) |
| 7121 | | |
| 7122 | | ROM_REGION( 0x50000, "audiocpu", 0 ) |
| 7123 | | ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) |
| 7124 | | |
| 7125 | | ROM_Y_ZOOM |
| 7126 | | |
| 7127 | | ROM_REGION( 0x20000, "fixed", ROMREGION_ERASEFF ) |
| 7128 | | |
| 7129 | | ROM_REGION( 0x20000, "fixedbios", 0 ) |
| 7130 | | ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) ) |
| 7131 | | |
| 7132 | | ROM_REGION( 0x10000, "ym", ROMREGION_ERASEFF ) |
| 7133 | | |
| 7134 | | NO_DELTAT_REGION |
| 7135 | | |
| 7136 | | ROM_REGION( 0x100000, "sprites", ROMREGION_ERASEFF ) |
| 7137 | | ROM_END |
| 7138 | | |
| 7139 | | |
| 7140 | 7222 | static DRIVER_INIT( fatfury2 ) |
| 7141 | 7223 | { |
| 7142 | 7224 | DRIVER_INIT_CALL(neogeo); |
| r5891 | r5892 | |
| 7724 | 7806 | DRIVER_INIT_CALL(neogeo); |
| 7725 | 7807 | } |
| 7726 | 7808 | |
| 7809 | /***********************************************************************/ |
| 7727 | 7810 | |
| 7728 | 7811 | |
| 7729 | 7812 | /* YEAR NAME PARENT MACHINE INPUT INIT MONITOR */ |
| r5891 | r5892 | |
| 7731 | 7814 | |
| 7732 | 7815 | /* SNK */ |
| 7733 | 7816 | GAME( 1990, nam1975, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "NAM-1975", 0 ) |
| 7734 | | GAME( 1990, bstars, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars Professional", 0 ) |
| 7817 | GAME( 1990, bstars, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars Professional (set 1)", 0 ) |
| 7818 | GAME( 1990, bstarsh, bstars, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars Professional (set 2)", 0 ) |
| 7735 | 7819 | GAME( 1990, tpgolf, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Player's Golf", 0 ) |
| 7736 | 7820 | GAME( 1990, mahretsu, neogeo, neogeo, mjneogeo, neogeo, ROT0, "SNK", "Mahjong Kyoretsuden", 0 ) |
| 7737 | 7821 | GAME( 1990, ridhero, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Riding Hero (set 1)", 0 ) |
| r5891 | r5892 | |
| 7772 | 7856 | GAME( 1993, samsho, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown / Samurai Spirits (set 1)", 0 ) |
| 7773 | 7857 | GAME( 1993, samshoh, samsho, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown / Samurai Spirits (set 2)", 0 ) |
| 7774 | 7858 | GAME( 1994, tophuntr, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 1)", 0 ) |
| 7775 | | GAME( 1994, tophuntra,tophuntr, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 2)", 0 ) |
| 7859 | GAME( 1994, tophuntrh,tophuntr, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 2)", 0 ) |
| 7776 | 7860 | GAME( 1992, fatfury2, neogeo, neogeo, neogeo, fatfury2, ROT0, "SNK", "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai", 0 ) |
| 7777 | 7861 | GAME( 1992, ssideki, neogeo, neogeo, neogeo, fatfury2, ROT0, "SNK", "Super Sidekicks / Tokuten Ou", 0 ) |
| 7778 | 7862 | GAME( 1994, kof94, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '94", 0 ) |
| r5891 | r5892 | |
| 7803 | 7887 | GAME( 1996, samsho4k, samsho4, neogeo, neogeo, neogeo, ROT0, "SNK", "Pae Wang Jeon Seol / Legend of a Warrior (Korean censored Samurai Shodown IV)", 0 ) |
| 7804 | 7888 | GAME( 1996, rbffspec, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special", 0 ) |
| 7805 | 7889 | GAME( 1997, kof97, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '97 (set 1)", 0 ) |
| 7806 | | GAME( 1997, kof97a, kof97, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '97 (set 2)", 0 ) |
| 7890 | GAME( 1997, kof97h, kof97, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '97 (set 2)", 0 ) |
| 7807 | 7891 | GAME( 1997, kof97pls, kof97, neogeo, neogeo, neogeo, ROT0, "bootleg", "The King of Fighters '97 Plus (bootleg)", 0 ) |
| 7808 | 7892 | GAME( 1997, kog, kof97, neogeo, kog, kog, ROT0, "bootleg", "King of Gladiator (The King of Fighters '97 bootleg)", GAME_NOT_WORKING) // protected bootleg |
| 7809 | 7893 | GAME( 1997, lastblad, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 1)", 0 ) |
| r5891 | r5892 | |
| 7961 | 8045 | |
| 7962 | 8046 | /* Taito */ |
| 7963 | 8047 | GAME( 1994, pbobblen, neogeo, neogeo, neogeo, neogeo, ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 1)", 0 ) |
| 7964 | | GAME( 1994, pbobblena,pbobblen, neogeo, neogeo, neogeo, ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 2)", 0 ) |
| 8048 | GAME( 1994, pbobblenb,pbobblen, neogeo, neogeo, neogeo, ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (bootleg)", 0 ) |
| 7965 | 8049 | GAME( 1999, pbobbl2n, neogeo, neogeo, neogeo, neogeo, ROT0, "Taito (SNK license)", "Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo)", 0 ) |
| 7966 | 8050 | GAME( 2003, pnyaa, neogeo, neogeo, neogeo, pnyaa, ROT0, "Aiky / Taito", "Pochi and Nyaa", 0 ) |
| 7967 | 8051 | |
| r5891 | r5892 | |
| 8002 | 8086 | //GAME( 2000, bangbedp, bangbead, neogeo, neogeo, neogeo, ROT0, "Visco", "Bang Bead (prototype)", 0 ) |
| 8003 | 8087 | |
| 8004 | 8088 | /* Mega Enterprise */ |
| 8005 | | GAME( 2002, mslug4, neogeo, neogeo, neogeo, mslug4, ROT0, "Mega / Playmore", "Metal Slug 4", 0 ) |
| 8089 | GAME( 2002, mslug4, neogeo, neogeo, neogeo, mslug4, ROT0, "Mega / Playmore", "Metal Slug 4 (set 1)", 0 ) |
| 8090 | GAME( 2002, mslug4h, mslug4, neogeo, neogeo, mslug4, ROT0, "Mega / Playmore", "Metal Slug 4 (set 2)", 0 ) |
| 8006 | 8091 | GAME( 2002, ms4plus, mslug4, neogeo, neogeo, ms4plus, ROT0, "bootleg", "Metal Slug 4 Plus (bootleg)", 0 ) |
| 8007 | 8092 | |
| 8008 | 8093 | /* Evoga */ |
src/mame/drivers/cvs.c
| r5891 | r5892 | |
| 80 | 80 | Hardware Info |
| 81 | 81 | Malcolm & Darren |
| 82 | 82 | |
| 83 | Additional work |
| 84 | 2009 Couriersud |
| 85 | |
| 86 | Todo & FIXME: |
| 87 | |
| 88 | - the board most probably has discrete circuits. The 393Hz tone used |
| 89 | for shots (superbike) and collisions (8ball) is just a guess. |
| 90 | |
| 83 | 91 | ***************************************************************************/ |
| 84 | 92 | |
| 85 | 93 | #include "driver.h" |
| r5891 | r5892 | |
| 94 | 102 | #define CVS_SHOW_ALL_INPUTS 0 |
| 95 | 103 | |
| 96 | 104 | |
| 97 | | #define VERBOSE 1 |
| 105 | #define VERBOSE |
| 98 | 106 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 99 | 107 | |
| 100 | 108 | |
| r5891 | r5892 | |
| 113 | 121 | UINT8 *cvs_s2636_0_ram; |
| 114 | 122 | UINT8 *cvs_s2636_1_ram; |
| 115 | 123 | UINT8 *cvs_s2636_2_ram; |
| 124 | static UINT8 *cvs_fo_state; |
| 116 | 125 | |
| 117 | 126 | static emu_timer *cvs_393hz_timer; |
| 118 | 127 | static UINT8 cvs_393hz_clock; |
| 119 | 128 | static UINT8 *cvs_4_bit_dac_data; |
| 120 | 129 | static UINT8 *cvs_tms5110_ctl_data; |
| 130 | static UINT8 *dac3_state; |
| 121 | 131 | |
| 122 | 132 | static UINT8 character_banking_mode; |
| 123 | 133 | static UINT16 character_ram_page_start; |
| r5891 | r5892 | |
| 125 | 135 | |
| 126 | 136 | |
| 127 | 137 | |
| 138 | |
| 128 | 139 | UINT8 cvs_get_character_banking_mode(void) |
| 129 | 140 | { |
| 130 | 141 | return character_banking_mode; |
| r5891 | r5892 | |
| 140 | 151 | |
| 141 | 152 | READ8_HANDLER( cvs_video_or_color_ram_r ) |
| 142 | 153 | { |
| 143 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 154 | if (*cvs_fo_state) |
| 144 | 155 | return cvs_video_ram[offset]; |
| 145 | 156 | else |
| 146 | 157 | return cvs_color_ram[offset]; |
| r5891 | r5892 | |
| 148 | 159 | |
| 149 | 160 | WRITE8_HANDLER( cvs_video_or_color_ram_w ) |
| 150 | 161 | { |
| 151 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 162 | if (*cvs_fo_state) |
| 152 | 163 | cvs_video_ram[offset] = data; |
| 153 | 164 | else |
| 154 | 165 | cvs_color_ram[offset] = data; |
| r5891 | r5892 | |
| 157 | 168 | |
| 158 | 169 | READ8_HANDLER( cvs_bullet_ram_or_palette_r ) |
| 159 | 170 | { |
| 160 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 171 | if (*cvs_fo_state) |
| 161 | 172 | return cvs_palette_ram[offset & 0x0f]; |
| 162 | 173 | else |
| 163 | 174 | return cvs_bullet_ram[offset]; |
| r5891 | r5892 | |
| 165 | 176 | |
| 166 | 177 | WRITE8_HANDLER( cvs_bullet_ram_or_palette_w ) |
| 167 | 178 | { |
| 168 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 179 | if (*cvs_fo_state) |
| 169 | 180 | cvs_palette_ram[offset & 0x0f] = data; |
| 170 | 181 | else |
| 171 | 182 | cvs_bullet_ram[offset] = data; |
| r5891 | r5892 | |
| 174 | 185 | |
| 175 | 186 | READ8_HANDLER( cvs_s2636_0_or_character_ram_r ) |
| 176 | 187 | { |
| 177 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 188 | if (*cvs_fo_state) |
| 178 | 189 | return cvs_character_ram[(0 * 0x800) | 0x400 | character_ram_page_start | offset]; |
| 179 | 190 | else |
| 180 | 191 | return cvs_s2636_0_ram[offset]; |
| r5891 | r5892 | |
| 182 | 193 | |
| 183 | 194 | WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w ) |
| 184 | 195 | { |
| 185 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 196 | if (*cvs_fo_state) |
| 186 | 197 | { |
| 187 | 198 | offset |= (0 * 0x800) | 0x400 | character_ram_page_start; |
| 188 | 199 | cvs_character_ram[offset] = data; |
| r5891 | r5892 | |
| 195 | 206 | |
| 196 | 207 | READ8_HANDLER( cvs_s2636_1_or_character_ram_r ) |
| 197 | 208 | { |
| 198 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 209 | if (*cvs_fo_state) |
| 199 | 210 | return cvs_character_ram[(1 * 0x800) | 0x400 | character_ram_page_start | offset]; |
| 200 | 211 | else |
| 201 | 212 | return cvs_s2636_1_ram[offset]; |
| r5891 | r5892 | |
| 203 | 214 | |
| 204 | 215 | WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w ) |
| 205 | 216 | { |
| 206 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 217 | if (*cvs_fo_state) |
| 207 | 218 | { |
| 208 | 219 | offset |= (1 * 0x800) | 0x400 | character_ram_page_start; |
| 209 | 220 | cvs_character_ram[offset] = data; |
| r5891 | r5892 | |
| 216 | 227 | |
| 217 | 228 | READ8_HANDLER( cvs_s2636_2_or_character_ram_r ) |
| 218 | 229 | { |
| 219 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 230 | if (*cvs_fo_state) |
| 220 | 231 | return cvs_character_ram[(2 * 0x800) | 0x400 | character_ram_page_start | offset]; |
| 221 | 232 | else |
| 222 | 233 | return cvs_s2636_2_ram[offset]; |
| r5891 | r5892 | |
| 224 | 235 | |
| 225 | 236 | WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w ) |
| 226 | 237 | { |
| 227 | | if (cpu_get_reg(space->cpu, S2650_FO)) |
| 238 | if (*cvs_fo_state) |
| 228 | 239 | { |
| 229 | 240 | offset |= (2 * 0x800) | 0x400 | character_ram_page_start; |
| 230 | 241 | cvs_character_ram[offset] = data; |
| r5891 | r5892 | |
| 251 | 262 | } |
| 252 | 263 | |
| 253 | 264 | |
| 254 | | static void cvs_dac_cpu_interrupt(running_machine *machine) |
| 265 | static void cvs_slave_cpu_interrupt(running_machine *machine, const char *cpu, int state) |
| 255 | 266 | { |
| 256 | | cpu_set_input_line_vector(cputag_get_cpu(machine, "audiocpu"), 0, 0x03); |
| 257 | | cputag_set_input_line(machine, "audiocpu", 0, HOLD_LINE); |
| 267 | cpu_set_input_line_vector(cputag_get_cpu(machine, cpu), 0, 0x03); |
| 268 | //cputag_set_input_line(machine, cpu, 0, state ? ASSERT_LINE : CLEAR_LINE); |
| 269 | cputag_set_input_line(machine, cpu, 0, state ? HOLD_LINE : CLEAR_LINE); |
| 258 | 270 | } |
| 259 | 271 | |
| 260 | 272 | |
| r5891 | r5892 | |
| 295 | 307 | * Timing |
| 296 | 308 | * |
| 297 | 309 | *************************************/ |
| 298 | | |
| 310 | #if 0 |
| 299 | 311 | static READ8_HANDLER( cvs_393hz_clock_r ) |
| 300 | 312 | { |
| 301 | 313 | return cvs_393hz_clock ? 0x80 : 0; |
| 302 | 314 | } |
| 315 | #endif |
| 303 | 316 | |
| 317 | static READ8_DEVICE_HANDLER( tms_clock_r ) |
| 318 | { |
| 319 | return tms5110_romclk_r(device, 0) ? 0x80 : 0; |
| 320 | } |
| 304 | 321 | |
| 305 | 322 | static TIMER_CALLBACK( cvs_393hz_timer_cb ) |
| 306 | 323 | { |
| 307 | 324 | cvs_393hz_clock = !cvs_393hz_clock; |
| 325 | if (dac3_state[2]) |
| 326 | dac_w(devtag_get_device(machine, "dac3"), 0, cvs_393hz_clock * 0xff); |
| 308 | 327 | } |
| 309 | 328 | |
| 310 | 329 | |
| 311 | 330 | static void start_393hz_timer(running_machine *machine) |
| 312 | 331 | { |
| 313 | 332 | cvs_393hz_timer = timer_alloc(machine, cvs_393hz_timer_cb, NULL); |
| 314 | | timer_adjust_periodic(cvs_393hz_timer, ATTOTIME_IN_HZ(2*393), 0, ATTOTIME_IN_HZ(2*393)); |
| 333 | timer_adjust_periodic(cvs_393hz_timer, ATTOTIME_IN_HZ(30*393), 0, ATTOTIME_IN_HZ(30*393)); |
| 315 | 334 | } |
| 316 | 335 | |
| 317 | 336 | |
| r5891 | r5892 | |
| 325 | 344 | static WRITE8_DEVICE_HANDLER( cvs_4_bit_dac_data_w ) |
| 326 | 345 | { |
| 327 | 346 | UINT8 dac_value; |
| 347 | static int old_data[4] = {0,0,0,0}; |
| 328 | 348 | |
| 349 | if (data != old_data[offset]) |
| 350 | { |
| 351 | LOG(("4BIT: %02x %02x\n", offset, data)); |
| 352 | old_data[offset] = data; |
| 353 | } |
| 329 | 354 | cvs_4_bit_dac_data[offset] = data >> 7; |
| 330 | 355 | |
| 331 | 356 | /* merge into D0-D3 */ |
| r5891 | r5892 | |
| 338 | 363 | dac_data_w(device, (dac_value << 4) | dac_value); |
| 339 | 364 | } |
| 340 | 365 | |
| 366 | static WRITE8_DEVICE_HANDLER( cvs_unknown_w ) |
| 367 | { |
| 368 | /* offset 2 is used in 8ball |
| 369 | * offset 0 is used in spacefrt |
| 370 | * offset 3 is used in darkwar |
| 371 | * |
| 372 | * offset 1 is not used (no trace in disassembly |
| 373 | */ |
| 341 | 374 | |
| 375 | if (data != dac3_state[offset]) |
| 376 | { |
| 377 | if (offset != 2) |
| 378 | popmessage("Unknown: %02x %02x\n", offset, data); |
| 379 | dac3_state[offset] = data; |
| 380 | } |
| 381 | } |
| 342 | 382 | |
| 383 | |
| 343 | 384 | /************************************* |
| 344 | 385 | * |
| 345 | 386 | * Speech hardware |
| 346 | 387 | * |
| 347 | 388 | *************************************/ |
| 348 | 389 | |
| 349 | | /* temporary code begin */ |
| 350 | | static void speech_execute_command(const device_config *tms, UINT8 command) |
| 351 | | { |
| 352 | | /* reset */ |
| 353 | | if (command == 0x3f) |
| 354 | | { |
| 355 | | tms5110_ctl_w(tms, 0, TMS5110_CMD_RESET); |
| 356 | 390 | |
| 357 | | tms5110_pdc_w(tms, 0,0); |
| 358 | | tms5110_pdc_w(tms, 0,1); |
| 359 | | tms5110_pdc_w(tms, 0,0); |
| 360 | | |
| 361 | | tms5110_pdc_w(tms, 0,0); |
| 362 | | tms5110_pdc_w(tms, 0,1); |
| 363 | | tms5110_pdc_w(tms, 0,0); |
| 364 | | |
| 365 | | tms5110_pdc_w(tms, 0,0); |
| 366 | | tms5110_pdc_w(tms, 0,1); |
| 367 | | tms5110_pdc_w(tms, 0,0); |
| 368 | | |
| 369 | | speech_rom_bit_address = 0; |
| 370 | | } |
| 371 | | /* start */ |
| 372 | | else |
| 373 | | { |
| 374 | | tms5110_ctl_w(tms, 0, TMS5110_CMD_SPEAK); |
| 375 | | |
| 376 | | tms5110_pdc_w(tms, 0, 0); |
| 377 | | tms5110_pdc_w(tms, 0, 1); |
| 378 | | tms5110_pdc_w(tms, 0, 0); |
| 379 | | |
| 380 | | speech_rom_bit_address = command * 0x80 * 8; |
| 381 | | } |
| 382 | | } |
| 383 | | /* temporary code end */ |
| 384 | | |
| 385 | | |
| 386 | 391 | static WRITE8_HANDLER( cvs_speech_rom_address_lo_w ) |
| 387 | 392 | { |
| 388 | 393 | /* assuming that d0-d2 are cleared here */ |
| 389 | 394 | speech_rom_bit_address = (speech_rom_bit_address & 0xf800) | (data << 3); |
| 390 | | LOG(("%04x : CVS: Speech Address = %04x\n", cpu_get_pc(space->cpu), speech_rom_bit_address >> 3)); |
| 395 | LOG(("%04x : CVS: Speech Lo %02x Address = %04x\n", cpu_get_pc(space->cpu), data, speech_rom_bit_address >> 3)); |
| 391 | 396 | } |
| 392 | 397 | |
| 393 | 398 | static WRITE8_HANDLER( cvs_speech_rom_address_hi_w ) |
| 394 | 399 | { |
| 395 | 400 | speech_rom_bit_address = (speech_rom_bit_address & 0x07ff) | (data << 11); |
| 401 | LOG(("%04x : CVS: Speech Hi %02x Address = %04x\n", cpu_get_pc(space->cpu), data, speech_rom_bit_address >> 3)); |
| 396 | 402 | } |
| 397 | 403 | |
| 398 | 404 | |
| 399 | | static void cvs_set_speech_command_w(const address_space *space, UINT8 data) |
| 400 | | { |
| 401 | | soundlatch2_w(space, 0, data & 0x7f); |
| 402 | | if (~data & 0x40) LOG(("%04x : CVS: Speech Command W = %04x\n", cpu_get_pc(space->cpu), data & 0x7f)); |
| 403 | | } |
| 404 | | |
| 405 | | |
| 406 | 405 | static READ8_HANDLER( cvs_speech_command_r ) |
| 407 | 406 | { |
| 408 | | /* bit 7 is TMS status (active LO) */ |
| 409 | | return (~tms5110_status_r(devtag_get_device(space->machine, "tms"), 0) << 7) | soundlatch2_r(space, 0); |
| 407 | /* FIXME: this was by observation on board ??? |
| 408 | * -bit 7 is TMS status (active LO) */ |
| 409 | return ((tms5110_ctl_r(devtag_get_device(space->machine, "tms"), 0) ^ 1) << 7) |
| 410 | | (soundlatch_r(space, 0) & 0x7f); |
| 410 | 411 | } |
| 411 | 412 | |
| 412 | 413 | |
| 413 | 414 | static WRITE8_DEVICE_HANDLER( cvs_tms5110_ctl_w ) |
| 414 | 415 | { |
| 415 | 416 | UINT8 ctl; |
| 416 | | |
| 417 | /* |
| 418 | * offset 0: CS ? |
| 419 | */ |
| 417 | 420 | cvs_tms5110_ctl_data[offset] = (~data >> 7) & 0x01; |
| 418 | 421 | |
| 419 | 422 | ctl = 0 | /* CTL1 */ |
| 420 | 423 | (cvs_tms5110_ctl_data[1] << 1) | /* CTL2 */ |
| 421 | | 0 | /* CTL4 */ |
| 422 | | (cvs_tms5110_ctl_data[0] << 3); /* CTL8 */ |
| 424 | (cvs_tms5110_ctl_data[2] << 2) | /* CTL4 */ |
| 425 | (cvs_tms5110_ctl_data[1] << 3); /* CTL8 */ |
| 423 | 426 | |
| 424 | | //tms5110_ctl_w(device, ctl); |
| 427 | LOG(("CVS: Speech CTL = %04x %02x %02x\n", ctl, offset, data)); |
| 428 | tms5110_ctl_w(device, 0, ctl); |
| 425 | 429 | } |
| 426 | 430 | |
| 427 | 431 | |
| 428 | 432 | static WRITE8_DEVICE_HANDLER( cvs_tms5110_pdc_w ) |
| 429 | 433 | { |
| 430 | | //tms5110_pdc_w(device, ~data >> 7); |
| 434 | UINT8 out = ((~data) >> 7) & 1; |
| 435 | LOG(("CVS: Speech PDC = %02x %02x\n", offset, out)); |
| 436 | tms5110_pdc_w(device, 0, out); |
| 431 | 437 | } |
| 432 | 438 | |
| 433 | 439 | |
| r5891 | r5892 | |
| 464 | 470 | |
| 465 | 471 | static WRITE8_HANDLER( audio_command_w ) |
| 466 | 472 | { |
| 473 | LOG(("data %02x\n", data)); |
| 467 | 474 | /* cause interrupt on audio CPU if bit 7 set */ |
| 468 | | if (data & 0x80) |
| 469 | | { |
| 470 | | soundlatch_w(space, 0, data); |
| 471 | | cvs_dac_cpu_interrupt(space->machine); |
| 472 | | |
| 473 | | LOG(("%04x : CVS: Audio command = %02x\n", cpu_get_pc(space->cpu), data)); |
| 474 | | } |
| 475 | | |
| 476 | | cvs_set_speech_command_w(space, data); |
| 477 | | |
| 478 | | /* temporary code begin */ |
| 479 | | if ((data & 0x40) == 0) |
| 480 | | speech_execute_command(devtag_get_device(space->machine, "tms"), data & 0x03f); |
| 481 | | /* temporary code end */ |
| 475 | soundlatch_w(space, 0, data); |
| 476 | cvs_slave_cpu_interrupt(space->machine, "audiocpu", data & 0x80 ? 1 : 0); |
| 482 | 477 | } |
| 483 | 478 | |
| 484 | 479 | |
| r5891 | r5892 | |
| 541 | 536 | AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READWRITE(cvs_collision_clear, cvs_video_fx_w) |
| 542 | 537 | AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_READWRITE(cvs_collision_r, audio_command_w) |
| 543 | 538 | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE") |
| 539 | AM_RANGE(S2650_FO_PORT, S2650_FO_PORT) AM_RAM AM_BASE(&cvs_fo_state) |
| 544 | 540 | ADDRESS_MAP_END |
| 545 | 541 | |
| 546 | 542 | |
| r5891 | r5892 | |
| 558 | 554 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_r) |
| 559 | 555 | AM_RANGE(0x1840, 0x1840) AM_DEVWRITE("dac1", dac_w) |
| 560 | 556 | AM_RANGE(0x1880, 0x1883) AM_DEVWRITE("dac2", cvs_4_bit_dac_data_w) AM_BASE(&cvs_4_bit_dac_data) |
| 561 | | AM_RANGE(0x1884, 0x1887) AM_WRITENOP /* not connected to anything */ |
| 557 | AM_RANGE(0x1884, 0x1887) AM_DEVWRITE("dac3", cvs_unknown_w) AM_BASE(&dac3_state) /* ???? not connected to anything */ |
| 562 | 558 | ADDRESS_MAP_END |
| 563 | 559 | |
| 564 | 560 | |
| 565 | 561 | static ADDRESS_MAP_START( cvs_dac_cpu_io_map, ADDRESS_SPACE_IO, 8 ) |
| 566 | | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(cvs_393hz_clock_r) |
| 562 | /* doesn't look like it is used at all */ |
| 563 | //AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(cvs_393hz_clock_r) |
| 567 | 564 | ADDRESS_MAP_END |
| 568 | 565 | |
| 569 | 566 | |
| r5891 | r5892 | |
| 580 | 577 | AM_RANGE(0x1d00, 0x1d00) AM_WRITE(cvs_speech_rom_address_lo_w) |
| 581 | 578 | AM_RANGE(0x1d40, 0x1d40) AM_WRITE(cvs_speech_rom_address_hi_w) |
| 582 | 579 | AM_RANGE(0x1d80, 0x1d80) AM_READ(cvs_speech_command_r) |
| 583 | | AM_RANGE(0x1ddd, 0x1dde) AM_DEVWRITE("tms", cvs_tms5110_ctl_w) AM_BASE(&cvs_tms5110_ctl_data) |
| 580 | AM_RANGE(0x1ddc, 0x1dde) AM_DEVWRITE("tms", cvs_tms5110_ctl_w) AM_BASE(&cvs_tms5110_ctl_data) |
| 584 | 581 | AM_RANGE(0x1ddf, 0x1ddf) AM_DEVWRITE("tms", cvs_tms5110_pdc_w) |
| 585 | 582 | ADDRESS_MAP_END |
| 586 | 583 | |
| 587 | 584 | |
| 588 | 585 | static ADDRESS_MAP_START( cvs_speech_cpu_io_map, ADDRESS_SPACE_IO, 8 ) |
| 589 | | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(cvs_393hz_clock_r) |
| 586 | /* romclk is much more probable, 393 Hz results in timing issues */ |
| 587 | // AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(cvs_393hz_clock_r) |
| 588 | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_DEVREAD("tms", tms_clock_r) |
| 590 | 589 | ADDRESS_MAP_END |
| 591 | 590 | |
| 592 | 591 | |
| 593 | | |
| 594 | 592 | /************************************* |
| 595 | 593 | * |
| 596 | 594 | * Standard CVS port definitions |
| r5891 | r5892 | |
| 1051 | 1049 | MDRV_SOUND_ADD("dac1", DAC, 0) |
| 1052 | 1050 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1053 | 1051 | |
| 1052 | //MDRV_SOUND_ADD("dac1a", DAC, 0) |
| 1053 | //MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1054 | |
| 1054 | 1055 | MDRV_SOUND_ADD("dac2", DAC, 0) |
| 1055 | 1056 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1056 | 1057 | |
| 1058 | MDRV_SOUND_ADD("dac3", DAC, 0) |
| 1059 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1060 | |
| 1057 | 1061 | MDRV_SOUND_ADD("tms", TMS5100, 640000) |
| 1058 | 1062 | MDRV_SOUND_CONFIG(tms5100_interface) |
| 1059 | 1063 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| r5891 | r5892 | |
| 1641 | 1645 | * |
| 1642 | 1646 | *************************************/ |
| 1643 | 1647 | |
| 1644 | | GAME( 1981, cosmos, 0, cvs, cosmos, 0, ROT90, "Century Electronics", "Cosmos", GAME_NO_COCKTAIL ) |
| 1645 | | GAME( 1981, darkwar, 0, cvs, darkwar, 0, ROT90, "Century Electronics", "Dark Warrior", GAME_NO_COCKTAIL ) |
| 1646 | | GAME( 1981, spacefrt, 0, cvs, spacefrt, 0, ROT90, "Century Electronics", "Space Fortress (CVS)", GAME_NO_COCKTAIL ) |
| 1647 | | GAME( 1982, 8ball, 0, cvs, 8ball, 0, ROT90, "Century Electronics", "Video Eight Ball", GAME_NO_COCKTAIL ) |
| 1648 | | GAME( 1982, 8ball1, 8ball, cvs, 8ball, 0, ROT90, "Century Electronics", "Video Eight Ball (Rev.1)", GAME_NO_COCKTAIL ) |
| 1649 | | GAME( 1982, logger, 0, cvs, logger, 0, ROT90, "Century Electronics", "Logger", GAME_NO_COCKTAIL ) |
| 1650 | | GAME( 1982, dazzler, 0, cvs, dazzler, 0, ROT90, "Century Electronics", "Dazzler", GAME_NO_COCKTAIL ) |
| 1651 | | GAME( 1982, wallst, 0, cvs, wallst, 0, ROT90, "Century Electronics", "Wall Street", GAME_NO_COCKTAIL ) |
| 1652 | | GAME( 1982, radarzon, 0, cvs, radarzon, 0, ROT90, "Century Electronics", "Radar Zone", GAME_NO_COCKTAIL ) |
| 1653 | | GAME( 1982, radarzon1,radarzon, cvs, radarzon, 0, ROT90, "Century Electronics", "Radar Zone (Rev.1)", GAME_NO_COCKTAIL ) |
| 1654 | | GAME( 1982, radarzont,radarzon, cvs, radarzon, 0, ROT90, "Century Electronics (Tuni Electro Service Inc)", "Radar Zone (Tuni)", GAME_NO_COCKTAIL ) |
| 1655 | | GAME( 1982, outline, radarzon, cvs, radarzon, 0, ROT90, "Century Electronics", "Outline", GAME_NO_COCKTAIL ) |
| 1656 | | GAME( 1982, goldbug, 0, cvs, goldbug, 0, ROT90, "Century Electronics", "Gold Bug", GAME_NO_COCKTAIL ) |
| 1657 | | GAME( 1982, diggerc, 0, cvs, diggerc, 0, ROT90, "Century Electronics", "Digger (CVS)", GAME_NO_COCKTAIL ) |
| 1658 | | GAME( 1983, heartatk, 0, cvs, heartatk, 0, ROT90, "Century Electronics", "Heart Attack", GAME_NO_COCKTAIL ) |
| 1659 | | GAME( 1983, hunchbak, 0, cvs, hunchbak, 0, ROT90, "Century Electronics", "Hunchback (set 1)", GAME_NO_COCKTAIL ) |
| 1660 | | GAME( 1983, hunchbaka,hunchbak, cvs, hunchbak, hunchbka, ROT90, "Century Electronics", "Hunchback (set 2)", GAME_NO_COCKTAIL ) |
| 1661 | | GAME( 1983, superbik, 0, cvs, superbik, superbik, ROT90, "Century Electronics", "Superbike", GAME_NO_COCKTAIL ) |
| 1662 | | GAME( 1983, raiders, 0, cvs, raiders, raiders, ROT90, "Century Electronics", "Raiders", GAME_NO_COCKTAIL ) |
| 1663 | | GAME( 1983, hero, 0, cvs, hero, hero, ROT90, "Seatongrove Ltd", "Hero", GAME_NO_COCKTAIL ) |
| 1664 | | GAME( 1984, huncholy, 0, cvs, huncholy, huncholy, ROT90, "Seatongrove Ltd", "Hunchback Olympic", GAME_NO_COCKTAIL ) |
| 1648 | GAME( 1981, cosmos, 0, cvs, cosmos, 0, ROT90, "Century Electronics", "Cosmos", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND ) |
| 1649 | GAME( 1981, darkwar, 0, cvs, darkwar, 0, ROT90, "Century Electronics", "Dark Warrior", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1650 | GAME( 1981, spacefrt, 0, cvs, spacefrt, 0, ROT90, "Century Electronics", "Space Fortress (CVS)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND ) |
| 1651 | GAME( 1982, 8ball, 0, cvs, 8ball, 0, ROT90, "Century Electronics", "Video Eight Ball", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1652 | GAME( 1982, 8ball1, 8ball, cvs, 8ball, 0, ROT90, "Century Electronics", "Video Eight Ball (Rev.1)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1653 | GAME( 1982, logger, 0, cvs, logger, 0, ROT90, "Century Electronics", "Logger", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1654 | GAME( 1982, dazzler, 0, cvs, dazzler, 0, ROT90, "Century Electronics", "Dazzler", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1655 | GAME( 1982, wallst, 0, cvs, wallst, 0, ROT90, "Century Electronics", "Wall Street", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1656 | GAME( 1982, radarzon, 0, cvs, radarzon, 0, ROT90, "Century Electronics", "Radar Zone", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1657 | GAME( 1982, radarzon1,radarzon, cvs, radarzon, 0, ROT90, "Century Electronics", "Radar Zone (Rev.1)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1658 | GAME( 1982, radarzont,radarzon, cvs, radarzon, 0, ROT90, "Century Electronics (Tuni Electro Service Inc)", "Radar Zone (Tuni)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1659 | GAME( 1982, outline, radarzon, cvs, radarzon, 0, ROT90, "Century Electronics", "Outline", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1660 | GAME( 1982, goldbug, 0, cvs, goldbug, 0, ROT90, "Century Electronics", "Gold Bug", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1661 | GAME( 1982, diggerc, 0, cvs, diggerc, 0, ROT90, "Century Electronics", "Digger (CVS)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1662 | GAME( 1983, heartatk, 0, cvs, heartatk, 0, ROT90, "Century Electronics", "Heart Attack", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1663 | GAME( 1983, hunchbak, 0, cvs, hunchbak, 0, ROT90, "Century Electronics", "Hunchback (set 1)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1664 | GAME( 1983, hunchbaka,hunchbak, cvs, hunchbak, hunchbka, ROT90, "Century Electronics", "Hunchback (set 2)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1665 | GAME( 1983, superbik, 0, cvs, superbik, superbik, ROT90, "Century Electronics", "Superbike", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1666 | GAME( 1983, raiders, 0, cvs, raiders, raiders, ROT90, "Century Electronics", "Raiders", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1667 | GAME( 1983, hero, 0, cvs, hero, hero, ROT90, "Seatongrove Ltd", "Hero", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
| 1668 | GAME( 1984, huncholy, 0, cvs, huncholy, huncholy, ROT90, "Seatongrove Ltd", "Hunchback Olympic", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND) |
src/mame/drivers/exzisus.c
| r5891 | r5892 | |
| 10 | 10 | |
| 11 | 11 | Supported games : |
| 12 | 12 | ================== |
| 13 | | Exzisus (C) 1987 Taito |
| 13 | Exzisus (2 sets) (C) 1987 Taito |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | System specs : |
| 17 | 17 | =============== |
| 18 | | CPU : Z80(4 MHz) x 4 |
| 19 | | Sound : YM2151 x 1 |
| 20 | | Chips : TC0010VCU + TC0140SYT |
| 18 | CPU : Z80 x 4 |
| 19 | Sound : YM2151 |
| 20 | Chips : TC0010VCU x 2 + TC0140SYT |
| 21 | 21 | |
| 22 | There are two types of Exzisus PCB: |
| 22 | 23 | |
| 24 | * The first (K1100256A) has separate RGB outputs for the background and sprites. |
| 25 | Exactly how they are combined to form the final image is unknown. |
| 26 | * The second, later PCB has a single video output and is JAMMA compliant. |
| 27 | |
| 23 | 28 | TODO: |
| 24 | 29 | - There must be a way for cpu a to stop cpu c, otherwise the RAM check in test |
| 25 | 30 | mode cannot work. However, the only way I found to do that is making writes |
| r5891 | r5892 | |
| 70 | 75 | |
| 71 | 76 | static WRITE8_HANDLER( exzisus_cpua_bankswitch_w ) |
| 72 | 77 | { |
| 73 | | UINT8 *RAM = memory_region(space->machine, "maincpu"); |
| 78 | UINT8 *RAM = memory_region(space->machine, "cpua"); |
| 74 | 79 | static int exzisus_cpua_bank = 0; |
| 75 | 80 | |
| 76 | 81 | if ( (data & 0x0f) != exzisus_cpua_bank ) |
| r5891 | r5892 | |
| 141 | 146 | // the RAM check to work |
| 142 | 147 | static DRIVER_INIT( exzisus ) |
| 143 | 148 | { |
| 144 | | UINT8 *RAM = memory_region(machine, "maincpu"); |
| 149 | UINT8 *RAM = memory_region(machine, "cpua"); |
| 145 | 150 | |
| 146 | 151 | /* Fix WORK RAM error */ |
| 147 | 152 | RAM[0x67fd] = 0x18; |
| r5891 | r5892 | |
| 270 | 275 | }; |
| 271 | 276 | |
| 272 | 277 | static GFXDECODE_START( exzisus ) |
| 273 | | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 256 ) |
| 274 | | GFXDECODE_ENTRY( "gfx2", 0, charlayout, 256, 256 ) |
| 278 | GFXDECODE_ENTRY( "bg0", 0, charlayout, 0, 256 ) |
| 279 | GFXDECODE_ENTRY( "bg1", 0, charlayout, 256, 256 ) |
| 275 | 280 | GFXDECODE_END |
| 276 | 281 | |
| 277 | 282 | |
| r5891 | r5892 | |
| 287 | 292 | }; |
| 288 | 293 | |
| 289 | 294 | |
| 290 | | |
| 295 | /* All clocks are unconfirmed */ |
| 291 | 296 | static MACHINE_DRIVER_START( exzisus ) |
| 292 | 297 | |
| 293 | 298 | /* basic machine hardware */ |
| 294 | | MDRV_CPU_ADD("maincpu", Z80, 6000000) /* 6 MHz ??? */ |
| 299 | MDRV_CPU_ADD("cpua", Z80, 6000000) |
| 295 | 300 | MDRV_CPU_PROGRAM_MAP(cpua_map) |
| 296 | 301 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 297 | 302 | |
| 298 | | MDRV_CPU_ADD("audiocpu", Z80, 4000000) /* 4 MHz ??? */ |
| 299 | | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 300 | | |
| 301 | | MDRV_CPU_ADD("cpub", Z80, 6000000) /* 6 MHz ??? */ |
| 303 | MDRV_CPU_ADD("cpub", Z80, 6000000) |
| 302 | 304 | MDRV_CPU_PROGRAM_MAP(cpub_map) |
| 303 | 305 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 304 | 306 | |
| 305 | | MDRV_CPU_ADD("cpuc", Z80, 6000000) /* 6 MHz ??? */ |
| 307 | MDRV_CPU_ADD("cpuc", Z80, 6000000) |
| 306 | 308 | MDRV_CPU_PROGRAM_MAP(cpuc_map) |
| 307 | 309 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| 308 | 310 | |
| 311 | MDRV_CPU_ADD("audiocpu", Z80, 4000000) |
| 312 | MDRV_CPU_PROGRAM_MAP(sound_map) |
| 313 | |
| 309 | 314 | MDRV_QUANTUM_TIME(HZ(600)) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ |
| 310 | 315 | |
| 311 | 316 | /* video hardware */ |
| r5891 | r5892 | |
| 339 | 344 | ***************************************************************************/ |
| 340 | 345 | |
| 341 | 346 | ROM_START( exzisus ) |
| 342 | | ROM_REGION( 0x48000, "maincpu", 0 ) /* Z80 CPU A */ |
| 343 | | ROM_LOAD( "b23-10.bin", 0x00000, 0x08000, CRC(c80216fc) SHA1(7b952779c420be08573768f09bd65d0a188df024) ) |
| 347 | ROM_REGION( 0x48000, "cpua", 0 ) |
| 348 | ROM_LOAD( "b12-09.7d", 0x00000, 0x08000, CRC(e80f49a9) SHA1(3995d52195cdadfa82ff992ec0456fce09e75132) ) |
| 344 | 349 | ROM_CONTINUE( 0x10000, 0x08000 ) |
| 345 | | ROM_LOAD( "b23-12.bin", 0x18000, 0x10000, CRC(13637f54) SHA1(c175bc60120e32eec6ccca822fa497a42dd59823) ) |
| 350 | ROM_LOAD( "b12-11.9d", 0x18000, 0x10000, CRC(11fcda2c) SHA1(4f8d1dff339d96ffadde2cc7eec23cfeb42481f2) ) |
| 346 | 351 | |
| 347 | | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 for Sound */ |
| 348 | | ROM_LOAD( "b23-14.bin", 0x00000, 0x08000, CRC(f7ca7df2) SHA1(6048d9341f0303546e447a76439e1927d14cdd57) ) |
| 352 | ROM_REGION( 0x48000, "cpub", 0 ) |
| 353 | ROM_LOAD( "b12-10.7f", 0x00000, 0x08000, CRC(a60227f1) SHA1(1e0d09f6b77794095092316fe8bf823d4c7775bb) ) |
| 354 | ROM_CONTINUE( 0x10000, 0x08000 ) |
| 355 | ROM_LOAD( "b12-12.8f", 0x18000, 0x10000, CRC(a662be67) SHA1(0643480d56d8ac020288db800a705dd5d0d3ad9f) ) |
| 356 | ROM_LOAD( "b12-13.10f", 0x28000, 0x10000, CRC(04a29633) SHA1(39476365241718f01f9630c12467cb24791a67e1) ) |
| 349 | 357 | |
| 350 | | ROM_REGION( 0x48000, "cpub", 0 ) /* Z80 CPU B */ |
| 351 | | ROM_LOAD( "b23-11.bin", 0x00000, 0x08000, CRC(d6a79cef) SHA1(e2b56aa38c017b24b50f304b9fe49ee14006f9a4) ) |
| 358 | ROM_REGION( 0x10000, "cpuc", 0 ) |
| 359 | ROM_LOAD( "b12-14.12c", 0x00000, 0x08000, CRC(b5ce5e75) SHA1(6d5ec788684e1be4c727ac02b9fa313a42985b40) ) |
| 360 | |
| 361 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 362 | ROM_LOAD( "b12-21.19f", 0x00000, 0x08000, CRC(b7e0f00e) SHA1(f79ef0dee6bd29c09b8e5c586514200e3fbaa87e) ) |
| 363 | |
| 364 | ROM_REGION( 0x80000, "bg0", ROMREGION_INVERT ) |
| 365 | ROM_LOAD( "b12-16.17d", 0x00000, 0x10000, CRC(6fec6acb) SHA1(2289c116d3f6093988a088d011f192dd4a99aa77) ) |
| 366 | ROM_LOAD( "b12-18.19d", 0x10000, 0x10000, CRC(64e358aa) SHA1(cd1a23458b1a2f9c8c8aea8086dc04e0f6cc6908) ) |
| 367 | ROM_LOAD( "b12-20.20d", 0x20000, 0x10000, CRC(87f52e89) SHA1(3f8530aca087fa2a32dc6dfbcfe2f86604ee3ca1) ) |
| 368 | ROM_LOAD( "b12-15.17c", 0x40000, 0x10000, CRC(d81107c8) SHA1(c024c9b7956de493687e1373318d4cd74b3555b2) ) |
| 369 | ROM_LOAD( "b12-17.19c", 0x50000, 0x10000, CRC(db1d5a6c) SHA1(c2e1b8d92c2b3b2ce775ed50ca4a37e84ed35a93) ) |
| 370 | ROM_LOAD( "b12-19.20c", 0x60000, 0x10000, CRC(772b2641) SHA1(35cc6d5a725f1817791e710afde992e64d14104f) ) |
| 371 | |
| 372 | ROM_REGION( 0x80000, "bg1", ROMREGION_INVERT ) |
| 373 | ROM_LOAD( "b12-05.1c", 0x00000, 0x10000, CRC(be5c5cc1) SHA1(af50c1ee0ce134871ea636c0e939f1a007a1cc13) ) |
| 374 | ROM_LOAD( "b12-07.3c", 0x10000, 0x10000, CRC(9353e39f) SHA1(576620818eb7a50a86aac0376a58ac22a29bb16d) ) |
| 375 | ROM_LOAD( "b12-06.1d", 0x40000, 0x10000, CRC(8571e6ed) SHA1(0a3228408f4d2afe3744172d24ae41d6400c30b6) ) |
| 376 | ROM_LOAD( "b12-08.3d", 0x50000, 0x10000, CRC(55ea5cca) SHA1(5717652ca028ff7a55c40573d52755985ed77ef7) ) |
| 377 | |
| 378 | ROM_REGION( 0x00c00, "proms", 0 ) |
| 379 | ROM_LOAD( "b12-27.13l", 0x00000, 0x00100, CRC(524c9a01) SHA1(1894de29ba15a26043706ca4c5ca33aa8373447a) ) |
| 380 | ROM_LOAD( "b12-24.6m", 0x00100, 0x00100, CRC(1aa5bde9) SHA1(1bb6d5614183ff98600c5555ec8f5c545648e55c) ) |
| 381 | ROM_LOAD( "b12-26.12l", 0x00400, 0x00100, CRC(65f42c61) SHA1(7dc493d918f16661e3524c4189e785edfd345dbb) ) |
| 382 | ROM_LOAD( "b12-23.4m", 0x00500, 0x00100, CRC(fad4db5f) SHA1(bb1169ed6147fb9ac413f0d63e428dd190e7641d) ) |
| 383 | ROM_LOAD( "b12-25.11l", 0x00800, 0x00100, CRC(3e30f45b) SHA1(aa1f5278975c101f03feb16cac0bd074a6a41d2c) ) |
| 384 | ROM_LOAD( "b12-22.2m", 0x00900, 0x00100, CRC(936855d2) SHA1(57bb7cb40462f37e49c4ff0d9c833bbd2fb78428) ) |
| 385 | ROM_END |
| 386 | |
| 387 | ROM_START( exzisusa ) |
| 388 | ROM_REGION( 0x48000, "cpua", 0 ) |
| 389 | ROM_LOAD( "b23-10.7d", 0x00000, 0x08000, CRC(c80216fc) SHA1(7b952779c420be08573768f09bd65d0a188df024) ) |
| 352 | 390 | ROM_CONTINUE( 0x10000, 0x08000 ) |
| 353 | | ROM_LOAD( "b12-12.bin", 0x18000, 0x10000, CRC(a662be67) SHA1(0643480d56d8ac020288db800a705dd5d0d3ad9f) ) |
| 354 | | ROM_LOAD( "b12-13.bin", 0x28000, 0x10000, CRC(04a29633) SHA1(39476365241718f01f9630c12467cb24791a67e1) ) |
| 391 | ROM_LOAD( "b23-12.9d", 0x18000, 0x10000, CRC(13637f54) SHA1(c175bc60120e32eec6ccca822fa497a42dd59823) ) |
| 355 | 392 | |
| 356 | | ROM_REGION( 0x10000, "cpuc", 0 ) /* Z80 CPU C */ |
| 357 | | ROM_LOAD( "b23-13.bin", 0x00000, 0x08000, CRC(51110aa1) SHA1(34c2701625eb1987affad1efd19ff8c9971456ae) ) |
| 393 | ROM_REGION( 0x48000, "cpub", 0 ) |
| 394 | ROM_LOAD( "b23-11.7f", 0x00000, 0x08000, CRC(d6a79cef) SHA1(e2b56aa38c017b24b50f304b9fe49ee14006f9a4) ) |
| 395 | ROM_CONTINUE( 0x10000, 0x08000 ) |
| 396 | ROM_LOAD( "b12-12.8f", 0x18000, 0x10000, CRC(a662be67) SHA1(0643480d56d8ac020288db800a705dd5d0d3ad9f) ) |
| 397 | ROM_LOAD( "b12-13.10f", 0x28000, 0x10000, CRC(04a29633) SHA1(39476365241718f01f9630c12467cb24791a67e1) ) |
| 358 | 398 | |
| 359 | | ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT ) /* BG 0 */ |
| 360 | | ROM_LOAD( "b12-16.bin", 0x00000, 0x10000, CRC(6fec6acb) SHA1(2289c116d3f6093988a088d011f192dd4a99aa77) ) |
| 361 | | ROM_LOAD( "b12-18.bin", 0x10000, 0x10000, CRC(64e358aa) SHA1(cd1a23458b1a2f9c8c8aea8086dc04e0f6cc6908) ) |
| 362 | | ROM_LOAD( "b12-20.bin", 0x20000, 0x10000, CRC(87f52e89) SHA1(3f8530aca087fa2a32dc6dfbcfe2f86604ee3ca1) ) |
| 363 | | ROM_LOAD( "b12-15.bin", 0x40000, 0x10000, CRC(d81107c8) SHA1(c024c9b7956de493687e1373318d4cd74b3555b2) ) |
| 364 | | ROM_LOAD( "b12-17.bin", 0x50000, 0x10000, CRC(db1d5a6c) SHA1(c2e1b8d92c2b3b2ce775ed50ca4a37e84ed35a93) ) |
| 365 | | ROM_LOAD( "b12-19.bin", 0x60000, 0x10000, CRC(772b2641) SHA1(35cc6d5a725f1817791e710afde992e64d14104f) ) |
| 399 | ROM_REGION( 0x10000, "cpuc", 0 ) |
| 400 | ROM_LOAD( "b23-13.12c", 0x00000, 0x08000, CRC(51110aa1) SHA1(34c2701625eb1987affad1efd19ff8c9971456ae) ) |
| 366 | 401 | |
| 367 | | ROM_REGION( 0x80000, "gfx2", ROMREGION_INVERT ) /* BG 1 */ |
| 368 | | ROM_LOAD( "b23-06.bin", 0x00000, 0x10000, CRC(44f8f661) SHA1(d77160a89e45556cd9ce211d89c398e1086d8d92) ) |
| 369 | | ROM_LOAD( "b23-08.bin", 0x10000, 0x10000, CRC(1ce498c1) SHA1(a9ce3de997089bd40c99bd89919b459c9f215fc8) ) |
| 370 | | ROM_LOAD( "b23-07.bin", 0x40000, 0x10000, CRC(d7f6ec89) SHA1(e8da207ddaf46ceff870b45ecec0e89c499291b4) ) |
| 371 | | ROM_LOAD( "b23-09.bin", 0x50000, 0x10000, CRC(6651617f) SHA1(6351a0b01589cb181b896285ade70e9dfcd799ec) ) |
| 402 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 403 | ROM_LOAD( "b23-14.19f", 0x00000, 0x08000, CRC(f7ca7df2) SHA1(6048d9341f0303546e447a76439e1927d14cdd57) ) |
| 372 | 404 | |
| 373 | | ROM_REGION( 0x00c00, "proms", 0 ) /* PROMS */ |
| 374 | | ROM_LOAD( "b23-04.bin", 0x00000, 0x00400, CRC(5042cffa) SHA1(c969748866a12681cf2dbf25a46da2c4e4f92313) ) |
| 375 | | ROM_LOAD( "b23-03.bin", 0x00400, 0x00400, CRC(9458fd45) SHA1(7f7cdacf37bb6f15de1109fa73ba3c5fc88893d0) ) |
| 376 | | ROM_LOAD( "b23-05.bin", 0x00800, 0x00400, CRC(87f0f69a) SHA1(37df6fd56245fab9beaabfd86fd8f95d7c42c2a5) ) |
| 405 | ROM_REGION( 0x80000, "bg0", ROMREGION_INVERT ) |
| 406 | ROM_LOAD( "b12-16.17d", 0x00000, 0x10000, CRC(6fec6acb) SHA1(2289c116d3f6093988a088d011f192dd4a99aa77) ) |
| 407 | ROM_LOAD( "b12-18.19d", 0x10000, 0x10000, CRC(64e358aa) SHA1(cd1a23458b1a2f9c8c8aea8086dc04e0f6cc6908) ) |
| 408 | ROM_LOAD( "b12-20.20d", 0x20000, 0x10000, CRC(87f52e89) SHA1(3f8530aca087fa2a32dc6dfbcfe2f86604ee3ca1) ) |
| 409 | ROM_LOAD( "b12-15.17c", 0x40000, 0x10000, CRC(d81107c8) SHA1(c024c9b7956de493687e1373318d4cd74b3555b2) ) |
| 410 | ROM_LOAD( "b12-17.19c", 0x50000, 0x10000, CRC(db1d5a6c) SHA1(c2e1b8d92c2b3b2ce775ed50ca4a37e84ed35a93) ) |
| 411 | ROM_LOAD( "b12-19.20c", 0x60000, 0x10000, CRC(772b2641) SHA1(35cc6d5a725f1817791e710afde992e64d14104f) ) |
| 412 | |
| 413 | ROM_REGION( 0x80000, "bg1", ROMREGION_INVERT ) |
| 414 | ROM_LOAD( "b23-06.1c", 0x00000, 0x10000, CRC(44f8f661) SHA1(d77160a89e45556cd9ce211d89c398e1086d8d92) ) |
| 415 | ROM_LOAD( "b23-08.3c", 0x10000, 0x10000, CRC(1ce498c1) SHA1(a9ce3de997089bd40c99bd89919b459c9f215fc8) ) |
| 416 | ROM_LOAD( "b23-07.1d", 0x40000, 0x10000, CRC(d7f6ec89) SHA1(e8da207ddaf46ceff870b45ecec0e89c499291b4) ) |
| 417 | ROM_LOAD( "b23-09.3d", 0x50000, 0x10000, CRC(6651617f) SHA1(6351a0b01589cb181b896285ade70e9dfcd799ec) ) |
| 418 | |
| 419 | ROM_REGION( 0x00c00, "proms", 0 ) |
| 420 | /* These appear to be twice the correct size */ |
| 421 | ROM_LOAD( "b23-04.15l", 0x00000, 0x00400, CRC(5042cffa) SHA1(c969748866a12681cf2dbf25a46da2c4e4f92313) ) |
| 422 | ROM_LOAD( "b23-03.14l", 0x00400, 0x00400, BAD_DUMP CRC(9458fd45) SHA1(7f7cdacf37bb6f15de1109fa73ba3c5fc88893d0) ) /* D0 is fixed */ |
| 423 | ROM_LOAD( "b23-05.16l", 0x00800, 0x00400, CRC(87f0f69a) SHA1(37df6fd56245fab9beaabfd86fd8f95d7c42c2a5) ) |
| 377 | 424 | ROM_END |
| 378 | 425 | |
| 379 | 426 | |
| 380 | | GAME( 1987, exzisus, 0, exzisus, exzisus, 0, ROT0, "Taito Corporation", "Exzisus (Japan)", 0 ) |
| 427 | GAME( 1987, exzisus, 0, exzisus, exzisus, 0, ROT0, "Taito Corporation", "Exzisus (Japan, dedicated)", 0 ) |
| 428 | GAME( 1987, exzisusa, exzisus, exzisus, exzisus, 0, ROT0, "Taito Corporation", "Exzisus (Japan, conversion)", 0 ) |
| 429 | /* A third set exists with a 'TAD Corp.' copyright */ |
src/mame/drivers/twin16.c
| r5891 | r5892 | |
| 852 | 852 | ROM_LOAD16_BYTE( "687_q12.8s", 0x20001, 0x10000, CRC(6d012167) SHA1(d608e29e0b2e834c099386b6ebb667e4bfc40ce7) ) |
| 853 | 853 | |
| 854 | 854 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 855 | | ROM_LOAD( "687_l03.10a", 0x00000, 0x8000, CRC(7201983c) SHA1(06d089406d2f702e8d51ffdfbf34e4727a28d506) ) |
| 855 | ROM_LOAD( "687_l03.10a", 0x00000, 0x8000, CRC(7201983c) SHA1(06d089406d2f702e8d51ffdfbf34e4727a28d506) ) |
| 856 | 856 | |
| 857 | 857 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 858 | | ROM_LOAD( "687_m14.d8", 0x00000, 0x4000, CRC(d7338557) SHA1(9b384baafabaab3888a0139674f0b530303684ca) ) // characters |
| 858 | ROM_LOAD( "687_m14.d8", 0x00000, 0x4000, CRC(d7338557) SHA1(9b384baafabaab3888a0139674f0b530303684ca) ) /* Title screen graphics & characters */ |
| 859 | 859 | |
| 860 | 860 | ROM_REGION16_LE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 861 | 861 | ROM_LOAD16_WORD( "687i17.p16", 0x000000, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) ) |
| r5891 | r5892 | |
| 868 | 868 | ROM_LOAD16_BYTE( "687_l10.8r", 0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) ) |
| 869 | 869 | |
| 870 | 870 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 871 | | ROM_LOAD( "687_i01.5a", 0x00000, 0x20000, CRC(d4992dfb) SHA1(c65bef07b6adb9ab6328d679595450945dbf6a88) ) |
| 871 | ROM_LOAD( "687_i01.5a", 0x00000, 0x20000, CRC(d4992dfb) SHA1(c65bef07b6adb9ab6328d679595450945dbf6a88) ) |
| 872 | 872 | |
| 873 | 873 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 874 | | ROM_LOAD( "687_i02.7c", 0x00000, 0x20000, CRC(e5947501) SHA1(9ec7319bd97711981db60af6f477c2ba2ec7e6b8) ) |
| 874 | ROM_LOAD( "687_i02.7c", 0x00000, 0x20000, CRC(e5947501) SHA1(9ec7319bd97711981db60af6f477c2ba2ec7e6b8) ) |
| 875 | 875 | ROM_END |
| 876 | 876 | |
| 877 | 877 | ROM_START( majuu ) |
| r5891 | r5892 | |
| 888 | 888 | ROM_LOAD16_BYTE( "687_q12.8s", 0x20001, 0x10000, CRC(6d012167) SHA1(d608e29e0b2e834c099386b6ebb667e4bfc40ce7) ) |
| 889 | 889 | |
| 890 | 890 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 891 | | ROM_LOAD( "687_l03.10a", 0x00000, 0x8000, CRC(7201983c) SHA1(06d089406d2f702e8d51ffdfbf34e4727a28d506) ) |
| 891 | ROM_LOAD( "687_l03.10a", 0x00000, 0x8000, CRC(7201983c) SHA1(06d089406d2f702e8d51ffdfbf34e4727a28d506) ) |
| 892 | 892 | |
| 893 | 893 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 894 | | ROM_LOAD( "687_l14.d8", 0x00000, 0x4000, CRC(20ecccd6) SHA1(b8ac3186de5ea81ae1c64b9511b7a0718aabab48) ) // characters |
| 894 | ROM_LOAD( "687_l14.d8", 0x00000, 0x4000, CRC(20ecccd6) SHA1(b8ac3186de5ea81ae1c64b9511b7a0718aabab48) ) /* Title screen graphics & characters */ |
| 895 | 895 | |
| 896 | 896 | ROM_REGION16_LE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 897 | 897 | ROM_LOAD16_WORD( "687i17.p16", 0x000000, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) ) |
| r5891 | r5892 | |
| 904 | 904 | ROM_LOAD16_BYTE( "687_l10.8r", 0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) ) |
| 905 | 905 | |
| 906 | 906 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 907 | | ROM_LOAD( "687_i01.5a", 0x00000, 0x20000, CRC(d4992dfb) SHA1(c65bef07b6adb9ab6328d679595450945dbf6a88) ) |
| 907 | ROM_LOAD( "687_i01.5a", 0x00000, 0x20000, CRC(d4992dfb) SHA1(c65bef07b6adb9ab6328d679595450945dbf6a88) ) |
| 908 | 908 | |
| 909 | 909 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 910 | | ROM_LOAD( "687_i02.7c", 0x00000, 0x20000, CRC(e5947501) SHA1(9ec7319bd97711981db60af6f477c2ba2ec7e6b8) ) |
| 910 | ROM_LOAD( "687_i02.7c", 0x00000, 0x20000, CRC(e5947501) SHA1(9ec7319bd97711981db60af6f477c2ba2ec7e6b8) ) |
| 911 | 911 | ROM_END |
| 912 | 912 | |
| 913 | 913 | ROM_START( darkadv ) |
| r5891 | r5892 | |
| 924 | 924 | ROM_LOAD16_BYTE( "687_n12.8s", 0x20001, 0x10000, CRC(da221944) SHA1(c288ee583414a077f0d8b815b8e01b7f19a5fafe) ) |
| 925 | 925 | |
| 926 | 926 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 927 | | ROM_LOAD( "687_n03.10a", 0x00000, 0x8000, CRC(a24c682f) SHA1(cf053270d3f77448ff802db832598ae3cf7dae6c) ) |
| 927 | ROM_LOAD( "687_n03.10a", 0x00000, 0x8000, CRC(a24c682f) SHA1(cf053270d3f77448ff802db832598ae3cf7dae6c) ) |
| 928 | 928 | |
| 929 | 929 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 930 | | ROM_LOAD( "687_n14.d8", 0x0000, 0x4000, CRC(c76ac6d2) SHA1(d8fec255f1f7177a3716a5894fb679cbe172b6ea) ) // characters |
| 930 | ROM_LOAD( "687_n14.d8", 0x0000, 0x4000, CRC(c76ac6d2) SHA1(d8fec255f1f7177a3716a5894fb679cbe172b6ea) ) /* Title screen graphics & characters */ |
| 931 | 931 | |
| 932 | 932 | ROM_REGION16_LE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 933 | 933 | ROM_LOAD16_WORD( "687i17.p16", 0x000000, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) ) |
| r5891 | r5892 | |
| 940 | 940 | ROM_LOAD16_BYTE( "687_l10.8r", 0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) ) |
| 941 | 941 | |
| 942 | 942 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 943 | | ROM_LOAD( "687_i01.5a", 0x00000, 0x20000, CRC(d4992dfb) SHA1(c65bef07b6adb9ab6328d679595450945dbf6a88) ) |
| 943 | ROM_LOAD( "687_i01.5a", 0x00000, 0x20000, CRC(d4992dfb) SHA1(c65bef07b6adb9ab6328d679595450945dbf6a88) ) |
| 944 | 944 | |
| 945 | 945 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 946 | | ROM_LOAD( "687_i02.7c", 0x00000, 0x20000, CRC(e5947501) SHA1(9ec7319bd97711981db60af6f477c2ba2ec7e6b8) ) |
| 946 | ROM_LOAD( "687_i02.7c", 0x00000, 0x20000, CRC(e5947501) SHA1(9ec7319bd97711981db60af6f477c2ba2ec7e6b8) ) |
| 947 | 947 | ROM_END |
| 948 | 948 | |
| 949 | 949 | ROM_START( vulcan ) |
| r5891 | r5892 | |
| 960 | 960 | ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) ) |
| 961 | 961 | |
| 962 | 962 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 963 | | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 963 | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 964 | 964 | |
| 965 | 965 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 966 | | ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) // characters |
| 966 | ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) /* Title screen graphics & characters */ |
| 967 | 967 | |
| 968 | 968 | ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 969 | 969 | ROM_LOAD16_WORD( "785f17.p16", 0x000000, 0x80000, CRC(8fbec1a4) SHA1(71cbdb25470b5a2ca7e80c92f12fc47e28085793) ) |
| r5891 | r5892 | |
| 974 | 974 | ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB |
| 975 | 975 | |
| 976 | 976 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 977 | | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 977 | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 978 | 978 | |
| 979 | 979 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 980 | | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 980 | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 981 | 981 | ROM_END |
| 982 | 982 | |
| 983 | ROM_START( vulcana ) |
| 984 | ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code (CPU A) |
| 985 | ROM_LOAD16_BYTE( "785_n05.6n", 0x00000, 0x10000, CRC(6371d475) SHA1(82e6adc38de8363c126cd073dbc95eeec576db98) ) |
| 986 | ROM_LOAD16_BYTE( "785_n04.4n", 0x00001, 0x10000, CRC(b6f24b9e) SHA1(01685f89955385714062cc70316edce1a6a64e35) ) |
| 987 | ROM_LOAD16_BYTE( "785_r09.6r", 0x20000, 0x10000, CRC(fbfd1543) SHA1(8ef41a0a9d3d1de9395bdd5288199841c61d7045) ) |
| 988 | ROM_LOAD16_BYTE( "785_r08.4r", 0x20001, 0x10000, CRC(36bb1be1) SHA1(ce9a98443a453b1c05dfb8d0f8ba0f94292b9d30) ) |
| 989 | |
| 990 | ROM_REGION( 0x40000, "sub", 0 ) // 68000 code (CPU B) |
| 991 | ROM_LOAD16_BYTE( "785_g07.10n", 0x00000, 0x10000, CRC(ee09dd5d) SHA1(9b6fb12c2cb7930df12d9876810811540fd560ee) ) |
| 992 | ROM_LOAD16_BYTE( "785_g06.8n" , 0x00001, 0x10000, CRC(85ab7af7) SHA1(5cb36918a5cdfd16611da76f07450ae1d115f2c7) ) |
| 993 | ROM_LOAD16_BYTE( "785_g13.10s", 0x20000, 0x10000, CRC(274f325d) SHA1(1076efa204eff0fc8a8788706b17b9a128023d35) ) |
| 994 | ROM_LOAD16_BYTE( "785_g12.8s", 0x20001, 0x10000, CRC(1625f933) SHA1(3f25d7396af46e75e3ae8456414e31935de43d34) ) |
| 995 | |
| 996 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 997 | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 998 | |
| 999 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1000 | ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) /* Title screen graphics & characters */ |
| 1001 | |
| 1002 | ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 1003 | ROM_LOAD16_WORD( "785f17.p16", 0x000000, 0x80000, CRC(8fbec1a4) SHA1(71cbdb25470b5a2ca7e80c92f12fc47e28085793) ) |
| 1004 | ROM_LOAD16_WORD( "785f18.p18", 0x080000, 0x80000, CRC(50d61e38) SHA1(051d332d93d435d19571e22d69ffc5395dbb16a4) ) |
| 1005 | ROM_LOAD16_WORD( "785f15.p13", 0x100000, 0x80000, CRC(af96aef3) SHA1(a58e26a8b134ab6e7938cd4fa342c04c236efd99) ) |
| 1006 | ROM_LOAD16_WORD( "785f16.p15", 0x180000, 0x80000, CRC(b858df1f) SHA1(c434da7ba54d59643fe6ca30bceccf16413904c3) ) |
| 1007 | |
| 1008 | ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB |
| 1009 | |
| 1010 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 1011 | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 1012 | |
| 1013 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 1014 | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 1015 | ROM_END |
| 1016 | |
| 983 | 1017 | ROM_START( gradius2 ) |
| 984 | 1018 | ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code (CPU A) |
| 985 | 1019 | ROM_LOAD16_BYTE( "785_x05.6n", 0x00000, 0x10000, CRC(8a23a7b8) SHA1(9846272c011715b17f146d5265a09e790d6e37cd) ) |
| r5891 | r5892 | |
| 994 | 1028 | ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) ) |
| 995 | 1029 | |
| 996 | 1030 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 997 | | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 1031 | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 998 | 1032 | |
| 999 | 1033 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1000 | | ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) // characters |
| 1034 | ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */ |
| 1001 | 1035 | |
| 1002 | 1036 | ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 1003 | 1037 | ROM_LOAD16_WORD_SWAP( "gr2.p16", 0x000000, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) ) /* 785f17.p16 byteswapped */ |
| r5891 | r5892 | |
| 1013 | 1047 | ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB |
| 1014 | 1048 | |
| 1015 | 1049 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 1016 | | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 1050 | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 1017 | 1051 | |
| 1018 | 1052 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 1019 | | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 1053 | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 1020 | 1054 | ROM_END |
| 1021 | 1055 | |
| 1022 | 1056 | ROM_START( gradius2a ) |
| r5891 | r5892 | |
| 1033 | 1067 | ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) ) |
| 1034 | 1068 | |
| 1035 | 1069 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 1036 | | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 1070 | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 1037 | 1071 | |
| 1038 | 1072 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1039 | | ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) // characters |
| 1073 | ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */ |
| 1040 | 1074 | |
| 1041 | 1075 | ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 1042 | 1076 | ROM_LOAD16_WORD( "785f17.p16", 0x000000, 0x80000, CRC(8fbec1a4) SHA1(71cbdb25470b5a2ca7e80c92f12fc47e28085793) ) |
| r5891 | r5892 | |
| 1047 | 1081 | ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB |
| 1048 | 1082 | |
| 1049 | 1083 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 1050 | | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 1084 | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 1051 | 1085 | |
| 1052 | 1086 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 1053 | | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 1087 | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 1054 | 1088 | ROM_END |
| 1055 | 1089 | |
| 1056 | 1090 | ROM_START( gradius2b ) |
| r5891 | r5892 | |
| 1067 | 1101 | ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) ) |
| 1068 | 1102 | |
| 1069 | 1103 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 1070 | | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 1104 | ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) ) |
| 1071 | 1105 | |
| 1072 | 1106 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1073 | | ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) // characters |
| 1107 | ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */ |
| 1074 | 1108 | |
| 1075 | 1109 | ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 1076 | 1110 | ROM_LOAD16_WORD( "785f17.p16", 0x000000, 0x80000, CRC(8fbec1a4) SHA1(71cbdb25470b5a2ca7e80c92f12fc47e28085793) ) |
| r5891 | r5892 | |
| 1081 | 1115 | ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB |
| 1082 | 1116 | |
| 1083 | 1117 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 1084 | | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 1118 | ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) ) |
| 1085 | 1119 | |
| 1086 | 1120 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 1087 | | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 1121 | ROM_LOAD( "785_f02.7c", 0x00000, 0x20000, CRC(c39f5ca4) SHA1(92ebea11b7d3a72d0f58c456f16a6ff36d6b3062) ) |
| 1088 | 1122 | ROM_END |
| 1089 | 1123 | |
| 1090 | 1124 | ROM_START( fround ) |
| r5891 | r5892 | |
| 1093 | 1127 | ROM_LOAD16_BYTE( "870_m20.bin", 0x00001, 0x20000, CRC(b1c79d6a) SHA1(76e95e87eaa96ba694675fde7706540c584a36fb) ) |
| 1094 | 1128 | |
| 1095 | 1129 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 1096 | | ROM_LOAD( "870_f03.10a", 0x00000, 0x8000, CRC(a645c727) SHA1(e173e79130f187d090766664f1c478d47062749c) ) |
| 1130 | ROM_LOAD( "870_f03.10a", 0x00000, 0x8000, CRC(a645c727) SHA1(e173e79130f187d090766664f1c478d47062749c) ) |
| 1097 | 1131 | |
| 1098 | 1132 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1099 | | ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) // characters |
| 1133 | ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */ |
| 1100 | 1134 | |
| 1101 | 1135 | ROM_REGION16_LE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 1102 | | ROM_LOAD16_WORD("870c18.p18", 0x000000, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) ) |
| 1103 | | ROM_LOAD16_WORD("870c17.p16", 0x080000, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) ) |
| 1104 | | ROM_LOAD16_WORD("870c16.p15", 0x100000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) ) |
| 1105 | | ROM_LOAD16_WORD("870c15.p13", 0x180000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) ) |
| 1136 | ROM_LOAD16_WORD("870c18.p18", 0x000000, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) ) |
| 1137 | ROM_LOAD16_WORD("870c17.p16", 0x080000, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) ) |
| 1138 | ROM_LOAD16_WORD("870c16.p15", 0x100000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) ) |
| 1139 | ROM_LOAD16_WORD("870c15.p13", 0x180000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) ) |
| 1106 | 1140 | |
| 1107 | 1141 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 1108 | | ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) ) |
| 1142 | ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) ) |
| 1109 | 1143 | |
| 1110 | 1144 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 1111 | | ROM_LOAD( "870_c02.7c", 0x00000, 0x20000, CRC(54e12c6d) SHA1(8171441aeb1a1dc4d65fae59c7c217f992f70cbc) ) |
| 1145 | ROM_LOAD( "870_c02.7c", 0x00000, 0x20000, CRC(54e12c6d) SHA1(8171441aeb1a1dc4d65fae59c7c217f992f70cbc) ) |
| 1112 | 1146 | ROM_END |
| 1113 | 1147 | |
| 1114 | 1148 | ROM_START( froundl ) |
| r5891 | r5892 | |
| 1117 | 1151 | ROM_LOAD16_BYTE( "870_l20.bin", 0x00001, 0x20000, CRC(0ce9786f) SHA1(0fb0eef999ed09dd50eed403255887103fc35461) ) |
| 1118 | 1152 | |
| 1119 | 1153 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 1120 | | ROM_LOAD( "870_f03.10a", 0x00000, 0x8000, CRC(a645c727) SHA1(e173e79130f187d090766664f1c478d47062749c) ) |
| 1154 | ROM_LOAD( "870_f03.10a", 0x00000, 0x8000, CRC(a645c727) SHA1(e173e79130f187d090766664f1c478d47062749c) ) |
| 1121 | 1155 | |
| 1122 | 1156 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1123 | | ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) // characters |
| 1157 | ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */ |
| 1124 | 1158 | |
| 1125 | 1159 | ROM_REGION16_LE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 1126 | | ROM_LOAD16_WORD("870c18.p18", 0x000000, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) ) |
| 1127 | | ROM_LOAD16_WORD("870c17.p16", 0x080000, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) ) |
| 1128 | | ROM_LOAD16_WORD("870c16.p15", 0x100000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) ) |
| 1129 | | ROM_LOAD16_WORD("870c15.p13", 0x180000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) ) |
| 1160 | ROM_LOAD16_WORD("870c18.p18", 0x000000, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) ) |
| 1161 | ROM_LOAD16_WORD("870c17.p16", 0x080000, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) ) |
| 1162 | ROM_LOAD16_WORD("870c16.p15", 0x100000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) ) |
| 1163 | ROM_LOAD16_WORD("870c15.p13", 0x180000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) ) |
| 1130 | 1164 | |
| 1131 | 1165 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 1132 | | ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) ) |
| 1166 | ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) ) |
| 1133 | 1167 | |
| 1134 | 1168 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 1135 | | ROM_LOAD( "870_c02.7c", 0x00000, 0x20000, CRC(54e12c6d) SHA1(8171441aeb1a1dc4d65fae59c7c217f992f70cbc) ) |
| 1169 | ROM_LOAD( "870_c02.7c", 0x00000, 0x20000, CRC(54e12c6d) SHA1(8171441aeb1a1dc4d65fae59c7c217f992f70cbc) ) |
| 1136 | 1170 | ROM_END |
| 1137 | 1171 | |
| 1138 | 1172 | ROM_START( hpuncher ) |
| r5891 | r5892 | |
| 1147 | 1181 | ROM_LOAD16_BYTE( "870_h06.8n", 0x00001, 0x10000, CRC(696ba702) SHA1(e35c9aeab4305d828a347eaddf4abc806a889fa3) ) |
| 1148 | 1182 | |
| 1149 | 1183 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 1150 | | ROM_LOAD( "870_g03.10a", 0x00000, 0x8000, CRC(db9c10c8) SHA1(b2ec4d6800a4ab00dfcc8d3cd4abf9b9d7c5544a) ) |
| 1184 | ROM_LOAD( "870_g03.10a", 0x00000, 0x8000, CRC(db9c10c8) SHA1(b2ec4d6800a4ab00dfcc8d3cd4abf9b9d7c5544a) ) |
| 1151 | 1185 | |
| 1152 | 1186 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1153 | | ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) // characters |
| 1187 | ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */ |
| 1154 | 1188 | |
| 1155 | 1189 | ROM_REGION16_LE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 1156 | | ROM_LOAD16_WORD("870c17.p16", 0x000000, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) ) |
| 1157 | | ROM_LOAD16_WORD("870c18.p18", 0x080000, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) ) |
| 1158 | | ROM_LOAD16_WORD("870c15.p13", 0x100000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) ) |
| 1159 | | ROM_LOAD16_WORD("870c16.p15", 0x180000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) ) |
| 1190 | ROM_LOAD16_WORD("870c17.p16", 0x000000, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) ) |
| 1191 | ROM_LOAD16_WORD("870c18.p18", 0x080000, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) ) |
| 1192 | ROM_LOAD16_WORD("870c15.p13", 0x100000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) ) |
| 1193 | ROM_LOAD16_WORD("870c16.p15", 0x180000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) ) |
| 1160 | 1194 | |
| 1161 | 1195 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 1162 | | ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) ) |
| 1196 | ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) ) |
| 1163 | 1197 | |
| 1164 | 1198 | ROM_REGION( 0x20000, "upd", 0 ) // samples |
| 1165 | | ROM_LOAD( "870_c02.7c", 0x00000, 0x20000, CRC(54e12c6d) SHA1(8171441aeb1a1dc4d65fae59c7c217f992f70cbc) ) |
| 1199 | ROM_LOAD( "870_c02.7c", 0x00000, 0x20000, CRC(54e12c6d) SHA1(8171441aeb1a1dc4d65fae59c7c217f992f70cbc) ) |
| 1166 | 1200 | ROM_END |
| 1167 | 1201 | |
| 1168 | 1202 | ROM_START( miaj ) |
| 1169 | 1203 | ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code (CPU A) |
| 1170 | | ROM_LOAD16_BYTE("808_r05.6n", 0x00000, 0x10000, CRC(91fd83f4) SHA1(12cba5828d1d752efe4fc1972bed0205ac277850) ) |
| 1171 | | ROM_LOAD16_BYTE("808_r04.4n", 0x00001, 0x10000, CRC(f1c8c597) SHA1(4e8e87aedc9dac4ed05816989210de49f4dd60d2) ) |
| 1172 | | ROM_LOAD16_BYTE("808_r09.6r", 0x20000, 0x10000, CRC(f74d4467) SHA1(2b2491ee7ece979f2ec849075b0c30b6c1ed6bae) ) |
| 1173 | | ROM_LOAD16_BYTE("808_r08.4r", 0x20001, 0x10000, CRC(26f21704) SHA1(123cb2e4bcb25d82faa75e4505f9859c10bca754) ) |
| 1204 | ROM_LOAD16_BYTE("808_r05.6n", 0x00000, 0x10000, CRC(91fd83f4) SHA1(12cba5828d1d752efe4fc1972bed0205ac277850) ) |
| 1205 | ROM_LOAD16_BYTE("808_r04.4n", 0x00001, 0x10000, CRC(f1c8c597) SHA1(4e8e87aedc9dac4ed05816989210de49f4dd60d2) ) |
| 1206 | ROM_LOAD16_BYTE("808_r09.6r", 0x20000, 0x10000, CRC(f74d4467) SHA1(2b2491ee7ece979f2ec849075b0c30b6c1ed6bae) ) |
| 1207 | ROM_LOAD16_BYTE("808_r08.4r", 0x20001, 0x10000, CRC(26f21704) SHA1(123cb2e4bcb25d82faa75e4505f9859c10bca754) ) |
| 1174 | 1208 | |
| 1175 | 1209 | ROM_REGION( 0x40000, "sub", 0 ) // 68000 code (CPU B) |
| 1176 | | ROM_LOAD16_BYTE("808_e07.10n", 0x00000, 0x10000, CRC(297bdcea) SHA1(41ed650cbc4f56777fa352812e9a560554459f90) ) |
| 1177 | | ROM_LOAD16_BYTE("808_e06.8n", 0x00001, 0x10000, CRC(8f576b33) SHA1(cd8c9a45626c30571ca12d0241cccc092c0903a0) ) |
| 1178 | | ROM_LOAD16_BYTE("808_e13.10s", 0x20000, 0x10000, CRC(1fa708f4) SHA1(9511a19f50fb61571c2986c72d1a85e87b8d0495) ) |
| 1179 | | ROM_LOAD16_BYTE("808_e12.8s", 0x20001, 0x10000, CRC(d62f1fde) SHA1(1e55084f1294b6ac7c152fcd1800511fcab5d360) ) |
| 1210 | ROM_LOAD16_BYTE("808_e07.10n", 0x00000, 0x10000, CRC(297bdcea) SHA1(41ed650cbc4f56777fa352812e9a560554459f90) ) |
| 1211 | ROM_LOAD16_BYTE("808_e06.8n", 0x00001, 0x10000, CRC(8f576b33) SHA1(cd8c9a45626c30571ca12d0241cccc092c0903a0) ) |
| 1212 | ROM_LOAD16_BYTE("808_e13.10s", 0x20000, 0x10000, CRC(1fa708f4) SHA1(9511a19f50fb61571c2986c72d1a85e87b8d0495) ) |
| 1213 | ROM_LOAD16_BYTE("808_e12.8s", 0x20001, 0x10000, CRC(d62f1fde) SHA1(1e55084f1294b6ac7c152fcd1800511fcab5d360) ) |
| 1180 | 1214 | |
| 1181 | 1215 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 1182 | | ROM_LOAD( "808_e03.10a", 0x00000, 0x8000, CRC(3d93a7cd) SHA1(dcdd327e78f32436b276d0666f62a5b733b296e8) ) |
| 1216 | ROM_LOAD( "808_e03.10a", 0x00000, 0x8000, CRC(3d93a7cd) SHA1(dcdd327e78f32436b276d0666f62a5b733b296e8) ) |
| 1183 | 1217 | |
| 1184 | 1218 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1185 | | ROM_LOAD("808_e14.d8", 0x0000, 0x4000, CRC(b9d36525) SHA1(53291c4911d7e1a5110539e4c57a11d0d530dc6f) ) // characters |
| 1219 | ROM_LOAD("808_e14.d8", 0x0000, 0x4000, CRC(b9d36525) SHA1(53291c4911d7e1a5110539e4c57a11d0d530dc6f) ) /* Title screen graphics & characters */ |
| 1186 | 1220 | |
| 1187 | 1221 | ROM_REGION16_LE( 0x200000, "gfx2", 0 ) // gfx data used at runtime |
| 1188 | | ROM_LOAD16_WORD("808d17.p16", 0x000000, 0x80000, CRC(d1299082) SHA1(c3c07b0517e7428ccd1cdf9e15aaf16d98e7c4cd) ) |
| 1189 | | ROM_LOAD16_WORD("808d15.p13", 0x100000, 0x80000, CRC(2b22a6b6) SHA1(8e1af0627a4eac045128c4096e2cfb59c3d2f5ef) ) |
| 1222 | ROM_LOAD16_WORD("808d17.p16", 0x000000, 0x80000, CRC(d1299082) SHA1(c3c07b0517e7428ccd1cdf9e15aaf16d98e7c4cd) ) |
| 1223 | ROM_LOAD16_WORD("808d15.p13", 0x100000, 0x80000, CRC(2b22a6b6) SHA1(8e1af0627a4eac045128c4096e2cfb59c3d2f5ef) ) |
| 1190 | 1224 | |
| 1191 | 1225 | ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB |
| 1192 | 1226 | |
| 1193 | 1227 | ROM_REGION( 0x20000, "konami", 0 ) // samples |
| 1194 | | ROM_LOAD("808_d01.5a", 0x00000, 0x20000, CRC(fd4d37c0) SHA1(ef91c6e7bb57c27a9a51729fffd1bfe3e806fb61) ) |
| 1228 | ROM_LOAD("808_d01.5a", 0x00000, 0x20000, CRC(fd4d37c0) SHA1(ef91c6e7bb57c27a9a51729fffd1bfe3e806fb61) ) |
| 1195 | 1229 | |
| 1196 | 1230 | ROM_REGION( 0x20000, "upd", ROMREGION_ERASE00 ) // samples |
| 1197 | 1231 | ROM_END |
| r5891 | r5892 | |
| 1210 | 1244 | ROM_LOAD16_BYTE( "903_e12.8s", 0x20001, 0x10000, CRC(883e3097) SHA1(fe0fa1a2881a67223d741c400bb8c1a0c67946c1) ) |
| 1211 | 1245 | |
| 1212 | 1246 | ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU) |
| 1213 | | ROM_LOAD( "903_d03.10a", 0x00000, 0x8000, CRC(455e855a) SHA1(cfdd54a5071862653ee94c0455301f4a7245fbd8) ) |
| 1247 | ROM_LOAD( "903_d03.10a", 0x00000, 0x8000, CRC(455e855a) SHA1(cfdd54a5071862653ee94c0455301f4a7245fbd8) ) |
| 1214 | 1248 | |
| 1215 | 1249 | ROM_REGION( 0x4000, "gfx1", 0 ) |
| 1216 | | ROM_LOAD( "903_e14.d8", 0x0000, 0x4000, CRC(ddbebbd5) SHA1(df532f19a08cabb28d693e4cd445c47c9e35e5ff) ) // characters |
| 1250 | ROM_LOAD( "903_e14.d8", 0x0000, 0x4000, CRC(ddbebbd5) SHA1(df532f19a08cabb28d693e4cd445c47c9e35e5ff) ) /* Title screen graphics & characters */ |
| 1217 | 1251 | |
| 1218 | 1252 | ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 ) // gfx data used at runtime |
| 1219 | 1253 | // unpopulated |
| r5891 | r5892 | |
| 1274 | 1308 | GAME( 1987, majuu, devilw, devilw, devilw, twin16, ROT0, "Konami", "Majuu no Ohkoku", GAME_SUPPORTS_SAVE ) |
| 1275 | 1309 | GAME( 1987, darkadv, devilw, devilw, darkadv, twin16, ROT0, "Konami", "Dark Adventure", GAME_SUPPORTS_SAVE ) |
| 1276 | 1310 | GAME( 1988, vulcan, 0, twin16, vulcan, twin16, ROT0, "Konami", "Vulcan Venture", GAME_SUPPORTS_SAVE ) |
| 1311 | GAME( 1988, vulcana, vulcan, twin16, gradius2, twin16, ROT0, "Konami", "Vulcan Venture (Older Ver.)", GAME_SUPPORTS_SAVE ) |
| 1277 | 1312 | GAME( 1988, gradius2, vulcan, twin16, gradius2, twin16, ROT0, "Konami", "Gradius II - GOFER no Yabou (Japan New Ver.)", GAME_SUPPORTS_SAVE ) |
| 1278 | 1313 | GAME( 1988, gradius2a,vulcan, twin16, vulcan, twin16, ROT0, "Konami", "Gradius II - GOFER no Yabou (Japan Old Ver.)", GAME_SUPPORTS_SAVE ) |
| 1279 | 1314 | GAME( 1988, gradius2b,vulcan, twin16, vulcan, twin16, ROT0, "Konami", "Gradius II - GOFER no Yabou (Japan Older Ver.)", GAME_SUPPORTS_SAVE ) |
src/emu/cpu/dsp56k/dsp56dsm.c
| r5891 | r5892 | |
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | /* |
| 10 | | This disassembler has been 75% tested. There may remain some bugs, but it disassembles |
| 11 | | Polygonet Commanders' memtest code 100% accurate (to my knowledge). |
| 10 | This disassembler has been 95% verified against the docs and a different disassembler. |
| 11 | The docs list some conflicting and confusing behaviors. These are mareked with an asterisk |
| 12 | and need to be tested on real hardware before this disassembler is considered 100% complete. |
| 12 | 13 | */ |
| 13 | 14 | |
| 14 | 15 | #include "dsp56k.h" |
| r5891 | r5892 | |
| 16 | 17 | /*******************/ |
| 17 | 18 | /* Dasm prototypes */ |
| 18 | 19 | /*******************/ |
| 19 | | static size_t dsp56k_dasm_addsub_2 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 20 | | static size_t dsp56k_dasm_mac_1 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 21 | | static size_t dsp56k_dasm_macr_1 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 22 | | static size_t dsp56k_dasm_move_1 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 23 | | static size_t dsp56k_dasm_mpy_1 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 24 | | static size_t dsp56k_dasm_mpyr_1 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 25 | | static size_t dsp56k_dasm_tfr_2 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 20 | static size_t dsp56k_dasm_addsub_2 (const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register); |
| 21 | static size_t dsp56k_dasm_mac_1 (const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register); |
| 22 | static size_t dsp56k_dasm_macr_1 (const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register); |
| 23 | static size_t dsp56k_dasm_tfr_2 (const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register); |
| 24 | static size_t dsp56k_dasm_move_1 (const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register); |
| 25 | static size_t dsp56k_dasm_mpy_1 (const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register); |
| 26 | static size_t dsp56k_dasm_mpyr_1 (const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register); |
| 26 | 27 | static size_t dsp56k_dasm_mpy_2 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 27 | 28 | static size_t dsp56k_dasm_mac_2 (const UINT16 op_byte, char* opcode_str, char* arg_str); |
| 28 | 29 | static size_t dsp56k_dasm_clr (const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register); |
| r5891 | r5892 | |
| 79 | 80 | static size_t dsp56k_dasm_debugcc (const UINT16 op, char* opcode_str, char* arg_str); |
| 80 | 81 | static size_t dsp56k_dasm_div (const UINT16 op, char* opcode_str, char* arg_str); |
| 81 | 82 | static size_t dsp56k_dasm_dmac (const UINT16 op, char* opcode_str, char* arg_str); |
| 82 | | static size_t dsp56k_dasm_do (const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str); |
| 83 | | static size_t dsp56k_dasm_do_1 (const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str); |
| 84 | | static size_t dsp56k_dasm_do_2 (const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str); |
| 85 | | static size_t dsp56k_dasm_doforever (const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str); |
| 83 | static size_t dsp56k_dasm_do (const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc); |
| 84 | static size_t dsp56k_dasm_do_1 (const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc); |
| 85 | static size_t dsp56k_dasm_do_2 (const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc); |
| 86 | static size_t dsp56k_dasm_doforever (const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc); |
| 86 | 87 | static size_t dsp56k_dasm_enddo (const UINT16 op, char* opcode_str, char* arg_str); |
| 87 | 88 | static size_t dsp56k_dasm_ext (const UINT16 op, char* opcode_str, char* arg_str); |
| 88 | 89 | static size_t dsp56k_dasm_illegal (const UINT16 op, char* opcode_str, char* arg_str); |
| r5891 | r5892 | |
| 189 | 190 | /**********************************/ |
| 190 | 191 | static void decode_x_memory_data_move(const UINT16 op, char* parallel_move_str); |
| 191 | 192 | static void decode_x_memory_data_move2(const UINT16 op, char* parallel_move_str, char* d_register); |
| 192 | | static void decode_dual_x_memory_data_read(const UINT16 op, char* parallel_move_str, char* parallel_move_str2); |
| 193 | static void decode_dual_x_memory_data_read(const UINT16 op, char* parallel_move_str, char* parallel_move_str2, char* d_register); |
| 193 | 194 | static void decode_register_to_register_data_move(const UINT16 op, char* parallel_move_str, char* d_register); |
| 194 | 195 | static void decode_x_memory_data_write_and_register_data_move(const UINT16 op, char* parallel_move_str, char* parallel_move_str2); |
| 195 | 196 | static void decode_address_register_update(const UINT16 op, char* parallel_move_str); |
| 196 | 197 | static void decode_x_memory_data_move_with_short_displacement(const UINT16 op, const UINT16 op2, char* parallel_move_str); |
| 197 | 198 | |
| 199 | |
| 198 | 200 | /********************/ |
| 199 | 201 | /* Helper functions */ |
| 200 | 202 | /********************/ |
| r5891 | r5892 | |
| 202 | 204 | static UINT16 dsp56k_op_mask(UINT16 op, UINT16 mask); |
| 203 | 205 | static void pad_string(const int dest_length, char* string); |
| 204 | 206 | |
| 205 | | enum bbbType { BBB_UPPER, BBB_MIDDLE, BBB_LOWER }; |
| 207 | enum bbbType { BBB_UPPER, BBB_MIDDLE, BBB_LOWER, BBB_INVALID }; |
| 206 | 208 | |
| 207 | 209 | |
| 210 | |
| 208 | 211 | /*****************************/ |
| 209 | 212 | /* Main disassembly function */ |
| 210 | 213 | /*****************************/ |
| r5891 | r5892 | |
| 222 | 225 | const UINT16 op = oprom[0] | (oprom[1] << 8); |
| 223 | 226 | const UINT16 op2 = oprom[2] | (oprom[3] << 8); |
| 224 | 227 | |
| 225 | | /* Dual X Memory Data Read : 011m mKKK -rr- ---- : A-142*/ |
| 228 | /* Dual X Memory Data Read : 011m mKKK .rr. .... : A-142*/ |
| 226 | 229 | if ((op & 0xe000) == 0x6000) |
| 227 | 230 | { |
| 231 | char d_register[32] = ""; |
| 232 | |
| 228 | 233 | /* Quote: (MOVE, MAC(R), MPY(R), ADD, SUB, TFR) */ |
| 229 | 234 | UINT16 op_byte = op & 0x00ff; |
| 230 | 235 | |
| 231 | 236 | /* ADD : 011m mKKK 0rru Fuuu : A-22 */ |
| 232 | 237 | /* SUB : 011m mKKK 0rru Fuuu : A-202 */ |
| 233 | | if ((op & 0xe080) == 0x6000) |
| 238 | /* Note: 0x0094 check allows command to drop through to MOVE and TFR */ |
| 239 | if (((op & 0xe080) == 0x6000) && ((op & 0x0094) != 0x0010)) |
| 234 | 240 | { |
| 235 | | size = dsp56k_dasm_addsub_2(op_byte, opcode_str, arg_str); |
| 241 | size = dsp56k_dasm_addsub_2(op_byte, opcode_str, arg_str, d_register); |
| 236 | 242 | } |
| 237 | 243 | /* MAC : 011m mKKK 1xx0 F1QQ : A-122 */ |
| 238 | 244 | else if ((op & 0xe094) == 0x6084) |
| 239 | 245 | { |
| 240 | | size = dsp56k_dasm_mac_1(op_byte, opcode_str, arg_str); |
| 246 | size = dsp56k_dasm_mac_1(op_byte, opcode_str, arg_str, d_register); |
| 241 | 247 | } |
| 242 | 248 | /* MACR: 011m mKKK 1--1 F1QQ : A-124 */ |
| 243 | 249 | else if ((op & 0xe094) == 0x6094) |
| 244 | 250 | { |
| 245 | | size = dsp56k_dasm_macr_1(op_byte, opcode_str, arg_str); |
| 251 | size = dsp56k_dasm_macr_1(op_byte, opcode_str, arg_str, d_register); |
| 246 | 252 | } |
| 253 | /* TFR : 011m mKKK 0rr1 F0DD : A-212 */ |
| 254 | else if ((op & 0xe094) == 0x6010) |
| 255 | { |
| 256 | size = dsp56k_dasm_tfr_2(op_byte, opcode_str, arg_str, d_register); |
| 257 | } |
| 247 | 258 | /* MOVE : 011m mKKK 0rr1 0000 : A-128 */ |
| 248 | 259 | else if ((op & 0xe09f) == 0x6010) |
| 249 | 260 | { |
| 250 | | size = dsp56k_dasm_move_1(op_byte, opcode_str, arg_str); |
| 261 | /* Note: The opcode encoding : 011x xxxx 0xx1 0000 (move + double memory read) |
| 262 | is .identical. to (tfr X0,A + two parallel reads). This sparks the notion |
| 263 | that these 'move' opcodes don't actually exist and are just there as |
| 264 | documentation. Real-world examples would need to be examined to come |
| 265 | to a satisfactory conclusion, but as it stands, tfr will override this |
| 266 | move operation. */ |
| 267 | size = dsp56k_dasm_move_1(op_byte, opcode_str, arg_str, d_register); |
| 251 | 268 | } |
| 252 | 269 | /* MPY : 011m mKKK 1xx0 F0QQ : A-160 */ |
| 253 | 270 | else if ((op & 0xe094) == 0x6080) |
| 254 | 271 | { |
| 255 | | size = dsp56k_dasm_mpy_1(op_byte, opcode_str, arg_str); |
| 272 | size = dsp56k_dasm_mpy_1(op_byte, opcode_str, arg_str, d_register); |
| 256 | 273 | } |
| 257 | 274 | /* MPYR : 011m mKKK 1--1 F0QQ : A-162 */ |
| 258 | 275 | else if ((op & 0xe094) == 0x6090) |
| 259 | 276 | { |
| 260 | | size = dsp56k_dasm_mpyr_1(op_byte, opcode_str, arg_str); |
| 277 | size = dsp56k_dasm_mpyr_1(op_byte, opcode_str, arg_str, d_register); |
| 261 | 278 | } |
| 262 | | /* TFR : 011m mKKK 0rr1 F0DD : A-212 */ |
| 263 | | else if ((op & 0xe094) == 0x6010) |
| 264 | | { |
| 265 | | size = dsp56k_dasm_tfr_2(op_byte, opcode_str, arg_str); |
| 266 | | } |
| 267 | 279 | |
| 268 | 280 | /* Now evaluate the parallel data move */ |
| 269 | | decode_dual_x_memory_data_read(op, parallel_move_str, parallel_move_str2); |
| 281 | decode_dual_x_memory_data_read(op, parallel_move_str, parallel_move_str2, d_register); |
| 270 | 282 | } |
| 271 | | /* X Memory Data Write and Register Data Move : 0001 011k RRDD ---- : A-140 */ |
| 283 | /* X Memory Data Write and Register Data Move : 0001 011k RRDD .... : A-140 */ |
| 272 | 284 | else if ((op & 0xfe00) == 0x1600) |
| 273 | 285 | { |
| 274 | 286 | /* Quote: (MPY or MAC) */ |
| r5891 | r5892 | |
| 734 | 746 | { |
| 735 | 747 | size = dsp56k_dasm_bscc(op, op2, opcode_str, arg_str, pc); |
| 736 | 748 | } |
| 737 | | /* BScc: 0000 0111 RR00 cccc : A-54 */ |
| 749 | /* BScc : 0000 0111 RR00 cccc : A-54 */ |
| 738 | 750 | else if ((op & 0xff30) == 0x0700) |
| 739 | 751 | { |
| 740 | 752 | size = dsp56k_dasm_bscc_1(op, opcode_str, arg_str); |
| r5891 | r5892 | |
| 765 | 777 | size = dsp56k_dasm_debugcc(op, opcode_str, arg_str); |
| 766 | 778 | } |
| 767 | 779 | /* DIV : 0001 0101 0--0 F1DD : A-76 */ |
| 768 | | /* WARNING : DOCS SAY THERE IS A PARALLEL MOVE HERE !!! */ |
| 769 | 780 | else if ((op & 0xff94) == 0x1504) |
| 770 | 781 | { |
| 771 | 782 | size = dsp56k_dasm_div(op, opcode_str, arg_str); |
| r5891 | r5892 | |
| 778 | 789 | /* DO : 0000 0000 110- --RR xxxx xxxx xxxx xxxx : A-82 */ |
| 779 | 790 | else if (((op & 0xffe0) == 0x00c0) && ((op2 & 0x0000) == 0x0000)) |
| 780 | 791 | { |
| 781 | | size = dsp56k_dasm_do(op, op2, opcode_str, arg_str); |
| 792 | size = dsp56k_dasm_do(op, op2, opcode_str, arg_str, pc); |
| 782 | 793 | } |
| 783 | 794 | /* DO : 0000 1110 iiii iiii xxxx xxxx xxxx xxxx : A-82 */ |
| 784 | 795 | else if (((op & 0xff00) == 0x0e00) && ((op2 & 0x0000) == 0x0000)) |
| 785 | 796 | { |
| 786 | | size = dsp56k_dasm_do_1(op, op2, opcode_str, arg_str); |
| 797 | size = dsp56k_dasm_do_1(op, op2, opcode_str, arg_str, pc); |
| 787 | 798 | } |
| 788 | 799 | /* DO : 0000 0100 000D DDDD xxxx xxxx xxxx xxxx : A-82 */ |
| 789 | 800 | else if (((op & 0xffe0) == 0x0400) && ((op2 & 0x0000) == 0x0000)) |
| 790 | 801 | { |
| 791 | | size = dsp56k_dasm_do_2(op, op2, opcode_str, arg_str); |
| 802 | size = dsp56k_dasm_do_2(op, op2, opcode_str, arg_str, pc); |
| 792 | 803 | } |
| 793 | 804 | /* DO FOREVER : 0000 0000 0000 0010 xxxx xxxx xxxx xxxx : A-88 */ |
| 794 | 805 | else if (((op & 0xffff) == 0x0002) && ((op2 & 0x0000) == 0x0000)) |
| 795 | 806 | { |
| 796 | | size = dsp56k_dasm_doforever(op, op2, opcode_str, arg_str); |
| 807 | size = dsp56k_dasm_doforever(op, op2, opcode_str, arg_str, pc); |
| 797 | 808 | } |
| 798 | 809 | /* ENDDO : 0000 0000 0000 1001 : A-92 */ |
| 799 | 810 | else if ((op & 0xffff) == 0x0009) |
| r5891 | r5892 | |
| 1080 | 1091 | |
| 1081 | 1092 | /* ADD : 011m mKKK 0rru Fuuu : A-22 */ |
| 1082 | 1093 | /* SUB : 011m mKKK 0rru Fuuu : A-202 */ |
| 1083 | | static size_t dsp56k_dasm_addsub_2(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1094 | static size_t dsp56k_dasm_addsub_2(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1084 | 1095 | { |
| 1085 | 1096 | /* TODO: How strange. Same as SUB? Investigate */ |
| 1086 | 1097 | char D[32]; |
| r5891 | r5892 | |
| 1089 | 1100 | decode_uuuuF_table(BITS(op_byte,0x17), BITS(op_byte,0x08), arg, S1, D); |
| 1090 | 1101 | sprintf(opcode_str, "%s", arg); |
| 1091 | 1102 | sprintf(arg_str, "%s,%s", S1, D); |
| 1103 | sprintf(d_register, "%s", D); |
| 1092 | 1104 | return 1; |
| 1093 | 1105 | } |
| 1094 | 1106 | |
| 1095 | 1107 | /* MAC : 011m mKKK 1xx0 F1QQ : A-122 */ |
| 1096 | | static size_t dsp56k_dasm_mac_1(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1108 | static size_t dsp56k_dasm_mac_1(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1097 | 1109 | { |
| 1098 | 1110 | char D[32]; |
| 1099 | 1111 | char S1[32]; |
| 1100 | 1112 | char S2[32]; |
| 1101 | | /* Oddly, these 4 mpxx ops have identical operand ordering as compared to single memory move equivalents */ |
| 1102 | 1113 | decode_QQF_table(BITS(op_byte,0x03), BITS(op_byte,0x08), S1, S2, D); |
| 1114 | sprintf(opcode_str, "mac"); |
| 1103 | 1115 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1104 | | sprintf(opcode_str, "mac"); |
| 1116 | sprintf(d_register, "%s", D); |
| 1105 | 1117 | return 1; |
| 1106 | 1118 | } |
| 1107 | 1119 | |
| 1108 | 1120 | /* MACR: 011m mKKK 1--1 F1QQ : A-124 */ |
| 1109 | | static size_t dsp56k_dasm_macr_1(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1121 | static size_t dsp56k_dasm_macr_1(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1110 | 1122 | { |
| 1111 | 1123 | char D[32]; |
| 1112 | 1124 | char S1[32]; |
| 1113 | 1125 | char S2[32]; |
| 1114 | | /* Oddly, these 4 mpxx ops have identical operand ordering as compared to single memory move equivalents */ |
| 1115 | 1126 | decode_QQF_table(BITS(op_byte,0x03), BITS(op_byte,0x08), S1, S2, D); |
| 1127 | sprintf(opcode_str, "macr"); |
| 1116 | 1128 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1117 | | sprintf(opcode_str, "macr"); |
| 1129 | sprintf(d_register, "%s", D); |
| 1118 | 1130 | return 1; |
| 1119 | 1131 | } |
| 1120 | 1132 | |
| 1133 | /* TFR : 011m mKKK 0rr1 F0DD : A-212 */ |
| 1134 | static size_t dsp56k_dasm_tfr_2(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1135 | { |
| 1136 | /* Note: This opcode collides with move_1 when F0DD is 0000. Needs verifying on a real CPU. */ |
| 1137 | char D[32]; |
| 1138 | char S1[32]; |
| 1139 | decode_DDF_table(BITS(op_byte,0x03), BITS(op_byte,0x08), S1, D); |
| 1140 | sprintf(opcode_str, "tfr"); |
| 1141 | if (BITS(op_byte,0x0f) == 0x00) |
| 1142 | strcat(opcode_str, "*"); /* This asterisk is to denote that this opcode may have an error with its disassembly */ |
| 1143 | sprintf(arg_str, "%s,%s", S1, D); |
| 1144 | sprintf(d_register, "%s", D); |
| 1145 | return 1; |
| 1146 | } |
| 1147 | |
| 1121 | 1148 | /* MOVE : 011m mKKK 0rr1 0000 : A-128 */ |
| 1122 | | static size_t dsp56k_dasm_move_1(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1149 | static size_t dsp56k_dasm_move_1(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1123 | 1150 | { |
| 1124 | | /* TODO: This MOVE opcode is .identical. to the TFR one. Investigate */ |
| 1151 | /* Note: This opcode collides with tfr_2 & will never be disassembled. Needs verifying on a real CPU. */ |
| 1125 | 1152 | char D[32]; |
| 1126 | 1153 | char S1[32]; |
| 1127 | 1154 | decode_DDF_table(BITS(op_byte,0x03), BITS(op_byte,0x08), S1, D); |
| 1128 | 1155 | sprintf(opcode_str, "tfr"); |
| 1129 | 1156 | sprintf(arg_str, "%s,%s", S1, D); |
| 1157 | sprintf(d_register, "%s", D); |
| 1130 | 1158 | return 1; |
| 1131 | 1159 | } |
| 1132 | 1160 | |
| 1133 | 1161 | /* MPY : 011m mKKK 1xx0 F0QQ : A-160 */ |
| 1134 | | static size_t dsp56k_dasm_mpy_1(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1162 | static size_t dsp56k_dasm_mpy_1(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1135 | 1163 | { |
| 1136 | 1164 | char D[32]; |
| 1137 | 1165 | char S1[32]; |
| 1138 | 1166 | char S2[32]; |
| 1139 | | /* Oddly, these 4 mpxx ops have identical operand ordering as compared to single memory move equivalents */ |
| 1140 | 1167 | decode_QQF_table(BITS(op_byte,0x03), BITS(op_byte,0x08), S1, S2, D); |
| 1168 | sprintf(opcode_str, "mpy"); |
| 1141 | 1169 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1142 | | sprintf(opcode_str, "mpy"); |
| 1170 | sprintf(d_register, "%s", D); |
| 1143 | 1171 | return 1; |
| 1144 | 1172 | } |
| 1145 | 1173 | |
| 1146 | 1174 | /* MPYR : 011m mKKK 1--1 F0QQ : A-162 */ |
| 1147 | | static size_t dsp56k_dasm_mpyr_1(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1175 | static size_t dsp56k_dasm_mpyr_1(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1148 | 1176 | { |
| 1149 | 1177 | char D[32]; |
| 1150 | 1178 | char S1[32]; |
| 1151 | 1179 | char S2[32]; |
| 1152 | | /* Oddly, these 4 mpxx ops have identical operand ordering as compared to single memory move equivalents */ |
| 1153 | 1180 | decode_QQF_table(BITS(op_byte,0x03), BITS(op_byte,0x08), S1, S2, D); |
| 1181 | sprintf(opcode_str, "mpyr"); |
| 1154 | 1182 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1155 | | sprintf(opcode_str, "mpyr"); |
| 1183 | sprintf(d_register, "%s", D); |
| 1156 | 1184 | return 1; |
| 1157 | 1185 | } |
| 1158 | 1186 | |
| 1159 | | /* TFR : 011m mKKK 0rr1 F0DD : A-212 */ |
| 1160 | | static size_t dsp56k_dasm_tfr_2(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1187 | /* MPY : 0001 0110 RRDD FQQQ : A-160 */ |
| 1188 | static size_t dsp56k_dasm_mpy_2(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1161 | 1189 | { |
| 1162 | | /* TODO - Same as move above. Investigate */ |
| 1163 | 1190 | char D[32]; |
| 1164 | 1191 | char S1[32]; |
| 1165 | | decode_DDF_table(BITS(op_byte,0x03), BITS(op_byte,0x08), S1, D); |
| 1166 | | sprintf(opcode_str, "tfr"); |
| 1167 | | sprintf(arg_str, "%s,%s", S1, D); |
| 1192 | char S2[32]; |
| 1193 | decode_QQQF_table(BITS(op_byte,0x0007), BITS(op_byte,0x0008), S1, S2, D); |
| 1194 | sprintf(opcode_str, "mpy"); |
| 1195 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1168 | 1196 | return 1; |
| 1169 | 1197 | } |
| 1170 | 1198 | |
| 1171 | | /* MPY : 0001 0110 RRDD FQQQ : A-160 */ |
| 1172 | | static size_t dsp56k_dasm_mpy_2(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1173 | | { |
| 1174 | | /* TODO |
| 1175 | | // MPY - 0001 0110 RRDD FQQQ |
| 1176 | | decode_k_table(BITS(op,0x0100), Dnot); |
| 1177 | | Rnum = decode_RR_table(BITS(op,0x00c0)); |
| 1178 | | decode_DD_table(BITS(op,0x0030), S); |
| 1179 | | decode_QQQF_table(BITS(op,0x0007), BITS(op,0x0008), S1, S2, D); |
| 1180 | | sprintf(buffer, "mpy %s,%s,%s %s,(R%d)+N%d %s,%s", S1, S2, D, Dnot, Rnum, Rnum, S, Dnot); |
| 1181 | | // Strange, but not entirely out of the question - this 'k' parameter is hardcoded |
| 1182 | | // I cheat here and do the parallel memory data move above - this specific one is only used twice |
| 1183 | | retSize = 1; |
| 1184 | | */ |
| 1185 | | return 0; |
| 1186 | | } |
| 1187 | | |
| 1188 | 1199 | /* MAC : 0001 0111 RRDD FQQQ : A-122 */ |
| 1189 | 1200 | static size_t dsp56k_dasm_mac_2(const UINT16 op_byte, char* opcode_str, char* arg_str) |
| 1190 | 1201 | { |
| 1191 | | /* TODO |
| 1192 | | // MAC - 0001 0111 RRDD FQQQ |
| 1193 | | decode_k_table(BITS(op,0x0100), Dnot); |
| 1194 | | Rnum = decode_RR_table(BITS(op,0x00c0)); |
| 1195 | | decode_DD_table(BITS(op,0x0030), S); |
| 1196 | | decode_QQQF_table(BITS(op,0x0007), BITS(op,0x0008), S1, S2, D); |
| 1197 | | sprintf(buffer, "mac %s,%s,%s %s,(R%d)+N%d %s,%s", S1, S2, D, Dnot, Rnum, Rnum, S, Dnot); |
| 1198 | | // Strange, but not entirely out of the question - this 'k' parameter is hardcoded |
| 1199 | | // I cheat here and do the parallel memory data move above - this specific one is only used twice |
| 1200 | | retSize = 1; |
| 1201 | | */ |
| 1202 | | return 0; |
| 1202 | char D[32]; |
| 1203 | char S1[32]; |
| 1204 | char S2[32]; |
| 1205 | decode_QQQF_table(BITS(op_byte,0x0007), BITS(op_byte,0x0008), S1, S2, D); |
| 1206 | sprintf(opcode_str, "mac"); |
| 1207 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1208 | return 1; |
| 1203 | 1209 | } |
| 1204 | 1210 | |
| 1205 | 1211 | /* CLR : .... .... 0000 F001 : A-60 */ |
| r5891 | r5892 | |
| 1364 | 1370 | { |
| 1365 | 1371 | sprintf(opcode_str, "subl"); |
| 1366 | 1372 | |
| 1367 | | /* Only one option for the F table */ |
| 1373 | /* There is only one option for the F table. This is a very strange opcode. */ |
| 1368 | 1374 | if (!BITS(op_byte,0x08)) |
| 1369 | 1375 | { |
| 1370 | 1376 | sprintf(arg_str, "B,A"); |
| r5891 | r5892 | |
| 1372 | 1378 | } |
| 1373 | 1379 | else |
| 1374 | 1380 | { |
| 1375 | | sprintf(arg_str, "!"); |
| 1381 | sprintf(arg_str, "!,!"); |
| 1382 | sprintf(d_register, "!"); |
| 1376 | 1383 | } |
| 1377 | 1384 | |
| 1378 | 1385 | return 1; |
| r5891 | r5892 | |
| 1418 | 1425 | { |
| 1419 | 1426 | char D[32]; |
| 1420 | 1427 | char S1[32]; |
| 1428 | /* Note: This is a JJJF limited in the docs, but other opcodes sneak |
| 1429 | in before cmp, so the same decode function can be used. */ |
| 1421 | 1430 | decode_JJJF_table(BITS(op_byte,0x07), BITS(op_byte,0x08), S1, D); |
| 1422 | | /* TODO: This is a JJJF limited */ |
| 1423 | 1431 | sprintf(opcode_str, "cmp"); |
| 1424 | | sprintf(arg_str, "%s,%s", S1,D); |
| 1432 | sprintf(arg_str, "%s,%s", S1, D); |
| 1425 | 1433 | sprintf(d_register, "%s", D); |
| 1426 | 1434 | return 1; |
| 1427 | 1435 | } |
| r5891 | r5892 | |
| 1520 | 1528 | { |
| 1521 | 1529 | char D[32]; |
| 1522 | 1530 | char S1[32]; |
| 1531 | /* Note: This is a JJJF limited in the docs, but other opcodes sneak |
| 1532 | in before cmp, so the same decode function can be used. */ |
| 1523 | 1533 | decode_JJJF_table(BITS(op_byte,0x07), BITS(op_byte,0x08), S1, D); |
| 1524 | | /* TODO: This is JJJF limited */ |
| 1525 | 1534 | sprintf(opcode_str, "cmpm"); |
| 1526 | | sprintf(arg_str, "%s,%s", S1,D); |
| 1535 | sprintf(arg_str, "%s,%s", S1, D); |
| 1527 | 1536 | sprintf(d_register, "%s", D); |
| 1528 | 1537 | return 1; |
| 1529 | 1538 | } |
| r5891 | r5892 | |
| 1531 | 1540 | /* MPY : .... .... 1k00 FQQQ : A-160 -- CONFIRMED TYPO IN DOCS (HHHH vs HHHW) */ |
| 1532 | 1541 | static size_t dsp56k_dasm_mpy(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1533 | 1542 | { |
| 1543 | /* There are inconsistencies with the S1 & S2 operand ordering in the docs, |
| 1544 | but since it's a multiply it doesn't matter */ |
| 1534 | 1545 | char D[32]; |
| 1535 | 1546 | char S1[32]; |
| 1536 | 1547 | char S2[32]; |
| 1537 | | char SIGN[32]; |
| 1548 | char sign[32]; |
| 1538 | 1549 | decode_QQQF_table(BITS(op_byte,0x07), BITS(op_byte,0x08), S1, S2, D); |
| 1539 | | decode_kSign_table(BITS(op_byte,0x40), SIGN); |
| 1550 | decode_kSign_table(BITS(op_byte,0x40), sign); |
| 1540 | 1551 | sprintf(opcode_str, "mpy"); |
| 1541 | | sprintf(arg_str, "(%s)%s,%s,%s", SIGN, S2, S1, D); |
| 1552 | if (sign[0] == '-') |
| 1553 | sprintf(arg_str, "-%s,%s,%s", S1, S2, D); |
| 1554 | else |
| 1555 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1542 | 1556 | sprintf(d_register, "%s", D); |
| 1543 | 1557 | return 1; |
| 1544 | 1558 | } |
| r5891 | r5892 | |
| 1546 | 1560 | /* MPYR : .... .... 1k01 FQQQ : A-162 */ |
| 1547 | 1561 | static size_t dsp56k_dasm_mpyr(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1548 | 1562 | { |
| 1563 | /* There are inconsistencies with the S1 & S2 operand ordering in the docs, |
| 1564 | but since it's a multiply it doesn't matter */ |
| 1549 | 1565 | char D[32]; |
| 1550 | 1566 | char S1[32]; |
| 1551 | 1567 | char S2[32]; |
| 1552 | | char SIGN[32]; |
| 1568 | char sign[32]; |
| 1553 | 1569 | decode_QQQF_table(BITS(op_byte,0x07), BITS(op_byte,0x08), S1, S2, D); |
| 1554 | | decode_kSign_table(BITS(op_byte,0x40), SIGN); |
| 1570 | decode_kSign_table(BITS(op_byte,0x40), sign); |
| 1555 | 1571 | sprintf(opcode_str, "mpyr"); |
| 1556 | | sprintf(arg_str, "(%s)%s,%s,%s", SIGN, S2, S1, D); |
| 1572 | if (sign[0] == '-') |
| 1573 | sprintf(arg_str, "-%s,%s,%s", S1, S2, D); |
| 1574 | else |
| 1575 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1557 | 1576 | sprintf(d_register, "%s", D); |
| 1558 | 1577 | return 1; |
| 1559 | 1578 | } |
| r5891 | r5892 | |
| 1564 | 1583 | char D[32]; |
| 1565 | 1584 | char S1[32]; |
| 1566 | 1585 | char S2[32]; |
| 1567 | | char SIGN[32]; |
| 1586 | char sign[32]; |
| 1568 | 1587 | decode_QQQF_table(BITS(op_byte,0x07), BITS(op_byte,0x08), S1, S2, D); |
| 1569 | | decode_kSign_table(BITS(op_byte,0x40), SIGN); |
| 1588 | decode_kSign_table(BITS(op_byte,0x40), sign); |
| 1570 | 1589 | sprintf(opcode_str, "mac"); |
| 1571 | | sprintf(arg_str, "(%s)%s,%s,%s", SIGN, S2, S1, D); |
| 1590 | if (sign[0] == '-') |
| 1591 | sprintf(arg_str, "-%s,%s,%s", S1, S2, D); |
| 1592 | else |
| 1593 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1572 | 1594 | sprintf(d_register, "%s", D); |
| 1573 | 1595 | return 1; |
| 1574 | 1596 | } |
| r5891 | r5892 | |
| 1576 | 1598 | /* MACR : .... .... 1k11 FQQQ : A-124 -- DRAMA - rr vs xx (805) */ |
| 1577 | 1599 | static size_t dsp56k_dasm_macr(const UINT16 op_byte, char* opcode_str, char* arg_str, char* d_register) |
| 1578 | 1600 | { |
| 1601 | /* There are inconsistencies with the S1 & S2 operand ordering in the docs, |
| 1602 | but since it's a multiply it doesn't matter */ |
| 1579 | 1603 | char D[32]; |
| 1580 | 1604 | char S1[32]; |
| 1581 | 1605 | char S2[32]; |
| 1582 | | char SIGN[32]; |
| 1606 | char sign[32]; |
| 1583 | 1607 | decode_QQQF_table(BITS(op_byte,0x07), BITS(op_byte,0x08), S1, S2, D); |
| 1584 | | decode_kSign_table(BITS(op_byte,0x40), SIGN); |
| 1608 | decode_kSign_table(BITS(op_byte,0x40), sign); |
| 1585 | 1609 | sprintf(opcode_str, "macr"); |
| 1586 | | /* TODO: It's a little odd that macr is S1,S2 while everyone else (mac, mpy, mpyr) is S2,S1. Check! */ |
| 1587 | | sprintf(arg_str, "(%s)%s,%s,%s", SIGN, S1, S2, D); |
| 1610 | if (sign[0] == '-') |
| 1611 | sprintf(arg_str, "-%s,%s,%s", S1, S2, D); |
| 1612 | else |
| 1613 | sprintf(arg_str, "%s,%s,%s", S1, S2, D); |
| 1588 | 1614 | sprintf(d_register, "%s", D); |
| 1589 | 1615 | return 1; |
| 1590 | 1616 | } |
| r5891 | r5892 | |
| 1611 | 1637 | char D[32]; |
| 1612 | 1638 | decode_EE_table(BITS(op,0x0600), D); |
| 1613 | 1639 | sprintf(opcode_str, "and(i)"); |
| 1614 | | sprintf(arg_str, "#%02x,%s", BITS(op,0x00ff), D); |
| 1640 | sprintf(arg_str, "#$%02x,%s", BITS(op,0x00ff), D); |
| 1615 | 1641 | return 1; |
| 1616 | 1642 | } |
| 1617 | 1643 | |
| r5891 | r5892 | |
| 1693 | 1719 | decode_DDDDD_table(BITS(op,0x001f), D); |
| 1694 | 1720 | break; |
| 1695 | 1721 | } |
| 1696 | | sprintf(arg_str, "#%04x,%s", iVal, D); |
| 1697 | 1722 | |
| 1723 | if (upperMiddleLower != BBB_INVALID) |
| 1724 | { |
| 1725 | sprintf(arg_str, "#$%04x,%s", iVal, D); |
| 1726 | } |
| 1727 | else |
| 1728 | { |
| 1729 | sprintf(arg_str, "[[invalid]],%s", D); |
| 1730 | } |
| 1731 | |
| 1698 | 1732 | switch(BITS(op2,0x1f00)) |
| 1699 | 1733 | { |
| 1700 | 1734 | case 0x12: sprintf(opcode_str, "bfchg"); break; |
| r5891 | r5892 | |
| 1713 | 1747 | char M[32]; |
| 1714 | 1748 | decode_cccc_table(BITS(op,0x000f), M); |
| 1715 | 1749 | sprintf(opcode_str, "b.%s", M); |
| 1716 | | sprintf(arg_str, "%d (0x%04x)", (INT16)op2, pc + 2 + (INT16)op2); |
| 1750 | sprintf(arg_str, "$%04x (%d)", pc + 2 + (INT16)op2, (INT16)op2); |
| 1717 | 1751 | return 2; |
| 1718 | 1752 | } |
| 1719 | 1753 | |
| r5891 | r5892 | |
| 1725 | 1759 | decode_cccc_table(BITS(op,0x3c0), M); |
| 1726 | 1760 | relativeInt = get_6_bit_signed_value(BITS(op,0x003f)); |
| 1727 | 1761 | sprintf(opcode_str, "b.%s", M); |
| 1728 | | sprintf(arg_str, "%d (0x%04x)", relativeInt, pc + 1 + relativeInt); |
| 1762 | sprintf(arg_str, "$%04x (%d)", pc + 1 + relativeInt, relativeInt); |
| 1729 | 1763 | return 1; |
| 1730 | 1764 | } |
| 1731 | 1765 | |
| r5891 | r5892 | |
| 1745 | 1779 | static size_t dsp56k_dasm_bra(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc) |
| 1746 | 1780 | { |
| 1747 | 1781 | sprintf(opcode_str, "bra"); |
| 1748 | | sprintf(arg_str, "%d (0x%04x)", (INT16)op2, pc + 2 + op2); |
| 1782 | sprintf(arg_str, "$%04x (%d)", pc + 2 + op2, (INT16)op2); |
| 1749 | 1783 | return 2; |
| 1750 | 1784 | } |
| 1751 | 1785 | |
| 1752 | 1786 | /* BRA : 0000 1011 aaaa aaaa : A-50 */ |
| 1753 | 1787 | static size_t dsp56k_dasm_bra_1(const UINT16 op, char* opcode_str, char* arg_str, const offs_t pc) |
| 1754 | 1788 | { |
| 1789 | INT8 iVal = (INT8)BITS(op,0x00ff); |
| 1755 | 1790 | sprintf(opcode_str, "bra"); |
| 1756 | | sprintf(arg_str, "%d (0x%02x)", (INT8)BITS(op,0x00ff), pc + 1 + (INT8)BITS(op,0x00ff)); |
| 1791 | sprintf(arg_str, "$%04x (%d)", pc + 1 + iVal, iVal); |
| 1757 | 1792 | return 1; |
| 1758 | 1793 | } |
| 1759 | 1794 | |
| r5891 | r5892 | |
| 1783 | 1818 | char M[32]; |
| 1784 | 1819 | decode_cccc_table(BITS(op,0x000f), M); |
| 1785 | 1820 | sprintf(opcode_str, "bs.%s", M); |
| 1786 | | sprintf(arg_str, "%d (0x%04x)", (INT16)op2, pc + 2 + (INT16)op2); |
| 1787 | | return (2 | DASMFLAG_STEP_OVER); /* probably */ |
| 1821 | sprintf(arg_str, "$%04x (%d)", pc + 2 + (INT16)op2, (INT16)op2); |
| 1822 | return (2 | DASMFLAG_STEP_OVER); |
| 1788 | 1823 | } |
| 1789 | 1824 | |
| 1790 | 1825 | /* BScc: 0000 0111 RR00 cccc : A-54 */ |
| r5891 | r5892 | |
| 1796 | 1831 | Rnum = decode_RR_table(BITS(op,0x00c0)); |
| 1797 | 1832 | sprintf(opcode_str, "bs.%s", M); |
| 1798 | 1833 | sprintf(arg_str, "R%d", Rnum); |
| 1799 | | return (1 | DASMFLAG_STEP_OVER); /* probably. What's the diff between a branch and a jump? */ |
| 1834 | return (1 | DASMFLAG_STEP_OVER); |
| 1800 | 1835 | } |
| 1801 | 1836 | |
| 1802 | 1837 | /* BSR : 0000 0001 0011 10-- xxxx xxxx xxxx xxxx : A-56 */ |
| 1803 | 1838 | static size_t dsp56k_dasm_bsr(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc) |
| 1804 | 1839 | { |
| 1805 | 1840 | sprintf(opcode_str, "bsr"); |
| 1806 | | sprintf(arg_str, "%d (0x%04x)", (INT16)op2, pc + 2 + (INT16)op2); |
| 1841 | sprintf(arg_str, "$%04x (%d)", pc + 2 + (INT16)op2, (INT16)op2); |
| 1807 | 1842 | return (2 | DASMFLAG_STEP_OVER); |
| 1808 | 1843 | } |
| 1809 | 1844 | |
| r5891 | r5892 | |
| 1844 | 1879 | } |
| 1845 | 1880 | |
| 1846 | 1881 | /* DIV : 0001 0101 0--0 F1DD : A-76 */ |
| 1847 | | /* WARNING : DOCS SAY THERE IS A PARALLEL MOVE HERE !!! */ |
| 1848 | 1882 | static size_t dsp56k_dasm_div(const UINT16 op, char* opcode_str, char* arg_str) |
| 1849 | 1883 | { |
| 1884 | /* The docs on page A-76 claim there is potential for a parallel move here, |
| 1885 | but various other sources (including elsewhere in the family manual) disagree */ |
| 1850 | 1886 | char D[32]; |
| 1851 | 1887 | char S1[32]; |
| 1852 | 1888 | decode_DDF_table(BITS(op,0x0003), BITS(op,0x0008), S1, D); |
| r5891 | r5892 | |
| 1870 | 1906 | } |
| 1871 | 1907 | |
| 1872 | 1908 | /* DO : 0000 0000 110- --RR xxxx xxxx xxxx xxxx : A-82 */ |
| 1873 | | static size_t dsp56k_dasm_do(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str) |
| 1909 | static size_t dsp56k_dasm_do(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc) |
| 1874 | 1910 | { |
| 1875 | 1911 | int Rnum; |
| 1876 | 1912 | Rnum = decode_RR_table(BITS(op,0x0003)); |
| 1877 | 1913 | sprintf(opcode_str, "do"); |
| 1878 | | sprintf(arg_str, "X:(R%d),%02x", Rnum, op2); |
| 1914 | sprintf(arg_str, "X:(R%d),$%02x", Rnum, pc + 2 + op2); |
| 1879 | 1915 | return 2; |
| 1880 | 1916 | } |
| 1881 | 1917 | |
| 1882 | 1918 | /* DO : 0000 1110 iiii iiii xxxx xxxx xxxx xxxx : A-82 */ |
| 1883 | | static size_t dsp56k_dasm_do_1(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str) |
| 1919 | static size_t dsp56k_dasm_do_1(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc) |
| 1884 | 1920 | { |
| 1885 | 1921 | sprintf(opcode_str, "do"); |
| 1886 | | sprintf(arg_str, "#%02x,%04x", BITS(op,0x00ff), op2); |
| 1922 | sprintf(arg_str, "#$%02x,$%04x", BITS(op,0x00ff), pc + 2 + op2); |
| 1887 | 1923 | return 2; |
| 1888 | 1924 | } |
| 1889 | 1925 | |
| 1890 | 1926 | /* DO : 0000 0100 000D DDDD xxxx xxxx xxxx xxxx : A-82 */ |
| 1891 | | static size_t dsp56k_dasm_do_2(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str) |
| 1927 | static size_t dsp56k_dasm_do_2(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc) |
| 1892 | 1928 | { |
| 1893 | 1929 | char S1[32]; |
| 1894 | 1930 | decode_DDDDD_table(BITS(op,0x001f), S1); |
| 1895 | 1931 | sprintf(opcode_str, "do"); |
| 1896 | | sprintf(arg_str, "%s,%04x", S1, op2); |
| 1932 | sprintf(arg_str, "%s,$%04x", S1, pc + 2 + op2); |
| 1897 | 1933 | return 2; |
| 1898 | 1934 | } |
| 1899 | 1935 | |
| 1900 | 1936 | /* DO FOREVER : 0000 0000 0000 0010 xxxx xxxx xxxx xxxx : A-88 */ |
| 1901 | | static size_t dsp56k_dasm_doforever(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str) |
| 1937 | static size_t dsp56k_dasm_doforever(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str, const offs_t pc) |
| 1902 | 1938 | { |
| 1903 | | sprintf(opcode_str, "doForever"); |
| 1904 | | sprintf(arg_str, "%04x", op2); |
| 1939 | sprintf(opcode_str, "do forever"); |
| 1940 | sprintf(arg_str, "$%04x", pc + 2 + op2); |
| 1905 | 1941 | return 2; |
| 1906 | 1942 | } |
| 1907 | 1943 | |
| r5891 | r5892 | |
| 1961 | 1997 | char M[32]; |
| 1962 | 1998 | decode_cccc_table(BITS(op,0x000f), M); |
| 1963 | 1999 | sprintf(opcode_str, "j.%s", M); |
| 1964 | | sprintf(arg_str, "%04x", op2); |
| 2000 | sprintf(arg_str, "$%04x", op2); |
| 1965 | 2001 | return 2; |
| 1966 | 2002 | } |
| 1967 | 2003 | |
| r5891 | r5892 | |
| 1981 | 2017 | static size_t dsp56k_dasm_jmp(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str) |
| 1982 | 2018 | { |
| 1983 | 2019 | sprintf(opcode_str, "jmp"); |
| 1984 | | sprintf(arg_str, "%04x", op2); |
| 2020 | sprintf(arg_str, "$%04x", op2); |
| 1985 | 2021 | return 2; |
| 1986 | 2022 | } |
| 1987 | 2023 | |
| r5891 | r5892 | |
| 2001 | 2037 | char M[32]; |
| 2002 | 2038 | decode_cccc_table(BITS(op,0x000f), M); |
| 2003 | 2039 | sprintf(opcode_str, "js.%s", M); |
| 2004 | | sprintf(arg_str, "%04x", op2); |
| 2005 | | return (2 |DASMFLAG_STEP_OVER); /* probably */ |
| 2040 | sprintf(arg_str, "$%04x", op2); |
| 2041 | return (2 | DASMFLAG_STEP_OVER); |
| 2006 | 2042 | } |
| 2007 | 2043 | |
| 2008 | 2044 | /* JScc : 0000 0110 RR00 cccc : A-112 */ |
| r5891 | r5892 | |
| 2014 | 2050 | Rnum = decode_RR_table(BITS(op,0x00c0)); |
| 2015 | 2051 | sprintf(opcode_str, "js.%s", M); |
| 2016 | 2052 | sprintf(arg_str, "R%d", Rnum); |
| 2017 | | return (1 | DASMFLAG_STEP_OVER); /* probably. What's the diff between a branch and a jump? */ |
| 2053 | return (1 | DASMFLAG_STEP_OVER); |
| 2018 | 2054 | } |
| 2019 | 2055 | |
| 2020 | 2056 | /* JSR : 0000 0001 0011 00-- xxxx xxxx xxxx xxxx : A-114 */ |
| 2021 | 2057 | static size_t dsp56k_dasm_jsr(const UINT16 op, const UINT16 op2, char* opcode_str, char* arg_str) |
| 2022 | 2058 | { |
| 2023 | 2059 | sprintf(opcode_str, "jsr"); |
| 2024 | | sprintf(arg_str, "%04x", op2); |
| 2060 | sprintf(arg_str, "$%04x", op2); |
| 2025 | 2061 | return (2 | DASMFLAG_STEP_OVER); |
| 2026 | 2062 | } |
| 2027 | 2063 | |
| r5891 | r5892 | |
| 2029 | 2065 | static size_t dsp56k_dasm_jsr_1(const UINT16 op, char* opcode_str, char* arg_str) |
| 2030 | 2066 | { |
| 2031 | 2067 | sprintf(opcode_str, "jsr"); |
| 2032 | | sprintf(arg_str, "%d (0x%02x)", BITS(op,0x00ff), BITS(op,0x00ff)); |
| 2068 | sprintf(arg_str, "#$%02x", BITS(op,0x00ff)); |
| 2033 | 2069 | return (1 | DASMFLAG_STEP_OVER); |
| 2034 | 2070 | } |
| 2035 | 2071 | |
| r5891 | r5892 | |
| 2194 | 2230 | char D1[32]; |
| 2195 | 2231 | decode_DD_table(BITS(op,0x0300), D1); |
| 2196 | 2232 | sprintf(opcode_str, "move(i)"); |
| 2197 | | sprintf(arg_str, "#%02x,%s", BITS(op,0x00ff), D1); |
| 2233 | sprintf(arg_str, "#$%02x,%s", BITS(op,0x00ff), D1); |
| 2198 | 2234 | return 1; |
| 2199 | 2235 | } |
| 2200 | 2236 | |
| r5891 | r5892 | |
| 2224 | 2260 | assemble_eas_from_m_table(BITS(op,0x000c), BITS(op,0x00c0), BITS(op,0x0003), ea, ea2); |
| 2225 | 2261 | sprintf(SD, "P:%s", ea); |
| 2226 | 2262 | assemble_arguments_from_W_table(BITS(op,0x0100), args, 'X', SD, ea2); |
| 2227 | | sprintf(opcode_str, "move(m)"); |
| 2263 | sprintf(opcode_str, "move(m)*"); /* This asterisk is to denote that this opcode may have an error with its disassembly */ |
| 2228 | 2264 | sprintf(arg_str, "%s", args); |
| 2229 | 2265 | return 1; |
| 2230 | 2266 | } |
| r5891 | r5892 | |
| 2240 | 2276 | assemble_reg_from_W_table(BITS(op2,0x0100), args, 'P', SD, B); |
| 2241 | 2277 | sprintf(opcode_str, "move(m)"); |
| 2242 | 2278 | sprintf(arg_str, "%s", args); |
| 2243 | | /* !!! The docs list the read/write order backwards for all move(m)'s - crackbabies ??? */ |
| 2244 | 2279 | return 2; |
| 2245 | 2280 | } |
| 2246 | 2281 | |
| r5891 | r5892 | |
| 2250 | 2285 | char A[32]; |
| 2251 | 2286 | char SD[32]; |
| 2252 | 2287 | char args[32]; |
| 2253 | | char fullAddy[128]; |
| 2288 | char fullAddy[128]; /* Convert Short Absolute Address to full 16-bit */ |
| 2254 | 2289 | decode_HH_table(BITS(op,0x00c0), SD); |
| 2255 | | assemble_address_from_IO_short_address(BITS(op,0x001f), fullAddy); /* Convert Short Absolute Address to full 16-bit */ |
| 2256 | | sprintf(A, "%02x (%s)", BITS(op,0x001f), fullAddy); |
| 2290 | assemble_address_from_IO_short_address(BITS(op,0x001f), fullAddy); |
| 2291 | sprintf(A, "$%s", fullAddy); |
| 2257 | 2292 | assemble_arguments_from_W_table(BITS(op,0x0100), args, 'X', SD, A); |
| 2258 | 2293 | sprintf(opcode_str, "move(p)"); |
| 2259 | 2294 | sprintf(arg_str, "%s", args); |
| r5891 | r5892 | |
| 2271 | 2306 | Rnum = decode_RR_table(BITS(op,0x00c0)); |
| 2272 | 2307 | assemble_ea_from_m_table(BITS(op,0x0020), Rnum, ea); |
| 2273 | 2308 | assemble_address_from_IO_short_address(BITS(op,0x001f), fullAddy); |
| 2274 | | sprintf(SD, "X:%02x (%s)", BITS(op,0x001f), fullAddy); |
| 2309 | sprintf(SD, "X:$%s", fullAddy); |
| 2275 | 2310 | assemble_arguments_from_W_table(BITS(op,0x0100), args, 'X', SD, ea); |
| 2276 | | sprintf(opcode_str, "move(p)"); |
| 2311 | sprintf(opcode_str, "move(p)*"); /* This asterisk is to denote that this opcode may have an error with its disassembly */ |
| 2277 | 2312 | sprintf(arg_str, "%s", args); |
| 2278 | 2313 | return 1; |
| 2279 | 2314 | } |
| r5891 | r5892 | |
| 2285 | 2320 | char SD[32]; |
| 2286 | 2321 | char args[32]; |
| 2287 | 2322 | decode_HH_table(BITS(op,0x00c0), SD); |
| 2288 | | sprintf(A, "00%02x", BITS(op,0x001f)); |
| 2323 | sprintf(A, "$%02x", BITS(op,0x001f)); |
| 2289 | 2324 | assemble_arguments_from_W_table(BITS(op,0x0100), args, 'X', SD, A); |
| 2290 | 2325 | sprintf(opcode_str, "move(s)"); |
| 2291 | 2326 | sprintf(arg_str, "%s", args); |
| r5891 | r5892 | |
| 2342 | 2377 | char D[32]; |
| 2343 | 2378 | decode_EE_table(BITS(op,0x0600), D); |
| 2344 | 2379 | sprintf(opcode_str, "or(i)"); |
| 2345 | | sprintf(arg_str, "#%02x,%s", BITS(op,0x00ff), D); |
| 2380 | sprintf(arg_str, "#$%02x,%s", BITS(op,0x00ff), D); |
| 2346 | 2381 | return 1; |
| 2347 | 2382 | } |
| 2348 | 2383 | |
| r5891 | r5892 | |
| 2360 | 2395 | static size_t dsp56k_dasm_rep_1(const UINT16 op, char* opcode_str, char* arg_str) |
| 2361 | 2396 | { |
| 2362 | 2397 | sprintf(opcode_str, "rep"); |
| 2363 | | sprintf(arg_str, "%d (0x%02x)", BITS(op,0x00ff), BITS(op,0x00ff)); |
| 2398 | sprintf(arg_str, "#$%02x (%d)", BITS(op,0x00ff), BITS(op,0x00ff)); |
| 2364 | 2399 | return 1; |
| 2365 | 2400 | } |
| 2366 | 2401 | |
| r5891 | r5892 | |
| 2449 | 2484 | decode_h0hF_table(BITS(op,0x0007),BITS(op,0x0008), S, D); |
| 2450 | 2485 | sprintf(arg_str, "%s,%s R0,R%d", S, D, Rnum); |
| 2451 | 2486 | |
| 2452 | | /* TODO: Investigate |
| 2453 | | if (S1[0] == D[0] && D[0] == 'A') |
| 2454 | | sprintf(buffer, "t.%s %s,%s", M, S1, D); |
| 2455 | | else |
| 2456 | | sprintf(buffer, "t.%s %s,%s R0,R%d", M, S1, D, Rnum); |
| 2457 | | */ |
| 2487 | /* Note: S == 'A' && D == 'A' is used by the assembler when "no Data ALU |
| 2488 | transfer is specified in the instruction." The Data ALU contains the |
| 2489 | X,Y,A,B registers. The AGU holds the R registers. This comment means |
| 2490 | the assembler will create Tcc A,A when it wants to conditionally transfer |
| 2491 | only a R register to another R register. */ |
| 2458 | 2492 | return 1; |
| 2459 | 2493 | } |
| 2460 | 2494 | |
| r5891 | r5892 | |
| 2478 | 2512 | char S1[32]; |
| 2479 | 2513 | char SD[32]; |
| 2480 | 2514 | char args[32]; |
| 2481 | | decode_DDF_table(BITS(op,0x0030), BITS(op,0x0008), D1, S1); /* Intentionally switched */ |
| 2515 | decode_DDF_table(BITS(op,0x0030), BITS(op,0x0008), D1, S1); /* Intentionally switched */ |
| 2482 | 2516 | decode_HHH_table(BITS(op,0x0007), SD); |
| 2483 | 2517 | Rnum = decode_RR_table(BITS(op,0x00c0)); |
| 2484 | 2518 | assemble_ea_from_m_table(BITS(op,0x0200), Rnum, ea); |
| r5891 | r5892 | |
| 2558 | 2592 | } |
| 2559 | 2593 | |
| 2560 | 2594 | /* Dual X Memory Data Read : 011m mKKK -rr- ---- : A-142*/ |
| 2561 | | static void decode_dual_x_memory_data_read(const UINT16 op, char* parallel_move_str, char* parallel_move_str2) |
| 2595 | static void decode_dual_x_memory_data_read(const UINT16 op, char* parallel_move_str, char* parallel_move_str2, char* d_register) |
| 2562 | 2596 | { |
| 2563 | 2597 | int Rnum; |
| 2564 | 2598 | char D1[32] = ""; |
| r5891 | r5892 | |
| 2570 | 2604 | decode_KKK_table(BITS(op,0x0700), D1, D2); |
| 2571 | 2605 | assemble_eas_from_m_table(BITS(op,0x1800), Rnum, 3, ea1, ea2); |
| 2572 | 2606 | |
| 2573 | | /* TODO : The ^F's should likely be replaced */ |
| 2607 | /* Not documented, but extrapolated from docs on page A-133 */ |
| 2608 | if (D1[0] == '^' && D1[1] == 'F') |
| 2609 | { |
| 2610 | if (d_register[0] == 'B') |
| 2611 | sprintf(D1, "A"); |
| 2612 | else if (d_register[0] == 'A') |
| 2613 | sprintf(D1, "B"); |
| 2614 | else |
| 2615 | sprintf(D1, "A"); /* In the case of no data ALU operation */ |
| 2616 | } |
| 2574 | 2617 | |
| 2575 | | if (Rnum == -1) |
| 2618 | /* D1 and D2 may not specify the same register : A-142 */ |
| 2619 | if (Rnum == 3) |
| 2576 | 2620 | { |
| 2577 | | sprintf(ea1, "(!!)!"); |
| 2621 | /* Replace the R3 with !! */ |
| 2622 | ea1[1] = ea1[2] = '!'; |
| 2578 | 2623 | } |
| 2579 | 2624 | |
| 2580 | 2625 | sprintf(parallel_move_str, "X:%s,%s", ea1, D1); |
| r5891 | r5892 | |
| 2625 | 2670 | char S[32]; |
| 2626 | 2671 | char Dnot[32]; |
| 2627 | 2672 | |
| 2628 | | /* TODO : Cross-check the Dnot stuff against the MPY & MAC things. */ |
| 2629 | | /* It's likely correct as-is, since the ALU op and this guy probably decode the same bit, */ |
| 2630 | | /* but i may have to pass in d_register just to be sure? */ |
| 2631 | 2673 | decode_k_table(BITS(op,0x0100), Dnot); |
| 2632 | 2674 | Rnum = decode_RR_table(BITS(op,0x00c0)); |
| 2633 | 2675 | decode_DD_table(BITS(op,0x0030), S); |
| 2634 | 2676 | |
| 2635 | | /* TODO : is Nn correct here? */ |
| 2636 | 2677 | sprintf(parallel_move_str, "%s,X:(R%d)+N%d", Dnot, Rnum, Rnum); |
| 2637 | 2678 | sprintf(parallel_move_str2, "%s,%s", S, Dnot); |
| 2638 | 2679 | } |
| r5891 | r5892 | |
| 2664 | 2705 | case 0x1: return BBB_LOWER; |
| 2665 | 2706 | } |
| 2666 | 2707 | |
| 2667 | | return BBB_LOWER; /* Not really safe... */ |
| 2708 | return BBB_INVALID; |
| 2668 | 2709 | } |
| 2669 | 2710 | |
| 2670 | 2711 | static void decode_cccc_table(UINT16 cccc, char *mnemonic) |
| r5891 | r5892 | |
| 2918 | 2959 | |
| 2919 | 2960 | static void decode_KKK_table(UINT16 KKK, char *D1, char *D2) |
| 2920 | 2961 | { |
| 2921 | | /* TODO: Fix ^Fs */ |
| 2922 | 2962 | switch(KKK) |
| 2923 | 2963 | { |
| 2924 | 2964 | case 0x0: sprintf(D1, "^F"); sprintf(D2, "X0"); break; |
| r5891 | r5892 | |
| 3008 | 3048 | |
| 3009 | 3049 | static int decode_rr_table(UINT16 rr) |
| 3010 | 3050 | { |
| 3011 | | if (rr != 0x3) |
| 3012 | | return rr; |
| 3013 | | else |
| 3014 | | return -1; |
| 3051 | return rr; |
| 3015 | 3052 | } |
| 3016 | 3053 | |
| 3017 | 3054 | static void decode_s_table(UINT16 s, char *arithmetic) |
| r5891 | r5892 | |
| 3038 | 3075 | { |
| 3039 | 3076 | UINT16 switchVal = (uuuu << 1) | F; |
| 3040 | 3077 | |
| 3041 | | /* An invalid uuuuF has been seen in the wild */ |
| 3042 | 3078 | sprintf(D, "sub?"); |
| 3043 | | sprintf(S, "add?"); |
| 3079 | sprintf(S, "add"); |
| 3044 | 3080 | sprintf(arg, "invalid"); |
| 3045 | 3081 | |
| 3046 | 3082 | switch(switchVal) |
| r5891 | r5892 | |
| 3092 | 3128 | switch(mm) |
| 3093 | 3129 | { |
| 3094 | 3130 | case 0x0: sprintf(ea1, "(R%d)+", n1) ; |
| 3095 | | sprintf(ea2, "(R%d)+", n2) ; break; |
| 3131 | sprintf(ea2, "(R%d)+", n2) ; break; |
| 3096 | 3132 | case 0x1: sprintf(ea1, "(R%d)+", n1) ; |
| 3097 | | sprintf(ea2, "(R%d)+N%d", n2, n2); break; |
| 3133 | sprintf(ea2, "(R%d)+N%d", n2, n2); break; |
| 3098 | 3134 | case 0x2: sprintf(ea1, "(R%d)+N%d", n1, n1); |
| 3099 | | sprintf(ea2, "(R%d)+", n2) ; break; |
| 3135 | sprintf(ea2, "(R%d)+", n2) ; break; |
| 3100 | 3136 | case 0x3: sprintf(ea1, "(R%d)+N%d", n1, n1); |
| 3101 | | sprintf(ea2, "(R%d)+N%d", n2, n2); break; |
| 3137 | sprintf(ea2, "(R%d)+N%d", n2, n2); break; |
| 3102 | 3138 | } |
| 3103 | 3139 | } |
| 3104 | 3140 | |
| r5891 | r5892 | |
| 3126 | 3162 | { |
| 3127 | 3163 | switch(t) |
| 3128 | 3164 | { |
| 3129 | | /* !!! Looking at page 336 of UM, I'm not sure if 0 is X: or if 0 is just # !!! */ |
| 3130 | | case 0x0: sprintf(ea, "X:%04x", val); break; |
| 3131 | | case 0x1: sprintf(ea, "#%04x", val); break; |
| 3165 | case 0x0: sprintf(ea, "X:$%04x", val); break; |
| 3166 | case 0x1: sprintf(ea, "#$%04x", val); break; |
| 3132 | 3167 | } |
| 3133 | 3168 | } |
| 3134 | 3169 | |
| r5891 | r5892 | |
| 3147 | 3182 | |
| 3148 | 3183 | switch(P) |
| 3149 | 3184 | { |
| 3150 | | case 0x0: sprintf(D, "X:%02x", ppppp); break; |
| 3185 | case 0x0: sprintf(D, "X:$%02x", ppppp); break; |
| 3151 | 3186 | case 0x1: |
| 3152 | 3187 | assemble_address_from_IO_short_address(ppppp, fullAddy); |
| 3153 | | sprintf(D, "X:%02x (%s)", ppppp, fullAddy); |
| 3188 | sprintf(D, "X:$%s", fullAddy); |
| 3154 | 3189 | break; |
| 3155 | 3190 | } |
| 3156 | 3191 | } |
| r5891 | r5892 | |
| 3166 | 3201 | |
| 3167 | 3202 | static void assemble_reg_from_W_table(UINT16 W, char *args, char ma, char *SD, INT8 xx) |
| 3168 | 3203 | { |
| 3169 | | /* TODO : xx is said to be signed on page A-139. Nowhere else. Are they all signed? */ |
| 3204 | UINT8 abs_xx; |
| 3205 | char operation[32]; |
| 3206 | |
| 3207 | if(xx < 0) |
| 3208 | sprintf(operation,"-"); |
| 3209 | else |
| 3210 | sprintf(operation,"+"); |
| 3211 | |
| 3212 | abs_xx = abs(xx); |
| 3213 | |
| 3170 | 3214 | switch(W) |
| 3171 | 3215 | { |
| 3172 | | case 0x0: sprintf(args, "%s,%c:(R2+%02x)", SD, ma, xx); break; |
| 3173 | | case 0x1: sprintf(args, "%c:(R2+%02x),%s", ma, xx, SD); break; |
| 3216 | case 0x0: sprintf(args, "%s,%c:(R2%s$%02x)", SD, ma, operation, abs_xx); break; |
| 3217 | case 0x1: sprintf(args, "%c:(R2%s$%02x),%s", ma, operation, abs_xx, SD); break; |
| 3174 | 3218 | } |
| 3175 | 3219 | } |
| 3176 | 3220 | |
| r5891 | r5892 | |
| 3224 | 3268 | strcat(string, " "); |
| 3225 | 3269 | } |
| 3226 | 3270 | } |
| 3227 | | |
src/emu/cpu/s2650/s2650.c
| r5891 | r5892 | |
| 123 | 123 | 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84 |
| 124 | 124 | }; |
| 125 | 125 | |
| 126 | /*************************************************************** |
| 127 | * handy table to build PC relative offsets |
| 128 | * from HR (holding register) |
| 129 | ***************************************************************/ |
| 130 | static const int S2650_relative[0x100] = |
| 131 | { |
| 132 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 133 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, |
| 134 | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, |
| 135 | 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, |
| 136 | -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, |
| 137 | -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, |
| 138 | -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, |
| 139 | -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, |
| 140 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 141 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, |
| 142 | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, |
| 143 | 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, |
| 144 | -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, |
| 145 | -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, |
| 146 | -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, |
| 147 | -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, |
| 148 | }; |
| 149 | |
| 150 | |
| 151 | /*************************************************************** |
| 152 | * RDMEM |
| 153 | * read memory byte from addr |
| 154 | ***************************************************************/ |
| 155 | #define RDMEM(addr) memory_read_byte_8le(s2650c->program, addr) |
| 156 | |
| 126 | 157 | static void s2650_set_sense(s2650_regs *s2650c, int state); |
| 127 | 158 | |
| 159 | INLINE void set_psu(s2650_regs *s2650c, UINT8 new) |
| 160 | { |
| 161 | UINT8 old = s2650c->psu; |
| 128 | 162 | |
| 129 | | #define CHECK_IRQ_LINE \ |
| 130 | | if (s2650c->irq_state != CLEAR_LINE) \ |
| 131 | | { \ |
| 132 | | if( (s2650c->psu & II) == 0 ) \ |
| 133 | | { \ |
| 134 | | int vector; \ |
| 135 | | if (s2650c->halt) \ |
| 136 | | { \ |
| 137 | | s2650c->halt = 0; \ |
| 138 | | s2650c->iar = (s2650c->iar + 1) & PMSK; \ |
| 139 | | } \ |
| 140 | | vector = (*s2650c->irq_callback)(s2650c->device, 0) & 0xff; \ |
| 141 | | /* build effective address within first 8K page */ \ |
| 142 | | s2650c->ea = S2650_relative[vector] & PMSK; \ |
| 143 | | if (vector & 0x80) /* indirect bit set ? */ \ |
| 144 | | { \ |
| 145 | | int addr = s2650c->ea; \ |
| 146 | | s2650c->icount -= 6; \ |
| 147 | | /* build indirect 32K address */ \ |
| 148 | | s2650c->ea = RDMEM(addr) << 8; \ |
| 149 | | if (!(++addr & PMSK)) addr -= PLEN; \ |
| 150 | | s2650c->ea = (s2650c->ea + RDMEM(addr)) & AMSK; \ |
| 151 | | } \ |
| 152 | | LOG(("S2650 interrupt to $%04x\n", s2650c->ea));\ |
| 153 | | s2650c->psu = (s2650c->psu & ~SP) | ((s2650c->psu + 1) & SP) | II; \ |
| 154 | | s2650c->ras[s2650c->psu & SP] = s2650c->page + s2650c->iar; \ |
| 155 | | s2650c->page = s2650c->ea & PAGE; \ |
| 156 | | s2650c->iar = s2650c->ea & PMSK; \ |
| 157 | | } \ |
| 163 | s2650c->psu = new; |
| 164 | if ((new ^ old) & FO) |
| 165 | memory_write_byte_8le(s2650c->io, S2650_FO_PORT, (new & FO) ? 1 : 0); |
| 166 | } |
| 167 | |
| 168 | INLINE UINT8 get_sp(s2650_regs *s2650c) |
| 169 | { |
| 170 | return (s2650c->psu & SP); |
| 171 | } |
| 172 | |
| 173 | INLINE void set_sp(s2650_regs *s2650c, UINT8 new_sp) |
| 174 | { |
| 175 | s2650c->psu = (s2650c->psu & ~SP) | (new_sp & SP); |
| 176 | } |
| 177 | |
| 178 | INLINE int check_irq_line(s2650_regs *s2650c) |
| 179 | { |
| 180 | int cycles = 0; |
| 181 | |
| 182 | if (s2650c->irq_state != CLEAR_LINE) |
| 183 | { |
| 184 | if( (s2650c->psu & II) == 0 ) |
| 185 | { |
| 186 | int vector; |
| 187 | if (s2650c->halt) |
| 188 | { |
| 189 | s2650c->halt = 0; |
| 190 | s2650c->iar = (s2650c->iar + 1) & PMSK; |
| 191 | } |
| 192 | vector = (*s2650c->irq_callback)(s2650c->device, 0) & 0xff; |
| 193 | /* build effective address within first 8K page */ |
| 194 | s2650c->ea = S2650_relative[vector] & PMSK; |
| 195 | if (vector & 0x80) /* indirect bit set ? */ |
| 196 | { |
| 197 | int addr = s2650c->ea; |
| 198 | cycles += 6; |
| 199 | /* build indirect 32K address */ |
| 200 | s2650c->ea = RDMEM(addr) << 8; |
| 201 | if (!(++addr & PMSK)) addr -= PLEN; |
| 202 | s2650c->ea = (s2650c->ea + RDMEM(addr)) & AMSK; |
| 203 | } |
| 204 | LOG(("S2650 interrupt to $%04x\n", s2650c->ea)); |
| 205 | set_sp(s2650c, get_sp(s2650c) + 1); |
| 206 | set_psu(s2650c, s2650c->psu | II); |
| 207 | s2650c->ras[get_sp(s2650c)] = s2650c->page + s2650c->iar; |
| 208 | s2650c->page = s2650c->ea & PAGE; |
| 209 | s2650c->iar = s2650c->ea & PMSK; |
| 210 | } |
| 158 | 211 | } |
| 212 | return cycles; |
| 213 | } |
| 159 | 214 | |
| 160 | 215 | /*************************************************************** |
| 161 | 216 | * |
| r5891 | r5892 | |
| 198 | 253 | } |
| 199 | 254 | |
| 200 | 255 | /*************************************************************** |
| 201 | | * RDMEM |
| 202 | | * read memory byte from addr |
| 203 | | ***************************************************************/ |
| 204 | | #define RDMEM(addr) memory_read_byte_8le(s2650c->program, addr) |
| 205 | | |
| 206 | | /*************************************************************** |
| 207 | | * handy table to build PC relative offsets |
| 208 | | * from HR (holding register) |
| 209 | | ***************************************************************/ |
| 210 | | static const int S2650_relative[0x100] = |
| 211 | | { |
| 212 | | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 213 | | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, |
| 214 | | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, |
| 215 | | 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, |
| 216 | | -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, |
| 217 | | -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, |
| 218 | | -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, |
| 219 | | -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, |
| 220 | | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 221 | | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, |
| 222 | | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, |
| 223 | | 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, |
| 224 | | -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, |
| 225 | | -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, |
| 226 | | -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, |
| 227 | | -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, |
| 228 | | }; |
| 229 | | |
| 230 | | /*************************************************************** |
| 231 | 256 | * _REL_EA |
| 232 | 257 | * build effective address with relative addressing |
| 233 | 258 | ***************************************************************/ |
| r5891 | r5892 | |
| 407 | 432 | { \ |
| 408 | 433 | if( cond ) \ |
| 409 | 434 | { \ |
| 410 | | REL_EA(s2650c->page); \ |
| 411 | | s2650c->psu = (s2650c->psu & ~SP) | ((s2650c->psu + 1) & SP); \ |
| 412 | | s2650c->ras[s2650c->psu & SP] = s2650c->page + s2650c->iar; \ |
| 413 | | s2650c->page = s2650c->ea & PAGE; \ |
| 414 | | s2650c->iar = s2650c->ea & PMSK; \ |
| 415 | | } else s2650c->iar = (s2650c->iar + 1) & PMSK; \ |
| 435 | REL_EA(s2650c->page); \ |
| 436 | set_sp(s2650c, get_sp(s2650c) + 1); \ |
| 437 | s2650c->ras[get_sp(s2650c)] = s2650c->page + s2650c->iar; \ |
| 438 | s2650c->page = s2650c->ea & PAGE; \ |
| 439 | s2650c->iar = s2650c->ea & PMSK; \ |
| 440 | } else s2650c->iar = (s2650c->iar + 1) & PMSK; \ |
| 416 | 441 | } |
| 417 | 442 | |
| 418 | 443 | /*************************************************************** |
| r5891 | r5892 | |
| 422 | 447 | #define M_ZBSR() \ |
| 423 | 448 | { \ |
| 424 | 449 | REL_ZERO(0); \ |
| 425 | | s2650c->psu = (s2650c->psu & ~SP) | ((s2650c->psu + 1) & SP); \ |
| 426 | | s2650c->ras[s2650c->psu & SP] = s2650c->page + s2650c->iar; \ |
| 427 | | s2650c->page = s2650c->ea & PAGE; \ |
| 428 | | s2650c->iar = s2650c->ea & PMSK; \ |
| 450 | set_sp(s2650c, get_sp(s2650c) + 1); \ |
| 451 | s2650c->ras[get_sp(s2650c)] = s2650c->page + s2650c->iar; \ |
| 452 | s2650c->page = s2650c->ea & PAGE; \ |
| 453 | s2650c->iar = s2650c->ea & PMSK; \ |
| 429 | 454 | } |
| 430 | 455 | |
| 431 | 456 | /*************************************************************** |
| r5891 | r5892 | |
| 437 | 462 | if( cond ) \ |
| 438 | 463 | { \ |
| 439 | 464 | BRA_EA(); \ |
| 440 | | s2650c->psu = (s2650c->psu & ~SP) | ((s2650c->psu + 1) & SP); \ |
| 441 | | s2650c->ras[s2650c->psu & SP] = s2650c->page + s2650c->iar; \ |
| 465 | set_sp(s2650c, get_sp(s2650c) + 1); \ |
| 466 | s2650c->ras[get_sp(s2650c)] = s2650c->page + s2650c->iar; \ |
| 442 | 467 | s2650c->page = s2650c->ea & PAGE; \ |
| 443 | 468 | s2650c->iar = s2650c->ea & PMSK; \ |
| 444 | 469 | } else s2650c->iar = (s2650c->iar + 2) & PMSK; \ |
| r5891 | r5892 | |
| 452 | 477 | { \ |
| 453 | 478 | BRA_EA(); \ |
| 454 | 479 | s2650c->ea = (s2650c->ea + s2650c->reg[3]) & AMSK; \ |
| 455 | | s2650c->psu = (s2650c->psu & ~SP) | ((s2650c->psu + 1) & SP); \ |
| 456 | | s2650c->ras[s2650c->psu & SP] = s2650c->page + s2650c->iar; \ |
| 480 | set_sp(s2650c, get_sp(s2650c) + 1); \ |
| 481 | s2650c->ras[get_sp(s2650c)] = s2650c->page + s2650c->iar; \ |
| 457 | 482 | s2650c->page = s2650c->ea & PAGE; \ |
| 458 | 483 | s2650c->iar = s2650c->ea & PMSK; \ |
| 459 | 484 | } |
| r5891 | r5892 | |
| 466 | 491 | { \ |
| 467 | 492 | if( cond ) \ |
| 468 | 493 | { \ |
| 469 | | s2650c->icount -= 6; \ |
| 470 | | s2650c->ea = s2650c->ras[s2650c->psu & SP]; \ |
| 471 | | s2650c->psu = (s2650c->psu & ~SP) | ((s2650c->psu - 1) & SP); \ |
| 472 | | s2650c->page = s2650c->ea & PAGE; \ |
| 473 | | s2650c->iar = s2650c->ea & PMSK; \ |
| 494 | s2650c->icount -= 6; \ |
| 495 | s2650c->ea = s2650c->ras[get_sp(s2650c)]; \ |
| 496 | set_sp(s2650c, get_sp(s2650c) - 1); \ |
| 497 | s2650c->page = s2650c->ea & PAGE; \ |
| 498 | s2650c->iar = s2650c->ea & PMSK; \ |
| 474 | 499 | } \ |
| 475 | 500 | } |
| 476 | 501 | |
| r5891 | r5892 | |
| 484 | 509 | { \ |
| 485 | 510 | if( cond ) \ |
| 486 | 511 | { \ |
| 487 | | s2650c->ea = s2650c->ras[s2650c->psu & SP]; \ |
| 488 | | s2650c->psu = (s2650c->psu & ~SP) | ((s2650c->psu - 1) & SP); \ |
| 489 | | s2650c->page = s2650c->ea & PAGE; \ |
| 490 | | s2650c->iar = s2650c->ea & PMSK; \ |
| 491 | | s2650c->psu &= ~II; \ |
| 492 | | CHECK_IRQ_LINE; \ |
| 512 | s2650c->ea = s2650c->ras[get_sp(s2650c)]; \ |
| 513 | set_sp(s2650c, get_sp(s2650c) - 1); \ |
| 514 | s2650c->page = s2650c->ea & PAGE; \ |
| 515 | s2650c->iar = s2650c->ea & PMSK; \ |
| 516 | set_psu(s2650c, s2650c->psu & ~II); \ |
| 517 | s2650c->icount -= check_irq_line(s2650c); \ |
| 493 | 518 | } \ |
| 494 | 519 | } |
| 495 | 520 | |
| r5891 | r5892 | |
| 673 | 698 | ***************************************************************/ |
| 674 | 699 | #define M_CPSU() \ |
| 675 | 700 | { \ |
| 676 | | UINT8 cpsu = ARG(s2650c); \ |
| 677 | | s2650c->psu = s2650c->psu & ~cpsu; \ |
| 678 | | CHECK_IRQ_LINE; \ |
| 701 | UINT8 cpsu = ARG(s2650c); \ |
| 702 | set_psu(s2650c, s2650c->psu & ~cpsu); \ |
| 703 | s2650c->icount -= check_irq_line(s2650c); \ |
| 679 | 704 | } |
| 680 | 705 | |
| 681 | 706 | /*************************************************************** |
| r5891 | r5892 | |
| 684 | 709 | ***************************************************************/ |
| 685 | 710 | #define M_CPSL() \ |
| 686 | 711 | { \ |
| 687 | | UINT8 cpsl = ARG(s2650c); \ |
| 712 | UINT8 cpsl = ARG(s2650c); \ |
| 688 | 713 | /* select other register set now ? */ \ |
| 689 | | if( (cpsl & RS) && (s2650c->psl & RS) ) \ |
| 714 | if( (cpsl & RS) && (s2650c->psl & RS) ) \ |
| 690 | 715 | SWAP_REGS; \ |
| 691 | | s2650c->psl = s2650c->psl & ~cpsl; \ |
| 692 | | CHECK_IRQ_LINE; \ |
| 716 | s2650c->psl = s2650c->psl & ~cpsl; \ |
| 693 | 717 | } |
| 694 | 718 | |
| 695 | 719 | /*************************************************************** |
| r5891 | r5892 | |
| 699 | 723 | ***************************************************************/ |
| 700 | 724 | #define M_PPSU() \ |
| 701 | 725 | { \ |
| 702 | | UINT8 ppsu = (ARG(s2650c) & ~PSU34) & ~SI; \ |
| 703 | | s2650c->psu = s2650c->psu | ppsu; \ |
| 726 | UINT8 ppsu = (ARG(s2650c) & ~PSU34) & ~SI; \ |
| 727 | set_psu(s2650c, s2650c->psu | ppsu); \ |
| 704 | 728 | } |
| 705 | 729 | |
| 706 | 730 | /*************************************************************** |
| r5891 | r5892 | |
| 807 | 831 | s2650c->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 808 | 832 | s2650c->io = memory_find_address_space(device, ADDRESS_SPACE_IO); |
| 809 | 833 | s2650c->psl = COM | WC; |
| 810 | | s2650c->psu = 0; |
| 834 | /* force write */ |
| 835 | s2650c->psu = 0xff; |
| 836 | set_psu(s2650c, 0); |
| 811 | 837 | } |
| 812 | 838 | |
| 813 | 839 | static CPU_EXIT( s2650 ) |
| r5891 | r5892 | |
| 827 | 853 | } |
| 828 | 854 | |
| 829 | 855 | s2650c->irq_state = state; |
| 830 | | CHECK_IRQ_LINE; |
| 831 | 856 | } |
| 832 | 857 | |
| 833 | 858 | static void s2650_set_flag(s2650_regs *s2650c, int state) |
| 834 | 859 | { |
| 835 | 860 | if (state) |
| 836 | | s2650c->psu |= FO; |
| 861 | set_psu(s2650c, s2650c->psu | FO); |
| 837 | 862 | else |
| 838 | | s2650c->psu &= ~FO; |
| 863 | set_psu(s2650c, s2650c->psu & ~FO); |
| 839 | 864 | } |
| 840 | 865 | |
| 841 | 866 | static int s2650_get_flag(s2650_regs *s2650c) |
| r5891 | r5892 | |
| 846 | 871 | static void s2650_set_sense(s2650_regs *s2650c, int state) |
| 847 | 872 | { |
| 848 | 873 | if (state) |
| 849 | | s2650c->psu |= SI; |
| 874 | set_psu(s2650c, s2650c->psu | SI); |
| 850 | 875 | else |
| 851 | | s2650c->psu &= ~SI; |
| 876 | set_psu(s2650c, s2650c->psu & ~SI); |
| 852 | 877 | } |
| 853 | 878 | |
| 854 | 879 | static int s2650_get_sense(s2650_regs *s2650c) |
| r5891 | r5892 | |
| 863 | 888 | s2650_regs *s2650c = get_safe_token(device); |
| 864 | 889 | |
| 865 | 890 | s2650c->icount = cycles; |
| 891 | |
| 892 | /* check for external irqs */ |
| 893 | s2650c->icount -= check_irq_line(s2650c); |
| 894 | |
| 866 | 895 | do |
| 867 | 896 | { |
| 868 | 897 | s2650c->ppc = s2650c->page + s2650c->iar; |
| r5891 | r5892 | |
| 1217 | 1246 | break; |
| 1218 | 1247 | case 0x92: /* LPSU */ |
| 1219 | 1248 | s2650c->icount -= 6; |
| 1220 | | s2650c->psu = (R0 & ~PSU34) & ~SI; |
| 1249 | set_psu(s2650c, (R0 & ~PSU34) & ~SI); |
| 1221 | 1250 | break; |
| 1222 | 1251 | case 0x93: /* LPSL */ |
| 1223 | 1252 | s2650c->icount -= 6; |
| r5891 | r5892 | |
| 1493 | 1522 | break; |
| 1494 | 1523 | |
| 1495 | 1524 | case CPUINFO_INT_REGISTER + S2650_PC: s2650c->page = info->i & PAGE; s2650c->iar = info->i & PMSK; break; |
| 1496 | | case CPUINFO_INT_SP: s2650c->psu = (s2650c->psu & ~SP) | (info->i & SP); break; |
| 1497 | | case CPUINFO_INT_REGISTER + S2650_PS: s2650c->psl = info->i & 0xff; s2650c->psu = info->i >> 8; break; |
| 1525 | case CPUINFO_INT_SP: set_sp(s2650c, info->i); break; |
| 1526 | case CPUINFO_INT_REGISTER + S2650_PS: s2650c->psl = info->i & 0xff; set_psu(s2650c, info->i >> 8); break; |
| 1498 | 1527 | case CPUINFO_INT_REGISTER + S2650_R0: s2650c->reg[0] = info->i; break; |
| 1499 | 1528 | case CPUINFO_INT_REGISTER + S2650_R1: s2650c->reg[1] = info->i; break; |
| 1500 | 1529 | case CPUINFO_INT_REGISTER + S2650_R2: s2650c->reg[2] = info->i; break; |
| r5891 | r5892 | |
| 1551 | 1580 | case CPUINFO_INT_PC: |
| 1552 | 1581 | case CPUINFO_INT_REGISTER + S2650_PC: info->i = s2650c->page + s2650c->iar; break; |
| 1553 | 1582 | |
| 1554 | | case CPUINFO_INT_SP: info->i = s2650c->psu & SP; break; |
| 1583 | case CPUINFO_INT_SP: info->i = get_sp(s2650c); break; |
| 1555 | 1584 | case CPUINFO_INT_REGISTER + S2650_PS: info->i = (s2650c->psu << 8) | s2650c->psl; break; |
| 1556 | 1585 | case CPUINFO_INT_REGISTER + S2650_R0: info->i = s2650c->reg[0]; break; |
| 1557 | 1586 | case CPUINFO_INT_REGISTER + S2650_R1: info->i = s2650c->reg[1]; break; |
src/emu/sound/disc_mth.c
| r5891 | r5892 | |
| 10 | 10 | ************************************************************************ |
| 11 | 11 | * |
| 12 | 12 | * DST_ADDDER - Multichannel adder |
| 13 | * DST_BITS_DECODE - Decode Bits from input node |
| 13 | 14 | * DST_CLAMP - Simple signal clamping circuit |
| 14 | 15 | * DST_COMP_ADDER - Selectable parallel component circuit |
| 15 | 16 | * DST_DAC_R1 - R1 Ladder DAC with cap filtering |
| r5891 | r5892 | |
| 26 | 27 | * DST_LOGIC_NXOR - Logic NXOR gate 2 input |
| 27 | 28 | * DST_LOGIC_DFF - Logic D-type flip/flop |
| 28 | 29 | * DST_LOGIC_JKFF - Logic JK-type flip/flop |
| 30 | * DST_LOGIC_SHIFT - Logic Shift Register |
| 29 | 31 | * DST_LOOKUP_TABLE - Return value from lookup table |
| 30 | 32 | * DST_MIXER - Final Mixer Stage |
| 31 | 33 | * DST_MULTIPLEX - 1 of x Multiplexer/switch |
| r5891 | r5892 | |
| 53 | 55 | int from; |
| 54 | 56 | int count; |
| 55 | 57 | int last_val; |
| 56 | | int v_out; |
| 57 | 58 | }; |
| 58 | 59 | |
| 59 | 60 | struct dst_dac_r1_context |
| r5891 | r5892 | |
| 123 | 124 | int clocktype; |
| 124 | 125 | }; |
| 125 | 126 | |
| 127 | struct dst_shift_context |
| 128 | { |
| 129 | double t_left; /* time unused during last sample in seconds */ |
| 130 | UINT32 shift_data; |
| 131 | UINT32 bit_mask; |
| 132 | UINT8 clock_type; |
| 133 | UINT8 reset_on_high; |
| 134 | UINT8 shift_r; |
| 135 | UINT8 last; |
| 136 | }; |
| 137 | |
| 126 | 138 | struct dst_size_context |
| 127 | 139 | { |
| 128 | 140 | int size; |
| r5891 | r5892 | |
| 292 | 304 | * |
| 293 | 305 | * DST_DAC_R1 - R1 Ladder DAC with cap smoothing |
| 294 | 306 | * |
| 295 | | * input[0] - Enable |
| 296 | | * input[1] - Binary Data Input |
| 297 | | * input[2] - Data On Voltage (3.4 for TTL) |
| 307 | * input[0] - Binary Data Input |
| 308 | * input[1] - Data On Voltage (3.4 for TTL) |
| 298 | 309 | * |
| 299 | 310 | * also passed discrete_dac_r1_ladder structure |
| 300 | 311 | * |
| 301 | 312 | * Mar 2004, D Renaud. |
| 302 | 313 | ************************************************************************/ |
| 303 | | #define DST_DAC_R1__ENABLE DISCRETE_INPUT(0) |
| 304 | | #define DST_DAC_R1__DATA DISCRETE_INPUT(1) |
| 305 | | #define DST_DAC_R1__VON DISCRETE_INPUT(2) |
| 314 | #define DST_DAC_R1__DATA DISCRETE_INPUT(0) |
| 315 | #define DST_DAC_R1__VON DISCRETE_INPUT(1) |
| 306 | 316 | |
| 307 | 317 | static DISCRETE_STEP(dst_dac_r1) |
| 308 | 318 | { |
| r5891 | r5892 | |
| 317 | 327 | data = (int)DST_DAC_R1__DATA; |
| 318 | 328 | x_time = DST_DAC_R1__DATA - data; |
| 319 | 329 | |
| 320 | | if (DST_DAC_R1__ENABLE) |
| 330 | von = DST_DAC_R1__VON; |
| 331 | for (bit=0; bit < info->ladderLength; bit++) |
| 321 | 332 | { |
| 322 | | von = DST_DAC_R1__VON; |
| 323 | | for (bit=0; bit < info->ladderLength; bit++) |
| 333 | /* Add up currents of ON circuits per Millman. */ |
| 334 | |
| 335 | /* ignore if no resistor present */ |
| 336 | if (info->r[bit] != 0) |
| 324 | 337 | { |
| 325 | | /* Add up currents of ON circuits per Millman. */ |
| 338 | i_bit = von / info->r[bit]; |
| 339 | bit_val = (data >> bit) & 0x01; |
| 326 | 340 | |
| 327 | | /* ignore if no resistor present */ |
| 328 | | if (info->r[bit] != 0) |
| 341 | if ((x_time != 0.0) && (bit_val != ((context->last_data >> bit) & 0x01))) |
| 329 | 342 | { |
| 330 | | i_bit = von / info->r[bit]; |
| 331 | | bit_val = (data >> bit) & 0x01; |
| 332 | | |
| 333 | | if ((x_time != 0.0) && (bit_val != ((context->last_data >> bit) & 0x01))) |
| 334 | | { |
| 335 | | /* there is x_time and a change in bit, |
| 336 | | * so anti-alias the current */ |
| 337 | | i_bit *= bit_val ? x_time : 1.0 - x_time; |
| 338 | | } |
| 339 | | else |
| 340 | | { |
| 341 | | /* there is no x_time or a change in bit, |
| 342 | | * so 0 the current if the bit value is 0 */ |
| 343 | | if (bit_val == 0) |
| 344 | | i_bit = 0; |
| 345 | | } |
| 346 | | i_total += i_bit; |
| 343 | /* there is x_time and a change in bit, |
| 344 | * so anti-alias the current */ |
| 345 | i_bit *= bit_val ? x_time : 1.0 - x_time; |
| 347 | 346 | } |
| 347 | else |
| 348 | { |
| 349 | /* there is no x_time or a change in bit, |
| 350 | * so 0 the current if the bit value is 0 */ |
| 351 | if (bit_val == 0) |
| 352 | i_bit = 0; |
| 353 | } |
| 354 | i_total += i_bit; |
| 348 | 355 | } |
| 356 | } |
| 349 | 357 | |
| 350 | | v = i_total * context->r_total; |
| 351 | | context->last_data = data; |
| 358 | v = i_total * context->r_total; |
| 359 | context->last_data = data; |
| 352 | 360 | |
| 353 | | /* Filter if needed, else just output voltage */ |
| 354 | | node->output[0] = info->cFilter ? node->output[0] + ((v - node->output[0]) * context->exponent) : v; |
| 355 | | } |
| 356 | | else |
| 357 | | { |
| 358 | | /* |
| 359 | | * If module is disabled we will just leave the voltage where it was. |
| 360 | | * We may want to set it to 0 in the future, but we will probably never |
| 361 | | * disable this module. |
| 362 | | */ |
| 363 | | } |
| 361 | /* Filter if needed, else just output voltage */ |
| 362 | node->output[0] = info->cFilter ? node->output[0] + ((v - node->output[0]) * context->exponent) : v; |
| 364 | 363 | } |
| 365 | 364 | |
| 366 | 365 | static DISCRETE_RESET(dst_dac_r1) |
| r5891 | r5892 | |
| 411 | 410 | if (info->cFilter) |
| 412 | 411 | { |
| 413 | 412 | /* Setup filter constants */ |
| 414 | | context->exponent = RC_CHARGE_EXP(node, context->r_total * info->cFilter); |
| 413 | context->exponent = RC_CHARGE_EXP(context->r_total * info->cFilter); |
| 415 | 414 | } |
| 416 | 415 | } |
| 417 | 416 | |
| r5891 | r5892 | |
| 509 | 508 | * |
| 510 | 509 | * DST_GAIN - This is a programmable gain module with enable function |
| 511 | 510 | * |
| 512 | | * input[0] - Enable input value |
| 513 | | * input[1] - Channel0 input value |
| 514 | | * input[2] - Gain value |
| 515 | | * input[3] - Final addition offset |
| 511 | * input[0] - Channel0 input value |
| 512 | * input[1] - Gain value |
| 513 | * input[2] - Final addition offset |
| 516 | 514 | * |
| 517 | 515 | ************************************************************************/ |
| 518 | | #define DST_GAIN__ENABLE DISCRETE_INPUT(0) |
| 519 | | #define DST_GAIN__IN DISCRETE_INPUT(1) |
| 520 | | #define DST_GAIN__GAIN DISCRETE_INPUT(2) |
| 521 | | #define DST_GAIN__OFFSET DISCRETE_INPUT(3) |
| 516 | #define DST_GAIN__IN DISCRETE_INPUT(0) |
| 517 | #define DST_GAIN__GAIN DISCRETE_INPUT(1) |
| 518 | #define DST_GAIN__OFFSET DISCRETE_INPUT(2) |
| 522 | 519 | |
| 523 | 520 | static DISCRETE_STEP(dst_gain) |
| 524 | 521 | { |
| 525 | | if(DST_GAIN__ENABLE) |
| 526 | | { |
| 527 | | node->output[0] = DST_GAIN__IN * DST_GAIN__GAIN; |
| 528 | | node->output[0] += DST_GAIN__OFFSET; |
| 529 | | } |
| 530 | | else |
| 531 | | { |
| 532 | | node->output[0] = 0; |
| 533 | | } |
| 522 | node->output[0] = DST_GAIN__IN * DST_GAIN__GAIN + DST_GAIN__OFFSET; |
| 534 | 523 | } |
| 535 | 524 | |
| 536 | 525 | |
| r5891 | r5892 | |
| 660 | 649 | * input[1] - input[0] value |
| 661 | 650 | * |
| 662 | 651 | ************************************************************************/ |
| 663 | | #define DST_LOGIC_INV__ENABLE DISCRETE_INPUT(0) |
| 664 | | #define DST_LOGIC_INV__IN DISCRETE_INPUT(1) |
| 652 | #define DST_LOGIC_INV__IN DISCRETE_INPUT(0) |
| 665 | 653 | |
| 666 | 654 | static DISCRETE_STEP(dst_logic_inv) |
| 667 | 655 | { |
| 668 | | if(DST_LOGIC_INV__ENABLE) |
| 669 | | { |
| 670 | | node->output[0] = DST_LOGIC_INV__IN ? 0.0 : 1.0; |
| 671 | | } |
| 672 | | else |
| 673 | | { |
| 674 | | node->output[0] = 0.0; |
| 675 | | } |
| 656 | node->output[0] = DST_LOGIC_INV__IN ? 0.0 : 1.0; |
| 676 | 657 | } |
| 677 | 658 | |
| 678 | 659 | /************************************************************************ |
| r5891 | r5892 | |
| 699 | 680 | { |
| 700 | 681 | context->last_val = v; |
| 701 | 682 | for (i = 0; i < context->count; i++ ) |
| 702 | | node->output[i] = ((v >> (i+context->from)) & 1) * context->v_out; |
| 683 | node->output[i] = ((v >> (i+context->from)) & 1) * DST_BITS_DECODE__VOUT; |
| 703 | 684 | } |
| 704 | 685 | } |
| 705 | 686 | |
| r5891 | r5892 | |
| 709 | 690 | |
| 710 | 691 | context->from = DST_BITS_DECODE__FROM; |
| 711 | 692 | context->count = DST_BITS_DECODE__TO - context->from + 1; |
| 712 | | context->v_out = DST_BITS_DECODE__VOUT; |
| 713 | 693 | |
| 714 | 694 | DISCRETE_STEP_CALL(dst_bits_decode); |
| 715 | 695 | } |
| r5891 | r5892 | |
| 717 | 697 | * |
| 718 | 698 | * DST_LOGIC_AND - Logic AND gate implementation |
| 719 | 699 | * |
| 720 | | * input[0] - Enable |
| 721 | | * input[1] - input[0] value |
| 722 | | * input[2] - input[1] value |
| 723 | | * input[3] - input[2] value |
| 724 | | * input[4] - input[3] value |
| 700 | * input[0] - input[0] value |
| 701 | * input[1] - input[1] value |
| 702 | * input[2] - input[2] value |
| 703 | * input[3] - input[3] value |
| 725 | 704 | * |
| 726 | 705 | ************************************************************************/ |
| 727 | | #define DST_LOGIC_AND__ENABLE DISCRETE_INPUT(0) |
| 728 | | #define DST_LOGIC_AND__IN0 DISCRETE_INPUT(1) |
| 729 | | #define DST_LOGIC_AND__IN1 DISCRETE_INPUT(2) |
| 730 | | #define DST_LOGIC_AND__IN2 DISCRETE_INPUT(3) |
| 731 | | #define DST_LOGIC_AND__IN3 DISCRETE_INPUT(4) |
| 706 | #define DST_LOGIC_AND__IN0 DISCRETE_INPUT(0) |
| 707 | #define DST_LOGIC_AND__IN1 DISCRETE_INPUT(1) |
| 708 | #define DST_LOGIC_AND__IN2 DISCRETE_INPUT(2) |
| 709 | #define DST_LOGIC_AND__IN3 DISCRETE_INPUT(3) |
| 732 | 710 | |
| 733 | 711 | static DISCRETE_STEP(dst_logic_and) |
| 734 | 712 | { |
| 735 | | if(DST_LOGIC_AND__ENABLE) |
| 736 | | { |
| 737 | | node->output[0] = (DST_LOGIC_AND__IN0 && DST_LOGIC_AND__IN1 && DST_LOGIC_AND__IN2 && DST_LOGIC_AND__IN3)? 1.0 : 0.0; |
| 738 | | } |
| 739 | | else |
| 740 | | { |
| 741 | | node->output[0] = 0.0; |
| 742 | | } |
| 713 | node->output[0] = (DST_LOGIC_AND__IN0 && DST_LOGIC_AND__IN1 && DST_LOGIC_AND__IN2 && DST_LOGIC_AND__IN3)? 1.0 : 0.0; |
| 743 | 714 | } |
| 744 | 715 | |
| 745 | 716 | /************************************************************************ |
| 746 | 717 | * |
| 747 | 718 | * DST_LOGIC_NAND - Logic NAND gate implementation |
| 748 | 719 | * |
| 749 | | * input[0] - Enable |
| 750 | | * input[1] - input[0] value |
| 751 | | * input[2] - input[1] value |
| 752 | | * input[3] - input[2] value |
| 753 | | * input[4] - input[3] value |
| 720 | * input[0] - input[0] value |
| 721 | * input[1] - input[1] value |
| 722 | * input[2] - input[2] value |
| 723 | * input[3] - input[3] value |
| 754 | 724 | * |
| 755 | 725 | ************************************************************************/ |
| 756 | | #define DST_LOGIC_NAND__ENABLE DISCRETE_INPUT(0) |
| 757 | | #define DST_LOGIC_NAND__IN0 DISCRETE_INPUT(1) |
| 758 | | #define DST_LOGIC_NAND__IN1 DISCRETE_INPUT(2) |
| 759 | | #define DST_LOGIC_NAND__IN2 DISCRETE_INPUT(3) |
| 760 | | #define DST_LOGIC_NAND__IN3 DISCRETE_INPUT(4) |
| 726 | #define DST_LOGIC_NAND__IN0 DISCRETE_INPUT(0) |
| 727 | #define DST_LOGIC_NAND__IN1 DISCRETE_INPUT(1) |
| 728 | #define DST_LOGIC_NAND__IN2 DISCRETE_INPUT(2) |
| 729 | #define DST_LOGIC_NAND__IN3 DISCRETE_INPUT(3) |
| 761 | 730 | |
| 762 | 731 | static DISCRETE_STEP(dst_logic_nand) |
| 763 | 732 | { |
| 764 | | if(DST_LOGIC_NAND__ENABLE) |
| 765 | | { |
| 766 | | node->output[0]= (DST_LOGIC_NAND__IN0 && DST_LOGIC_NAND__IN1 && DST_LOGIC_NAND__IN2 && DST_LOGIC_NAND__IN3)? 0.0 : 1.0; |
| 767 | | } |
| 768 | | else |
| 769 | | { |
| 770 | | node->output[0] = 0.0; |
| 771 | | } |
| 733 | node->output[0]= (DST_LOGIC_NAND__IN0 && DST_LOGIC_NAND__IN1 && DST_LOGIC_NAND__IN2 && DST_LOGIC_NAND__IN3)? 0.0 : 1.0; |
| 772 | 734 | } |
| 773 | 735 | |
| 774 | 736 | /************************************************************************ |
| 775 | 737 | * |
| 776 | 738 | * DST_LOGIC_OR - Logic OR gate implementation |
| 777 | 739 | * |
| 778 | | * input[0] - Enable |
| 779 | | * input[1] - input[0] value |
| 780 | | * input[2] - input[1] value |
| 781 | | * input[3] - input[2] value |
| 782 | | * input[4] - input[3] value |
| 740 | * input[0] - input[0] value |
| 741 | * input[1] - input[1] value |
| 742 | * input[2] - input[2] value |
| 743 | * input[3] - input[3] value |
| 783 | 744 | * |
| 784 | 745 | ************************************************************************/ |
| 785 | | #define DST_LOGIC_OR__ENABLE DISCRETE_INPUT(0) |
| 786 | | #define DST_LOGIC_OR__IN0 DISCRETE_INPUT(1) |
| 787 | | #define DST_LOGIC_OR__IN1 DISCRETE_INPUT(2) |
| 788 | | #define DST_LOGIC_OR__IN2 DISCRETE_INPUT(3) |
| 789 | | #define DST_LOGIC_OR__IN3 DISCRETE_INPUT(4) |
| 746 | #define DST_LOGIC_OR__IN0 DISCRETE_INPUT(0) |
| 747 | #define DST_LOGIC_OR__IN1 DISCRETE_INPUT(1) |
| 748 | #define DST_LOGIC_OR__IN2 DISCRETE_INPUT(2) |
| 749 | #define DST_LOGIC_OR__IN3 DISCRETE_INPUT(3) |
| 790 | 750 | |
| 791 | 751 | static DISCRETE_STEP(dst_logic_or) |
| 792 | 752 | { |
| 793 | | if(DST_LOGIC_OR__ENABLE) |
| 794 | | { |
| 795 | | node->output[0] = (DST_LOGIC_OR__IN0 || DST_LOGIC_OR__IN1 || DST_LOGIC_OR__IN2 || DST_LOGIC_OR__IN3) ? 1.0 : 0.0; |
| 796 | | } |
| 797 | | else |
| 798 | | { |
| 799 | | node->output[0] = 0.0; |
| 800 | | } |
| 753 | node->output[0] = (DST_LOGIC_OR__IN0 || DST_LOGIC_OR__IN1 || DST_LOGIC_OR__IN2 || DST_LOGIC_OR__IN3) ? 1.0 : 0.0; |
| 801 | 754 | } |
| 802 | 755 | |
| 803 | 756 | /************************************************************************ |
| 804 | 757 | * |
| 805 | 758 | * DST_LOGIC_NOR - Logic NOR gate implementation |
| 806 | 759 | * |
| 807 | | * input[0] - Enable |
| 808 | | * input[1] - input[0] value |
| 809 | | * input[2] - input[1] value |
| 810 | | * input[3] - input[2] value |
| 811 | | * input[4] - input[3] value |
| 760 | * input[0] - input[0] value |
| 761 | * input[1] - input[1] value |
| 762 | * input[2] - input[2] value |
| 763 | * input[3] - input[3] value |
| 812 | 764 | * |
| 813 | 765 | ************************************************************************/ |
| 814 | | #define DST_LOGIC_NOR__ENABLE DISCRETE_INPUT(0) |
| 815 | | #define DST_LOGIC_NOR__IN0 DISCRETE_INPUT(1) |
| 816 | | #define DST_LOGIC_NOR__IN1 DISCRETE_INPUT(2) |
| 817 | | #define DST_LOGIC_NOR__IN2 DISCRETE_INPUT(3) |
| 818 | | #define DST_LOGIC_NOR__IN3 DISCRETE_INPUT(4) |
| 766 | #define DST_LOGIC_NOR__IN0 DISCRETE_INPUT(0) |
| 767 | #define DST_LOGIC_NOR__IN1 DISCRETE_INPUT(1) |
| 768 | #define DST_LOGIC_NOR__IN2 DISCRETE_INPUT(2) |
| 769 | #define DST_LOGIC_NOR__IN3 DISCRETE_INPUT(3) |
| 819 | 770 | |
| 820 | 771 | static DISCRETE_STEP(dst_logic_nor) |
| 821 | 772 | { |
| 822 | | if(DST_LOGIC_NOR__ENABLE) |
| 823 | | { |
| 824 | | node->output[0] = (DST_LOGIC_NOR__IN0 || DST_LOGIC_NOR__IN1 || DST_LOGIC_NOR__IN2 || DST_LOGIC_NOR__IN3) ? 0.0 : 1.0; |
| 825 | | } |
| 826 | | else |
| 827 | | { |
| 828 | | node->output[0] = 0.0; |
| 829 | | } |
| 773 | node->output[0] = (DST_LOGIC_NOR__IN0 || DST_LOGIC_NOR__IN1 || DST_LOGIC_NOR__IN2 || DST_LOGIC_NOR__IN3) ? 0.0 : 1.0; |
| 830 | 774 | } |
| 831 | 775 | |
| 832 | 776 | /************************************************************************ |
| 833 | 777 | * |
| 834 | 778 | * DST_LOGIC_XOR - Logic XOR gate implementation |
| 835 | 779 | * |
| 836 | | * input[0] - Enable |
| 837 | | * input[1] - input[0] value |
| 838 | | * input[2] - input[1] value |
| 780 | * input[0] - input[0] value |
| 781 | * input[1] - input[1] value |
| 839 | 782 | * |
| 840 | 783 | ************************************************************************/ |
| 841 | | #define DST_LOGIC_XOR__ENABLE DISCRETE_INPUT(0) |
| 842 | | #define DST_LOGIC_XOR__IN0 DISCRETE_INPUT(1) |
| 843 | | #define DST_LOGIC_XOR__IN1 DISCRETE_INPUT(2) |
| 784 | #define DST_LOGIC_XOR__IN0 DISCRETE_INPUT(0) |
| 785 | #define DST_LOGIC_XOR__IN1 DISCRETE_INPUT(1) |
| 844 | 786 | |
| 845 | 787 | static DISCRETE_STEP(dst_logic_xor) |
| 846 | 788 | { |
| 847 | | if(DST_LOGIC_XOR__ENABLE) |
| 848 | | { |
| 849 | | node->output[0] = ((DST_LOGIC_XOR__IN0 && !DST_LOGIC_XOR__IN1) || (!DST_LOGIC_XOR__IN0 && DST_LOGIC_XOR__IN1)) ? 1.0 : 0.0; |
| 850 | | } |
| 851 | | else |
| 852 | | { |
| 853 | | node->output[0] = 0.0; |
| 854 | | } |
| 789 | node->output[0] = ((DST_LOGIC_XOR__IN0 && !DST_LOGIC_XOR__IN1) || (!DST_LOGIC_XOR__IN0 && DST_LOGIC_XOR__IN1)) ? 1.0 : 0.0; |
| 855 | 790 | } |
| 856 | 791 | |
| 857 | 792 | /************************************************************************ |
| 858 | 793 | * |
| 859 | 794 | * DST_LOGIC_NXOR - Logic NXOR gate implementation |
| 860 | 795 | * |
| 861 | | * input[0] - Enable |
| 862 | | * input[1] - input[0] value |
| 863 | | * input[2] - input[1] value |
| 796 | * input[0] - input[0] value |
| 797 | * input[1] - input[1] value |
| 864 | 798 | * |
| 865 | 799 | ************************************************************************/ |
| 866 | | #define DST_LOGIC_XNOR__ENABLE DISCRETE_INPUT(0) |
| 867 | | #define DST_LOGIC_XNOR__IN0 DISCRETE_INPUT(1) |
| 868 | | #define DST_LOGIC_XNOR__IN1 DISCRETE_INPUT(2) |
| 800 | #define DST_LOGIC_XNOR__IN0 DISCRETE_INPUT(0) |
| 801 | #define DST_LOGIC_XNOR__IN1 DISCRETE_INPUT(1) |
| 869 | 802 | |
| 870 | 803 | static DISCRETE_STEP(dst_logic_nxor) |
| 871 | 804 | { |
| 872 | | if(DST_LOGIC_XNOR__ENABLE) |
| 873 | | { |
| 874 | | node->output[0] = ((DST_LOGIC_XNOR__IN0 && !DST_LOGIC_XNOR__IN1) || (!DST_LOGIC_XNOR__IN0 && DST_LOGIC_XNOR__IN1)) ? 0.0 : 1.0; |
| 875 | | } |
| 876 | | else |
| 877 | | { |
| 878 | | node->output[0] = 0.0; |
| 879 | | } |
| 805 | node->output[0] = ((DST_LOGIC_XNOR__IN0 && !DST_LOGIC_XNOR__IN1) || (!DST_LOGIC_XNOR__IN0 && DST_LOGIC_XNOR__IN1)) ? 0.0 : 1.0; |
| 880 | 806 | } |
| 881 | 807 | |
| 882 | 808 | |
| r5891 | r5892 | |
| 884 | 810 | * |
| 885 | 811 | * DST_LOGIC_DFF - Standard D-type flip-flop implementation |
| 886 | 812 | * |
| 887 | | * input[0] - enable |
| 888 | | * input[1] - /Reset |
| 889 | | * input[2] - /Set |
| 890 | | * input[3] - clock |
| 891 | | * input[4] - data |
| 813 | * input[0] - /Reset |
| 814 | * input[1] - /Set |
| 815 | * input[2] - clock |
| 816 | * input[3] - data |
| 892 | 817 | * |
| 893 | 818 | ************************************************************************/ |
| 894 | | #define DST_LOGIC_DFF__ENABLE DISCRETE_INPUT(0) |
| 895 | | #define DST_LOGIC_DFF__RESET !DISCRETE_INPUT(1) |
| 896 | | #define DST_LOGIC_DFF__SET !DISCRETE_INPUT(2) |
| 897 | | #define DST_LOGIC_DFF__CLOCK DISCRETE_INPUT(3) |
| 898 | | #define DST_LOGIC_DFF__DATA DISCRETE_INPUT(4) |
| 819 | #define DST_LOGIC_DFF__RESET !DISCRETE_INPUT(0) |
| 820 | #define DST_LOGIC_DFF__SET !DISCRETE_INPUT(1) |
| 821 | #define DST_LOGIC_DFF__CLOCK DISCRETE_INPUT(2) |
| 822 | #define DST_LOGIC_DFF__DATA DISCRETE_INPUT(3) |
| 899 | 823 | |
| 900 | 824 | static DISCRETE_STEP(dst_logic_dff) |
| 901 | 825 | { |
| r5891 | r5892 | |
| 903 | 827 | |
| 904 | 828 | int clk = (int)DST_LOGIC_DFF__CLOCK; |
| 905 | 829 | |
| 906 | | if (DST_LOGIC_DFF__ENABLE) |
| 907 | | { |
| 908 | | if (DST_LOGIC_DFF__RESET) |
| 909 | | node->output[0] = 0; |
| 910 | | else if (DST_LOGIC_DFF__SET) |
| 911 | | node->output[0] = 1; |
| 912 | | else if (!context->last_clk && clk) /* low to high */ |
| 913 | | node->output[0] = DST_LOGIC_DFF__DATA; |
| 914 | | } |
| 915 | | else |
| 916 | | { |
| 830 | if (DST_LOGIC_DFF__RESET) |
| 917 | 831 | node->output[0] = 0; |
| 918 | | } |
| 832 | else if (DST_LOGIC_DFF__SET) |
| 833 | node->output[0] = 1; |
| 834 | else if (!context->last_clk && clk) /* low to high */ |
| 835 | node->output[0] = DST_LOGIC_DFF__DATA; |
| 919 | 836 | context->last_clk = clk; |
| 920 | 837 | } |
| 921 | 838 | |
| r5891 | r5892 | |
| 932 | 849 | * |
| 933 | 850 | * DST_LOGIC_JKFF - Standard JK-type flip-flop implementation |
| 934 | 851 | * |
| 935 | | * input[0] - enable |
| 936 | | * input[1] - /Reset |
| 937 | | * input[2] - /Set |
| 938 | | * input[3] - clock |
| 939 | | * input[4] - J |
| 940 | | * input[5] - K |
| 852 | * input[0] - /Reset |
| 853 | * input[1] - /Set |
| 854 | * input[2] - clock |
| 855 | * input[3] - J |
| 856 | * input[4] - K |
| 941 | 857 | * |
| 942 | 858 | ************************************************************************/ |
| 943 | | #define DST_LOGIC_JKFF__ENABLE DISCRETE_INPUT(0) |
| 944 | | #define DST_LOGIC_JKFF__RESET !DISCRETE_INPUT(1) |
| 945 | | #define DST_LOGIC_JKFF__SET !DISCRETE_INPUT(2) |
| 946 | | #define DST_LOGIC_JKFF__CLOCK DISCRETE_INPUT(3) |
| 947 | | #define DST_LOGIC_JKFF__J DISCRETE_INPUT(4) |
| 948 | | #define DST_LOGIC_JKFF__K DISCRETE_INPUT(5) |
| 859 | #define DST_LOGIC_JKFF__RESET !DISCRETE_INPUT(0) |
| 860 | #define DST_LOGIC_JKFF__SET !DISCRETE_INPUT(1) |
| 861 | #define DST_LOGIC_JKFF__CLOCK DISCRETE_INPUT(2) |
| 862 | #define DST_LOGIC_JKFF__J DISCRETE_INPUT(3) |
| 863 | #define DST_LOGIC_JKFF__K DISCRETE_INPUT(4) |
| 949 | 864 | |
| 950 | 865 | static DISCRETE_STEP(dst_logic_jkff) |
| 951 | 866 | { |
| r5891 | r5892 | |
| 955 | 870 | int j = (int)DST_LOGIC_JKFF__J; |
| 956 | 871 | int k = (int)DST_LOGIC_JKFF__K; |
| 957 | 872 | |
| 958 | | if (DST_LOGIC_JKFF__ENABLE) |
| 873 | if (DST_LOGIC_JKFF__RESET) |
| 874 | node->output[0] = 0; |
| 875 | else if (DST_LOGIC_JKFF__SET) |
| 876 | node->output[0] = 1; |
| 877 | else if (context->last_clk && !clk) /* high to low */ |
| 959 | 878 | { |
| 960 | | if (DST_LOGIC_JKFF__RESET) |
| 961 | | node->output[0] = 0; |
| 962 | | else if (DST_LOGIC_JKFF__SET) |
| 963 | | node->output[0] = 1; |
| 964 | | else if (context->last_clk && !clk) /* high to low */ |
| 879 | if (!j) |
| 965 | 880 | { |
| 966 | | if (!j) |
| 967 | | { |
| 968 | | /* J=0, K=0 - Hold */ |
| 969 | | if (k) |
| 970 | | /* J=0, K=1 - Reset */ |
| 971 | | node->output[0] = 0; |
| 972 | | } |
| 881 | /* J=0, K=0 - Hold */ |
| 882 | if (k) |
| 883 | /* J=0, K=1 - Reset */ |
| 884 | node->output[0] = 0; |
| 885 | } |
| 886 | else |
| 887 | { |
| 888 | if (!k) |
| 889 | /* J=1, K=0 - Set */ |
| 890 | node->output[0] = 1; |
| 973 | 891 | else |
| 974 | | { |
| 975 | | if (!k) |
| 976 | | /* J=1, K=0 - Set */ |
| 977 | | node->output[0] = 1; |
| 978 | | else |
| 979 | | /* J=1, K=1 - Toggle */ |
| 980 | | node->output[0] = !(int)node->output[0]; |
| 981 | | } |
| 892 | /* J=1, K=1 - Toggle */ |
| 893 | node->output[0] = !(int)node->output[0]; |
| 982 | 894 | } |
| 983 | 895 | } |
| 896 | context->last_clk = clk; |
| 897 | } |
| 898 | |
| 899 | |
| 900 | /************************************************************************ |
| 901 | * |
| 902 | * DST_LOGIC_SHIFT - Shift Register implementation |
| 903 | * |
| 904 | ************************************************************************/ |
| 905 | #define DST_LOGIC_SHIFT__IN DISCRETE_INPUT(0) |
| 906 | #define DST_LOGIC_SHIFT__RESET DISCRETE_INPUT(1) |
| 907 | #define DST_LOGIC_SHIFT__CLK DISCRETE_INPUT(2) |
| 908 | #define DST_LOGIC_SHIFT__SIZE DISCRETE_INPUT(3) |
| 909 | #define DST_LOGIC_SHIFT__OPTIONS DISCRETE_INPUT(4) |
| 910 | |
| 911 | static DISCRETE_STEP(dst_logic_shift) |
| 912 | { |
| 913 | struct dst_shift_context *context = (struct dst_shift_context *)node->context; |
| 914 | |
| 915 | double cycles; |
| 916 | double ds_clock; |
| 917 | int clock = 0, inc = 0; |
| 918 | |
| 919 | int input_bit = (DST_LOGIC_SHIFT__IN != 0) ? 1 : 0; |
| 920 | ds_clock = DST_LOGIC_SHIFT__CLK; |
| 921 | if (context->clock_type == DISC_CLK_IS_FREQ) |
| 922 | { |
| 923 | /* We need to keep clocking the internal clock even if in reset. */ |
| 924 | cycles = (context->t_left + node->info->sample_time) * ds_clock; |
| 925 | inc = (int)cycles; |
| 926 | context->t_left = (cycles - inc) / ds_clock; |
| 927 | } |
| 984 | 928 | else |
| 985 | 929 | { |
| 930 | clock = (int)ds_clock; |
| 931 | } |
| 932 | |
| 933 | /* If reset enabled then set output to the reset value. No x_time in reset. */ |
| 934 | if(((DST_LOGIC_SHIFT__RESET == 0) ? 0 : 1) == context->reset_on_high) |
| 935 | { |
| 936 | context->shift_data = 0; |
| 986 | 937 | node->output[0] = 0; |
| 938 | return; |
| 987 | 939 | } |
| 988 | | context->last_clk = clk; |
| 940 | |
| 941 | /* increment clock */ |
| 942 | switch (context->clock_type) |
| 943 | { |
| 944 | case DISC_CLK_ON_F_EDGE: |
| 945 | case DISC_CLK_ON_R_EDGE: |
| 946 | /* See if the clock has toggled to the proper edge */ |
| 947 | clock = (clock != 0); |
| 948 | if (context->last != clock) |
| 949 | { |
| 950 | context->last = clock; |
| 951 | if (context->clock_type == clock) |
| 952 | { |
| 953 | /* Toggled */ |
| 954 | inc = 1; |
| 955 | } |
| 956 | } |
| 957 | break; |
| 958 | |
| 959 | case DISC_CLK_BY_COUNT: |
| 960 | /* Clock number of times specified. */ |
| 961 | inc = clock; |
| 962 | break; |
| 963 | } |
| 964 | |
| 965 | if (inc > 0) |
| 966 | { |
| 967 | if (context->shift_r) |
| 968 | { |
| 969 | context->shift_data >>= 1; |
| 970 | context->shift_data |= input_bit << ((int)DST_LOGIC_SHIFT__SIZE - 1); |
| 971 | inc--; |
| 972 | context->shift_data >>= inc; |
| 973 | } |
| 974 | else |
| 975 | { |
| 976 | context->shift_data <<= 1; |
| 977 | context->shift_data |= input_bit; |
| 978 | inc--; |
| 979 | context->shift_data <<= inc; |
| 980 | } |
| 981 | context->shift_data &= context->bit_mask; |
| 982 | } |
| 983 | |
| 984 | node->output[0] = context->shift_data; |
| 989 | 985 | } |
| 990 | 986 | |
| 987 | static DISCRETE_RESET(dst_logic_shift) |
| 988 | { |
| 989 | struct dst_shift_context *context = (struct dst_shift_context *)node->context; |
| 991 | 990 | |
| 991 | context->bit_mask = (1 << (int)DST_LOGIC_SHIFT__SIZE) - 1; |
| 992 | context->clock_type = (int)DST_LOGIC_SHIFT__OPTIONS & DISC_CLK_MASK; |
| 993 | context->reset_on_high = ((int)DST_LOGIC_SHIFT__OPTIONS & DISC_LOGIC_SHIFT__RESET_H) ? 1 : 0; |
| 994 | context->shift_r = ((int)DST_LOGIC_SHIFT__OPTIONS & DISC_LOGIC_SHIFT__RIGHT) ? 1 : 0; |
| 995 | |
| 996 | context->t_left = 0; |
| 997 | context->last = 0; |
| 998 | context->shift_data = 0; |
| 999 | node->output[0] = 0; |
| 1000 | } |
| 1001 | |
| 992 | 1002 | /************************************************************************ |
| 993 | 1003 | * |
| 994 | 1004 | * DST_LOOKUP_TABLE - Return value from lookup table |
| 995 | 1005 | * |
| 996 | | * input[0] - Enable input value |
| 997 | | * input[1] - Input 1 |
| 998 | | * input[2] - Table size |
| 1006 | * input[0] - Input 1 |
| 1007 | * input[1] - Table size |
| 999 | 1008 | * |
| 1000 | 1009 | * Also passed address of the lookup table |
| 1001 | 1010 | * |
| 1002 | 1011 | * Feb 2007, D Renaud. |
| 1003 | 1012 | ************************************************************************/ |
| 1004 | | #define DST_LOOKUP_TABLE__ENABLE DISCRETE_INPUT(0) |
| 1005 | | #define DST_LOOKUP_TABLE__IN DISCRETE_INPUT(1) |
| 1006 | | #define DST_LOOKUP_TABLE__SIZE DISCRETE_INPUT(2) |
| 1013 | #define DST_LOOKUP_TABLE__IN DISCRETE_INPUT(0) |
| 1014 | #define DST_LOOKUP_TABLE__SIZE DISCRETE_INPUT(1) |
| 1007 | 1015 | |
| 1008 | 1016 | static DISCRETE_STEP(dst_lookup_table) |
| 1009 | 1017 | { |
| r5891 | r5892 | |
| 1011 | 1019 | |
| 1012 | 1020 | int addr = DST_LOOKUP_TABLE__IN; |
| 1013 | 1021 | |
| 1014 | | if (!DST_LOOKUP_TABLE__ENABLE || addr < 0 || addr >= DST_LOOKUP_TABLE__SIZE) |
| 1022 | if (addr < 0 || addr >= DST_LOOKUP_TABLE__SIZE) |
| 1015 | 1023 | node->output[0] = 0; |
| 1016 | 1024 | else |
| 1017 | 1025 | node->output[0] = table[addr]; |
| r5891 | r5892 | |
| 1138 | 1146 | /* Re-calculate exponent if resistor is a node and has changed value */ |
| 1139 | 1147 | if (*context->r_node[bit] != context->r_last[bit]) |
| 1140 | 1148 | { |
| 1141 | | context->exponent_rc[bit] = RC_CHARGE_EXP(node, rTemp2 * info->c[bit]); |
| 1149 | context->exponent_rc[bit] = RC_CHARGE_EXP(rTemp2 * info->c[bit]); |
| 1142 | 1150 | context->r_last[bit] = *context->r_node[bit]; |
| 1143 | 1151 | } |
| 1144 | 1152 | } |
| r5891 | r5892 | |
| 1194 | 1202 | if (r_node_bit_flag != 0) |
| 1195 | 1203 | { |
| 1196 | 1204 | /* Re-calculate exponent if resistor nodes are used */ |
| 1197 | | context->exponent_c_f = RC_CHARGE_EXP(node, r_total * info->cF); |
| 1205 | context->exponent_c_f = RC_CHARGE_EXP(r_total * info->cF); |
| 1198 | 1206 | } |
| 1199 | 1207 | context->v_cap_f += (v - v_ref - context->v_cap_f) * context->exponent_c_f; |
| 1200 | 1208 | v = context->v_cap_f; |
| r5891 | r5892 | |
| 1288 | 1296 | break; |
| 1289 | 1297 | } |
| 1290 | 1298 | /* Setup filter constants */ |
| 1291 | | context->exponent_rc[bit] = RC_CHARGE_EXP(node, rTemp * info->c[bit]); |
| 1299 | context->exponent_rc[bit] = RC_CHARGE_EXP(rTemp * info->c[bit]); |
| 1292 | 1300 | } |
| 1293 | 1301 | } |
| 1294 | 1302 | |
| r5891 | r5892 | |
| 1303 | 1311 | if (info->cF != 0) |
| 1304 | 1312 | { |
| 1305 | 1313 | /* Setup filter constants */ |
| 1306 | | context->exponent_c_f = RC_CHARGE_EXP(node, ((info->type == DISC_MIXER_IS_OP_AMP) ? info->rF : (1.0 / context->r_total)) * info->cF); |
| 1314 | context->exponent_c_f = RC_CHARGE_EXP(((info->type == DISC_MIXER_IS_OP_AMP) ? info->rF : (1.0 / context->r_total)) * info->cF); |
| 1307 | 1315 | } |
| 1308 | 1316 | |
| 1309 | 1317 | context->v_cap_amp = 0; |
| r5891 | r5892 | |
| 1313 | 1321 | /* Setup filter constants */ |
| 1314 | 1322 | /* We will use 100k ohms as an average final stage impedance. */ |
| 1315 | 1323 | /* Your amp/speaker system will have more effect on incorrect filtering then any value used here. */ |
| 1316 | | context->exponent_c_amp = RC_CHARGE_EXP(node, RES_K(100) * info->cAmp); |
| 1324 | context->exponent_c_amp = RC_CHARGE_EXP(RES_K(100) * info->cAmp); |
| 1317 | 1325 | } |
| 1318 | 1326 | |
| 1319 | 1327 | if (context->type == DISC_MIXER_IS_OP_AMP_WITH_RI) context->gain = info->rF / info->rI; |
| r5891 | r5892 | |
| 1326 | 1334 | * |
| 1327 | 1335 | * DST_MULTIPLEX - 1 of x multiplexer/switch |
| 1328 | 1336 | * |
| 1329 | | * input[0] - Enable input value |
| 1330 | | * input[1] - switch position |
| 1331 | | * input[2] - input[0] |
| 1332 | | * input[3] - input[1] |
| 1337 | * input[0] - switch position |
| 1338 | * input[1] - input[0] |
| 1339 | * input[2] - input[1] |
| 1333 | 1340 | * ..... |
| 1334 | 1341 | * |
| 1335 | 1342 | * Dec 2004, D Renaud. |
| 1336 | 1343 | ************************************************************************/ |
| 1337 | | #define DST_MULTIPLEX__ENABLE DISCRETE_INPUT(0) |
| 1338 | | #define DST_MULTIPLEX__ADDR DISCRETE_INPUT(1) |
| 1339 | | #define DST_MULTIPLEX__INP(addr) DISCRETE_INPUT(2 + addr) |
| 1344 | #define DST_MULTIPLEX__ADDR DISCRETE_INPUT(0) |
| 1345 | #define DST_MULTIPLEX__INP(addr) DISCRETE_INPUT(1 + addr) |
| 1340 | 1346 | |
| 1341 | 1347 | static DISCRETE_STEP(dst_multiplex) |
| 1342 | 1348 | { |
| r5891 | r5892 | |
| 1344 | 1350 | |
| 1345 | 1351 | int addr; |
| 1346 | 1352 | |
| 1347 | | if(DST_MULTIPLEX__ENABLE) |
| 1353 | addr = DST_MULTIPLEX__ADDR; /* FP to INT */ |
| 1354 | if ((addr >= 0) && (addr < context->size)) |
| 1348 | 1355 | { |
| 1349 | | addr = DST_MULTIPLEX__ADDR; /* FP to INT */ |
| 1350 | | if ((addr >= 0) && (addr < context->size)) |
| 1351 | | { |
| 1352 | | node->output[0] = DST_MULTIPLEX__INP(addr); |
| 1353 | | } |
| 1354 | | else |
| 1355 | | { |
| 1356 | | /* Bad address. We will leave the output alone. */ |
| 1357 | | discrete_log(node->info, "NODE_%02d - Address = %d. Out of bounds\n", NODE_BLOCKINDEX(node), addr); |
| 1358 | | } |
| 1356 | node->output[0] = DST_MULTIPLEX__INP(addr); |
| 1359 | 1357 | } |
| 1360 | 1358 | else |
| 1361 | 1359 | { |
| 1362 | | node->output[0] = 0; |
| 1360 | /* Bad address. We will leave the output alone. */ |
| 1361 | discrete_log(node->info, "NODE_%02d - Address = %d. Out of bounds\n", NODE_BLOCKINDEX(node), addr); |
| 1363 | 1362 | } |
| 1364 | 1363 | } |
| 1365 | 1364 | |
| r5891 | r5892 | |
| 1524 | 1523 | * |
| 1525 | 1524 | * DST_SAMPHOLD - Sample & Hold Implementation |
| 1526 | 1525 | * |
| 1527 | | * input[0] - Enable |
| 1528 | | * input[1] - input[0] value |
| 1529 | | * input[2] - clock node |
| 1530 | | * input[3] - clock type |
| 1526 | * input[0] - input[0] value |
| 1527 | * input[1] - clock node |
| 1528 | * input[2] - clock type |
| 1531 | 1529 | * |
| 1532 | 1530 | ************************************************************************/ |
| 1533 | | #define DST_SAMPHOLD__ENABLE DISCRETE_INPUT(0) |
| 1534 | | #define DST_SAMPHOLD__IN0 DISCRETE_INPUT(1) |
| 1535 | | #define DST_SAMPHOLD__CLOCK DISCRETE_INPUT(2) |
| 1536 | | #define DST_SAMPHOLD__TYPE DISCRETE_INPUT(3) |
| 1531 | #define DST_SAMPHOLD__IN0 DISCRETE_INPUT(0) |
| 1532 | #define DST_SAMPHOLD__CLOCK DISCRETE_INPUT(1) |
| 1533 | #define DST_SAMPHOLD__TYPE DISCRETE_INPUT(2) |
| 1537 | 1534 | |
| 1538 | 1535 | static DISCRETE_STEP(dst_samphold) |
| 1539 | 1536 | { |
| 1540 | 1537 | struct dst_samphold_context *context = (struct dst_samphold_context *)node->context; |
| 1541 | 1538 | |
| 1542 | | if(DST_SAMPHOLD__ENABLE) |
| 1539 | switch(context->clocktype) |
| 1543 | 1540 | { |
| 1544 | | switch(context->clocktype) |
| 1545 | | { |
| 1546 | | case DISC_SAMPHOLD_REDGE: |
| 1547 | | /* Clock the whole time the input is rising */ |
| 1548 | | if (DST_SAMPHOLD__CLOCK > context->last_input) node->output[0] = DST_SAMPHOLD__IN0; |
| 1549 | | break; |
| 1550 | | case DISC_SAMPHOLD_FEDGE: |
| 1551 | | /* Clock the whole time the input is falling */ |
| 1552 | | if(DST_SAMPHOLD__CLOCK < context->last_input) node->output[0] = DST_SAMPHOLD__IN0; |
| 1553 | | break; |
| 1554 | | case DISC_SAMPHOLD_HLATCH: |
| 1555 | | /* Output follows input if clock != 0 */ |
| 1556 | | if( DST_SAMPHOLD__CLOCK) node->output[0] = DST_SAMPHOLD__IN0; |
| 1557 | | break; |
| 1558 | | case DISC_SAMPHOLD_LLATCH: |
| 1559 | | /* Output follows input if clock == 0 */ |
| 1560 | | if (DST_SAMPHOLD__CLOCK == 0) node->output[0] = DST_SAMPHOLD__IN0; |
| 1561 | | break; |
| 1562 | | default: |
| 1563 | | discrete_log(node->info, "dst_samphold_step - Invalid clocktype passed"); |
| 1564 | | break; |
| 1565 | | } |
| 1541 | case DISC_SAMPHOLD_REDGE: |
| 1542 | /* Clock the whole time the input is rising */ |
| 1543 | if (DST_SAMPHOLD__CLOCK > context->last_input) node->output[0] = DST_SAMPHOLD__IN0; |
| 1544 | break; |
| 1545 | case DISC_SAMPHOLD_FEDGE: |
| 1546 | /* Clock the whole time the input is falling */ |
| 1547 | if(DST_SAMPHOLD__CLOCK < context->last_input) node->output[0] = DST_SAMPHOLD__IN0; |
| 1548 | break; |
| 1549 | case DISC_SAMPHOLD_HLATCH: |
| 1550 | /* Output follows input if clock != 0 */ |
| 1551 | if( DST_SAMPHOLD__CLOCK) node->output[0] = DST_SAMPHOLD__IN0; |
| 1552 | break; |
| 1553 | case DISC_SAMPHOLD_LLATCH: |
| 1554 | /* Output follows input if clock == 0 */ |
| 1555 | if (DST_SAMPHOLD__CLOCK == 0) node->output[0] = DST_SAMPHOLD__IN0; |
| 1556 | break; |
| 1557 | default: |
| 1558 | discrete_log(node->info, "dst_samphold_step - Invalid clocktype passed"); |
| 1559 | break; |
| 1566 | 1560 | } |
| 1567 | | else |
| 1568 | | { |
| 1569 | | node->output[0] = 0; |
| 1570 | | } |
| 1571 | 1561 | /* Save the last value */ |
| 1572 | 1562 | context->last_input = DST_SAMPHOLD__CLOCK; |
| 1573 | 1563 | } |
| r5891 | r5892 | |
| 1586 | 1576 | |
| 1587 | 1577 | /************************************************************************ |
| 1588 | 1578 | * |
| 1589 | | * DSS_SWITCH - Programmable 2 pole switch module with enable function |
| 1579 | * DST_SWITCH - Programmable 2 pole switch module with enable function |
| 1590 | 1580 | * |
| 1591 | 1581 | * input[0] - Enable input value |
| 1592 | 1582 | * input[1] - switch position |
| r5891 | r5892 | |
| 1594 | 1584 | * input[3] - input[1] |
| 1595 | 1585 | * |
| 1596 | 1586 | ************************************************************************/ |
| 1597 | | #define DSS_SWITCH__ENABLE DISCRETE_INPUT(0) |
| 1598 | | #define DSS_SWITCH__SWITCH DISCRETE_INPUT(1) |
| 1599 | | #define DSS_SWITCH__IN0 DISCRETE_INPUT(2) |
| 1600 | | #define DSS_SWITCH__IN1 DISCRETE_INPUT(3) |
| 1587 | #define DST_SWITCH__ENABLE DISCRETE_INPUT(0) |
| 1588 | #define DST_SWITCH__SWITCH DISCRETE_INPUT(1) |
| 1589 | #define DST_SWITCH__IN0 DISCRETE_INPUT(2) |
| 1590 | #define DST_SWITCH__IN1 DISCRETE_INPUT(3) |
| 1601 | 1591 | |
| 1602 | 1592 | static DISCRETE_STEP(dst_switch) |
| 1603 | 1593 | { |
| 1604 | | if(DSS_SWITCH__ENABLE) |
| 1594 | if(DST_SWITCH__ENABLE) |
| 1605 | 1595 | { |
| 1606 | | node->output[0] = DSS_SWITCH__SWITCH ? DSS_SWITCH__IN1 : DSS_SWITCH__IN0; |
| 1596 | node->output[0] = DST_SWITCH__SWITCH ? DST_SWITCH__IN1 : DST_SWITCH__IN0; |
| 1607 | 1597 | } |
| 1608 | 1598 | else |
| 1609 | 1599 | { |
| r5891 | r5892 | |
| 1613 | 1603 | |
| 1614 | 1604 | /************************************************************************ |
| 1615 | 1605 | * |
| 1616 | | * DSS_ASWITCH - Analog switch |
| 1606 | * DST_ASWITCH - Analog switch |
| 1617 | 1607 | * |
| 1618 | | * input[0] - Enable input value |
| 1619 | 1608 | * input[1] - Control |
| 1620 | 1609 | * input[2] - Input |
| 1621 | 1610 | * input[3] - Threshold for enable |
| 1622 | 1611 | * |
| 1623 | 1612 | ************************************************************************/ |
| 1624 | | #define DSS_ASWITCH__ENABLE DISCRETE_INPUT(0) |
| 1625 | | #define DSS_ASWITCH__CTRL DISCRETE_INPUT(1) |
| 1626 | | #define DSS_ASWITCH__IN DISCRETE_INPUT(2) |
| 1627 | | #define DSS_ASWITCH__THRESHOLD DISCRETE_INPUT(3) |
| 1613 | #define DST_ASWITCH__CTRL DISCRETE_INPUT(1) |
| 1614 | #define DST_ASWITCH__IN DISCRETE_INPUT(2) |
| 1615 | #define DST_ASWITCH__THRESHOLD DISCRETE_INPUT(3) |
| 1628 | 1616 | |
| 1629 | 1617 | |
| 1630 | 1618 | static DISCRETE_STEP(dst_aswitch) |
| 1631 | 1619 | { |
| 1632 | | if(DSS_SWITCH__ENABLE) |
| 1633 | | { |
| 1634 | | node->output[0] = DSS_ASWITCH__CTRL > DSS_ASWITCH__THRESHOLD ? DSS_ASWITCH__IN : 0; |
| 1635 | | } |
| 1636 | | else |
| 1637 | | { |
| 1638 | | node->output[0] = 0; |
| 1639 | | } |
| 1620 | node->output[0] = DST_ASWITCH__CTRL > DST_ASWITCH__THRESHOLD ? DST_ASWITCH__IN : 0; |
| 1640 | 1621 | } |
| 1641 | 1622 | |
| 1642 | 1623 | /************************************************************************ |
| r5891 | r5892 | |
| 1864 | 1845 | if (context->has_r4) |
| 1865 | 1846 | { |
| 1866 | 1847 | /* exponential charge */ |
| 1867 | | context->exponent = RC_CHARGE_EXP(node, info->r4 * info->c); |
| 1848 | context->exponent = RC_CHARGE_EXP(info->r4 * info->c); |
| 1868 | 1849 | } |
| 1869 | 1850 | else |
| 1870 | 1851 | /* linear charge */ |
| r5891 | r5892 | |
| 1935 | 1916 | const discrete_op_amp_1sht_info *info = (const discrete_op_amp_1sht_info *)node->custom; |
| 1936 | 1917 | struct dst_op_amp_1sht_context *context = (struct dst_op_amp_1sht_context *)node->context; |
| 1937 | 1918 | |
| 1938 | | context->exponent1c = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r3, info->r4) * info->c1); |
| 1939 | | context->exponent1d = RC_CHARGE_EXP(node, info->r4 * info->c1); |
| 1940 | | context->exponent2 = RC_CHARGE_EXP(node, info->r2 * info->c2); |
| 1919 | context->exponent1c = RC_CHARGE_EXP(RES_2_PARALLEL(info->r3, info->r4) * info->c1); |
| 1920 | context->exponent1d = RC_CHARGE_EXP(info->r4 * info->c1); |
| 1921 | context->exponent2 = RC_CHARGE_EXP(info->r2 * info->c2); |
| 1941 | 1922 | context->i_fixed = (info->vP - OP_AMP_NORTON_VBE) / info->r1; |
| 1942 | 1923 | context->v_cap1 = context->v_cap2 = 0; |
| 1943 | 1924 | context->v_max = info->vP - OP_AMP_NORTON_VBE; |
| r5891 | r5892 | |
| 2062 | 2043 | context->v_cap1 = 0; |
| 2063 | 2044 | /* Charge rate thru r5 */ |
| 2064 | 2045 | /* There can be a different charge rates depending on function F3. */ |
| 2065 | | context->exponent_c[0] = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r5, info->r6) * info->c1); |
| 2066 | | context->exponent_c[1] = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r5, context->r67) * info->c1); |
| 2046 | context->exponent_c[0] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r5, info->r6) * info->c1); |
| 2047 | context->exponent_c[1] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r5, context->r67) * info->c1); |
| 2067 | 2048 | /* Discharge rate thru r6 + r7 */ |
| 2068 | | context->exponent_d[1] = RC_CHARGE_EXP(node, context->r67 * info->c1); |
| 2049 | context->exponent_d[1] = RC_CHARGE_EXP(context->r67 * info->c1); |
| 2069 | 2050 | /* Discharge rate thru r6 */ |
| 2070 | 2051 | if (info->r6 != 0) |
| 2071 | 2052 | { |
| 2072 | | context->exponent_d[0] = RC_CHARGE_EXP(node, info->r6 * info->c1); |
| 2053 | context->exponent_d[0] = RC_CHARGE_EXP(info->r6 * info->c1); |
| 2073 | 2054 | } |
| 2074 | 2055 | context->v_cap2 = 0; |
| 2075 | 2056 | context->v_trig2 = (info->v2 - 0.6 - OP_AMP_NORTON_VBE) * RES_VOLTAGE_DIVIDER(info->r8, info->r9); |
| 2076 | | context->exponent2[0] = RC_CHARGE_EXP(node, info->r9 * info->c2); |
| 2077 | | context->exponent2[1] = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r8, info->r9) * info->c2); |
| 2057 | context->exponent2[0] = RC_CHARGE_EXP(info->r9 * info->c2); |
| 2058 | context->exponent2[1] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r8, info->r9) * info->c2); |
| 2078 | 2059 | context->v_cap3 = 0; |
| 2079 | 2060 | context->v_trig3 = (info->v3 - 0.6 - OP_AMP_NORTON_VBE) * RES_VOLTAGE_DIVIDER(info->r10, info->r11); |
| 2080 | | context->exponent3[0] = RC_CHARGE_EXP(node, info->r11 * info->c3); |
| 2081 | | context->exponent3[1] = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r10, info->r11) * info->c3); |
| 2061 | context->exponent3[0] = RC_CHARGE_EXP(info->r11 * info->c3); |
| 2062 | context->exponent3[1] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r10, info->r11) * info->c3); |
| 2082 | 2063 | |
| 2083 | 2064 | DISCRETE_STEP_CALL(dst_tvca_op_amp); |
| 2084 | 2065 | } |
src/emu/sound/discrete.h
| r5891 | r5892 | |
| 224 | 224 | * DISCRETE_DIVIDE(NODE,ENAB,IN0,IN1) |
| 225 | 225 | * DISCRETE_GAIN(NODE,IN0,GAIN) |
| 226 | 226 | * DISCRETE_INVERT(NODE,IN0) |
| 227 | | * DISCRETE_LOOKUP_TABLE(NODE,ENAB,ADDR,SIZE,TABLE) |
| 227 | * DISCRETE_LOOKUP_TABLE(NODE,ADDR,SIZE,TABLE) |
| 228 | 228 | * DISCRETE_MULTIPLY(NODE,ENAB,IN0,IN1) |
| 229 | | * DISCRETE_MULTADD(NODE,ENAB,INP0,INP1,INP2) |
| 229 | * DISCRETE_MULTADD(NODE,INP0,INP1,INP2) |
| 230 | 230 | * DISCRETE_ONESHOT(NODE,TRIG,AMPL,WIDTH,TYPE) |
| 231 | 231 | * DISCRETE_ONESHOTR(NODE,RESET,TRIG,AMPL,WIDTH,TYPE) |
| 232 | 232 | * DISCRETE_ONOFF(NODE,ENAB,INP0) |
| 233 | 233 | * DISCRETE_RAMP(NODE,ENAB,RAMP,GRAD,MIN,MAX,CLAMP) |
| 234 | | * DISCRETE_SAMPLHOLD(NODE,ENAB,INP0,CLOCK,CLKTYPE) |
| 234 | * DISCRETE_SAMPLHOLD(NODE,INP0,CLOCK,CLKTYPE) |
| 235 | 235 | * DISCRETE_SWITCH(NODE,ENAB,SWITCH,INP0,INP1) |
| 236 | * DISCRETE_ASWITCH(NODE,CTRL,INP,THRESHOLD) |
| 236 | 237 | * DISCRETE_TRANSFORM2(NODE,INP0,INP1,FUNCT) |
| 237 | 238 | * DISCRETE_TRANSFORM3(NODE,INP0,INP1,INP2,FUNCT) |
| 238 | 239 | * DISCRETE_TRANSFORM4(NODE,INP0,INP1,INP2,INP3,FUNCT) |
| 239 | 240 | * DISCRETE_TRANSFORM5(NODE,INP0,INP1,INP2,INP3,INP4,FUNCT) |
| 240 | 241 | * |
| 241 | 242 | * DISCRETE_COMP_ADDER(NODE,DATA,TABLE) |
| 242 | | * DISCRETE_DAC_R1(NODE,ENAB,DATA,VDATA,LADDER) |
| 243 | * DISCRETE_DAC_R1(NODE,DATA,VDATA,LADDER) |
| 243 | 244 | * DISCRETE_DIODE_MIXER2(NODE,IN0,IN1,TABLE) |
| 244 | 245 | * DISCRETE_DIODE_MIXER3(NODE,IN0,IN1,IN2,TABLE) |
| 245 | 246 | * DISCRETE_DIODE_MIXER4(NODE,IN0,IN1,IN2,IN3,TABLE) |
| r5891 | r5892 | |
| 258 | 259 | * DISCRETE_BIT_DECODE(NODE,INP,BIT_N,VOUT) |
| 259 | 260 | * DISCRETE_BITS_DECODE(NODE,INP,BIT_FROM,BIT_TO,VOUT) |
| 260 | 261 | * |
| 261 | | * DISCRETE_LOGIC_INVERT(NODE,ENAB,INP0) |
| 262 | | * DISCRETE_LOGIC_AND(NODE,ENAB,INP0,INP1) |
| 263 | | * DISCRETE_LOGIC_AND3(NODE,ENAB,INP0,INP1,INP2) |
| 264 | | * DISCRETE_LOGIC_AND4(NODE,ENAB,INP0,INP1,INP2,INP3) |
| 265 | | * DISCRETE_LOGIC_NAND(NODE,ENAB,INP0,INP1) |
| 266 | | * DISCRETE_LOGIC_NAND3(NODE,ENAB,INP0,INP1,INP2) |
| 267 | | * DISCRETE_LOGIC_NAND4(NODE,ENAB,INP0,INP1,INP2,INP3) |
| 268 | | * DISCRETE_LOGIC_OR(NODE,ENAB,INP0,INP1) |
| 269 | | * DISCRETE_LOGIC_OR3(NODE,ENAB,INP0,INP1,INP2) |
| 270 | | * DISCRETE_LOGIC_OR4(NODE,ENAB,INP0,INP1,INP2,INP3) |
| 271 | | * DISCRETE_LOGIC_NOR(NODE,ENAB,INP0,INP1) |
| 272 | | * DISCRETE_LOGIC_NOR3(NODE,ENAB,INP0,INP1,INP2) |
| 273 | | * DISCRETE_LOGIC_NOR4(NODE,ENAB,INP0,INP1,INP2,INP3) |
| 274 | | * DISCRETE_LOGIC_XOR(NODE,ENAB,INP0,INP1) |
| 275 | | * DISCRETE_LOGIC_NXOR(NODE,ENAB,INP0,INP1) |
| 276 | | * DISCRETE_LOGIC_DFLIPFLOP(NODE,ENAB,RESET,SET,CLK,INP) |
| 277 | | * DISCRETE_LOGIC_JKFLIPFLOP(NODE,ENAB,RESET,SET,CLK,J,K) |
| 278 | | * DISCRETE_MULTIPLEX2(NODE,ENAB,ADDR,INP0,INP1) |
| 279 | | * DISCRETE_MULTIPLEX4(NODE,ENAB,ADDR,INP0,INP1,INP2,INP3) |
| 280 | | * DISCRETE_MULTIPLEX8(NODE,ENAB,ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7) |
| 262 | * DISCRETE_LOGIC_INVERT(NODE,INP0) |
| 263 | * DISCRETE_LOGIC_AND(NODE,INP0,INP1) |
| 264 | * DISCRETE_LOGIC_AND3(NODE,INP0,INP1,INP2) |
| 265 | * DISCRETE_LOGIC_AND4(NODE,INP0,INP1,INP2,INP3) |
| 266 | * DISCRETE_LOGIC_NAND(NODE,INP0,INP1) |
| 267 | * DISCRETE_LOGIC_NAND3(NODE,INP0,INP1,INP2) |
| 268 | * DISCRETE_LOGIC_NAND4(NODE,INP0,INP1,INP2,INP3) |
| 269 | * DISCRETE_LOGIC_OR(NODE,INP0,INP1) |
| 270 | * DISCRETE_LOGIC_OR3(NODE,INP0,INP1,INP2) |
| 271 | * DISCRETE_LOGIC_OR4(NODE,INP0,INP1,INP2,INP3) |
| 272 | * DISCRETE_LOGIC_NOR(NODE,INP0,INP1) |
| 273 | * DISCRETE_LOGIC_NOR3(NODE,INP0,INP1,INP2) |
| 274 | * DISCRETE_LOGIC_NOR4(NODE,INP0,INP1,INP2,INP3) |
| 275 | * DISCRETE_LOGIC_XOR(NODE,INP0,INP1) |
| 276 | * DISCRETE_LOGIC_NXOR(NODE,INP0,INP1) |
| 277 | * DISCRETE_LOGIC_DFLIPFLOP(NODE,RESET,SET,CLK,INP) |
| 278 | * DISCRETE_LOGIC_JKFLIPFLOP(NODE,RESET,SET,CLK,J,K) |
| 279 | * DISCRETE_LOGIC_SHIFT(NODE,INP0,RESET,CLK,SIZE,OPTIONS) |
| 280 | * DISCRETE_MULTIPLEX2(NODE,ADDR,INP0,INP1) |
| 281 | * DISCRETE_MULTIPLEX4(NODE,ADDR,INP0,INP1,INP2,INP3) |
| 282 | * DISCRETE_MULTIPLEX8(NODE,ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7) |
| 281 | 283 | * |
| 282 | 284 | * DISCRETE_FILTER1(NODE,ENAB,INP0,FREQ,TYPE) |
| 283 | 285 | * DISCRETE_FILTER2(NODE,ENAB,INP0,FREQ,DAMP,TYPE) |
| r5891 | r5892 | |
| 301 | 303 | * DISCRETE_555_CC(NODE,RESET,VIN,R,C,RBIAS,RGND,RDIS,OPTIONS) |
| 302 | 304 | * DISCRETE_555_VCO1(NODE,RESET,VIN,OPTIONS) |
| 303 | 305 | * DISCRETE_555_VCO1_CV(NODE,RESET,VIN,CTRLV,OPTIONS) |
| 304 | | * DISCRETE_566(NODE,ENAB,VMOD,R,C,OPTIONS) |
| 306 | * DISCRETE_566(NODE,VMOD,R,C,OPTIONS) |
| 307 | * DISCRETE_74LS624(NODE,VMOD,VRNG,C,OUTTYPE) |
| 305 | 308 | * |
| 306 | 309 | * DISCRETE_CUSTOM1(NODE,IN0,INFO) |
| 307 | 310 | * DISCRETE_CUSTOM2(NODE,IN0,IN1,INFO) |
| r5891 | r5892 | |
| 1296 | 1299 | * |
| 1297 | 1300 | * .------------. |
| 1298 | 1301 | * | | |
| 1299 | | * ENAB -0------>| | |
| 1300 | | * | | |
| 1301 | 1302 | * INPUT0 -0------>| | |
| 1302 | 1303 | * | LOGIC | |
| 1303 | 1304 | * [INPUT1] -1------>| FUNCTION |----> Netlist node |
| r5891 | r5892 | |
| 1311 | 1312 | * Declaration syntax |
| 1312 | 1313 | * |
| 1313 | 1314 | * DISCRETE_LOGIC_XXXn(name of node, |
| 1314 | | * (X=INV/AND/etc) enable node or static value, |
| 1315 | * (X=INV/AND/etc) |
| 1315 | 1316 | * (n=Blank/2/3) input0 node or static value, |
| 1316 | 1317 | * [input1 node or static value], |
| 1317 | 1318 | * [input2 node or static value], |
| r5891 | r5892 | |
| 1319 | 1320 | * |
| 1320 | 1321 | * Example config lines |
| 1321 | 1322 | * |
| 1322 | | * DISCRETE_LOGIC_INVERT(NODE_03,1,NODE_12) |
| 1323 | | * DISCRETE_LOGIC_AND(NODE_03,1,NODE_12,NODE_13) |
| 1324 | | * DISCRETE_LOGIC_NOR4(NODE_03,1,NODE_12,NODE_13,NODE_14,NODE_15) |
| 1323 | * DISCRETE_LOGIC_INVERT(NODE_03,NODE_12) |
| 1324 | * DISCRETE_LOGIC_AND(NODE_03,NODE_12,NODE_13) |
| 1325 | * DISCRETE_LOGIC_NOR4(NODE_03,NODE_12,NODE_13,NODE_14,NODE_15) |
| 1325 | 1326 | * |
| 1326 | 1327 | * Node output is always either 0.0 or 1.0 any input value !=0.0 is |
| 1327 | 1328 | * taken as a logic 1. |
| r5891 | r5892 | |
| 1348 | 1349 | * Declaration syntax |
| 1349 | 1350 | * |
| 1350 | 1351 | * DISCRETE_LOGIC_DFLIPFLOP(name of node, |
| 1351 | | * enable node or static value, |
| 1352 | 1352 | * reset node or static value, |
| 1353 | 1353 | * set node or static value, |
| 1354 | 1354 | * clock node, |
| r5891 | r5892 | |
| 1356 | 1356 | * |
| 1357 | 1357 | * Example config line |
| 1358 | 1358 | * |
| 1359 | | * DISCRETE_LOGIC_DFLIPFLOP(NODE_7,1,NODE_17,0,NODE_13,1) |
| 1359 | * DISCRETE_LOGIC_DFLIPFLOP(NODE_7,NODE_17,0,NODE_13,1) |
| 1360 | 1360 | * |
| 1361 | 1361 | * A flip-flop that clocks a logic 1 through on the rising edge of |
| 1362 | 1362 | * NODE_13. A logic 1 on NODE_17 resets the output to 0. |
| r5891 | r5892 | |
| 1385 | 1385 | * Declaration syntax |
| 1386 | 1386 | * |
| 1387 | 1387 | * DISCRETE_LOGIC_JKFLIPFLOP(name of node, |
| 1388 | | * enable node or static value, |
| 1389 | 1388 | * reset node or static value, |
| 1390 | 1389 | * set node or static value, |
| 1391 | 1390 | * clock node, |
| r5891 | r5892 | |
| 1401 | 1400 | * Declaration syntax |
| 1402 | 1401 | * |
| 1403 | 1402 | * DISCRETE_LOOKUP_TABLE(name of node, |
| 1404 | | * enable node or static value, |
| 1405 | 1403 | * address node, |
| 1406 | 1404 | * size of table static value, |
| 1407 | 1405 | * address of table of double values) |
| r5891 | r5892 | |
| 1431 | 1429 | * Declaration syntax |
| 1432 | 1430 | * |
| 1433 | 1431 | * DISCRETE_MULTIPLEXx(name of node, |
| 1434 | | * (x=2/4/8) enable node or static value, |
| 1435 | | * address node, |
| 1432 | * (x=2/4/8) address node, |
| 1436 | 1433 | * input 0 node or static value, |
| 1437 | 1434 | * input 1 node or static value, ...) |
| 1438 | 1435 | * |
| 1439 | 1436 | *********************************************************************** |
| 1440 | 1437 | * |
| 1438 | * DISCRETE_LOGIC_SHIFT - shift register |
| 1439 | * |
| 1440 | * Declaration syntax |
| 1441 | * |
| 1442 | * DISCRETE_LOGIC_SHIFT(name of node, |
| 1443 | * input node, |
| 1444 | * reset node or static value, |
| 1445 | * clock node or static value, |
| 1446 | * size static value, |
| 1447 | * options static value) |
| 1448 | * |
| 1449 | * Options: |
| 1450 | * reset type: DISC_LOGIC_SHIFT__RESET_L |
| 1451 | * DISC_LOGIC_SHIFT__RESET_H |
| 1452 | * shift type: DISC_LOGIC_SHIFT__LEFT |
| 1453 | * DISC_LOGIC_SHIFT__RIGHT |
| 1454 | * clock type: DISC_CLK_ON_F_EDGE - toggle on falling edge. |
| 1455 | * DISC_CLK_ON_R_EDGE - toggle on rising edge. |
| 1456 | * DISC_CLK_BY_COUNT - toggle specified number of times. |
| 1457 | * DISC_CLK_IS_FREQ - internally clock at this frequency. |
| 1458 | * |
| 1459 | * EXAMPLES: see Sky Raider |
| 1460 | * |
| 1461 | *********************************************************************** |
| 1462 | * |
| 1441 | 1463 | * DISCRETE_GAIN - Node multiplication function output is equal |
| 1442 | 1464 | * DISCRETE_MULTIPLY to INPUT0 * INPUT1 |
| 1443 | 1465 | * DISCRETE_MULTADD to (INPUT0 * INPUT1) + INPUT 2 |
| 1444 | 1466 | * |
| 1445 | 1467 | * .------------. |
| 1446 | 1468 | * | | |
| 1447 | | * ENAB -0------>| | |
| 1448 | | * | | |
| 1449 | 1469 | * INPUT0 -1------>| \|/ | |
| 1450 | 1470 | * | -+- |----> Netlist node |
| 1451 | 1471 | * INPUT1 -2------>| /|\ | |
| r5891 | r5892 | |
| 1457 | 1477 | * Declaration syntax |
| 1458 | 1478 | * |
| 1459 | 1479 | * DISCRETE_MULTIPLY (name of node, |
| 1460 | | * enable node or static value, |
| 1461 | 1480 | * input0 node or static value, |
| 1462 | 1481 | * input1 node or static value) |
| 1463 | 1482 | * |
| 1464 | 1483 | * DISCRETE_MULTADD (name of node, |
| 1465 | | * enable node or static value, |
| 1466 | 1484 | * input0 node or static value, |
| 1467 | 1485 | * input1 node or static value, |
| 1468 | 1486 | * input2 node or static value) |
| r5891 | r5892 | |
| 1636 | 1654 | * Declaration syntax |
| 1637 | 1655 | * |
| 1638 | 1656 | * DISCRETE_ASWITCH (name of node, |
| 1639 | | * enable node or static value, |
| 1640 | 1657 | * ctrl node or static value, |
| 1641 | 1658 | * input node or static value, |
| 1642 | 1659 | * threshold satic value ) |
| 1643 | 1660 | * |
| 1644 | 1661 | * Example config line |
| 1645 | 1662 | * |
| 1646 | | * DISCRETE_ASWITCH(NODE_03,1,NODE_10,NODE_90, 2.73) |
| 1663 | * DISCRETE_ASWITCH(NODE_03,NODE_10,NODE_90, 2.73) |
| 1647 | 1664 | * |
| 1648 | 1665 | * Always enabled, NODE_10 switches output to be either NODE_90 or |
| 1649 | 1666 | * constant value 0.0. Ctrl>2.73 output=NODE_90 else output=0 |
| r5891 | r5892 | |
| 1773 | 1790 | * Declaration syntax |
| 1774 | 1791 | * |
| 1775 | 1792 | * DISCRETE_DAC_R1(name of node, |
| 1776 | | * enable node or static value, |
| 1777 | 1793 | * data node (static value is useless), |
| 1778 | 1794 | * vData node or static value (voltage when a bit is on ), |
| 1779 | 1795 | * address of discrete_dac_r1_ladder structure) |
| r5891 | r5892 | |
| 3160 | 3176 | * Declaration syntax |
| 3161 | 3177 | * |
| 3162 | 3178 | * DISCRETE_566(name of node, |
| 3163 | | * enable node or static value, |
| 3164 | 3179 | * vMod node or static value, |
| 3165 | 3180 | * R node or static value in ohms, |
| 3166 | 3181 | * C node or static value in Farads, |
| r5891 | r5892 | |
| 3213 | 3228 | * Declaration syntax |
| 3214 | 3229 | * |
| 3215 | 3230 | * DISCRETE_74LS624(name of node, |
| 3216 | | * enable node or static value, |
| 3217 | 3231 | * vMod node or static value, |
| 3218 | | * vRng node or static value, |
| 3219 | | * C node or static value in Farads, |
| 3232 | * vRng static value, |
| 3233 | * C static value in Farads, |
| 3220 | 3234 | * Type of output static value) |
| 3221 | 3235 | * |
| 3222 | 3236 | * Type of Output |
| r5891 | r5892 | |
| 3225 | 3239 | * DISC_LS624_OUT_COUNT_F Number of Falling edges |
| 3226 | 3240 | * DISC_LS624_OUT_COUNT_R Number of Rising edges |
| 3227 | 3241 | * |
| 3242 | * |
| 3243 | * EXAMPLES: see Donkey Kong Jr. |
| 3244 | * |
| 3228 | 3245 | *********************************************************************** |
| 3229 | 3246 | * |
| 3230 | 3247 | * DISCRETE_CUSTOMx - Link to custom code |
| r5891 | r5892 | |
| 3246 | 3263 | * if you have used DISCRETE_STEP(basename) and DISCRETE_RESET(basename) to define |
| 3247 | 3264 | * the step/reset procedures. |
| 3248 | 3265 | * |
| 3249 | | * EXAMPLES: see Donkey Kong, Mario Bros. |
| 3266 | * EXAMPLES: see Donkey Kong, Mario Bros., Sky Raider |
| 3250 | 3267 | * |
| 3251 | 3268 | *********************************************************************** |
| 3252 | 3269 | ======================================================================= |
| r5891 | r5892 | |
| 3341 | 3358 | *************************************/ |
| 3342 | 3359 | |
| 3343 | 3360 | /* calculate charge exponent using discrete sample time */ |
| 3344 | | #define RC_CHARGE_EXP(_node, rc) (1.0 - exp((_node)->info->neg_sample_time / (rc))) |
| 3361 | #define RC_CHARGE_EXP(rc) (1.0 - exp((node)->info->neg_sample_time / (rc))) |
| 3345 | 3362 | /* calculate charge exponent using given sample time */ |
| 3346 | | #define RC_CHARGE_EXP_DT(rc, dt) (1.0 - exp(-(dt) / (rc))) |
| 3347 | | #define RC_CHARGE_NEG_EXP_DT(rc, dt) (1.0 - exp((dt) / (rc))) |
| 3363 | #define RC_CHARGE_EXP_DT(rc, dt) (1.0 - exp(-(dt) / (rc))) |
| 3364 | #define RC_CHARGE_NEG_EXP_DT(rc, dt) (1.0 - exp((dt) / (rc))) |
| 3348 | 3365 | |
| 3349 | 3366 | /* calculate discharge exponent using discrete sample time */ |
| 3350 | | #define RC_DISCHARGE_EXP(_node, rc) (exp((_node)->info->neg_sample_time / (rc))) |
| 3367 | #define RC_DISCHARGE_EXP(rc) (exp((node)->info->neg_sample_time / (rc))) |
| 3351 | 3368 | /* calculate discharge exponent using given sample time */ |
| 3352 | | #define RC_DISCHARGE_EXP_DT(rc, dt) (exp(-(dt) / (rc))) |
| 3353 | | #define RC_DISCHARGE_NEG_EXP_DT(rc, dt) (exp((dt) / (rc))) |
| 3369 | #define RC_DISCHARGE_EXP_DT(rc, dt) (exp(-(dt) / (rc))) |
| 3370 | #define RC_DISCHARGE_NEG_EXP_DT(rc, dt) (exp((dt) / (rc))) |
| 3354 | 3371 | |
| 3355 | 3372 | /************************************* |
| 3356 | 3373 | * |
| r5891 | r5892 | |
| 3358 | 3375 | * |
| 3359 | 3376 | *************************************/ |
| 3360 | 3377 | |
| 3361 | | #define DISCRETE_STEP_NAME( _func ) _func ## _step |
| 3362 | | #define DISCRETE_RESET_NAME( _func ) _func ## _reset |
| 3363 | | #define DISCRETE_START_NAME( _func ) _func ## _start |
| 3364 | | #define DISCRETE_STOP_NAME( _func ) _func ## _stop |
| 3378 | #define DISCRETE_STEP_NAME( _func ) _func ## _step |
| 3379 | #define DISCRETE_RESET_NAME( _func ) _func ## _reset |
| 3380 | #define DISCRETE_START_NAME( _func ) _func ## _start |
| 3381 | #define DISCRETE_STOP_NAME( _func ) _func ## _stop |
| 3365 | 3382 | |
| 3366 | | #define DISCRETE_FUNC(_func) void _func (node_description *node) |
| 3383 | #define DISCRETE_FUNC(_func) void _func (node_description *node) |
| 3367 | 3384 | |
| 3368 | | #define DISCRETE_STEP(_func) DISCRETE_FUNC(DISCRETE_STEP_NAME(_func)) |
| 3369 | | #define DISCRETE_RESET(_func) DISCRETE_FUNC(DISCRETE_RESET_NAME(_func)) |
| 3370 | | #define DISCRETE_START(_func) DISCRETE_FUNC(DISCRETE_START_NAME(_func)) |
| 3371 | | #define DISCRETE_STOP(_func) DISCRETE_FUNC(DISCRETE_STOP_NAME(_func)) |
| 3385 | #define DISCRETE_STEP(_func) DISCRETE_FUNC(DISCRETE_STEP_NAME(_func)) |
| 3386 | #define DISCRETE_RESET(_func) DISCRETE_FUNC(DISCRETE_RESET_NAME(_func)) |
| 3387 | #define DISCRETE_START(_func) DISCRETE_FUNC(DISCRETE_START_NAME(_func)) |
| 3388 | #define DISCRETE_STOP(_func) DISCRETE_FUNC(DISCRETE_STOP_NAME(_func)) |
| 3372 | 3389 | |
| 3373 | | #define DISCRETE_STEP_CALL(_func) DISCRETE_STEP_NAME(_func) (node) |
| 3374 | | #define DISCRETE_RESET_CALL(_func) DISCRETE_RESET_NAME(_func) (node) |
| 3375 | | #define DISCRETE_START_CALL(_func) DISCRETE_START_NAME(_func) (node) |
| 3376 | | #define DISCRETE_STOP_CALL(_func) DISCRETE_STOP_NAME(_func) (node) |
| 3390 | #define DISCRETE_STEP_CALL(_func) DISCRETE_STEP_NAME(_func) (node) |
| 3391 | #define DISCRETE_RESET_CALL(_func) DISCRETE_RESET_NAME(_func) (node) |
| 3392 | #define DISCRETE_START_CALL(_func) DISCRETE_START_NAME(_func) (node) |
| 3393 | #define DISCRETE_STOP_CALL(_func) DISCRETE_STOP_NAME(_func) (node) |
| 3377 | 3394 | |
| 3378 | 3395 | #define DISCRETE_CUSTOM_MODULE(_basename, _context_type) \ |
| 3379 | 3396 | { DST_CUSTOM, "CUSTOM", 1, sizeof(_context_type), DISCRETE_RESET_NAME(_basename), DISCRETE_STEP_NAME(_basename) } |
| 3380 | 3397 | |
| 3381 | | #define DISCRETE_INPUT(_num) (*(node->input[_num])) |
| 3398 | #define DISCRETE_INPUT(_num) (*(node->input[_num])) |
| 3382 | 3399 | |
| 3383 | 3400 | /************************************* |
| 3384 | 3401 | * |
| r5891 | r5892 | |
| 3386 | 3403 | * |
| 3387 | 3404 | *************************************/ |
| 3388 | 3405 | |
| 3389 | | #define DISCRETE_MAX_NODES 300 |
| 3390 | | #define DISCRETE_MAX_INPUTS 10 |
| 3391 | | #define DISCRETE_MAX_OUTPUTS 8 |
| 3392 | | #define DISCRETE_MAX_TASK_OUTPUTS 8 |
| 3406 | #define DISCRETE_MAX_NODES 300 |
| 3407 | #define DISCRETE_MAX_INPUTS 10 |
| 3408 | #define DISCRETE_MAX_OUTPUTS 8 |
| 3409 | #define DISCRETE_MAX_TASK_OUTPUTS 8 |
| 3393 | 3410 | |
| 3394 | 3411 | |
| 3395 | 3412 | /************************************* |
| r5891 | r5892 | |
| 3398 | 3415 | * |
| 3399 | 3416 | *************************************/ |
| 3400 | 3417 | |
| 3401 | | #define DEFAULT_TTL_V_LOGIC_1 3.4 |
| 3418 | #define DEFAULT_TTL_V_LOGIC_1 3.4 |
| 3402 | 3419 | |
| 3403 | | #define DISC_LOGADJ 1.0 |
| 3404 | | #define DISC_LINADJ 0.0 |
| 3420 | #define DISC_LOGADJ 1.0 |
| 3421 | #define DISC_LINADJ 0.0 |
| 3405 | 3422 | |
| 3406 | 3423 | /* DISCRETE_COMP_ADDER types */ |
| 3407 | | #define DISC_COMP_P_CAPACITOR 0x00 |
| 3408 | | #define DISC_COMP_P_RESISTOR 0x01 |
| 3424 | #define DISC_COMP_P_CAPACITOR 0x00 |
| 3425 | #define DISC_COMP_P_RESISTOR 0x01 |
| 3409 | 3426 | |
| 3410 | 3427 | /* clk types */ |
| 3411 | | #define DISC_CLK_MASK 0x03 |
| 3412 | | #define DISC_CLK_ON_F_EDGE 0x00 |
| 3413 | | #define DISC_CLK_ON_R_EDGE 0x01 |
| 3414 | | #define DISC_CLK_BY_COUNT 0x02 |
| 3415 | | #define DISC_CLK_IS_FREQ 0x03 |
| 3428 | #define DISC_CLK_MASK 0x03 |
| 3429 | #define DISC_CLK_ON_F_EDGE 0x00 |
| 3430 | #define DISC_CLK_ON_R_EDGE 0x01 |
| 3431 | #define DISC_CLK_BY_COUNT 0x02 |
| 3432 | #define DISC_CLK_IS_FREQ 0x03 |
| 3416 | 3433 | |
| 3417 | | #define DISC_COUNT_DOWN 0 |
| 3418 | | #define DISC_COUNT_UP 1 |
| 3434 | #define DISC_COUNT_DOWN 0 |
| 3435 | #define DISC_COUNT_UP 1 |
| 3419 | 3436 | |
| 3420 | | #define DISC_COUNTER_IS_7492 0x08 |
| 3437 | #define DISC_COUNTER_IS_7492 0x08 |
| 3421 | 3438 | |
| 3422 | | #define DISC_OUT_MASK 0x30 |
| 3423 | | #define DISC_OUT_DEFAULT 0x00 |
| 3424 | | #define DISC_OUT_IS_ENERGY 0x10 |
| 3425 | | #define DISC_OUT_HAS_XTIME 0x20 |
| 3439 | #define DISC_OUT_MASK 0x30 |
| 3440 | #define DISC_OUT_DEFAULT 0x00 |
| 3441 | #define DISC_OUT_IS_ENERGY 0x10 |
| 3442 | #define DISC_OUT_HAS_XTIME 0x20 |
| 3426 | 3443 | |
| 3427 | 3444 | /* Function possibilities for the LFSR feedback nodes */ |
| 3428 | 3445 | /* 2 inputs, one output */ |
| 3429 | | #define DISC_LFSR_XOR 0 |
| 3430 | | #define DISC_LFSR_OR 1 |
| 3431 | | #define DISC_LFSR_AND 2 |
| 3432 | | #define DISC_LFSR_XNOR 3 |
| 3433 | | #define DISC_LFSR_NOR 4 |
| 3434 | | #define DISC_LFSR_NAND 5 |
| 3435 | | #define DISC_LFSR_IN0 6 |
| 3436 | | #define DISC_LFSR_IN1 7 |
| 3437 | | #define DISC_LFSR_NOT_IN0 8 |
| 3438 | | #define DISC_LFSR_NOT_IN1 9 |
| 3439 | | #define DISC_LFSR_REPLACE 10 |
| 3440 | | #define DISC_LFSR_XOR_INV_IN0 11 |
| 3441 | | #define DISC_LFSR_XOR_INV_IN1 12 |
| 3446 | #define DISC_LFSR_XOR 0 |
| 3447 | #define DISC_LFSR_OR 1 |
| 3448 | #define DISC_LFSR_AND 2 |
| 3449 | #define DISC_LFSR_XNOR 3 |
| 3450 | #define DISC_LFSR_NOR 4 |
| 3451 | #define DISC_LFSR_NAND 5 |
| 3452 | #define DISC_LFSR_IN0 6 |
| 3453 | #define DISC_LFSR_IN1 7 |
| 3454 | #define DISC_LFSR_NOT_IN0 8 |
| 3455 | #define DISC_LFSR_NOT_IN1 9 |
| 3456 | #define DISC_LFSR_REPLACE 10 |
| 3457 | #define DISC_LFSR_XOR_INV_IN0 11 |
| 3458 | #define DISC_LFSR_XOR_INV_IN1 12 |
| 3442 | 3459 | |
| 3443 | 3460 | /* LFSR Flag Bits */ |
| 3444 | | #define DISC_LFSR_FLAG_OUT_INVERT 0x01 |
| 3445 | | #define DISC_LFSR_FLAG_RESET_TYPE_L 0x00 |
| 3446 | | #define DISC_LFSR_FLAG_RESET_TYPE_H 0x02 |
| 3447 | | #define DISC_LFSR_FLAG_OUTPUT_F0 0x04 |
| 3448 | | #define DISC_LFSR_FLAG_OUTPUT_SR_SN1 0x08 |
| 3461 | #define DISC_LFSR_FLAG_OUT_INVERT 0x01 |
| 3462 | #define DISC_LFSR_FLAG_RESET_TYPE_L 0x00 |
| 3463 | #define DISC_LFSR_FLAG_RESET_TYPE_H 0x02 |
| 3464 | #define DISC_LFSR_FLAG_OUTPUT_F0 0x04 |
| 3465 | #define DISC_LFSR_FLAG_OUTPUT_SR_SN1 0x08 |
| 3449 | 3466 | |
| 3450 | 3467 | /* Sample & Hold supported clock types */ |
| 3451 | | #define DISC_SAMPHOLD_REDGE 0 |
| 3452 | | #define DISC_SAMPHOLD_FEDGE 1 |
| 3453 | | #define DISC_SAMPHOLD_HLATCH 2 |
| 3454 | | #define DISC_SAMPHOLD_LLATCH 3 |
| 3468 | #define DISC_SAMPHOLD_REDGE 0 |
| 3469 | #define DISC_SAMPHOLD_FEDGE 1 |
| 3470 | #define DISC_SAMPHOLD_HLATCH 2 |
| 3471 | #define DISC_SAMPHOLD_LLATCH 3 |
| 3455 | 3472 | |
| 3473 | /* Shift options */ |
| 3474 | #define DISC_LOGIC_SHIFT__RESET_L 0x00 |
| 3475 | #define DISC_LOGIC_SHIFT__RESET_H 0x10 |
| 3476 | #define DISC_LOGIC_SHIFT__LEFT 0x00 |
| 3477 | #define DISC_LOGIC_SHIFT__RIGHT 0x20 |
| 3478 | |
| 3456 | 3479 | /* Maximum number of resistors in ladder chain */ |
| 3457 | | #define DISC_LADDER_MAXRES 8 |
| 3480 | #define DISC_LADDER_MAXRES 8 |
| 3458 | 3481 | |
| 3459 | 3482 | /* Filter types */ |
| 3460 | | #define DISC_FILTER_LOWPASS 0 |
| 3461 | | #define DISC_FILTER_HIGHPASS 1 |
| 3462 | | #define DISC_FILTER_BANDPASS 2 |
| 3483 | #define DISC_FILTER_LOWPASS 0 |
| 3484 | #define DISC_FILTER_HIGHPASS 1 |
| 3485 | #define DISC_FILTER_BANDPASS 2 |
| 3463 | 3486 | |
| 3464 | 3487 | /* Mixer types */ |
| 3465 | | #define DISC_MIXER_IS_RESISTOR 0 |
| 3466 | | #define DISC_MIXER_IS_OP_AMP 1 |
| 3467 | | #define DISC_MIXER_IS_OP_AMP_WITH_RI 2 // Used only internally. Use DISC_MIXER_IS_OP_AMP |
| 3488 | #define DISC_MIXER_IS_RESISTOR 0 |
| 3489 | #define DISC_MIXER_IS_OP_AMP 1 |
| 3490 | #define DISC_MIXER_IS_OP_AMP_WITH_RI 2 // Used only internally. Use DISC_MIXER_IS_OP_AMP |
| 3468 | 3491 | |
| 3469 | 3492 | /* Triggered Op Amp Functions */ |
| 3470 | 3493 | enum |
| r5891 | r5892 | |
| 3482 | 3505 | |
| 3483 | 3506 | |
| 3484 | 3507 | /* Common Op Amp Flags and values */ |
| 3485 | | #define DISC_OP_AMP_IS_NORTON 0x01 |
| 3486 | | #define OP_AMP_NORTON_VBE 0.5 // This is the norton junction voltage. Used only internally. |
| 3487 | | #define OP_AMP_VP_RAIL_OFFSET 1.5 // This is how close an op-amp can get to the vP rail. Used only internally. |
| 3508 | #define DISC_OP_AMP_IS_NORTON 0x01 |
| 3509 | #define OP_AMP_NORTON_VBE 0.5 // This is the norton junction voltage. Used only internally. |
| 3510 | #define OP_AMP_VP_RAIL_OFFSET 1.5 // This is how close an op-amp can get to the vP rail. Used only internally. |
| 3488 | 3511 | |
| 3489 | 3512 | /* Integrate options */ |
| 3490 | | #define DISC_INTEGRATE_OP_AMP_1 0x00 |
| 3491 | | #define DISC_INTEGRATE_OP_AMP_2 0x10 |
| 3513 | #define DISC_INTEGRATE_OP_AMP_1 0x00 |
| 3514 | #define DISC_INTEGRATE_OP_AMP_2 0x10 |
| 3492 | 3515 | |
| 3493 | 3516 | /* op amp 1 shot types */ |
| 3494 | | #define DISC_OP_AMP_1SHT_1 0x00 |
| 3517 | #define DISC_OP_AMP_1SHT_1 0x00 |
| 3495 | 3518 | |
| 3496 | 3519 | /* Op Amp Filter Options */ |
| 3497 | 3520 | #define DISC_OP_AMP_FILTER_IS_LOW_PASS_1 0x00 |
| r5891 | r5892 | |
| 3520 | 3543 | #define DISC_OP_AMP_OSCILLATOR_TYPE_MASK (0xf0 | DISC_OP_AMP_IS_NORTON) // Used only internally. |
| 3521 | 3544 | |
| 3522 | 3545 | /* Schmitt Oscillator Options */ |
| 3523 | | #define DISC_SCHMITT_OSC_IN_IS_LOGIC 0x00 |
| 3524 | | #define DISC_SCHMITT_OSC_IN_IS_VOLTAGE 0x01 |
| 3546 | #define DISC_SCHMITT_OSC_IN_IS_LOGIC 0x00 |
| 3547 | #define DISC_SCHMITT_OSC_IN_IS_VOLTAGE 0x01 |
| 3525 | 3548 | |
| 3526 | | #define DISC_SCHMITT_OSC_ENAB_IS_AND 0x00 |
| 3527 | | #define DISC_SCHMITT_OSC_ENAB_IS_NAND 0x02 |
| 3528 | | #define DISC_SCHMITT_OSC_ENAB_IS_OR 0x04 |
| 3529 | | #define DISC_SCHMITT_OSC_ENAB_IS_NOR 0x06 |
| 3549 | #define DISC_SCHMITT_OSC_ENAB_IS_AND 0x00 |
| 3550 | #define DISC_SCHMITT_OSC_ENAB_IS_NAND 0x02 |
| 3551 | #define DISC_SCHMITT_OSC_ENAB_IS_OR 0x04 |
| 3552 | #define DISC_SCHMITT_OSC_ENAB_IS_NOR 0x06 |
| 3530 | 3553 | |
| 3531 | | #define DISC_SCHMITT_OSC_ENAB_MASK 0x06 /* Bits that define output enable type. |
| 3532 | | * Used only internally in module. */ |
| 3554 | #define DISC_SCHMITT_OSC_ENAB_MASK 0x06 /* Bits that define output enable type. |
| 3555 | * Used only internally in module. */ |
| 3533 | 3556 | |
| 3534 | 3557 | /* 555 Common output flags */ |
| 3535 | | #define DISC_555_OUT_DC 0x00 |
| 3536 | | #define DISC_555_OUT_AC 0x10 |
| 3558 | #define DISC_555_OUT_DC 0x00 |
| 3559 | #define DISC_555_OUT_AC 0x10 |
| 3537 | 3560 | |
| 3538 | | #define DISC_555_TRIGGER_IS_LOGIC 0x00 |
| 3539 | | #define DISC_555_TRIGGER_IS_VOLTAGE 0x40 |
| 3540 | | #define DISC_555_TRIGGER_DISCHARGES_CAP 0x80 |
| 3561 | #define DISC_555_TRIGGER_IS_LOGIC 0x00 |
| 3562 | #define DISC_555_TRIGGER_IS_VOLTAGE 0x40 |
| 3563 | #define DISC_555_TRIGGER_DISCHARGES_CAP 0x80 |
| 3541 | 3564 | |
| 3542 | | #define DISC_555_OUT_SQW 0x00 /* Squarewave */ |
| 3543 | | #define DISC_555_OUT_CAP 0x01 /* Cap charge waveform */ |
| 3544 | | #define DISC_555_OUT_COUNT_F 0x02 /* Falling count */ |
| 3545 | | #define DISC_555_OUT_COUNT_R 0x03 /* Rising count */ |
| 3546 | | #define DISC_555_OUT_ENERGY 0x04 |
| 3547 | | #define DISC_555_OUT_LOGIC_X 0x05 |
| 3548 | | #define DISC_555_OUT_COUNT_F_X 0x06 |
| 3549 | | #define DISC_555_OUT_COUNT_R_X 0x07 |
| 3565 | #define DISC_555_OUT_SQW 0x00 /* Squarewave */ |
| 3566 | #define DISC_555_OUT_CAP 0x01 /* Cap charge waveform */ |
| 3567 | #define DISC_555_OUT_COUNT_F 0x02 /* Falling count */ |
| 3568 | #define DISC_555_OUT_COUNT_R 0x03 /* Rising count */ |
| 3569 | #define DISC_555_OUT_ENERGY 0x04 |
| 3570 | #define DISC_555_OUT_LOGIC_X 0x05 |
| 3571 | #define DISC_555_OUT_COUNT_F_X 0x06 |
| 3572 | #define DISC_555_OUT_COUNT_R_X 0x07 |
| 3550 | 3573 | |
| 3551 | | #define DISC_555_OUT_MASK 0x07 /* Bits that define output type. |
| 3574 | #define DISC_555_OUT_MASK 0x07 /* Bits that define output type. |
| 3552 | 3575 | * Used only internally in module. */ |
| 3553 | 3576 | |
| 3554 | 3577 | #define DISC_555_ASTABLE_HAS_FAST_CHARGE_DIODE 0x80 |
| r5891 | r5892 | |
| 3556 | 3579 | #define DISCRETE_555_CC_TO_CAP 0x80 |
| 3557 | 3580 | |
| 3558 | 3581 | /* 566 output flags */ |
| 3559 | | #define DISC_566_OUT_DC 0x00 |
| 3560 | | #define DISC_566_OUT_AC 0x01 |
| 3582 | #define DISC_566_OUT_DC 0x00 |
| 3583 | #define DISC_566_OUT_AC 0x01 |
| 3561 | 3584 | |
| 3562 | | #define DISC_566_OUT_SQUARE 0x00 /* Squarewave */ |
| 3563 | | #define DISC_566_OUT_TRIANGLE 0x10 /* Triangle waveform */ |
| 3564 | | #define DISC_566_OUT_LOGIC 0x20 /* 0/1 logic output */ |
| 3585 | #define DISC_566_OUT_SQUARE 0x00 /* Squarewave */ |
| 3586 | #define DISC_566_OUT_TRIANGLE 0x10 /* Triangle waveform */ |
| 3587 | #define DISC_566_OUT_LOGIC 0x20 /* 0/1 logic output */ |
| 3565 | 3588 | |
| 3566 | | #define DISC_566_OUT_MASK 0x30 /* Bits that define output type. |
| 3567 | | * Used only internally in module. */ |
| 3589 | #define DISC_566_OUT_MASK 0x30 /* Bits that define output type. |
| 3590 | * Used only internally in module. */ |
| 3568 | 3591 | #define DEFAULT_566_CHARGE -1 |
| 3569 | 3592 | |
| 3570 | 3593 | /* LS624 output flags */ |
| 3571 | | #define DISC_LS624_OUT_ENERGY 0x01 |
| 3572 | | #define DISC_LS624_OUT_LOGIC 0x02 |
| 3573 | | #define DISC_LS624_OUT_COUNT_F 0x03 |
| 3574 | | #define DISC_LS624_OUT_COUNT_R 0x04 |
| 3594 | #define DISC_LS624_OUT_ENERGY 0x01 |
| 3595 | #define DISC_LS624_OUT_LOGIC 0x02 |
| 3596 | #define DISC_LS624_OUT_COUNT_F 0x03 |
| 3597 | #define DISC_LS624_OUT_COUNT_R 0x04 |
| 3575 | 3598 | |
| 3576 | 3599 | /* Oneshot types */ |
| 3577 | | #define DISC_ONESHOT_FEDGE 0x00 |
| 3578 | | #define DISC_ONESHOT_REDGE 0x01 |
| 3600 | #define DISC_ONESHOT_FEDGE 0x00 |
| 3601 | #define DISC_ONESHOT_REDGE 0x01 |
| 3579 | 3602 | |
| 3580 | | #define DISC_ONESHOT_NORETRIG 0x00 |
| 3581 | | #define DISC_ONESHOT_RETRIG 0x02 |
| 3603 | #define DISC_ONESHOT_NORETRIG 0x00 |
| 3604 | #define DISC_ONESHOT_RETRIG 0x02 |
| 3582 | 3605 | |
| 3583 | | #define DISC_OUT_ACTIVE_LOW 0x04 |
| 3584 | | #define DISC_OUT_ACTIVE_HIGH 0x00 |
| 3606 | #define DISC_OUT_ACTIVE_LOW 0x04 |
| 3607 | #define DISC_OUT_ACTIVE_HIGH 0x00 |
| 3585 | 3608 | |
| 3586 | | #define DISC_CD4066_THRESHOLD 2.75 |
| 3609 | #define DISC_CD4066_THRESHOLD 2.75 |
| 3587 | 3610 | |
| 3588 | 3611 | /* Integrate */ |
| 3589 | 3612 | |
| 3590 | | #define DISC_RC_INTEGRATE_TYPE1 0x00 |
| 3591 | | #define DISC_RC_INTEGRATE_TYPE2 0x01 |
| 3592 | | #define DISC_RC_INTEGRATE_TYPE3 0x02 |
| 3613 | #define DISC_RC_INTEGRATE_TYPE1 0x00 |
| 3614 | #define DISC_RC_INTEGRATE_TYPE2 0x01 |
| 3615 | #define DISC_RC_INTEGRATE_TYPE3 0x02 |
| 3593 | 3616 | |
| 3594 | 3617 | /************************************* |
| 3595 | 3618 | * |
| r5891 | r5892 | |
| 3641 | 3664 | |
| 3642 | 3665 | struct _node_description |
| 3643 | 3666 | { |
| 3644 | | double output[DISCRETE_MAX_OUTPUTS]; /* The node's last output value */ |
| 3667 | double output[DISCRETE_MAX_OUTPUTS]; /* The node's last output value */ |
| 3645 | 3668 | |
| 3646 | | int active_inputs; /* Number of active inputs on this node type */ |
| 3647 | | int input_is_node; /* Bit Flags. 1 in bit location means input_is_node */ |
| 3648 | | const double * input[DISCRETE_MAX_INPUTS]; /* Addresses of Input values */ |
| 3669 | int active_inputs; /* Number of active inputs on this node type */ |
| 3670 | int input_is_node; /* Bit Flags. 1 in bit location means input_is_node */ |
| 3671 | const double * input[DISCRETE_MAX_INPUTS]; /* Addresses of Input values */ |
| 3649 | 3672 | |
| 3650 | | void * context; /* Contextual information specific to this node type */ |
| 3651 | | const void * custom; /* Custom function specific initialisation data */ |
| 3673 | void * context; /* Contextual information specific to this node type */ |
| 3674 | const void * custom; /* Custom function specific initialisation data */ |
| 3652 | 3675 | |
| 3653 | | const discrete_module *module; /* Node's module info */ |
| 3654 | | const discrete_sound_block *block; /* Points to the node's setup block. */ |
| 3655 | | const discrete_info *info; /* Points to the parent */ |
| 3676 | const discrete_module *module; /* Node's module info */ |
| 3677 | const discrete_sound_block *block; /* Points to the node's setup block. */ |
| 3678 | const discrete_info *info; /* Points to the parent */ |
| 3656 | 3679 | |
| 3657 | | osd_ticks_t run_time; |
| 3680 | osd_ticks_t run_time; |
| 3658 | 3681 | }; |
| 3659 | 3682 | |
| 3660 | 3683 | |
| r5891 | r5892 | |
| 3671 | 3694 | typedef struct _linked_list_entry linked_list_entry; |
| 3672 | 3695 | struct _linked_list_entry |
| 3673 | 3696 | { |
| 3674 | | const void *ptr; |
| 3675 | | linked_list_entry *next; |
| 3697 | const void *ptr; |
| 3698 | linked_list_entry *next; |
| 3676 | 3699 | }; |
| 3677 | 3700 | |
| 3678 | 3701 | typedef struct _discrete_task_context discrete_task_context; |
| r5891 | r5892 | |
| 3693 | 3716 | const device_config *device; |
| 3694 | 3717 | |
| 3695 | 3718 | /* emulation info */ |
| 3696 | | int sample_rate; |
| 3697 | | double sample_time; |
| 3698 | | double neg_sample_time; |
| 3719 | int sample_rate; |
| 3720 | double sample_time; |
| 3721 | double neg_sample_time; |
| 3699 | 3722 | |
| 3700 | 3723 | /* internal node tracking */ |
| 3701 | 3724 | node_description **indexed_node; |
| r5891 | r5892 | |
| 3719 | 3742 | linked_list_entry *output_list; |
| 3720 | 3743 | |
| 3721 | 3744 | /* the output stream */ |
| 3722 | | sound_stream *discrete_stream; |
| 3745 | sound_stream *discrete_stream; |
| 3723 | 3746 | |
| 3724 | 3747 | /* debugging statistics */ |
| 3725 | | FILE *disclogfile; |
| 3748 | FILE *disclogfile; |
| 3726 | 3749 | |
| 3727 | 3750 | /* parallel tasks */ |
| 3728 | | osd_work_queue *queue; |
| 3751 | osd_work_queue *queue; |
| 3729 | 3752 | |
| 3730 | 3753 | /* profiling */ |
| 3731 | | UINT64 total_samples; |
| 3732 | | UINT64 total_stream_updates; |
| 3754 | UINT64 total_samples; |
| 3755 | UINT64 total_stream_updates; |
| 3733 | 3756 | }; |
| 3734 | 3757 | |
| 3735 | 3758 | |
| r5891 | r5892 | |
| 4159 | 4182 | DST_LOGIC_NXOR, |
| 4160 | 4183 | DST_LOGIC_DFF, |
| 4161 | 4184 | DST_LOGIC_JKFF, |
| 4185 | DST_LOGIC_SHIFT, |
| 4162 | 4186 | DST_LOOKUP_TABLE, /* return value from lookup table */ |
| 4163 | 4187 | DST_MULTIPLEX, /* 1 of x multiplexer */ |
| 4164 | 4188 | DST_ONESHOT, /* One-shot pulse generator */ |
| r5891 | r5892 | |
| 4296 | 4320 | #define DISCRETE_ADDER4(NODE,ENAB,INP0,INP1,INP2,INP3) { NODE, DST_ADDER , 5, { ENAB,INP0,INP1,INP2,INP3 }, { ENAB,INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_ADDER4" }, |
| 4297 | 4321 | #define DISCRETE_CLAMP(NODE,ENAB,INP0,MIN,MAX,CLAMP) { NODE, DST_CLAMP , 5, { ENAB,INP0,MIN,MAX,CLAMP }, { ENAB,INP0,MIN,MAX,CLAMP }, NULL, "DISCRETE_CLAMP" }, |
| 4298 | 4322 | #define DISCRETE_DIVIDE(NODE,ENAB,INP0,INP1) { NODE, DST_DIVIDE , 3, { ENAB,INP0,INP1 }, { ENAB,INP0,INP1 }, NULL, "DISCRETE_DIVIDE" }, |
| 4299 | | #define DISCRETE_GAIN(NODE,INP0,GAIN) { NODE, DST_GAIN , 4, { NODE_NC,INP0,NODE_NC,NODE_NC }, { 1,INP0,GAIN,0 }, NULL, "DISCRETE_GAIN" }, |
| 4300 | | #define DISCRETE_INVERT(NODE,INP0) { NODE, DST_GAIN , 4, { NODE_NC,INP0,NODE_NC,NODE_NC }, { 1,INP0,-1,0 }, NULL, "DISCRETE_INVERT" }, |
| 4301 | | #define DISCRETE_LOGIC_INVERT(NODE,ENAB,INP0) { NODE, DST_LOGIC_INV , 2, { ENAB,INP0 }, { ENAB,INP0 }, NULL, "DISCRETE_LOGIC_INVERT" }, |
| 4323 | #define DISCRETE_GAIN(NODE,INP0,GAIN) { NODE, DST_GAIN , 3, { INP0,NODE_NC,NODE_NC }, { INP0,GAIN,0 }, NULL, "DISCRETE_GAIN" }, |
| 4324 | #define DISCRETE_INVERT(NODE,INP0) { NODE, DST_GAIN , 3, { INP0,NODE_NC,NODE_NC }, { INP0,-1,0 }, NULL, "DISCRETE_INVERT" }, |
| 4325 | #define DISCRETE_LOGIC_INVERT(NODE,INP0) { NODE, DST_LOGIC_INV , 1, { INP0 }, { INP0 }, NULL, "DISCRETE_LOGIC_INVERT" }, |
| 4302 | 4326 | |
| 4303 | 4327 | #define DISCRETE_BIT_DECODE(NODE, INP, BIT_N, VOUT) { NODE, DST_BITS_DECODE , 3, { INP,NODE_NC,NODE_NC,NODE_NC }, { INP,BIT_N,BIT_N, VOUT }, NULL, "DISCRETE_BIT_DECODE" }, |
| 4304 | 4328 | #define DISCRETE_BITS_DECODE(NODE, INP, BIT_FROM, BIT_TO, VOUT) { NODE, DST_BITS_DECODE , 4, { INP,NODE_NC,NODE_NC,NODE_NC }, { INP,BIT_FROM,BIT_TO, VOUT }, NULL, "DISCRETE_BITS_DECODE" }, |
| 4305 | 4329 | |
| 4306 | | #define DISCRETE_LOGIC_AND(NODE,ENAB,INP0,INP1) { NODE, DST_LOGIC_AND , 5, { ENAB,INP0,INP1,NODE_NC,NODE_NC }, { ENAB,INP0,INP1,1.0,1.0 }, NULL, "DISCRETE_LOGIC_AND" }, |
| 4307 | | #define DISCRETE_LOGIC_AND3(NODE,ENAB,INP0,INP1,INP2) { NODE, DST_LOGIC_AND , 5, { ENAB,INP0,INP1,INP2,NODE_NC }, { ENAB,INP0,INP1,INP2,1.0 }, NULL, "DISCRETE_LOGIC_AND3" }, |
| 4308 | | #define DISCRETE_LOGIC_AND4(NODE,ENAB,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_AND , 5, { ENAB,INP0,INP1,INP2,INP3 }, { ENAB,INP0,INP1,INP2,INP3 } ,NULL, "DISCRETE_LOGIC_AND4" }, |
| 4309 | | #define DISCRETE_LOGIC_NAND(NODE,ENAB,INP0,INP1) { NODE, DST_LOGIC_NAND , 5, { ENAB,INP0,INP1,NODE_NC,NODE_NC }, { ENAB,INP0,INP1,1.0,1.0 }, NULL, "DISCRETE_LOGIC_NAND" }, |
| 4310 | | #define DISCRETE_LOGIC_NAND3(NODE,ENAB,INP0,INP1,INP2) { NODE, DST_LOGIC_NAND , 5, { ENAB,INP0,INP1,INP2,NODE_NC }, { ENAB,INP0,INP1,INP2,1.0 }, NULL, "DISCRETE_LOGIC_NAND3" }, |
| 4311 | | #define DISCRETE_LOGIC_NAND4(NODE,ENAB,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_NAND , 5, { ENAB,INP0,INP1,INP2,INP3 }, { ENAB,INP0,INP1,INP2,INP3 }, NULL, ")DISCRETE_LOGIC_NAND4" }, |
| 4312 | | #define DISCRETE_LOGIC_OR(NODE,ENAB,INP0,INP1) { NODE, DST_LOGIC_OR , 5, { ENAB,INP0,INP1,NODE_NC,NODE_NC }, { ENAB,INP0,INP1,0.0,0.0 }, NULL, "DISCRETE_LOGIC_OR" }, |
| 4313 | | #define DISCRETE_LOGIC_OR3(NODE,ENAB,INP0,INP1,INP2) { NODE, DST_LOGIC_OR , 5, { ENAB,INP0,INP1,INP2,NODE_NC }, { ENAB,INP0,INP1,INP2,0.0 }, NULL, "DISCRETE_LOGIC_OR3" }, |
| 4314 | | #define DISCRETE_LOGIC_OR4(NODE,ENAB,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_OR , 5, { ENAB,INP0,INP1,INP2,INP3 }, { ENAB,INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_LOGIC_OR4" }, |
| 4315 | | #define DISCRETE_LOGIC_NOR(NODE,ENAB,INP0,INP1) { NODE, DST_LOGIC_NOR , 5, { ENAB,INP0,INP1,NODE_NC,NODE_NC }, { ENAB,INP0,INP1,0.0,0.0 }, NULL, "DISCRETE_LOGIC_NOR" }, |
| 4316 | | #define DISCRETE_LOGIC_NOR3(NODE,ENAB,INP0,INP1,INP2) { NODE, DST_LOGIC_NOR , 5, { ENAB,INP0,INP1,INP2,NODE_NC }, { ENAB,INP0,INP1,INP2,0.0 }, NULL, "DISCRETE_LOGIC_NOR3" }, |
| 4317 | | #define DISCRETE_LOGIC_NOR4(NODE,ENAB,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_NOR , 5, { ENAB,INP0,INP1,INP2,INP3 }, { ENAB,INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_LOGIC_NOR4" }, |
| 4318 | | #define DISCRETE_LOGIC_XOR(NODE,ENAB,INP0,INP1) { NODE, DST_LOGIC_XOR , 3, { ENAB,INP0,INP1 }, { ENAB,INP0,INP1 }, NULL, "DISCRETE_LOGIC_XOR" }, |
| 4319 | | #define DISCRETE_LOGIC_NXOR(NODE,ENAB,INP0,INP1) { NODE, DST_LOGIC_NXOR , 3, { ENAB,INP0,INP1 }, { ENAB,INP0,INP1 }, NULL, "DISCRETE_LOGIC_NXOR" }, |
| 4320 | | #define DISCRETE_LOGIC_DFLIPFLOP(NODE,ENAB,RESET,SET,CLK,INP) { NODE, DST_LOGIC_DFF , 5, { ENAB,RESET,SET,CLK,INP }, { ENAB,RESET,SET,CLK,INP }, NULL, "DISCRETE_LOGIC_DFLIPFLOP" }, |
| 4321 | | #define DISCRETE_LOGIC_JKFLIPFLOP(NODE,ENAB,RESET,SET,CLK,J,K) { NODE, DST_LOGIC_JKFF , 6, { ENAB,RESET,SET,CLK,J,K }, { ENAB,RESET,SET,CLK,J,K }, NULL, "DISCRETE_LOGIC_JKFLIPFLOP" }, |
| 4322 | | #define DISCRETE_LOOKUP_TABLE(NODE,ENAB,ADDR,SIZE,TABLE) { NODE, DST_LOOKUP_TABLE, 3, { ENAB,ADDR,NODE_NC }, { ENAB,ADDR,SIZE }, TABLE, "DISCRETE_LOOKUP_TABLE" }, |
| 4323 | | #define DISCRETE_MULTIPLEX2(NODE,ENAB,ADDR,INP0,INP1) { NODE, DST_MULTIPLEX , 4, { ENAB,ADDR,INP0,INP1 }, { ENAB,ADDR,INP0,INP1 }, NULL, "DISCRETE_MULTIPLEX2" }, |
| 4324 | | #define DISCRETE_MULTIPLEX4(NODE,ENAB,ADDR,INP0,INP1,INP2,INP3) { NODE, DST_MULTIPLEX , 6, { ENAB,ADDR,INP0,INP1,INP2,INP3 }, { ENAB,ADDR,INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_MULTIPLEX4" }, |
| 4325 | | #define DISCRETE_MULTIPLEX8(NODE,ENAB,ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7) { NODE, DST_MULTIPLEX, 10, { ENAB,ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7 }, { ENAB,ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7 }, NULL, "DISCRETE_MULTIPLEX8" }, |
| 4326 | | #define DISCRETE_MULTIPLY(NODE,ENAB,INP0,INP1) { NODE, DST_GAIN , 4, { ENAB,INP0,INP1,NODE_NC }, { ENAB,INP0,INP1,0 }, NULL, "DISCRETE_MULTIPLY" }, |
| 4327 | | #define DISCRETE_MULTADD(NODE,ENAB,INP0,INP1,INP2) { NODE, DST_GAIN , 4, { ENAB,INP0,INP1,INP2 }, { ENAB,INP0,INP1,INP2 }, NULL, "DISCRETE_MULTADD" }, |
| 4330 | #define DISCRETE_LOGIC_AND(NODE,INP0,INP1) { NODE, DST_LOGIC_AND , 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,1.0,1.0 }, NULL, "DISCRETE_LOGIC_AND" }, |
| 4331 | #define DISCRETE_LOGIC_AND3(NODE,INP0,INP1,INP2) { NODE, DST_LOGIC_AND , 4, { INP0,INP1,INP2,NODE_NC }, { INP0,INP1,INP2,1.0 }, NULL, "DISCRETE_LOGIC_AND3" }, |
| 4332 | #define DISCRETE_LOGIC_AND4(NODE,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_AND , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 } ,NULL, "DISCRETE_LOGIC_AND4" }, |
| 4333 | #define DISCRETE_LOGIC_NAND(NODE,INP0,INP1) { NODE, DST_LOGIC_NAND , 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,1.0,1.0 }, NULL, "DISCRETE_LOGIC_NAND" }, |
| 4334 | #define DISCRETE_LOGIC_NAND3(NODE,INP0,INP1,INP2) { NODE, DST_LOGIC_NAND , 4, { INP0,INP1,INP2,NODE_NC }, { INP0,INP1,INP2,1.0 }, NULL, "DISCRETE_LOGIC_NAND3" }, |
| 4335 | #define DISCRETE_LOGIC_NAND4(NODE,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_NAND , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 }, NULL, ")DISCRETE_LOGIC_NAND4" }, |
| 4336 | #define DISCRETE_LOGIC_OR(NODE,INP0,INP1) { NODE, DST_LOGIC_OR , 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,0.0,0.0 }, NULL, "DISCRETE_LOGIC_OR" }, |
| 4337 | #define DISCRETE_LOGIC_OR3(NODE,INP0,INP1,INP2) { NODE, DST_LOGIC_OR , 4, { INP0,INP1,INP2,NODE_NC }, { INP0,INP1,INP2,0.0 }, NULL, "DISCRETE_LOGIC_OR3" }, |
| 4338 | #define DISCRETE_LOGIC_OR4(NODE,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_OR , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_LOGIC_OR4" }, |
| 4339 | #define DISCRETE_LOGIC_NOR(NODE,INP0,INP1) { NODE, DST_LOGIC_NOR , 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,0.0,0.0 }, NULL, "DISCRETE_LOGIC_NOR" }, |
| 4340 | #define DISCRETE_LOGIC_NOR3(NODE,INP0,INP1,INP2) { NODE, DST_LOGIC_NOR , 4, { INP0,INP1,INP2,NODE_NC }, { INP0,INP1,INP2,0.0 }, NULL, "DISCRETE_LOGIC_NOR3" }, |
| 4341 | #define DISCRETE_LOGIC_NOR4(NODE,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_NOR , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_LOGIC_NOR4" }, |
| 4342 | #define DISCRETE_LOGIC_XOR(NODE,INP0,INP1) { NODE, DST_LOGIC_XOR , 2, { INP0,INP1 }, { INP0,INP1 }, NULL, "DISCRETE_LOGIC_XOR" }, |
| 4343 | #define DISCRETE_LOGIC_NXOR(NODE,INP0,INP1) { NODE, DST_LOGIC_NXOR , 2, { INP0,INP1 }, { INP0,INP1 }, NULL, "DISCRETE_LOGIC_NXOR" }, |
| 4344 | #define DISCRETE_LOGIC_DFLIPFLOP(NODE,RESET,SET,CLK,INP) { NODE, DST_LOGIC_DFF , 4, { RESET,SET,CLK,INP }, { RESET,SET,CLK,INP }, NULL, "DISCRETE_LOGIC_DFLIPFLOP" }, |
| 4345 | #define DISCRETE_LOGIC_JKFLIPFLOP(NODE,RESET,SET,CLK,J,K) { NODE, DST_LOGIC_JKFF , 5, { RESET,SET,CLK,J,K }, { RESET,SET,CLK,J,K }, NULL, "DISCRETE_LOGIC_JKFLIPFLOP" }, |
| 4346 | #define DISCRETE_LOGIC_SHIFT(NODE,INP0,RESET,CLK,SIZE,OPTIONS) { NODE, DST_LOGIC_SHIFT , 5, { INP0,RESET,CLK,NODE_NC,NODE_NC }, { INP0,RESET,CLK,SIZE,OPTIONS }, NULL, "DISCRETE_LOGIC_SHIFT" }, |
| 4347 | #define DISCRETE_LOOKUP_TABLE(NODE,ADDR,SIZE,TABLE) { NODE, DST_LOOKUP_TABLE, 2, { ADDR,NODE_NC }, { ADDR,SIZE }, TABLE, "DISCRETE_LOOKUP_TABLE" }, |
| 4348 | #define DISCRETE_MULTIPLEX2(NODE,ADDR,INP0,INP1) { NODE, DST_MULTIPLEX , 3, { ADDR,INP0,INP1 }, { ADDR,INP0,INP1 }, NULL, "DISCRETE_MULTIPLEX2" }, |
| 4349 | #define DISCRETE_MULTIPLEX4(NODE,ADDR,INP0,INP1,INP2,INP3) { NODE, DST_MULTIPLEX , 5, { ADDR,INP0,INP1,INP2,INP3 }, { ADDR,INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_MULTIPLEX4" }, |
| 4350 | #define DISCRETE_MULTIPLEX8(NODE,ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7) { NODE, DST_MULTIPLEX, 9, { ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7 }, { ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7 }, NULL, "DISCRETE_MULTIPLEX8" }, |
| 4351 | #define DISCRETE_MULTIPLY(NODE,INP0,INP1) { NODE, DST_GAIN , 3, { INP0,INP1,NODE_NC }, { INP0,INP1,0 }, NULL, "DISCRETE_MULTIPLY" }, |
| 4352 | #define DISCRETE_MULTADD(NODE,INP0,INP1,INP2) { NODE, DST_GAIN , 3, { INP0,INP1,INP2 }, { INP0,INP1,INP2 }, NULL, "DISCRETE_MULTADD" }, |
| 4328 | 4353 | #define DISCRETE_ONESHOT(NODE,TRIG,AMPL,WIDTH,TYPE) { NODE, DST_ONESHOT , 5, { NODE_NC,TRIG,AMPL,WIDTH,NODE_NC }, { 0,TRIG,AMPL,WIDTH,TYPE }, NULL, "DISCRETE_ONESHOT" }, |
| 4329 | 4354 | #define DISCRETE_ONESHOTR(NODE,RESET,TRIG,AMPL,WIDTH,TYPE) { NODE, DST_ONESHOT , 5, { RESET,TRIG,AMPL,WIDTH,NODE_NC }, { RESET,TRIG,AMPL,WIDTH,TYPE }, NULL, "One Shot Resetable" }, |
| 4330 | | #define DISCRETE_ONOFF(NODE,ENAB,INP0) { NODE, DST_GAIN , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,0,1,0 }, NULL, "DISCRETE_ONOFF" }, |
| 4355 | #define DISCRETE_ONOFF(NODE,ENAB,INP0) { NODE, DST_GAIN , 3, { ENAB,INP0,NODE_NC }, { 0,1,0 }, NULL, "DISCRETE_ONOFF" }, |
| 4331 | 4356 | #define DISCRETE_RAMP(NODE,ENAB,RAMP,GRAD,START,END,CLAMP) { NODE, DST_RAMP , 6, { ENAB,RAMP,GRAD,START,END,CLAMP }, { ENAB,RAMP,GRAD,START,END,CLAMP }, NULL, "DISCRETE_RAMP" }, |
| 4332 | | #define DISCRETE_SAMPLHOLD(NODE,ENAB,INP0,CLOCK,CLKTYPE) { NODE, DST_SAMPHOLD , 4, { ENAB,INP0,CLOCK,NODE_NC }, { ENAB,INP0,CLOCK,CLKTYPE }, NULL, "DISCRETE_SAMPLHOLD" }, |
| 4357 | #define DISCRETE_SAMPLHOLD(NODE,INP0,CLOCK,CLKTYPE) { NODE, DST_SAMPHOLD , 3, { INP0,CLOCK,NODE_NC }, { INP0,CLOCK,CLKTYPE }, NULL, "DISCRETE_SAMPLHOLD" }, |
| 4333 | 4358 | #define DISCRETE_SWITCH(NODE,ENAB,SWITCH,INP0,INP1) { NODE, DST_SWITCH , 4, { ENAB,SWITCH,INP0,INP1 }, { ENAB,SWITCH,INP0,INP1 }, NULL, "DISCRETE_SWITCH" }, |
| 4334 | | #define DISCRETE_ASWITCH(NODE,ENAB,CTRL,INP,THRESHOLD) { NODE, DST_ASWITCH , 3, { ENAB,CTRL,INP,THRESHOLD }, { ENAB,CTRL,INP, THRESHOLD}, NULL, "Analog Switch" }, |
| 4359 | #define DISCRETE_ASWITCH(NODE,CTRL,INP,THRESHOLD) { NODE, DST_ASWITCH , 3, { CTRL,INP,THRESHOLD }, { CTRL,INP, THRESHOLD}, NULL, "Analog Switch" }, |
| 4335 | 4360 | #define DISCRETE_TRANSFORM2(NODE,INP0,INP1,FUNCT) { NODE, DST_TRANSFORM , 2, { INP0,INP1 }, { INP0,INP1 }, FUNCT, "DISCRETE_TRANSFORM2" }, |
| 4336 | 4361 | #define DISCRETE_TRANSFORM3(NODE,INP0,INP1,INP2,FUNCT) { NODE, DST_TRANSFORM , 3, { INP0,INP1,INP2 }, { INP0,INP1,INP2 }, FUNCT, "DISCRETE_TRANSFORM3" }, |
| 4337 | 4362 | #define DISCRETE_TRANSFORM4(NODE,INP0,INP1,INP2,INP3,FUNCT) { NODE, DST_TRANSFORM , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 }, FUNCT, "DISCRETE_TRANSFORM4" }, |
| 4338 | 4363 | #define DISCRETE_TRANSFORM5(NODE,INP0,INP1,INP2,INP3,INP4,FUNCT) { NODE, DST_TRANSFORM , 5, { INP0,INP1,INP2,INP3,INP4 }, { INP0,INP1,INP2,INP3,INP4 }, FUNCT, "DISCRETE_TRANSFORM5" }, |
| 4339 | 4364 | /* Component specific */ |
| 4340 | 4365 | #define DISCRETE_COMP_ADDER(NODE,DATA,TABLE) { NODE, DST_COMP_ADDER , 1, { DATA }, { DATA }, TABLE, "DISCRETE_COMP_ADDER" }, |
| 4341 | | #define DISCRETE_DAC_R1(NODE,ENAB,DATA,VDATA,LADDER) { NODE, DST_DAC_R1 , 3, { ENAB,DATA,VDATA }, { ENAB,DATA,VDATA }, LADDER, "DISCRETE_DAC_R1" }, |
| 4366 | #define DISCRETE_DAC_R1(NODE,DATA,VDATA,LADDER) { NODE, DST_DAC_R1 , 2, { DATA,VDATA }, { DATA,VDATA }, LADDER, "DISCRETE_DAC_R1" }, |
| 4342 | 4367 | #define DISCRETE_DIODE_MIXER2(NODE,IN0,IN1,TABLE) { NODE, DST_DIODE_MIX , 3, { IN0,IN1 }, { IN0,IN1 }, TABLE, "DISCRETE_DIODE_MIXER2" }, |
| 4343 | 4368 | #define DISCRETE_DIODE_MIXER3(NODE,IN0,IN1,IN2,TABLE) { NODE, DST_DIODE_MIX , 4, { IN0,IN1,IN2 }, { IN0,IN1,IN2 }, TABLE, "DISCRETE_DIODE_MIXER3" }, |
| 4344 | 4369 | #define DISCRETE_DIODE_MIXER4(NODE,IN0,IN1,IN2,IN3,TABLE) { NODE, DST_DIODE_MIX , 5, { IN0,IN1,IN2,IN3 }, { IN0,IN1,IN2,IN3 }, TABLE, "DISCRETE_DIODE_MIXER4" }, |
| r5891 | r5892 | |
| 4397 | 4422 | #define DISCRETE_555_CC(NODE,RESET,VIN,R,C,RBIAS,RGND,RDIS,OPTIONS) { NODE, DSD_555_CC , 7, { RESET,VIN,R,C,RBIAS,RGND,RDIS }, { RESET,VIN,R,C,RBIAS,RGND,RDIS }, OPTIONS, "DISCRETE_555_CC" }, |
| 4398 | 4423 | #define DISCRETE_555_VCO1(NODE,RESET,VIN,OPTIONS) { NODE, DSD_555_VCO1 , 3, { RESET,VIN,NODE_NC }, { RESET,VIN,-1 }, OPTIONS, "DISCRETE_555_VCO1" }, |
| 4399 | 4424 | #define DISCRETE_555_VCO1_CV(NODE,RESET,VIN,CTRLV,OPTIONS) { NODE, DSD_555_VCO1 , 3, { RESET,VIN,CTRLV }, { RESET,VIN,CTRLV }, OPTIONS, "DISCRETE_555_VCO1_CV" }, |
| 4400 | | #define DISCRETE_566(NODE,ENAB,VMOD,R,C,OPTIONS) { NODE, DSD_566 , 4, { ENAB,VMOD,R,C }, { ENAB,VMOD,R,C }, OPTIONS, "DISCRETE_566" }, |
| 4401 | | #define DISCRETE_74LS624(NODE,ENAB,VMOD,VRNG,C,OUTTYPE) { NODE, DSD_LS624 , 5, { ENAB,VMOD,VRNG,C,NODE_NC }, { ENAB,VMOD,VRNG,C, OUTTYPE }, NULL, "DISCRETE_74LS624" }, |
| 4425 | #define DISCRETE_566(NODE,VMOD,R,C,OPTIONS) { NODE, DSD_566 , 3, { VMOD,R,C }, { VMOD,R,C }, OPTIONS, "DISCRETE_566" }, |
| 4426 | #define DISCRETE_74LS624(NODE,VMOD,VRNG,C,OUTTYPE) { NODE, DSD_LS624 , 4, { VMOD,NODE_NC,NODE_NC,NODE_NC }, { VMOD,VRNG,C,OUTTYPE }, NULL, "DISCRETE_74LS624" }, |
| 4402 | 4427 | |
| 4403 | 4428 | /* NOP */ |
| 4404 | 4429 | #define DISCRETE_NOP(NODE) { NODE, DSS_NOP , 0, { 0 }, { 0 }, NULL, "DISCRETE_NOP" }, |
| r5891 | r5892 | |
| 4424 | 4449 | //#define DISCRETE_TASK_SYNC() { NODE_SPECIAL, DSO_TASK_SYNC, 0, { 0 }, { 0 }, NULL, "DISCRETE_TASK_SYNC" }, |
| 4425 | 4450 | |
| 4426 | 4451 | /* output */ |
| 4427 | | #define DISCRETE_OUTPUT(OPNODE,GAIN) { NODE_SPECIAL, DSO_OUTPUT , 2, { OPNODE,NODE_NC }, { 0,GAIN }, NULL, "DISCRETE_OUTPUT" }, |
| 4452 | #define DISCRETE_OUTPUT(OPNODE,GAIN) { NODE_SPECIAL, DSO_OUTPUT , 2, { OPNODE,NODE_NC }, { 0,GAIN }, NULL, "DISCRETE_OUTPUT" }, |
| 4428 | 4453 | |
| 4429 | 4454 | |
| 4430 | 4455 | /************************************* |
src/emu/sound/tms5220.c
| r5891 | r5892 | |
| 38 | 38 | Note the standard naming for d* data bits with 7 as MSB and 0 as LSB is in lowercase. |
| 39 | 39 | TI's naming has D7 as LSB and D0 as MSB and is in uppercase |
| 40 | 40 | |
| 41 | TODO: |
| 42 | Implement a ready callback for pc interfaces |
| 43 | - this will be quite a challenge since for it to be really accurate |
| 44 | the whole emulation has to run in sync (lots of timers) with the |
| 45 | cpu cores. |
| 46 | If a command is still executing, /READY will be kept high until the command has |
| 47 | finished if the next command is written. |
| 48 | TMS5220C: see below. |
| 49 | tomcat has a 5220 which is not hooked up at all |
| 50 | |
| 51 | Notes: |
| 52 | Looping has the tms5220 hookep up directly to the cpu. However currently the |
| 53 | tms9900 cpu core does not support a ready line. |
| 54 | |
| 55 | Email from Lord Nightmare having a lot more detail follows: |
| 56 | |
| 57 | Yes, there is at least two more differences: |
| 58 | The 5220 is 'noisier' when playing unvoiced frames than the 5220C is; I |
| 59 | think the 5220C may use a different energy table (or use one value lower |
| 60 | in the normal energy table) than the 5220 does, possibly only when |
| 61 | playing unvoiced frames, but I can't prove this without a decap; the |
| 62 | 5220C's PROMOUT pin (for dumping the lpc tables as played) is |
| 63 | nonfunctional due to changed design or a die bug. |
| 64 | In addition, the NOP commands on the FIFO interface have been changed |
| 65 | and data passed in the low bits has a meaning regarding frame length: |
| 66 | commands : |
| 67 | (lsb is right, msb is left; x means don't care) |
| 68 | x0x0xbcc : (5220: NOP) (5220C: select frame length by cc, and b selects |
| 69 | whether every frame is preceeded by 2 bits to select the frame length |
| 70 | (instead of using the value set by cc)) (default is 00 for frame length |
| 71 | (200 samples) and 0 for whether the preceeding 2 bits are enabled (off)) |
| 72 | x001xxxx: sends eight read bit commands (M0 high M1 low) to VSM and |
| 73 | reads the resulting bits serially into a temporary register, which |
| 74 | becomes readable as the next byte read from the tms52xx once ready goes |
| 75 | active. |
| 76 | |
| 77 | Note the bit order of the byte read from the TMS52xx is BACKWARDS as |
| 78 | compared to the actual data order as in the rom on the VSM chips! This |
| 79 | was IMHO a rather silly design decision of TI. (I asked Larry |
| 80 | Brantingham about this but he wasn't involved with the TMS52xx chips, |
| 81 | just the 5100) |
| 82 | There's ASCII data in the TI 99/4 speech module VSMs which has the bit |
| 83 | order reversed on purpose because of this! |
| 84 | |
| 85 | x011xxxx: sends a read and branch command (M0 high, M1 high) to force |
| 86 | VSM to set its data pointer to whatever the data is at its current |
| 87 | pointer location is) |
| 88 | x100aaaa: send a load address command (M0 low M1 high) to vsm with the 4 |
| 89 | 'a' bits |
| 90 | x101xxxx: 'speak' begins speaking from current address in the data |
| 91 | pointer of the vsms |
| 92 | x110xxxx: 'speak external' begins speaking from the 16 byte fifo |
| 93 | x111xxxx: resets the speech synthesis core immediately; clears the bit |
| 94 | offset counter in the fifo to the nearest byte 'forward ', but does NOT |
| 95 | clear the fifo, annoyingly! |
| 96 | |
| 97 | Its also possible but inconclusive that the chirp table was changed. |
| 98 | The LPC tables between the 5220 and 5220C are MOSTLY the same of not |
| 99 | completely so, but as mentioned above the energy table has some sort of |
| 100 | difference. |
| 101 | |
| 102 | |
| 103 | As for which games used which chips, from the TMS5220 wikipedia page: |
| 104 | |
| 105 | TMS5200 AKA TMC0285: (1981 to 1983ish when supplies ran low) |
| 106 | Arcade: Zaccaria's 'money money' and 'jack rabbit'; Bally/Midway's |
| 107 | 'Discs of Tron' (all environmental cabs and a few upright cabs; the code |
| 108 | exists on all versions for the speech though, and upright cabs can be |
| 109 | upgraded to add it by hacking on a 'Squawk & Talk' pinball speech board |
| 110 | (which is also TMS5200 based) with a few modded components) |
| 111 | Pinball: All Bally/Midway machines which uses the 'Squawk & Talk' board. |
| 112 | Home computer: TI 99/4 PHP1500 Speech module (along with two VSM |
| 113 | serial chips); Street Electronics Corp.'s Apple II 'Echo 2' Speech |
| 114 | synthesizer (early cards only) |
| 115 | |
| 116 | TMS5220: (mostly on things made between 1982 and 1984-1985 when supplies |
| 117 | ran low) |
| 118 | Arcade: Bally/Midway's 'NFL Football'; Atari's 'Star Wars', |
| 119 | 'Firefox', 'Return of the Jedi', 'Road Runner', 'The Empire Strikes |
| 120 | Back' (all verified with schematics); Venture Line's 'Looping' and 'Sky |
| 121 | Bumper' (need verify for both); Olympia's 'Portraits' (need verify); |
| 122 | Exidy's 'Victory' and 'Victor Banana' (need verify for both) |
| 123 | Pinball: Several (don't know names offhand, have not checked schematics) |
| 124 | Home computer: Street Electronics Corp.'s Apple II 'Echo 2' Speech |
| 125 | synthesizer (later cards only); Texas Instruments' 'Speak and Learn' |
| 126 | scanner wand unit. |
| 127 | |
| 128 | TMS5220C AKA TSP5220C: (on stuff made from 1984 to 1992 or so) |
| 129 | Arcade: Atari's 'Indiana Jones and the Temple of Doom', '720', |
| 130 | 'Gauntlet', 'Gauntlet II', 'A.P.B.', 'Paperboy', 'RoadBlasters', |
| 131 | 'Vindicators Pt II'(verify?), and 'Escape from the Planet of the Robot |
| 132 | Monsters' (all verified except for vindicators pt 2) |
| 133 | Pinball: Several (less common than the tms5220? (not sure about |
| 134 | this), mostly on later pinballs with LPC speech) |
| 135 | Home computer: Street Electronics Corp.'s 'ECHO' parallel/hobbyist |
| 136 | module (6511 based), IBM PS/2 Speech adapter (parallel port connection |
| 137 | device), PES Speech adapter (serial port connection) |
| 138 | |
| 139 | |
| 41 | 140 | ***********************************************************************************************/ |
| 42 | 141 | |
| 43 | 142 | #include "sndintrf.h" |
| r5891 | r5892 | |
| 45 | 144 | #include "tms5220.h" |
| 46 | 145 | |
| 47 | 146 | |
| 48 | | #define DEBUG_5220 0 |
| 147 | #define VERBOSE (0) |
| 148 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 49 | 149 | |
| 50 | 150 | #define MAX_SAMPLE_CHUNK 512 |
| 151 | #define FIFO_SIZE 16 |
| 51 | 152 | |
| 52 | 153 | |
| 53 | 154 | enum _tms5220_variant |
| 54 | 155 | { |
| 55 | | variant_tms5220, /* TMS5220_IS_TMS5220, TMS5220_IS_TMS5220C, TMS5220_IS_TSP5220C */ |
| 156 | variant_tms5220c, /* TMS5220_IS_TMS5220C TMS5220_IS_TSP5220C */ |
| 157 | variant_tms5220, /* TMS5220_IS_TMS5220 */ |
| 56 | 158 | variant_tmc0285 /* TMS5220_IS_TMS5200, TMS5220_IS_CD2501 */ |
| 57 | 159 | }; |
| 58 | 160 | typedef enum _tms5220_variant tms5220_variant; |
| r5891 | r5892 | |
| 73 | 175 | typedef struct _tms5220_state tms5220_state; |
| 74 | 176 | struct _tms5220_state |
| 75 | 177 | { |
| 178 | /* callbacks */ |
| 179 | devcb_resolved_write_line irq_func; |
| 180 | |
| 76 | 181 | /* these contain data that describes the 128-bit data FIFO */ |
| 77 | | #define FIFO_SIZE 16 |
| 78 | 182 | UINT8 fifo[FIFO_SIZE]; |
| 79 | 183 | UINT8 fifo_head; |
| 80 | 184 | UINT8 fifo_tail; |
| r5891 | r5892 | |
| 99 | 203 | UINT8 buffer_empty; /* FIFO is empty*/ |
| 100 | 204 | UINT8 irq_pin; /* state of the IRQ pin (output) */ |
| 101 | 205 | |
| 102 | | void (*irq_func)(const device_config *device, int state); /* called when the state of the IRQ pin changes */ |
| 103 | | |
| 104 | | |
| 105 | 206 | /* these contain data describing the current and previous voice frames */ |
| 106 | 207 | UINT16 old_energy; |
| 107 | 208 | UINT16 old_pitch; |
| r5891 | r5892 | |
| 140 | 241 | UINT8 data_register; /* data register, used by read command */ |
| 141 | 242 | UINT8 RDB_flag; /* whether we should read data register or status register */ |
| 142 | 243 | |
| 244 | /* io_ready: page 3 of the datasheet specifies that READY will be asserted until |
| 245 | * data is available or processed by the system. |
| 246 | */ |
| 247 | |
| 248 | UINT8 io_ready; |
| 249 | |
| 250 | /* flag for "true" timing involving rs/ws */ |
| 251 | |
| 252 | UINT8 true_timing; |
| 253 | |
| 254 | /* rsws - state, rs bit 1, ws bit 0 */ |
| 255 | UINT8 rs_ws; |
| 256 | UINT8 read_latch; |
| 257 | UINT8 write_latch; |
| 258 | |
| 143 | 259 | /* flag for variant tmc0285/tms5200 emulation */ |
| 144 | 260 | /* The TMC0285 AKA TMS5200 is an earlier variant of the TMS5220 used in |
| 145 | 261 | the early releases of the Speech Module for the TI-99/4(a) computer, |
| r5891 | r5892 | |
| 243 | 359 | state_save_register_device_item(tms->device, 0, tms->data_register); |
| 244 | 360 | state_save_register_device_item(tms->device, 0, tms->RDB_flag); |
| 245 | 361 | state_save_register_device_item(tms->device, 0, tms->digital_select); |
| 362 | |
| 363 | state_save_register_device_item(tms->device, 0, tms->io_ready); |
| 246 | 364 | } |
| 247 | 365 | |
| 248 | 366 | |
| r5891 | r5892 | |
| 265 | 383 | if (tms->speak_external) |
| 266 | 384 | tms->buffer_empty = 0; |
| 267 | 385 | |
| 268 | | if (DEBUG_5220) logerror("Added byte to FIFO (size=%2d)\n", tms->fifo_count); |
| 386 | LOG(("Added byte to FIFO (size=%2d)\n", tms->fifo_count)); |
| 269 | 387 | } |
| 270 | 388 | else |
| 271 | 389 | { |
| 272 | | if (DEBUG_5220) logerror("Ran out of room in the FIFO!\n"); |
| 390 | LOG(("Ran out of room in the FIFO!\n")); |
| 273 | 391 | } |
| 274 | 392 | |
| 275 | 393 | /* update the buffer low state */ |
| r5891 | r5892 | |
| 317 | 435 | /* clear the interrupt pin */ |
| 318 | 436 | set_interrupt_state(tms, 0); |
| 319 | 437 | |
| 320 | | if (DEBUG_5220) logerror("Status read: TS=%d BL=%d BE=%d\n", tms->talk_status, tms->buffer_low, tms->buffer_empty); |
| 438 | LOG(("Status read: TS=%d BL=%d BE=%d\n", tms->talk_status, tms->buffer_low, tms->buffer_empty)); |
| 321 | 439 | |
| 322 | 440 | return (tms->talk_status << 7) | (tms->buffer_low << 6) | (tms->buffer_empty << 5); |
| 323 | 441 | } |
| r5891 | r5892 | |
| 333 | 451 | |
| 334 | 452 | static int tms5220_ready_read(tms5220_state *tms) |
| 335 | 453 | { |
| 336 | | return (tms->fifo_count < FIFO_SIZE-1); |
| 454 | LOG(("io_ready %d\n", tms->io_ready)); |
| 455 | return (tms->fifo_count < FIFO_SIZE-1) && tms->io_ready; |
| 337 | 456 | } |
| 338 | 457 | |
| 339 | 458 | |
| r5891 | r5892 | |
| 762 | 881 | break; |
| 763 | 882 | |
| 764 | 883 | case 0x30 : /* read and branch */ |
| 765 | | if (DEBUG_5220) logerror("read and branch command received\n"); |
| 884 | LOG(("read and branch command received\n")); |
| 766 | 885 | tms->RDB_flag = FALSE; |
| 767 | 886 | if (tms->intf->read_and_branch) |
| 768 | 887 | (*tms->intf->read_and_branch)(tms->device); |
| r5891 | r5892 | |
| 893 | 1012 | // WARNING: This code below breaks Victory's power-on test! If you change it |
| 894 | 1013 | // make sure you test Victory. |
| 895 | 1014 | // { |
| 896 | | // if (DEBUG_5220) logerror("Buffer Empty set - Last frame stop frame\n"); |
| 1015 | // LOG(("Buffer Empty set - Last frame stop frame\n"); |
| 897 | 1016 | |
| 898 | 1017 | // tms->buffer_empty = 1; |
| 899 | 1018 | // return 1; |
| r5891 | r5892 | |
| 916 | 1035 | /* if the index is 0 or 15, we're done */ |
| 917 | 1036 | if (indx == 0 || indx == 15) |
| 918 | 1037 | { |
| 919 | | if (DEBUG_5220) logerror(" (4-bit energy=%d frame)\n",tms->new_energy); |
| 1038 | LOG((" (4-bit energy=%d frame)\n",tms->new_energy)); |
| 920 | 1039 | |
| 921 | 1040 | /* clear tms->fifo if stop frame encountered */ |
| 922 | 1041 | if (indx == 15) |
| r5891 | r5892 | |
| 953 | 1072 | for (i = 0; i < 10; i++) |
| 954 | 1073 | tms->new_k[i] = tms->old_k[i]; |
| 955 | 1074 | |
| 956 | | if (DEBUG_5220) logerror(" (11-bit energy=%d pitch=%d rep=%d frame)\n", tms->new_energy, tms->new_pitch, rep_flag); |
| 1075 | LOG((" (11-bit energy=%d pitch=%d rep=%d frame)\n", tms->new_energy, tms->new_pitch, rep_flag)); |
| 957 | 1076 | goto done; |
| 958 | 1077 | } |
| 959 | 1078 | |
| r5891 | r5892 | |
| 975 | 1094 | else |
| 976 | 1095 | tms->new_k[3] = k4table[extract_bits(tms, 4)]; |
| 977 | 1096 | |
| 978 | | if (DEBUG_5220) logerror(" (29-bit energy=%d pitch=%d rep=%d 4K frame)\n", tms->new_energy, tms->new_pitch, rep_flag); |
| 1097 | LOG((" (29-bit energy=%d pitch=%d rep=%d 4K frame)\n", tms->new_energy, tms->new_pitch, rep_flag)); |
| 979 | 1098 | goto done; |
| 980 | 1099 | } |
| 981 | 1100 | |
| r5891 | r5892 | |
| 1001 | 1120 | tms->new_k[8] = k9table[extract_bits(tms, 3)]; |
| 1002 | 1121 | tms->new_k[9] = k10table[extract_bits(tms, 3)]; |
| 1003 | 1122 | |
| 1004 | | if (DEBUG_5220) logerror(" (50-bit energy=%d pitch=%d rep=%d 10K frame)\n", tms->new_energy, tms->new_pitch, rep_flag); |
| 1123 | LOG((" (50-bit energy=%d pitch=%d rep=%d 10K frame)\n", tms->new_energy, tms->new_pitch, rep_flag)); |
| 1005 | 1124 | |
| 1006 | 1125 | done: |
| 1007 | | if (DEBUG_5220) |
| 1008 | | { |
| 1009 | | if (tms->speak_external) |
| 1010 | | logerror("Parsed a frame successfully in FIFO - %d bits remaining\n", bits); |
| 1011 | | else |
| 1012 | | logerror("Parsed a frame successfully in ROM\n"); |
| 1013 | | } |
| 1126 | if (tms->speak_external) |
| 1127 | LOG(("Parsed a frame successfully in FIFO - %d bits remaining\n", bits)); |
| 1128 | else |
| 1129 | LOG(("Parsed a frame successfully in ROM\n")); |
| 1014 | 1130 | |
| 1015 | 1131 | if (the_first_frame) |
| 1016 | 1132 | { |
| r5891 | r5892 | |
| 1027 | 1143 | |
| 1028 | 1144 | ranout: |
| 1029 | 1145 | |
| 1030 | | if (DEBUG_5220) logerror("Ran out of bits on a parse!\n"); |
| 1146 | LOG(("Ran out of bits on a parse!\n")); |
| 1031 | 1147 | |
| 1032 | 1148 | /* this is an error condition; mark the buffer empty and turn off speaking */ |
| 1033 | 1149 | tms->buffer_empty = 1; |
| r5891 | r5892 | |
| 1059 | 1175 | set_interrupt_state(tms, 1); |
| 1060 | 1176 | tms->buffer_low = 1; |
| 1061 | 1177 | |
| 1062 | | if (DEBUG_5220) logerror("Buffer low set\n"); |
| 1178 | LOG(("Buffer low set\n")); |
| 1063 | 1179 | } |
| 1064 | 1180 | |
| 1065 | 1181 | /* did we just become full? */ |
| r5891 | r5892 | |
| 1067 | 1183 | { |
| 1068 | 1184 | tms->buffer_low = 0; |
| 1069 | 1185 | |
| 1070 | | if (DEBUG_5220) logerror("Buffer low cleared\n"); |
| 1186 | LOG(("Buffer low cleared\n")); |
| 1071 | 1187 | } |
| 1072 | 1188 | } |
| 1073 | 1189 | |
| r5891 | r5892 | |
| 1081 | 1197 | |
| 1082 | 1198 | static void set_interrupt_state(tms5220_state *tms, int state) |
| 1083 | 1199 | { |
| 1084 | | if (tms->intf->irq && state != tms->irq_pin) |
| 1085 | | tms->intf->irq(tms->device, state); |
| 1200 | if (tms->irq_func.write && state != tms->irq_pin) |
| 1201 | devcb_call_write_line(&tms->irq_func, !state); |
| 1086 | 1202 | tms->irq_pin = state; |
| 1087 | 1203 | } |
| 1088 | 1204 | |
| r5891 | r5892 | |
| 1095 | 1211 | |
| 1096 | 1212 | static DEVICE_START( tms5220 ) |
| 1097 | 1213 | { |
| 1098 | | static const tms5220_interface dummy = { 0 }; |
| 1214 | static const tms5220_interface dummy = { DEVCB_NULL }; |
| 1099 | 1215 | tms5220_state *tms = get_safe_token(device); |
| 1100 | 1216 | |
| 1101 | 1217 | /* set the interface and device */ |
| r5891 | r5892 | |
| 1103 | 1219 | tms->device = device; |
| 1104 | 1220 | tms->clock = device->clock; |
| 1105 | 1221 | |
| 1222 | /* resolve */ |
| 1223 | |
| 1224 | devcb_resolve_write_line(&tms->irq_func, &tms->intf->irq_func, device); |
| 1225 | |
| 1106 | 1226 | /* initialize a stream */ |
| 1107 | 1227 | tms->stream = stream_create(device, 0, 1, device->clock / 80, tms, tms5220_update); |
| 1108 | 1228 | |
| 1229 | /* not during reset which is called frm within a write! */ |
| 1230 | tms->io_ready = 1; |
| 1231 | tms->true_timing = 0; |
| 1232 | |
| 1233 | tms->variant = variant_tms5220; |
| 1109 | 1234 | register_for_save_states(tms); |
| 1110 | 1235 | } |
| 1111 | 1236 | |
| 1237 | static DEVICE_START( tms5220c ) |
| 1238 | { |
| 1239 | tms5220_state *tms = get_safe_token(device); |
| 1240 | DEVICE_START_CALL( tms5220 ); |
| 1241 | tms->variant = variant_tms5220c; |
| 1242 | } |
| 1112 | 1243 | |
| 1113 | 1244 | static DEVICE_START( tmc0285 ) |
| 1114 | 1245 | { |
| r5891 | r5892 | |
| 1137 | 1268 | /* initialize the chip state */ |
| 1138 | 1269 | /* Note that we do not actually clear IRQ on start-up : IRQ is even raised if tms->buffer_empty or tms->buffer_low are 0 */ |
| 1139 | 1270 | tms->tms5220_speaking = tms->speak_external = tms->talk_status = tms->first_frame = tms->last_frame = tms->irq_pin = 0; |
| 1140 | | if (tms->intf->irq) tms->intf->irq(tms->device, 0); |
| 1271 | set_interrupt_state(tms, 0); |
| 1141 | 1272 | tms->buffer_empty = tms->buffer_low = 1; |
| 1142 | 1273 | |
| 1143 | 1274 | tms->RDB_flag = FALSE; |
| r5891 | r5892 | |
| 1162 | 1293 | tms->schedule_dummy_read = TRUE; |
| 1163 | 1294 | } |
| 1164 | 1295 | |
| 1296 | /********************************************************************************************** |
| 1165 | 1297 | |
| 1298 | True timing |
| 1166 | 1299 | |
| 1300 | ***********************************************************************************************/ |
| 1301 | |
| 1302 | TIMER_CALLBACK( io_ready_cb ) |
| 1303 | { |
| 1304 | tms5220_state *tms = (tms5220_state *) ptr; |
| 1305 | if (param) |
| 1306 | { |
| 1307 | switch (tms->rs_ws) |
| 1308 | { |
| 1309 | case 0x02: |
| 1310 | /* Write */ |
| 1311 | /* bring up to date first */ |
| 1312 | LOG(("Service write %02x\n", tms->write_latch)); |
| 1313 | stream_update(tms->stream); |
| 1314 | tms5220_data_write(tms, tms->write_latch); |
| 1315 | break; |
| 1316 | case 0x01: |
| 1317 | /* Read */ |
| 1318 | /* bring up to date first */ |
| 1319 | stream_update(tms->stream); |
| 1320 | tms->read_latch = tms5220_status_read(tms); |
| 1321 | break; |
| 1322 | case 0x03: |
| 1323 | /* High Impedance */ |
| 1324 | case 0x00: |
| 1325 | /* illegal */ |
| 1326 | break; |
| 1327 | } |
| 1328 | } |
| 1329 | tms->io_ready = param; |
| 1330 | } |
| 1331 | |
| 1332 | WRITE_LINE_DEVICE_HANDLER( tms5220_rsq_w ) |
| 1333 | { |
| 1334 | tms5220_state *tms = get_safe_token(device); |
| 1335 | UINT8 new; |
| 1336 | |
| 1337 | tms->true_timing = 1; |
| 1338 | state &= 0x01; |
| 1339 | |
| 1340 | new = (tms->rs_ws & 0x01) | (state<<1); |
| 1341 | if (new != tms->rs_ws) |
| 1342 | { |
| 1343 | tms->rs_ws = new; |
| 1344 | if (new == 0) |
| 1345 | { |
| 1346 | if (tms->variant == variant_tms5220c) |
| 1347 | device_reset(device); |
| 1348 | else |
| 1349 | /* illegal */ |
| 1350 | LOG(("tms5220_rs_w: illegal\n")); |
| 1351 | return; |
| 1352 | } |
| 1353 | else if ( new == 3) |
| 1354 | { |
| 1355 | /* high impedance */ |
| 1356 | tms->read_latch = 0xff; |
| 1357 | return; |
| 1358 | } |
| 1359 | if (state) |
| 1360 | { |
| 1361 | /* low to high */ |
| 1362 | } |
| 1363 | else |
| 1364 | { |
| 1365 | /* high to low - schedule ready cycle*/ |
| 1366 | LOG(("Schedule write ready\n")); |
| 1367 | tms->io_ready = 1; |
| 1368 | /* 100 nsec from data sheet */ |
| 1369 | timer_set(tms->device->machine, ATTOTIME_IN_NSEC(100), tms, 0, io_ready_cb); |
| 1370 | /* 25 usec in datasheet, but zaccaria won't work */ |
| 1371 | timer_set(tms->device->machine, ATTOTIME_IN_USEC(100), tms, 1, io_ready_cb); |
| 1372 | } |
| 1373 | } |
| 1374 | } |
| 1375 | |
| 1376 | WRITE_LINE_DEVICE_HANDLER( tms5220_wsq_w ) |
| 1377 | { |
| 1378 | tms5220_state *tms = get_safe_token(device); |
| 1379 | UINT8 new; |
| 1380 | |
| 1381 | tms->true_timing = 1; |
| 1382 | state &= 0x01; |
| 1383 | new = (tms->rs_ws & 0x02) | (state<<0); |
| 1384 | if (new != tms->rs_ws) |
| 1385 | { |
| 1386 | tms->rs_ws = new; |
| 1387 | if (new == 0) |
| 1388 | { |
| 1389 | if (tms->variant == variant_tms5220c) |
| 1390 | device_reset(device); |
| 1391 | else |
| 1392 | /* illegal */ |
| 1393 | LOG(("tms5220_ws_w: illegal\n")); |
| 1394 | return; |
| 1395 | } |
| 1396 | else if ( new == 3) |
| 1397 | { |
| 1398 | /* high impedance */ |
| 1399 | tms->read_latch = 0xff; |
| 1400 | return; |
| 1401 | } |
| 1402 | if (state) |
| 1403 | { |
| 1404 | /* low to high */ |
| 1405 | } |
| 1406 | else |
| 1407 | { |
| 1408 | /* high to low - schedule ready cycle*/ |
| 1409 | tms->io_ready = 1; |
| 1410 | timer_set(tms->device->machine, ATTOTIME_IN_NSEC(100), tms, 0, io_ready_cb); |
| 1411 | timer_set(tms->device->machine, ATTOTIME_IN_USEC(25), tms, 1, io_ready_cb); |
| 1412 | } |
| 1413 | } |
| 1414 | } |
| 1415 | |
| 1167 | 1416 | /********************************************************************************************** |
| 1168 | 1417 | |
| 1169 | 1418 | tms5220_data_w -- write data to the sound chip |
| r5891 | r5892 | |
| 1173 | 1422 | WRITE8_DEVICE_HANDLER( tms5220_data_w ) |
| 1174 | 1423 | { |
| 1175 | 1424 | tms5220_state *tms = get_safe_token(device); |
| 1176 | | /* bring up to date first */ |
| 1177 | | stream_update(tms->stream); |
| 1178 | | tms5220_data_write(tms, data); |
| 1425 | |
| 1426 | if (!tms->true_timing) |
| 1427 | { |
| 1428 | /* bring up to date first */ |
| 1429 | stream_update(tms->stream); |
| 1430 | tms5220_data_write(tms, data); |
| 1431 | } |
| 1432 | else |
| 1433 | { |
| 1434 | /* actually in a write ? */ |
| 1435 | if (!(tms->rs_ws == 0x02)) |
| 1436 | LOG(("tms5220_data_w: data written outside ws, status: %02x!\n", tms->rs_ws)); |
| 1437 | tms->write_latch = data; |
| 1438 | } |
| 1179 | 1439 | } |
| 1180 | 1440 | |
| 1181 | 1441 | |
| r5891 | r5892 | |
| 1189 | 1449 | READ8_DEVICE_HANDLER( tms5220_status_r ) |
| 1190 | 1450 | { |
| 1191 | 1451 | tms5220_state *tms = get_safe_token(device); |
| 1192 | | /* bring up to date first */ |
| 1193 | | stream_update(tms->stream); |
| 1194 | | return tms5220_status_read(tms); |
| 1452 | if (!tms->true_timing) |
| 1453 | { |
| 1454 | /* bring up to date first */ |
| 1455 | stream_update(tms->stream); |
| 1456 | return tms5220_status_read(tms); |
| 1457 | } |
| 1458 | else |
| 1459 | { |
| 1460 | /* actually in a read ? */ |
| 1461 | if (tms->rs_ws == 0x01) |
| 1462 | return tms->read_latch; |
| 1463 | else |
| 1464 | LOG(("tms5220_status_r: data read outside rs!\n")); |
| 1465 | return 0xff; |
| 1466 | } |
| 1195 | 1467 | } |
| 1196 | 1468 | |
| 1197 | 1469 | |
| r5891 | r5892 | |
| 1202 | 1474 | |
| 1203 | 1475 | ***********************************************************************************************/ |
| 1204 | 1476 | |
| 1205 | | int tms5220_ready_r(const device_config *device) |
| 1477 | READ_LINE_DEVICE_HANDLER( tms5220_readyq_r ) |
| 1206 | 1478 | { |
| 1207 | 1479 | tms5220_state *tms = get_safe_token(device); |
| 1208 | 1480 | /* bring up to date first */ |
| 1209 | 1481 | stream_update(tms->stream); |
| 1210 | | return tms5220_ready_read(tms); |
| 1482 | return !tms5220_ready_read(tms); |
| 1211 | 1483 | } |
| 1212 | 1484 | |
| 1213 | 1485 | |
| r5891 | r5892 | |
| 1237 | 1509 | |
| 1238 | 1510 | ***********************************************************************************************/ |
| 1239 | 1511 | |
| 1240 | | int tms5220_int_r(const device_config *device) |
| 1512 | READ_LINE_DEVICE_HANDLER( tms5220_intq_r ) |
| 1241 | 1513 | { |
| 1242 | 1514 | tms5220_state *tms = get_safe_token(device); |
| 1243 | 1515 | /* bring up to date first */ |
| 1244 | 1516 | stream_update(tms->stream); |
| 1245 | | return tms5220_int_read(tms); |
| 1517 | return !tms5220_int_read(tms); |
| 1246 | 1518 | } |
| 1247 | 1519 | |
| 1248 | 1520 | |
| r5891 | r5892 | |
| 1304 | 1576 | #define DEVTEMPLATE_FAMILY "TI Speech" |
| 1305 | 1577 | #include "devtempl.h" |
| 1306 | 1578 | |
| 1579 | #define DEVTEMPLATE_DERIVED_ID(p,s) p##tms5220c##s |
| 1580 | #define DEVTEMPLATE_DERIVED_FEATURES DT_HAS_START |
| 1581 | #define DEVTEMPLATE_DERIVED_NAME "TMS5220C" |
| 1582 | #include "devtempl.h" |
| 1583 | |
| 1307 | 1584 | #define DEVTEMPLATE_DERIVED_ID(p,s) p##tmc0285##s |
| 1308 | 1585 | #define DEVTEMPLATE_DERIVED_FEATURES DT_HAS_START |
| 1309 | 1586 | #define DEVTEMPLATE_DERIVED_NAME "TMC0285" |