trunk/src/mame/includes/gameplan.h
| r22524 | r22525 | |
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "machine/6522via.h" |
| 10 | #include "machine/6532riot.h" |
| 10 | 11 | |
| 11 | 12 | #define GAMEPLAN_MAIN_MASTER_CLOCK (XTAL_3_579545MHz) |
| 12 | 13 | #define GAMEPLAN_AUDIO_MASTER_CLOCK (XTAL_3_579545MHz) |
| r22524 | r22525 | |
| 29 | 30 | m_trvquest_question(*this, "trvquest_q"), |
| 30 | 31 | m_maincpu(*this, "maincpu"), |
| 31 | 32 | m_audiocpu(*this, "audiocpu"), |
| 33 | m_riot(*this, "riot"), |
| 32 | 34 | m_via_0(*this, "via6522_0"), |
| 33 | 35 | m_via_1(*this, "via6522_1"), |
| 34 | 36 | m_via_2(*this, "via6522_2") { } |
| r22524 | r22525 | |
| 49 | 51 | /* devices */ |
| 50 | 52 | required_device<cpu_device> m_maincpu; |
| 51 | 53 | optional_device<cpu_device> m_audiocpu; |
| 52 | | device_t *m_riot; |
| 54 | optional_device<riot6532_device> m_riot; |
| 53 | 55 | required_device<via6522_device> m_via_0; |
| 54 | 56 | required_device<via6522_device> m_via_1; |
| 55 | 57 | required_device<via6522_device> m_via_2; |
trunk/src/mame/includes/starwars.h
| r22524 | r22525 | |
| 12 | 12 | public: |
| 13 | 13 | starwars_state(const machine_config &mconfig, device_type type, const char *tag) |
| 14 | 14 | : driver_device(mconfig, type, tag), |
| 15 | m_riot(*this, "riot"), |
| 15 | 16 | m_mathram(*this, "mathram"), |
| 16 | 17 | m_maincpu(*this, "maincpu"), |
| 17 | 18 | m_audiocpu(*this, "audiocpu") { } |
| 18 | 19 | |
| 19 | 20 | UINT8 m_sound_data; |
| 20 | 21 | UINT8 m_main_data; |
| 21 | | device_t *m_riot; |
| 22 | required_device<riot6532_device> m_riot; |
| 22 | 23 | UINT8 *m_slapstic_source; |
| 23 | 24 | UINT8 *m_slapstic_base; |
| 24 | 25 | UINT8 m_slapstic_current_bank; |
| r22524 | r22525 | |
| 85 | 86 | /*----------- defined in audio/starwars.c -----------*/ |
| 86 | 87 | |
| 87 | 88 | extern const riot6532_interface starwars_riot6532_intf; |
| 88 | | SOUND_START( starwars ); |
trunk/src/mame/drivers/tomcat.c
| r22524 | r22525 | |
| 338 | 338 | AM_RANGE(0x3000, 0x30df) AM_WRITE(soundlatches_w) |
| 339 | 339 | AM_RANGE(0x30e0, 0x30e0) AM_NOP // COINRD Inputs: D7 = Coin L, D6 = Coin R, D5 = SOUNDFLAG |
| 340 | 340 | AM_RANGE(0x5000, 0x507f) AM_RAM // 6532 ram |
| 341 | | AM_RANGE(0x5080, 0x509f) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 341 | AM_RANGE(0x5080, 0x509f) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 342 | 342 | AM_RANGE(0x6000, 0x601f) AM_DEVREADWRITE("pokey1", pokey_device, read, write) |
| 343 | 343 | AM_RANGE(0x7000, 0x701f) AM_DEVREADWRITE("pokey2", pokey_device, read, write) |
| 344 | 344 | AM_RANGE(0x8000, 0xffff) AM_NOP // main sound program rom |
trunk/src/mame/drivers/firefox.c
| r22524 | r22525 | |
| 557 | 557 | static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, firefox_state ) |
| 558 | 558 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 559 | 559 | AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0700) AM_RAM /* RIOT ram */ |
| 560 | | AM_RANGE(0x0880, 0x089f) AM_MIRROR(0x07e0) AM_DEVREADWRITE_LEGACY("riot",riot6532_r, riot6532_w) |
| 560 | AM_RANGE(0x0880, 0x089f) AM_MIRROR(0x07e0) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 561 | 561 | AM_RANGE(0x1000, 0x1000) AM_READ(main_to_sound_r) |
| 562 | 562 | AM_RANGE(0x1800, 0x1800) AM_WRITE(sound_to_main_w) |
| 563 | 563 | AM_RANGE(0x2000, 0x200f) AM_DEVREADWRITE("pokey1", pokey_device, read, write) |
trunk/src/mame/drivers/gameplan.c
| r22524 | r22525 | |
| 148 | 148 | |
| 149 | 149 | WRITE8_MEMBER(gameplan_state::audio_cmd_w) |
| 150 | 150 | { |
| 151 | | riot6532_porta_in_set(m_riot, data, 0x7f); |
| 151 | m_riot->porta_in_set(data, 0x7f); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | WRITE8_MEMBER(gameplan_state::audio_trigger_w) |
| 156 | 156 | { |
| 157 | | riot6532_porta_in_set(m_riot, data << 7, 0x80); |
| 157 | m_riot->porta_in_set(data << 7, 0x80); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
| r22524 | r22525 | |
| 224 | 224 | |
| 225 | 225 | static ADDRESS_MAP_START( gameplan_audio_map, AS_PROGRAM, 8, gameplan_state ) |
| 226 | 226 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x1780) AM_RAM /* 6532 internal RAM */ |
| 227 | | AM_RANGE(0x0800, 0x081f) AM_MIRROR(0x17e0) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 227 | AM_RANGE(0x0800, 0x081f) AM_MIRROR(0x17e0) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 228 | 228 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 229 | 229 | AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ffc) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 230 | 230 | AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) |
| r22524 | r22525 | |
| 235 | 235 | /* same as Gameplan, but larger ROM */ |
| 236 | 236 | static ADDRESS_MAP_START( leprechn_audio_map, AS_PROGRAM, 8, gameplan_state ) |
| 237 | 237 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x1780) AM_RAM /* 6532 internal RAM */ |
| 238 | | AM_RANGE(0x0800, 0x081f) AM_MIRROR(0x17e0) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 238 | AM_RANGE(0x0800, 0x081f) AM_MIRROR(0x17e0) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 239 | 239 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 240 | 240 | AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ffc) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 241 | 241 | AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) |
| r22524 | r22525 | |
| 973 | 973 | |
| 974 | 974 | MACHINE_START_MEMBER(gameplan_state,gameplan) |
| 975 | 975 | { |
| 976 | | m_riot = machine().device("riot"); |
| 977 | | |
| 978 | 976 | /* register for save states */ |
| 979 | 977 | save_item(NAME(m_current_port)); |
| 980 | 978 | save_item(NAME(m_video_x)); |
trunk/src/mame/drivers/tourtabl.c
| r22524 | r22525 | |
| 58 | 58 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tourtabl_state ) |
| 59 | 59 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0100) AM_DEVREADWRITE("tia_video", tia_video_device, read, write) |
| 60 | 60 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x0100) AM_RAM |
| 61 | | AM_RANGE(0x0280, 0x029f) AM_DEVREADWRITE_LEGACY("riot1", riot6532_r, riot6532_w) |
| 61 | AM_RANGE(0x0280, 0x029f) AM_DEVREADWRITE("riot1", riot6532_device, read, write) |
| 62 | 62 | AM_RANGE(0x0400, 0x047f) AM_RAM |
| 63 | | AM_RANGE(0x0500, 0x051f) AM_DEVREADWRITE_LEGACY("riot2", riot6532_r, riot6532_w) |
| 63 | AM_RANGE(0x0500, 0x051f) AM_DEVREADWRITE("riot2", riot6532_device, read, write) |
| 64 | 64 | AM_RANGE(0x0800, 0x1fff) AM_ROM |
| 65 | 65 | AM_RANGE(0xe800, 0xffff) AM_ROM |
| 66 | 66 | ADDRESS_MAP_END |
trunk/src/mame/drivers/starwars.c
| r22524 | r22525 | |
| 200 | 200 | AM_RANGE(0x0000, 0x07ff) AM_WRITE(starwars_sout_w) |
| 201 | 201 | AM_RANGE(0x0800, 0x0fff) AM_READ(starwars_sin_r) /* SIN Read */ |
| 202 | 202 | AM_RANGE(0x1000, 0x107f) AM_RAM /* 6532 ram */ |
| 203 | | AM_RANGE(0x1080, 0x109f) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 203 | AM_RANGE(0x1080, 0x109f) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 204 | 204 | AM_RANGE(0x1800, 0x183f) AM_WRITE(quad_pokeyn_w) |
| 205 | 205 | AM_RANGE(0x2000, 0x27ff) AM_RAM /* program RAM */ |
| 206 | 206 | AM_RANGE(0x4000, 0x7fff) AM_ROM /* sound roms */ |
| r22524 | r22525 | |
| 348 | 348 | MCFG_VIDEO_START(avg_starwars) |
| 349 | 349 | |
| 350 | 350 | /* sound hardware */ |
| 351 | | MCFG_SOUND_START(starwars) |
| 352 | 351 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 353 | 352 | |
| 354 | 353 | MCFG_POKEY_ADD("pokey1", MASTER_CLOCK / 8) |
trunk/src/mame/audio/starwars.c
| r22524 | r22525 | |
| 13 | 13 | #include "includes/starwars.h" |
| 14 | 14 | |
| 15 | 15 | |
| 16 | | |
| 17 | | |
| 18 | | |
| 19 | | SOUND_START( starwars ) |
| 20 | | { |
| 21 | | starwars_state *state = machine.driver_data<starwars_state>(); |
| 22 | | state->m_riot = machine.device("riot"); |
| 23 | | } |
| 24 | | |
| 25 | | |
| 26 | 16 | /************************************* |
| 27 | 17 | * |
| 28 | 18 | * RIOT interfaces |
| r22524 | r22525 | |
| 42 | 32 | /* d1 (out) TMS5220 Not Read */ |
| 43 | 33 | /* d0 (out) TMS5220 Not Write */ |
| 44 | 34 | /* Note: bit 4 is always set to avoid sound self test */ |
| 45 | | UINT8 olddata = riot6532_porta_in_get(machine().device("riot")); |
| 35 | UINT8 olddata = m_riot->porta_in_get(); |
| 46 | 36 | |
| 47 | 37 | return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(machine().device("tms")) << 2); |
| 48 | 38 | } |
| r22524 | r22525 | |
| 85 | 75 | static TIMER_CALLBACK( sound_callback ) |
| 86 | 76 | { |
| 87 | 77 | starwars_state *state = machine.driver_data<starwars_state>(); |
| 88 | | riot6532_porta_in_set(state->m_riot, 0x40, 0x40); |
| 78 | state->m_riot->porta_in_set(0x40, 0x40); |
| 89 | 79 | state->m_main_data = param; |
| 90 | 80 | machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); |
| 91 | 81 | } |
| r22524 | r22525 | |
| 93 | 83 | |
| 94 | 84 | READ8_MEMBER(starwars_state::starwars_sin_r) |
| 95 | 85 | { |
| 96 | | riot6532_porta_in_set(m_riot, 0x00, 0x80); |
| 86 | m_riot->porta_in_set(0x00, 0x80); |
| 97 | 87 | return m_sound_data; |
| 98 | 88 | } |
| 99 | 89 | |
| r22524 | r22525 | |
| 113 | 103 | |
| 114 | 104 | READ8_MEMBER(starwars_state::starwars_main_read_r) |
| 115 | 105 | { |
| 116 | | riot6532_porta_in_set(m_riot, 0x00, 0x40); |
| 106 | m_riot->porta_in_set(0x00, 0x40); |
| 117 | 107 | return m_main_data; |
| 118 | 108 | } |
| 119 | 109 | |
| 120 | 110 | |
| 121 | 111 | READ8_MEMBER(starwars_state::starwars_main_ready_flag_r) |
| 122 | 112 | { |
| 123 | | return riot6532_porta_in_get(m_riot) & 0xc0; /* only upper two flag bits mapped */ |
| 113 | return m_riot->porta_in_get() & 0xc0; /* only upper two flag bits mapped */ |
| 124 | 114 | } |
| 125 | 115 | |
| 126 | 116 | static TIMER_CALLBACK( main_callback ) |
| 127 | 117 | { |
| 128 | 118 | starwars_state *state = machine.driver_data<starwars_state>(); |
| 129 | | if (riot6532_porta_in_get(state->m_riot) & 0x80) |
| 119 | if (state->m_riot->porta_in_get() & 0x80) |
| 130 | 120 | logerror("Sound data not read %x\n",state->m_sound_data); |
| 131 | 121 | |
| 132 | | riot6532_porta_in_set(state->m_riot, 0x80, 0x80); |
| 122 | state->m_riot->porta_in_set(0x80, 0x80); |
| 133 | 123 | state->m_sound_data = param; |
| 134 | 124 | machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); |
| 135 | 125 | } |
| r22524 | r22525 | |
| 142 | 132 | |
| 143 | 133 | WRITE8_MEMBER(starwars_state::starwars_soundrst_w) |
| 144 | 134 | { |
| 145 | | riot6532_porta_in_set(m_riot, 0x00, 0xc0); |
| 135 | m_riot->porta_in_set(0x00, 0xc0); |
| 146 | 136 | |
| 147 | 137 | /* reset sound CPU here */ |
| 148 | 138 | m_audiocpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); |
trunk/src/mame/audio/exidy.c
| r22524 | r22525 | |
| 81 | 81 | UINT8 m_riot_irq_state; |
| 82 | 82 | |
| 83 | 83 | /* 6532 variables */ |
| 84 | | device_t *m_riot; |
| 84 | riot6532_device *m_riot; |
| 85 | 85 | |
| 86 | 86 | struct sh6840_timer_channel m_sh6840_timer[3]; |
| 87 | 87 | INT16 m_sh6840_volume[3]; |
| r22524 | r22525 | |
| 532 | 532 | |
| 533 | 533 | if (state->m_tms != NULL) |
| 534 | 534 | { |
| 535 | | logerror("(%f)%s:TMS5220 data write = %02X\n", space.machine().time().as_double(), space.machine().describe_context(), riot6532_porta_out_get(state->m_riot)); |
| 535 | logerror("(%f)%s:TMS5220 data write = %02X\n", space.machine().time().as_double(), space.machine().describe_context(), state->m_riot->porta_out_get()); |
| 536 | 536 | tms5220_data_w(state->m_tms, space, 0, data); |
| 537 | 537 | } |
| 538 | 538 | } |
| r22524 | r22525 | |
| 563 | 563 | static READ8_DEVICE_HANDLER( r6532_portb_r ) |
| 564 | 564 | { |
| 565 | 565 | exidy_sound_state *state = get_safe_token(device); |
| 566 | | UINT8 newdata = riot6532_portb_in_get(state->m_riot); |
| 566 | UINT8 newdata = state->m_riot->portb_in_get(); |
| 567 | 567 | if (state->m_tms != NULL) |
| 568 | 568 | { |
| 569 | 569 | newdata &= ~0x0c; |
| r22524 | r22525 | |
| 843 | 843 | |
| 844 | 844 | DEVICE_START_CALL(common_sh_start); |
| 845 | 845 | |
| 846 | | state->m_riot = machine.device("riot"); |
| 846 | state->m_riot = machine.device<riot6532_device>("riot"); |
| 847 | 847 | |
| 848 | 848 | state->m_has_sh8253 = TRUE; |
| 849 | 849 | state->m_tms = NULL; |
| r22524 | r22525 | |
| 935 | 935 | static ADDRESS_MAP_START( venture_audio_map, AS_PROGRAM, 8, driver_device ) |
| 936 | 936 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 937 | 937 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0780) AM_RAM |
| 938 | | AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0780) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 938 | AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0780) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 939 | 939 | AM_RANGE(0x1000, 0x1003) AM_MIRROR(0x07fc) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 940 | 940 | AM_RANGE(0x1800, 0x1803) AM_MIRROR(0x07fc) AM_DEVREADWRITE_LEGACY("custom", exidy_sh8253_r, exidy_sh8253_w) |
| 941 | 941 | AM_RANGE(0x2000, 0x27ff) AM_DEVWRITE_LEGACY("custom", exidy_sound_filter_w) |
| r22524 | r22525 | |
| 977 | 977 | hc55516_digit_w(state->m_cvsd, data & 1); |
| 978 | 978 | |
| 979 | 979 | if (!(offset & 0x20)) |
| 980 | | riot6532_portb_in_set(state->m_riot, data & 1, 0xff); |
| 980 | state->m_riot->portb_in_set(data & 1, 0xff); |
| 981 | 981 | } |
| 982 | 982 | |
| 983 | 983 | |
| r22524 | r22525 | |
| 987 | 987 | |
| 988 | 988 | if (!(offset & 0x80)) |
| 989 | 989 | { |
| 990 | | UINT8 porta = riot6532_porta_out_get(state->m_riot); |
| 990 | UINT8 porta = state->m_riot->porta_out_get(); |
| 991 | 991 | UINT8 data = (porta & 0x06) >> 1; |
| 992 | 992 | data |= (porta & 0x01) << 2; |
| 993 | 993 | data |= (porta & 0x08); |
| r22524 | r22525 | |
| 1201 | 1201 | |
| 1202 | 1202 | static ADDRESS_MAP_START( victory_audio_map, AS_PROGRAM, 8, driver_device ) |
| 1203 | 1203 | AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0f00) AM_RAM |
| 1204 | | AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 1204 | AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 1205 | 1205 | AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x0ffc) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1206 | 1206 | AM_RANGE(0x3000, 0x3003) AM_MIRROR(0x0ffc) AM_DEVREADWRITE_LEGACY("custom", exidy_sh8253_r, exidy_sh8253_w) |
| 1207 | 1207 | AM_RANGE(0x4000, 0x4fff) AM_NOP |
trunk/src/emu/machine/6532riot.c
| r22524 | r22525 | |
| 156 | 156 | riot6532_w - master I/O write access |
| 157 | 157 | -------------------------------------------------*/ |
| 158 | 158 | |
| 159 | | WRITE8_DEVICE_HANDLER( riot6532_w ) |
| 160 | | { |
| 161 | | riot6532_device *via = downcast<riot6532_device *>(device); |
| 162 | | via->reg_w(offset, data); |
| 163 | | } |
| 164 | | |
| 165 | 159 | WRITE8_MEMBER( riot6532_device::write ) |
| 166 | 160 | { |
| 167 | 161 | reg_w(offset, data); |
| r22524 | r22525 | |
| 247 | 241 | riot6532_r - master I/O read access |
| 248 | 242 | -------------------------------------------------*/ |
| 249 | 243 | |
| 250 | | READ8_DEVICE_HANDLER( riot6532_r ) |
| 251 | | { |
| 252 | | riot6532_device *via = downcast<riot6532_device *>(device); |
| 253 | | return via->reg_r(offset); |
| 254 | | } |
| 255 | | |
| 256 | 244 | READ8_MEMBER( riot6532_device::read ) |
| 257 | 245 | { |
| 258 | 246 | return reg_r(offset, space.debugger_access()); |
| r22524 | r22525 | |
| 343 | 331 | porta_in_set - set port A input value |
| 344 | 332 | -------------------------------------------------*/ |
| 345 | 333 | |
| 346 | | void riot6532_porta_in_set(device_t *device, UINT8 data, UINT8 mask) |
| 347 | | { |
| 348 | | riot6532_device *via = downcast<riot6532_device *>(device); |
| 349 | | via->porta_in_set(data, mask); |
| 350 | | } |
| 351 | | |
| 352 | 334 | void riot6532_device::porta_in_set(UINT8 data, UINT8 mask) |
| 353 | 335 | { |
| 354 | 336 | m_port[0].m_in = (m_port[0].m_in & ~mask) | (data & mask); |
| r22524 | r22525 | |
| 360 | 342 | portb_in_set - set port B input value |
| 361 | 343 | -------------------------------------------------*/ |
| 362 | 344 | |
| 363 | | void riot6532_portb_in_set(device_t *device, UINT8 data, UINT8 mask) |
| 364 | | { |
| 365 | | riot6532_device *via = downcast<riot6532_device *>(device); |
| 366 | | via->portb_in_set(data, mask); |
| 367 | | } |
| 368 | | |
| 369 | 345 | void riot6532_device::portb_in_set(UINT8 data, UINT8 mask) |
| 370 | 346 | { |
| 371 | 347 | m_port[1].m_in = (m_port[1].m_in & ~mask) | (data & mask); |
| r22524 | r22525 | |
| 376 | 352 | porta_in_get - return port A input value |
| 377 | 353 | -------------------------------------------------*/ |
| 378 | 354 | |
| 379 | | UINT8 riot6532_porta_in_get(device_t *device) |
| 380 | | { |
| 381 | | riot6532_device *via = downcast<riot6532_device *>(device); |
| 382 | | return via->porta_in_get(); |
| 383 | | } |
| 384 | | |
| 385 | 355 | UINT8 riot6532_device::porta_in_get() |
| 386 | 356 | { |
| 387 | 357 | return m_port[0].m_in; |
| r22524 | r22525 | |
| 392 | 362 | portb_in_get - return port B input value |
| 393 | 363 | -------------------------------------------------*/ |
| 394 | 364 | |
| 395 | | UINT8 riot6532_portb_in_get(device_t *device) |
| 396 | | { |
| 397 | | riot6532_device *via = downcast<riot6532_device *>(device); |
| 398 | | return via->portb_in_get(); |
| 399 | | } |
| 400 | | |
| 401 | 365 | UINT8 riot6532_device::portb_in_get() |
| 402 | 366 | { |
| 403 | 367 | return m_port[1].m_in; |
| r22524 | r22525 | |
| 408 | 372 | porta_in_get - return port A output value |
| 409 | 373 | -------------------------------------------------*/ |
| 410 | 374 | |
| 411 | | UINT8 riot6532_porta_out_get(device_t *device) |
| 412 | | { |
| 413 | | riot6532_device *via = downcast<riot6532_device *>(device); |
| 414 | | return via->porta_out_get(); |
| 415 | | } |
| 416 | | |
| 417 | 375 | UINT8 riot6532_device::porta_out_get() |
| 418 | 376 | { |
| 419 | 377 | return m_port[0].m_out; |
| r22524 | r22525 | |
| 424 | 382 | portb_in_get - return port B output value |
| 425 | 383 | -------------------------------------------------*/ |
| 426 | 384 | |
| 427 | | UINT8 riot6532_portb_out_get(device_t *device) |
| 428 | | { |
| 429 | | riot6532_device *via = downcast<riot6532_device *>(device); |
| 430 | | return via->portb_out_get(); |
| 431 | | } |
| 432 | | |
| 433 | 385 | UINT8 riot6532_device::portb_out_get() |
| 434 | 386 | { |
| 435 | 387 | return m_port[1].m_out; |
trunk/src/emu/machine/6532riot.h
| r22524 | r22525 | |
| 113 | 113 | // device type definition |
| 114 | 114 | extern const device_type RIOT6532; |
| 115 | 115 | |
| 116 | | |
| 117 | | |
| 118 | | /*************************************************************************** |
| 119 | | PROTOTYPES |
| 120 | | ***************************************************************************/ |
| 121 | | |
| 122 | | DECLARE_READ8_DEVICE_HANDLER( riot6532_r ); |
| 123 | | DECLARE_WRITE8_DEVICE_HANDLER( riot6532_w ); |
| 124 | | |
| 125 | | void riot6532_porta_in_set(device_t *device, UINT8 data, UINT8 mask); |
| 126 | | void riot6532_portb_in_set(device_t *device, UINT8 data, UINT8 mask); |
| 127 | | |
| 128 | | UINT8 riot6532_porta_in_get(device_t *device); |
| 129 | | UINT8 riot6532_portb_in_get(device_t *device); |
| 130 | | |
| 131 | | UINT8 riot6532_porta_out_get(device_t *device); |
| 132 | | UINT8 riot6532_portb_out_get(device_t *device); |
| 133 | | |
| 134 | 116 | #endif |
trunk/src/mess/machine/interpod.c
| r22524 | r22525 | |
| 111 | 111 | |
| 112 | 112 | static ADDRESS_MAP_START( interpod_mem, AS_PROGRAM, 8, interpod_device ) |
| 113 | 113 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x3b80) AM_RAM // 6532 |
| 114 | | AM_RANGE(0x0400, 0x041f) AM_MIRROR(0x3be0) AM_DEVREADWRITE_LEGACY(R6532_TAG, riot6532_r, riot6532_w) |
| 114 | AM_RANGE(0x0400, 0x041f) AM_MIRROR(0x3be0) AM_DEVREADWRITE(R6532_TAG, riot6532_device, read, write) |
| 115 | 115 | AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x9ffe) AM_DEVREADWRITE(MC6850_TAG, acia6850_device, status_read, control_write) |
| 116 | 116 | AM_RANGE(0x2001, 0x2001) AM_MIRROR(0x9ffe) AM_DEVREADWRITE(MC6850_TAG, acia6850_device, data_read, data_write) |
| 117 | 117 | AM_RANGE(0x4000, 0x47ff) AM_MIRROR(0xb800) AM_ROM AM_REGION(R6502_TAG, 0) |
trunk/src/mess/machine/c8280.c
| r22524 | r22525 | |
| 86 | 86 | static ADDRESS_MAP_START( c8280_main_mem, AS_PROGRAM, 8, c8280_device ) |
| 87 | 87 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x100) AM_RAM // 6532 #1 |
| 88 | 88 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x100) AM_RAM // 6532 #2 |
| 89 | | AM_RANGE(0x0200, 0x021f) AM_MIRROR(0xd60) AM_DEVREADWRITE_LEGACY(M6532_0_TAG, riot6532_r, riot6532_w) |
| 90 | | AM_RANGE(0x0280, 0x029f) AM_MIRROR(0xd60) AM_DEVREADWRITE_LEGACY(M6532_1_TAG, riot6532_r, riot6532_w) |
| 89 | AM_RANGE(0x0200, 0x021f) AM_MIRROR(0xd60) AM_DEVREADWRITE(M6532_0_TAG, riot6532_device, read, write) |
| 90 | AM_RANGE(0x0280, 0x029f) AM_MIRROR(0xd60) AM_DEVREADWRITE(M6532_1_TAG, riot6532_device, read, write) |
| 91 | 91 | AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0xc00) AM_RAM AM_SHARE("share1") |
| 92 | 92 | AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0xc00) AM_RAM AM_SHARE("share2") |
| 93 | 93 | AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0xc00) AM_RAM AM_SHARE("share3") |
| r22524 | r22525 | |
| 455 | 455 | update_ieee_signals(); |
| 456 | 456 | |
| 457 | 457 | // set RIOT PA7 |
| 458 | | riot6532_porta_in_set(m_riot1, !state << 7, 0x80); |
| 458 | m_riot1->porta_in_set(!state << 7, 0x80); |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | |
trunk/src/mess/machine/c2040.c
| r22524 | r22525 | |
| 256 | 256 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 257 | 257 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0100) AM_RAM // 6532 #1 |
| 258 | 258 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x0100) AM_RAM // 6532 #2 |
| 259 | | AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0d60) AM_DEVREADWRITE_LEGACY(M6532_0_TAG, riot6532_r, riot6532_w) |
| 260 | | AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x0d60) AM_DEVREADWRITE_LEGACY(M6532_1_TAG, riot6532_r, riot6532_w) |
| 259 | AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0d60) AM_DEVREADWRITE(M6532_0_TAG, riot6532_device, read, write) |
| 260 | AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x0d60) AM_DEVREADWRITE(M6532_1_TAG, riot6532_device, read, write) |
| 261 | 261 | AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share1") |
| 262 | 262 | AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share2") |
| 263 | 263 | AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share3") |
| r22524 | r22525 | |
| 290 | 290 | static ADDRESS_MAP_START( c8050_main_mem, AS_PROGRAM, 8, c2040_device ) |
| 291 | 291 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0100) AM_RAM // 6532 #1 |
| 292 | 292 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x0100) AM_RAM // 6532 #2 |
| 293 | | AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0d60) AM_DEVREADWRITE_LEGACY(M6532_0_TAG, riot6532_r, riot6532_w) |
| 294 | | AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x0d60) AM_DEVREADWRITE_LEGACY(M6532_1_TAG, riot6532_r, riot6532_w) |
| 293 | AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0d60) AM_DEVREADWRITE(M6532_0_TAG, riot6532_device, read, write) |
| 294 | AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x0d60) AM_DEVREADWRITE(M6532_1_TAG, riot6532_device, read, write) |
| 295 | 295 | AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share1") |
| 296 | 296 | AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share2") |
| 297 | 297 | AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share3") |
| r22524 | r22525 | |
| 1693 | 1693 | update_ieee_signals(); |
| 1694 | 1694 | |
| 1695 | 1695 | // set RIOT PA7 |
| 1696 | | riot6532_porta_in_set(m_riot1, !state << 7, 0x80); |
| 1696 | m_riot1->porta_in_set(!state << 7, 0x80); |
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | 1699 | |
trunk/src/mess/machine/d9060.c
| r22524 | r22525 | |
| 89 | 89 | static ADDRESS_MAP_START( d9060_main_mem, AS_PROGRAM, 8, base_d9060_device ) |
| 90 | 90 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0100) AM_RAM // 6532 #1 |
| 91 | 91 | AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x0100) AM_RAM // 6532 #2 |
| 92 | | AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0d60) AM_DEVREADWRITE_LEGACY(M6532_0_TAG, riot6532_r, riot6532_w) |
| 93 | | AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x0d60) AM_DEVREADWRITE_LEGACY(M6532_1_TAG, riot6532_r, riot6532_w) |
| 92 | AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0d60) AM_DEVREADWRITE(M6532_0_TAG, riot6532_device, read, write) |
| 93 | AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x0d60) AM_DEVREADWRITE(M6532_1_TAG, riot6532_device, read, write) |
| 94 | 94 | AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share1") |
| 95 | 95 | AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share2") |
| 96 | 96 | AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share3") |
| r22524 | r22525 | |
| 559 | 559 | update_ieee_signals(); |
| 560 | 560 | |
| 561 | 561 | // set RIOT PA7 |
| 562 | | riot6532_porta_in_set(m_riot1, !state << 7, 0x80); |
| 562 | m_riot1->porta_in_set(!state << 7, 0x80); |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | |
trunk/src/mess/drivers/aim65.c
| r22524 | r22525 | |
| 35 | 35 | AM_RANGE( 0x1000, 0x9fff ) AM_NOP /* User available expansions */ |
| 36 | 36 | AM_RANGE( 0xa000, 0xa00f ) AM_MIRROR(0x3f0) AM_DEVREADWRITE("via6522_1", via6522_device, read, write) // user via |
| 37 | 37 | AM_RANGE( 0xa400, 0xa47f ) AM_RAM /* RIOT RAM */ |
| 38 | | AM_RANGE( 0xa480, 0xa497 ) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 38 | AM_RANGE( 0xa480, 0xa497 ) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 39 | 39 | AM_RANGE( 0xa498, 0xa7ff ) AM_NOP /* Not available */ |
| 40 | 40 | AM_RANGE( 0xa800, 0xa80f ) AM_MIRROR(0x3f0) AM_DEVREADWRITE("via6522_0", via6522_device, read, write) // system via |
| 41 | 41 | AM_RANGE( 0xac00, 0xac03 ) AM_DEVREADWRITE("pia6821", pia6821_device, read, write) |
trunk/src/mess/drivers/sym1.c
| r22524 | r22525 | |
| 39 | 39 | AM_RANGE(0x0c00, 0x0fff) AM_RAMBANK("bank4") AM_SHARE("ram_3k") |
| 40 | 40 | AM_RANGE(0x8000, 0x8fff) AM_ROM AM_SHARE("monitor") /* U20 Monitor ROM */ |
| 41 | 41 | AM_RANGE(0xa000, 0xa00f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write) /* U25 VIA #1 */ |
| 42 | | AM_RANGE(0xa400, 0xa40f) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) /* U27 RIOT */ |
| 42 | AM_RANGE(0xa400, 0xa40f) AM_DEVREADWRITE("riot", riot6532_device, read, write) /* U27 RIOT */ |
| 43 | 43 | AM_RANGE(0xa600, 0xa67f) AM_RAMBANK("bank5") AM_SHARE("riot_ram") /* U27 RIOT RAM */ |
| 44 | 44 | AM_RANGE(0xa800, 0xa80f) AM_DEVREADWRITE("via6522_1", via6522_device, read, write) /* U28 VIA #2 */ |
| 45 | 45 | AM_RANGE(0xac00, 0xac0f) AM_DEVREADWRITE("via6522_2", via6522_device, read, write) /* U29 VIA #3 */ |
trunk/src/mess/drivers/junior.c
| r22524 | r22525 | |
| 61 | 61 | ADDRESS_MAP_UNMAP_HIGH |
| 62 | 62 | AM_RANGE(0x0000, 0x03ff) AM_RAM // 1K RAM |
| 63 | 63 | AM_RANGE(0x1a00, 0x1a7f) AM_RAM // 6532 RAM |
| 64 | | AM_RANGE(0x1a80, 0x1aff) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 64 | AM_RANGE(0x1a80, 0x1aff) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 65 | 65 | AM_RANGE(0x1c00, 0x1fff) AM_ROM // Monitor |
| 66 | 66 | ADDRESS_MAP_END |
| 67 | 67 | |
| r22524 | r22525 | |
| 143 | 143 | |
| 144 | 144 | READ8_MEMBER( junior_state::junior_riot_b_r ) |
| 145 | 145 | { |
| 146 | | if ( riot6532_portb_out_get(m_riot) & 0x20 ) |
| 146 | if ( m_riot->portb_out_get() & 0x20 ) |
| 147 | 147 | return 0xFF; |
| 148 | 148 | |
| 149 | 149 | return 0x7F; |
trunk/src/mess/drivers/a7800.c
| r22524 | r22525 | |
| 68 | 68 | AM_RANGE(0x0020, 0x003f) AM_MIRROR(0x300) AM_READWRITE(a7800_MARIA_r, a7800_MARIA_w) |
| 69 | 69 | AM_RANGE(0x0040, 0x00ff) AM_READ_BANK("bank5") AM_WRITE(a7800_RAM0_w) /* RAM (6116 block 0) */ |
| 70 | 70 | AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("bank6") /* RAM (6116 block 1) */ |
| 71 | | AM_RANGE(0x0280, 0x02ff) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 71 | AM_RANGE(0x0280, 0x02ff) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 72 | 72 | AM_RANGE(0x0450, 0x045f) /*XBOARD POKEY1*/ |
| 73 | 73 | AM_RANGE(0x0460, 0x046f) /*XBOARD POKEY2*/ |
| 74 | 74 | AM_RANGE(0x0470, 0x047f) /*XBOARD CTRL*/ |