summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-09-13 08:41:44 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2015-09-13 08:41:44 +0200
commitf88cefad27a1737c76e09d99c9fb43e173506081 (patch)
tree2d8167d03579c46e226471747eb4407bd00ed6fa /src/devices/bus
parente92ac9e0fa8e99869894bea00589bbb526be30aa (diff)
Move all devices into separate part of src tree (nw)
Diffstat (limited to 'src/devices/bus')
-rw-r--r--src/devices/bus/a1bus/a1bus.c204
-rw-r--r--src/devices/bus/a1bus/a1bus.h145
-rw-r--r--src/devices/bus/a1bus/a1cassette.c201
-rw-r--r--src/devices/bus/a1bus/a1cassette.h53
-rw-r--r--src/devices/bus/a1bus/a1cffa.c156
-rw-r--r--src/devices/bus/a1bus/a1cffa.h53
-rw-r--r--src/devices/bus/a2bus/a2alfam2.c181
-rw-r--r--src/devices/bus/a2bus/a2alfam2.h72
-rw-r--r--src/devices/bus/a2bus/a2applicard.c286
-rw-r--r--src/devices/bus/a2bus/a2applicard.h61
-rw-r--r--src/devices/bus/a2bus/a2arcadebd.c149
-rw-r--r--src/devices/bus/a2bus/a2arcadebd.h54
-rw-r--r--src/devices/bus/a2bus/a2bus.c334
-rw-r--r--src/devices/bus/a2bus/a2bus.h197
-rw-r--r--src/devices/bus/a2bus/a2cffa.c278
-rw-r--r--src/devices/bus/a2bus/a2cffa.h86
-rw-r--r--src/devices/bus/a2bus/a2corvus.c187
-rw-r--r--src/devices/bus/a2bus/a2corvus.h55
-rw-r--r--src/devices/bus/a2bus/a2diskii.c153
-rw-r--r--src/devices/bus/a2bus/a2diskii.h67
-rw-r--r--src/devices/bus/a2bus/a2diskiing.c123
-rw-r--r--src/devices/bus/a2bus/a2diskiing.h59
-rw-r--r--src/devices/bus/a2bus/a2dx1.c119
-rw-r--r--src/devices/bus/a2bus/a2dx1.h52
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.c180
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.h146
-rw-r--r--src/devices/bus/a2bus/a2echoii.c103
-rw-r--r--src/devices/bus/a2bus/a2echoii.h49
-rw-r--r--src/devices/bus/a2bus/a2eext80col.c75
-rw-r--r--src/devices/bus/a2bus/a2eext80col.h47
-rw-r--r--src/devices/bus/a2bus/a2eramworks3.c99
-rw-r--r--src/devices/bus/a2bus/a2eramworks3.h49
-rw-r--r--src/devices/bus/a2bus/a2estd80col.c82
-rw-r--r--src/devices/bus/a2bus/a2estd80col.h47
-rw-r--r--src/devices/bus/a2bus/a2hsscsi.c323
-rw-r--r--src/devices/bus/a2bus/a2hsscsi.h65
-rw-r--r--src/devices/bus/a2bus/a2lang.c145
-rw-r--r--src/devices/bus/a2bus/a2lang.h46
-rw-r--r--src/devices/bus/a2bus/a2mcms.c382
-rw-r--r--src/devices/bus/a2bus/a2mcms.h121
-rw-r--r--src/devices/bus/a2bus/a2memexp.c230
-rw-r--r--src/devices/bus/a2bus/a2memexp.h72
-rw-r--r--src/devices/bus/a2bus/a2midi.c172
-rw-r--r--src/devices/bus/a2bus/a2midi.h55
-rw-r--r--src/devices/bus/a2bus/a2mockingboard.c528
-rw-r--r--src/devices/bus/a2bus/a2mockingboard.h97
-rw-r--r--src/devices/bus/a2bus/a2pic.c290
-rw-r--r--src/devices/bus/a2bus/a2pic.h67
-rw-r--r--src/devices/bus/a2bus/a2sam.c87
-rw-r--r--src/devices/bus/a2bus/a2sam.h48
-rw-r--r--src/devices/bus/a2bus/a2scsi.c323
-rw-r--r--src/devices/bus/a2bus/a2scsi.h64
-rw-r--r--src/devices/bus/a2bus/a2softcard.c184
-rw-r--r--src/devices/bus/a2bus/a2softcard.h54
-rw-r--r--src/devices/bus/a2bus/a2ssc.c244
-rw-r--r--src/devices/bus/a2bus/a2ssc.h58
-rw-r--r--src/devices/bus/a2bus/a2swyft.c149
-rw-r--r--src/devices/bus/a2bus/a2swyft.h52
-rw-r--r--src/devices/bus/a2bus/a2themill.c333
-rw-r--r--src/devices/bus/a2bus/a2themill.h57
-rw-r--r--src/devices/bus/a2bus/a2thunderclock.c179
-rw-r--r--src/devices/bus/a2bus/a2thunderclock.h57
-rw-r--r--src/devices/bus/a2bus/a2ultraterm.c399
-rw-r--r--src/devices/bus/a2bus/a2ultraterm.h79
-rw-r--r--src/devices/bus/a2bus/a2videoterm.c377
-rw-r--r--src/devices/bus/a2bus/a2videoterm.h121
-rw-r--r--src/devices/bus/a2bus/a2vulcan.c302
-rw-r--r--src/devices/bus/a2bus/a2vulcan.h80
-rw-r--r--src/devices/bus/a2bus/a2zipdrive.c198
-rw-r--r--src/devices/bus/a2bus/a2zipdrive.h65
-rw-r--r--src/devices/bus/a2bus/corvfdc01.c281
-rw-r--r--src/devices/bus/a2bus/corvfdc01.h65
-rw-r--r--src/devices/bus/a2bus/corvfdc02.c299
-rw-r--r--src/devices/bus/a2bus/corvfdc02.h70
-rw-r--r--src/devices/bus/a2bus/ezcgi.c315
-rw-r--r--src/devices/bus/a2bus/ezcgi.h111
-rw-r--r--src/devices/bus/a2bus/laser128.c146
-rw-r--r--src/devices/bus/a2bus/laser128.h54
-rw-r--r--src/devices/bus/a2bus/mouse.c531
-rw-r--r--src/devices/bus/a2bus/mouse.h93
-rw-r--r--src/devices/bus/a2bus/ramcard128k.c190
-rw-r--r--src/devices/bus/a2bus/ramcard128k.h56
-rw-r--r--src/devices/bus/a2bus/ramcard16k.c170
-rw-r--r--src/devices/bus/a2bus/ramcard16k.h55
-rw-r--r--src/devices/bus/a2bus/timemasterho.c280
-rw-r--r--src/devices/bus/a2bus/timemasterho.h67
-rw-r--r--src/devices/bus/a7800/a78_carts.h39
-rw-r--r--src/devices/bus/a7800/a78_slot.c831
-rw-r--r--src/devices/bus/a7800/a78_slot.h155
-rw-r--r--src/devices/bus/a7800/cpuwiz.c132
-rw-r--r--src/devices/bus/a7800/cpuwiz.h74
-rw-r--r--src/devices/bus/a7800/hiscore.c77
-rw-r--r--src/devices/bus/a7800/hiscore.h40
-rw-r--r--src/devices/bus/a7800/rom.c497
-rw-r--r--src/devices/bus/a7800/rom.h261
-rw-r--r--src/devices/bus/a7800/xboard.c239
-rw-r--r--src/devices/bus/a7800/xboard.h71
-rw-r--r--src/devices/bus/a800/a800_carts.h50
-rw-r--r--src/devices/bus/a800/a800_slot.c549
-rw-r--r--src/devices/bus/a800/a800_slot.h188
-rw-r--r--src/devices/bus/a800/oss.c252
-rw-r--r--src/devices/bus/a800/oss.h97
-rw-r--r--src/devices/bus/a800/rom.c447
-rw-r--r--src/devices/bus/a800/rom.h224
-rw-r--r--src/devices/bus/a800/sparta.c71
-rw-r--r--src/devices/bus/a800/sparta.h34
-rw-r--r--src/devices/bus/a8sio/a8sio.c219
-rw-r--r--src/devices/bus/a8sio/a8sio.h144
-rw-r--r--src/devices/bus/a8sio/cassette.c117
-rw-r--r--src/devices/bus/a8sio/cassette.h54
-rw-r--r--src/devices/bus/abcbus/abc890.c408
-rw-r--r--src/devices/bus/abcbus/abc890.h130
-rw-r--r--src/devices/bus/abcbus/abcbus.c144
-rw-r--r--src/devices/bus/abcbus/abcbus.h319
-rw-r--r--src/devices/bus/abcbus/fd2.c432
-rw-r--r--src/devices/bus/abcbus/fd2.h83
-rw-r--r--src/devices/bus/abcbus/hdc.c151
-rw-r--r--src/devices/bus/abcbus/hdc.h57
-rw-r--r--src/devices/bus/abcbus/lux10828.c678
-rw-r--r--src/devices/bus/abcbus/lux10828.h115
-rw-r--r--src/devices/bus/abcbus/lux21046.c1163
-rw-r--r--src/devices/bus/abcbus/lux21046.h200
-rw-r--r--src/devices/bus/abcbus/lux21056.c673
-rw-r--r--src/devices/bus/abcbus/lux21056.h108
-rw-r--r--src/devices/bus/abcbus/lux4105.c393
-rw-r--r--src/devices/bus/abcbus/lux4105.h92
-rw-r--r--src/devices/bus/abcbus/memcard.c163
-rw-r--r--src/devices/bus/abcbus/memcard.h56
-rw-r--r--src/devices/bus/abcbus/ram.c79
-rw-r--r--src/devices/bus/abcbus/ram.h51
-rw-r--r--src/devices/bus/abcbus/sio.c160
-rw-r--r--src/devices/bus/abcbus/sio.h53
-rw-r--r--src/devices/bus/abcbus/slutprov.c79
-rw-r--r--src/devices/bus/abcbus/slutprov.h44
-rw-r--r--src/devices/bus/abcbus/turbo.c149
-rw-r--r--src/devices/bus/abcbus/turbo.h56
-rw-r--r--src/devices/bus/abcbus/uni800.c110
-rw-r--r--src/devices/bus/abcbus/uni800.h44
-rw-r--r--src/devices/bus/abckb/abc77.c658
-rw-r--r--src/devices/bus/abckb/abc77.h116
-rw-r--r--src/devices/bus/abckb/abc800kb.c507
-rw-r--r--src/devices/bus/abckb/abc800kb.h90
-rw-r--r--src/devices/bus/abckb/abc99.c782
-rw-r--r--src/devices/bus/abckb/abc99.h114
-rw-r--r--src/devices/bus/abckb/abckb.c136
-rw-r--r--src/devices/bus/abckb/abckb.h97
-rw-r--r--src/devices/bus/adam/adamlink.c84
-rw-r--r--src/devices/bus/adam/adamlink.h47
-rw-r--r--src/devices/bus/adam/exp.c190
-rw-r--r--src/devices/bus/adam/exp.h130
-rw-r--r--src/devices/bus/adam/ide.c209
-rw-r--r--src/devices/bus/adam/ide.h59
-rw-r--r--src/devices/bus/adam/ram.c72
-rw-r--r--src/devices/bus/adam/ram.h50
-rw-r--r--src/devices/bus/adamnet/adamnet.c264
-rw-r--r--src/devices/bus/adamnet/adamnet.h131
-rw-r--r--src/devices/bus/adamnet/ddp.c308
-rw-r--r--src/devices/bus/adamnet/ddp.h67
-rw-r--r--src/devices/bus/adamnet/fdc.c352
-rw-r--r--src/devices/bus/adamnet/fdc.h69
-rw-r--r--src/devices/bus/adamnet/kb.c425
-rw-r--r--src/devices/bus/adamnet/kb.h78
-rw-r--r--src/devices/bus/adamnet/printer.c257
-rw-r--r--src/devices/bus/adamnet/printer.h61
-rw-r--r--src/devices/bus/adamnet/spi.c185
-rw-r--r--src/devices/bus/adamnet/spi.h60
-rw-r--r--src/devices/bus/amiga/zorro/a2052.c134
-rw-r--r--src/devices/bus/amiga/zorro/a2052.h51
-rw-r--r--src/devices/bus/amiga/zorro/a2232.c651
-rw-r--r--src/devices/bus/amiga/zorro/a2232.h151
-rw-r--r--src/devices/bus/amiga/zorro/a590.c349
-rw-r--r--src/devices/bus/amiga/zorro/a590.h134
-rw-r--r--src/devices/bus/amiga/zorro/action_replay.c149
-rw-r--r--src/devices/bus/amiga/zorro/action_replay.h82
-rw-r--r--src/devices/bus/amiga/zorro/buddha.c350
-rw-r--r--src/devices/bus/amiga/zorro/buddha.h82
-rw-r--r--src/devices/bus/amiga/zorro/cards.c39
-rw-r--r--src/devices/bus/amiga/zorro/cards.h44
-rw-r--r--src/devices/bus/amiga/zorro/zorro.c378
-rw-r--r--src/devices/bus/amiga/zorro/zorro.h449
-rw-r--r--src/devices/bus/apf/rom.c78
-rw-r--r--src/devices/bus/apf/rom.h62
-rw-r--r--src/devices/bus/apf/slot.c294
-rw-r--r--src/devices/bus/apf/slot.h116
-rw-r--r--src/devices/bus/apricot/cards.c15
-rw-r--r--src/devices/bus/apricot/cards.h19
-rw-r--r--src/devices/bus/apricot/expansion.c192
-rw-r--r--src/devices/bus/apricot/expansion.h208
-rw-r--r--src/devices/bus/apricot/ram.c177
-rw-r--r--src/devices/bus/apricot/ram.h89
-rw-r--r--src/devices/bus/arcadia/rom.c62
-rw-r--r--src/devices/bus/arcadia/rom.h44
-rw-r--r--src/devices/bus/arcadia/slot.c260
-rw-r--r--src/devices/bus/arcadia/slot.h103
-rw-r--r--src/devices/bus/astrocde/exp.c85
-rw-r--r--src/devices/bus/astrocde/exp.h57
-rw-r--r--src/devices/bus/astrocde/ram.c211
-rw-r--r--src/devices/bus/astrocde/ram.h135
-rw-r--r--src/devices/bus/astrocde/rom.c99
-rw-r--r--src/devices/bus/astrocde/rom.h73
-rw-r--r--src/devices/bus/astrocde/slot.c236
-rw-r--r--src/devices/bus/astrocde/slot.h103
-rw-r--r--src/devices/bus/bml3/bml3bus.c241
-rw-r--r--src/devices/bus/bml3/bml3bus.h153
-rw-r--r--src/devices/bus/bml3/bml3kanji.c101
-rw-r--r--src/devices/bus/bml3/bml3kanji.h49
-rw-r--r--src/devices/bus/bml3/bml3mp1802.c143
-rw-r--r--src/devices/bus/bml3/bml3mp1802.h58
-rw-r--r--src/devices/bus/bml3/bml3mp1805.c170
-rw-r--r--src/devices/bus/bml3/bml3mp1805.h54
-rw-r--r--src/devices/bus/bw2/exp.c191
-rw-r--r--src/devices/bus/bw2/exp.h131
-rw-r--r--src/devices/bus/bw2/ramcard.c126
-rw-r--r--src/devices/bus/bw2/ramcard.h59
-rw-r--r--src/devices/bus/c64/16kb.c124
-rw-r--r--src/devices/bus/c64/16kb.h59
-rw-r--r--src/devices/bus/c64/4dxh.c77
-rw-r--r--src/devices/bus/c64/4dxh.h50
-rw-r--r--src/devices/bus/c64/4ksa.c77
-rw-r--r--src/devices/bus/c64/4ksa.h50
-rw-r--r--src/devices/bus/c64/4tba.c77
-rw-r--r--src/devices/bus/c64/4tba.h50
-rw-r--r--src/devices/bus/c64/bn1541.c154
-rw-r--r--src/devices/bus/c64/bn1541.h82
-rw-r--r--src/devices/bus/c64/c128_comal80.c103
-rw-r--r--src/devices/bus/c64/c128_comal80.h51
-rw-r--r--src/devices/bus/c64/c128_partner.c250
-rw-r--r--src/devices/bus/c64/c128_partner.h68
-rw-r--r--src/devices/bus/c64/comal80.c86
-rw-r--r--src/devices/bus/c64/comal80.h51
-rw-r--r--src/devices/bus/c64/cpm.c230
-rw-r--r--src/devices/bus/c64/cpm.h65
-rw-r--r--src/devices/bus/c64/currah_speech.c255
-rw-r--r--src/devices/bus/c64/currah_speech.h58
-rw-r--r--src/devices/bus/c64/dela_ep256.c156
-rw-r--r--src/devices/bus/c64/dela_ep256.h60
-rw-r--r--src/devices/bus/c64/dela_ep64.c146
-rw-r--r--src/devices/bus/c64/dela_ep64.h64
-rw-r--r--src/devices/bus/c64/dela_ep7x8.c133
-rw-r--r--src/devices/bus/c64/dela_ep7x8.h65
-rw-r--r--src/devices/bus/c64/dinamic.c74
-rw-r--r--src/devices/bus/c64/dinamic.h50
-rw-r--r--src/devices/bus/c64/dqbb.c121
-rw-r--r--src/devices/bus/c64/dqbb.h59
-rw-r--r--src/devices/bus/c64/easy_calc_result.c107
-rw-r--r--src/devices/bus/c64/easy_calc_result.h51
-rw-r--r--src/devices/bus/c64/easyflash.c228
-rw-r--r--src/devices/bus/c64/easyflash.h64
-rw-r--r--src/devices/bus/c64/epyx_fast_load.c116
-rw-r--r--src/devices/bus/c64/epyx_fast_load.h52
-rw-r--r--src/devices/bus/c64/exos.c67
-rw-r--r--src/devices/bus/c64/exos.h47
-rw-r--r--src/devices/bus/c64/exp.c445
-rw-r--r--src/devices/bus/c64/exp.h202
-rw-r--r--src/devices/bus/c64/fcc.c255
-rw-r--r--src/devices/bus/c64/fcc.h69
-rw-r--r--src/devices/bus/c64/final.c134
-rw-r--r--src/devices/bus/c64/final.h53
-rw-r--r--src/devices/bus/c64/final3.c150
-rw-r--r--src/devices/bus/c64/final3.h57
-rw-r--r--src/devices/bus/c64/fun_play.c98
-rw-r--r--src/devices/bus/c64/fun_play.h51
-rw-r--r--src/devices/bus/c64/geocable.c72
-rw-r--r--src/devices/bus/c64/geocable.h63
-rw-r--r--src/devices/bus/c64/georam.c99
-rw-r--r--src/devices/bus/c64/georam.h53
-rw-r--r--src/devices/bus/c64/ide64.c357
-rw-r--r--src/devices/bus/c64/ide64.h70
-rw-r--r--src/devices/bus/c64/ieee488.c249
-rw-r--r--src/devices/bus/c64/ieee488.h67
-rw-r--r--src/devices/bus/c64/kingsoft.c98
-rw-r--r--src/devices/bus/c64/kingsoft.h49
-rw-r--r--src/devices/bus/c64/mach5.c118
-rw-r--r--src/devices/bus/c64/mach5.h55
-rw-r--r--src/devices/bus/c64/magic_desk.c85
-rw-r--r--src/devices/bus/c64/magic_desk.h51
-rw-r--r--src/devices/bus/c64/magic_formel.c267
-rw-r--r--src/devices/bus/c64/magic_formel.h71
-rw-r--r--src/devices/bus/c64/magic_voice.c372
-rw-r--r--src/devices/bus/c64/magic_voice.h82
-rw-r--r--src/devices/bus/c64/midi_maplin.c152
-rw-r--r--src/devices/bus/c64/midi_maplin.h56
-rw-r--r--src/devices/bus/c64/midi_namesoft.c150
-rw-r--r--src/devices/bus/c64/midi_namesoft.h56
-rw-r--r--src/devices/bus/c64/midi_passport.c195
-rw-r--r--src/devices/bus/c64/midi_passport.h62
-rw-r--r--src/devices/bus/c64/midi_sci.c151
-rw-r--r--src/devices/bus/c64/midi_sci.h56
-rw-r--r--src/devices/bus/c64/midi_siel.c152
-rw-r--r--src/devices/bus/c64/midi_siel.h56
-rw-r--r--src/devices/bus/c64/mikro_assembler.c57
-rw-r--r--src/devices/bus/c64/mikro_assembler.h46
-rw-r--r--src/devices/bus/c64/multiscreen.c226
-rw-r--r--src/devices/bus/c64/multiscreen.h57
-rw-r--r--src/devices/bus/c64/music64.c238
-rw-r--r--src/devices/bus/c64/music64.h63
-rw-r--r--src/devices/bus/c64/neoram.c99
-rw-r--r--src/devices/bus/c64/neoram.h57
-rw-r--r--src/devices/bus/c64/ocean.c115
-rw-r--r--src/devices/bus/c64/ocean.h51
-rw-r--r--src/devices/bus/c64/pagefox.c137
-rw-r--r--src/devices/bus/c64/pagefox.h53
-rw-r--r--src/devices/bus/c64/partner.c208
-rw-r--r--src/devices/bus/c64/partner.h60
-rw-r--r--src/devices/bus/c64/prophet64.c86
-rw-r--r--src/devices/bus/c64/prophet64.h51
-rw-r--r--src/devices/bus/c64/ps64.c157
-rw-r--r--src/devices/bus/c64/ps64.h52
-rw-r--r--src/devices/bus/c64/reu.c137
-rw-r--r--src/devices/bus/c64/reu.h101
-rw-r--r--src/devices/bus/c64/rex.c78
-rw-r--r--src/devices/bus/c64/rex.h47
-rw-r--r--src/devices/bus/c64/rex_ep256.c165
-rw-r--r--src/devices/bus/c64/rex_ep256.h60
-rw-r--r--src/devices/bus/c64/ross.c92
-rw-r--r--src/devices/bus/c64/ross.h52
-rw-r--r--src/devices/bus/c64/sfx_sound_expander.c286
-rw-r--r--src/devices/bus/c64/sfx_sound_expander.h71
-rw-r--r--src/devices/bus/c64/silverrock.c132
-rw-r--r--src/devices/bus/c64/silverrock.h51
-rw-r--r--src/devices/bus/c64/simons_basic.c84
-rw-r--r--src/devices/bus/c64/simons_basic.h48
-rw-r--r--src/devices/bus/c64/stardos.c194
-rw-r--r--src/devices/bus/c64/stardos.h60
-rw-r--r--src/devices/bus/c64/std.c68
-rw-r--r--src/devices/bus/c64/std.h46
-rw-r--r--src/devices/bus/c64/structured_basic.c103
-rw-r--r--src/devices/bus/c64/structured_basic.h52
-rw-r--r--src/devices/bus/c64/super_explode.c125
-rw-r--r--src/devices/bus/c64/super_explode.h54
-rw-r--r--src/devices/bus/c64/super_games.c102
-rw-r--r--src/devices/bus/c64/super_games.h51
-rw-r--r--src/devices/bus/c64/supercpu.c306
-rw-r--r--src/devices/bus/c64/supercpu.h63
-rw-r--r--src/devices/bus/c64/sw8k.c114
-rw-r--r--src/devices/bus/c64/sw8k.h55
-rw-r--r--src/devices/bus/c64/swiftlink.c175
-rw-r--r--src/devices/bus/c64/swiftlink.h76
-rw-r--r--src/devices/bus/c64/system3.c90
-rw-r--r--src/devices/bus/c64/system3.h51
-rw-r--r--src/devices/bus/c64/tdos.c341
-rw-r--r--src/devices/bus/c64/tdos.h61
-rw-r--r--src/devices/bus/c64/turbo232.c219
-rw-r--r--src/devices/bus/c64/turbo232.h89
-rw-r--r--src/devices/bus/c64/user.c32
-rw-r--r--src/devices/bus/c64/user.h33
-rw-r--r--src/devices/bus/c64/vizastar.c89
-rw-r--r--src/devices/bus/c64/vizastar.h46
-rw-r--r--src/devices/bus/c64/vw64.c127
-rw-r--r--src/devices/bus/c64/vw64.h52
-rw-r--r--src/devices/bus/c64/warp_speed.c147
-rw-r--r--src/devices/bus/c64/warp_speed.h54
-rw-r--r--src/devices/bus/c64/westermann.c82
-rw-r--r--src/devices/bus/c64/westermann.h47
-rw-r--r--src/devices/bus/c64/xl80.c239
-rw-r--r--src/devices/bus/c64/xl80.h64
-rw-r--r--src/devices/bus/c64/zaxxon.c66
-rw-r--r--src/devices/bus/c64/zaxxon.h49
-rw-r--r--src/devices/bus/cbm2/24k.c88
-rw-r--r--src/devices/bus/cbm2/24k.h48
-rw-r--r--src/devices/bus/cbm2/exp.c206
-rw-r--r--src/devices/bus/cbm2/exp.h136
-rw-r--r--src/devices/bus/cbm2/hrg.c231
-rw-r--r--src/devices/bus/cbm2/hrg.h83
-rw-r--r--src/devices/bus/cbm2/std.c65
-rw-r--r--src/devices/bus/cbm2/std.h45
-rw-r--r--src/devices/bus/cbm2/user.c77
-rw-r--r--src/devices/bus/cbm2/user.h157
-rw-r--r--src/devices/bus/cbmiec/c1526.c269
-rw-r--r--src/devices/bus/cbmiec/c1526.h90
-rw-r--r--src/devices/bus/cbmiec/c1541.c1211
-rw-r--r--src/devices/bus/cbmiec/c1541.h300
-rw-r--r--src/devices/bus/cbmiec/c1571.c1040
-rw-r--r--src/devices/bus/cbmiec/c1571.h187
-rw-r--r--src/devices/bus/cbmiec/c1581.c470
-rw-r--r--src/devices/bus/cbmiec/c1581.h112
-rw-r--r--src/devices/bus/cbmiec/c64_nl10.c102
-rw-r--r--src/devices/bus/cbmiec/c64_nl10.h52
-rw-r--r--src/devices/bus/cbmiec/cbmiec.c526
-rw-r--r--src/devices/bus/cbmiec/cbmiec.h210
-rw-r--r--src/devices/bus/cbmiec/cmdhd.c198
-rw-r--r--src/devices/bus/cbmiec/cmdhd.h72
-rw-r--r--src/devices/bus/cbmiec/diag264_lb_iec.c52
-rw-r--r--src/devices/bus/cbmiec/diag264_lb_iec.h46
-rw-r--r--src/devices/bus/cbmiec/fd2000.c361
-rw-r--r--src/devices/bus/cbmiec/fd2000.h97
-rw-r--r--src/devices/bus/cbmiec/interpod.c182
-rw-r--r--src/devices/bus/cbmiec/interpod.h76
-rw-r--r--src/devices/bus/cbmiec/serialbox.c150
-rw-r--r--src/devices/bus/cbmiec/serialbox.h65
-rw-r--r--src/devices/bus/cbmiec/vic1515.c164
-rw-r--r--src/devices/bus/cbmiec/vic1515.h55
-rw-r--r--src/devices/bus/cbmiec/vic1520.c192
-rw-r--r--src/devices/bus/cbmiec/vic1520.h55
-rw-r--r--src/devices/bus/centronics/comxpl80.c328
-rw-r--r--src/devices/bus/centronics/comxpl80.h81
-rw-r--r--src/devices/bus/centronics/covox.c127
-rw-r--r--src/devices/bus/centronics/covox.h94
-rw-r--r--src/devices/bus/centronics/ctronics.c132
-rw-r--r--src/devices/bus/centronics/ctronics.h222
-rw-r--r--src/devices/bus/centronics/digiblst.c63
-rw-r--r--src/devices/bus/centronics/digiblst.h60
-rw-r--r--src/devices/bus/centronics/dsjoy.c48
-rw-r--r--src/devices/bus/centronics/dsjoy.h47
-rw-r--r--src/devices/bus/centronics/epson_ex800.c496
-rw-r--r--src/devices/bus/centronics/epson_ex800.h76
-rw-r--r--src/devices/bus/centronics/epson_lx800.c358
-rw-r--r--src/devices/bus/centronics/epson_lx800.h73
-rw-r--r--src/devices/bus/centronics/epson_lx810l.c632
-rw-r--r--src/devices/bus/centronics/epson_lx810l.h141
-rw-r--r--src/devices/bus/centronics/printer.c133
-rw-r--r--src/devices/bus/centronics/printer.h58
-rw-r--r--src/devices/bus/cgenie/expansion/carts.c13
-rw-r--r--src/devices/bus/cgenie/expansion/carts.h20
-rw-r--r--src/devices/bus/cgenie/expansion/expansion.c108
-rw-r--r--src/devices/bus/cgenie/expansion/expansion.h128
-rw-r--r--src/devices/bus/cgenie/expansion/floppy.c226
-rw-r--r--src/devices/bus/cgenie/expansion/floppy.h76
-rw-r--r--src/devices/bus/cgenie/parallel/carts.c14
-rw-r--r--src/devices/bus/cgenie/parallel/carts.h21
-rw-r--r--src/devices/bus/cgenie/parallel/joystick.c153
-rw-r--r--src/devices/bus/cgenie/parallel/joystick.h48
-rw-r--r--src/devices/bus/cgenie/parallel/parallel.c115
-rw-r--r--src/devices/bus/cgenie/parallel/parallel.h94
-rw-r--r--src/devices/bus/cgenie/parallel/printer.c132
-rw-r--r--src/devices/bus/cgenie/parallel/printer.h58
-rw-r--r--src/devices/bus/chanf/rom.c242
-rw-r--r--src/devices/bus/chanf/rom.h144
-rw-r--r--src/devices/bus/chanf/slot.c286
-rw-r--r--src/devices/bus/chanf/slot.h119
-rw-r--r--src/devices/bus/coco/coco_232.c92
-rw-r--r--src/devices/bus/coco/coco_232.h42
-rw-r--r--src/devices/bus/coco/coco_dwsock.c210
-rw-r--r--src/devices/bus/coco/coco_dwsock.h73
-rw-r--r--src/devices/bus/coco/coco_fdc.c713
-rw-r--r--src/devices/bus/coco/coco_fdc.h180
-rw-r--r--src/devices/bus/coco/coco_multi.c274
-rw-r--r--src/devices/bus/coco/coco_multi.h69
-rw-r--r--src/devices/bus/coco/coco_orch90.c85
-rw-r--r--src/devices/bus/coco/coco_orch90.h42
-rw-r--r--src/devices/bus/coco/coco_pak.c179
-rw-r--r--src/devices/bus/coco/coco_pak.h65
-rw-r--r--src/devices/bus/coco/cococart.c451
-rw-r--r--src/devices/bus/coco/cococart.h183
-rw-r--r--src/devices/bus/coleco/ctrl.c77
-rw-r--r--src/devices/bus/coleco/ctrl.h105
-rw-r--r--src/devices/bus/coleco/exp.c156
-rw-r--r--src/devices/bus/coleco/exp.h132
-rw-r--r--src/devices/bus/coleco/hand.c126
-rw-r--r--src/devices/bus/coleco/hand.h55
-rw-r--r--src/devices/bus/coleco/sac.c138
-rw-r--r--src/devices/bus/coleco/sac.h56
-rw-r--r--src/devices/bus/coleco/std.c60
-rw-r--r--src/devices/bus/coleco/std.h44
-rw-r--r--src/devices/bus/coleco/xin1.c71
-rw-r--r--src/devices/bus/coleco/xin1.h48
-rw-r--r--src/devices/bus/compucolor/floppy.c252
-rw-r--r--src/devices/bus/compucolor/floppy.h123
-rw-r--r--src/devices/bus/comx35/clm.c263
-rw-r--r--src/devices/bus/comx35/clm.h63
-rw-r--r--src/devices/bus/comx35/eprom.c121
-rw-r--r--src/devices/bus/comx35/eprom.h56
-rw-r--r--src/devices/bus/comx35/exp.c187
-rw-r--r--src/devices/bus/comx35/exp.h145
-rw-r--r--src/devices/bus/comx35/expbox.c306
-rw-r--r--src/devices/bus/comx35/expbox.h77
-rw-r--r--src/devices/bus/comx35/fdc.c286
-rw-r--r--src/devices/bus/comx35/fdc.h70
-rw-r--r--src/devices/bus/comx35/joycard.c114
-rw-r--r--src/devices/bus/comx35/joycard.h53
-rw-r--r--src/devices/bus/comx35/printer.c191
-rw-r--r--src/devices/bus/comx35/printer.h60
-rw-r--r--src/devices/bus/comx35/ram.c103
-rw-r--r--src/devices/bus/comx35/ram.h53
-rw-r--r--src/devices/bus/comx35/thermal.c127
-rw-r--r--src/devices/bus/comx35/thermal.h54
-rw-r--r--src/devices/bus/cpc/amdrum.c69
-rw-r--r--src/devices/bus/cpc/amdrum.h48
-rw-r--r--src/devices/bus/cpc/brunword4.c110
-rw-r--r--src/devices/bus/cpc/brunword4.h38
-rw-r--r--src/devices/bus/cpc/cpc_pds.c76
-rw-r--r--src/devices/bus/cpc/cpc_pds.h58
-rw-r--r--src/devices/bus/cpc/cpc_rom.c135
-rw-r--r--src/devices/bus/cpc/cpc_rom.h90
-rw-r--r--src/devices/bus/cpc/cpc_rs232.c164
-rw-r--r--src/devices/bus/cpc/cpc_rs232.h65
-rw-r--r--src/devices/bus/cpc/cpc_ssa1.c220
-rw-r--r--src/devices/bus/cpc/cpc_ssa1.h128
-rw-r--r--src/devices/bus/cpc/cpcexp.c89
-rw-r--r--src/devices/bus/cpc/cpcexp.h154
-rw-r--r--src/devices/bus/cpc/ddi1.c139
-rw-r--r--src/devices/bus/cpc/ddi1.h47
-rw-r--r--src/devices/bus/cpc/hd20.c131
-rw-r--r--src/devices/bus/cpc/hd20.h50
-rw-r--r--src/devices/bus/cpc/magicsound.c190
-rw-r--r--src/devices/bus/cpc/magicsound.h91
-rw-r--r--src/devices/bus/cpc/mface2.c343
-rw-r--r--src/devices/bus/cpc/mface2.h71
-rw-r--r--src/devices/bus/cpc/playcity.c162
-rw-r--r--src/devices/bus/cpc/playcity.h68
-rw-r--r--src/devices/bus/cpc/smartwatch.c91
-rw-r--r--src/devices/bus/cpc/smartwatch.h48
-rw-r--r--src/devices/bus/cpc/symbfac2.c295
-rw-r--r--src/devices/bus/cpc/symbfac2.h85
-rw-r--r--src/devices/bus/crvision/rom.c140
-rw-r--r--src/devices/bus/crvision/rom.h116
-rw-r--r--src/devices/bus/crvision/slot.c295
-rw-r--r--src/devices/bus/crvision/slot.h108
-rw-r--r--src/devices/bus/dmv/dmvbus.c381
-rw-r--r--src/devices/bus/dmv/dmvbus.h122
-rw-r--r--src/devices/bus/dmv/k210.c166
-rw-r--r--src/devices/bus/dmv/k210.h71
-rw-r--r--src/devices/bus/dmv/k220.c275
-rw-r--r--src/devices/bus/dmv/k220.h60
-rw-r--r--src/devices/bus/dmv/k230.c315
-rw-r--r--src/devices/bus/dmv/k230.h146
-rw-r--r--src/devices/bus/dmv/k233.c89
-rw-r--r--src/devices/bus/dmv/k233.h44
-rw-r--r--src/devices/bus/dmv/k801.c280
-rw-r--r--src/devices/bus/dmv/k801.h106
-rw-r--r--src/devices/bus/dmv/k803.c133
-rw-r--r--src/devices/bus/dmv/k803.h54
-rw-r--r--src/devices/bus/dmv/k806.c243
-rw-r--r--src/devices/bus/dmv/k806.h72
-rw-r--r--src/devices/bus/dmv/ram.c96
-rw-r--r--src/devices/bus/dmv/ram.h71
-rw-r--r--src/devices/bus/ecbbus/ecbbus.c211
-rw-r--r--src/devices/bus/ecbbus/ecbbus.h187
-rw-r--r--src/devices/bus/ecbbus/grip.c902
-rw-r--r--src/devices/bus/ecbbus/grip.h131
-rw-r--r--src/devices/bus/econet/e01.c716
-rw-r--r--src/devices/bus/econet/e01.h135
-rw-r--r--src/devices/bus/econet/econet.c313
-rw-r--r--src/devices/bus/econet/econet.h165
-rw-r--r--src/devices/bus/ep64/exdos.c243
-rw-r--r--src/devices/bus/ep64/exdos.h64
-rw-r--r--src/devices/bus/ep64/exp.c90
-rw-r--r--src/devices/bus/ep64/exp.h151
-rw-r--r--src/devices/bus/epson_sio/epson_sio.c115
-rw-r--r--src/devices/bus/epson_sio/epson_sio.h96
-rw-r--r--src/devices/bus/epson_sio/pf10.c241
-rw-r--r--src/devices/bus/epson_sio/pf10.h101
-rw-r--r--src/devices/bus/epson_sio/tf20.c320
-rw-r--r--src/devices/bus/epson_sio/tf20.h91
-rw-r--r--src/devices/bus/gameboy/gb_slot.c860
-rw-r--r--src/devices/bus/gameboy/gb_slot.h211
-rw-r--r--src/devices/bus/gameboy/mbc.c1274
-rw-r--r--src/devices/bus/gameboy/mbc.h393
-rw-r--r--src/devices/bus/gameboy/rom.c364
-rw-r--r--src/devices/bus/gameboy/rom.h146
-rw-r--r--src/devices/bus/gamegear/ggext.c120
-rw-r--r--src/devices/bus/gamegear/ggext.h122
-rw-r--r--src/devices/bus/gamegear/smsctrladp.c94
-rw-r--r--src/devices/bus/gamegear/smsctrladp.h56
-rw-r--r--src/devices/bus/gba/gba_slot.c465
-rw-r--r--src/devices/bus/gba/gba_slot.h583
-rw-r--r--src/devices/bus/gba/rom.c438
-rw-r--r--src/devices/bus/gba/rom.h174
-rw-r--r--src/devices/bus/generic/carts.c22
-rw-r--r--src/devices/bus/generic/carts.h24
-rw-r--r--src/devices/bus/generic/ram.c123
-rw-r--r--src/devices/bus/generic/ram.h109
-rw-r--r--src/devices/bus/generic/rom.c122
-rw-r--r--src/devices/bus/generic/rom.h75
-rw-r--r--src/devices/bus/generic/slot.c283
-rw-r--r--src/devices/bus/generic/slot.h176
-rw-r--r--src/devices/bus/ieee488/c2031.c482
-rw-r--r--src/devices/bus/ieee488/c2031.h87
-rw-r--r--src/devices/bus/ieee488/c2040.c802
-rw-r--r--src/devices/bus/ieee488/c2040.h133
-rw-r--r--src/devices/bus/ieee488/c2040fdc.c623
-rw-r--r--src/devices/bus/ieee488/c2040fdc.h168
-rw-r--r--src/devices/bus/ieee488/c8050.c950
-rw-r--r--src/devices/bus/ieee488/c8050.h140
-rw-r--r--src/devices/bus/ieee488/c8050fdc.c634
-rw-r--r--src/devices/bus/ieee488/c8050fdc.h170
-rw-r--r--src/devices/bus/ieee488/c8280.c527
-rw-r--r--src/devices/bus/ieee488/c8280.h90
-rw-r--r--src/devices/bus/ieee488/d9060.c578
-rw-r--r--src/devices/bus/ieee488/d9060.h122
-rw-r--r--src/devices/bus/ieee488/hardbox.c401
-rw-r--r--src/devices/bus/ieee488/hardbox.h77
-rw-r--r--src/devices/bus/ieee488/ieee488.c396
-rw-r--r--src/devices/bus/ieee488/ieee488.h253
-rw-r--r--src/devices/bus/ieee488/shark.c144
-rw-r--r--src/devices/bus/ieee488/shark.h52
-rw-r--r--src/devices/bus/ieee488/softbox.c393
-rw-r--r--src/devices/bus/ieee488/softbox.h82
-rw-r--r--src/devices/bus/imi7000/imi5000h.c478
-rw-r--r--src/devices/bus/imi7000/imi5000h.h89
-rw-r--r--src/devices/bus/imi7000/imi7000.c101
-rw-r--r--src/devices/bus/imi7000/imi7000.h132
-rw-r--r--src/devices/bus/intv/ecs.c589
-rw-r--r--src/devices/bus/intv/ecs.h147
-rw-r--r--src/devices/bus/intv/rom.c51
-rw-r--r--src/devices/bus/intv/rom.h84
-rw-r--r--src/devices/bus/intv/slot.c571
-rw-r--r--src/devices/bus/intv/slot.h185
-rw-r--r--src/devices/bus/intv/voice.c124
-rw-r--r--src/devices/bus/intv/voice.h78
-rw-r--r--src/devices/bus/iq151/disc2.c132
-rw-r--r--src/devices/bus/iq151/disc2.h53
-rw-r--r--src/devices/bus/iq151/grafik.c190
-rw-r--r--src/devices/bus/iq151/grafik.h63
-rw-r--r--src/devices/bus/iq151/iq151.c210
-rw-r--r--src/devices/bus/iq151/iq151.h155
-rw-r--r--src/devices/bus/iq151/minigraf.c167
-rw-r--r--src/devices/bus/iq151/minigraf.h56
-rw-r--r--src/devices/bus/iq151/ms151a.c167
-rw-r--r--src/devices/bus/iq151/ms151a.h56
-rw-r--r--src/devices/bus/iq151/rom.c229
-rw-r--r--src/devices/bus/iq151/rom.h130
-rw-r--r--src/devices/bus/iq151/staper.c144
-rw-r--r--src/devices/bus/iq151/staper.h59
-rw-r--r--src/devices/bus/iq151/video32.c170
-rw-r--r--src/devices/bus/iq151/video32.h50
-rw-r--r--src/devices/bus/iq151/video64.c177
-rw-r--r--src/devices/bus/iq151/video64.h51
-rw-r--r--src/devices/bus/isa/3c503.c304
-rw-r--r--src/devices/bus/isa/3c503.h64
-rw-r--r--src/devices/bus/isa/3c505.c1667
-rw-r--r--src/devices/bus/isa/3c505.h283
-rw-r--r--src/devices/bus/isa/adlib.c87
-rw-r--r--src/devices/bus/isa/adlib.h44
-rw-r--r--src/devices/bus/isa/aga.c1008
-rw-r--r--src/devices/bus/isa/aga.h128
-rw-r--r--src/devices/bus/isa/aha1542.c203
-rw-r--r--src/devices/bus/isa/aha1542.h57
-rw-r--r--src/devices/bus/isa/cga.c2011
-rw-r--r--src/devices/bus/isa/cga.h286
-rw-r--r--src/devices/bus/isa/com.c194
-rw-r--r--src/devices/bus/isa/com.h58
-rw-r--r--src/devices/bus/isa/dectalk.c220
-rw-r--r--src/devices/bus/isa/dectalk.h56
-rw-r--r--src/devices/bus/isa/ega.c1416
-rw-r--r--src/devices/bus/isa/ega.h111
-rw-r--r--src/devices/bus/isa/fdc.c167
-rw-r--r--src/devices/bus/isa/fdc.h84
-rw-r--r--src/devices/bus/isa/finalchs.c127
-rw-r--r--src/devices/bus/isa/finalchs.h50
-rw-r--r--src/devices/bus/isa/gblaster.c124
-rw-r--r--src/devices/bus/isa/gblaster.h49
-rw-r--r--src/devices/bus/isa/gus.c1724
-rw-r--r--src/devices/bus/isa/gus.h323
-rw-r--r--src/devices/bus/isa/hdc.c1050
-rw-r--r--src/devices/bus/isa/hdc.h186
-rw-r--r--src/devices/bus/isa/ibm_mfc.c484
-rw-r--r--src/devices/bus/isa/ibm_mfc.h90
-rw-r--r--src/devices/bus/isa/ide.c120
-rw-r--r--src/devices/bus/isa/ide.h50
-rw-r--r--src/devices/bus/isa/isa.c646
-rw-r--r--src/devices/bus/isa/isa.h439
-rw-r--r--src/devices/bus/isa/isa_cards.c103
-rw-r--r--src/devices/bus/isa/isa_cards.h71
-rw-r--r--src/devices/bus/isa/lpt.c67
-rw-r--r--src/devices/bus/isa/lpt.h50
-rw-r--r--src/devices/bus/isa/mach32.c156
-rw-r--r--src/devices/bus/isa/mach32.h176
-rw-r--r--src/devices/bus/isa/mc1502_fdc.c221
-rw-r--r--src/devices/bus/isa/mc1502_fdc.h65
-rw-r--r--src/devices/bus/isa/mc1502_rom.c71
-rw-r--r--src/devices/bus/isa/mc1502_rom.h42
-rw-r--r--src/devices/bus/isa/mda.c981
-rw-r--r--src/devices/bus/isa/mda.h132
-rw-r--r--src/devices/bus/isa/mpu401.c93
-rw-r--r--src/devices/bus/isa/mpu401.h46
-rw-r--r--src/devices/bus/isa/mufdc.c203
-rw-r--r--src/devices/bus/isa/mufdc.h94
-rw-r--r--src/devices/bus/isa/ne1000.c133
-rw-r--r--src/devices/bus/isa/ne1000.h37
-rw-r--r--src/devices/bus/isa/ne2000.c144
-rw-r--r--src/devices/bus/isa/ne2000.h35
-rw-r--r--src/devices/bus/isa/num9rev.c319
-rw-r--r--src/devices/bus/isa/num9rev.h63
-rw-r--r--src/devices/bus/isa/omti8621.c1382
-rw-r--r--src/devices/bus/isa/omti8621.h135
-rw-r--r--src/devices/bus/isa/p1_fdc.c203
-rw-r--r--src/devices/bus/isa/p1_fdc.h58
-rw-r--r--src/devices/bus/isa/p1_hdc.c146
-rw-r--r--src/devices/bus/isa/p1_hdc.h55
-rw-r--r--src/devices/bus/isa/p1_rom.c76
-rw-r--r--src/devices/bus/isa/p1_rom.h42
-rw-r--r--src/devices/bus/isa/pc1640_iga.c115
-rw-r--r--src/devices/bus/isa/pc1640_iga.h46
-rw-r--r--src/devices/bus/isa/pds.c65
-rw-r--r--src/devices/bus/isa/pds.h40
-rw-r--r--src/devices/bus/isa/pgc.c372
-rw-r--r--src/devices/bus/isa/pgc.h67
-rw-r--r--src/devices/bus/isa/s3virge.c776
-rw-r--r--src/devices/bus/isa/s3virge.h82
-rw-r--r--src/devices/bus/isa/sb16.c850
-rw-r--r--src/devices/bus/isa/sb16.h120
-rw-r--r--src/devices/bus/isa/sblaster.c1682
-rw-r--r--src/devices/bus/isa/sblaster.h258
-rw-r--r--src/devices/bus/isa/sc499.c1333
-rw-r--r--src/devices/bus/isa/sc499.h159
-rw-r--r--src/devices/bus/isa/side116.c190
-rw-r--r--src/devices/bus/isa/side116.h59
-rw-r--r--src/devices/bus/isa/ssi2001.c39
-rw-r--r--src/devices/bus/isa/ssi2001.h40
-rw-r--r--src/devices/bus/isa/stereo_fx.c233
-rw-r--r--src/devices/bus/isa/stereo_fx.h81
-rw-r--r--src/devices/bus/isa/svga_cirrus.c180
-rw-r--r--src/devices/bus/isa/svga_cirrus.h63
-rw-r--r--src/devices/bus/isa/svga_s3.c392
-rw-r--r--src/devices/bus/isa/svga_s3.h111
-rw-r--r--src/devices/bus/isa/svga_trident.c107
-rw-r--r--src/devices/bus/isa/svga_trident.h49
-rw-r--r--src/devices/bus/isa/svga_tseng.c94
-rw-r--r--src/devices/bus/isa/svga_tseng.h43
-rw-r--r--src/devices/bus/isa/trident.c1612
-rw-r--r--src/devices/bus/isa/trident.h153
-rw-r--r--src/devices/bus/isa/vga.c84
-rw-r--r--src/devices/bus/isa/vga.h43
-rw-r--r--src/devices/bus/isa/vga_ati.c351
-rw-r--r--src/devices/bus/isa/vga_ati.h97
-rw-r--r--src/devices/bus/isa/wd1002a_wx1.c70
-rw-r--r--src/devices/bus/isa/wd1002a_wx1.h46
-rw-r--r--src/devices/bus/isa/wdxt_gen.c376
-rw-r--r--src/devices/bus/isa/wdxt_gen.h85
-rw-r--r--src/devices/bus/isa/xsu_cards.c66
-rw-r--r--src/devices/bus/isa/xsu_cards.h37
-rw-r--r--src/devices/bus/isa/xtide.c333
-rw-r--r--src/devices/bus/isa/xtide.h51
-rw-r--r--src/devices/bus/isbx/compis_fdc.c181
-rw-r--r--src/devices/bus/isbx/compis_fdc.h65
-rw-r--r--src/devices/bus/isbx/isbc_218a.c208
-rw-r--r--src/devices/bus/isbx/isbc_218a.h67
-rw-r--r--src/devices/bus/isbx/isbx.c78
-rw-r--r--src/devices/bus/isbx/isbx.h155
-rw-r--r--src/devices/bus/kc/d002.c230
-rw-r--r--src/devices/bus/kc/d002.h60
-rw-r--r--src/devices/bus/kc/d004.c514
-rw-r--r--src/devices/bus/kc/d004.h114
-rw-r--r--src/devices/bus/kc/kc.c376
-rw-r--r--src/devices/bus/kc/kc.h152
-rw-r--r--src/devices/bus/kc/ram.c449
-rw-r--r--src/devices/bus/kc/ram.h180
-rw-r--r--src/devices/bus/kc/rom.c230
-rw-r--r--src/devices/bus/kc/rom.h98
-rw-r--r--src/devices/bus/lpci/cirrus.c164
-rw-r--r--src/devices/bus/lpci/cirrus.h41
-rw-r--r--src/devices/bus/lpci/i82371ab.c257
-rw-r--r--src/devices/bus/lpci/i82371ab.h53
-rw-r--r--src/devices/bus/lpci/i82371sb.c181
-rw-r--r--src/devices/bus/lpci/i82371sb.h50
-rw-r--r--src/devices/bus/lpci/i82439tx.c312
-rw-r--r--src/devices/bus/lpci/i82439tx.h59
-rw-r--r--src/devices/bus/lpci/mpc105.c233
-rw-r--r--src/devices/bus/lpci/mpc105.h60
-rw-r--r--src/devices/bus/lpci/northbridge.c48
-rw-r--r--src/devices/bus/lpci/northbridge.h34
-rw-r--r--src/devices/bus/lpci/pci.c334
-rw-r--r--src/devices/bus/lpci/pci.h112
-rw-r--r--src/devices/bus/lpci/southbridge.c490
-rw-r--r--src/devices/bus/lpci/southbridge.h131
-rw-r--r--src/devices/bus/macpds/macpds.c198
-rw-r--r--src/devices/bus/macpds/macpds.h133
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.c238
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.h55
-rw-r--r--src/devices/bus/megadrive/eeprom.c376
-rw-r--r--src/devices/bus/megadrive/eeprom.h143
-rw-r--r--src/devices/bus/megadrive/ggenie.c185
-rw-r--r--src/devices/bus/megadrive/ggenie.h40
-rw-r--r--src/devices/bus/megadrive/jcart.c257
-rw-r--r--src/devices/bus/megadrive/jcart.h84
-rw-r--r--src/devices/bus/megadrive/md_carts.c71
-rw-r--r--src/devices/bus/megadrive/md_carts.h27
-rw-r--r--src/devices/bus/megadrive/md_slot.c1099
-rw-r--r--src/devices/bus/megadrive/md_slot.h262
-rw-r--r--src/devices/bus/megadrive/rom.c1422
-rw-r--r--src/devices/bus/megadrive/rom.h585
-rw-r--r--src/devices/bus/megadrive/sk.c95
-rw-r--r--src/devices/bus/megadrive/sk.h35
-rw-r--r--src/devices/bus/megadrive/stm95.c265
-rw-r--r--src/devices/bus/megadrive/stm95.h86
-rw-r--r--src/devices/bus/megadrive/svp.c472
-rw-r--r--src/devices/bus/megadrive/svp.h75
-rw-r--r--src/devices/bus/midi/midi.c55
-rw-r--r--src/devices/bus/midi/midi.h65
-rw-r--r--src/devices/bus/midi/midiinport.c30
-rw-r--r--src/devices/bus/midi/midiinport.h36
-rw-r--r--src/devices/bus/midi/midioutport.c29
-rw-r--r--src/devices/bus/midi/midioutport.h36
-rw-r--r--src/devices/bus/msx_cart/arc.c64
-rw-r--r--src/devices/bus/msx_cart/arc.h34
-rw-r--r--src/devices/bus/msx_cart/ascii.c535
-rw-r--r--src/devices/bus/msx_cart/ascii.h141
-rw-r--r--src/devices/bus/msx_cart/bm_012.c112
-rw-r--r--src/devices/bus/msx_cart/bm_012.h34
-rw-r--r--src/devices/bus/msx_cart/cartridge.c109
-rw-r--r--src/devices/bus/msx_cart/cartridge.h52
-rw-r--r--src/devices/bus/msx_cart/crossblaim.c82
-rw-r--r--src/devices/bus/msx_cart/crossblaim.h37
-rw-r--r--src/devices/bus/msx_cart/disk.c628
-rw-r--r--src/devices/bus/msx_cart/disk.h145
-rw-r--r--src/devices/bus/msx_cart/dooly.c67
-rw-r--r--src/devices/bus/msx_cart/dooly.h32
-rw-r--r--src/devices/bus/msx_cart/fmpac.c173
-rw-r--r--src/devices/bus/msx_cart/fmpac.h46
-rw-r--r--src/devices/bus/msx_cart/fs_sr022.c71
-rw-r--r--src/devices/bus/msx_cart/fs_sr022.h33
-rw-r--r--src/devices/bus/msx_cart/halnote.c159
-rw-r--r--src/devices/bus/msx_cart/halnote.h37
-rw-r--r--src/devices/bus/msx_cart/hfox.c79
-rw-r--r--src/devices/bus/msx_cart/hfox.h35
-rw-r--r--src/devices/bus/msx_cart/holy_quran.c119
-rw-r--r--src/devices/bus/msx_cart/holy_quran.h37
-rw-r--r--src/devices/bus/msx_cart/konami.c937
-rw-r--r--src/devices/bus/msx_cart/konami.h197
-rw-r--r--src/devices/bus/msx_cart/korean.c298
-rw-r--r--src/devices/bus/msx_cart/korean.h91
-rw-r--r--src/devices/bus/msx_cart/majutsushi.c115
-rw-r--r--src/devices/bus/msx_cart/majutsushi.h39
-rw-r--r--src/devices/bus/msx_cart/moonsound.c126
-rw-r--r--src/devices/bus/msx_cart/moonsound.h37
-rw-r--r--src/devices/bus/msx_cart/msx_audio.c389
-rw-r--r--src/devices/bus/msx_cart/msx_audio.h93
-rw-r--r--src/devices/bus/msx_cart/msx_audio_kb.c313
-rw-r--r--src/devices/bus/msx_cart/msx_audio_kb.h49
-rw-r--r--src/devices/bus/msx_cart/msxdos2.c67
-rw-r--r--src/devices/bus/msx_cart/msxdos2.h35
-rw-r--r--src/devices/bus/msx_cart/nomapper.c94
-rw-r--r--src/devices/bus/msx_cart/nomapper.h30
-rw-r--r--src/devices/bus/msx_cart/rtype.c78
-rw-r--r--src/devices/bus/msx_cart/rtype.h35
-rw-r--r--src/devices/bus/msx_cart/super_swangi.c72
-rw-r--r--src/devices/bus/msx_cart/super_swangi.h35
-rw-r--r--src/devices/bus/msx_cart/superloderunner.c62
-rw-r--r--src/devices/bus/msx_cart/superloderunner.h35
-rw-r--r--src/devices/bus/msx_cart/yamaha.c205
-rw-r--r--src/devices/bus/msx_cart/yamaha.h64
-rw-r--r--src/devices/bus/msx_slot/bunsetsu.c78
-rw-r--r--src/devices/bus/msx_slot/bunsetsu.h38
-rw-r--r--src/devices/bus/msx_slot/cartridge.c382
-rw-r--r--src/devices/bus/msx_slot/cartridge.h87
-rw-r--r--src/devices/bus/msx_slot/disk.c813
-rw-r--r--src/devices/bus/msx_slot/disk.h231
-rw-r--r--src/devices/bus/msx_slot/fs4600.c163
-rw-r--r--src/devices/bus/msx_slot/fs4600.h47
-rw-r--r--src/devices/bus/msx_slot/music.c49
-rw-r--r--src/devices/bus/msx_slot/music.h39
-rw-r--r--src/devices/bus/msx_slot/panasonic08.c182
-rw-r--r--src/devices/bus/msx_slot/panasonic08.h48
-rw-r--r--src/devices/bus/msx_slot/ram.c36
-rw-r--r--src/devices/bus/msx_slot/ram.h36
-rw-r--r--src/devices/bus/msx_slot/ram_mm.c80
-rw-r--r--src/devices/bus/msx_slot/ram_mm.h45
-rw-r--r--src/devices/bus/msx_slot/rom.c66
-rw-r--r--src/devices/bus/msx_slot/rom.h34
-rw-r--r--src/devices/bus/msx_slot/slot.c36
-rw-r--r--src/devices/bus/msx_slot/slot.h39
-rw-r--r--src/devices/bus/msx_slot/sony08.c190
-rw-r--r--src/devices/bus/msx_slot/sony08.h47
-rw-r--r--src/devices/bus/nasbus/avc.c164
-rw-r--r--src/devices/bus/nasbus/avc.h56
-rw-r--r--src/devices/bus/nasbus/cards.c14
-rw-r--r--src/devices/bus/nasbus/cards.h21
-rw-r--r--src/devices/bus/nasbus/floppy.c209
-rw-r--r--src/devices/bus/nasbus/floppy.h61
-rw-r--r--src/devices/bus/nasbus/nasbus.c165
-rw-r--r--src/devices/bus/nasbus/nasbus.h210
-rw-r--r--src/devices/bus/neogeo/banked_cart.c107
-rw-r--r--src/devices/bus/neogeo/banked_cart.h46
-rw-r--r--src/devices/bus/neogeo/bootleg_cart.c378
-rw-r--r--src/devices/bus/neogeo/bootleg_cart.h250
-rw-r--r--src/devices/bus/neogeo/bootleg_hybrid_cart.c319
-rw-r--r--src/devices/bus/neogeo/bootleg_hybrid_cart.h192
-rw-r--r--src/devices/bus/neogeo/bootleg_prot.c1066
-rw-r--r--src/devices/bus/neogeo/bootleg_prot.h98
-rw-r--r--src/devices/bus/neogeo/cmc_cart.c223
-rw-r--r--src/devices/bus/neogeo/cmc_cart.h191
-rw-r--r--src/devices/bus/neogeo/cmc_prot.c789
-rw-r--r--src/devices/bus/neogeo/cmc_prot.h87
-rw-r--r--src/devices/bus/neogeo/fatfury2_cart.c75
-rw-r--r--src/devices/bus/neogeo/fatfury2_cart.h41
-rw-r--r--src/devices/bus/neogeo/fatfury2_prot.c110
-rw-r--r--src/devices/bus/neogeo/fatfury2_prot.h42
-rw-r--r--src/devices/bus/neogeo/kof2002_cart.c157
-rw-r--r--src/devices/bus/neogeo/kof2002_cart.h111
-rw-r--r--src/devices/bus/neogeo/kof2002_prot.c83
-rw-r--r--src/devices/bus/neogeo/kof2002_prot.h38
-rw-r--r--src/devices/bus/neogeo/kof98_cart.c80
-rw-r--r--src/devices/bus/neogeo/kof98_cart.h41
-rw-r--r--src/devices/bus/neogeo/kof98_prot.c141
-rw-r--r--src/devices/bus/neogeo/kof98_prot.h40
-rw-r--r--src/devices/bus/neogeo/kog_prot.c118
-rw-r--r--src/devices/bus/neogeo/kog_prot.h40
-rw-r--r--src/devices/bus/neogeo/mslugx_cart.c75
-rw-r--r--src/devices/bus/neogeo/mslugx_cart.h41
-rw-r--r--src/devices/bus/neogeo/mslugx_prot.c95
-rw-r--r--src/devices/bus/neogeo/mslugx_prot.h41
-rw-r--r--src/devices/bus/neogeo/neogeo_carts.c97
-rw-r--r--src/devices/bus/neogeo/neogeo_carts.h30
-rw-r--r--src/devices/bus/neogeo/neogeo_helper.c66
-rw-r--r--src/devices/bus/neogeo/neogeo_helper.h4
-rw-r--r--src/devices/bus/neogeo/neogeo_intf.c33
-rw-r--r--src/devices/bus/neogeo/neogeo_intf.h78
-rw-r--r--src/devices/bus/neogeo/neogeo_slot.c222
-rw-r--r--src/devices/bus/neogeo/neogeo_slot.h87
-rw-r--r--src/devices/bus/neogeo/pcm2_cart.c135
-rw-r--r--src/devices/bus/neogeo/pcm2_cart.h98
-rw-r--r--src/devices/bus/neogeo/pcm2_prot.c88
-rw-r--r--src/devices/bus/neogeo/pcm2_prot.h36
-rw-r--r--src/devices/bus/neogeo/pvc_cart.c139
-rw-r--r--src/devices/bus/neogeo/pvc_cart.h108
-rw-r--r--src/devices/bus/neogeo/pvc_prot.c316
-rw-r--r--src/devices/bus/neogeo/pvc_prot.h50
-rw-r--r--src/devices/bus/neogeo/rom.c70
-rw-r--r--src/devices/bus/neogeo/rom.h38
-rw-r--r--src/devices/bus/neogeo/sbp_prot.c86
-rw-r--r--src/devices/bus/neogeo/sbp_prot.h40
-rw-r--r--src/devices/bus/neogeo/sma_cart.c177
-rw-r--r--src/devices/bus/neogeo/sma_cart.h112
-rw-r--r--src/devices/bus/neogeo/sma_prot.c462
-rw-r--r--src/devices/bus/neogeo/sma_prot.h58
-rw-r--r--src/devices/bus/nes/2a03pur.c109
-rw-r--r--src/devices/bus/nes/2a03pur.h33
-rw-r--r--src/devices/bus/nes/act53.c206
-rw-r--r--src/devices/bus/nes/act53.h38
-rw-r--r--src/devices/bus/nes/aladdin.c339
-rw-r--r--src/devices/bus/nes/aladdin.h167
-rw-r--r--src/devices/bus/nes/ave.c214
-rw-r--r--src/devices/bus/nes/ave.h69
-rw-r--r--src/devices/bus/nes/bandai.c479
-rw-r--r--src/devices/bus/nes/bandai.h141
-rw-r--r--src/devices/bus/nes/benshieng.c105
-rw-r--r--src/devices/bus/nes/benshieng.h34
-rw-r--r--src/devices/bus/nes/bootleg.c1635
-rw-r--r--src/devices/bus/nes/bootleg.h480
-rw-r--r--src/devices/bus/nes/camerica.c225
-rw-r--r--src/devices/bus/nes/camerica.h72
-rw-r--r--src/devices/bus/nes/cne.c220
-rw-r--r--src/devices/bus/nes/cne.h66
-rw-r--r--src/devices/bus/nes/cony.c397
-rw-r--r--src/devices/bus/nes/cony.h75
-rw-r--r--src/devices/bus/nes/datach.c420
-rw-r--r--src/devices/bus/nes/datach.h170
-rw-r--r--src/devices/bus/nes/discrete.c209
-rw-r--r--src/devices/bus/nes/discrete.h80
-rw-r--r--src/devices/bus/nes/disksys.c431
-rw-r--r--src/devices/bus/nes/disksys.h71
-rw-r--r--src/devices/bus/nes/event.c239
-rw-r--r--src/devices/bus/nes/event.h44
-rw-r--r--src/devices/bus/nes/ggenie.c274
-rw-r--r--src/devices/bus/nes/ggenie.h58
-rw-r--r--src/devices/bus/nes/henggedianzi.c278
-rw-r--r--src/devices/bus/nes/henggedianzi.h78
-rw-r--r--src/devices/bus/nes/hes.c87
-rw-r--r--src/devices/bus/nes/hes.h28
-rw-r--r--src/devices/bus/nes/hosenkan.c155
-rw-r--r--src/devices/bus/nes/hosenkan.h39
-rw-r--r--src/devices/bus/nes/irem.c352
-rw-r--r--src/devices/bus/nes/irem.h108
-rw-r--r--src/devices/bus/nes/jaleco.c886
-rw-r--r--src/devices/bus/nes/jaleco.h256
-rw-r--r--src/devices/bus/nes/jy.c589
-rw-r--r--src/devices/bus/nes/jy.h104
-rw-r--r--src/devices/bus/nes/kaiser.c588
-rw-r--r--src/devices/bus/nes/kaiser.h184
-rw-r--r--src/devices/bus/nes/karastudio.c309
-rw-r--r--src/devices/bus/nes/karastudio.h147
-rw-r--r--src/devices/bus/nes/konami.c787
-rw-r--r--src/devices/bus/nes/konami.h155
-rw-r--r--src/devices/bus/nes/legacy.c311
-rw-r--r--src/devices/bus/nes/legacy.h81
-rw-r--r--src/devices/bus/nes/mmc1.c374
-rw-r--r--src/devices/bus/nes/mmc1.h82
-rw-r--r--src/devices/bus/nes/mmc2.c198
-rw-r--r--src/devices/bus/nes/mmc2.h54
-rw-r--r--src/devices/bus/nes/mmc3.c560
-rw-r--r--src/devices/bus/nes/mmc3.h146
-rw-r--r--src/devices/bus/nes/mmc3_clones.c2588
-rw-r--r--src/devices/bus/nes/mmc3_clones.h697
-rw-r--r--src/devices/bus/nes/mmc5.c679
-rw-r--r--src/devices/bus/nes/mmc5.h94
-rw-r--r--src/devices/bus/nes/multigame.c2602
-rw-r--r--src/devices/bus/nes/multigame.h894
-rw-r--r--src/devices/bus/nes/namcot.c688
-rw-r--r--src/devices/bus/nes/namcot.h163
-rw-r--r--src/devices/bus/nes/nanjing.c175
-rw-r--r--src/devices/bus/nes/nanjing.h38
-rw-r--r--src/devices/bus/nes/nes_carts.c366
-rw-r--r--src/devices/bus/nes/nes_carts.h73
-rw-r--r--src/devices/bus/nes/nes_ines.inc939
-rw-r--r--src/devices/bus/nes/nes_pcb.inc609
-rw-r--r--src/devices/bus/nes/nes_slot.c1053
-rw-r--r--src/devices/bus/nes/nes_slot.h430
-rw-r--r--src/devices/bus/nes/nes_unif.inc575
-rw-r--r--src/devices/bus/nes/ntdec.c186
-rw-r--r--src/devices/bus/nes/ntdec.h51
-rw-r--r--src/devices/bus/nes/nxrom.c583
-rw-r--r--src/devices/bus/nes/nxrom.h216
-rw-r--r--src/devices/bus/nes/pirate.c1387
-rw-r--r--src/devices/bus/nes/pirate.h399
-rw-r--r--src/devices/bus/nes/pt554.c107
-rw-r--r--src/devices/bus/nes/pt554.h31
-rw-r--r--src/devices/bus/nes/racermate.c92
-rw-r--r--src/devices/bus/nes/racermate.h35
-rw-r--r--src/devices/bus/nes/rcm.c303
-rw-r--r--src/devices/bus/nes/rcm.h105
-rw-r--r--src/devices/bus/nes/rexsoft.c262
-rw-r--r--src/devices/bus/nes/rexsoft.h61
-rw-r--r--src/devices/bus/nes/sachen.c695
-rw-r--r--src/devices/bus/nes/sachen.h261
-rw-r--r--src/devices/bus/nes/somari.c421
-rw-r--r--src/devices/bus/nes/somari.h54
-rw-r--r--src/devices/bus/nes/sunsoft.c628
-rw-r--r--src/devices/bus/nes/sunsoft.h147
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.c315
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.h150
-rw-r--r--src/devices/bus/nes/taito.c470
-rw-r--r--src/devices/bus/nes/taito.h104
-rw-r--r--src/devices/bus/nes/tengen.c376
-rw-r--r--src/devices/bus/nes/tengen.h88
-rw-r--r--src/devices/bus/nes/txc.c268
-rw-r--r--src/devices/bus/nes/txc.h99
-rw-r--r--src/devices/bus/nes/waixing.c1244
-rw-r--r--src/devices/bus/nes/waixing.h396
-rw-r--r--src/devices/bus/nes_ctrl/4score.c189
-rw-r--r--src/devices/bus/nes_ctrl/4score.h84
-rw-r--r--src/devices/bus/nes_ctrl/arkpaddle.c130
-rw-r--r--src/devices/bus/nes_ctrl/arkpaddle.h70
-rw-r--r--src/devices/bus/nes_ctrl/bcbattle.c183
-rw-r--r--src/devices/bus/nes_ctrl/bcbattle.h53
-rw-r--r--src/devices/bus/nes_ctrl/ctrl.c207
-rw-r--r--src/devices/bus/nes_ctrl/ctrl.h103
-rw-r--r--src/devices/bus/nes_ctrl/fckeybrd.c231
-rw-r--r--src/devices/bus/nes_ctrl/fckeybrd.h54
-rw-r--r--src/devices/bus/nes_ctrl/ftrainer.c153
-rw-r--r--src/devices/bus/nes_ctrl/ftrainer.h51
-rw-r--r--src/devices/bus/nes_ctrl/hori.c168
-rw-r--r--src/devices/bus/nes_ctrl/hori.h78
-rw-r--r--src/devices/bus/nes_ctrl/joypad.c315
-rw-r--r--src/devices/bus/nes_ctrl/joypad.h111
-rw-r--r--src/devices/bus/nes_ctrl/konamihs.c101
-rw-r--r--src/devices/bus/nes_ctrl/konamihs.h49
-rw-r--r--src/devices/bus/nes_ctrl/miracle.c283
-rw-r--r--src/devices/bus/nes_ctrl/miracle.h71
-rw-r--r--src/devices/bus/nes_ctrl/mjpanel.c131
-rw-r--r--src/devices/bus/nes_ctrl/mjpanel.h51
-rw-r--r--src/devices/bus/nes_ctrl/pachinko.c107
-rw-r--r--src/devices/bus/nes_ctrl/pachinko.h49
-rw-r--r--src/devices/bus/nes_ctrl/partytap.c107
-rw-r--r--src/devices/bus/nes_ctrl/partytap.h49
-rw-r--r--src/devices/bus/nes_ctrl/powerpad.c135
-rw-r--r--src/devices/bus/nes_ctrl/powerpad.h52
-rw-r--r--src/devices/bus/nes_ctrl/suborkey.c229
-rw-r--r--src/devices/bus/nes_ctrl/suborkey.h51
-rw-r--r--src/devices/bus/nes_ctrl/zapper.c96
-rw-r--r--src/devices/bus/nes_ctrl/zapper.h52
-rw-r--r--src/devices/bus/nubus/nubus.c475
-rw-r--r--src/devices/bus/nubus/nubus.h177
-rw-r--r--src/devices/bus/nubus/nubus_48gc.c369
-rw-r--r--src/devices/bus/nubus/nubus_48gc.h70
-rw-r--r--src/devices/bus/nubus/nubus_asntmc3b.c210
-rw-r--r--src/devices/bus/nubus/nubus_asntmc3b.h68
-rw-r--r--src/devices/bus/nubus/nubus_cb264.c300
-rw-r--r--src/devices/bus/nubus/nubus_cb264.h51
-rw-r--r--src/devices/bus/nubus/nubus_image.c388
-rw-r--r--src/devices/bus/nubus/nubus_image.h80
-rw-r--r--src/devices/bus/nubus/nubus_m2hires.c314
-rw-r--r--src/devices/bus/nubus/nubus_m2hires.h56
-rw-r--r--src/devices/bus/nubus/nubus_m2video.c314
-rw-r--r--src/devices/bus/nubus/nubus_m2video.h56
-rw-r--r--src/devices/bus/nubus/nubus_radiustpd.c214
-rw-r--r--src/devices/bus/nubus/nubus_radiustpd.h56
-rw-r--r--src/devices/bus/nubus/nubus_spec8.c355
-rw-r--r--src/devices/bus/nubus/nubus_spec8.h64
-rw-r--r--src/devices/bus/nubus/nubus_specpdq.c490
-rw-r--r--src/devices/bus/nubus/nubus_specpdq.h63
-rw-r--r--src/devices/bus/nubus/nubus_vikbw.c174
-rw-r--r--src/devices/bus/nubus/nubus_vikbw.h50
-rw-r--r--src/devices/bus/nubus/nubus_wsportrait.c310
-rw-r--r--src/devices/bus/nubus/nubus_wsportrait.h56
-rw-r--r--src/devices/bus/nubus/pds30_30hr.c319
-rw-r--r--src/devices/bus/nubus/pds30_30hr.h56
-rw-r--r--src/devices/bus/nubus/pds30_cb264.c324
-rw-r--r--src/devices/bus/nubus/pds30_cb264.h56
-rw-r--r--src/devices/bus/nubus/pds30_mc30.c336
-rw-r--r--src/devices/bus/nubus/pds30_mc30.h56
-rw-r--r--src/devices/bus/nubus/pds30_procolor816.c350
-rw-r--r--src/devices/bus/nubus/pds30_procolor816.h56
-rw-r--r--src/devices/bus/nubus/pds30_sigmalview.c216
-rw-r--r--src/devices/bus/nubus/pds30_sigmalview.h57
-rw-r--r--src/devices/bus/odyssey2/chess.c60
-rw-r--r--src/devices/bus/odyssey2/chess.h32
-rw-r--r--src/devices/bus/odyssey2/rom.c96
-rw-r--r--src/devices/bus/odyssey2/rom.h67
-rw-r--r--src/devices/bus/odyssey2/slot.c278
-rw-r--r--src/devices/bus/odyssey2/slot.h121
-rw-r--r--src/devices/bus/odyssey2/voice.c103
-rw-r--r--src/devices/bus/odyssey2/voice.h50
-rw-r--r--src/devices/bus/oricext/jasmin.c174
-rw-r--r--src/devices/bus/oricext/jasmin.h43
-rw-r--r--src/devices/bus/oricext/microdisc.c152
-rw-r--r--src/devices/bus/oricext/microdisc.h54
-rw-r--r--src/devices/bus/oricext/oricext.c78
-rw-r--r--src/devices/bus/oricext/oricext.h65
-rw-r--r--src/devices/bus/pc_joy/pc_joy.c93
-rw-r--r--src/devices/bus/pc_joy/pc_joy.h78
-rw-r--r--src/devices/bus/pc_joy/pc_joy_sw.c177
-rw-r--r--src/devices/bus/pc_joy/pc_joy_sw.h38
-rw-r--r--src/devices/bus/pc_kbd/ec1841.c486
-rw-r--r--src/devices/bus/pc_kbd/ec1841.h82
-rw-r--r--src/devices/bus/pc_kbd/iskr1030.c500
-rw-r--r--src/devices/bus/pc_kbd/iskr1030.h93
-rw-r--r--src/devices/bus/pc_kbd/keyboards.c28
-rw-r--r--src/devices/bus/pc_kbd/keyboards.h31
-rw-r--r--src/devices/bus/pc_kbd/keytro.c629
-rw-r--r--src/devices/bus/pc_kbd/keytro.h76
-rw-r--r--src/devices/bus/pc_kbd/msnat.c451
-rw-r--r--src/devices/bus/pc_kbd/msnat.h74
-rw-r--r--src/devices/bus/pc_kbd/pc83.c424
-rw-r--r--src/devices/bus/pc_kbd/pc83.h89
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.c235
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.h143
-rw-r--r--src/devices/bus/pc_kbd/pcat84.c641
-rw-r--r--src/devices/bus/pc_kbd/pcat84.h114
-rw-r--r--src/devices/bus/pc_kbd/pcxt83.c451
-rw-r--r--src/devices/bus/pc_kbd/pcxt83.h83
-rw-r--r--src/devices/bus/pce/pce_rom.c126
-rw-r--r--src/devices/bus/pce/pce_rom.h85
-rw-r--r--src/devices/bus/pce/pce_slot.c395
-rw-r--r--src/devices/bus/pce/pce_slot.h129
-rw-r--r--src/devices/bus/pet/64k.c203
-rw-r--r--src/devices/bus/pet/64k.h56
-rw-r--r--src/devices/bus/pet/c2n.c160
-rw-r--r--src/devices/bus/pet/c2n.h86
-rw-r--r--src/devices/bus/pet/cass.c99
-rw-r--r--src/devices/bus/pet/cass.h117
-rw-r--r--src/devices/bus/pet/cb2snd.c64
-rw-r--r--src/devices/bus/pet/cb2snd.h44
-rw-r--r--src/devices/bus/pet/diag.c44
-rw-r--r--src/devices/bus/pet/diag.h57
-rw-r--r--src/devices/bus/pet/diag264_lb_tape.c83
-rw-r--r--src/devices/bus/pet/diag264_lb_tape.h53
-rw-r--r--src/devices/bus/pet/exp.c204
-rw-r--r--src/devices/bus/pet/exp.h139
-rw-r--r--src/devices/bus/pet/hsg.c258
-rw-r--r--src/devices/bus/pet/hsg.h87
-rw-r--r--src/devices/bus/pet/petuja.c105
-rw-r--r--src/devices/bus/pet/petuja.h63
-rw-r--r--src/devices/bus/pet/superpet.c436
-rw-r--r--src/devices/bus/pet/superpet.h80
-rw-r--r--src/devices/bus/pet/user.c130
-rw-r--r--src/devices/bus/pet/user.h231
-rw-r--r--src/devices/bus/plus4/c1551.c552
-rw-r--r--src/devices/bus/plus4/c1551.h107
-rw-r--r--src/devices/bus/plus4/diag264_lb_user.c42
-rw-r--r--src/devices/bus/plus4/diag264_lb_user.h59
-rw-r--r--src/devices/bus/plus4/exp.c209
-rw-r--r--src/devices/bus/plus4/exp.h187
-rw-r--r--src/devices/bus/plus4/sid.c165
-rw-r--r--src/devices/bus/plus4/sid.h59
-rw-r--r--src/devices/bus/plus4/std.c69
-rw-r--r--src/devices/bus/plus4/std.h47
-rw-r--r--src/devices/bus/plus4/user.c22
-rw-r--r--src/devices/bus/plus4/user.h33
-rw-r--r--src/devices/bus/psx/analogue.c264
-rw-r--r--src/devices/bus/psx/analogue.h57
-rw-r--r--src/devices/bus/psx/ctlrport.c231
-rw-r--r--src/devices/bus/psx/ctlrport.h145
-rw-r--r--src/devices/bus/psx/memcard.c365
-rw-r--r--src/devices/bus/psx/memcard.h77
-rw-r--r--src/devices/bus/psx/multitap.c275
-rw-r--r--src/devices/bus/psx/multitap.h43
-rw-r--r--src/devices/bus/ql/cst_q_plus4.c144
-rw-r--r--src/devices/bus/ql/cst_q_plus4.h72
-rw-r--r--src/devices/bus/ql/cst_qdisc.c85
-rw-r--r--src/devices/bus/ql/cst_qdisc.h53
-rw-r--r--src/devices/bus/ql/cumana_fdi.c85
-rw-r--r--src/devices/bus/ql/cumana_fdi.h53
-rw-r--r--src/devices/bus/ql/exp.c110
-rw-r--r--src/devices/bus/ql/exp.h151
-rw-r--r--src/devices/bus/ql/kempston_di.c83
-rw-r--r--src/devices/bus/ql/kempston_di.h53
-rw-r--r--src/devices/bus/ql/miracle_gold_card.c85
-rw-r--r--src/devices/bus/ql/miracle_gold_card.h53
-rw-r--r--src/devices/bus/ql/miracle_hd.c83
-rw-r--r--src/devices/bus/ql/miracle_hd.h53
-rw-r--r--src/devices/bus/ql/mp_fdi.c83
-rw-r--r--src/devices/bus/ql/mp_fdi.h53
-rw-r--r--src/devices/bus/ql/opd_basic_master.c81
-rw-r--r--src/devices/bus/ql/opd_basic_master.h53
-rw-r--r--src/devices/bus/ql/pcml_qdisk.c83
-rw-r--r--src/devices/bus/ql/pcml_qdisk.h53
-rw-r--r--src/devices/bus/ql/qubide.c286
-rw-r--r--src/devices/bus/ql/qubide.h63
-rw-r--r--src/devices/bus/ql/rom.c136
-rw-r--r--src/devices/bus/ql/rom.h126
-rw-r--r--src/devices/bus/ql/sandy_superdisk.c275
-rw-r--r--src/devices/bus/ql/sandy_superdisk.h70
-rw-r--r--src/devices/bus/ql/sandy_superqboard.c453
-rw-r--r--src/devices/bus/ql/sandy_superqboard.h131
-rw-r--r--src/devices/bus/ql/std.c57
-rw-r--r--src/devices/bus/ql/std.h44
-rw-r--r--src/devices/bus/ql/trumpcard.c291
-rw-r--r--src/devices/bus/ql/trumpcard.h100
-rw-r--r--src/devices/bus/rs232/keyboard.c115
-rw-r--r--src/devices/bus/rs232/keyboard.h48
-rw-r--r--src/devices/bus/rs232/loopback.c42
-rw-r--r--src/devices/bus/rs232/loopback.h25
-rw-r--r--src/devices/bus/rs232/null_modem.c131
-rw-r--r--src/devices/bus/rs232/null_modem.h53
-rw-r--r--src/devices/bus/rs232/printer.c85
-rw-r--r--src/devices/bus/rs232/printer.h44
-rw-r--r--src/devices/bus/rs232/rs232.c113
-rw-r--r--src/devices/bus/rs232/rs232.h263
-rw-r--r--src/devices/bus/rs232/ser_mouse.c265
-rw-r--r--src/devices/bus/rs232/ser_mouse.h81
-rw-r--r--src/devices/bus/rs232/terminal.c106
-rw-r--r--src/devices/bus/rs232/terminal.h46
-rw-r--r--src/devices/bus/rs232/xvd701.c150
-rw-r--r--src/devices/bus/rs232/xvd701.h44
-rw-r--r--src/devices/bus/s100/dj2db.c517
-rw-r--r--src/devices/bus/s100/dj2db.h88
-rw-r--r--src/devices/bus/s100/djdma.c127
-rw-r--r--src/devices/bus/s100/djdma.h51
-rw-r--r--src/devices/bus/s100/mm65k16s.c267
-rw-r--r--src/devices/bus/s100/mm65k16s.h55
-rw-r--r--src/devices/bus/s100/nsmdsa.c120
-rw-r--r--src/devices/bus/s100/nsmdsa.h58
-rw-r--r--src/devices/bus/s100/nsmdsad.c122
-rw-r--r--src/devices/bus/s100/nsmdsad.h59
-rw-r--r--src/devices/bus/s100/s100.c200
-rw-r--r--src/devices/bus/s100/s100.h311
-rw-r--r--src/devices/bus/s100/wunderbus.c528
-rw-r--r--src/devices/bus/s100/wunderbus.h72
-rw-r--r--src/devices/bus/saturn/bram.c110
-rw-r--r--src/devices/bus/saturn/bram.h69
-rw-r--r--src/devices/bus/saturn/dram.c96
-rw-r--r--src/devices/bus/saturn/dram.h49
-rw-r--r--src/devices/bus/saturn/rom.c55
-rw-r--r--src/devices/bus/saturn/rom.h33
-rw-r--r--src/devices/bus/saturn/sat_slot.c295
-rw-r--r--src/devices/bus/saturn/sat_slot.h123
-rw-r--r--src/devices/bus/scsi/acb4070.c63
-rw-r--r--src/devices/bus/scsi/acb4070.h47
-rw-r--r--src/devices/bus/scsi/cdu76s.c47
-rw-r--r--src/devices/bus/scsi/cdu76s.h31
-rw-r--r--src/devices/bus/scsi/d9060hd.c36
-rw-r--r--src/devices/bus/scsi/d9060hd.h22
-rw-r--r--src/devices/bus/scsi/omti5100.c94
-rw-r--r--src/devices/bus/scsi/omti5100.h30
-rw-r--r--src/devices/bus/scsi/pc9801_sasi.c28
-rw-r--r--src/devices/bus/scsi/pc9801_sasi.h20
-rw-r--r--src/devices/bus/scsi/s1410.c365
-rw-r--r--src/devices/bus/scsi/s1410.h35
-rw-r--r--src/devices/bus/scsi/sa1403d.c148
-rw-r--r--src/devices/bus/scsi/sa1403d.h36
-rw-r--r--src/devices/bus/scsi/scsi.c709
-rw-r--r--src/devices/bus/scsi/scsi.h313
-rw-r--r--src/devices/bus/scsi/scsicd.c41
-rw-r--r--src/devices/bus/scsi/scsicd.h31
-rw-r--r--src/devices/bus/scsi/scsihd.c39
-rw-r--r--src/devices/bus/scsi/scsihd.h31
-rw-r--r--src/devices/bus/scsi/scsihle.c591
-rw-r--r--src/devices/bus/scsi/scsihle.h92
-rw-r--r--src/devices/bus/scv/rom.c205
-rw-r--r--src/devices/bus/scv/rom.h151
-rw-r--r--src/devices/bus/scv/slot.c317
-rw-r--r--src/devices/bus/scv/slot.h119
-rw-r--r--src/devices/bus/sega8/ccatch.c63
-rw-r--r--src/devices/bus/sega8/ccatch.h35
-rw-r--r--src/devices/bus/sega8/mgear.c46
-rw-r--r--src/devices/bus/sega8/mgear.h39
-rw-r--r--src/devices/bus/sega8/rom.c940
-rw-r--r--src/devices/bus/sega8/rom.h388
-rw-r--r--src/devices/bus/sega8/sega8_slot.c872
-rw-r--r--src/devices/bus/sega8/sega8_slot.h243
-rw-r--r--src/devices/bus/sms_ctrl/graphic.c156
-rw-r--r--src/devices/bus/sms_ctrl/graphic.h59
-rw-r--r--src/devices/bus/sms_ctrl/joypad.c76
-rw-r--r--src/devices/bus/sms_ctrl/joypad.h52
-rw-r--r--src/devices/bus/sms_ctrl/lphaser.c291
-rw-r--r--src/devices/bus/sms_ctrl/lphaser.h69
-rw-r--r--src/devices/bus/sms_ctrl/multitap.c154
-rw-r--r--src/devices/bus/sms_ctrl/multitap.h59
-rw-r--r--src/devices/bus/sms_ctrl/paddle.c108
-rw-r--r--src/devices/bus/sms_ctrl/paddle.h60
-rw-r--r--src/devices/bus/sms_ctrl/rfu.c140
-rw-r--r--src/devices/bus/sms_ctrl/rfu.h62
-rw-r--r--src/devices/bus/sms_ctrl/smsctrl.c133
-rw-r--r--src/devices/bus/sms_ctrl/smsctrl.h118
-rw-r--r--src/devices/bus/sms_ctrl/sports.c158
-rw-r--r--src/devices/bus/sms_ctrl/sports.h65
-rw-r--r--src/devices/bus/sms_ctrl/sportsjp.c156
-rw-r--r--src/devices/bus/sms_ctrl/sportsjp.h65
-rw-r--r--src/devices/bus/sms_exp/gender.c103
-rw-r--r--src/devices/bus/sms_exp/gender.h57
-rw-r--r--src/devices/bus/sms_exp/smsexp.c137
-rw-r--r--src/devices/bus/sms_exp/smsexp.h95
-rw-r--r--src/devices/bus/snes/bsx.c546
-rw-r--r--src/devices/bus/snes/bsx.h151
-rw-r--r--src/devices/bus/snes/event.c285
-rw-r--r--src/devices/bus/snes/event.h57
-rw-r--r--src/devices/bus/snes/rom.c510
-rw-r--r--src/devices/bus/snes/rom.h209
-rw-r--r--src/devices/bus/snes/rom21.c258
-rw-r--r--src/devices/bus/snes/rom21.h67
-rw-r--r--src/devices/bus/snes/sa1.c1144
-rw-r--r--src/devices/bus/snes/sa1.h113
-rw-r--r--src/devices/bus/snes/sdd1.c617
-rw-r--r--src/devices/bus/snes/sdd1.h187
-rw-r--r--src/devices/bus/snes/sfx.c148
-rw-r--r--src/devices/bus/snes/sfx.h50
-rw-r--r--src/devices/bus/snes/sgb.c292
-rw-r--r--src/devices/bus/snes/sgb.h78
-rw-r--r--src/devices/bus/snes/snes_carts.c52
-rw-r--r--src/devices/bus/snes/snes_carts.h31
-rw-r--r--src/devices/bus/snes/snes_slot.c1374
-rw-r--r--src/devices/bus/snes/snes_slot.h274
-rw-r--r--src/devices/bus/snes/spc7110.c1677
-rw-r--r--src/devices/bus/snes/spc7110.h226
-rw-r--r--src/devices/bus/snes/sufami.c162
-rw-r--r--src/devices/bus/snes/sufami.h53
-rw-r--r--src/devices/bus/snes/upd.c566
-rw-r--r--src/devices/bus/snes/upd.h223
-rw-r--r--src/devices/bus/snes_ctrl/bcbattle.c212
-rw-r--r--src/devices/bus/snes_ctrl/bcbattle.h60
-rw-r--r--src/devices/bus/snes_ctrl/ctrl.c136
-rw-r--r--src/devices/bus/snes_ctrl/ctrl.h100
-rw-r--r--src/devices/bus/snes_ctrl/joypad.c125
-rw-r--r--src/devices/bus/snes_ctrl/joypad.h55
-rw-r--r--src/devices/bus/snes_ctrl/miracle.c278
-rw-r--r--src/devices/bus/snes_ctrl/miracle.h72
-rw-r--r--src/devices/bus/snes_ctrl/mouse.c239
-rw-r--r--src/devices/bus/snes_ctrl/mouse.h63
-rw-r--r--src/devices/bus/snes_ctrl/multitap.c154
-rw-r--r--src/devices/bus/snes_ctrl/multitap.h61
-rw-r--r--src/devices/bus/snes_ctrl/pachinko.c110
-rw-r--r--src/devices/bus/snes_ctrl/pachinko.h56
-rw-r--r--src/devices/bus/snes_ctrl/sscope.c185
-rw-r--r--src/devices/bus/snes_ctrl/sscope.h60
-rw-r--r--src/devices/bus/snes_ctrl/twintap.c113
-rw-r--r--src/devices/bus/snes_ctrl/twintap.h55
-rw-r--r--src/devices/bus/spc1000/exp.c82
-rw-r--r--src/devices/bus/spc1000/exp.h50
-rw-r--r--src/devices/bus/spc1000/fdd.c226
-rw-r--r--src/devices/bus/spc1000/fdd.h65
-rw-r--r--src/devices/bus/spc1000/vdp.c106
-rw-r--r--src/devices/bus/spc1000/vdp.h45
-rw-r--r--src/devices/bus/ti99_peb/bwg.c704
-rw-r--r--src/devices/bus/ti99_peb/bwg.h142
-rw-r--r--src/devices/bus/ti99_peb/evpc.c369
-rw-r--r--src/devices/bus/ti99_peb/evpc.h62
-rw-r--r--src/devices/bus/ti99_peb/hfdc.c1079
-rw-r--r--src/devices/bus/ti99_peb/hfdc.h188
-rw-r--r--src/devices/bus/ti99_peb/horizon.c450
-rw-r--r--src/devices/bus/ti99_peb/horizon.h67
-rw-r--r--src/devices/bus/ti99_peb/hsgpl.c680
-rw-r--r--src/devices/bus/ti99_peb/hsgpl.h83
-rw-r--r--src/devices/bus/ti99_peb/memex.c176
-rw-r--r--src/devices/bus/ti99_peb/memex.h45
-rw-r--r--src/devices/bus/ti99_peb/myarcmem.c209
-rw-r--r--src/devices/bus/ti99_peb/myarcmem.h45
-rw-r--r--src/devices/bus/ti99_peb/pcode.c331
-rw-r--r--src/devices/bus/ti99_peb/pcode.h51
-rw-r--r--src/devices/bus/ti99_peb/peribox.c722
-rw-r--r--src/devices/bus/ti99_peb/peribox.h246
-rw-r--r--src/devices/bus/ti99_peb/samsmem.c133
-rw-r--r--src/devices/bus/ti99_peb/samsmem.h44
-rw-r--r--src/devices/bus/ti99_peb/spchsyn.c188
-rw-r--r--src/devices/bus/ti99_peb/spchsyn.h51
-rw-r--r--src/devices/bus/ti99_peb/ti_32kmem.c118
-rw-r--r--src/devices/bus/ti99_peb/ti_32kmem.h36
-rw-r--r--src/devices/bus/ti99_peb/ti_fdc.c432
-rw-r--r--src/devices/bus/ti99_peb/ti_fdc.h111
-rw-r--r--src/devices/bus/ti99_peb/ti_rs232.c1135
-rw-r--r--src/devices/bus/ti99_peb/ti_rs232.h168
-rw-r--r--src/devices/bus/ti99_peb/tn_ide.c382
-rw-r--r--src/devices/bus/ti99_peb/tn_ide.h64
-rw-r--r--src/devices/bus/ti99_peb/tn_usbsm.c345
-rw-r--r--src/devices/bus/ti99_peb/tn_usbsm.h60
-rw-r--r--src/devices/bus/ti99x/990_dk.c893
-rw-r--r--src/devices/bus/ti99x/990_dk.h74
-rw-r--r--src/devices/bus/ti99x/990_hd.c1025
-rw-r--r--src/devices/bus/ti99x/990_hd.h80
-rw-r--r--src/devices/bus/ti99x/990_tap.c1021
-rw-r--r--src/devices/bus/ti99x/990_tap.h63
-rw-r--r--src/devices/bus/ti99x/998board.c1076
-rw-r--r--src/devices/bus/ti99x/998board.h278
-rw-r--r--src/devices/bus/ti99x/datamux.c489
-rw-r--r--src/devices/bus/ti99x/datamux.h157
-rw-r--r--src/devices/bus/ti99x/genboard.c1994
-rw-r--r--src/devices/bus/ti99x/genboard.h220
-rw-r--r--src/devices/bus/ti99x/grom.c269
-rw-r--r--src/devices/bus/ti99x/grom.h108
-rw-r--r--src/devices/bus/ti99x/gromport.c2509
-rw-r--r--src/devices/bus/ti99x/gromport.h547
-rw-r--r--src/devices/bus/ti99x/handset.c530
-rw-r--r--src/devices/bus/ti99x/handset.h93
-rw-r--r--src/devices/bus/ti99x/joyport.c115
-rw-r--r--src/devices/bus/ti99x/joyport.h89
-rw-r--r--src/devices/bus/ti99x/mecmouse.c209
-rw-r--r--src/devices/bus/ti99x/mecmouse.h48
-rw-r--r--src/devices/bus/ti99x/ti99defs.h116
-rw-r--r--src/devices/bus/ti99x/videowrp.c258
-rw-r--r--src/devices/bus/ti99x/videowrp.h187
-rw-r--r--src/devices/bus/tvc/hbf.c178
-rw-r--r--src/devices/bus/tvc/hbf.h59
-rw-r--r--src/devices/bus/tvc/tvc.c167
-rw-r--r--src/devices/bus/tvc/tvc.h128
-rw-r--r--src/devices/bus/vboy/rom.c61
-rw-r--r--src/devices/bus/vboy/rom.h47
-rw-r--r--src/devices/bus/vboy/slot.c273
-rw-r--r--src/devices/bus/vboy/slot.h115
-rw-r--r--src/devices/bus/vc4000/rom.c269
-rw-r--r--src/devices/bus/vc4000/rom.h74
-rw-r--r--src/devices/bus/vc4000/slot.c295
-rw-r--r--src/devices/bus/vc4000/slot.h117
-rw-r--r--src/devices/bus/vcs/compumat.c53
-rw-r--r--src/devices/bus/vcs/compumat.h35
-rw-r--r--src/devices/bus/vcs/dpc.c300
-rw-r--r--src/devices/bus/vcs/dpc.h95
-rwxr-xr-xsrc/devices/bus/vcs/rom.c1050
-rwxr-xr-xsrc/devices/bus/vcs/rom.h391
-rw-r--r--src/devices/bus/vcs/scharger.c214
-rw-r--r--src/devices/bus/vcs/scharger.h47
-rwxr-xr-xsrc/devices/bus/vcs/vcs_slot.c853
-rwxr-xr-xsrc/devices/bus/vcs/vcs_slot.h160
-rw-r--r--src/devices/bus/vcs_ctrl/ctrl.c83
-rw-r--r--src/devices/bus/vcs_ctrl/ctrl.h124
-rw-r--r--src/devices/bus/vcs_ctrl/joybooster.c95
-rw-r--r--src/devices/bus/vcs_ctrl/joybooster.h59
-rw-r--r--src/devices/bus/vcs_ctrl/joystick.c74
-rw-r--r--src/devices/bus/vcs_ctrl/joystick.h51
-rw-r--r--src/devices/bus/vcs_ctrl/keypad.c139
-rw-r--r--src/devices/bus/vcs_ctrl/keypad.h59
-rw-r--r--src/devices/bus/vcs_ctrl/lightpen.c85
-rw-r--r--src/devices/bus/vcs_ctrl/lightpen.h55
-rw-r--r--src/devices/bus/vcs_ctrl/paddles.c99
-rw-r--r--src/devices/bus/vcs_ctrl/paddles.h58
-rw-r--r--src/devices/bus/vcs_ctrl/wheel.c76
-rw-r--r--src/devices/bus/vcs_ctrl/wheel.h52
-rw-r--r--src/devices/bus/vectrex/rom.c88
-rw-r--r--src/devices/bus/vectrex/rom.h67
-rw-r--r--src/devices/bus/vectrex/slot.c278
-rw-r--r--src/devices/bus/vectrex/slot.h115
-rw-r--r--src/devices/bus/vic10/exp.c243
-rw-r--r--src/devices/bus/vic10/exp.h184
-rw-r--r--src/devices/bus/vic10/std.c78
-rw-r--r--src/devices/bus/vic10/std.h47
-rw-r--r--src/devices/bus/vic20/4cga.c113
-rw-r--r--src/devices/bus/vic20/4cga.h66
-rw-r--r--src/devices/bus/vic20/exp.c229
-rw-r--r--src/devices/bus/vic20/exp.h172
-rw-r--r--src/devices/bus/vic20/fe3.c638
-rw-r--r--src/devices/bus/vic20/fe3.h94
-rw-r--r--src/devices/bus/vic20/megacart.c130
-rw-r--r--src/devices/bus/vic20/megacart.h60
-rw-r--r--src/devices/bus/vic20/std.c69
-rw-r--r--src/devices/bus/vic20/std.h46
-rw-r--r--src/devices/bus/vic20/user.c22
-rw-r--r--src/devices/bus/vic20/user.h33
-rw-r--r--src/devices/bus/vic20/vic1010.c126
-rw-r--r--src/devices/bus/vic20/vic1010.h69
-rw-r--r--src/devices/bus/vic20/vic1011.c101
-rw-r--r--src/devices/bus/vic20/vic1011.h57
-rw-r--r--src/devices/bus/vic20/vic1110.c117
-rw-r--r--src/devices/bus/vic20/vic1110.h54
-rw-r--r--src/devices/bus/vic20/vic1111.c81
-rw-r--r--src/devices/bus/vic20/vic1111.h50
-rw-r--r--src/devices/bus/vic20/vic1112.c216
-rw-r--r--src/devices/bus/vic20/vic1112.h72
-rw-r--r--src/devices/bus/vic20/vic1210.c78
-rw-r--r--src/devices/bus/vic20/vic1210.h51
-rw-r--r--src/devices/bus/vidbrain/exp.c206
-rw-r--r--src/devices/bus/vidbrain/exp.h169
-rw-r--r--src/devices/bus/vidbrain/money_minder.c76
-rw-r--r--src/devices/bus/vidbrain/money_minder.h46
-rw-r--r--src/devices/bus/vidbrain/std.c62
-rw-r--r--src/devices/bus/vidbrain/std.h45
-rw-r--r--src/devices/bus/vidbrain/timeshare.c75
-rw-r--r--src/devices/bus/vidbrain/timeshare.h46
-rw-r--r--src/devices/bus/vip/byteio.c88
-rw-r--r--src/devices/bus/vip/byteio.h133
-rw-r--r--src/devices/bus/vip/exp.c217
-rw-r--r--src/devices/bus/vip/exp.h167
-rw-r--r--src/devices/bus/vip/vp550.c249
-rw-r--r--src/devices/bus/vip/vp550.h66
-rw-r--r--src/devices/bus/vip/vp570.c120
-rw-r--r--src/devices/bus/vip/vp570.h54
-rw-r--r--src/devices/bus/vip/vp575.c317
-rw-r--r--src/devices/bus/vip/vp575.h96
-rw-r--r--src/devices/bus/vip/vp585.c132
-rw-r--r--src/devices/bus/vip/vp585.h56
-rw-r--r--src/devices/bus/vip/vp590.c261
-rw-r--r--src/devices/bus/vip/vp590.h71
-rw-r--r--src/devices/bus/vip/vp595.c100
-rw-r--r--src/devices/bus/vip/vp595.h53
-rw-r--r--src/devices/bus/vip/vp620.c103
-rw-r--r--src/devices/bus/vip/vp620.h57
-rw-r--r--src/devices/bus/vip/vp700.c81
-rw-r--r--src/devices/bus/vip/vp700.h52
-rw-r--r--src/devices/bus/vtech/ioexp/carts.c14
-rw-r--r--src/devices/bus/vtech/ioexp/carts.h21
-rw-r--r--src/devices/bus/vtech/ioexp/ioexp.c91
-rw-r--r--src/devices/bus/vtech/ioexp/ioexp.h87
-rw-r--r--src/devices/bus/vtech/ioexp/joystick.c109
-rw-r--r--src/devices/bus/vtech/ioexp/joystick.h50
-rw-r--r--src/devices/bus/vtech/ioexp/printer.c93
-rw-r--r--src/devices/bus/vtech/ioexp/printer.h52
-rw-r--r--src/devices/bus/vtech/memexp/carts.c19
-rw-r--r--src/devices/bus/vtech/memexp/carts.h23
-rw-r--r--src/devices/bus/vtech/memexp/floppy.c298
-rw-r--r--src/devices/bus/vtech/memexp/floppy.h66
-rw-r--r--src/devices/bus/vtech/memexp/memexp.c108
-rw-r--r--src/devices/bus/vtech/memexp/memexp.h125
-rw-r--r--src/devices/bus/vtech/memexp/memory.c166
-rw-r--r--src/devices/bus/vtech/memexp/memory.h94
-rw-r--r--src/devices/bus/vtech/memexp/rs232.c104
-rw-r--r--src/devices/bus/vtech/memexp/rs232.h50
-rw-r--r--src/devices/bus/vtech/memexp/wordpro.c65
-rw-r--r--src/devices/bus/vtech/memexp/wordpro.h39
-rw-r--r--src/devices/bus/wangpc/emb.c175
-rw-r--r--src/devices/bus/wangpc/emb.h55
-rw-r--r--src/devices/bus/wangpc/lic.c159
-rw-r--r--src/devices/bus/wangpc/lic.h53
-rw-r--r--src/devices/bus/wangpc/lvc.c340
-rw-r--r--src/devices/bus/wangpc/lvc.h68
-rw-r--r--src/devices/bus/wangpc/mcc.c265
-rw-r--r--src/devices/bus/wangpc/mcc.h60
-rw-r--r--src/devices/bus/wangpc/mvc.c333
-rw-r--r--src/devices/bus/wangpc/mvc.h68
-rw-r--r--src/devices/bus/wangpc/rtc.c278
-rw-r--r--src/devices/bus/wangpc/rtc.h66
-rw-r--r--src/devices/bus/wangpc/tig.c324
-rw-r--r--src/devices/bus/wangpc/tig.h69
-rw-r--r--src/devices/bus/wangpc/wangpc.c278
-rw-r--r--src/devices/bus/wangpc/wangpc.h228
-rw-r--r--src/devices/bus/wangpc/wdc.c342
-rw-r--r--src/devices/bus/wangpc/wdc.h81
-rw-r--r--src/devices/bus/wswan/rom.c524
-rw-r--r--src/devices/bus/wswan/rom.h105
-rw-r--r--src/devices/bus/wswan/slot.c457
-rw-r--r--src/devices/bus/wswan/slot.h131
-rw-r--r--src/devices/bus/x68k/x68k_neptunex.c149
-rw-r--r--src/devices/bus/x68k/x68k_neptunex.h54
-rw-r--r--src/devices/bus/x68k/x68k_scsiext.c101
-rw-r--r--src/devices/bus/x68k/x68k_scsiext.h46
-rw-r--r--src/devices/bus/x68k/x68kexp.c79
-rw-r--r--src/devices/bus/x68k/x68kexp.h149
-rw-r--r--src/devices/bus/z88/flash.c94
-rw-r--r--src/devices/bus/z88/flash.h46
-rw-r--r--src/devices/bus/z88/ram.c110
-rw-r--r--src/devices/bus/z88/ram.h85
-rw-r--r--src/devices/bus/z88/rom.c89
-rw-r--r--src/devices/bus/z88/rom.h70
-rw-r--r--src/devices/bus/z88/z88.c212
-rw-r--r--src/devices/bus/z88/z88.h138
1552 files changed, 291977 insertions, 0 deletions
diff --git a/src/devices/bus/a1bus/a1bus.c b/src/devices/bus/a1bus/a1bus.c
new file mode 100644
index 00000000000..7012d11a81b
--- /dev/null
+++ b/src/devices/bus/a1bus/a1bus.c
@@ -0,0 +1,204 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/***************************************************************************
+
+ a1bus.c - Apple I slot bus and card emulation
+
+***************************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+#include "a1bus.h"
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A1BUS_SLOT = &device_creator<a1bus_slot_device>;
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// a1bus_slot_device - constructor
+//-------------------------------------------------
+a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A1BUS_SLOT, "Apple I Slot", tag, owner, clock, "a1bus_slot", __FILE__),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+void a1bus_slot_device::static_set_a1bus_slot(device_t &device, const char *tag, const char *slottag)
+{
+ a1bus_slot_device &a1bus_card = dynamic_cast<a1bus_slot_device &>(device);
+ a1bus_card.m_a1bus_tag = tag;
+ a1bus_card.m_a1bus_slottag = slottag;
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a1bus_slot_device::device_start()
+{
+ device_a1bus_card_interface *dev = dynamic_cast<device_a1bus_card_interface *>(get_card_device());
+
+ if (dev) device_a1bus_card_interface::static_set_a1bus_tag(*dev, m_a1bus_tag, m_a1bus_slottag);
+}
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A1BUS = &device_creator<a1bus_device>;
+
+void a1bus_device::static_set_cputag(device_t &device, const char *tag)
+{
+ a1bus_device &a1bus = downcast<a1bus_device &>(device);
+ a1bus.m_cputag = tag;
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// a1bus_device - constructor
+//-------------------------------------------------
+
+a1bus_device::a1bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A1BUS, "Apple I Bus", tag, owner, clock, "a1bus", __FILE__),
+ m_out_irq_cb(*this),
+ m_out_nmi_cb(*this)
+{
+}
+
+a1bus_device::a1bus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ m_out_irq_cb(*this),
+ m_out_nmi_cb(*this)
+{
+}
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a1bus_device::device_start()
+{
+ m_maincpu = machine().device<cpu_device>(m_cputag);
+
+ // resolve callbacks
+ m_out_irq_cb.resolve_safe();
+ m_out_nmi_cb.resolve_safe();
+
+ // clear slot
+ m_device = NULL;
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void a1bus_device::device_reset()
+{
+}
+
+device_a1bus_card_interface *a1bus_device::get_a1bus_card()
+{
+ return m_device;
+}
+
+void a1bus_device::add_a1bus_card(device_a1bus_card_interface *card)
+{
+ m_device = card;
+}
+
+void a1bus_device::set_irq_line(int state)
+{
+ m_out_irq_cb(state);
+}
+
+void a1bus_device::set_nmi_line(int state)
+{
+ m_out_nmi_cb(state);
+}
+
+void a1bus_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler)
+{
+ m_maincpu = machine().device<cpu_device>(m_cputag);
+
+ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler);
+}
+
+void a1bus_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data)
+{
+// printf("install_bank: %s @ %x->%x mask %x mirror %x\n", tag, start, end, mask, mirror);
+ m_maincpu = machine().device<cpu_device>(m_cputag);
+ address_space &space = m_maincpu->space(AS_PROGRAM);
+ space.install_readwrite_bank(start, end, mask, mirror, tag );
+ machine().root_device().membank(tag)->set_base(data);
+}
+
+// interrupt request from a1bus card
+WRITE_LINE_MEMBER( a1bus_device::irq_w ) { m_out_irq_cb(state); }
+WRITE_LINE_MEMBER( a1bus_device::nmi_w ) { m_out_nmi_cb(state); }
+
+//**************************************************************************
+// DEVICE CONFIG A1BUS CARD INTERFACE
+//**************************************************************************
+
+
+//**************************************************************************
+// DEVICE A1BUS CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_a1bus_card_interface - constructor
+//-------------------------------------------------
+
+device_a1bus_card_interface::device_a1bus_card_interface(const machine_config &mconfig, device_t &device)
+ : device_slot_card_interface(mconfig, device),
+ m_a1bus(NULL),
+ m_a1bus_tag(NULL)
+{
+}
+
+
+//-------------------------------------------------
+// ~device_a1bus_card_interface - destructor
+//-------------------------------------------------
+
+device_a1bus_card_interface::~device_a1bus_card_interface()
+{
+}
+
+void device_a1bus_card_interface::static_set_a1bus_tag(device_t &device, const char *tag, const char *slottag)
+{
+ device_a1bus_card_interface &a1bus_card = dynamic_cast<device_a1bus_card_interface &>(device);
+ a1bus_card.m_a1bus_tag = tag;
+ a1bus_card.m_a1bus_slottag = slottag;
+}
+
+void device_a1bus_card_interface::set_a1bus_device()
+{
+ m_a1bus = dynamic_cast<a1bus_device *>(device().machine().device(m_a1bus_tag));
+ m_a1bus->add_a1bus_card(this);
+}
+
+void device_a1bus_card_interface::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler)
+{
+ m_a1bus->install_device(start, end, rhandler, whandler);
+}
+
+void device_a1bus_card_interface::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, char *tag, UINT8 *data)
+{
+ m_a1bus->install_bank(start, end, mask, mirror, tag, data);
+}
diff --git a/src/devices/bus/a1bus/a1bus.h b/src/devices/bus/a1bus/a1bus.h
new file mode 100644
index 00000000000..ecdb440f948
--- /dev/null
+++ b/src/devices/bus/a1bus/a1bus.h
@@ -0,0 +1,145 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/***************************************************************************
+
+ a1bus.h - Apple I expansion slot and card emulation
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __A1BUS_H__
+#define __A1BUS_H__
+
+#include "emu.h"
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_A1BUS_CPU(_cputag) \
+ a1bus_device::static_set_cputag(*device, _cputag);
+
+#define MCFG_A1BUS_OUT_IRQ_CB(_devcb) \
+ devcb = &a1bus_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+
+#define MCFG_A1BUS_OUT_NMI_CB(_devcb) \
+ devcb = &a1bus_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+
+#define MCFG_A1BUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
+ MCFG_DEVICE_ADD(_tag, A1BUS_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
+ a1bus_slot_device::static_set_a1bus_slot(*device, _nbtag, _tag);
+#define MCFG_A1BUS_SLOT_REMOVE(_tag) \
+ MCFG_DEVICE_REMOVE(_tag)
+
+#define MCFG_A1BUS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
+ MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
+ MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
+ device_a1bus_card_interface::static_set_a1bus_tag(*device, _nbtag, _tag);
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a1bus_device;
+
+class a1bus_slot_device : public device_t,
+ public device_slot_interface
+{
+public:
+ // construction/destruction
+ a1bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a1bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // device-level overrides
+ virtual void device_start();
+
+ // inline configuration
+ static void static_set_a1bus_slot(device_t &device, const char *tag, const char *slottag);
+protected:
+ // configuration
+ const char *m_a1bus_tag, *m_a1bus_slottag;
+};
+
+// device type definition
+extern const device_type A1BUS_SLOT;
+
+
+class device_a1bus_card_interface;
+// ======================> a1bus_device
+class a1bus_device : public device_t
+{
+public:
+ // construction/destruction
+ a1bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a1bus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // inline configuration
+ static void static_set_cputag(device_t &device, const char *tag);
+ template<class _Object> static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast<a1bus_device &>(device).m_out_irq_cb.set_callback(object); }
+ template<class _Object> static devcb_base &set_out_nmi_callback(device_t &device, _Object object) { return downcast<a1bus_device &>(device).m_out_nmi_cb.set_callback(object); }
+
+ void add_a1bus_card(device_a1bus_card_interface *card);
+ device_a1bus_card_interface *get_a1bus_card();
+
+ void set_irq_line(int state);
+ void set_nmi_line(int state);
+
+ void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
+ void install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data);
+
+ DECLARE_WRITE_LINE_MEMBER( irq_w );
+ DECLARE_WRITE_LINE_MEMBER( nmi_w );
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ // internal state
+ cpu_device *m_maincpu;
+
+ devcb_write_line m_out_irq_cb;
+ devcb_write_line m_out_nmi_cb;
+
+ device_a1bus_card_interface *m_device;
+ const char *m_cputag;
+};
+
+
+// device type definition
+extern const device_type A1BUS;
+
+// ======================> device_a1bus_card_interface
+
+// class representing interface-specific live a1bus card
+class device_a1bus_card_interface : public device_slot_card_interface
+{
+ friend class a1bus_device;
+public:
+ // construction/destruction
+ device_a1bus_card_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_a1bus_card_interface();
+
+ device_a1bus_card_interface *next() const { return m_next; }
+
+ void set_a1bus_device();
+
+ void raise_slot_irq() { m_a1bus->set_irq_line(ASSERT_LINE); }
+ void lower_slot_irq() { m_a1bus->set_irq_line(CLEAR_LINE); }
+ void raise_slot_nmi() { m_a1bus->set_nmi_line(ASSERT_LINE); }
+ void lower_slot_nmi() { m_a1bus->set_nmi_line(CLEAR_LINE); }
+
+ void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
+ void install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, char *tag, UINT8 *data);
+
+ // inline configuration
+ static void static_set_a1bus_tag(device_t &device, const char *tag, const char *slottag);
+public:
+ a1bus_device *m_a1bus;
+ const char *m_a1bus_tag, *m_a1bus_slottag;
+ device_a1bus_card_interface *m_next;
+};
+
+#endif /* __A1BUS_H__ */
diff --git a/src/devices/bus/a1bus/a1cassette.c b/src/devices/bus/a1bus/a1cassette.c
new file mode 100644
index 00000000000..daa79b15ce5
--- /dev/null
+++ b/src/devices/bus/a1bus/a1cassette.c
@@ -0,0 +1,201 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a1cassette.c
+
+ Apple I Cassette Interface
+
+*********************************************************************/
+
+#include "a1cassette.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+#define CASSETTE_ROM_REGION "casrom"
+
+const device_type A1BUS_CASSETTE = &device_creator<a1bus_cassette_device>;
+
+/* sound output */
+
+MACHINE_CONFIG_FRAGMENT( cassette )
+ MCFG_CASSETTE_ADD("cassette")
+ MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED)
+ MCFG_CASSETTE_INTERFACE("apple1_cass")
+MACHINE_CONFIG_END
+
+ROM_START( cassette )
+ /* 256-byte cassette interface ROM, in two 82s129 or mmi6301 256x4 proms at locations 3 and 4 on the cassette interface daughtercard (they are labeled "MMI 6301-IJ // 7623L // APPLE-A3" and "MMI 6301-IJ // 7623L // APPLE-A4") */
+ ROM_REGION(0x100, CASSETTE_ROM_REGION, 0)
+ ROM_LOAD_NIB_HIGH( "apple-a3.3", 0x0000, 0x0100, CRC(6eae8f52) SHA1(71906932727ef70952ef6afe6b08708df15cd67d) )
+ ROM_LOAD_NIB_LOW( "apple-a4.4", 0x0000, 0x0100, CRC(94efa977) SHA1(851f3bd6863859a1a6909179a5e5bf744b3d807e) )
+ROM_END
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a1bus_cassette_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( cassette );
+}
+
+const rom_entry *a1bus_cassette_device::device_rom_region() const
+{
+ return ROM_NAME( cassette );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a1bus_cassette_device::a1bus_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A1BUS_CASSETTE, "Apple I cassette board", tag, owner, clock, "a1cass", __FILE__),
+ device_a1bus_card_interface(mconfig, *this),
+ m_cassette(*this, "cassette")
+{
+}
+
+a1bus_cassette_device::a1bus_cassette_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a1bus_card_interface(mconfig, *this),
+ m_cassette(*this, "cassette")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a1bus_cassette_device::device_start()
+{
+ set_a1bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(CASSETTE_ROM_REGION).c_str())->base();
+
+ install_device(0xc000, 0xc0ff, read8_delegate(FUNC(a1bus_cassette_device::cassette_r), this), write8_delegate(FUNC(a1bus_cassette_device::cassette_w), this));
+ install_bank(0xc100, 0xc1ff, 0, 0, (char *)"bank_a1cas", m_rom);
+
+ save_item(NAME(m_cassette_output_flipflop));
+}
+
+void a1bus_cassette_device::device_reset()
+{
+ m_cassette_output_flipflop = 0;
+}
+
+/*****************************************************************************
+** Cassette interface I/O
+**
+** The Apple I's cassette interface was a small card that plugged
+** into the expansion connector on the motherboard. (This was a
+** slot-type connector, separate from the motherboard's edge
+** connector, but with the same signals.) The cassette interface
+** provided separate cassette input and output jacks, some very
+** simple interface hardware, and 256 bytes of ROM containing the
+** cassette I/O code.
+**
+** The interface was mostly software-controlled. The only hardware
+** was an output flip-flop for generating the cassette output signal,
+** a National Semiconductor LM311 voltage comparator for generating a
+** digital signal from the analog cassette input, an input
+** signal-level LED, and some gates to control the interface logic
+** and address decoding. The cassette ROM code did most of the work
+** of generating and interpreting tape signals. It also contained
+** its own mini-monitor for issuing tape read and write commands.
+**
+** The cassette interface was assigned to the $C000-$CFFF block of
+** addresses, although it did not use most of the space in that
+** block. Addresses were mapped as follows:
+**
+** $C000-$C0FF: Cassette I/O space.
+** Any access here toggles the output signal.
+** $C000-$C07F: Cassette output only; input disabled.
+** Mirrors $C100-$C17F on reads.
+** $C080-$C0FF: Cassette input and output.
+** When input low, mirrors $C180-$C1FF on reads.
+** When input high, both odd and even addresses
+** mirror even ROM addresses $C180-$C1FE.
+** $C100-$C1FF: Cassette ROM code.
+**
+** Note the peculiar addressing scheme. Data was written simply
+** through repeated accesses, rather than by writing to an address.
+** Data was read by reading an odd input address and comparing the
+** ROM byte returned to detect signal changes.
+**
+** The standard tape signal was a simple square wave, although this
+** was often greatly distorted by the cassette recorder. A single
+** tape record consisted of a 10-second 800-Hz leader, followed by a
+** single short square-wave cycle used as a sync bit, followed by the
+** tape data. The data was encoded using a single square-wave cycle
+** for each bit; "1" bits were at 1000 Hz, "0" bits at 2000 Hz. (All
+** of these frequencies are approximate and could vary due to
+** differences in recorder speed.) Each byte was written starting
+** from the most significant bit; bytes were written from low to high
+** addresses. No error detection was provided. Multiple records
+** could be placed on a single tape.
+*****************************************************************************/
+
+/* The cassette output signal for writing tapes is generated by a
+ flip-flop which is toggled to produce the output waveform. Any
+ access to the cassette I/O range, whether a read or a write,
+ toggles this flip-flop. */
+void a1bus_cassette_device::cassette_toggle_output()
+{
+ m_cassette_output_flipflop = !m_cassette_output_flipflop;
+ m_cassette->output(m_cassette_output_flipflop ? 1.0 : -1.0);
+}
+
+READ8_MEMBER(a1bus_cassette_device::cassette_r)
+{
+ cassette_toggle_output();
+
+ if (offset <= 0x7f)
+ {
+ /* If the access is to address range $C000-$C07F, the cassette
+ input signal is ignored . In this case the value read
+ always comes from the corresponding cassette ROM location
+ in $C100-$C17F. */
+
+ return m_rom[offset];
+ }
+ else
+ {
+ /* For accesses to address range $C080-$C0FF, the cassette
+ input signal is enabled. If the signal is low, the value
+ read comes from the corresponding cassette ROM location in
+ $C180-$C1FF. If the signal is high, the low bit of the
+ address is masked before the corresponding cassette ROM
+ location is accessed; e.g., a read from $C081 would return
+ the ROM byte at $C180. The cassette ROM routines detect
+ changes in the cassette input signal by repeatedly reading
+ from $C081 and comparing the values read. */
+
+ /* (Don't try putting a non-zero "noise threshhold" here,
+ because it can cause tape header bits on real cassette
+ images to be misread as data bits.) */
+ if (m_cassette->input() > 0.0)
+ return m_rom[0xc100 + (offset & ~1)];
+ else
+ return m_rom[0xc100 + offset];
+ }
+}
+
+WRITE8_MEMBER(a1bus_cassette_device::cassette_w)
+{
+ /* Writes toggle the output flip-flop in the same way that reads
+ do; other than that they have no effect. Any repeated accesses
+ to the cassette I/O address range can be used to write data to
+ cassette, and the cassette ROM always uses reads to do this.
+ However, we still have to handle writes, since they may be done
+ by user code. */
+
+ cassette_toggle_output();
+}
diff --git a/src/devices/bus/a1bus/a1cassette.h b/src/devices/bus/a1bus/a1cassette.h
new file mode 100644
index 00000000000..e8d656c1c3a
--- /dev/null
+++ b/src/devices/bus/a1bus/a1cassette.h
@@ -0,0 +1,53 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a1cassette.h
+
+ Apple I Cassette Interface
+
+*********************************************************************/
+
+#ifndef __A1BUS_CASSETTE__
+#define __A1BUS_CASSETTE__
+
+#include "a1bus.h"
+#include "imagedev/cassette.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a1bus_cassette_device:
+ public device_t,
+ public device_a1bus_card_interface
+{
+public:
+ // construction/destruction
+ a1bus_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a1bus_cassette_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+ optional_device<cassette_image_device> m_cassette;
+
+ DECLARE_READ8_MEMBER(cassette_r);
+ DECLARE_WRITE8_MEMBER(cassette_w);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ void cassette_toggle_output();
+
+private:
+ UINT8 *m_rom;
+ int m_cassette_output_flipflop;
+};
+
+// device type definition
+extern const device_type A1BUS_CASSETTE;
+
+#endif /* __A1BUS_CASSETTE__ */
diff --git a/src/devices/bus/a1bus/a1cffa.c b/src/devices/bus/a1bus/a1cffa.c
new file mode 100644
index 00000000000..f67470bb5db
--- /dev/null
+++ b/src/devices/bus/a1bus/a1cffa.c
@@ -0,0 +1,156 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a1cffa.c
+
+ Rich Dreher's Compact Flash for Apple I
+
+*********************************************************************/
+
+#include "a1cffa.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+#define CFFA_ROM_REGION "cffa_rom"
+#define CFFA_ATA_TAG "cffa_ata"
+
+const device_type A1BUS_CFFA = &device_creator<a1bus_cffa_device>;
+
+MACHINE_CONFIG_FRAGMENT( cffa )
+ MCFG_ATA_INTERFACE_ADD(CFFA_ATA_TAG, ata_devices, "hdd", NULL, false)
+MACHINE_CONFIG_END
+
+ROM_START( cffa )
+ ROM_REGION(0x2000, CFFA_ROM_REGION, 0)
+ ROM_LOAD ("cffaromv1.1.bin", 0x0000, 0x1fe0, CRC(bf6b55ad) SHA1(6a290be18485a06f243a3561c4e01be5aafa4bfe) )
+ROM_END
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a1bus_cffa_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( cffa );
+}
+
+const rom_entry *a1bus_cffa_device::device_rom_region() const
+{
+ return ROM_NAME( cffa );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a1bus_cffa_device::a1bus_cffa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A1BUS_CFFA, "CFFA Compact Flash for Apple I", tag, owner, clock, "cffa1", __FILE__),
+ device_a1bus_card_interface(mconfig, *this),
+ m_ata(*this, CFFA_ATA_TAG)
+{
+}
+
+a1bus_cffa_device::a1bus_cffa_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a1bus_card_interface(mconfig, *this),
+ m_ata(*this, CFFA_ATA_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a1bus_cffa_device::device_start()
+{
+ set_a1bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(CFFA_ROM_REGION).c_str())->base();
+
+ install_device(0xafe0, 0xafff, read8_delegate(FUNC(a1bus_cffa_device::cffa_r), this), write8_delegate(FUNC(a1bus_cffa_device::cffa_w), this));
+ install_bank(0x9000, 0xafdf, 0, 0, (char *)"bank_cffa1", m_rom);
+
+ save_item(NAME(m_lastdata));
+ save_item(NAME(m_writeprotect));
+}
+
+void a1bus_cffa_device::device_reset()
+{
+ m_writeprotect = false;
+ m_lastdata = 0;
+}
+
+READ8_MEMBER(a1bus_cffa_device::cffa_r)
+{
+ switch (offset & 0xf)
+ {
+ case 0x0:
+ return m_lastdata>>8;
+
+ case 0x3:
+ m_writeprotect = false;
+ break;
+
+ case 0x4:
+ m_writeprotect = true;
+ break;
+
+ case 0x8:
+ m_lastdata = m_ata->read_cs0(space, (offset & 0xf) - 8, 0xff);
+ return m_lastdata & 0x00ff;
+
+ case 0x9:
+ case 0xa:
+ case 0xb:
+ case 0xc:
+ case 0xd:
+ case 0xe:
+ case 0xf:
+ return m_ata->read_cs0(space, (offset & 0xf) - 8, 0xff);
+ }
+
+ return 0xff;
+}
+
+WRITE8_MEMBER(a1bus_cffa_device::cffa_w)
+{
+ switch (offset & 0xf)
+ {
+ case 0x0:
+ m_lastdata &= 0x00ff;
+ m_lastdata |= data<<8;
+ break;
+
+ case 0x3:
+ m_writeprotect = false;
+ break;
+
+ case 0x4:
+ m_writeprotect = true;
+ break;
+
+
+ case 0x8:
+ m_ata->write_cs0(space, (offset & 0xf) - 8, data, 0xff);
+ break;
+
+ case 0x9:
+ case 0xa:
+ case 0xb:
+ case 0xc:
+ case 0xd:
+ case 0xe:
+ case 0xf:
+ m_ata->write_cs0(space, (offset & 0xf) - 8, data, 0xff);
+ break;
+
+ }
+}
diff --git a/src/devices/bus/a1bus/a1cffa.h b/src/devices/bus/a1bus/a1cffa.h
new file mode 100644
index 00000000000..a1dc4258cbc
--- /dev/null
+++ b/src/devices/bus/a1bus/a1cffa.h
@@ -0,0 +1,53 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a1cffa.h
+
+ Rich Dreher's Compact Flash for Apple I
+
+*********************************************************************/
+
+#ifndef __A1BUS_CFFA__
+#define __A1BUS_CFFA__
+
+#include "emu.h"
+#include "a1bus.h"
+#include "machine/ataintf.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a1bus_cffa_device:
+ public device_t,
+ public device_a1bus_card_interface
+{
+public:
+ // construction/destruction
+ a1bus_cffa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a1bus_cffa_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+ required_device<ata_interface_device> m_ata;
+
+ DECLARE_READ8_MEMBER(cffa_r);
+ DECLARE_WRITE8_MEMBER(cffa_w);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ UINT8 *m_rom;
+ UINT16 m_lastdata;
+ bool m_writeprotect;
+};
+
+// device type definition
+extern const device_type A1BUS_CFFA;
+
+#endif /* __A1BUS_CFFA__ */
diff --git a/src/devices/bus/a2bus/a2alfam2.c b/src/devices/bus/a2bus/a2alfam2.c
new file mode 100644
index 00000000000..3a35c8ab253
--- /dev/null
+++ b/src/devices/bus/a2bus/a2alfam2.c
@@ -0,0 +1,181 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2alfsm2.c
+
+ Implementation of the ALF Apple Music II card (originally marketed as the "MC1")
+ The AE Super Music Synthesizer is a superset of this card (4x76489 instead of 3)
+
+*********************************************************************/
+
+#include "a2alfam2.h"
+#include "includes/apple2.h"
+#include "sound/sn76496.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_ALFAM2 = &device_creator<a2bus_alfam2_device>;
+const device_type A2BUS_AESMS = &device_creator<a2bus_aesms_device>;
+
+#define SN1_TAG "sn76489_1" // left
+#define SN2_TAG "sn76489_2" // center
+#define SN3_TAG "sn76489_3" // right
+#define SN4_TAG "sn76489_4" // center?
+
+MACHINE_CONFIG_FRAGMENT( a2alfam2 )
+ MCFG_SPEAKER_STANDARD_STEREO("alf_l", "alf_r")
+
+ MCFG_SOUND_ADD(SN1_TAG, SN76489, 1020484)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
+ MCFG_SOUND_ADD(SN2_TAG, SN76489, 1020484)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
+ MCFG_SOUND_ADD(SN3_TAG, SN76489, 1020484)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
+MACHINE_CONFIG_END
+
+MACHINE_CONFIG_FRAGMENT( a2aesms )
+ MCFG_SPEAKER_STANDARD_STEREO("alf_l", "alf_r")
+
+ MCFG_SOUND_ADD(SN1_TAG, SN76489, 1020484)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
+
+ MCFG_SOUND_ADD(SN2_TAG, SN76489, 1020484)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
+
+ MCFG_SOUND_ADD(SN3_TAG, SN76489, 1020484)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
+
+ MCFG_SOUND_ADD(SN4_TAG, SN76489, 1020484)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_l", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "alf_r", 0.50)
+MACHINE_CONFIG_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_sn76489_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( a2alfam2 );
+}
+
+machine_config_constructor a2bus_aesms_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( a2aesms );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_sn76489_device::a2bus_sn76489_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_sn1(*this, SN1_TAG),
+ m_sn2(*this, SN2_TAG),
+ m_sn3(*this, SN3_TAG),
+ m_sn4(*this, SN4_TAG)
+{
+}
+
+a2bus_alfam2_device::a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_sn76489_device(mconfig, A2BUS_ALFAM2, "ALF MC1 / Apple Music II", tag, owner, clock, "a2alfam2", __FILE__)
+{
+ m_has4thsn = false;
+}
+
+a2bus_aesms_device::a2bus_aesms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_sn76489_device(mconfig, A2BUS_ALFAM2, "Applied Engineering Super Music Synthesizer", tag, owner, clock, "a2aesms", __FILE__)
+{
+ m_has4thsn = true;
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_sn76489_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+ m_latch0 = m_latch1 = m_latch2 = m_latch3 = 0;
+
+ save_item(NAME(m_latch0));
+ save_item(NAME(m_latch1));
+ save_item(NAME(m_latch2));
+ save_item(NAME(m_latch3));
+}
+
+void a2bus_sn76489_device::device_reset()
+{
+ m_latch0 = m_latch1 = m_latch2 = m_latch3 = 0;
+}
+
+UINT8 a2bus_sn76489_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ // SN76489 can't be read, it appears from the schematics this is what happens
+ switch (offset)
+ {
+ case 0:
+ return m_latch0;
+
+ case 1:
+ return m_latch1;
+
+ case 2:
+ return m_latch2;
+
+ case 3:
+ return m_latch3;
+ }
+
+ return 0xff;
+}
+
+void a2bus_sn76489_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ switch (offset)
+ {
+ case 0:
+ m_sn1->write(space, 0, data);
+ m_latch0 = data;
+ break;
+
+ case 1:
+ m_sn2->write(space, 0, data);
+ m_latch1 = data;
+ break;
+
+ case 2:
+ m_sn3->write(space, 0, data);
+ m_latch2 = data;
+ break;
+
+ case 3:
+ if (m_has4thsn)
+ {
+ m_sn4->write(space, 0, data);
+ m_latch3 = data;
+ }
+ break;
+ }
+}
+
+bool a2bus_sn76489_device::take_c800()
+{
+ return false;
+}
diff --git a/src/devices/bus/a2bus/a2alfam2.h b/src/devices/bus/a2bus/a2alfam2.h
new file mode 100644
index 00000000000..ab2ee9e38a4
--- /dev/null
+++ b/src/devices/bus/a2bus/a2alfam2.h
@@ -0,0 +1,72 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2alfam2.h
+
+ Implementation of the ALF Apple Music II card and compatibles
+
+*********************************************************************/
+
+#ifndef __A2BUS_ALFAM2__
+#define __A2BUS_ALFAM2__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "sound/sn76496.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_sn76489_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_sn76489_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ required_device<sn76489_device> m_sn1;
+ required_device<sn76489_device> m_sn2;
+ required_device<sn76489_device> m_sn3;
+ optional_device<sn76489_device> m_sn4;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual bool take_c800();
+
+private:
+ UINT8 m_latch0, m_latch1, m_latch2, m_latch3;
+
+protected:
+ bool m_has4thsn;
+};
+
+class a2bus_alfam2_device : public a2bus_sn76489_device
+{
+public:
+ a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class a2bus_aesms_device : public a2bus_sn76489_device
+{
+public:
+ a2bus_aesms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual machine_config_constructor device_mconfig_additions() const;
+};
+
+// device type definition
+extern const device_type A2BUS_ALFAM2;
+extern const device_type A2BUS_AESMS;
+
+#endif /* __A2BUS_ALFAM2__ */
diff --git a/src/devices/bus/a2bus/a2applicard.c b/src/devices/bus/a2bus/a2applicard.c
new file mode 100644
index 00000000000..6698ea4f68c
--- /dev/null
+++ b/src/devices/bus/a2bus/a2applicard.c
@@ -0,0 +1,286 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2applicard.c
+
+ Implementation of the PCPI AppliCard Z-80 card
+
+ Unlike the SoftCard and clones, this has its own 64k of RAM on board
+ and the Z80 runs completely independently of the host's 6502.
+
+*********************************************************************/
+
+#include "a2applicard.h"
+#include "includes/apple2.h"
+#include "cpu/z80/z80.h"
+#include "machine/z80ctc.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_APPLICARD = &device_creator<a2bus_applicard_device>;
+
+#define Z80_TAG "z80"
+#define Z80_ROM_REGION "z80_rom"
+
+static ADDRESS_MAP_START( z80_mem, AS_PROGRAM, 8, a2bus_applicard_device )
+ AM_RANGE(0x0000, 0xffff) AM_READWRITE(dma_r, dma_w)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( z80_io, AS_IO, 8, a2bus_applicard_device )
+ AM_RANGE(0x00, 0x60) AM_MIRROR(0xff00) AM_READWRITE(z80_io_r, z80_io_w)
+ADDRESS_MAP_END
+
+MACHINE_CONFIG_FRAGMENT( a2applicard )
+ MCFG_CPU_ADD(Z80_TAG, Z80, 6000000) // Z80 runs at 6 MHz
+ MCFG_CPU_PROGRAM_MAP(z80_mem)
+ MCFG_CPU_IO_MAP(z80_io)
+MACHINE_CONFIG_END
+
+ROM_START( a2applicard )
+ ROM_REGION(0x800, Z80_ROM_REGION, 0)
+ ROM_LOAD( "applicard-v9.bin", 0x000000, 0x000800, CRC(1d461000) SHA1(71d633be864b6084362e85108a4e600cbe6e44fe) )
+ROM_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_applicard_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( a2applicard );
+}
+
+//-------------------------------------------------
+// device_rom_region - device-specific ROMs
+//-------------------------------------------------
+
+const rom_entry *a2bus_applicard_device::device_rom_region() const
+{
+ return ROM_NAME( a2applicard );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_applicard_device::a2bus_applicard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_z80(*this, Z80_TAG)
+{
+}
+
+a2bus_applicard_device::a2bus_applicard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_APPLICARD, "PCPI Applicard", tag, owner, clock, "a2aplcrd", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_z80(*this, Z80_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_applicard_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ // locate Z80 ROM
+ m_z80rom = device().machine().root_device().memregion(this->subtag(Z80_ROM_REGION).c_str())->base();
+
+ save_item(NAME(m_bROMAtZ80Zero));
+ save_item(NAME(m_z80stat));
+ save_item(NAME(m_6502stat));
+ save_item(NAME(m_toz80));
+ save_item(NAME(m_to6502));
+ save_item(NAME(m_z80ram));
+
+ memset(m_z80ram, 0, 64*1024);
+}
+
+void a2bus_applicard_device::device_reset()
+{
+ m_bROMAtZ80Zero = true;
+ m_z80stat = false;
+}
+
+UINT8 a2bus_applicard_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset & 0xf)
+ {
+ case 0:
+ m_6502stat = false;
+ return m_to6502;
+
+ case 1:
+ return m_toz80;
+
+ case 2:
+ if (m_z80stat)
+ {
+ return 0x80;
+ }
+ return false;
+
+ case 3:
+ if (m_6502stat)
+ {
+ return 0x80;
+ }
+ return false;
+
+ case 5:
+ m_bROMAtZ80Zero = true;
+ m_toz80 = false;
+ m_to6502 = false;
+ m_z80->reset();
+ break;
+
+ case 6: // IRQ on Z80 via CTC channel 3 (CP/M doesn't use the CTC or IRQs)
+ fatalerror("Applicard: Z80 IRQ not supported yet\n");
+
+ case 7: // NMI on Z80 (direct)
+ m_z80->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ break;
+
+ }
+ return 0xff;
+}
+
+void a2bus_applicard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ switch (offset & 0xf)
+ {
+ case 0: // are these legal to write?
+ case 2:
+ case 3:
+ break;
+
+ case 1:
+ m_z80stat = true;
+ m_toz80 = data;
+ break;
+
+ case 5:
+ case 6:
+ case 7:
+ read_c0nx(space, offset); // let the read handler take care of these
+ break;
+ }
+}
+
+READ8_MEMBER( a2bus_applicard_device::z80_io_r )
+{
+ UINT8 tmp = 0;
+
+ switch (offset)
+ {
+ case 0:
+ return m_to6502;
+
+ case 0x20:
+ m_z80stat = false;
+ return m_toz80;
+
+ case 0x40:
+ if (m_z80stat)
+ {
+ tmp |= 0x80;
+ }
+ if (m_6502stat)
+ {
+ tmp |= 1;
+ }
+ return tmp;
+
+ case 0x60:
+ break;
+ }
+ return 0xff;
+}
+
+WRITE8_MEMBER( a2bus_applicard_device::z80_io_w )
+{
+ switch (offset)
+ {
+ case 0:
+ m_to6502 = data;
+ m_6502stat = true;
+ break;
+
+ case 0x60:
+ if (data & 1)
+ {
+ m_bROMAtZ80Zero = true;
+ }
+ else
+ {
+ m_bROMAtZ80Zero = false;
+ }
+ break;
+ }
+}
+
+//-------------------------------------------------
+// dma_r -
+//-------------------------------------------------
+
+READ8_MEMBER( a2bus_applicard_device::dma_r )
+{
+ if (offset < 0x8000)
+ {
+ if (m_bROMAtZ80Zero)
+ {
+ return m_z80rom[offset & 0x7ff];
+ }
+ else
+ {
+ return m_z80ram[offset];
+ }
+ }
+ else
+ {
+ return m_z80ram[offset];
+ }
+ // never executed
+ //return 0xff;
+}
+
+
+//-------------------------------------------------
+// dma_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( a2bus_applicard_device::dma_w )
+{
+ if (offset < 0x8000)
+ {
+ // writing only works if ROM not mapped from 0-7fff
+ if (!m_bROMAtZ80Zero)
+ {
+ m_z80ram[offset] = data;
+ }
+ }
+ else
+ {
+ m_z80ram[offset] = data;
+ }
+}
+
+bool a2bus_applicard_device::take_c800()
+{
+ return false;
+}
diff --git a/src/devices/bus/a2bus/a2applicard.h b/src/devices/bus/a2bus/a2applicard.h
new file mode 100644
index 00000000000..b015d84fe6a
--- /dev/null
+++ b/src/devices/bus/a2bus/a2applicard.h
@@ -0,0 +1,61 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2applicard.h
+
+ Implementation of the PCPI AppliCard Z-80 card
+
+*********************************************************************/
+
+#ifndef __A2BUS_APPLICARD__
+#define __A2BUS_APPLICARD__
+
+#include "emu.h"
+#include "a2bus.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_applicard_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_applicard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ a2bus_applicard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ DECLARE_READ8_MEMBER( dma_r );
+ DECLARE_WRITE8_MEMBER( dma_w );
+ DECLARE_READ8_MEMBER( z80_io_r );
+ DECLARE_WRITE8_MEMBER( z80_io_w );
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+ virtual const rom_entry *device_rom_region() const;
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual bool take_c800();
+
+ required_device<cpu_device> m_z80;
+
+private:
+ bool m_bROMAtZ80Zero;
+ bool m_z80stat, m_6502stat;
+ UINT8 m_toz80, m_to6502;
+ UINT8 m_z80ram[64*1024];
+ UINT8 *m_z80rom;
+};
+
+// device type definition
+extern const device_type A2BUS_APPLICARD;
+
+#endif /* __A2BUS_APPLICARD__ */
diff --git a/src/devices/bus/a2bus/a2arcadebd.c b/src/devices/bus/a2bus/a2arcadebd.c
new file mode 100644
index 00000000000..dcad400f8b1
--- /dev/null
+++ b/src/devices/bus/a2bus/a2arcadebd.c
@@ -0,0 +1,149 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2arcadeboard.c
+
+ Implementation of the Third Millenium Engineering Arcade Board
+
+ TODO:
+ - VDPTEST program seems to want more than 16K of RAM, but docs/ads/press releases say 16k, period
+ - MLDEMO program needs vsync IRQ from the TMS but doesn't program the registers the way our emulation
+ wants to enable IRQs
+
+*********************************************************************/
+
+#include "emu.h"
+#include "a2arcadebd.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+#define TMS_TAG "arcbd_tms"
+#define AY_TAG "arcbd_ay"
+#define SCREEN_TAG "screen"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_ARCADEBOARD = &device_creator<a2bus_arcboard_device>;
+
+MACHINE_CONFIG_FRAGMENT( arcadeboard )
+ MCFG_DEVICE_ADD( TMS_TAG, TMS9918A, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000) // 16k of VRAM
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(a2bus_arcboard_device, tms_irq_w))
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
+ MCFG_SCREEN_UPDATE_DEVICE( TMS_TAG, tms9918a_device, screen_update )
+
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD(AY_TAG, AY8910, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+MACHINE_CONFIG_END
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_arcboard_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( arcadeboard );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_ARCADEBOARD, "Third Millenium Engineering Arcade Board", tag, owner, clock, "a2arcbd", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_tms(*this, TMS_TAG),
+ m_ay(*this, AY_TAG)
+{
+}
+
+a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_tms(*this, TMS_TAG),
+ m_ay(*this, AY_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_arcboard_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+}
+
+void a2bus_arcboard_device::device_reset()
+{
+}
+
+/*
+ C0nx map:
+ 0 - TMS read vram
+ 1 - TMS read status
+ 2 - TMS write vram
+ 3 - TMS write register
+ 5 - AY register select
+ 6 - AY data
+*/
+
+UINT8 a2bus_arcboard_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset)
+ {
+ case 0:
+ return m_tms->vram_read(space, 0);
+
+ case 1:
+ return m_tms->register_read(space, 0);
+
+ case 6:
+ return m_ay->data_r(space, 0);
+ }
+
+ return 0xff;
+}
+
+void a2bus_arcboard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ switch (offset)
+ {
+ case 2:
+ m_tms->vram_write(space, 0, data);
+ break;
+
+ case 3:
+ m_tms->register_write(space, 0, data);
+ break;
+
+ case 5:
+ m_ay->address_w(space, 0, data);
+ break;
+
+ case 6:
+ m_ay->data_w(space, 0, data);
+ break;
+ }
+}
+
+WRITE_LINE_MEMBER( a2bus_arcboard_device::tms_irq_w )
+{
+ if (state)
+ {
+ raise_slot_irq();
+ }
+ else
+ {
+ lower_slot_irq();
+ }
+}
diff --git a/src/devices/bus/a2bus/a2arcadebd.h b/src/devices/bus/a2bus/a2arcadebd.h
new file mode 100644
index 00000000000..ae39c51eac6
--- /dev/null
+++ b/src/devices/bus/a2bus/a2arcadebd.h
@@ -0,0 +1,54 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2arcadebd.h
+
+ Third Millenium Engineering Arcade Board
+
+*********************************************************************/
+
+#ifndef __A2BUS_ARCADEBOARD__
+#define __A2BUS_ARCADEBOARD__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "video/tms9928a.h"
+#include "sound/ay8910.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_arcboard_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2bus_arcboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ DECLARE_WRITE_LINE_MEMBER( tms_irq_w );
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+
+ required_device<tms9918a_device> m_tms;
+ required_device<ay8910_device> m_ay;
+
+private:
+};
+
+// device type definition
+extern const device_type A2BUS_ARCADEBOARD;
+
+#endif /* __A2BUS_ARCADEBOARD__ */
diff --git a/src/devices/bus/a2bus/a2bus.c b/src/devices/bus/a2bus/a2bus.c
new file mode 100644
index 00000000000..cd2eab4eea7
--- /dev/null
+++ b/src/devices/bus/a2bus/a2bus.c
@@ -0,0 +1,334 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/***************************************************************************
+
+ a2bus.c - Apple II slot bus and card emulation
+
+ by R. Belmont
+
+ Pinout (/ indicates an inverted signal, ie, one that would have a bar over it
+ on a schematic diagram)
+
+ (rear of computer)
+
+ GND 26 25 +5V
+ DMA IN 27 24 DMA OUT
+ INT IN 28 23 INT OUT
+ /NMI 29 22 /DMA
+ /IRQ 30 21 RDY
+ /RES 31 20 /IOSTB
+ /INH 32 19 N.C.
+ -12V 33 18 R/W
+ -5V 34 17 A15
+ N.C. 35 16 A14
+ 7M 36 15 A13
+ Q3 37 14 A12
+ PH1 38 13 A11
+ USER 1 39 12 A10
+ PH0 40 11 A9
+ /DEVSEL 41 10 A8
+ D7 42 9 A7
+ D6 43 8 A6
+ D5 44 7 A5
+ D4 45 6 A4
+ D3 46 5 A3
+ D2 47 4 A2
+ D1 48 3 A1
+ D0 49 2 A0
+ -12V 50 1 /IOSEL
+
+ (front of computer)
+
+ Signal descriptions:
+ GND - power supply ground
+ DMA IN - daisy chain of DMA signal from higher priority devices. usually connected to DMA OUT.
+ INT IN - similar to DMA IN but for INT instead of DMA.
+ /NMI - non-maskable interrupt input to the 6502
+ /IRQ - maskable interrupt input to the 6502
+ /RES - system reset signal
+ /INH - On the II and II+, inhibits the motherboard ROMs, allowing a card to replace them.
+ On the IIe, inhibits all motherboard RAM/ROM for both CPU and DMA accesses.
+ On the IIgs, works like the IIe except for the address range 0x6000 to 0x9FFF where
+ it will cause bus contention.
+ -12V - negative 12 volts DC power
+ -5V - negative 5 volts DC power
+ 7M - 7 MHz clock (1/4th of the master clock on the IIgs, 1/2 on 8-bit IIs)
+ Q3 - 2 MHz asymmetrical clock
+ PH1 - 6502 phase 1 clock
+ /DEVSEL - asserted on an access to C0nX, where n = the slot number plus 8.
+ D0-D7 - 8-bit data bus
+ +5V - 5 volts DC power
+ DMA OUT - see DMA IN
+ INT OUT - see INT IN
+ /DMA - pulling this low disconnects the 6502 from the bus and halts it
+ RDY - 6502 RDY input. Pulling this low when PH1 is active will halt the
+ 6502 and latch the current address bus value.
+ /IOSTB - asserted on an access between C800 and CFFF.
+ A0-A15 - 16-bit address bus
+ /IOSEL - asserted on accesses to CnXX where n is the slot number.
+ Not present on slot 0.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+#include "a2bus.h"
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_SLOT = &device_creator<a2bus_slot_device>;
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// a2bus_slot_device - constructor
+//-------------------------------------------------
+a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_SLOT, "Apple II Slot", tag, owner, clock, "a2bus_slot", __FILE__),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+void a2bus_slot_device::static_set_a2bus_slot(device_t &device, const char *tag, const char *slottag)
+{
+ a2bus_slot_device &a2bus_card = dynamic_cast<a2bus_slot_device &>(device);
+ a2bus_card.m_a2bus_tag = tag;
+ a2bus_card.m_a2bus_slottag = slottag;
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_slot_device::device_start()
+{
+ device_a2bus_card_interface *dev = dynamic_cast<device_a2bus_card_interface *>(get_card_device());
+
+ if (dev) device_a2bus_card_interface::static_set_a2bus_tag(*dev, m_a2bus_tag, m_a2bus_slottag);
+}
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS = &device_creator<a2bus_device>;
+
+void a2bus_device::static_set_cputag(device_t &device, const char *tag)
+{
+ a2bus_device &a2bus = downcast<a2bus_device &>(device);
+ a2bus.m_cputag = tag;
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// a2bus_device - constructor
+//-------------------------------------------------
+
+a2bus_device::a2bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS, "Apple II Bus", tag, owner, clock, "a2bus", __FILE__),
+ m_out_irq_cb(*this),
+ m_out_nmi_cb(*this),
+ m_out_inh_cb(*this)
+{
+}
+
+a2bus_device::a2bus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ m_out_irq_cb(*this),
+ m_out_nmi_cb(*this),
+ m_out_inh_cb(*this)
+{
+}
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_device::device_start()
+{
+ m_maincpu = machine().device<cpu_device>(m_cputag);
+ m_maincpu_space = &machine().device<cpu_device>(m_cputag)->space(AS_PROGRAM);
+
+ // resolve callbacks
+ m_out_irq_cb.resolve_safe();
+ m_out_nmi_cb.resolve_safe();
+ m_out_inh_cb.resolve_safe();
+
+ // clear slots
+ for (int i = 0; i < 8; i++)
+ {
+ m_device_list[i] = NULL;
+ }
+
+ m_slot_irq_mask = m_slot_nmi_mask = 0;
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void a2bus_device::device_reset()
+{
+}
+
+device_a2bus_card_interface *a2bus_device::get_a2bus_card(int slot)
+{
+ if (slot < 0)
+ {
+ return NULL;
+ }
+
+ if (m_device_list[slot])
+ {
+ return m_device_list[slot];
+ }
+
+ return NULL;
+}
+
+void a2bus_device::add_a2bus_card(int slot, device_a2bus_card_interface *card)
+{
+ m_device_list[slot] = card;
+}
+
+UINT8 a2bus_device::get_a2bus_irq_mask()
+{
+ return m_slot_irq_mask;
+}
+
+UINT8 a2bus_device::get_a2bus_nmi_mask()
+{
+ return m_slot_nmi_mask;
+}
+
+void a2bus_device::set_irq_line(int state, int slot)
+{
+ m_out_irq_cb(state);
+
+ if (state == CLEAR_LINE)
+ {
+ m_slot_irq_mask &= ~(1<<slot);
+ }
+ else if (state == ASSERT_LINE)
+ {
+ m_slot_irq_mask |= (1<<slot);
+ }
+}
+
+void a2bus_device::set_nmi_line(int state, int slot)
+{
+ m_out_nmi_cb(state);
+
+ if (state == CLEAR_LINE)
+ {
+ m_slot_nmi_mask &= ~(1<<slot);
+ }
+ else if (state == ASSERT_LINE)
+ {
+ m_slot_nmi_mask |= (1<<slot);
+ }
+}
+
+void a2bus_device::set_maincpu_halt(int state)
+{
+ m_maincpu->set_input_line(INPUT_LINE_HALT, state);
+}
+
+UINT8 a2bus_device::dma_r(address_space &space, UINT16 offset)
+{
+ m_maincpu_space->set_debugger_access(space.debugger_access());
+
+ return m_maincpu_space->read_byte(offset);
+}
+
+void a2bus_device::dma_w(address_space &space, UINT16 offset, UINT8 data)
+{
+ m_maincpu_space->set_debugger_access(space.debugger_access());
+
+ m_maincpu_space->write_byte(offset, data);
+}
+
+UINT8 a2bus_device::dma_nospace_r(UINT16 offset)
+{
+ return m_maincpu_space->read_byte(offset);
+}
+
+void a2bus_device::dma_nospace_w(UINT16 offset, UINT8 data)
+{
+ m_maincpu_space->write_byte(offset, data);
+}
+
+void a2bus_device::recalc_inh(int slot)
+{
+ m_out_inh_cb(ASSERT_LINE);
+ m_out_inh_cb(CLEAR_LINE);
+}
+
+// interrupt request from a2bus card
+WRITE_LINE_MEMBER( a2bus_device::irq_w ) { m_out_irq_cb(state); }
+WRITE_LINE_MEMBER( a2bus_device::nmi_w ) { m_out_nmi_cb(state); }
+
+//**************************************************************************
+// DEVICE CONFIG A2BUS CARD INTERFACE
+//**************************************************************************
+
+
+//**************************************************************************
+// DEVICE A2BUS CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_a2bus_card_interface - constructor
+//-------------------------------------------------
+
+device_a2bus_card_interface::device_a2bus_card_interface(const machine_config &mconfig, device_t &device)
+ : device_slot_card_interface(mconfig, device),
+ m_a2bus(NULL),
+ m_a2bus_tag(NULL)
+{
+}
+
+
+//-------------------------------------------------
+// ~device_a2bus_card_interface - destructor
+//-------------------------------------------------
+
+device_a2bus_card_interface::~device_a2bus_card_interface()
+{
+}
+
+void device_a2bus_card_interface::static_set_a2bus_tag(device_t &device, const char *tag, const char *slottag)
+{
+ device_a2bus_card_interface &a2bus_card = dynamic_cast<device_a2bus_card_interface &>(device);
+ a2bus_card.m_a2bus_tag = tag;
+ a2bus_card.m_a2bus_slottag = slottag;
+}
+
+void device_a2bus_card_interface::set_a2bus_device()
+{
+ // extract the slot number from the last digit of the slot tag
+ int tlen = strlen(m_a2bus_slottag);
+
+ m_slot = (m_a2bus_slottag[tlen-1] - '0');
+
+ if (m_slot < 0 || m_slot > 7)
+ {
+ fatalerror("Slot %x out of range for Apple II Bus\n", m_slot);
+ }
+
+ m_a2bus = dynamic_cast<a2bus_device *>(device().machine().device(m_a2bus_tag));
+ m_a2bus->add_a2bus_card(m_slot, this);
+}
diff --git a/src/devices/bus/a2bus/a2bus.h b/src/devices/bus/a2bus/a2bus.h
new file mode 100644
index 00000000000..90ab602607d
--- /dev/null
+++ b/src/devices/bus/a2bus/a2bus.h
@@ -0,0 +1,197 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/***************************************************************************
+
+ a2bus.h - Apple II slot bus and card emulation
+
+ by R. Belmont
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __A2BUS_H__
+#define __A2BUS_H__
+
+#include "emu.h"
+
+// /INH special addresses
+#define INH_START_INVALID 0xffff;
+#define INH_END_INVALID 0x0000;
+
+// /INH types
+#define INH_NONE 0x00
+#define INH_READ 0x01
+#define INH_WRITE 0x02
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_A2BUS_CPU(_cputag) \
+ a2bus_device::static_set_cputag(*device, _cputag);
+
+#define MCFG_A2BUS_OUT_IRQ_CB(_devcb) \
+ devcb = &a2bus_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+
+#define MCFG_A2BUS_OUT_NMI_CB(_devcb) \
+ devcb = &a2bus_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+
+#define MCFG_A2BUS_OUT_INH_CB(_devcb) \
+ devcb = &a2bus_device::set_out_inh_callback(*device, DEVCB_##_devcb);
+
+#define MCFG_A2BUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
+ MCFG_DEVICE_ADD(_tag, A2BUS_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
+ a2bus_slot_device::static_set_a2bus_slot(*device, _nbtag, _tag);
+#define MCFG_A2BUS_SLOT_REMOVE(_tag) \
+ MCFG_DEVICE_REMOVE(_tag)
+
+#define MCFG_A2BUS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
+ MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
+ MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
+ device_a2bus_card_interface::static_set_a2bus_tag(*device, _nbtag, _tag);
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_device;
+
+class a2bus_slot_device : public device_t,
+ public device_slot_interface
+{
+public:
+ // construction/destruction
+ a2bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // device-level overrides
+ virtual void device_start();
+
+ // inline configuration
+ static void static_set_a2bus_slot(device_t &device, const char *tag, const char *slottag);
+protected:
+ // configuration
+ const char *m_a2bus_tag, *m_a2bus_slottag;
+};
+
+// device type definition
+extern const device_type A2BUS_SLOT;
+
+
+class device_a2bus_card_interface;
+// ======================> a2bus_device
+class a2bus_device : public device_t
+{
+ // multi-card devices need to access m_device_list, so they get friend'ed here.
+ friend class a2bus_mcms2_device;
+public:
+ // construction/destruction
+ a2bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2bus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // inline configuration
+ static void static_set_cputag(device_t &device, const char *tag);
+ template<class _Object> static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast<a2bus_device &>(device).m_out_irq_cb.set_callback(object); }
+ template<class _Object> static devcb_base &set_out_nmi_callback(device_t &device, _Object object) { return downcast<a2bus_device &>(device).m_out_nmi_cb.set_callback(object); }
+ template<class _Object> static devcb_base &set_out_inh_callback(device_t &device, _Object object) { return downcast<a2bus_device &>(device).m_out_inh_cb.set_callback(object); }
+
+ void add_a2bus_card(int slot, device_a2bus_card_interface *card);
+ device_a2bus_card_interface *get_a2bus_card(int slot);
+ UINT8 get_a2bus_irq_mask();
+ UINT8 get_a2bus_nmi_mask();
+
+ void set_irq_line(int state, int slot);
+ void set_nmi_line(int state, int slot);
+ void set_maincpu_halt(int state);
+ void recalc_inh(int slot);
+ UINT8 dma_r(address_space &space, UINT16 offset);
+ void dma_w(address_space &space, UINT16 offset, UINT8 data);
+ UINT8 dma_nospace_r(UINT16 offset);
+ void dma_nospace_w(UINT16 offset, UINT8 data);
+
+ DECLARE_WRITE_LINE_MEMBER( irq_w );
+ DECLARE_WRITE_LINE_MEMBER( nmi_w );
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ // internal state
+ cpu_device *m_maincpu;
+ address_space *m_maincpu_space;
+
+ devcb_write_line m_out_irq_cb;
+ devcb_write_line m_out_nmi_cb;
+ devcb_write8 m_out_inh_cb;
+
+ device_a2bus_card_interface *m_device_list[8];
+ const char *m_cputag;
+
+ UINT8 m_slot_irq_mask;
+ UINT8 m_slot_nmi_mask;
+};
+
+
+// device type definition
+extern const device_type A2BUS;
+
+// ======================> device_a2bus_card_interface
+
+// class representing interface-specific live a2bus card
+class device_a2bus_card_interface : public device_slot_card_interface
+{
+ friend class a2bus_device;
+public:
+ // construction/destruction
+ device_a2bus_card_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_a2bus_card_interface();
+
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset) { logerror("a2bus: unhandled read at C0n%x\n", offset); return 0; } // C0nX - /DEVSEL
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) { logerror("a2bus: unhandled write %02x to C0n%x\n", data, offset); }
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset) { return 0; } // CnXX - /IOSEL
+ virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) { logerror("a2bus: unhandled write %02x to Cn%02x\n", data, offset); }
+ virtual UINT8 read_c800(address_space &space, UINT16 offset) { return 0; } // C800 - /IOSTB
+ virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) { logerror("a2bus: unhandled write %02x to %04x\n", data, offset + 0xc800); }
+ virtual bool take_c800() { return true; } // override and return false if your card doesn't take over the c800 space
+ virtual UINT8 read_inh_rom(address_space &space, UINT16 offset) { return 0; }
+ virtual void write_inh_rom(address_space &space, UINT16 offset, UINT8 data) { }
+ virtual UINT16 inh_start() { return INH_START_INVALID; }
+ virtual UINT16 inh_end() { return INH_END_INVALID; }
+ virtual int inh_type() { return INH_NONE; }
+
+ device_a2bus_card_interface *next() const { return m_next; }
+
+ void set_a2bus_device();
+
+ UINT32 get_slotromspace() { return 0xc000 | (m_slot<<8); } // return Cn00 address for this slot
+ UINT32 get_slotiospace() { return 0xc080 + (m_slot<<4); } // return C0n0 address for this slot
+
+ void raise_slot_irq() { m_a2bus->set_irq_line(ASSERT_LINE, m_slot); }
+ void lower_slot_irq() { m_a2bus->set_irq_line(CLEAR_LINE, m_slot); }
+ void raise_slot_nmi() { m_a2bus->set_nmi_line(ASSERT_LINE, m_slot); }
+ void lower_slot_nmi() { m_a2bus->set_nmi_line(CLEAR_LINE, m_slot); }
+ void recalc_slot_inh() { m_a2bus->recalc_inh(m_slot); }
+ void set_maincpu_halt(int state) { m_a2bus->set_maincpu_halt(state); }
+
+ // pass through the original address space if any for debugger protection
+ // when debugging e.g. coprocessor cards (Z80 SoftCard etc).
+ UINT8 slot_dma_read(address_space &space, UINT16 offset) { return m_a2bus->dma_r(space, offset); }
+ void slot_dma_write(address_space &space, UINT16 offset, UINT8 data) { m_a2bus->dma_w(space, offset, data); }
+
+ // these versions forego that protection for when the DMA isn't coming from a debuggable CPU device
+ UINT8 slot_dma_read_no_space(UINT16 offset) { return m_a2bus->dma_nospace_r(offset); }
+ void slot_dma_write_no_space(UINT16 offset, UINT8 data) { m_a2bus->dma_nospace_w(offset, data); }
+
+ // inline configuration
+ static void static_set_a2bus_tag(device_t &device, const char *tag, const char *slottag);
+public:
+ a2bus_device *m_a2bus;
+ const char *m_a2bus_tag, *m_a2bus_slottag;
+ int m_slot;
+ device_a2bus_card_interface *m_next;
+};
+
+#endif /* __A2BUS_H__ */
diff --git a/src/devices/bus/a2bus/a2cffa.c b/src/devices/bus/a2bus/a2cffa.c
new file mode 100644
index 00000000000..6bde1195ac7
--- /dev/null
+++ b/src/devices/bus/a2bus/a2cffa.c
@@ -0,0 +1,278 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2cffa.c
+
+ Implementation of Rich Dreher's IDE/CompactFlash card
+ for the Apple II.
+
+ http://www.dreher.net/
+
+*********************************************************************/
+
+#include "a2cffa.h"
+#include "includes/apple2.h"
+#include "machine/ataintf.h"
+#include "imagedev/harddriv.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+#define LOG_A2CFFA 1
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_CFFA2 = &device_creator<a2bus_cffa2_device>;
+const device_type A2BUS_CFFA2_6502 = &device_creator<a2bus_cffa2_6502_device>;
+
+#define CFFA2_ROM_REGION "cffa2_rom"
+#define CFFA2_ATA_TAG "cffa2_ata"
+
+MACHINE_CONFIG_FRAGMENT( cffa2 )
+ MCFG_ATA_INTERFACE_ADD(CFFA2_ATA_TAG, ata_devices, "hdd", NULL, false)
+
+// not yet, the core explodes
+// MCFG_SOFTWARE_LIST_ADD("hdd_list", "apple2gs_hdd")
+MACHINE_CONFIG_END
+
+ROM_START( cffa2 )
+ ROM_REGION(0x1000, CFFA2_ROM_REGION, 0)
+ ROM_LOAD( "cffa20eec02.bin", 0x000000, 0x001000, CRC(fb3726f8) SHA1(080ff88f19de22328e162954ee2b51ee65f9d5cd) )
+ROM_END
+
+ROM_START( cffa2_6502 )
+ ROM_REGION(0x1000, CFFA2_ROM_REGION, 0)
+ ROM_LOAD( "cffa20ee02.bin", 0x000000, 0x001000, CRC(3ecafce5) SHA1(d600692ed9626668233a22a48236af639410cb7b) )
+ROM_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_cffa2000_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( cffa2 );
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *a2bus_cffa2000_device::device_rom_region() const
+{
+ return ROM_NAME( cffa2 );
+}
+
+const rom_entry *a2bus_cffa2_6502_device::device_rom_region() const
+{
+ return ROM_NAME( cffa2_6502 );
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_cffa2000_device::a2bus_cffa2000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_ata(*this, CFFA2_ATA_TAG)
+{
+}
+
+a2bus_cffa2_device::a2bus_cffa2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_cffa2000_device(mconfig, A2BUS_CFFA2, "CFFA2000 Compact Flash (65C02 firmware, www.dreher.net)", tag, owner, clock, "a2cffa2", __FILE__),
+ device_nvram_interface(mconfig, *this)
+{
+}
+
+a2bus_cffa2_6502_device::a2bus_cffa2_6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_cffa2000_device(mconfig, A2BUS_CFFA2, "CFFA2000 Compact Flash (6502 firmware, www.dreher.net)", tag, owner, clock, "a2cffa02", __FILE__),
+ device_nvram_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_cffa2000_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(CFFA2_ROM_REGION).c_str())->base();
+
+ // patch default setting so slave device is enabled and up to 13 devices on both connectors
+ m_rom[0x800] = 13;
+ m_rom[0x801] = 13;
+
+ save_item(NAME(m_lastdata));
+ save_item(NAME(m_lastreaddata));
+ save_item(NAME(m_writeprotect));
+ save_item(NAME(m_eeprom));
+ save_item(NAME(m_inwritecycle));
+}
+
+void a2bus_cffa2000_device::device_reset()
+{
+ m_writeprotect = true;
+ m_inwritecycle = false;
+}
+
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_cffa2000_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset)
+ {
+ case 0:
+ return m_lastreaddata>>8;
+
+ case 3:
+ m_writeprotect = false;
+ break;
+
+ case 4:
+ m_writeprotect = true;
+ break;
+
+ case 8:
+ // Apple /// driver uses sta $c080,x when writing, which causes spurious reads of c088
+ if (!m_inwritecycle)
+ {
+ m_lastreaddata = m_ata->read_cs0(space, offset - 8, 0xffff);
+ }
+ return m_lastreaddata & 0xff;
+
+ case 9:
+ case 0xa:
+ case 0xb:
+ case 0xc:
+ case 0xd:
+ case 0xe:
+ case 0xf:
+ return m_ata->read_cs0(space, offset-8, 0xff);
+ }
+
+ return 0xff;
+}
+
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_cffa2000_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ m_inwritecycle = false;
+
+ switch (offset)
+ {
+ case 0:
+ m_lastdata &= 0x00ff;
+ m_lastdata |= data<<8;
+// printf("%02x to 0, m_lastdata = %x\n", data, m_lastdata);
+ m_inwritecycle = true;
+ break;
+
+ case 3:
+ m_writeprotect = false;
+ break;
+
+ case 4:
+ m_writeprotect = true;
+ break;
+
+ case 8:
+ m_lastdata &= 0xff00;
+ m_lastdata |= data;
+// printf("%02x to 8, m_lastdata = %x\n", data, m_lastdata);
+ m_ata->write_cs0(space, offset-8, m_lastdata, 0xffff);
+ break;
+
+ case 9:
+ case 0xa:
+ case 0xb:
+ case 0xc:
+ case 0xd:
+ case 0xe:
+ case 0xf:
+ m_ata->write_cs0(space, offset-8, data, 0xff);
+ break;
+ }
+}
+
+/*-------------------------------------------------
+ read_cnxx - called for reads from this card's cnxx space
+-------------------------------------------------*/
+
+UINT8 a2bus_cffa2000_device::read_cnxx(address_space &space, UINT8 offset)
+{
+ int slotimg = m_slot * 0x100;
+
+ // ROM contains a CnXX image for each of slots 1-7
+ return m_eeprom[offset+slotimg];
+}
+
+/*-------------------------------------------------
+ read_c800 - called for reads from this card's c800 space
+-------------------------------------------------*/
+
+UINT8 a2bus_cffa2000_device::read_c800(address_space &space, UINT16 offset)
+{
+ return m_eeprom[offset+0x800];
+}
+
+void a2bus_cffa2000_device::write_c800(address_space &space, UINT16 offset, UINT8 data)
+{
+ if (!m_writeprotect)
+ {
+// printf("Write %02x to EEPROM at %x (PC=%x)\n", data, offset, space.device().safe_pc());
+ m_eeprom[offset + 0x800] = data;
+ }
+}
+
+// NVRAM device virtual overrides to provide saving/loading of settings changes
+void a2bus_cffa2_device::nvram_default()
+{
+ memcpy(m_eeprom, m_rom, 0x1000);
+}
+
+void a2bus_cffa2_device::nvram_read(emu_file &file)
+{
+ file.read(m_eeprom, 0x1000);
+}
+
+void a2bus_cffa2_device::nvram_write(emu_file &file)
+{
+ file.write(m_eeprom, 0x1000);
+}
+
+void a2bus_cffa2_6502_device::nvram_default()
+{
+ memcpy(m_eeprom, m_rom, 0x1000);
+}
+
+void a2bus_cffa2_6502_device::nvram_read(emu_file &file)
+{
+ file.read(m_eeprom, 0x1000);
+}
+
+void a2bus_cffa2_6502_device::nvram_write(emu_file &file)
+{
+ file.write(m_eeprom, 0x1000);
+}
diff --git a/src/devices/bus/a2bus/a2cffa.h b/src/devices/bus/a2bus/a2cffa.h
new file mode 100644
index 00000000000..a719861efa9
--- /dev/null
+++ b/src/devices/bus/a2bus/a2cffa.h
@@ -0,0 +1,86 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2cffa.h
+
+ Implementation of Rich Dreher's IDE/CompactFlash board for
+ the Apple II
+
+*********************************************************************/
+
+#ifndef __A2BUS_CFFA2__
+#define __A2BUS_CFFA2__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "machine/ataintf.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_cffa2000_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_cffa2000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+ virtual UINT8 read_c800(address_space &space, UINT16 offset);
+ virtual void write_c800(address_space &space, UINT16 offset, UINT8 data);
+
+ required_device<ata_interface_device> m_ata;
+
+ UINT8 *m_rom;
+ UINT8 m_eeprom[0x1000];
+
+private:
+ UINT16 m_lastdata, m_lastreaddata;
+ bool m_writeprotect;
+ bool m_inwritecycle;
+};
+
+class a2bus_cffa2_device : public a2bus_cffa2000_device, public device_nvram_interface
+{
+public:
+ a2bus_cffa2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ // device_config_nvram_interface overrides
+ virtual void nvram_default();
+ virtual void nvram_read(emu_file &file);
+ virtual void nvram_write(emu_file &file);
+};
+
+class a2bus_cffa2_6502_device : public a2bus_cffa2000_device, public device_nvram_interface
+{
+public:
+ a2bus_cffa2_6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ virtual const rom_entry *device_rom_region() const;
+
+protected:
+ // device_config_nvram_interface overrides
+ virtual void nvram_default();
+ virtual void nvram_read(emu_file &file);
+ virtual void nvram_write(emu_file &file);
+};
+
+// device type definition
+extern const device_type A2BUS_CFFA2;
+extern const device_type A2BUS_CFFA2_6502;
+
+#endif /* __A2BUS_CFFA2__ */
diff --git a/src/devices/bus/a2bus/a2corvus.c b/src/devices/bus/a2bus/a2corvus.c
new file mode 100644
index 00000000000..d3de7fdfee0
--- /dev/null
+++ b/src/devices/bus/a2bus/a2corvus.c
@@ -0,0 +1,187 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2corvus.c
+
+ Implementation of the Corvus flat-cable hard disk interface
+ for the Apple II.
+
+ This same card was used in the Corvus Concept.
+
+ C0n0 = drive read/write
+ C0n1 = read status (busy in bit 7, data direction in bit 6)
+
+ Reads and writes to C0n2+ happen; the contents of the reads are thrown away
+ immediately by all the code I've examined, and sending the writes to the
+ drive's write port makes it not work so they're intended to be ignored too.
+
+ 5 MB: -chs 144,4,20 -ss 512
+ 10 MB: -chs 358,3,20 -ss 512
+ 20 MB: -chs 388,5,20 -ss 512
+
+ To set up a disk from scratch on the Apple II:
+ 1) Create a disk of your desired capacity using CHDMAN -c none and the parameters
+ listed above for each of the possible sizes.
+ 2) Boot apple2p with the corvus in slot 2 and a diskii(ng) in slot 6 with the
+ "Corvus Hard Drive - Diagnostics.dsk" mounted.
+ 3) Press F to format. Accept all the default options from now on;
+ there is no "format switch" to worry about with the current emulation.
+ 4) Quit MESS. Restart with the corvus in slot 6 and a diskii(ng) in slot 7
+ with the "Corvus Hard Drive - Utilities Disk 1.dsk" mounted.
+ 5) When you get the BASIC prompt, "RUN BSYSGEN"
+ 6) Choose drive 1 and press Y at "OK TO BSYSGEN?"
+ 7) When the format completes, type "RUN APPLESOFT BOOT PREP" and press Enter.
+ 8) Once it finishes, quit MESS. Remove the diskii(ng) from slot 7 and
+ the system will boot into DOS 3.3 from the Corvus HD.
+
+ TODO: but there are no Corvus drivers present after that, only
+ Disk II?
+
+*********************************************************************/
+
+#include "a2corvus.h"
+#include "includes/apple2.h"
+#include "imagedev/harddriv.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_CORVUS = &device_creator<a2bus_corvus_device>;
+
+#define CORVUS_ROM_REGION "corvus_rom"
+#define CORVUS_HD_TAG "corvushd"
+
+static MACHINE_CONFIG_FRAGMENT(corvus)
+ MCFG_DEVICE_ADD(CORVUS_HD_TAG, CORVUS_HDC, 0)
+ MCFG_HARDDISK_ADD("harddisk1")
+ MCFG_HARDDISK_INTERFACE("corvus_hdd")
+ MCFG_HARDDISK_ADD("harddisk2")
+ MCFG_HARDDISK_INTERFACE("corvus_hdd")
+ MCFG_HARDDISK_ADD("harddisk3")
+ MCFG_HARDDISK_INTERFACE("corvus_hdd")
+ MCFG_HARDDISK_ADD("harddisk4")
+ MCFG_HARDDISK_INTERFACE("corvus_hdd")
+MACHINE_CONFIG_END
+
+ROM_START( corvus )
+ ROM_REGION(0x800, CORVUS_ROM_REGION, 0)
+ ROM_LOAD( "a4.7.u10", 0x0000, 0x0800, CRC(1cf6e32a) SHA1(dbd6efeb3b54c0523b8b4eda8b3d737413f6a91a) )
+ROM_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_corvus_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( corvus );
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *a2bus_corvus_device::device_rom_region() const
+{
+ return ROM_NAME( corvus );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_corvus_device::a2bus_corvus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_corvushd(*this, CORVUS_HD_TAG)
+{
+}
+
+a2bus_corvus_device::a2bus_corvus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_CORVUS, "Corvus Flat Cable interface", tag, owner, clock, "a2corvus", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_corvushd(*this, CORVUS_HD_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_corvus_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(CORVUS_ROM_REGION).c_str())->base();
+}
+
+void a2bus_corvus_device::device_reset()
+{
+}
+
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_corvus_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset)
+ {
+ case 0:
+ return m_corvushd->read(space, 0);
+
+ case 1:
+ return m_corvushd->status_r(space, 0);
+
+ default:
+ logerror("Corvus: read unhandled c0n%x (PC=%x)\n", offset, space.device().safe_pc());
+ break;
+ }
+
+ return 0xff;
+}
+
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_corvus_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ if (offset == 0)
+ {
+ m_corvushd->write(space, 0, data);
+ }
+}
+
+/*-------------------------------------------------
+ read_cnxx - called for reads from this card's cnxx space
+-------------------------------------------------*/
+
+UINT8 a2bus_corvus_device::read_cnxx(address_space &space, UINT8 offset)
+{
+ // one slot image at the end of the ROM, it appears
+ return m_rom[offset+0x700];
+}
+
+/*-------------------------------------------------
+ read_c800 - called for reads from this card's c800 space
+-------------------------------------------------*/
+
+UINT8 a2bus_corvus_device::read_c800(address_space &space, UINT16 offset)
+{
+ return m_rom[offset & 0x7ff];
+}
diff --git a/src/devices/bus/a2bus/a2corvus.h b/src/devices/bus/a2bus/a2corvus.h
new file mode 100644
index 00000000000..4c9ade900ab
--- /dev/null
+++ b/src/devices/bus/a2bus/a2corvus.h
@@ -0,0 +1,55 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2corvus.h
+
+ Implementation of the Corvus flat-cable hard disk interface
+ for the Apple II.
+
+*********************************************************************/
+
+#ifndef __A2BUS_CORVUS__
+#define __A2BUS_CORVUS__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "machine/corvushd.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_corvus_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_corvus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ a2bus_corvus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+ required_device<corvus_hdc_t> m_corvushd;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+ virtual UINT8 read_c800(address_space &space, UINT16 offset);
+
+private:
+ UINT8 *m_rom;
+};
+
+// device type definition
+extern const device_type A2BUS_CORVUS;
+
+#endif /* __A2BUS_CORVUS__ */
diff --git a/src/devices/bus/a2bus/a2diskii.c b/src/devices/bus/a2bus/a2diskii.c
new file mode 100644
index 00000000000..ad8a860a69f
--- /dev/null
+++ b/src/devices/bus/a2bus/a2diskii.c
@@ -0,0 +1,153 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2diskii.c
+
+ Implementation of the Apple II Disk II controller card
+
+*********************************************************************/
+
+#include "emu.h"
+#include "includes/apple2.h"
+#include "imagedev/flopdrv.h"
+#include "formats/ap2_dsk.h"
+#include "machine/appldriv.h"
+#include "a2diskii.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_DISKII = &device_creator<a2bus_diskii_device>;
+const device_type A2BUS_IWM_FDC = &device_creator<a2bus_iwmflop_device>;
+
+#define DISKII_ROM_REGION "diskii_rom"
+#define FDC_TAG "diskii_fdc"
+
+const applefdc_interface fdc_interface =
+{
+ apple525_set_lines, /* set_lines */
+ apple525_set_enable_lines, /* set_enable_lines */
+
+ apple525_read_data, /* read_data */
+ apple525_write_data, /* write_data */
+ apple525_read_status /* read_status */
+};
+
+static const floppy_interface floppy_interface =
+{
+ FLOPPY_STANDARD_5_25_DSHD,
+ LEGACY_FLOPPY_OPTIONS_NAME(apple2),
+ "floppy_5_25"
+};
+
+MACHINE_CONFIG_FRAGMENT( diskii )
+ MCFG_APPLEFDC_ADD(FDC_TAG, fdc_interface)
+ MCFG_LEGACY_FLOPPY_APPLE_2_DRIVES_ADD(floppy_interface,15,16)
+MACHINE_CONFIG_END
+
+MACHINE_CONFIG_FRAGMENT( iwmflop )
+ MCFG_IWM_ADD(FDC_TAG, fdc_interface)
+ MCFG_LEGACY_FLOPPY_APPLE_2_DRIVES_ADD(floppy_interface,15,16)
+MACHINE_CONFIG_END
+
+ROM_START( diskii )
+ ROM_REGION(0x100, DISKII_ROM_REGION, 0)
+ ROM_LOAD( "341-0027-a.p5", 0x000000, 0x000100, CRC(ce7144f6) SHA1(d4181c9f046aafc3fb326b381baac809d9e38d16) )
+ROM_END
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_floppy_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( diskii );
+}
+
+machine_config_constructor a2bus_iwmflop_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( iwmflop );
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *a2bus_floppy_device::device_rom_region() const
+{
+ return ROM_NAME( diskii );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_floppy_device::a2bus_floppy_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_fdc(*this, FDC_TAG)
+{
+}
+
+a2bus_diskii_device::a2bus_diskii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_floppy_device(mconfig, A2BUS_DISKII, "Apple Disk II controller", tag, owner, clock, "a2diskii", __FILE__)
+{
+}
+
+a2bus_iwmflop_device::a2bus_iwmflop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_floppy_device(mconfig, A2BUS_IWM_FDC, "Apple IWM floppy card", tag, owner, clock, "a2iwm_flop", __FILE__)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_floppy_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(DISKII_ROM_REGION).c_str())->base();
+}
+
+void a2bus_floppy_device::device_reset()
+{
+}
+
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_floppy_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ return m_fdc->read(offset);
+}
+
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_floppy_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ m_fdc->write(offset, data);
+}
+
+/*-------------------------------------------------
+ read_cnxx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_floppy_device::read_cnxx(address_space &space, UINT8 offset)
+{
+ return m_rom[offset];
+}
diff --git a/src/devices/bus/a2bus/a2diskii.h b/src/devices/bus/a2bus/a2diskii.h
new file mode 100644
index 00000000000..15e47316fe7
--- /dev/null
+++ b/src/devices/bus/a2bus/a2diskii.h
@@ -0,0 +1,67 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2diskii.h
+
+ Apple II Disk II Controller Card
+
+*********************************************************************/
+
+#ifndef __A2BUS_DISKII__
+#define __A2BUS_DISKII__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "machine/applefdc.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_floppy_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_floppy_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+
+ required_device<applefdc_base_device> m_fdc;
+
+private:
+ UINT8 *m_rom;
+};
+
+class a2bus_diskii_device: public a2bus_floppy_device
+{
+public:
+ a2bus_diskii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class a2bus_iwmflop_device: public a2bus_floppy_device
+{
+public:
+ a2bus_iwmflop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual machine_config_constructor device_mconfig_additions() const;
+};
+
+// device type definition
+extern const device_type A2BUS_DISKII;
+extern const device_type A2BUS_IWM_FDC;
+
+#endif /* __A2BUS_DISKII__ */
diff --git a/src/devices/bus/a2bus/a2diskiing.c b/src/devices/bus/a2bus/a2diskiing.c
new file mode 100644
index 00000000000..de0f84c26db
--- /dev/null
+++ b/src/devices/bus/a2bus/a2diskiing.c
@@ -0,0 +1,123 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2diskii.c
+
+ Implementation of the Apple II Disk II controller card
+
+*********************************************************************/
+
+#include "emu.h"
+#include "imagedev/floppy.h"
+#include "formats/ap2_dsk.h"
+#include "a2diskiing.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_DISKIING = &device_creator<a2bus_diskiing_device>;
+
+#define WOZFDC_TAG "wozfdc"
+#define DISKII_ROM_REGION "diskii_rom"
+
+static SLOT_INTERFACE_START( a2_floppies )
+ SLOT_INTERFACE( "525", FLOPPY_525_SD )
+SLOT_INTERFACE_END
+
+static MACHINE_CONFIG_FRAGMENT( diskiing )
+ MCFG_DEVICE_ADD(WOZFDC_TAG, DISKII_FDC, 1021800*2)
+ MCFG_FLOPPY_DRIVE_ADD("0", a2_floppies, "525", a2bus_diskiing_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("1", a2_floppies, "525", a2bus_diskiing_device::floppy_formats)
+MACHINE_CONFIG_END
+
+ROM_START( diskiing )
+ ROM_REGION(0x100, DISKII_ROM_REGION, 0)
+ ROM_LOAD( "341-0027-a.p5", 0x0000, 0x0100, CRC(ce7144f6) SHA1(d4181c9f046aafc3fb326b381baac809d9e38d16) ) /* 341-0027-a: 16-sector disk drive (older version), PROM P5 */
+ROM_END
+
+FLOPPY_FORMATS_MEMBER( a2bus_diskiing_device::floppy_formats )
+ FLOPPY_A216S_FORMAT, FLOPPY_RWTS18_FORMAT, FLOPPY_EDD_FORMAT
+FLOPPY_FORMATS_END
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_diskiing_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( diskiing );
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *a2bus_diskiing_device::device_rom_region() const
+{
+ return ROM_NAME( diskiing );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_diskiing_device::a2bus_diskiing_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_DISKIING, "Apple Disk II NG controller", tag, owner, clock, "a2diskiing", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_wozfdc(*this, WOZFDC_TAG),
+ floppy0(*this, "0"),
+ floppy1(*this, "1")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_diskiing_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(DISKII_ROM_REGION).c_str())->base();
+}
+
+void a2bus_diskiing_device::device_reset()
+{
+ m_wozfdc->set_floppies(floppy0, floppy1);
+}
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_diskiing_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ return m_wozfdc->read(space, offset);
+}
+
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_diskiing_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ m_wozfdc->write(space, offset, data);
+}
+
+/*-------------------------------------------------
+ read_cnxx - called for reads from this card's cnxx space
+-------------------------------------------------*/
+
+UINT8 a2bus_diskiing_device::read_cnxx(address_space &space, UINT8 offset)
+{
+ return m_rom[offset];
+}
diff --git a/src/devices/bus/a2bus/a2diskiing.h b/src/devices/bus/a2bus/a2diskiing.h
new file mode 100644
index 00000000000..462731449bb
--- /dev/null
+++ b/src/devices/bus/a2bus/a2diskiing.h
@@ -0,0 +1,59 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2diskiing.h
+
+ Apple II Disk II Controller Card, new floppy
+
+*********************************************************************/
+
+#ifndef __A2BUS_DISKIING__
+#define __A2BUS_DISKIING__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "imagedev/floppy.h"
+#include "formats/flopimg.h"
+#include "machine/wozfdc.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+
+class a2bus_diskiing_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_diskiing_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+ DECLARE_FLOPPY_FORMATS( floppy_formats );
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+
+private:
+ required_device<diskii_fdc> m_wozfdc;
+ required_device<floppy_connector> floppy0;
+ required_device<floppy_connector> floppy1;
+
+ const UINT8 *m_rom;
+};
+
+// device type definition
+extern const device_type A2BUS_DISKIING;
+
+#endif /* __A2BUS_DISKIING__ */
diff --git a/src/devices/bus/a2bus/a2dx1.c b/src/devices/bus/a2bus/a2dx1.c
new file mode 100644
index 00000000000..e3b4fcc3fc5
--- /dev/null
+++ b/src/devices/bus/a2bus/a2dx1.c
@@ -0,0 +1,119 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2dx1.c
+
+ Implementation of the Decillionix DX-1 sampler card
+
+*********************************************************************/
+
+#include "a2dx1.h"
+#include "includes/apple2.h"
+#include "sound/dac.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_DX1 = &device_creator<a2bus_dx1_device>;
+
+#define DAC_TAG "dac"
+
+MACHINE_CONFIG_FRAGMENT( a2dx1 )
+ MCFG_SPEAKER_STANDARD_MONO("dx1spkr")
+ MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "dx1spkr", 1.00)
+MACHINE_CONFIG_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_dx1_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( a2dx1 );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_dac(*this, DAC_TAG)
+{
+}
+
+a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_DX1, "Decillonix DX-1", tag, owner, clock, "a2dx1", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_dac(*this, DAC_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_dx1_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ save_item(NAME(m_volume));
+ save_item(NAME(m_lastdac));
+}
+
+void a2bus_dx1_device::device_reset()
+{
+ m_volume = m_lastdac = 0;
+}
+
+UINT8 a2bus_dx1_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset)
+ {
+ case 1: // ADC input
+ return 0;
+
+ case 3: // busy flag
+ return 0x80; // indicate not busy
+
+ case 7: // 1-bit ADC input (bit 7 of c0n1, probably)
+ return 0;
+ }
+
+ return 0xff;
+}
+
+void a2bus_dx1_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ switch (offset)
+ {
+ case 5: // volume
+ m_volume = data;
+ m_dac->write_unsigned16(data*m_lastdac);
+ break;
+
+ case 6:
+ m_lastdac = data;
+ m_dac->write_unsigned16(data*m_volume);
+ break;
+ }
+}
+
+bool a2bus_dx1_device::take_c800()
+{
+ return false;
+}
diff --git a/src/devices/bus/a2bus/a2dx1.h b/src/devices/bus/a2bus/a2dx1.h
new file mode 100644
index 00000000000..99b9d98193a
--- /dev/null
+++ b/src/devices/bus/a2bus/a2dx1.h
@@ -0,0 +1,52 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2dx1.h
+
+ Implementation of the Decillionix DX-1 sampler card
+
+*********************************************************************/
+
+#ifndef __A2BUS_DX1__
+#define __A2BUS_DX1__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "sound/dac.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_dx1_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_dx1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ a2bus_dx1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ required_device<dac_device> m_dac;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual bool take_c800();
+
+private:
+ UINT8 m_volume, m_lastdac;
+};
+
+// device type definition
+extern const device_type A2BUS_DX1;
+
+#endif /* __A2BUS_DX1__ */
diff --git a/src/devices/bus/a2bus/a2eauxslot.c b/src/devices/bus/a2bus/a2eauxslot.c
new file mode 100644
index 00000000000..3f6d99ead9c
--- /dev/null
+++ b/src/devices/bus/a2bus/a2eauxslot.c
@@ -0,0 +1,180 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/***************************************************************************
+
+ a2eauxslot.c - Apple IIe auxiliary slot and card emulation
+
+ by R. Belmont
+
+***************************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+#include "a2eauxslot.h"
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2EAUXSLOT_SLOT = &device_creator<a2eauxslot_slot_device>;
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// a2eauxslot_slot_device - constructor
+//-------------------------------------------------
+a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2EAUXSLOT_SLOT, "Apple IIe AUX Slot", tag, owner, clock, "a2eauxslot_slot", __FILE__),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+void a2eauxslot_slot_device::static_set_a2eauxslot_slot(device_t &device, const char *tag, const char *slottag)
+{
+ a2eauxslot_slot_device &a2eauxslot_card = dynamic_cast<a2eauxslot_slot_device &>(device);
+ a2eauxslot_card.m_a2eauxslot_tag = tag;
+ a2eauxslot_card.m_a2eauxslot_slottag = slottag;
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2eauxslot_slot_device::device_start()
+{
+ device_a2eauxslot_card_interface *dev = dynamic_cast<device_a2eauxslot_card_interface *>(get_card_device());
+
+ if (dev) device_a2eauxslot_card_interface::static_set_a2eauxslot_tag(*dev, m_a2eauxslot_tag, m_a2eauxslot_slottag);
+}
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2EAUXSLOT = &device_creator<a2eauxslot_device>;
+
+void a2eauxslot_device::static_set_cputag(device_t &device, const char *tag)
+{
+ a2eauxslot_device &a2eauxslot = downcast<a2eauxslot_device &>(device);
+ a2eauxslot.m_cputag = tag;
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// a2eauxslot_device - constructor
+//-------------------------------------------------
+
+a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2EAUXSLOT, "Apple IIe AUX Bus", tag, owner, clock, "a2eauxslot", __FILE__),
+ m_out_irq_cb(*this),
+ m_out_nmi_cb(*this)
+{
+}
+
+a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ m_out_irq_cb(*this),
+ m_out_nmi_cb(*this)
+{
+}
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2eauxslot_device::device_start()
+{
+ m_maincpu = machine().device<cpu_device>(m_cputag);
+
+ // resolve callbacks
+ m_out_irq_cb.resolve_safe();
+ m_out_nmi_cb.resolve_safe();
+
+ // clear slot
+ m_device = NULL;
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void a2eauxslot_device::device_reset()
+{
+}
+
+device_a2eauxslot_card_interface *a2eauxslot_device::get_a2eauxslot_card()
+{
+ return m_device;
+}
+
+void a2eauxslot_device::add_a2eauxslot_card(device_a2eauxslot_card_interface *card)
+{
+ m_device = card;
+}
+
+void a2eauxslot_device::set_irq_line(int state)
+{
+ m_out_irq_cb(state);
+}
+
+void a2eauxslot_device::set_nmi_line(int state)
+{
+ m_out_nmi_cb(state);
+}
+
+// interrupt request from a2eauxslot card
+WRITE_LINE_MEMBER( a2eauxslot_device::irq_w ) { m_out_irq_cb(state); }
+WRITE_LINE_MEMBER( a2eauxslot_device::nmi_w ) { m_out_nmi_cb(state); }
+
+//**************************************************************************
+// DEVICE CONFIG A2EAUXSLOT CARD INTERFACE
+//**************************************************************************
+
+
+//**************************************************************************
+// DEVICE A2EAUXSLOT CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_a2eauxslot_card_interface - constructor
+//-------------------------------------------------
+
+device_a2eauxslot_card_interface::device_a2eauxslot_card_interface(const machine_config &mconfig, device_t &device)
+ : device_slot_card_interface(mconfig, device),
+ m_a2eauxslot(NULL),
+ m_a2eauxslot_tag(NULL)
+{
+}
+
+
+//-------------------------------------------------
+// ~device_a2eauxslot_card_interface - destructor
+//-------------------------------------------------
+
+device_a2eauxslot_card_interface::~device_a2eauxslot_card_interface()
+{
+}
+
+void device_a2eauxslot_card_interface::static_set_a2eauxslot_tag(device_t &device, const char *tag, const char *slottag)
+{
+ device_a2eauxslot_card_interface &a2eauxslot_card = dynamic_cast<device_a2eauxslot_card_interface &>(device);
+ a2eauxslot_card.m_a2eauxslot_tag = tag;
+ a2eauxslot_card.m_a2eauxslot_slottag = slottag;
+}
+
+void device_a2eauxslot_card_interface::set_a2eauxslot_device()
+{
+ m_a2eauxslot = dynamic_cast<a2eauxslot_device *>(device().machine().device(m_a2eauxslot_tag));
+ m_a2eauxslot->add_a2eauxslot_card(this);
+}
diff --git a/src/devices/bus/a2bus/a2eauxslot.h b/src/devices/bus/a2bus/a2eauxslot.h
new file mode 100644
index 00000000000..47babc64bab
--- /dev/null
+++ b/src/devices/bus/a2bus/a2eauxslot.h
@@ -0,0 +1,146 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/***************************************************************************
+
+ a2eauxslot.h - Apple IIe auxiliary slot and card emulation
+
+ by R. Belmont
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __A2EAUXSLOT_H__
+#define __A2EAUXSLOT_H__
+
+#include "emu.h"
+#include "a2bus.h"
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_A2EAUXSLOT_CPU(_cputag) \
+ a2eauxslot_device::static_set_cputag(*device, _cputag);
+
+#define MCFG_A2EAUXSLOT_OUT_IRQ_CB(_devcb) \
+ devcb = &a2eauxslot_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+
+#define MCFG_A2EAUXSLOT_OUT_NMI_CB(_devcb) \
+ devcb = &a2eauxslot_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+
+#define MCFG_A2EAUXSLOT_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
+ MCFG_DEVICE_ADD(_tag, A2EAUXSLOT_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
+ a2eauxslot_slot_device::static_set_a2eauxslot_slot(*device, _nbtag, _tag);
+#define MCFG_A2EAUXSLOT_SLOT_REMOVE(_tag) \
+ MCFG_DEVICE_REMOVE(_tag)
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2eauxslot_device;
+
+class a2eauxslot_slot_device : public device_t,
+ public device_slot_interface
+{
+public:
+ // construction/destruction
+ a2eauxslot_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2eauxslot_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // device-level overrides
+ virtual void device_start();
+
+ // inline configuration
+ static void static_set_a2eauxslot_slot(device_t &device, const char *tag, const char *slottag);
+protected:
+ // configuration
+ const char *m_a2eauxslot_tag, *m_a2eauxslot_slottag;
+};
+
+// device type definition
+extern const device_type A2EAUXSLOT_SLOT;
+
+
+class device_a2eauxslot_card_interface;
+
+// ======================> a2eauxslot_device
+class a2eauxslot_device : public device_t
+{
+public:
+ // construction/destruction
+ a2eauxslot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2eauxslot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // inline configuration
+ static void static_set_cputag(device_t &device, const char *tag);
+ template<class _Object> static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast<a2eauxslot_device &>(device).m_out_irq_cb.set_callback(object); }
+ template<class _Object> static devcb_base &set_out_nmi_callback(device_t &device, _Object object) { return downcast<a2eauxslot_device &>(device).m_out_nmi_cb.set_callback(object); }
+
+ void add_a2eauxslot_card(device_a2eauxslot_card_interface *card);
+ device_a2eauxslot_card_interface *get_a2eauxslot_card();
+
+ void set_irq_line(int state);
+ void set_nmi_line(int state);
+
+ DECLARE_WRITE_LINE_MEMBER( irq_w );
+ DECLARE_WRITE_LINE_MEMBER( nmi_w );
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ // internal state
+ cpu_device *m_maincpu;
+
+ devcb_write_line m_out_irq_cb;
+ devcb_write_line m_out_nmi_cb;
+
+ device_a2eauxslot_card_interface *m_device;
+ const char *m_cputag;
+};
+
+
+// device type definition
+extern const device_type A2EAUXSLOT;
+
+// ======================> device_a2eauxslot_card_interface
+
+// class representing interface-specific live a2eauxslot card
+class device_a2eauxslot_card_interface : public device_slot_card_interface
+{
+ friend class a2eauxslot_device;
+public:
+ // construction/destruction
+ device_a2eauxslot_card_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_a2eauxslot_card_interface();
+
+ virtual UINT8 read_auxram(UINT16 offset) { printf("a2eauxslot: unhandled auxram read @ %04x\n", offset); return 0xff; }
+ virtual void write_auxram(UINT16 offset, UINT8 data) { printf("a2eauxslot: unhandled auxram write %02x @ %04x\n", data, offset); }
+ virtual void write_c07x(address_space &space, UINT8 offset, UINT8 data) {}
+ virtual UINT8 *get_vram_ptr() = 0;
+ virtual UINT8 *get_auxbank_ptr() = 0;
+ virtual bool allow_dhr() { return true; }
+
+ device_a2eauxslot_card_interface *next() const { return m_next; }
+
+ void set_a2eauxslot_device();
+
+ void raise_slot_irq() { m_a2eauxslot->set_irq_line(ASSERT_LINE); }
+ void lower_slot_irq() { m_a2eauxslot->set_irq_line(CLEAR_LINE); }
+ void raise_slot_nmi() { m_a2eauxslot->set_nmi_line(ASSERT_LINE); }
+ void lower_slot_nmi() { m_a2eauxslot->set_nmi_line(CLEAR_LINE); }
+
+ // inline configuration
+ static void static_set_a2eauxslot_tag(device_t &device, const char *tag, const char *slottag);
+public:
+ a2eauxslot_device *m_a2eauxslot;
+ const char *m_a2eauxslot_tag, *m_a2eauxslot_slottag;
+ int m_slot;
+ device_a2eauxslot_card_interface *m_next;
+};
+
+#endif /* __A2EAUXSLOT_H__ */
diff --git a/src/devices/bus/a2bus/a2echoii.c b/src/devices/bus/a2bus/a2echoii.c
new file mode 100644
index 00000000000..e6be96b5d85
--- /dev/null
+++ b/src/devices/bus/a2bus/a2echoii.c
@@ -0,0 +1,103 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2echoii.c
+
+ Implementation of the Street Electronics Echo II speech card
+
+*********************************************************************/
+
+#include "a2echoii.h"
+#include "includes/apple2.h"
+#include "sound/tms5220.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_ECHOII = &device_creator<a2bus_echoii_device>;
+
+#define TMS_TAG "tms5220"
+
+MACHINE_CONFIG_FRAGMENT( a2echoii )
+ MCFG_SPEAKER_STANDARD_MONO("echoii")
+ MCFG_SOUND_ADD(TMS_TAG, TMS5220, 640000) // Note the Echo II card has a "FREQ" potentiometer which can be used to adjust the tms5220's clock frequency; 640khz is the '8khz' value according to the tms5220 datasheet
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "echoii", 1.0)
+MACHINE_CONFIG_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_echoii_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( a2echoii );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_echoii_device::a2bus_echoii_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_tms(*this, TMS_TAG)
+{
+}
+
+a2bus_echoii_device::a2bus_echoii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_ECHOII, "Street Electronics Echo II", tag, owner, clock, "a2echoii", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_tms(*this, TMS_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_echoii_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+}
+
+void a2bus_echoii_device::device_reset()
+{
+}
+
+UINT8 a2bus_echoii_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset)
+ {
+ case 0:
+ return 0x1f | m_tms->status_r(space, 0);
+ }
+
+ return 0;
+}
+
+void a2bus_echoii_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ switch (offset)
+ {
+ case 0:
+ m_tms->data_w(space, offset, data);
+ break;
+ }
+}
+
+bool a2bus_echoii_device::take_c800()
+{
+ return false;
+}
diff --git a/src/devices/bus/a2bus/a2echoii.h b/src/devices/bus/a2bus/a2echoii.h
new file mode 100644
index 00000000000..9413ce3a900
--- /dev/null
+++ b/src/devices/bus/a2bus/a2echoii.h
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2echoii.h
+
+ Implementation of the Street Electronics Echo II speech card
+
+*********************************************************************/
+
+#ifndef __A2BUS_ECHOII__
+#define __A2BUS_ECHOII__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "sound/tms5220.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_echoii_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_echoii_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ a2bus_echoii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ required_device<tms5220_device> m_tms;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual bool take_c800();
+};
+
+// device type definition
+extern const device_type A2BUS_ECHOII;
+
+#endif /* __A2BUS_ECHOII__ */
diff --git a/src/devices/bus/a2bus/a2eext80col.c b/src/devices/bus/a2bus/a2eext80col.c
new file mode 100644
index 00000000000..c3e9af48cac
--- /dev/null
+++ b/src/devices/bus/a2bus/a2eext80col.c
@@ -0,0 +1,75 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2eext80col.c
+
+ Apple IIe Extended 80 Column Card (64K of RAM, double-hi-res)
+
+*********************************************************************/
+
+#include "emu.h"
+#include "includes/apple2.h"
+#include "a2eext80col.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2EAUX_EXT80COL = &device_creator<a2eaux_ext80col_device>;
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2eaux_ext80col_device::a2eaux_ext80col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2EAUX_EXT80COL, "Apple IIe Extended 80-Column Card", tag, owner, clock, "a2eext80", __FILE__),
+ device_a2eauxslot_card_interface(mconfig, *this)
+{
+}
+
+a2eaux_ext80col_device::a2eaux_ext80col_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2eauxslot_card_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2eaux_ext80col_device::device_start()
+{
+ set_a2eauxslot_device();
+ memset(m_ram, 0, sizeof(m_ram));
+ save_item(NAME(m_ram));
+}
+
+void a2eaux_ext80col_device::device_reset()
+{
+}
+
+UINT8 a2eaux_ext80col_device::read_auxram(UINT16 offset)
+{
+ return m_ram[offset];
+}
+
+void a2eaux_ext80col_device::write_auxram(UINT16 offset, UINT8 data)
+{
+ m_ram[offset] = data;
+}
+
+UINT8 *a2eaux_ext80col_device::get_vram_ptr()
+{
+ return &m_ram[0];
+}
+
+UINT8 *a2eaux_ext80col_device::get_auxbank_ptr()
+{
+ return &m_ram[0];
+}
diff --git a/src/devices/bus/a2bus/a2eext80col.h b/src/devices/bus/a2bus/a2eext80col.h
new file mode 100644
index 00000000000..ba14f5f0ad3
--- /dev/null
+++ b/src/devices/bus/a2bus/a2eext80col.h
@@ -0,0 +1,47 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2eext80col.c
+
+ Apple IIe Extended 80 Column Card
+
+*********************************************************************/
+
+#ifndef __A2EAUX_EXT80COL__
+#define __A2EAUX_EXT80COL__
+
+#include "emu.h"
+#include "a2eauxslot.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2eaux_ext80col_device:
+ public device_t,
+ public device_a2eauxslot_card_interface
+{
+public:
+ // construction/destruction
+ a2eaux_ext80col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2eaux_ext80col_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ virtual UINT8 read_auxram(UINT16 offset);
+ virtual void write_auxram(UINT16 offset, UINT8 data);
+ virtual UINT8 *get_vram_ptr();
+ virtual UINT8 *get_auxbank_ptr();
+ virtual bool allow_dhr() { return true; }
+
+private:
+ UINT8 m_ram[64*1024];
+};
+
+// device type definition
+extern const device_type A2EAUX_EXT80COL;
+
+#endif /* __A2EAUX_EXT80COL__ */
diff --git a/src/devices/bus/a2bus/a2eramworks3.c b/src/devices/bus/a2bus/a2eramworks3.c
new file mode 100644
index 00000000000..17b7b2ceb0e
--- /dev/null
+++ b/src/devices/bus/a2bus/a2eramworks3.c
@@ -0,0 +1,99 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2eramworks3.c
+
+ Applied Engineering RamWorks III
+
+
+*********************************************************************/
+
+#include "emu.h"
+#include "includes/apple2.h"
+#include "a2eramworks3.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2EAUX_RAMWORKS3 = &device_creator<a2eaux_ramworks3_device>;
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2eaux_ramworks3_device::a2eaux_ramworks3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2EAUX_RAMWORKS3, "Applied Engineering RamWorks III", tag, owner, clock, "a2erwks3", __FILE__),
+ device_a2eauxslot_card_interface(mconfig, *this)
+{
+}
+
+a2eaux_ramworks3_device::a2eaux_ramworks3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2eauxslot_card_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2eaux_ramworks3_device::device_start()
+{
+ set_a2eauxslot_device();
+ save_item(NAME(m_ram));
+ save_item(NAME(m_bank));
+}
+
+void a2eaux_ramworks3_device::device_reset()
+{
+ m_bank = 0;
+}
+
+UINT8 a2eaux_ramworks3_device::read_auxram(UINT16 offset)
+{
+ return m_ram[offset+m_bank];
+}
+
+void a2eaux_ramworks3_device::write_auxram(UINT16 offset, UINT8 data)
+{
+ m_ram[offset+m_bank] = data;
+}
+
+UINT8 *a2eaux_ramworks3_device::get_vram_ptr()
+{
+ return &m_ram[0];
+}
+
+UINT8 *a2eaux_ramworks3_device::get_auxbank_ptr()
+{
+ return &m_ram[m_bank];
+}
+
+/*
+ These cards are split into 64k logical banks.
+
+ On a RW3:
+ Banks 00-0F is the first MB
+ Banks 10-17 are the next 512K
+ Banks 30-37 are the next 512K
+ Banks 50-57 are the next 512K
+ Banks 70-77 are the next 512K
+
+ However, the software will recognize and correctly use a configuration in which
+ all of banks 00-7F are populated for a total of 8 megabytes. So that's what we do.
+*/
+void a2eaux_ramworks3_device::write_c07x(address_space &space, UINT8 offset, UINT8 data)
+{
+ // write to C073?
+ if (offset == 3)
+ {
+ m_bank = 0x10000 * (data & 0x7f);
+ }
+}
diff --git a/src/devices/bus/a2bus/a2eramworks3.h b/src/devices/bus/a2bus/a2eramworks3.h
new file mode 100644
index 00000000000..93b120bb59d
--- /dev/null
+++ b/src/devices/bus/a2bus/a2eramworks3.h
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2eramworks3.c
+
+ Applied Engineering RamWorks III
+
+*********************************************************************/
+
+#ifndef __A2EAUX_RAMWORKS3__
+#define __A2EAUX_RAMWORKS3__
+
+#include "emu.h"
+#include "a2eauxslot.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2eaux_ramworks3_device:
+ public device_t,
+ public device_a2eauxslot_card_interface
+{
+public:
+ // construction/destruction
+ a2eaux_ramworks3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2eaux_ramworks3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ virtual UINT8 read_auxram(UINT16 offset);
+ virtual void write_auxram(UINT16 offset, UINT8 data);
+ virtual UINT8 *get_vram_ptr();
+ virtual UINT8 *get_auxbank_ptr();
+ virtual bool allow_dhr() { return true; }
+ virtual void write_c07x(address_space &space, UINT8 offset, UINT8 data);
+
+private:
+ UINT8 m_ram[8*1024*1024];
+ int m_bank;
+};
+
+// device type definition
+extern const device_type A2EAUX_RAMWORKS3;
+
+#endif /* __A2EAUX_RAMWORKS3__ */
diff --git a/src/devices/bus/a2bus/a2estd80col.c b/src/devices/bus/a2bus/a2estd80col.c
new file mode 100644
index 00000000000..706f32d6a55
--- /dev/null
+++ b/src/devices/bus/a2bus/a2estd80col.c
@@ -0,0 +1,82 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2estd80col.c
+
+ Apple IIe Standard 80 Column Card (2K of RAM, no double-hi-res)
+
+*********************************************************************/
+
+#include "emu.h"
+#include "includes/apple2.h"
+#include "a2estd80col.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2EAUX_STD80COL = &device_creator<a2eaux_std80col_device>;
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2eaux_std80col_device::a2eaux_std80col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2EAUX_STD80COL, "Apple IIe Standard 80-Column Card", tag, owner, clock, "a2estd80", __FILE__),
+ device_a2eauxslot_card_interface(mconfig, *this)
+{
+}
+
+a2eaux_std80col_device::a2eaux_std80col_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2eauxslot_card_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2eaux_std80col_device::device_start()
+{
+ set_a2eauxslot_device();
+ save_item(NAME(m_ram));
+}
+
+void a2eaux_std80col_device::device_reset()
+{
+}
+
+UINT8 a2eaux_std80col_device::read_auxram(UINT16 offset)
+{
+ if (offset < 0x800)
+ {
+ return m_ram[offset];
+ }
+
+ return 0xff;
+}
+
+void a2eaux_std80col_device::write_auxram(UINT16 offset, UINT8 data)
+{
+ if (offset < 0x800)
+ {
+ m_ram[offset] = data;
+ }
+}
+
+UINT8 *a2eaux_std80col_device::get_vram_ptr()
+{
+ return &m_ram[0];
+}
+
+UINT8 *a2eaux_std80col_device::get_auxbank_ptr()
+{
+ return &m_ram[0];
+}
diff --git a/src/devices/bus/a2bus/a2estd80col.h b/src/devices/bus/a2bus/a2estd80col.h
new file mode 100644
index 00000000000..bcab4bab704
--- /dev/null
+++ b/src/devices/bus/a2bus/a2estd80col.h
@@ -0,0 +1,47 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2estd80col.c
+
+ Apple IIe Standard 80 Column Card
+
+*********************************************************************/
+
+#ifndef __A2EAUX_STD80COL__
+#define __A2EAUX_STD80COL__
+
+#include "emu.h"
+#include "a2eauxslot.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2eaux_std80col_device:
+ public device_t,
+ public device_a2eauxslot_card_interface
+{
+public:
+ // construction/destruction
+ a2eaux_std80col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2eaux_std80col_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ virtual UINT8 read_auxram(UINT16 offset);
+ virtual void write_auxram(UINT16 offset, UINT8 data);
+ virtual UINT8 *get_vram_ptr();
+ virtual UINT8 *get_auxbank_ptr();
+ virtual bool allow_dhr() { return false; } // we don't allow DHR
+
+private:
+ UINT8 m_ram[2*1024];
+};
+
+// device type definition
+extern const device_type A2EAUX_STD80COL;
+
+#endif /* __A2EAUX_STD80COL__ */
diff --git a/src/devices/bus/a2bus/a2hsscsi.c b/src/devices/bus/a2bus/a2hsscsi.c
new file mode 100644
index 00000000000..a292eba7410
--- /dev/null
+++ b/src/devices/bus/a2bus/a2hsscsi.c
@@ -0,0 +1,323 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2hsscsi.c
+
+ Implementation of the Apple II High Speed SCSI Card
+
+ This uses an ASIC called "Sandwich II"; the card itself is
+ sometimes known as "Cocoon".
+
+ Notes:
+ C0n0-C0n7 = NCR5380 registers in normal order
+ C0n8 = DMA address low
+ C0n9 = DMA address high
+ C0nA = DMA count low
+ C0nB = DMA count high
+ C0nC = DMA control
+ C0nD = Enable DMA / reset 5380
+ C0nE = Priority (read bits 5-7) / Fire watchdog (write bit 7) / RAM bank (write bits 0-3)
+ C0nF = DMA speed (bit 7 = 0 for fast, 1 for slow) / ROM bank (write bits 0-4)
+
+ DMA control register (C0nC):
+ 0x01 = pseudo-DMA enable
+ 0x02 = DMA enable
+ 0x04 = test mode
+ 0x08 = disable stop-DMA-on-IRQ
+ 0x10 = DMA direction (read only)
+ 0x20 = 5380 IRQ enable
+ 0x40 = system DMA status (read only)
+ 0x80 = DMA stopped due to IRQ
+
+ Enable DMA / reset 5380 register (C0nD):
+ 0x01 = Resume DMA after rollover or IRQ
+ 0x02 = Reset the 5380
+ 0x40 = Clear test mode
+ 0x80 = Set test mode
+
+*********************************************************************/
+
+#include "a2hsscsi.h"
+#include "includes/apple2.h"
+#include "machine/nscsi_cd.h"
+#include "machine/nscsi_hd.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_HSSCSI = &device_creator<a2bus_hsscsi_device>;
+
+#define SCSI_ROM_REGION "scsi_rom"
+#define SCSI_BUS_TAG "scsibus"
+#define SCSI_5380_TAG "scsibus:7:ncr5380"
+
+static MACHINE_CONFIG_FRAGMENT( ncr5380 )
+ MCFG_DEVICE_CLOCK(10000000)
+ MCFG_NCR5380N_DRQ_HANDLER(DEVWRITELINE("^^", a2bus_hsscsi_device, drq_w))
+MACHINE_CONFIG_END
+
+static SLOT_INTERFACE_START( hsscsi_devices )
+ SLOT_INTERFACE("cdrom", NSCSI_CDROM)
+ SLOT_INTERFACE("harddisk", NSCSI_HARDDISK)
+ SLOT_INTERFACE_INTERNAL("ncr5380", NCR5380N)
+SLOT_INTERFACE_END
+
+static MACHINE_CONFIG_FRAGMENT( hsscsi )
+ MCFG_NSCSI_BUS_ADD(SCSI_BUS_TAG)
+ MCFG_NSCSI_ADD("scsibus:0", hsscsi_devices, 0, false)
+ MCFG_NSCSI_ADD("scsibus:1", hsscsi_devices, 0, false)
+ MCFG_NSCSI_ADD("scsibus:2", hsscsi_devices, 0, false)
+ MCFG_NSCSI_ADD("scsibus:3", hsscsi_devices, 0, false)
+ MCFG_NSCSI_ADD("scsibus:4", hsscsi_devices, 0, false)
+ MCFG_NSCSI_ADD("scsibus:5", hsscsi_devices, 0, false)
+ MCFG_NSCSI_ADD("scsibus:6", hsscsi_devices, "harddisk", false)
+ MCFG_NSCSI_ADD("scsibus:7", hsscsi_devices, "ncr5380", true)
+ MCFG_DEVICE_CARD_MACHINE_CONFIG("ncr5380", ncr5380)
+MACHINE_CONFIG_END
+
+ROM_START( hsscsi )
+ ROM_REGION(0x8000, SCSI_ROM_REGION, 0)
+ ROM_LOAD( "341-0803.bin", 0x0000, 0x8000, CRC(2c15618b) SHA1(7d32227299933bfc1b7f8bc2062906fdfe530674) )
+ROM_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_hsscsi_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( hsscsi );
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *a2bus_hsscsi_device::device_rom_region() const
+{
+ return ROM_NAME( hsscsi );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_hsscsi_device::a2bus_hsscsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_ncr5380(*this, SCSI_5380_TAG),
+ m_scsibus(*this, SCSI_BUS_TAG)
+{
+}
+
+a2bus_hsscsi_device::a2bus_hsscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_HSSCSI, "Apple II High-Speed SCSI Card", tag, owner, clock, "a2hsscsi", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_ncr5380(*this, SCSI_5380_TAG),
+ m_scsibus(*this, SCSI_BUS_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_hsscsi_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(SCSI_ROM_REGION).c_str())->base();
+
+ memset(m_ram, 0, 8192);
+
+ save_item(NAME(m_ram));
+ save_item(NAME(m_rambank));
+ save_item(NAME(m_rombank));
+ save_item(NAME(m_bank));
+ save_item(NAME(m_drq));
+ save_item(NAME(m_816block));
+}
+
+void a2bus_hsscsi_device::device_reset()
+{
+ m_rambank = 0;
+ m_rombank = 0;
+ m_c0ne = m_c0nf = 0;
+ m_816block = false;
+}
+
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_hsscsi_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+// printf("Read 5380 @ %x\n", offset);
+ return m_ncr5380->read(space, offset);
+
+ case 0xc:
+ return 0x00; // indicate watchdog?
+
+ case 0xe: // code at cf32 wants to RMW this without killing the ROM bank
+ return m_c0ne;
+
+ case 0xf:
+ return m_c0nf;
+
+ default:
+ printf("Read c0n%x (PC=%x)\n", offset, space.device().safe_pc());
+ break;
+ }
+
+ return 0xff;
+}
+
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_hsscsi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ switch (offset)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+// printf("%02x to 5380 reg %x\n", data, offset);
+ m_ncr5380->write(space, offset, data);
+ break;
+#if 0
+ case 8: // DMA address low
+ break;
+
+ case 9: // DMA address high
+ break;
+
+ case 0xa: // DMA count low
+ break;
+
+ case 0xb: // DMA count high
+ break;
+
+ case 0xc: // DMA control
+ break;
+#endif
+
+ case 0xd: // DMA enable / reset
+ printf("%02x to DMA enable/reset\n", data);
+ if (data & 0x2)
+ {
+ // printf("Resetting SCSI: %02x at %x\n", data, space.device().safe_pc());
+ m_ncr5380->reset();
+ }
+ break;
+
+ case 0xe:
+ m_c0ne = data;
+ m_rombank = (data & 0x1f) * 0x400;
+ printf("c0ne to %x (ROM bank %x)\n", data & 0x1f, m_rombank);
+ break;
+
+ case 0xf:
+ m_c0nf = data;
+ m_rambank = (data & 0x7) * 0x400;
+ printf("c0nf to %x (RAM bank %x)\n", data & 0x7, m_rambank);
+ break;
+
+ default:
+ printf("Write %02x to c0n%x (PC=%x)\n", data, offset, space.device().safe_pc());
+ break;
+ }
+}
+
+/*-------------------------------------------------
+ read_cnxx - called for reads from this card's cnxx space
+-------------------------------------------------*/
+
+UINT8 a2bus_hsscsi_device::read_cnxx(address_space &space, UINT8 offset)
+{
+ // one slot image at the start of the ROM, it appears
+ return m_rom[offset];
+}
+
+void a2bus_hsscsi_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data)
+{
+// printf("Write %02x to cn%02x (PC=%x)\n", data, offset, space.device().safe_pc());
+}
+
+/*-------------------------------------------------
+ read_c800 - called for reads from this card's c800 space
+-------------------------------------------------*/
+
+UINT8 a2bus_hsscsi_device::read_c800(address_space &space, UINT16 offset)
+{
+ // bankswitched RAM at c800-cbff
+ // bankswitched ROM at cc00-cfff
+ if (offset < 0x400)
+ {
+// printf("Read RAM at %x = %02x\n", offset+m_rambank, m_ram[offset + m_rambank]);
+ if (m_816block)
+ {
+ return m_ncr5380->dma_r();
+ }
+
+ return m_ram[offset + m_rambank];
+ }
+ else
+ {
+ return m_rom[(offset-0x400) + m_rombank];
+ }
+}
+
+/*-------------------------------------------------
+ write_c800 - called for writes to this card's c800 space
+-------------------------------------------------*/
+void a2bus_hsscsi_device::write_c800(address_space &space, UINT16 offset, UINT8 data)
+{
+ if (offset < 0x400)
+ {
+// printf("%02x to RAM at %x\n", data, offset+m_rambank);
+ if (m_816block)
+ {
+ m_ncr5380->dma_w(data);
+ }
+ else
+ {
+ m_ram[offset + m_rambank] = data;
+ }
+ }
+}
+
+WRITE_LINE_MEMBER( a2bus_hsscsi_device::drq_w )
+{
+ m_drq = (state ? 0x80 : 0x00);
+}
diff --git a/src/devices/bus/a2bus/a2hsscsi.h b/src/devices/bus/a2bus/a2hsscsi.h
new file mode 100644
index 00000000000..2deada2e051
--- /dev/null
+++ b/src/devices/bus/a2bus/a2hsscsi.h
@@ -0,0 +1,65 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2hsscsi.h
+
+ Implementation of the Apple II High Speed SCSI Card
+
+*********************************************************************/
+
+#ifndef __A2BUS_HSSCSI__
+#define __A2BUS_HSSCSI__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "machine/ncr5380n.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_hsscsi_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_hsscsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ a2bus_hsscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+ required_device<ncr5380n_device> m_ncr5380;
+ required_device<nscsi_bus_device> m_scsibus;
+
+ DECLARE_WRITE_LINE_MEMBER( drq_w );
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+ virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_c800(address_space &space, UINT16 offset);
+ virtual void write_c800(address_space &space, UINT16 offset, UINT8 data);
+
+private:
+ UINT8 *m_rom;
+ UINT8 m_ram[8192]; // 8 banks of 1024 bytes
+ int m_rambank, m_rombank;
+ UINT8 m_drq;
+ UINT8 m_bank;
+ bool m_816block;
+ UINT8 m_c0ne, m_c0nf;
+};
+
+// device type definition
+extern const device_type A2BUS_HSSCSI;
+
+#endif /* __A2BUS_HSSCSI__ */
diff --git a/src/devices/bus/a2bus/a2lang.c b/src/devices/bus/a2bus/a2lang.c
new file mode 100644
index 00000000000..9a0b21dca36
--- /dev/null
+++ b/src/devices/bus/a2bus/a2lang.c
@@ -0,0 +1,145 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2lang.c
+
+ Implementation of the Apple II Language Card
+
+ TODO: refactor machine/apple2.c so it's possible to have an Apple II
+ and II Plus without a language card (and to emulate other
+ slot 0 stuff like hack/freezer cards).
+
+*********************************************************************/
+
+#include "emu.h"
+#include "includes/apple2.h"
+#include "a2lang.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+#define LOG_LANGCARD 0
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_LANG = &device_creator<a2bus_lang_device>;
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_lang_device::a2bus_lang_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_LANG, "Apple II Language Card", tag, owner, clock, "a2lang", __FILE__),
+ device_a2bus_card_interface(mconfig, *this)
+{
+ last_offset = -1;
+}
+
+a2bus_lang_device::a2bus_lang_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this)
+{
+ last_offset = -1;
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_lang_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ save_item(NAME(last_offset));
+}
+
+void a2bus_lang_device::device_reset()
+{
+}
+
+/*-------------------------------------------------
+ apple2_langcard_touch - device read callback
+-------------------------------------------------*/
+
+void a2bus_lang_device::langcard_touch(offs_t offset)
+{
+ UINT32 val, mask;
+
+ if (LOG_LANGCARD)
+ logerror("language card bankswitch read, offset: $c08%0x\n", offset);
+
+ /* determine which flags to change */
+ mask = VAR_LCWRITE | VAR_LCRAM | VAR_LCRAM2;
+ val = 0;
+
+ if (offset & 0x01)
+ val |= VAR_LCWRITE;
+
+ switch(offset & 0x03)
+ {
+ case 0x03:
+ case 0x00:
+ val |= VAR_LCRAM;
+ break;
+ }
+
+ if ((offset & 0x08) == 0)
+ val |= VAR_LCRAM2;
+
+ /* change the flags */
+ apple2_state *state = machine().driver_data<apple2_state>();
+ state->apple2_setvar(val, mask);
+}
+
+
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_lang_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ apple2_state *state = machine().driver_data<apple2_state>();
+
+ // enforce "read twice" for c081/3/9/B
+ // but only on the II/II+ with a discrete language card.
+ // later machines' ASICs dropped the double-read requirement,
+ // likely to be interrupt-safe.
+ if (state->m_machinetype == APPLE_II)
+ {
+ switch (offset & 0x03)
+ {
+ case 1:
+ case 3:
+ if (offset != last_offset)
+ {
+ last_offset = offset;
+ return 0;
+ }
+ break;
+ }
+ }
+
+ langcard_touch(offset);
+ last_offset = offset;
+ return 0;
+}
+
+
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_lang_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ langcard_touch(offset);
+ last_offset = -1;
+}
diff --git a/src/devices/bus/a2bus/a2lang.h b/src/devices/bus/a2bus/a2lang.h
new file mode 100644
index 00000000000..b97ae92a5b1
--- /dev/null
+++ b/src/devices/bus/a2bus/a2lang.h
@@ -0,0 +1,46 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2lang.h
+
+ Apple II Language Card
+
+*********************************************************************/
+
+#ifndef __A2BUS_LANG__
+#define __A2BUS_LANG__
+
+#include "emu.h"
+#include "a2bus.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_lang_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_lang_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2bus_lang_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+
+private:
+ void langcard_touch(offs_t offset);
+
+ int last_offset;
+};
+
+// device type definition
+extern const device_type A2BUS_LANG;
+
+#endif /* __A2BUS_LANG__ */
diff --git a/src/devices/bus/a2bus/a2mcms.c b/src/devices/bus/a2bus/a2mcms.c
new file mode 100644
index 00000000000..e9bb29d1243
--- /dev/null
+++ b/src/devices/bus/a2bus/a2mcms.c
@@ -0,0 +1,382 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2mcms.c
+
+ Implementation of the Mountain Computer Music System.
+ This was sold standalone and also used as part of the alphaSyntauri
+ and SoundChaser systems.
+
+*********************************************************************/
+
+#include "a2mcms.h"
+#include "includes/apple2.h"
+
+// the actual sound device (a slot device can't currently also be a sound device so we keep this private here)
+enum
+{
+ CTRL_IRQS = 0,
+ CTRL_DMA,
+ CTRL_MASTERVOL
+};
+
+
+const device_type MCMS = &device_creator<mcms_device>;
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_MCMS1 = &device_creator<a2bus_mcms1_device>;
+const device_type A2BUS_MCMS2 = &device_creator<a2bus_mcms2_device>;
+
+#define ENGINE_TAG "engine"
+
+#define MCFG_MCMS_IRQ_CALLBACK(_cb) \
+ devcb = &mcms_device::set_irq_cb(*device, DEVCB_##_cb);
+
+MACHINE_CONFIG_FRAGMENT( a2mcms )
+ MCFG_SPEAKER_STANDARD_STEREO("mcms_l", "mcms_r")
+
+ MCFG_DEVICE_ADD(ENGINE_TAG, MCMS, 1000000)
+ MCFG_MCMS_IRQ_CALLBACK(WRITELINE(a2bus_mcms1_device, irq_w))
+
+ MCFG_SOUND_ROUTE(0, "mcms_l", 1.0)
+ MCFG_SOUND_ROUTE(1, "mcms_r", 1.0)
+MACHINE_CONFIG_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_mcms1_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( a2mcms );
+}
+
+//**************************************************************************
+// LIVE DEVICE - Card 1
+//**************************************************************************
+
+a2bus_mcms1_device::a2bus_mcms1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_mcms(*this, ENGINE_TAG)
+{
+}
+
+a2bus_mcms1_device::a2bus_mcms1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_MCMS1, "Mountain Computer Music System (card 1)", tag, owner, clock, "a2mcms1", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_mcms(*this, ENGINE_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_mcms1_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+}
+
+void a2bus_mcms1_device::device_reset()
+{
+ m_mcms->set_bus_device(this);
+}
+
+// read once at c0n0 to disable 125 Hz IRQs
+// read once at c0n1 to enable 125 Hz IRQs
+UINT8 a2bus_mcms1_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ if (offset == 0)
+ {
+ m_mcms->control_w(space, CTRL_IRQS, 0);
+ }
+ else if (offset == 1)
+ {
+ m_mcms->control_w(space, CTRL_IRQS, 1);
+ }
+
+ return 0xff;
+}
+
+// read at Cn00: light gun in bit 7, bits 0-5 = 'random' number
+UINT8 a2bus_mcms1_device::read_cnxx(address_space &space, UINT8 offset)
+{
+ return m_mcms->get_pen_rand();
+}
+
+// write 0-255 to Cn00 to set the master volume
+void a2bus_mcms1_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data)
+{
+ if (offset == 0)
+ {
+ m_mcms->control_w(space, CTRL_MASTERVOL, data);
+ }
+}
+
+mcms_device *a2bus_mcms1_device::get_engine(void)
+{
+ return m_mcms;
+}
+
+WRITE_LINE_MEMBER(a2bus_mcms1_device::irq_w)
+{
+ if (state == ASSERT_LINE)
+ {
+ raise_slot_irq();
+ }
+ else
+ {
+ lower_slot_irq();
+ }
+}
+
+//**************************************************************************
+// LIVE DEVICE - Card 2
+//**************************************************************************
+
+a2bus_mcms2_device::a2bus_mcms2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this)
+{
+}
+
+a2bus_mcms2_device::a2bus_mcms2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_MCMS2, "Mountain Computer Music System (card 2)", tag, owner, clock, "a2mcms2", __FILE__),
+ device_a2bus_card_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_mcms2_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ if (m_slot < 2)
+ {
+ fatalerror("MCMS: Card 2 must be in slot 2 or greater\n");
+ }
+}
+
+void a2bus_mcms2_device::device_reset()
+{
+ m_card1 = static_cast<a2bus_mcms1_device *>(m_a2bus->m_device_list[m_slot-1]);
+ m_engine = m_card1->get_engine();
+}
+
+// here to soak up false reads from indexed accesses
+UINT8 a2bus_mcms2_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ return 0xff;
+}
+
+// write once to c0n0 to disable the card (reset also disables)
+// write twice to c0n1 to enable the card (value doesn't matter)
+void a2bus_mcms2_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ if (offset == 0)
+ {
+ m_engine->control_w(space, CTRL_DMA, 0);
+ }
+ else if (offset == 1)
+ {
+ m_engine->control_w(space, CTRL_DMA, 1);
+ }
+}
+
+void a2bus_mcms2_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data)
+{
+ m_engine->voiceregs_w(space, offset, data);
+}
+
+
+/*
+ Sound device implementation
+*/
+
+mcms_device::mcms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MCMS, "Mountain Computer Music System engine", tag, owner, clock, "msmseng", __FILE__),
+ device_sound_interface(mconfig, *this),
+ m_write_irq(*this)
+{
+}
+
+void mcms_device::device_start()
+{
+ m_write_irq.resolve();
+ m_stream = machine().sound().stream_alloc(*this, 0, 2, 31250);
+ m_timer = timer_alloc(0, NULL);
+ m_clrtimer = timer_alloc(1, NULL);
+ m_enabled = false;
+ memset(m_vols, 0, sizeof(m_vols));
+ memset(m_table, 0, sizeof(m_table));
+ memset(m_freq, 0, sizeof(m_freq));
+ memset(m_acc, 0, sizeof(m_acc));
+
+ // the card detect programs volumes and wavetable page but not freq and expects the accumulator to increment
+ for (int i = 0; i < 16; i++)
+ {
+ m_freq[i] = 0x0040;
+ }
+
+ save_item(NAME(m_enabled));
+ save_item(NAME(m_vols));
+ save_item(NAME(m_table));
+ save_item(NAME(m_freq));
+ save_item(NAME(m_acc));
+ save_item(NAME(m_mastervol));
+ save_item(NAME(m_rand));
+}
+
+void mcms_device::device_reset()
+{
+ m_write_irq(CLEAR_LINE);
+ m_timer->adjust(attotime::never);
+ m_clrtimer->adjust(attotime::never);
+ m_enabled = false;
+}
+
+void mcms_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
+{
+ if (tid == 0)
+ {
+ m_write_irq(ASSERT_LINE);
+ // clear this IRQ in 10 cycles (?)
+ m_clrtimer->adjust(attotime::from_usec(10), 0);
+ }
+ else if (tid == 1)
+ {
+ m_write_irq(CLEAR_LINE);
+ }
+}
+
+void mcms_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ stream_sample_t *outL, *outR;
+ int i, v;
+ UINT16 wptr;
+ INT8 sample;
+ INT32 mixL, mixR;
+
+ outL = outputs[1];
+ outR = outputs[0];
+
+ if (m_enabled)
+ {
+ for (i = 0; i < samples; i++)
+ {
+ mixL = mixR = 0;
+
+ for (v = 0; v < 16; v++)
+ {
+ m_acc[v] += m_freq[v];
+ wptr = (m_table[v]<<8) | (m_acc[v]>>8);
+ m_rand = (m_acc[v]>>8) & 0x1f;
+
+ sample = (m_pBusDevice->slot_dma_read_no_space(wptr) ^ 0x80);
+ if (v & 1)
+ {
+ mixL += sample * m_vols[v];
+ }
+ else
+ {
+ mixR += sample * m_vols[v];
+ }
+ }
+
+ outL[i] = (mixL * m_mastervol)>>9;
+ outR[i] = (mixR * m_mastervol)>>9;
+ }
+ }
+ else
+ {
+ for (i = 0; i < samples; i++)
+ {
+ outL[i] = outR[i] = 0;
+ }
+ }
+}
+
+WRITE8_MEMBER(mcms_device::voiceregs_w)
+{
+ m_stream->update();
+ if (offset >= 0x20)
+ {
+ if (offset & 1) // amp
+ {
+ m_vols[(offset-0x21)/2] = data;
+ }
+ else // wavetable page
+ {
+ m_table[(offset-0x20)/2] = data;
+ }
+ }
+ else
+ {
+ if (offset & 1) // freq L
+ {
+ if (offset == 0x1f)
+ {
+ m_freq[0] &= 0xff00;
+ m_freq[0] |= data;
+ }
+ else
+ {
+ int reg = (offset/2)+1;
+ m_freq[reg] &= 0xff00;
+ m_freq[reg] |= data;
+ }
+ }
+ else // freq H
+ {
+ int reg = (offset/2);
+ m_freq[reg] &= 0x00ff;
+ m_freq[reg] |= (data<<8);
+ }
+ }
+}
+
+WRITE8_MEMBER(mcms_device::control_w)
+{
+ m_stream->update();
+
+ switch (offset)
+ {
+ case CTRL_IRQS:
+ if (data == 0)
+ {
+ m_timer->adjust(attotime::never);
+ }
+ else
+ {
+ m_timer->adjust(attotime::zero, 0, attotime::from_hz(125));
+ }
+ break;
+
+ case CTRL_DMA:
+ m_enabled = (data == 0) ? false : true;
+ break;
+
+ case CTRL_MASTERVOL:
+ m_mastervol = data;
+ break;
+ }
+}
diff --git a/src/devices/bus/a2bus/a2mcms.h b/src/devices/bus/a2bus/a2mcms.h
new file mode 100644
index 00000000000..283d13be62c
--- /dev/null
+++ b/src/devices/bus/a2bus/a2mcms.h
@@ -0,0 +1,121 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2mcms.h
+
+ Implementation of the Mountain Computer Music System.
+ This was sold standalone and also used as part of the alphaSyntauri
+ and SoundChaser systems.
+
+*********************************************************************/
+
+#ifndef __A2BUS_MCMS__
+#define __A2BUS_MCMS__
+
+#include "emu.h"
+#include "a2bus.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_mcms1_device;
+
+class mcms_device : public device_t, public device_sound_interface
+{
+public:
+ // construction/destruction
+ mcms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ DECLARE_WRITE8_MEMBER(voiceregs_w);
+ DECLARE_WRITE8_MEMBER(control_w);
+ UINT8 get_pen_rand(void) { m_stream->update(); return m_rand; }
+
+ void set_bus_device(a2bus_mcms1_device *pDev) { m_pBusDevice = pDev; }
+
+ template<class _Object> static devcb_base &set_irq_cb(device_t &device, _Object wr) { return downcast<mcms_device &>(device).m_write_irq.set_callback(wr); }
+ devcb_write_line m_write_irq;
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+private:
+ sound_stream *m_stream;
+ emu_timer *m_timer, *m_clrtimer;
+ a2bus_mcms1_device *m_pBusDevice;
+ bool m_enabled;
+ UINT8 m_vols[16];
+ UINT8 m_table[16];
+ UINT16 m_freq[16];
+ UINT16 m_acc[16];
+ UINT8 m_mastervol;
+ UINT8 m_rand;
+};
+
+// card 1
+class a2bus_mcms1_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_mcms1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ a2bus_mcms1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ // comms from card 2 (oscillator parameter writes)
+ mcms_device *get_engine(void);
+
+ DECLARE_WRITE_LINE_MEMBER(irq_w);
+
+ required_device<mcms_device> m_mcms;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+ virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data);
+ virtual bool take_c800() { return false; }
+};
+
+// card 2
+class a2bus_mcms2_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_mcms2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ a2bus_mcms2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data);
+ virtual bool take_c800() { return false; }
+
+private:
+ a2bus_mcms1_device *m_card1; // card 1 for passthrough
+ mcms_device *m_engine;
+};
+
+// device type definition
+extern const device_type A2BUS_MCMS1;
+extern const device_type A2BUS_MCMS2;
+
+#endif /* __A2BUS_MCMS__ */
diff --git a/src/devices/bus/a2bus/a2memexp.c b/src/devices/bus/a2bus/a2memexp.c
new file mode 100644
index 00000000000..210ba76a0d2
--- /dev/null
+++ b/src/devices/bus/a2bus/a2memexp.c
@@ -0,0 +1,230 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2memexp.c
+
+ Implementation of the Apple II Memory Expansion Card
+
+*********************************************************************/
+
+#include "a2memexp.h"
+#include "includes/apple2.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_MEMEXP = &device_creator<a2bus_memexpapple_device>;
+const device_type A2BUS_RAMFACTOR = &device_creator<a2bus_ramfactor_device>;
+
+#define MEMEXP_ROM_REGION "memexp_rom"
+
+MACHINE_CONFIG_FRAGMENT( memexp )
+MACHINE_CONFIG_END
+
+ROM_START( memexp )
+ ROM_REGION(0x1000, MEMEXP_ROM_REGION, 0)
+ ROM_LOAD( "341-0344a.bin", 0x0000, 0x1000, CRC(1e994e17) SHA1(6e823a1fa40ed37eeddcef23f5df24da2ea1463e) )
+ROM_END
+
+ROM_START( ramfactor )
+ ROM_REGION(0x8000, MEMEXP_ROM_REGION, 0)
+ ROM_LOAD( "ae ramfactor rom v1.4.bin", 0x0000, 0x2000, CRC(1c56d646) SHA1(32cb02a6a915dd3962bfa1f0184a94253e03ba6b) )
+ ROM_LOAD( "ae ramfactor rom v1.3.bin", 0x2000, 0x2000, CRC(434f5c45) SHA1(cf31a370951bd9a10d5b77f179134b358683b8fa) )
+ ROM_LOAD( "ae ramfactor rom v1.1.bin", 0x4000, 0x2000, CRC(328907a3) SHA1(dc25b4133a52609799098d8918a289fd973d28d9) )
+ ROM_LOAD( "ae ramfactor rom v1.0.bin", 0x6000, 0x2000, CRC(39c2162a) SHA1(9286d35907939aadb1fffd3e1d75603fe3e846ad) )
+ROM_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_memexp_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( memexp );
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *a2bus_memexp_device::device_rom_region() const
+{
+ return ROM_NAME( memexp );
+}
+
+const rom_entry *a2bus_ramfactor_device::device_rom_region() const
+{
+ return ROM_NAME( ramfactor );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_memexp_device::a2bus_memexp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this)
+{
+}
+
+a2bus_memexpapple_device::a2bus_memexpapple_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_memexp_device(mconfig, A2BUS_MEMEXP, "Apple II Memory Expansion Card", tag, owner, clock, "a2memexp", __FILE__)
+{
+ m_isramfactor = false;
+ m_bankhior = 0xf0;
+ m_addrmask = 0xfffff;
+}
+
+a2bus_ramfactor_device::a2bus_ramfactor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_memexp_device(mconfig, A2BUS_RAMFACTOR, "Applied Engineering RamFactor", tag, owner, clock, "a2ramfac", __FILE__)
+{
+ m_isramfactor = true;
+ m_bankhior = 0x00;
+ m_addrmask = 0x7fffff;
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_memexp_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(MEMEXP_ROM_REGION).c_str())->base();
+
+ memset(m_ram, 0xff, 1024*1024*sizeof(UINT8));
+
+ save_item(NAME(m_regs));
+ save_item(NAME(m_ram));
+ save_item(NAME(m_wptr));
+ save_item(NAME(m_liveptr));
+}
+
+void a2bus_memexp_device::device_reset()
+{
+ memset(m_regs, 0, sizeof(UINT8) * 0x10);
+ m_wptr = m_liveptr = 0;
+}
+
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_memexp_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ UINT8 retval = m_regs[offset];
+
+ if (offset == 3)
+ {
+ retval = m_ram[m_liveptr&m_addrmask];
+// printf("Read RAM[%x] = %02x\n", m_liveptr, retval);
+ m_liveptr++;
+ m_regs[0] = m_liveptr & 0xff;
+ m_regs[1] = (m_liveptr>>8) & 0xff;
+ m_regs[2] = ((m_liveptr>>16) & 0xff) | m_bankhior;
+ }
+
+// printf("Read c0n%x (PC=%x) = %02x\n", offset, space.device().safe_pc(), retval);
+
+ return retval;
+}
+
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_memexp_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+// printf("Write %02x to c0n%x (PC=%x)\n", data, offset, space.device().safe_pc());
+
+ switch (offset)
+ {
+ case 0:
+ m_wptr &= ~0xff;
+ m_wptr |= data;
+ m_regs[0] = m_wptr & 0xff;
+ m_regs[1] = (m_wptr>>8) & 0xff;
+ m_regs[2] = ((m_wptr>>16) & 0xff) | m_bankhior;
+ m_liveptr = m_wptr;
+ break;
+
+ case 1:
+ m_wptr &= ~0xff00;
+ m_wptr |= (data<<8);
+ m_regs[0] = m_wptr & 0xff;
+ m_regs[1] = (m_wptr>>8) & 0xff;
+ m_regs[2] = ((m_wptr>>16) & 0xff) | m_bankhior;
+ m_liveptr = m_wptr;
+ break;
+
+ case 2:
+ m_wptr &= ~0xff0000;
+ m_wptr |= (data<<16);
+ m_regs[0] = m_wptr & 0xff;
+ m_regs[1] = (m_wptr>>8) & 0xff;
+ m_regs[2] = ((m_wptr>>16) & 0xff) | m_bankhior;
+ m_liveptr = m_wptr;
+ break;
+
+ case 3:
+// printf("Write %02x to RAM[%x]\n", data, m_liveptr);
+ m_ram[(m_liveptr&m_addrmask)] = data;
+ m_liveptr++;
+ m_regs[0] = m_liveptr & 0xff;
+ m_regs[1] = (m_liveptr>>8) & 0xff;
+ m_regs[2] = ((m_liveptr>>16) & 0xff) | m_bankhior;
+ break;
+
+ default:
+ m_regs[offset] = data;
+ break;
+ }
+}
+
+/*-------------------------------------------------
+ read_cnxx - called for reads from this card's cnxx space
+-------------------------------------------------*/
+
+UINT8 a2bus_memexp_device::read_cnxx(address_space &space, UINT8 offset)
+{
+ int slotimg = m_slot * 0x100;
+
+ // first 0x400 of ROM contains a CnXX image for each of slots 1-7, last 0x400 is c800 image
+ if ((m_isramfactor) && (m_regs[0xf] & 0x01))
+ {
+ return m_rom[offset+slotimg+0x1000];
+ }
+
+ return m_rom[offset+slotimg];
+}
+
+/*-------------------------------------------------
+ read_c800 - called for reads from this card's c800 space
+-------------------------------------------------*/
+
+UINT8 a2bus_memexp_device::read_c800(address_space &space, UINT16 offset)
+{
+ // c70a diags confirm: bit 1 of cn0F banks in the second half of the ROM
+ if ((m_isramfactor) && (m_regs[0xf] & 0x01))
+ {
+ return m_rom[offset+0x1800];
+ }
+
+ return m_rom[offset+0x800];
+}
diff --git a/src/devices/bus/a2bus/a2memexp.h b/src/devices/bus/a2bus/a2memexp.h
new file mode 100644
index 00000000000..e7167569c67
--- /dev/null
+++ b/src/devices/bus/a2bus/a2memexp.h
@@ -0,0 +1,72 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2memexp.h
+
+ Implementation of the Apple II Memory Expansion Card
+
+*********************************************************************/
+
+#ifndef __A2BUS_MEMEXP__
+#define __A2BUS_MEMEXP__
+
+#include "emu.h"
+#include "a2bus.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_memexp_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_memexp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+ bool m_isramfactor;
+ UINT8 m_bankhior;
+ int m_addrmask;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+ virtual UINT8 read_c800(address_space &space, UINT16 offset);
+
+private:
+ UINT8 *m_rom;
+ UINT8 m_regs[0x10];
+ UINT8 m_ram[8*1024*1024];
+ int m_wptr, m_liveptr;
+};
+
+class a2bus_memexpapple_device : public a2bus_memexp_device
+{
+public:
+ a2bus_memexpapple_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class a2bus_ramfactor_device : public a2bus_memexp_device
+{
+public:
+ a2bus_ramfactor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual const rom_entry *device_rom_region() const;
+};
+
+// device type definition
+extern const device_type A2BUS_MEMEXP;
+extern const device_type A2BUS_RAMFACTOR;
+
+#endif /* __A2BUS_MEMEXP__ */
diff --git a/src/devices/bus/a2bus/a2midi.c b/src/devices/bus/a2bus/a2midi.c
new file mode 100644
index 00000000000..92dbff70520
--- /dev/null
+++ b/src/devices/bus/a2bus/a2midi.c
@@ -0,0 +1,172 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2midi.c
+
+ Apple II 6850 MIDI card, as made by Passport, Yamaha, and others.
+
+*********************************************************************/
+
+#include "a2midi.h"
+#include "machine/clock.h"
+#include "bus/midi/midi.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_MIDI = &device_creator<a2bus_midi_device>;
+
+#define MIDI_PTM_TAG "midi_ptm"
+#define MIDI_ACIA_TAG "midi_acia"
+
+MACHINE_CONFIG_FRAGMENT( midi )
+ MCFG_DEVICE_ADD(MIDI_PTM_TAG, PTM6840, 0)
+ MCFG_PTM6840_INTERNAL_CLOCK(1021800.0f)
+ MCFG_PTM6840_EXTERNAL_CLOCKS(1021800.0f, 1021800.0f, 1021800.0f)
+ MCFG_PTM6840_IRQ_CB(WRITELINE(a2bus_midi_device, ptm_irq_w))
+
+ MCFG_DEVICE_ADD(MIDI_ACIA_TAG, ACIA6850, 0)
+ MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("mdout", midi_port_device, write_txd))
+ MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(a2bus_midi_device, acia_irq_w))
+
+ MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin")
+ MCFG_MIDI_RX_HANDLER(DEVWRITELINE(MIDI_ACIA_TAG, acia6850_device, write_rxd))
+
+ MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout")
+
+ MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16)
+ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(a2bus_midi_device, write_acia_clock))
+MACHINE_CONFIG_END
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_midi_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( midi );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_midi_device::a2bus_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_MIDI, "6850 MIDI card", tag, owner, clock, "a2midi", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_ptm(*this, MIDI_PTM_TAG),
+ m_acia(*this, MIDI_ACIA_TAG),
+ m_ptm_irq(false)
+{
+}
+
+a2bus_midi_device::a2bus_midi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_ptm(*this, MIDI_PTM_TAG),
+ m_acia(*this, MIDI_ACIA_TAG),
+ m_ptm_irq(false)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_midi_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+}
+
+void a2bus_midi_device::device_reset()
+{
+ m_acia_irq = m_ptm_irq = false;
+}
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_midi_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ // PTM at C0n0-C0n7, ACIA at C0n8-C0n9, drum sync (?) at C0nA-C0nB
+
+ if (offset < 8)
+ {
+ return m_ptm->read(space, offset & 7);
+ }
+ else if (offset == 8)
+ {
+ return m_acia->status_r(space, 0);
+ }
+ else if (offset == 9)
+ {
+ UINT8 ret = m_acia->data_r(space, 0);
+ return ret;
+ }
+
+ return 0;
+}
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_midi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ if (offset < 8)
+ {
+ m_ptm->write(space, offset & 7, data);
+ }
+ else if (offset == 8)
+ {
+ m_acia->control_w(space, 0, data);
+ }
+ else if (offset == 9)
+ {
+ m_acia->data_w(space, 0, data);
+ }
+}
+
+WRITE_LINE_MEMBER( a2bus_midi_device::acia_irq_w )
+{
+ m_acia_irq = state ? true : false;
+
+ if (m_acia_irq || m_ptm_irq)
+ {
+ raise_slot_irq();
+ }
+ else
+ {
+ lower_slot_irq();
+ }
+}
+
+WRITE_LINE_MEMBER( a2bus_midi_device::ptm_irq_w )
+{
+ m_acia_irq = state ? true : false;
+
+ if (m_acia_irq || m_ptm_irq)
+ {
+ raise_slot_irq();
+ }
+ else
+ {
+ lower_slot_irq();
+ }
+}
+
+WRITE_LINE_MEMBER( a2bus_midi_device::write_acia_clock )
+{
+ m_acia->write_txc(state);
+ m_acia->write_rxc(state);
+}
diff --git a/src/devices/bus/a2bus/a2midi.h b/src/devices/bus/a2bus/a2midi.h
new file mode 100644
index 00000000000..f7023eba570
--- /dev/null
+++ b/src/devices/bus/a2bus/a2midi.h
@@ -0,0 +1,55 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2midi.h
+
+ Apple II 6850 MIDI card, as made by Passport, Yamaha, and others.
+
+*********************************************************************/
+
+#ifndef __A2BUS_MIDI__
+#define __A2BUS_MIDI__
+
+#include "a2bus.h"
+#include "machine/6840ptm.h"
+#include "machine/6850acia.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_midi_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2bus_midi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( ptm_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( write_acia_clock );
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+
+ required_device<ptm6840_device> m_ptm;
+ required_device<acia6850_device> m_acia;
+
+private:
+ bool m_acia_irq, m_ptm_irq;
+};
+
+// device type definition
+extern const device_type A2BUS_MIDI;
+
+#endif /* __A2BUS_MIDI__ */
diff --git a/src/devices/bus/a2bus/a2mockingboard.c b/src/devices/bus/a2bus/a2mockingboard.c
new file mode 100644
index 00000000000..9dd792f6e45
--- /dev/null
+++ b/src/devices/bus/a2bus/a2mockingboard.c
@@ -0,0 +1,528 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2mockingboard.c
+
+ Implementation of the Sweet Micro Systems Mockingboard card
+ and friends.
+
+*********************************************************************/
+
+#include "emu.h"
+#include "a2mockingboard.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+#define VIA1_TAG "mockbd_via1"
+#define VIA2_TAG "mockbd_via2"
+#define AY1_TAG "mockbd_ay1"
+#define AY2_TAG "mockbd_ay2"
+#define AY3_TAG "mockbd_ay3"
+#define AY4_TAG "mockbd_ay4"
+#define E2P_TMS_TAG "tms5220"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_MOCKINGBOARD = &device_creator<a2bus_mockingboard_device>;
+const device_type A2BUS_PHASOR = &device_creator<a2bus_phasor_device>;
+const device_type A2BUS_ECHOPLUS = &device_creator<a2bus_echoplus_device>;
+
+MACHINE_CONFIG_FRAGMENT( mockingboard )
+ MCFG_DEVICE_ADD(VIA1_TAG, VIA6522, 1022727)
+ MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(a2bus_ayboard_device, via1_out_a))
+ MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(a2bus_ayboard_device, via1_out_b))
+ MCFG_VIA6522_IRQ_HANDLER(WRITELINE(a2bus_ayboard_device, via1_irq_w))
+
+ MCFG_DEVICE_ADD(VIA2_TAG, VIA6522, 1022727)
+ MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(a2bus_ayboard_device, via2_out_a))
+ MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(a2bus_ayboard_device, via2_out_b))
+ MCFG_VIA6522_IRQ_HANDLER(WRITELINE(a2bus_ayboard_device, via2_irq_w))
+
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SOUND_ADD(AY1_TAG, AY8913, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ MCFG_SOUND_ADD(AY2_TAG, AY8913, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+MACHINE_CONFIG_END
+
+MACHINE_CONFIG_FRAGMENT( phasor )
+ MCFG_DEVICE_ADD(VIA1_TAG, VIA6522, 1022727)
+ MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(a2bus_ayboard_device, via1_out_a))
+ MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(a2bus_ayboard_device, via1_out_b))
+ MCFG_VIA6522_IRQ_HANDLER(WRITELINE(a2bus_ayboard_device, via1_irq_w))
+
+ MCFG_DEVICE_ADD(VIA2_TAG, VIA6522, 1022727)
+ MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(a2bus_ayboard_device, via2_out_a))
+ MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(a2bus_ayboard_device, via2_out_b))
+ MCFG_VIA6522_IRQ_HANDLER(WRITELINE(a2bus_ayboard_device, via2_irq_w))
+
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker2", "rspeaker2")
+ MCFG_SOUND_ADD(AY1_TAG, AY8913, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ MCFG_SOUND_ADD(AY2_TAG, AY8913, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker2", 1.0)
+ MCFG_SOUND_ADD(AY3_TAG, AY8913, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD(AY4_TAG, AY8913, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker2", 1.0)
+MACHINE_CONFIG_END
+
+MACHINE_CONFIG_FRAGMENT( echoplus )
+ MCFG_DEVICE_ADD(VIA1_TAG, VIA6522, 1022727)
+ MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(a2bus_ayboard_device, via1_out_a))
+ MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(a2bus_ayboard_device, via1_out_b))
+ MCFG_VIA6522_IRQ_HANDLER(WRITELINE(a2bus_ayboard_device, via1_irq_w))
+
+ MCFG_DEVICE_ADD(VIA2_TAG, VIA6522, 1022727)
+ MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(a2bus_ayboard_device, via2_out_a))
+ MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(a2bus_ayboard_device, via2_out_b))
+ MCFG_VIA6522_IRQ_HANDLER(WRITELINE(a2bus_ayboard_device, via2_irq_w))
+
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SOUND_ADD(AY1_TAG, AY8913, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ MCFG_SOUND_ADD(AY2_TAG, AY8913, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+
+ MCFG_SPEAKER_STANDARD_MONO("echosp")
+ MCFG_SOUND_ADD(E2P_TMS_TAG, TMS5220, 640000)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "echosp", 1.0)
+MACHINE_CONFIG_END
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_ayboard_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( mockingboard );
+}
+
+machine_config_constructor a2bus_phasor_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( phasor );
+}
+
+machine_config_constructor a2bus_echoplus_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( echoplus );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_ayboard_device::a2bus_ayboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_via1(*this, VIA1_TAG),
+ m_via2(*this, VIA2_TAG),
+ m_ay1(*this, AY1_TAG),
+ m_ay2(*this, AY2_TAG),
+ m_ay3(*this, AY3_TAG),
+ m_ay4(*this, AY4_TAG)
+{
+}
+
+a2bus_mockingboard_device::a2bus_mockingboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_ayboard_device(mconfig, A2BUS_MOCKINGBOARD, "Sweet Micro Systems Mockingboard", tag, owner, clock, "a2mockbd", __FILE__)
+{
+ m_isPhasor = false;
+ m_PhasorNative = false;
+}
+
+a2bus_phasor_device::a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_ayboard_device(mconfig, A2BUS_PHASOR, "Applied Engineering Phasor", tag, owner, clock, "a2phasor", __FILE__)
+{
+ m_isPhasor = true;
+ m_PhasorNative = false;
+}
+
+a2bus_echoplus_device::a2bus_echoplus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ a2bus_ayboard_device(mconfig, A2BUS_ECHOPLUS, "Street Electronics Echo Plus", tag, owner, clock, "a2echop", __FILE__),
+ m_tms(*this, E2P_TMS_TAG)
+{
+ m_isPhasor = false;
+ m_PhasorNative = false;
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_ayboard_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ save_item(NAME(m_porta1));
+ save_item(NAME(m_porta2));
+}
+
+void a2bus_ayboard_device::device_reset()
+{
+ m_porta1 = m_porta2 = 0;
+}
+
+/*-------------------------------------------------
+ read_cnxx - called for reads from this card's cnxx space
+-------------------------------------------------*/
+
+UINT8 a2bus_ayboard_device::read_cnxx(address_space &space, UINT8 offset)
+{
+// printf("Mockingboard(%d): read @ Cn%02X (PC=%x)\n", m_slot, offset, space.device().safe_pc());
+ if (m_isPhasor)
+ {
+ UINT8 retVal = 0;
+ int viaSel;
+
+ if (m_PhasorNative)
+ {
+ viaSel = ((offset & 0x80)>> 6) | ((offset & 0x10)>> 4);
+ }
+ else
+ {
+ viaSel = (offset & 0x80) ? 2 : 1;
+ }
+
+ if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0))
+ {
+ if (viaSel & 1)
+ {
+ retVal |= m_via1->read(space, offset & 0xf);
+ }
+
+ if (viaSel & 2)
+ {
+ retVal |= m_via2->read(space, offset & 0xf);
+ }
+ }
+
+ return retVal;
+ }
+ else
+ {
+ if (offset <= 0x10)
+ {
+ return m_via1->read(space, offset & 0xf);
+ }
+ else if (offset >= 0x80 && offset <= 0x90)
+ {
+ return m_via2->read(space, offset & 0xf);
+ }
+ }
+
+ return 0;
+}
+
+/*-------------------------------------------------
+ write_cnxx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_ayboard_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data)
+{
+ if (m_isPhasor)
+ {
+ if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0))
+ {
+ int viaSel;
+
+ if (m_PhasorNative)
+ {
+ viaSel = ((offset & 0x80)>> 6) | ((offset & 0x10)>> 4);
+ }
+ else
+ {
+ viaSel = (offset & 0x80) ? 2 : 1;
+ }
+
+// printf("Phasor(%d): write %02x to Cn%02X (PC=%x) (native %d viaSel %d)\n", m_slot, data, offset, space.device().safe_pc(), m_PhasorNative ? 1 : 0, viaSel);
+
+ if (viaSel & 1)
+ {
+ m_via1->write(space, offset&0xf, data);
+ }
+ if (viaSel & 2)
+ {
+ m_via2->write(space, offset&0xf, data);
+ }
+ }
+ }
+ else
+ {
+ if (offset <= 0x10)
+ {
+ m_via1->write(space, offset & 0xf, data);
+ }
+ else if (offset >= 0x80 && offset <= 0x90)
+ {
+ m_via2->write(space, offset & 0xf, data);
+ }
+ else
+ {
+ printf("Mockingboard(%d): unk write %02x to Cn%02X (PC=%x)\n", m_slot, data, offset, space.device().safe_pc());
+ }
+ }
+}
+
+
+WRITE_LINE_MEMBER( a2bus_ayboard_device::via1_irq_w )
+{
+ if (state)
+ {
+ raise_slot_irq();
+ }
+ else
+ {
+ lower_slot_irq();
+ }
+}
+
+WRITE_LINE_MEMBER( a2bus_ayboard_device::via2_irq_w )
+{
+ if (state)
+ {
+ raise_slot_irq();
+ }
+ else
+ {
+ lower_slot_irq();
+ }
+}
+
+WRITE8_MEMBER( a2bus_ayboard_device::via1_out_a )
+{
+ m_porta1 = data;
+}
+
+WRITE8_MEMBER( a2bus_ayboard_device::via1_out_b )
+{
+ if (!(data & 4))
+ {
+ m_ay1->reset_w(space, 0, 0);
+ if (m_isPhasor && m_PhasorNative)
+ {
+ m_ay2->reset_w(space, 0, 0);
+ }
+ }
+ else
+ {
+ if (!m_isPhasor)
+ {
+ switch (data & 3)
+ {
+ case 0: // BDIR=0, BC1=0 (inactive)
+ break;
+
+ case 1: // BDIR=0, BC1=1 (read PSG)
+ m_porta1 = m_ay1->data_r(space, 0);
+ break;
+
+ case 2: // BDIR=1, BC1=0 (write PSG)
+ m_ay1->data_w(space, 0, m_porta1);
+ break;
+
+ case 3: // BDIR=1, BC1=1 (latch)
+ m_ay1->address_w(space, 0, m_porta1);
+ break;
+ }
+ }
+ else
+ {
+ int chipSel;
+
+ if (m_PhasorNative)
+ {
+ chipSel = (~(data >> 3) & 3);
+ }
+ else
+ {
+ chipSel = 1;
+ }
+
+// printf("Phasor: %02x to AY1/2 CS %02x (BDIR/BC1 %02x, data %02x)\n", m_porta1, chipSel, data & 3, data);
+ switch (data & 3)
+ {
+ case 0: // BDIR=0, BC1=0 (inactive)
+ break;
+
+ case 1: // BDIR=0, BC1=1 (read PSG)
+ if (chipSel & 1)
+ {
+ m_porta1 = m_ay1->data_r(space, 0);
+ }
+ if (chipSel & 2)
+ {
+ m_porta1 = m_ay2->data_r(space, 0);
+ }
+ break;
+
+ case 2: // BDIR=1, BC1=0 (write PSG)
+ if (chipSel & 1)
+ {
+ m_ay1->data_w(space, 0, m_porta1);
+ }
+ if (chipSel & 2)
+ {
+ m_ay2->data_w(space, 0, m_porta1);
+ }
+ break;
+
+ case 3: // BDIR=1, BC1=1 (latch)
+ if (chipSel & 1)
+ {
+ m_ay1->address_w(space, 0, m_porta1);
+ }
+ if (chipSel & 2)
+ {
+ m_ay2->address_w(space, 0, m_porta1);
+ }
+ break;
+ }
+ }
+ }
+}
+
+WRITE8_MEMBER( a2bus_ayboard_device::via2_out_a )
+{
+ m_porta2 = data;
+}
+
+WRITE8_MEMBER( a2bus_ayboard_device::via2_out_b )
+{
+ if (!(data & 4))
+ {
+ if (m_isPhasor && m_PhasorNative)
+ {
+ m_ay3->reset_w(space, 0, 0);
+ m_ay4->reset_w(space, 0, 0);
+ }
+ else
+ {
+ m_ay2->reset_w(space, 0, 0);
+ }
+ }
+ else
+ {
+ if (!m_isPhasor)
+ {
+ switch (data & 3)
+ {
+ case 0: // BDIR=0, BC1=0 (inactive)
+ break;
+
+ case 1: // BDIR=0, BC1=1 (read PSG)
+ m_porta2 = m_ay2->data_r(space, 0);
+ break;
+
+ case 2: // BDIR=1, BC1=0 (write PSG)
+ m_ay2->data_w(space, 0, m_porta2);
+ break;
+
+ case 3: // BDIR=1, BC1=1 (latch)
+ m_ay2->address_w(space, 0, m_porta2);
+ break;
+ }
+ }
+ else
+ {
+ int chipSel;
+
+ if (m_PhasorNative)
+ {
+ chipSel = (~(data >> 3) & 3);
+ }
+ else
+ {
+ chipSel = 1;
+ }
+
+// printf("Phasor: %02x to AY3/4 CS %02x (BDIR/BC1 %02x, data %02x)\n", m_porta2, chipSel, data & 3, data);
+ switch (data & 3)
+ {
+ case 0: // BDIR=0, BC1=0 (inactive)
+ break;
+
+ case 1: // BDIR=0, BC1=1 (read PSG)
+ if (chipSel & 1)
+ {
+ m_porta2 = m_ay3->data_r(space, 0);
+ }
+ if (chipSel & 2)
+ {
+ m_porta2 = m_ay4->data_r(space, 0);
+ }
+ break;
+
+ case 2: // BDIR=1, BC1=0 (write PSG)
+ if (chipSel & 1)
+ {
+ m_ay3->data_w(space, 0, m_porta2);
+ }
+ if (chipSel & 2)
+ {
+ m_ay4->data_w(space, 0, m_porta2);
+ }
+ break;
+
+ case 3: // BDIR=1, BC1=1 (latch)
+ if (chipSel & 1)
+ {
+ m_ay3->address_w(space, 0, m_porta2);
+ }
+ if (chipSel & 2)
+ {
+ m_ay4->address_w(space, 0, m_porta2);
+ }
+ break;
+ }
+ }
+ }
+}
+
+UINT8 a2bus_ayboard_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ if (m_isPhasor)
+ {
+ m_PhasorNative = (offset & 1) ? true : false;
+ }
+
+ return 0xff;
+}
+
+void a2bus_ayboard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ if (m_isPhasor)
+ {
+ m_PhasorNative = (offset & 1) ? true : false;
+ }
+}
+
+UINT8 a2bus_echoplus_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset)
+ {
+ case 0:
+ return 0x1f | m_tms->status_r(space, 0);
+ }
+
+ return 0;
+}
+
+void a2bus_echoplus_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ switch (offset)
+ {
+ case 0:
+ m_tms->data_w(space, offset, data);
+ break;
+ }
+}
diff --git a/src/devices/bus/a2bus/a2mockingboard.h b/src/devices/bus/a2bus/a2mockingboard.h
new file mode 100644
index 00000000000..eb297bc9605
--- /dev/null
+++ b/src/devices/bus/a2bus/a2mockingboard.h
@@ -0,0 +1,97 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2mockingboard.h
+
+ Sweet Micro Systems Mockingboard and compatibles
+
+*********************************************************************/
+
+#ifndef __A2BUS_MOCKINGBOARD__
+#define __A2BUS_MOCKINGBOARD__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "machine/6522via.h"
+#include "sound/ay8910.h"
+#include "sound/tms5220.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_ayboard_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_ayboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ DECLARE_WRITE_LINE_MEMBER( via1_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( via2_irq_w );
+ DECLARE_WRITE8_MEMBER(via1_out_a);
+ DECLARE_WRITE8_MEMBER(via1_out_b);
+ DECLARE_WRITE8_MEMBER(via2_out_a);
+ DECLARE_WRITE8_MEMBER(via2_out_b);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+ virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data);
+
+ required_device<via6522_device> m_via1;
+ required_device<via6522_device> m_via2;
+ required_device<ay8913_device> m_ay1;
+ required_device<ay8913_device> m_ay2;
+ optional_device<ay8913_device> m_ay3;
+ optional_device<ay8913_device> m_ay4;
+
+ bool m_isPhasor, m_PhasorNative;
+
+private:
+ UINT8 m_porta1, m_porta2;
+};
+
+class a2bus_mockingboard_device : public a2bus_ayboard_device
+{
+public:
+ a2bus_mockingboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class a2bus_phasor_device : public a2bus_ayboard_device
+{
+public:
+ a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual machine_config_constructor device_mconfig_additions() const;
+};
+
+class a2bus_echoplus_device : public a2bus_ayboard_device
+{
+public:
+ a2bus_echoplus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+
+ required_device<tms5220_device> m_tms;
+
+ virtual machine_config_constructor device_mconfig_additions() const;
+};
+
+// device type definition
+extern const device_type A2BUS_MOCKINGBOARD;
+extern const device_type A2BUS_PHASOR;
+extern const device_type A2BUS_ECHOPLUS;
+
+#endif /* __A2BUS_MOCKINGBOARD__ */
diff --git a/src/devices/bus/a2bus/a2pic.c b/src/devices/bus/a2bus/a2pic.c
new file mode 100644
index 00000000000..daede92b119
--- /dev/null
+++ b/src/devices/bus/a2bus/a2pic.c
@@ -0,0 +1,290 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2pic.c
+
+ Apple II Parallel Interface Card (670-0021)
+
+*********************************************************************/
+
+#include "a2pic.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_PIC = &device_creator<a2bus_pic_device>;
+
+#define PIC_ROM_REGION "pic_rom"
+#define PIC_CENTRONICS_TAG "pic_ctx"
+
+MACHINE_CONFIG_FRAGMENT( pic )
+ MCFG_CENTRONICS_ADD(PIC_CENTRONICS_TAG, centronics_devices, "printer")
+ MCFG_CENTRONICS_DATA_INPUT_BUFFER("ctx_data_in")
+ MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(a2bus_pic_device, ack_w))
+
+ MCFG_DEVICE_ADD("ctx_data_in", INPUT_BUFFER, 0)
+ MCFG_CENTRONICS_OUTPUT_LATCH_ADD("ctx_data_out", PIC_CENTRONICS_TAG)
+MACHINE_CONFIG_END
+
+ROM_START( pic )
+ ROM_REGION(0x000200, PIC_ROM_REGION, 0)
+ ROM_LOAD( "341-0057.bin", 0x000000, 0x000200, CRC(0d2d84ee) SHA1(bfc5b863d37e59875a6159528eb0f2b6082063b5) )
+ROM_END
+
+static INPUT_PORTS_START( pic )
+ PORT_START("DSW1")
+ PORT_DIPNAME( 0x07, 0x00, "Strobe length (SW1-3)" )
+ PORT_DIPSETTING( 0x00, "1 microsecond" )
+ PORT_DIPSETTING( 0x01, "3 microseconds" )
+ PORT_DIPSETTING( 0x02, "5 microseconds" )
+ PORT_DIPSETTING( 0x03, "7 microseconds" )
+ PORT_DIPSETTING( 0x04, "9 microseconds" )
+ PORT_DIPSETTING( 0x05, "11 microseconds" )
+ PORT_DIPSETTING( 0x06, "13 microseconds" )
+ PORT_DIPSETTING( 0x07, "15 microseconds" )
+
+ PORT_DIPNAME( 0x08, 0x00, "Strobe polarity (SW4)" )
+ PORT_DIPSETTING( 0x00, "Positive" )
+ PORT_DIPSETTING( 0x08, "Negative" )
+
+ PORT_DIPNAME( 0x10, 0x00, "Acknowledge polarity (SW5)" )
+ PORT_DIPSETTING( 0x00, "Positive" )
+ PORT_DIPSETTING( 0x10, "Negative" )
+
+ PORT_DIPNAME( 0x20, 0x20, "Firmware (SW6)" )
+ PORT_DIPSETTING( 0x00, "Parallel Printer (341-0005)" )
+ PORT_DIPSETTING( 0x20, "Centronics (341-0019)" )
+
+ PORT_DIPNAME( 0x40, 0x00, "Use interrupts (SW7)" )
+ PORT_DIPSETTING( 0x00, "Off" )
+ PORT_DIPSETTING( 0x40, "On" )
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor a2bus_pic_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( pic );
+}
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_pic_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( pic );
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *a2bus_pic_device::device_rom_region() const
+{
+ return ROM_NAME( pic );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_pic_device::a2bus_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_PIC, "Apple Parallel Interface Card", tag, owner, clock, "a2pic", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_dsw1(*this, "DSW1"),
+ m_ctx(*this, PIC_CENTRONICS_TAG),
+ m_ctx_data_in(*this, "ctx_data_in"),
+ m_ctx_data_out(*this, "ctx_data_out"),
+ m_started(false)
+{
+}
+
+a2bus_pic_device::a2bus_pic_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_dsw1(*this, "DSW1"),
+ m_ctx(*this, PIC_CENTRONICS_TAG),
+ m_ctx_data_in(*this, "ctx_data_in"),
+ m_ctx_data_out(*this, "ctx_data_out"),
+ m_started(false)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_pic_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+
+ m_rom = device().machine().root_device().memregion(this->subtag(PIC_ROM_REGION).c_str())->base();
+
+ m_timer = timer_alloc(0, NULL);
+ m_timer->adjust(attotime::never);
+
+ save_item(NAME(m_ack));
+ save_item(NAME(m_irqenable));
+ save_item(NAME(m_autostrobe));
+}
+
+void a2bus_pic_device::device_reset()
+{
+ m_started = true;
+ m_ack = 0;
+ m_irqenable = false;
+ m_autostrobe = false;
+ lower_slot_irq();
+ m_timer->adjust(attotime::never);
+
+ // set initial state of the strobe line depending on the dipswitch
+ clear_strobe();
+}
+
+void a2bus_pic_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
+{
+ clear_strobe();
+
+ m_timer->adjust(attotime::never);
+}
+
+/*-------------------------------------------------
+ read_cnxx - called for reads from this card's cnxx space
+-------------------------------------------------*/
+
+UINT8 a2bus_pic_device::read_cnxx(address_space &space, UINT8 offset)
+{
+ m_autostrobe = true;
+
+ if (m_dsw1->read() & 0x20)
+ {
+ return m_rom[(offset&0xff) | 0x100];
+ }
+
+ return m_rom[(offset&0xff)];
+}
+
+/*-------------------------------------------------
+ read_c0nx - called for reads from this card's c0nx space
+-------------------------------------------------*/
+
+UINT8 a2bus_pic_device::read_c0nx(address_space &space, UINT8 offset)
+{
+ switch (offset)
+ {
+ case 3:
+ return m_ctx_data_in->read();
+
+ case 4:
+ return m_ack;
+
+ case 6: // does reading this really work?
+ m_irqenable = true;
+ break;
+
+ case 7:
+ m_irqenable = false;
+ m_autostrobe = false;
+ lower_slot_irq();
+ break;
+
+ }
+
+ return 0;
+}
+
+/*-------------------------------------------------
+ write_c0nx - called for writes to this card's c0nx space
+-------------------------------------------------*/
+
+void a2bus_pic_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ switch (offset)
+ {
+ case 0: // set data out and send a strobe
+ m_ctx_data_out->write(data);
+
+ if (m_autostrobe)
+ {
+ start_strobe();
+ }
+ break;
+
+ case 2: // send a strobe
+ start_strobe();
+ break;
+
+ case 6: // enable interrupt on ACK
+ m_irqenable = true;
+ break;
+
+ case 7: // disable and acknowledge IRQ, reset ACK flip-flop, disable autostrobe
+ m_irqenable = false;
+ m_autostrobe = false;
+ lower_slot_irq();
+ break;
+ }
+}
+
+WRITE_LINE_MEMBER( a2bus_pic_device::ack_w )
+{
+ if (m_started)
+ {
+ UINT8 dsw1 = m_dsw1->read();
+
+ if (dsw1 & 0x10) // negative polarity
+ {
+ m_ack = (state == ASSERT_LINE) ? 0x00 : 0x80;
+ }
+ else
+ {
+ m_ack = (state == ASSERT_LINE) ? 0x80 : 0x00;
+ }
+
+ m_ack |= 0x40; // set ACK flip-flop
+
+ if ((dsw1 & 0x40) && (m_irqenable))
+ {
+ raise_slot_irq();
+ }
+ }
+}
+
+void a2bus_pic_device::start_strobe()
+{
+ int usec = ((m_dsw1->read() & 7) * 2) + 1; // strobe length in microseconds
+
+ if (m_dsw1->read() & 0x8) // negative polarity
+ {
+ m_ctx->write_strobe(CLEAR_LINE);
+ }
+ else
+ {
+ m_ctx->write_strobe(ASSERT_LINE);
+ }
+
+ m_timer->adjust(attotime::from_usec(usec), 0, attotime::never);
+}
+
+void a2bus_pic_device::clear_strobe()
+{
+ if (m_dsw1->read() & 0x8) // negative polarity
+ {
+ m_ctx->write_strobe(ASSERT_LINE);
+ }
+ else
+ {
+ m_ctx->write_strobe(CLEAR_LINE);
+ }
+}
diff --git a/src/devices/bus/a2bus/a2pic.h b/src/devices/bus/a2bus/a2pic.h
new file mode 100644
index 00000000000..172ec603502
--- /dev/null
+++ b/src/devices/bus/a2bus/a2pic.h
@@ -0,0 +1,67 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2pic.h
+
+ Apple II Parallel Interface Card
+
+*********************************************************************/
+
+#ifndef __A2BUS_PIC__
+#define __A2BUS_PIC__
+
+#include "a2bus.h"
+#include "bus/centronics/ctronics.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_pic_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ a2bus_pic_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+ virtual ioport_constructor device_input_ports() const;
+
+ required_ioport m_dsw1;
+
+ DECLARE_WRITE_LINE_MEMBER( ack_w );
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
+
+ required_device<centronics_device> m_ctx;
+ required_device<input_buffer_device> m_ctx_data_in;
+ required_device<output_latch_device> m_ctx_data_out;
+
+ void start_strobe();
+ void clear_strobe();
+
+private:
+ UINT8 *m_rom;
+ bool m_started;
+ UINT8 m_ack;
+ bool m_irqenable;
+ bool m_autostrobe;
+ emu_timer *m_timer;
+};
+
+// device type definition
+extern const device_type A2BUS_PIC;
+
+#endif /* __A2BUS_PIC__ */
diff --git a/src/devices/bus/a2bus/a2sam.c b/src/devices/bus/a2bus/a2sam.c
new file mode 100644
index 00000000000..7cdabc64b74
--- /dev/null
+++ b/src/devices/bus/a2bus/a2sam.c
@@ -0,0 +1,87 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2sam.c
+
+ Implementation of the S.A.M. "Software Automated Mouth" card
+
+*********************************************************************/
+
+#include "a2sam.h"
+#include "includes/apple2.h"
+#include "sound/dac.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_SAM = &device_creator<a2bus_sam_device>;
+
+#define DAC_TAG "dac"
+
+MACHINE_CONFIG_FRAGMENT( a2sam )
+ MCFG_SPEAKER_STANDARD_MONO("samspkr")
+ MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "samspkr", 1.00)
+MACHINE_CONFIG_END
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor a2bus_sam_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( a2sam );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_sam_device::a2bus_sam_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_a2bus_card_interface(mconfig, *this),
+ m_dac(*this, DAC_TAG)
+{
+}
+
+a2bus_sam_device::a2bus_sam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, A2BUS_SAM, "Don't Ask Software SAM", tag, owner, clock, "a2sam", __FILE__),
+ device_a2bus_card_interface(mconfig, *this),
+ m_dac(*this, DAC_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_sam_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+}
+
+void a2bus_sam_device::device_reset()
+{
+}
+
+void a2bus_sam_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
+{
+ m_dac->write_unsigned8(data);
+}
+
+bool a2bus_sam_device::take_c800()
+{
+ return false;
+}
diff --git a/src/devices/bus/a2bus/a2sam.h b/src/devices/bus/a2bus/a2sam.h
new file mode 100644
index 00000000000..3c2076921ef
--- /dev/null
+++ b/src/devices/bus/a2bus/a2sam.h
@@ -0,0 +1,48 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2sam.h
+
+ Implementation of the S.A.M. "Software Automated Mouth" card
+
+*********************************************************************/
+
+#ifndef __A2BUS_SAM__
+#define __A2BUS_SAM__
+
+#include "emu.h"
+#include "a2bus.h"
+#include "sound/dac.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_sam_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_sam_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ a2bus_sam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ required_device<dac_device> m_dac;
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+ // overrides of standard a2bus slot functions
+ virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
+ virtual bool take_c800();
+};
+
+// device type definition
+extern const device_type A2BUS_SAM;
+
+#endif /* __A2BUS_SAM__ */
diff --git a/src/devices/bus/a2bus/a2scsi.c b/src/devices/bus/a2bus/a2scsi.c
new file mode 100644
index 00000000000..5e9fc865718
--- /dev/null
+++ b/src/devices/bus/a2bus/a2scsi.c
@@ -0,0 +1,323 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+/*********************************************************************
+
+ a2scsi.c
+
+ Implementation of the Apple II SCSI Card
+
+ Schematic at:
+ http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/SCSI%20Controllers/Apple%20II%20SCSI%20Card/Schematics/Rev.%20C%20SCSI%20Schematic%20-%20Updated%202-23-6.jpg
+
+
+ Notes:
+ C0n0-C0n7 = NCR5380 registers in normal order
+ C0n8 = pseudo-DMA read/write and DACK
+ C0n9 = DIP switches
+ C0na = RAM and ROM bank switching
+ C0nb = reset 5380
+ C0nc = set IIgs block mode
+ C0nd = set pseudo-DMA
+ C0ne = read DRQ status in bit 7
+
+ In IIgs block mode, any read from C800-CBFF window fetches
+ the next byte from the 5380's DMA port. This lets you use the
+ 65816 MVN/MVP operations to burst-transfer up to 1K at a time.
+ (Requires a cycle-by-cycle haltable 65816 core; don't install the
+ GS/OS driver right now to avoid this)
+
+ Pseudo-DMA works similarly to the Mac implementation; use C0n8
+ to read/write "DMA" bytes in that mode.
+
+*********************************************************************/
+
+#include "a2scsi.h"
+#include "includes/apple2.h"
+#include "machine/nscsi_cd.h"
+#include "machine/nscsi_hd.h"
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type A2BUS_SCSI = &device_creator<a2