src/mame/machine/scramble.c
| r15199 | r15200 | |
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | | #include "machine/8255ppi.h" |
| 12 | #include "machine/i8255.h" |
| 13 | 13 | #include "includes/scramble.h" |
| 14 | 14 | |
| 15 | 15 | |
| r15199 | r15200 | |
| 50 | 50 | |
| 51 | 51 | /* state of the security PAL (6J) */ |
| 52 | 52 | |
| 53 | | static WRITE8_DEVICE_HANDLER( scramble_protection_w ) |
| 53 | WRITE8_DEVICE_HANDLER( scramble_protection_w ) |
| 54 | 54 | { |
| 55 | 55 | scramble_state *state = device->machine().driver_data<scramble_state>(); |
| 56 | 56 | state->m_xb = data; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | | static READ8_DEVICE_HANDLER( scramble_protection_r ) |
| 59 | READ8_DEVICE_HANDLER( scramble_protection_r ) |
| 60 | 60 | { |
| 61 | 61 | switch (cpu_get_pc(device->machine().device("maincpu"))) |
| 62 | 62 | { |
| r15199 | r15200 | |
| 116 | 116 | |
| 117 | 117 | static READ8_HANDLER( cavelon_banksw_r ) |
| 118 | 118 | { |
| 119 | scramble_state *state = space->machine().driver_data<scramble_state>(); |
| 119 | 120 | cavelon_banksw(space->machine()); |
| 120 | 121 | |
| 121 | | if ((offset >= 0x0100) && (offset <= 0x0103)) |
| 122 | | return ppi8255_r(space->machine().device("ppi8255_0"), offset - 0x0100); |
| 122 | if ((offset >= 0x0100) && (offset <= 0x0103)) |
| 123 | return state->m_ppi8255_0->read(*space, offset - 0x0100); |
| 123 | 124 | else if ((offset >= 0x0200) && (offset <= 0x0203)) |
| 124 | | return ppi8255_r(space->machine().device("ppi8255_1"), offset - 0x0200); |
| 125 | return state->m_ppi8255_1->read(*space, offset - 0x0200); |
| 125 | 126 | |
| 126 | 127 | return 0xff; |
| 127 | 128 | } |
| 128 | 129 | |
| 129 | 130 | static WRITE8_HANDLER( cavelon_banksw_w ) |
| 130 | 131 | { |
| 132 | scramble_state *state = space->machine().driver_data<scramble_state>(); |
| 131 | 133 | cavelon_banksw(space->machine()); |
| 132 | 134 | |
| 133 | | if ((offset >= 0x0100) && (offset <= 0x0103)) |
| 134 | | ppi8255_w(space->machine().device("ppi8255_0"), offset - 0x0100, data); |
| 135 | if ((offset >= 0x0100) && (offset <= 0x0103)) |
| 136 | state->m_ppi8255_0->write(*space, offset - 0x0100, data); |
| 135 | 137 | else if ((offset >= 0x0200) && (offset <= 0x0203)) |
| 136 | | ppi8255_w(space->machine().device("ppi8255_1"), offset - 0x0200, data); |
| 138 | state->m_ppi8255_1->write(*space, offset - 0x0200, data); |
| 137 | 139 | } |
| 138 | 140 | |
| 139 | 141 | |
| r15199 | r15200 | |
| 147 | 149 | space->write_byte(0x1000+offset,data); |
| 148 | 150 | } |
| 149 | 151 | |
| 150 | | const ppi8255_interface scramble_ppi_0_intf = |
| 151 | | { |
| 152 | | DEVCB_INPUT_PORT("IN0"), /* Port A read */ |
| 153 | | DEVCB_INPUT_PORT("IN1"), /* Port B read */ |
| 154 | | DEVCB_INPUT_PORT("IN2"), /* Port C read */ |
| 155 | | DEVCB_NULL, /* Port A write */ |
| 156 | | DEVCB_NULL, /* Port B write */ |
| 157 | | DEVCB_NULL /* Port C write */ |
| 158 | | }; |
| 159 | 152 | |
| 160 | | const ppi8255_interface scramble_ppi_1_intf = |
| 161 | | { |
| 162 | | DEVCB_NULL, /* Port A read */ |
| 163 | | DEVCB_NULL, /* Port B read */ |
| 164 | | DEVCB_NULL, /* Port C read */ |
| 165 | | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ |
| 166 | | DEVCB_HANDLER(scramble_sh_irqtrigger_w), /* Port B write */ |
| 167 | | DEVCB_NULL /* Port C write */ |
| 168 | | }; |
| 169 | 153 | |
| 170 | | |
| 171 | | const ppi8255_interface stratgyx_ppi_1_intf = |
| 172 | | { |
| 173 | | DEVCB_NULL, /* Port A read */ |
| 174 | | DEVCB_NULL, /* Port B read */ |
| 175 | | DEVCB_INPUT_PORT("IN3"), /* Port C read */ |
| 176 | | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ |
| 177 | | DEVCB_HANDLER(scramble_sh_irqtrigger_w), /* Port B write */ |
| 178 | | DEVCB_NULL /* Port C write */ |
| 179 | | }; |
| 180 | | |
| 181 | | |
| 182 | | const ppi8255_interface scramble_protection_ppi_1_intf = |
| 183 | | { |
| 184 | | DEVCB_NULL, /* Port A read */ |
| 185 | | DEVCB_NULL, /* Port B read */ |
| 186 | | DEVCB_HANDLER(scramble_protection_r), /* Port C read */ |
| 187 | | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ |
| 188 | | DEVCB_HANDLER(scramble_sh_irqtrigger_w), /* Port B write */ |
| 189 | | DEVCB_HANDLER(scramble_protection_w) /* Port C write */ |
| 190 | | }; |
| 191 | | |
| 192 | | |
| 193 | | const ppi8255_interface mrkougar_ppi_1_intf = |
| 194 | | { |
| 195 | | DEVCB_NULL, /* Port A read */ |
| 196 | | DEVCB_NULL, /* Port B read */ |
| 197 | | DEVCB_NULL, /* Port C read */ |
| 198 | | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ |
| 199 | | DEVCB_HANDLER(mrkougar_sh_irqtrigger_w), /* Port B write */ |
| 200 | | DEVCB_NULL /* Port C write */ |
| 201 | | }; |
| 202 | | |
| 203 | | |
| 204 | 154 | DRIVER_INIT( scramble_ppi ) |
| 205 | 155 | { |
| 206 | 156 | } |
src/mame/drivers/scramble.c
| r15199 | r15200 | |
| 32 | 32 | #include "sound/dac.h" |
| 33 | 33 | #include "sound/flt_rc.h" |
| 34 | 34 | #include "machine/7474.h" |
| 35 | | #include "machine/8255ppi.h" |
| 35 | #include "machine/i8255.h" |
| 36 | 36 | #include "includes/scramble.h" |
| 37 | 37 | |
| 38 | 38 | |
| r15199 | r15200 | |
| 53 | 53 | AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w) |
| 54 | 54 | AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r) |
| 55 | 55 | AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r) |
| 56 | | AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 57 | | AM_RANGE(0x8110, 0x8113) AM_DEVREAD_LEGACY("ppi8255_0", ppi8255_r) /* mirror for Frog */ |
| 58 | | AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 56 | AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 57 | AM_RANGE(0x8110, 0x8113) AM_DEVREAD("ppi8255_0", i8255_device, read) /* mirror for Frog */ |
| 58 | AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 59 | 59 | ADDRESS_MAP_END |
| 60 | 60 | |
| 61 | 61 | |
| r15199 | r15200 | |
| 79 | 79 | AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w) |
| 80 | 80 | AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w) |
| 81 | 81 | /* don't know where these are */ |
| 82 | | // AM_RANGE(0x8100, 0x8103) AM_WRITE_LEGACY(ppi8255_0_w) |
| 83 | | // AM_RANGE(0x8200, 0x8203) AM_WRITE_LEGACY(ppi8255_1_w) |
| 82 | // AM_RANGE(0x8100, 0x8103) AM_WRITE("ppi8255_0", i8255_device, write) |
| 83 | // AM_RANGE(0x8200, 0x8203) AM_WRITE("ppi8255_1", i8255_device, write) |
| 84 | 84 | |
| 85 | 85 | AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) |
| 86 | | // AM_RANGE(0x8100, 0x8103) AM_READ_LEGACY(ppi8255_0_r) |
| 87 | | // AM_RANGE(0x8200, 0x8203) AM_READ_LEGACY(ppi8255_1_r) |
| 86 | // AM_RANGE(0x8100, 0x8103) AM_READ("ppi8255_0", i8255_device, read) |
| 87 | // AM_RANGE(0x8200, 0x8203) AM_READ("ppi8255_1", i8255_device, read) |
| 88 | 88 | |
| 89 | 89 | AM_RANGE(0xf000, 0xffff) AM_READONLY |
| 90 | 90 | ADDRESS_MAP_END |
| r15199 | r15200 | |
| 92 | 92 | static ADDRESS_MAP_START( ckongs_map, AS_PROGRAM, 8, scramble_state ) |
| 93 | 93 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 94 | 94 | AM_RANGE(0x6000, 0x6bff) AM_RAM |
| 95 | | AM_RANGE(0x7000, 0x7003) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 96 | | AM_RANGE(0x7800, 0x7803) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 95 | AM_RANGE(0x7000, 0x7003) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 96 | AM_RANGE(0x7800, 0x7803) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 97 | 97 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_SHARE("videoram") |
| 98 | 98 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_SHARE("attributesram") |
| 99 | 99 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("spriteram") |
| r15199 | r15200 | |
| 107 | 107 | ADDRESS_MAP_END |
| 108 | 108 | |
| 109 | 109 | |
| 110 | | static READ8_DEVICE_HANDLER(mars_ppi8255_r) |
| 110 | READ8_MEMBER(scramble_state::mars_ppi8255_0_r) |
| 111 | 111 | { |
| 112 | | return ppi8255_r(device, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01)); |
| 112 | return m_ppi8255_0->read(space, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01)); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | | static WRITE8_DEVICE_HANDLER(mars_ppi8255_w) |
| 115 | READ8_MEMBER(scramble_state::mars_ppi8255_1_r) |
| 116 | 116 | { |
| 117 | | ppi8255_w(device, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data); |
| 117 | return m_ppi8255_1->read(space, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01)); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | WRITE8_MEMBER(scramble_state::mars_ppi8255_0_w) |
| 121 | { |
| 122 | m_ppi8255_0->write(space, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data); |
| 123 | } |
| 120 | 124 | |
| 125 | WRITE8_MEMBER(scramble_state::mars_ppi8255_1_w) |
| 126 | { |
| 127 | m_ppi8255_1->write(space, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data); |
| 128 | } |
| 129 | |
| 121 | 130 | static ADDRESS_MAP_START( mars_map, AS_PROGRAM, 8, scramble_state ) |
| 122 | 131 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 123 | 132 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| r15199 | r15200 | |
| 135 | 144 | AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w) |
| 136 | 145 | AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r) |
| 137 | 146 | AM_RANGE(0x7000, 0x7000) AM_READNOP |
| 138 | | AM_RANGE(0x8100, 0x810f) AM_DEVREADWRITE_LEGACY("ppi8255_0", mars_ppi8255_r, mars_ppi8255_w) |
| 139 | | AM_RANGE(0x8200, 0x820f) AM_DEVREADWRITE_LEGACY("ppi8255_1", mars_ppi8255_r, mars_ppi8255_w) |
| 147 | AM_RANGE(0x8100, 0x810f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w) |
| 148 | AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w) |
| 140 | 149 | ADDRESS_MAP_END |
| 141 | 150 | |
| 142 | 151 | |
| r15199 | r15200 | |
| 156 | 165 | AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w) |
| 157 | 166 | AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w) |
| 158 | 167 | AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r) |
| 159 | | AM_RANGE(0x8200, 0x820f) AM_DEVREADWRITE_LEGACY("ppi8255_1", mars_ppi8255_r, mars_ppi8255_w) |
| 168 | AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w) |
| 160 | 169 | AM_RANGE(0xa000, 0xafff) AM_ROM |
| 161 | | AM_RANGE(0xc100, 0xc10f) AM_DEVREADWRITE_LEGACY("ppi8255_0", mars_ppi8255_r, mars_ppi8255_w) |
| 170 | AM_RANGE(0xc100, 0xc10f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w) |
| 162 | 171 | ADDRESS_MAP_END |
| 163 | 172 | |
| 164 | 173 | |
| r15199 | r15200 | |
| 177 | 186 | AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w) |
| 178 | 187 | AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w) |
| 179 | 188 | AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r) |
| 180 | | AM_RANGE(0x8100, 0x810f) AM_DEVREADWRITE_LEGACY("ppi8255_0", mars_ppi8255_r, mars_ppi8255_w) |
| 181 | | AM_RANGE(0x8200, 0x820f) AM_DEVREADWRITE_LEGACY("ppi8255_1", mars_ppi8255_r, mars_ppi8255_w) |
| 189 | AM_RANGE(0x8100, 0x810f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w) |
| 190 | AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w) |
| 182 | 191 | ADDRESS_MAP_END |
| 183 | 192 | |
| 184 | 193 | |
| r15199 | r15200 | |
| 208 | 217 | |
| 209 | 218 | static ADDRESS_MAP_START( hunchbks_map, AS_PROGRAM, 8, scramble_state ) |
| 210 | 219 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 211 | | AM_RANGE(0x1210, 0x1213) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 220 | AM_RANGE(0x1210, 0x1213) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 212 | 221 | AM_RANGE(0x1400, 0x143f) AM_RAM_WRITE(galaxold_attributesram_w) AM_SHARE("attributesram") |
| 213 | 222 | AM_RANGE(0x1440, 0x145f) AM_RAM AM_SHARE("spriteram") |
| 214 | 223 | AM_RANGE(0x1460, 0x147f) AM_RAM AM_SHARE("bulletsram") |
| 215 | 224 | AM_RANGE(0x1480, 0x14ff) AM_RAM |
| 216 | | AM_RANGE(0x1500, 0x1503) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 225 | AM_RANGE(0x1500, 0x1503) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 217 | 226 | AM_RANGE(0x1606, 0x1606) AM_WRITE(galaxold_flip_screen_x_w) |
| 218 | 227 | AM_RANGE(0x1607, 0x1607) AM_WRITE(galaxold_flip_screen_y_w) |
| 219 | 228 | AM_RANGE(0x1680, 0x1680) AM_READ(watchdog_reset_r) |
| r15199 | r15200 | |
| 243 | 252 | AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w) |
| 244 | 253 | AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w) |
| 245 | 254 | AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r) |
| 246 | | AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 247 | | AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 255 | AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 256 | AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 248 | 257 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 249 | 258 | ADDRESS_MAP_END |
| 250 | 259 | |
| r15199 | r15200 | |
| 1148 | 1157 | GFXDECODE_ENTRY( "gfx1", 0x0000, ad2083_spritelayout, 0, 8 ) |
| 1149 | 1158 | GFXDECODE_END |
| 1150 | 1159 | |
| 1160 | |
| 1161 | |
| 1162 | I8255A_INTERFACE( scramble_ppi_0_intf ) |
| 1163 | { |
| 1164 | DEVCB_INPUT_PORT("IN0"), /* Port A read */ |
| 1165 | DEVCB_NULL, /* Port A write */ |
| 1166 | DEVCB_INPUT_PORT("IN1"), /* Port B read */ |
| 1167 | DEVCB_NULL, /* Port B write */ |
| 1168 | DEVCB_INPUT_PORT("IN2"), /* Port C read */ |
| 1169 | DEVCB_NULL /* Port C write */ |
| 1170 | }; |
| 1171 | |
| 1172 | I8255A_INTERFACE( scramble_ppi_1_intf ) |
| 1173 | { |
| 1174 | DEVCB_NULL, /* Port A read */ |
| 1175 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */ |
| 1176 | DEVCB_NULL, /* Port B read */ |
| 1177 | DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */ |
| 1178 | DEVCB_NULL, /* Port C read */ |
| 1179 | DEVCB_NULL /* Port C write */ |
| 1180 | }; |
| 1181 | |
| 1182 | I8255A_INTERFACE( stratgyx_ppi_1_intf ) |
| 1183 | { |
| 1184 | DEVCB_NULL, /* Port A read */ |
| 1185 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */ |
| 1186 | DEVCB_NULL, /* Port B read */ |
| 1187 | DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */ |
| 1188 | DEVCB_INPUT_PORT("IN3"), /* Port C read */ |
| 1189 | DEVCB_NULL /* Port C write */ |
| 1190 | }; |
| 1191 | |
| 1192 | I8255A_INTERFACE( scramble_protection_ppi_1_intf ) |
| 1193 | { |
| 1194 | DEVCB_NULL, /* Port A read */ |
| 1195 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */ |
| 1196 | DEVCB_NULL, /* Port B read */ |
| 1197 | DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */ |
| 1198 | DEVCB_HANDLER(scramble_protection_r), /* Port C read */ |
| 1199 | DEVCB_HANDLER(scramble_protection_w) /* Port C write */ |
| 1200 | }; |
| 1201 | |
| 1202 | I8255A_INTERFACE( mrkougar_ppi_1_intf ) |
| 1203 | { |
| 1204 | DEVCB_NULL, /* Port A read */ |
| 1205 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */ |
| 1206 | DEVCB_NULL, /* Port B read */ |
| 1207 | DEVCB_HANDLER(mrkougar_sh_irqtrigger_w),/* Port B write */ |
| 1208 | DEVCB_NULL, /* Port C read */ |
| 1209 | DEVCB_NULL /* Port C write */ |
| 1210 | }; |
| 1211 | |
| 1212 | |
| 1151 | 1213 | static const ay8910_interface scramble_ay8910_interface_2 = |
| 1152 | 1214 | { |
| 1153 | 1215 | AY8910_LEGACY_OUTPUT, |
| r15199 | r15200 | |
| 1251 | 1313 | |
| 1252 | 1314 | MCFG_MACHINE_RESET(scramble) |
| 1253 | 1315 | |
| 1254 | | MCFG_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf ) |
| 1255 | | MCFG_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf ) |
| 1316 | MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf ) |
| 1317 | MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi_1_intf ) |
| 1256 | 1318 | |
| 1257 | 1319 | /* video hardware */ |
| 1258 | 1320 | MCFG_SCREEN_ADD("screen", RASTER) |
| r15199 | r15200 | |
| 1320 | 1382 | MCFG_CPU_MODIFY("maincpu") |
| 1321 | 1383 | MCFG_CPU_PROGRAM_MAP(mrkougar_map) |
| 1322 | 1384 | |
| 1323 | | MCFG_PPI8255_RECONFIG( "ppi8255_1", mrkougar_ppi_1_intf ) |
| 1385 | MCFG_DEVICE_REMOVE("ppi8255_1") |
| 1386 | MCFG_I8255A_ADD( "ppi8255_1", mrkougar_ppi_1_intf ) |
| 1324 | 1387 | |
| 1325 | 1388 | /* video hardware */ |
| 1326 | 1389 | MCFG_GFXDECODE(mrkougar) |
| r15199 | r15200 | |
| 1334 | 1397 | MCFG_CPU_MODIFY("maincpu") |
| 1335 | 1398 | MCFG_CPU_PROGRAM_MAP(mrkougar_map) |
| 1336 | 1399 | |
| 1337 | | MCFG_PPI8255_RECONFIG( "ppi8255_1", mrkougar_ppi_1_intf ) |
| 1400 | MCFG_DEVICE_REMOVE("ppi8255_1") |
| 1401 | MCFG_I8255A_ADD( "ppi8255_1", mrkougar_ppi_1_intf ) |
| 1338 | 1402 | |
| 1339 | 1403 | /* video hardware */ |
| 1340 | 1404 | MCFG_PALETTE_LENGTH(32+64+2+0) /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */ |
src/mame/drivers/scobra.c
| r15199 | r15200 | |
| 34 | 34 | |
| 35 | 35 | #include "emu.h" |
| 36 | 36 | #include "cpu/z80/z80.h" |
| 37 | | #include "machine/8255ppi.h" |
| 37 | #include "machine/i8255.h" |
| 38 | 38 | #include "machine/7474.h" |
| 39 | 39 | #include "sound/ay8910.h" |
| 40 | 40 | #include "includes/scramble.h" |
| r15199 | r15200 | |
| 50 | 50 | optional_shared_ptr<UINT8> m_soundram; |
| 51 | 51 | DECLARE_READ8_MEMBER(scobra_soundram_r); |
| 52 | 52 | DECLARE_WRITE8_MEMBER(scobra_soundram_w); |
| 53 | DECLARE_READ8_MEMBER(scobra_type2_ppi8255_0_r); |
| 54 | DECLARE_READ8_MEMBER(scobra_type2_ppi8255_1_r); |
| 55 | DECLARE_READ8_MEMBER(hustler_ppi8255_0_r); |
| 56 | DECLARE_READ8_MEMBER(hustler_ppi8255_1_r); |
| 57 | DECLARE_WRITE8_MEMBER(scobra_type2_ppi8255_0_w); |
| 58 | DECLARE_WRITE8_MEMBER(scobra_type2_ppi8255_1_w); |
| 59 | DECLARE_WRITE8_MEMBER(hustler_ppi8255_0_w); |
| 60 | DECLARE_WRITE8_MEMBER(hustler_ppi8255_1_w); |
| 53 | 61 | DECLARE_CUSTOM_INPUT_MEMBER(stratgyx_coinage_r); |
| 54 | 62 | }; |
| 55 | 63 | |
| r15199 | r15200 | |
| 96 | 104 | DEVCB_NULL |
| 97 | 105 | }; |
| 98 | 106 | |
| 99 | | static READ8_DEVICE_HANDLER(scobra_type2_ppi8255_r) |
| 100 | | { |
| 101 | | return ppi8255_r(device, offset >> 2); |
| 102 | | } |
| 107 | READ8_MEMBER(scobra_state::scobra_type2_ppi8255_0_r){ return m_ppi8255_0->read(space, offset >> 2); } |
| 108 | READ8_MEMBER(scobra_state::scobra_type2_ppi8255_1_r){ return m_ppi8255_1->read(space, offset >> 2); } |
| 109 | WRITE8_MEMBER(scobra_state::scobra_type2_ppi8255_0_w){ m_ppi8255_0->write(space, offset >> 2, data); } |
| 110 | WRITE8_MEMBER(scobra_state::scobra_type2_ppi8255_1_w){ m_ppi8255_1->write(space, offset >> 2, data); } |
| 103 | 111 | |
| 104 | | static WRITE8_DEVICE_HANDLER(scobra_type2_ppi8255_w) |
| 105 | | { |
| 106 | | ppi8255_w(device, offset >> 2, data); |
| 107 | | } |
| 112 | READ8_MEMBER(scobra_state::hustler_ppi8255_0_r){ return m_ppi8255_0->read(space, offset >> 3); } |
| 113 | READ8_MEMBER(scobra_state::hustler_ppi8255_1_r){ return m_ppi8255_1->read(space, offset >> 3); } |
| 114 | WRITE8_MEMBER(scobra_state::hustler_ppi8255_0_w){ m_ppi8255_0->write(space, offset >> 3, data); } |
| 115 | WRITE8_MEMBER(scobra_state::hustler_ppi8255_1_w){ m_ppi8255_1->write(space, offset >> 3, data); } |
| 108 | 116 | |
| 109 | | static READ8_DEVICE_HANDLER(hustler_ppi8255_r) |
| 110 | | { |
| 111 | | return ppi8255_r(device, offset >> 3); |
| 112 | | } |
| 113 | | |
| 114 | | static WRITE8_DEVICE_HANDLER(hustler_ppi8255_w) |
| 115 | | { |
| 116 | | ppi8255_w(device, offset >> 3, data); |
| 117 | | } |
| 118 | | |
| 119 | 117 | static ADDRESS_MAP_START( type1_map, AS_PROGRAM, 8, scobra_state ) |
| 120 | 118 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 121 | 119 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| r15199 | r15200 | |
| 126 | 124 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_SHARE("spriteram") |
| 127 | 125 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_SHARE("bulletsram") |
| 128 | 126 | AM_RANGE(0x9080, 0x90ff) AM_RAM |
| 129 | | AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 130 | | AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 127 | AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 128 | AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 131 | 129 | AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w) |
| 132 | 130 | AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_coin_counter_w) |
| 133 | 131 | AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_stars_enable_w) |
| r15199 | r15200 | |
| 146 | 144 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_SHARE("videoram") |
| 147 | 145 | AM_RANGE(0x9400, 0x97ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) /* mirror */ |
| 148 | 146 | AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r) |
| 149 | | AM_RANGE(0xa000, 0xa00f) AM_DEVREADWRITE_LEGACY("ppi8255_0", scobra_type2_ppi8255_r, scobra_type2_ppi8255_w) |
| 150 | | AM_RANGE(0xa800, 0xa80f) AM_DEVREADWRITE_LEGACY("ppi8255_1", scobra_type2_ppi8255_r, scobra_type2_ppi8255_w) |
| 147 | AM_RANGE(0xa000, 0xa00f) AM_READWRITE(scobra_type2_ppi8255_0_r, scobra_type2_ppi8255_0_w) |
| 148 | AM_RANGE(0xa800, 0xa80f) AM_READWRITE(scobra_type2_ppi8255_1_r, scobra_type2_ppi8255_1_w) |
| 151 | 149 | AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_stars_enable_w) |
| 152 | 150 | AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_nmi_enable_w) |
| 153 | 151 | AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_coin_counter_0_w) |
| r15199 | r15200 | |
| 169 | 167 | AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w) |
| 170 | 168 | AM_RANGE(0xa80e, 0xa80e) AM_WRITENOP /* coin counters */ |
| 171 | 169 | AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) |
| 172 | | AM_RANGE(0xd000, 0xd01f) AM_DEVREADWRITE_LEGACY("ppi8255_0", hustler_ppi8255_r, hustler_ppi8255_w) |
| 173 | | AM_RANGE(0xe000, 0xe01f) AM_DEVREADWRITE_LEGACY("ppi8255_1", hustler_ppi8255_r, hustler_ppi8255_w) |
| 170 | AM_RANGE(0xd000, 0xd01f) AM_READWRITE(hustler_ppi8255_0_r, hustler_ppi8255_0_w) |
| 171 | AM_RANGE(0xe000, 0xe01f) AM_READWRITE(hustler_ppi8255_1_r, hustler_ppi8255_1_w) |
| 174 | 172 | ADDRESS_MAP_END |
| 175 | 173 | |
| 176 | 174 | static ADDRESS_MAP_START( hustlerb_map, AS_PROGRAM, 8, scobra_state ) |
| r15199 | r15200 | |
| 186 | 184 | AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w) |
| 187 | 185 | AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_x_w) |
| 188 | 186 | AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r) |
| 189 | | AM_RANGE(0xc100, 0xc103) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 190 | | AM_RANGE(0xc200, 0xc203) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 187 | AM_RANGE(0xc100, 0xc103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 188 | AM_RANGE(0xc200, 0xc203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 191 | 189 | ADDRESS_MAP_END |
| 192 | 190 | |
| 193 | 191 | static ADDRESS_MAP_START( mimonkey_map, AS_PROGRAM, 8, scobra_state ) |
| r15199 | r15200 | |
| 199 | 197 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_SHARE("spriteram") |
| 200 | 198 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_SHARE("bulletsram") |
| 201 | 199 | AM_RANGE(0x9080, 0x90ff) AM_RAM |
| 202 | | AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 203 | | AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 200 | AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 201 | AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 204 | 202 | AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w) |
| 205 | 203 | AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxold_gfxbank_w) |
| 206 | 204 | AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w) |
| r15199 | r15200 | |
| 669 | 667 | |
| 670 | 668 | MCFG_MACHINE_RESET(scramble) |
| 671 | 669 | |
| 672 | | MCFG_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf ) |
| 673 | | MCFG_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf ) |
| 670 | MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf ) |
| 671 | MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi_1_intf ) |
| 674 | 672 | |
| 675 | 673 | MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL) |
| 676 | 674 | MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) |
| r15199 | r15200 | |
| 754 | 752 | |
| 755 | 753 | /* basic machine hardware */ |
| 756 | 754 | |
| 757 | | /* device config overrides */ |
| 758 | | MCFG_PPI8255_RECONFIG( "ppi8255_1", stratgyx_ppi_1_intf ) |
| 755 | MCFG_DEVICE_REMOVE("ppi8255_1") |
| 756 | MCFG_I8255A_ADD( "ppi8255_1", stratgyx_ppi_1_intf ) |
| 759 | 757 | |
| 760 | 758 | /* video hardware */ |
| 761 | 759 | MCFG_PALETTE_LENGTH(32+64+2+8) /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */ |
| r15199 | r15200 | |
| 797 | 795 | MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer) |
| 798 | 796 | |
| 799 | 797 | /* device config overrides */ |
| 800 | | MCFG_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf ) |
| 801 | | MCFG_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf ) |
| 798 | MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf ) |
| 799 | MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi_1_intf ) |
| 802 | 800 | |
| 803 | 801 | /* video hardware */ |
| 804 | 802 | MCFG_SCREEN_ADD("screen", RASTER) |
src/mame/drivers/galaxian.c
| r15199 | r15200 | |
| 417 | 417 | #include "emu.h" |
| 418 | 418 | #include "cpu/z80/z80.h" |
| 419 | 419 | #include "cpu/s2650/s2650.h" |
| 420 | | #include "machine/8255ppi.h" |
| 420 | #include "machine/i8255.h" |
| 421 | 421 | #include "sound/ay8910.h" |
| 422 | 422 | #include "sound/sn76496.h" |
| 423 | 423 | #include "sound/dac.h" |
| r15199 | r15200 | |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | |
| 625 | | static const ppi8255_interface konami_ppi8255_0_intf = |
| 625 | static I8255A_INTERFACE( konami_ppi8255_0_intf ) |
| 626 | 626 | { |
| 627 | | DEVCB_INPUT_PORT("IN0"), /* Port A read */ |
| 628 | | DEVCB_INPUT_PORT("IN1"), /* Port B read */ |
| 629 | | DEVCB_INPUT_PORT("IN2"), /* Port C read */ |
| 630 | | DEVCB_NULL, /* Port A write */ |
| 631 | | DEVCB_NULL, /* Port B write */ |
| 632 | | DEVCB_HANDLER(konami_portc_0_w) /* Port C write */ |
| 627 | DEVCB_INPUT_PORT("IN0"), /* Port A read */ |
| 628 | DEVCB_NULL, /* Port A write */ |
| 629 | DEVCB_INPUT_PORT("IN1"), /* Port B read */ |
| 630 | DEVCB_NULL, /* Port B write */ |
| 631 | DEVCB_INPUT_PORT("IN2"), /* Port C read */ |
| 632 | DEVCB_HANDLER(konami_portc_0_w) /* Port C write */ |
| 633 | 633 | }; |
| 634 | 634 | |
| 635 | | |
| 636 | | static const ppi8255_interface konami_ppi8255_1_intf = |
| 635 | static I8255A_INTERFACE( konami_ppi8255_1_intf ) |
| 637 | 636 | { |
| 638 | | DEVCB_NULL, /* Port A read */ |
| 639 | | DEVCB_NULL, /* Port B read */ |
| 640 | | DEVCB_INPUT_PORT("IN3"), /* Port C read */ |
| 641 | | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ |
| 642 | | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 643 | | DEVCB_HANDLER(konami_portc_1_w) /* Port C write */ |
| 637 | DEVCB_NULL, /* Port A read */ |
| 638 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */ |
| 639 | DEVCB_NULL, /* Port B read */ |
| 640 | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 641 | DEVCB_INPUT_PORT("IN3"), /* Port C read */ |
| 642 | DEVCB_HANDLER(konami_portc_1_w) /* Port C write */ |
| 644 | 643 | }; |
| 645 | 644 | |
| 646 | 645 | |
| 647 | | |
| 648 | 646 | /************************************* |
| 649 | 647 | * |
| 650 | 648 | * The End I/O |
| r15199 | r15200 | |
| 655 | 653 | { |
| 656 | 654 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 657 | 655 | UINT8 result = 0xff; |
| 658 | | if (offset & 0x0100) result &= ppi8255_r(machine().device("ppi8255_0"), offset & 3); |
| 659 | | if (offset & 0x0200) result &= ppi8255_r(machine().device("ppi8255_1"), offset & 3); |
| 656 | if (offset & 0x0100) result &= m_ppi8255_0->read(space, offset & 3); |
| 657 | if (offset & 0x0200) result &= m_ppi8255_1->read(space, offset & 3); |
| 660 | 658 | return result; |
| 661 | 659 | } |
| 662 | 660 | |
| r15199 | r15200 | |
| 664 | 662 | WRITE8_MEMBER(galaxian_state::theend_ppi8255_w) |
| 665 | 663 | { |
| 666 | 664 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 667 | | if (offset & 0x0100) ppi8255_w(machine().device("ppi8255_0"), offset & 3, data); |
| 668 | | if (offset & 0x0200) ppi8255_w(machine().device("ppi8255_1"), offset & 3, data); |
| 665 | if (offset & 0x0100) m_ppi8255_0->write(space, offset & 3, data); |
| 666 | if (offset & 0x0200) m_ppi8255_1->write(space, offset & 3, data); |
| 669 | 667 | } |
| 670 | 668 | |
| 671 | 669 | |
| r15199 | r15200 | |
| 675 | 673 | } |
| 676 | 674 | |
| 677 | 675 | |
| 678 | | static const ppi8255_interface theend_ppi8255_0_intf = |
| 676 | static I8255A_INTERFACE( theend_ppi8255_0_intf ) |
| 679 | 677 | { |
| 680 | | DEVCB_INPUT_PORT("IN0"), /* Port A read */ |
| 681 | | DEVCB_INPUT_PORT("IN1"), /* Port B read */ |
| 682 | | DEVCB_INPUT_PORT("IN2"), /* Port C read */ |
| 683 | | DEVCB_NULL, /* Port A write */ |
| 684 | | DEVCB_NULL, /* Port B write */ |
| 685 | | DEVCB_HANDLER(theend_coin_counter_w)/* Port C write */ |
| 678 | DEVCB_INPUT_PORT("IN0"), /* Port A read */ |
| 679 | DEVCB_NULL, /* Port A write */ |
| 680 | DEVCB_INPUT_PORT("IN1"), /* Port B read */ |
| 681 | DEVCB_NULL, /* Port B write */ |
| 682 | DEVCB_INPUT_PORT("IN2"), /* Port C read */ |
| 683 | DEVCB_HANDLER(theend_coin_counter_w) /* Port C write */ |
| 686 | 684 | }; |
| 687 | 685 | |
| 688 | 686 | |
| r15199 | r15200 | |
| 736 | 734 | } |
| 737 | 735 | |
| 738 | 736 | |
| 739 | | static const ppi8255_interface scramble_ppi8255_1_intf = |
| 737 | static I8255A_INTERFACE( scramble_ppi8255_1_intf ) |
| 740 | 738 | { |
| 741 | | DEVCB_NULL, /* Port A read */ |
| 742 | | DEVCB_NULL, /* Port B read */ |
| 743 | | DEVCB_HANDLER(scramble_protection_r), /* Port C read */ |
| 744 | | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ |
| 745 | | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 746 | | DEVCB_HANDLER(scramble_protection_w) /* Port C write */ |
| 739 | DEVCB_NULL, /* Port A read */ |
| 740 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */ |
| 741 | DEVCB_NULL, /* Port B read */ |
| 742 | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 743 | DEVCB_HANDLER(scramble_protection_r), /* Port C read */ |
| 744 | DEVCB_HANDLER(scramble_protection_w) /* Port C write */ |
| 747 | 745 | }; |
| 748 | 746 | |
| 749 | 747 | |
| 750 | | |
| 751 | 748 | /************************************* |
| 752 | 749 | * |
| 753 | 750 | * Explorer I/O |
| r15199 | r15200 | |
| 779 | 776 | { |
| 780 | 777 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 781 | 778 | UINT8 result = 0xff; |
| 782 | | if (offset & 0x04) result &= ppi8255_r(machine().device("ppi8255_2"), offset & 3); |
| 779 | if (offset & 0x04) result &= m_ppi8255_2->read(space, offset & 3); |
| 783 | 780 | return result; |
| 784 | 781 | } |
| 785 | 782 | |
| r15199 | r15200 | |
| 787 | 784 | WRITE8_MEMBER(galaxian_state::sfx_sample_io_w) |
| 788 | 785 | { |
| 789 | 786 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 790 | | if (offset & 0x04) ppi8255_w(machine().device("ppi8255_2"), offset & 3, data); |
| 787 | if (offset & 0x04) m_ppi8255_2->write(space, offset & 3, data); |
| 791 | 788 | if (offset & 0x10) dac_signed_data_w(machine().device("dac"), data); |
| 792 | 789 | } |
| 793 | 790 | |
| r15199 | r15200 | |
| 805 | 802 | } |
| 806 | 803 | |
| 807 | 804 | |
| 808 | | static const ppi8255_interface sfx_ppi8255_2_intf = |
| 805 | static I8255A_INTERFACE( sfx_ppi8255_2_intf ) |
| 809 | 806 | { |
| 810 | | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_r), /* Port A read */ |
| 811 | | DEVCB_NULL, /* Port B read */ |
| 812 | | DEVCB_NULL, /* Port C read */ |
| 813 | | DEVCB_NULL, /* Port A write */ |
| 814 | | DEVCB_NULL, /* Port B write */ |
| 815 | | DEVCB_NULL /* Port C write */ |
| 807 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_r), /* Port A read */ |
| 808 | DEVCB_NULL, /* Port A write */ |
| 809 | DEVCB_NULL, /* Port B read */ |
| 810 | DEVCB_NULL, /* Port B write */ |
| 811 | DEVCB_NULL, /* Port C read */ |
| 812 | DEVCB_NULL /* Port C write */ |
| 816 | 813 | }; |
| 817 | 814 | |
| 818 | | |
| 819 | | |
| 820 | 815 | /************************************* |
| 821 | 816 | * |
| 822 | 817 | * Monster Zero I/O |
| r15199 | r15200 | |
| 879 | 874 | { |
| 880 | 875 | } |
| 881 | 876 | |
| 882 | | static const ppi8255_interface monsterz_ppi8255_1_intf = |
| 877 | static I8255A_INTERFACE( monsterz_ppi8255_1_intf ) |
| 883 | 878 | { |
| 884 | | DEVCB_NULL, /* Port A read */ |
| 885 | | DEVCB_NULL, /* Port B read */ |
| 886 | | DEVCB_INPUT_PORT("IN3"), /* Port C read */ |
| 887 | | DEVCB_HANDLER(monsterz_porta_1_w), /* Port A write */ |
| 888 | | DEVCB_HANDLER(monsterz_portb_1_w), /* Port B write */ |
| 889 | | DEVCB_HANDLER(monsterz_portc_1_w) /* Port C write */ |
| 879 | DEVCB_NULL, /* Port A read */ |
| 880 | DEVCB_HANDLER(monsterz_porta_1_w), /* Port A write */ |
| 881 | DEVCB_NULL, /* Port B read */ |
| 882 | DEVCB_HANDLER(monsterz_portb_1_w), /* Port B write */ |
| 883 | DEVCB_INPUT_PORT("IN3"), /* Port C read */ |
| 884 | DEVCB_HANDLER(monsterz_portc_1_w) /* Port C write */ |
| 890 | 885 | }; |
| 891 | 886 | |
| 892 | 887 | |
| 893 | | |
| 894 | 888 | /************************************* |
| 895 | 889 | * |
| 896 | 890 | * Frogger I/O |
| r15199 | r15200 | |
| 901 | 895 | { |
| 902 | 896 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 903 | 897 | UINT8 result = 0xff; |
| 904 | | if (offset & 0x1000) result &= ppi8255_r(machine().device("ppi8255_1"), (offset >> 1) & 3); |
| 905 | | if (offset & 0x2000) result &= ppi8255_r(machine().device("ppi8255_0"), (offset >> 1) & 3); |
| 898 | if (offset & 0x1000) result &= m_ppi8255_1->read(space, (offset >> 1) & 3); |
| 899 | if (offset & 0x2000) result &= m_ppi8255_0->read(space, (offset >> 1) & 3); |
| 906 | 900 | return result; |
| 907 | 901 | } |
| 908 | 902 | |
| r15199 | r15200 | |
| 910 | 904 | WRITE8_MEMBER(galaxian_state::frogger_ppi8255_w) |
| 911 | 905 | { |
| 912 | 906 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 913 | | if (offset & 0x1000) ppi8255_w(machine().device("ppi8255_1"), (offset >> 1) & 3, data); |
| 914 | | if (offset & 0x2000) ppi8255_w(machine().device("ppi8255_0"), (offset >> 1) & 3, data); |
| 907 | if (offset & 0x1000) m_ppi8255_1->write(space, (offset >> 1) & 3, data); |
| 908 | if (offset & 0x2000) m_ppi8255_0->write(space, (offset >> 1) & 3, data); |
| 915 | 909 | } |
| 916 | 910 | |
| 917 | 911 | |
| r15199 | r15200 | |
| 960 | 954 | { |
| 961 | 955 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 962 | 956 | UINT8 result = 0xff; |
| 963 | | if (offset & 0x1000) result &= ppi8255_r(machine().device("ppi8255_0"), (offset >> 3) & 3); |
| 964 | | if (offset & 0x2000) result &= ppi8255_r(machine().device("ppi8255_1"), (offset >> 3) & 3); |
| 957 | if (offset & 0x1000) result &= m_ppi8255_0->read(space, (offset >> 3) & 3); |
| 958 | if (offset & 0x2000) result &= m_ppi8255_1->read(space, (offset >> 3) & 3); |
| 965 | 959 | return result; |
| 966 | 960 | } |
| 967 | 961 | |
| r15199 | r15200 | |
| 969 | 963 | WRITE8_MEMBER(galaxian_state::frogf_ppi8255_w) |
| 970 | 964 | { |
| 971 | 965 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 972 | | if (offset & 0x1000) ppi8255_w(machine().device("ppi8255_0"), (offset >> 3) & 3, data); |
| 973 | | if (offset & 0x2000) ppi8255_w(machine().device("ppi8255_1"), (offset >> 3) & 3, data); |
| 966 | if (offset & 0x1000) m_ppi8255_0->write(space, (offset >> 3) & 3, data); |
| 967 | if (offset & 0x2000) m_ppi8255_1->write(space, (offset >> 3) & 3, data); |
| 974 | 968 | } |
| 975 | 969 | |
| 976 | 970 | |
| r15199 | r15200 | |
| 981 | 975 | * |
| 982 | 976 | *************************************/ |
| 983 | 977 | |
| 984 | | READ8_MEMBER(galaxian_state::turtles_ppi8255_0_r){ return ppi8255_r(machine().device("ppi8255_0"), (offset >> 4) & 3); } |
| 985 | | READ8_MEMBER(galaxian_state::turtles_ppi8255_1_r){ return ppi8255_r(machine().device("ppi8255_1"), (offset >> 4) & 3); } |
| 986 | | WRITE8_MEMBER(galaxian_state::turtles_ppi8255_0_w){ ppi8255_w(machine().device("ppi8255_0"), (offset >> 4) & 3, data); } |
| 987 | | WRITE8_MEMBER(galaxian_state::turtles_ppi8255_1_w){ ppi8255_w(machine().device("ppi8255_1"), (offset >> 4) & 3, data); } |
| 978 | READ8_MEMBER(galaxian_state::turtles_ppi8255_0_r){ return m_ppi8255_0->read(space, (offset >> 4) & 3); } |
| 979 | READ8_MEMBER(galaxian_state::turtles_ppi8255_1_r){ return m_ppi8255_1->read(space, (offset >> 4) & 3); } |
| 980 | WRITE8_MEMBER(galaxian_state::turtles_ppi8255_0_w){ m_ppi8255_0->write(space, (offset >> 4) & 3, data); } |
| 981 | WRITE8_MEMBER(galaxian_state::turtles_ppi8255_1_w){ m_ppi8255_1->write(space, (offset >> 4) & 3, data); } |
| 988 | 982 | |
| 989 | 983 | |
| 990 | 984 | |
| r15199 | r15200 | |
| 1061 | 1055 | digitalker_0_wr_w(device, data & 4 ? ASSERT_LINE : CLEAR_LINE); |
| 1062 | 1056 | } |
| 1063 | 1057 | |
| 1064 | | static const ppi8255_interface scorpion_ppi8255_1_intf = |
| 1058 | static I8255A_INTERFACE( scorpion_ppi8255_1_intf ) |
| 1065 | 1059 | { |
| 1066 | | DEVCB_NULL, /* Port A read */ |
| 1067 | | DEVCB_NULL, /* Port B read */ |
| 1068 | | DEVCB_HANDLER(scorpion_protection_r), /* Port C read */ |
| 1069 | | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ |
| 1070 | | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 1071 | | DEVCB_HANDLER(scorpion_protection_w) /* Port C write */ |
| 1060 | DEVCB_NULL, /* Port A read */ |
| 1061 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */ |
| 1062 | DEVCB_NULL, /* Port B read */ |
| 1063 | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 1064 | DEVCB_HANDLER(scorpion_protection_r), /* Port C read */ |
| 1065 | DEVCB_HANDLER(scorpion_protection_w) /* Port C write */ |
| 1072 | 1066 | }; |
| 1073 | 1067 | |
| 1074 | 1068 | |
| 1075 | | |
| 1076 | 1069 | /************************************* |
| 1077 | 1070 | * |
| 1078 | 1071 | * Ghostmuncher Galaxian I/O |
| r15199 | r15200 | |
| 1339 | 1332 | } |
| 1340 | 1333 | |
| 1341 | 1334 | |
| 1342 | | static const ppi8255_interface moonwar_ppi8255_0_intf = |
| 1335 | static I8255A_INTERFACE( moonwar_ppi8255_0_intf ) |
| 1343 | 1336 | { |
| 1344 | 1337 | DEVCB_INPUT_PORT("IN0"), /* Port A read */ |
| 1345 | | DEVCB_INPUT_PORT("IN1"), /* Port B read */ |
| 1346 | | DEVCB_INPUT_PORT("IN2"), /* Port C read */ |
| 1347 | 1338 | DEVCB_NULL, /* Port A write */ |
| 1339 | DEVCB_INPUT_PORT("IN1"), /* Port B read */ |
| 1348 | 1340 | DEVCB_NULL, /* Port B write */ |
| 1341 | DEVCB_INPUT_PORT("IN2"), /* Port C read */ |
| 1349 | 1342 | DEVCB_HANDLER(moonwar_port_select_w) /* Port C write */ |
| 1350 | 1343 | }; |
| 1351 | 1344 | |
| 1352 | 1345 | |
| 1353 | | |
| 1354 | 1346 | /************************************* |
| 1355 | 1347 | * |
| 1356 | 1348 | * Memory maps |
| r15199 | r15200 | |
| 1551 | 1543 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x4000) AM_RAM |
| 1552 | 1544 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x4400) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram") |
| 1553 | 1545 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x4700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1554 | | AM_RANGE(0x9800, 0x9803) AM_MIRROR(0x47fc) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 1555 | | AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x47fc) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 1546 | AM_RANGE(0x9800, 0x9803) AM_MIRROR(0x47fc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 1547 | AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x47fc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 1556 | 1548 | AM_RANGE(0xa801, 0xa801) AM_MIRROR(0x47f8) AM_WRITE(irq_enable_w) |
| 1557 | 1549 | AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x47f8) AM_WRITE(coin_count_0_w) |
| 1558 | 1550 | AM_RANGE(0xa803, 0xa803) AM_MIRROR(0x47f8) AM_WRITE(scramble_background_enable_w) |
| r15199 | r15200 | |
| 1579 | 1571 | AM_RANGE(0x1200, 0x12ff) AM_MIRROR(0x0100) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1580 | 1572 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_READ(watchdog_reset_r) |
| 1581 | 1573 | AM_RANGE(0x4000, 0xbfff) AM_ROM |
| 1582 | | AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x3efc) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 1583 | | AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 1574 | AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 1575 | AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 1584 | 1576 | ADDRESS_MAP_END |
| 1585 | 1577 | |
| 1586 | 1578 | |
| r15199 | r15200 | |
| 1590 | 1582 | AM_RANGE(0x0400, 0x0bff) AM_RAM |
| 1591 | 1583 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram") |
| 1592 | 1584 | AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1593 | | AM_RANGE(0x2400, 0x2403) AM_MIRROR(0x01fc) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 1585 | AM_RANGE(0x2400, 0x2403) AM_MIRROR(0x01fc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 1594 | 1586 | AM_RANGE(0x2601, 0x2601) AM_MIRROR(0x01f8) AM_WRITE(irq_enable_w) |
| 1595 | 1587 | AM_RANGE(0x2602, 0x2602) AM_MIRROR(0x01f8) AM_WRITE(coin_count_0_w) |
| 1596 | 1588 | AM_RANGE(0x2603, 0x2603) AM_MIRROR(0x01f8) AM_WRITE(scramble_background_enable_w) |
| r15199 | r15200 | |
| 1601 | 1593 | AM_RANGE(0x4000, 0xbfff) AM_ROM |
| 1602 | 1594 | AM_RANGE(0x7c00, 0x7fff) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram") /* mirror! */ |
| 1603 | 1595 | AM_RANGE(0xf400, 0xf400) AM_MIRROR(0x01ff) AM_READ(watchdog_reset_r) |
| 1604 | | AM_RANGE(0xf600, 0xf603) AM_MIRROR(0x01fc) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 1596 | AM_RANGE(0xf600, 0xf603) AM_MIRROR(0x01fc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 1605 | 1597 | ADDRESS_MAP_END |
| 1606 | 1598 | |
| 1607 | 1599 | |
| r15199 | r15200 | |
| 2126 | 2118 | |
| 2127 | 2119 | static MACHINE_CONFIG_DERIVED( konami_base, galaxian_base ) |
| 2128 | 2120 | |
| 2129 | | MCFG_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf ) |
| 2130 | | MCFG_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf ) |
| 2121 | MCFG_I8255A_ADD( "ppi8255_0", konami_ppi8255_0_intf ) |
| 2122 | MCFG_I8255A_ADD( "ppi8255_1", konami_ppi8255_1_intf ) |
| 2131 | 2123 | MACHINE_CONFIG_END |
| 2132 | 2124 | |
| 2133 | 2125 | |
| r15199 | r15200 | |
| 2387 | 2379 | MCFG_CPU_MODIFY("maincpu") |
| 2388 | 2380 | MCFG_CPU_PROGRAM_MAP(theend_map) |
| 2389 | 2381 | |
| 2390 | | MCFG_PPI8255_ADD( "ppi8255_0", theend_ppi8255_0_intf ) |
| 2391 | | MCFG_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf ) |
| 2382 | MCFG_I8255A_ADD( "ppi8255_0", theend_ppi8255_0_intf ) |
| 2383 | MCFG_I8255A_ADD( "ppi8255_1", konami_ppi8255_1_intf ) |
| 2392 | 2384 | MACHINE_CONFIG_END |
| 2393 | 2385 | |
| 2394 | 2386 | |
| r15199 | r15200 | |
| 2399 | 2391 | MCFG_CPU_MODIFY("maincpu") |
| 2400 | 2392 | MCFG_CPU_PROGRAM_MAP(theend_map) |
| 2401 | 2393 | |
| 2402 | | MCFG_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf ) |
| 2403 | | MCFG_PPI8255_ADD( "ppi8255_1", scramble_ppi8255_1_intf ) |
| 2394 | MCFG_I8255A_ADD( "ppi8255_0", konami_ppi8255_0_intf ) |
| 2395 | MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi8255_1_intf ) |
| 2404 | 2396 | MACHINE_CONFIG_END |
| 2405 | 2397 | |
| 2406 | 2398 | |
| r15199 | r15200 | |
| 2428 | 2420 | |
| 2429 | 2421 | static MACHINE_CONFIG_DERIVED( scorpion, theend ) |
| 2430 | 2422 | |
| 2431 | | MCFG_PPI8255_RECONFIG( "ppi8255_0", konami_ppi8255_0_intf ) |
| 2432 | | MCFG_PPI8255_RECONFIG( "ppi8255_1", scorpion_ppi8255_1_intf ) |
| 2423 | MCFG_DEVICE_REMOVE("ppi8255_0") |
| 2424 | MCFG_DEVICE_REMOVE("ppi8255_1") |
| 2425 | MCFG_I8255A_ADD( "ppi8255_0", konami_ppi8255_0_intf ) |
| 2426 | MCFG_I8255A_ADD( "ppi8255_1", scorpion_ppi8255_1_intf ) |
| 2433 | 2427 | |
| 2434 | 2428 | /* extra AY8910 with I/O ports */ |
| 2435 | 2429 | MCFG_SOUND_ADD("8910.2", AY8910, KONAMI_SOUND_CLOCK/8) |
| r15199 | r15200 | |
| 2455 | 2449 | MCFG_CPU_PROGRAM_MAP(sfx_sample_map) |
| 2456 | 2450 | MCFG_CPU_IO_MAP(sfx_sample_portmap) |
| 2457 | 2451 | |
| 2458 | | MCFG_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf ) |
| 2459 | | MCFG_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf ) |
| 2460 | | MCFG_PPI8255_ADD( "ppi8255_2", sfx_ppi8255_2_intf ) |
| 2452 | MCFG_I8255A_ADD( "ppi8255_0", konami_ppi8255_0_intf ) |
| 2453 | MCFG_I8255A_ADD( "ppi8255_1", konami_ppi8255_1_intf ) |
| 2454 | MCFG_I8255A_ADD( "ppi8255_2", sfx_ppi8255_2_intf ) |
| 2461 | 2455 | |
| 2462 | 2456 | /* port on 2nd 8910 is used for communication */ |
| 2463 | 2457 | MCFG_SOUND_MODIFY("8910.1") |
| r15199 | r15200 | |
| 2475 | 2469 | MCFG_CPU_MODIFY("maincpu") |
| 2476 | 2470 | MCFG_CPU_PROGRAM_MAP(monsterz_map) |
| 2477 | 2471 | |
| 2478 | | MCFG_PPI8255_RECONFIG( "ppi8255_1", monsterz_ppi8255_1_intf ) |
| 2472 | MCFG_DEVICE_REMOVE("ppi8255_1") |
| 2473 | MCFG_I8255A_ADD( "ppi8255_1", monsterz_ppi8255_1_intf ) |
| 2479 | 2474 | |
| 2480 | 2475 | /* there are likely other differences too, but those can wait until after protection is sorted out */ |
| 2481 | 2476 | |
| r15199 | r15200 | |
| 2518 | 2513 | |
| 2519 | 2514 | static MACHINE_CONFIG_DERIVED( moonwar, scobra ) |
| 2520 | 2515 | |
| 2521 | | /* device config overrides */ |
| 2522 | | MCFG_PPI8255_RECONFIG( "ppi8255_0", moonwar_ppi8255_0_intf ) |
| 2523 | | MCFG_PPI8255_RECONFIG( "ppi8255_1", konami_ppi8255_1_intf ) |
| 2516 | MCFG_DEVICE_REMOVE("ppi8255_0") |
| 2517 | MCFG_DEVICE_REMOVE("ppi8255_1") |
| 2518 | MCFG_I8255A_ADD( "ppi8255_0", moonwar_ppi8255_0_intf ) |
| 2519 | MCFG_I8255A_ADD( "ppi8255_1", konami_ppi8255_1_intf ) |
| 2524 | 2520 | |
| 2525 | 2521 | MCFG_PALETTE_INIT(moonwar) // bullets are less yellow |
| 2526 | 2522 | MACHINE_CONFIG_END |