trunk/src/mame/drivers/namcos23.c
| r18703 | r18704 | |
| 1454 | 1454 | DECLARE_WRITE8_MEMBER(s23_iob_p4_w); |
| 1455 | 1455 | DECLARE_READ8_MEMBER(s23_iob_p6_r); |
| 1456 | 1456 | DECLARE_WRITE8_MEMBER(s23_iob_p6_w); |
| 1457 | | DECLARE_READ8_MEMBER(s23_gun_r); |
| 1458 | | DECLARE_READ8_MEMBER(iob_r); |
| 1457 | DECLARE_READ8_MEMBER(s23_iob_gun_r); |
| 1458 | DECLARE_READ8_MEMBER(s23_iob_analog_r); |
| 1459 | 1459 | DECLARE_DRIVER_INIT(ss23); |
| 1460 | 1460 | TILE_GET_INFO_MEMBER(TextTilemapGetInfo); |
| 1461 | 1461 | DECLARE_MACHINE_START(s23); |
| r18703 | r18704 | |
| 2858 | 2858 | PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "DIP:1" ) |
| 2859 | 2859 | INPUT_PORTS_END |
| 2860 | 2860 | |
| 2861 | static INPUT_PORTS_START( finlflng ) |
| 2862 | PORT_INCLUDE( gorgon ) |
| 2863 | |
| 2864 | PORT_MODIFY("IN0") |
| 2865 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) |
| 2866 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) |
| 2867 | |
| 2868 | #if 0 // need to hook these up properly |
| 2869 | PORT_START("ADC0") |
| 2870 | PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC0") |
| 2871 | PORT_START("ADC1") |
| 2872 | PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC1") |
| 2873 | PORT_START("ADC2") |
| 2874 | PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC2") |
| 2875 | PORT_START("ADC3") |
| 2876 | PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC3") |
| 2877 | #endif |
| 2878 | INPUT_PORTS_END |
| 2879 | |
| 2861 | 2880 | static INPUT_PORTS_START( rapidrvrp ) |
| 2862 | 2881 | PORT_INCLUDE( gorgon ) |
| 2863 | 2882 | |
| r18703 | r18704 | |
| 2890 | 2909 | |
| 2891 | 2910 | PORT_MODIFY("DSW") |
| 2892 | 2911 | PORT_DIPNAME( 0x08, 0x08, "Debug Messages" ) PORT_DIPLOCATION("DIP:5") |
| 2912 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 2913 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 2893 | 2914 | PORT_DIPNAME( 0x40, 0x40, "Dev Service Mode" ) PORT_DIPLOCATION("DIP:2") |
| 2894 | 2915 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 2895 | 2916 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 2896 | 2917 | PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "DIP:1" ) PORT_NAME("User Service Mode") |
| 2918 | |
| 2919 | #if 0 // need to hook these up properly |
| 2920 | PORT_START("ADC0") |
| 2921 | PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC0") // rear r |
| 2922 | PORT_START("ADC1") |
| 2923 | PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC1") // rear l |
| 2924 | PORT_START("ADC2") |
| 2925 | PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC2") // front r |
| 2926 | PORT_START("ADC3") |
| 2927 | PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC3") // front l |
| 2928 | #endif |
| 2897 | 2929 | INPUT_PORTS_END |
| 2898 | 2930 | |
| 2899 | 2931 | static INPUT_PORTS_START( s23 ) |
| r18703 | r18704 | |
| 3121 | 3153 | //printf("iob %02x to port 6\n", data); |
| 3122 | 3154 | } |
| 3123 | 3155 | |
| 3124 | | READ8_MEMBER(namcos23_state::s23_gun_r) |
| 3156 | READ8_MEMBER(namcos23_state::s23_iob_gun_r) |
| 3125 | 3157 | { |
| 3126 | 3158 | UINT16 xpos = ioport("LIGHTX")->read(); |
| 3127 | 3159 | UINT16 ypos = ioport("LIGHTY")->read(); |
| r18703 | r18704 | |
| 3140 | 3172 | return 0; |
| 3141 | 3173 | } |
| 3142 | 3174 | |
| 3143 | | READ8_MEMBER(namcos23_state::iob_r) |
| 3175 | READ8_MEMBER(namcos23_state::s23_iob_analog_r) |
| 3144 | 3176 | { |
| 3145 | | return machine().rand(); |
| 3177 | static const char *const portnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" }; |
| 3178 | if (offset & 1) |
| 3179 | return ioport(portnames[offset >> 1 & 3])->read_safe(0) >> 8 & 0xff; |
| 3180 | else |
| 3181 | return ioport(portnames[offset >> 1 & 3])->read_safe(0) & 0xff; |
| 3146 | 3182 | } |
| 3147 | 3183 | |
| 3148 | 3184 | /* H8/3334 (Namco C78) I/O board MCU */ |
| r18703 | r18704 | |
| 3154 | 3190 | AM_RANGE(0x6003, 0x6003) AM_READ_PORT("IN3") |
| 3155 | 3191 | AM_RANGE(0x6004, 0x6005) AM_WRITENOP |
| 3156 | 3192 | AM_RANGE(0x6006, 0x6007) AM_NOP |
| 3157 | | AM_RANGE(0x7000, 0x700f) AM_READ(iob_r ) |
| 3158 | 3193 | |
| 3159 | 3194 | AM_RANGE(0xc000, 0xf7ff) AM_RAM |
| 3160 | 3195 | ADDRESS_MAP_END |
| 3161 | 3196 | |
| 3162 | 3197 | static ADDRESS_MAP_START( timecrs2iobrdmap, AS_PROGRAM, 8, namcos23_state ) |
| 3163 | | AM_RANGE(0x7000, 0x700f) AM_READ(s23_gun_r ) |
| 3198 | AM_RANGE(0x7000, 0x700f) AM_READ(s23_iob_gun_r) |
| 3164 | 3199 | AM_IMPORT_FROM( s23iobrdmap ) |
| 3165 | 3200 | ADDRESS_MAP_END |
| 3166 | 3201 | |
| r18703 | r18704 | |
| 3175 | 3210 | AM_RANGE(H8_PORT_8, H8_PORT_8) AM_NOP // unknown - used on ASCA-5 only |
| 3176 | 3211 | AM_RANGE(H8_PORT_9, H8_PORT_9) AM_NOP // unknown - used on ASCA-5 only |
| 3177 | 3212 | AM_RANGE(H8_SERIAL_0, H8_SERIAL_0) AM_READWRITE(s23_iob_mcu_r, s23_iob_mcu_w) |
| 3178 | | AM_RANGE(H8_ADC_0_H, H8_ADC_3_L) AM_NOP // analog input |
| 3213 | AM_RANGE(H8_ADC_0_H, H8_ADC_3_L) AM_READ(s23_iob_analog_r) |
| 3179 | 3214 | ADDRESS_MAP_END |
| 3180 | 3215 | |
| 3181 | 3216 | DRIVER_INIT_MEMBER(namcos23_state,ss23) |
| r18703 | r18704 | |
| 4432 | 4467 | GAME( 1997, rapidrvr, 0, gorgon, gorgon, namcos23_state, ss23, ROT0, "Namco", "Rapid River (RD3 Ver. C)", GAME_FLAGS ) // 97/11/27, USA |
| 4433 | 4468 | GAME( 1997, rapidrvr2, rapidrvr, gorgon, gorgon, namcos23_state, ss23, ROT0, "Namco", "Rapid River (RD2 Ver. C)", GAME_FLAGS ) // 97/11/27, Europe |
| 4434 | 4469 | GAME( 1997, rapidrvrp, rapidrvr, gorgon, rapidrvrp, namcos23_state, ss23, ROT0, "Namco", "Rapid River (prototype)", GAME_FLAGS ) // 97/11/10, USA |
| 4435 | | GAME( 1997, finlflng, 0, gorgon, gorgon, namcos23_state, ss23, ROT0, "Namco", "Final Furlong (FF2 Ver. A)", GAME_FLAGS ) |
| 4470 | GAME( 1997, finlflng, 0, gorgon, finlflng, namcos23_state, ss23, ROT0, "Namco", "Final Furlong (FF2 Ver. A)", GAME_FLAGS ) |
| 4436 | 4471 | GAME( 1997, downhill, 0, s23, s23, namcos23_state, ss23, ROT0, "Namco", "Downhill Bikers (DH3 Ver. A)", GAME_FLAGS ) |
| 4437 | 4472 | GAME( 1997, motoxgo, 0, s23, s23, namcos23_state, ss23, ROT0, "Namco", "Motocross Go! (MG3 Ver. A)", GAME_FLAGS ) |
| 4438 | 4473 | GAME( 1997, motoxgoa, motoxgo, s23, s23, namcos23_state, ss23, ROT0, "Namco", "Motocross Go! (MG2 Ver. A)", GAME_FLAGS ) |