summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2012-08-21 10:41:19 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2012-08-21 10:41:19 +0000
commit7285b359d259b2ae0fdf85096571c386ec8c991a (patch)
treea027aff57f1a255f9ec6cfd3b68cabe4b6683998 /src
parent67c425e90757876a6716b7867df30c0149912e74 (diff)
Merge of MESS sources (no whatsnew)
Diffstat (limited to 'src')
-rw-r--r--src/mess/audio/arcadia.c166
-rw-r--r--src/mess/audio/arcadia.h41
-rw-r--r--src/mess/audio/channelf.c152
-rw-r--r--src/mess/audio/dai.c139
-rw-r--r--src/mess/audio/dave.c837
-rw-r--r--src/mess/audio/dave.h57
-rw-r--r--src/mess/audio/gb.c775
-rw-r--r--src/mess/audio/gb.h6
-rw-r--r--src/mess/audio/gmaster.c86
-rw-r--r--src/mess/audio/lynx.c540
-rw-r--r--src/mess/audio/mac.c207
-rw-r--r--src/mess/audio/mea8000.c726
-rw-r--r--src/mess/audio/mea8000.h37
-rw-r--r--src/mess/audio/mos7360.c1143
-rw-r--r--src/mess/audio/mos7360.h213
-rw-r--r--src/mess/audio/socrates.c165
-rw-r--r--src/mess/audio/socrates.h15
-rw-r--r--src/mess/audio/spchroms.c111
-rw-r--r--src/mess/audio/spchroms.h15
-rw-r--r--src/mess/audio/special.c91
-rw-r--r--src/mess/audio/svision.c318
-rw-r--r--src/mess/audio/t6721.c300
-rw-r--r--src/mess/audio/t6721.h27
-rw-r--r--src/mess/audio/ted7360.c1505
-rw-r--r--src/mess/audio/ted7360.h92
-rw-r--r--src/mess/audio/tvc.c161
-rw-r--r--src/mess/audio/upd1771.c484
-rw-r--r--src/mess/audio/upd1771.h37
-rw-r--r--src/mess/audio/vboy.c488
-rw-r--r--src/mess/audio/vboy.h106
-rw-r--r--src/mess/audio/vc4000.c102
-rw-r--r--src/mess/audio/wswan.c268
-rw-r--r--src/mess/devices/appldriv.c336
-rw-r--r--src/mess/devices/appldriv.h74
-rw-r--r--src/mess/devices/kermit.c710
-rw-r--r--src/mess/devices/kermit.h36
-rw-r--r--src/mess/devices/microdrv.c204
-rw-r--r--src/mess/devices/microdrv.h103
-rw-r--r--src/mess/devices/sonydriv.c572
-rw-r--r--src/mess/devices/sonydriv.h70
-rw-r--r--src/mess/devices/xmodem.c368
-rw-r--r--src/mess/devices/xmodem.h37
-rw-r--r--src/mess/drivers/4004clk.c189
-rw-r--r--src/mess/drivers/68ksbc.c112
-rw-r--r--src/mess/drivers/a2600.c2307
-rw-r--r--src/mess/drivers/a3000.c97
-rw-r--r--src/mess/drivers/a310.c356
-rw-r--r--src/mess/drivers/a5105.c638
-rw-r--r--src/mess/drivers/a51xx.c176
-rw-r--r--src/mess/drivers/a6809.c176
-rw-r--r--src/mess/drivers/a7000.c836
-rw-r--r--src/mess/drivers/a7150.c78
-rw-r--r--src/mess/drivers/a7800.c352
-rw-r--r--src/mess/drivers/abc1600.c1995
-rw-r--r--src/mess/drivers/abc80.c864
-rw-r--r--src/mess/drivers/abc80x.c1606
-rw-r--r--src/mess/drivers/ac1.c215
-rw-r--r--src/mess/drivers/ace.c698
-rw-r--r--src/mess/drivers/acrnsys1.c233
-rw-r--r--src/mess/drivers/adam.c1811
-rw-r--r--src/mess/drivers/advision.c124
-rw-r--r--src/mess/drivers/aim65.c322
-rw-r--r--src/mess/drivers/aim65_40.c168
-rw-r--r--src/mess/drivers/alesis.c309
-rw-r--r--src/mess/drivers/alphatro.c476
-rw-r--r--src/mess/drivers/altair.c151
-rw-r--r--src/mess/drivers/ami1200.c415
-rw-r--r--src/mess/drivers/amico2k.c244
-rw-r--r--src/mess/drivers/amiga.c759
-rw-r--r--src/mess/drivers/amstr_pc.c511
-rw-r--r--src/mess/drivers/amstrad.c1183
-rw-r--r--src/mess/drivers/apexc.c905
-rw-r--r--src/mess/drivers/apf.c767
-rw-r--r--src/mess/drivers/apogee.c207
-rw-r--r--src/mess/drivers/apollo.c1380
-rw-r--r--src/mess/drivers/apple1.c343
-rw-r--r--src/mess/drivers/apple2.c1121
-rw-r--r--src/mess/drivers/apple2gs.c416
-rw-r--r--src/mess/drivers/apple3.c196
-rw-r--r--src/mess/drivers/applix.c239
-rw-r--r--src/mess/drivers/apricot.c416
-rw-r--r--src/mess/drivers/apricotf.c403
-rw-r--r--src/mess/drivers/apricotp.c657
-rw-r--r--src/mess/drivers/aquarius.c524
-rw-r--r--src/mess/drivers/arcadia.c900
-rw-r--r--src/mess/drivers/argo.c369
-rw-r--r--src/mess/drivers/astrocde.c395
-rw-r--r--src/mess/drivers/at.c1446
-rw-r--r--src/mess/drivers/atari400.c1501
-rw-r--r--src/mess/drivers/atarist.c3434
-rw-r--r--src/mess/drivers/atm.c236
-rw-r--r--src/mess/drivers/atom.c880
-rw-r--r--src/mess/drivers/avigo.c1039
-rw-r--r--src/mess/drivers/ax20.c139
-rw-r--r--src/mess/drivers/b16.c318
-rw-r--r--src/mess/drivers/b2m.c276
-rw-r--r--src/mess/drivers/babbage.c298
-rw-r--r--src/mess/drivers/basic52.c176
-rw-r--r--src/mess/drivers/bbc.c988
-rw-r--r--src/mess/drivers/bbcbc.c210
-rw-r--r--src/mess/drivers/bcs3.c508
-rw-r--r--src/mess/drivers/bebox.c209
-rw-r--r--src/mess/drivers/beehive.c323
-rw-r--r--src/mess/drivers/beta.c294
-rw-r--r--src/mess/drivers/bigbord2.c730
-rw-r--r--src/mess/drivers/bk.c270
-rw-r--r--src/mess/drivers/bmjr.c395
-rw-r--r--src/mess/drivers/bml3.c952
-rw-r--r--src/mess/drivers/bob85.c221
-rw-r--r--src/mess/drivers/bullet.c1255
-rw-r--r--src/mess/drivers/busicom.c254
-rw-r--r--src/mess/drivers/bw12.c840
-rw-r--r--src/mess/drivers/bw2.c719
-rw-r--r--src/mess/drivers/c10.c178
-rw-r--r--src/mess/drivers/c128.c1111
-rw-r--r--src/mess/drivers/c16.c668
-rw-r--r--src/mess/drivers/c64.c1798
-rw-r--r--src/mess/drivers/c64dtv.c68
-rw-r--r--src/mess/drivers/c65.c391
-rw-r--r--src/mess/drivers/c80.c275
-rw-r--r--src/mess/drivers/c900.c62
-rw-r--r--src/mess/drivers/camplynx.c555
-rw-r--r--src/mess/drivers/casloopy.c251
-rw-r--r--src/mess/drivers/cat.c496
-rw-r--r--src/mess/drivers/cbmb.c720
-rw-r--r--src/mess/drivers/ccs2422.c112
-rw-r--r--src/mess/drivers/ccs2810.c150
-rw-r--r--src/mess/drivers/cd2650.c295
-rw-r--r--src/mess/drivers/cfx9850.c258
-rw-r--r--src/mess/drivers/cgc7900.c499
-rw-r--r--src/mess/drivers/cgenie.c759
-rw-r--r--src/mess/drivers/channelf.c407
-rw-r--r--src/mess/drivers/chaos.c161
-rw-r--r--src/mess/drivers/chessmst.c299
-rw-r--r--src/mess/drivers/chesstrv.c251
-rw-r--r--src/mess/drivers/clcd.c335
-rw-r--r--src/mess/drivers/cm1800.c118
-rw-r--r--src/mess/drivers/coco12.c350
-rw-r--r--src/mess/drivers/coco3.c339
-rw-r--r--src/mess/drivers/codata.c94
-rw-r--r--src/mess/drivers/coleco.c414
-rw-r--r--src/mess/drivers/compis.c493
-rw-r--r--src/mess/drivers/comquest.c311
-rw-r--r--src/mess/drivers/comx35.c603
-rw-r--r--src/mess/drivers/concept.c333
-rw-r--r--src/mess/drivers/cortex.c105
-rw-r--r--src/mess/drivers/cosmicos.c633
-rw-r--r--src/mess/drivers/cp1.c114
-rw-r--r--src/mess/drivers/craft.c1017
-rw-r--r--src/mess/drivers/crvision.c1105
-rw-r--r--src/mess/drivers/csc.c346
-rw-r--r--src/mess/drivers/cvicny.c147
-rw-r--r--src/mess/drivers/cxhumax.c1103
-rw-r--r--src/mess/drivers/cybiko.c407
-rw-r--r--src/mess/drivers/czk80.c114
-rw-r--r--src/mess/drivers/d6800.c399
-rw-r--r--src/mess/drivers/d6809.c167
-rw-r--r--src/mess/drivers/dai.c260
-rw-r--r--src/mess/drivers/dc.c395
-rw-r--r--src/mess/drivers/dct11em.c81
-rw-r--r--src/mess/drivers/dectalk.c820
-rw-r--r--src/mess/drivers/dgn_beta.c382
-rw-r--r--src/mess/drivers/digel804.c712
-rw-r--r--src/mess/drivers/dim68k.c385
-rw-r--r--src/mess/drivers/dm7000.c367
-rw-r--r--src/mess/drivers/dms5000.c80
-rw-r--r--src/mess/drivers/dms86.c133
-rw-r--r--src/mess/drivers/dmv.c345
-rw-r--r--src/mess/drivers/dolphunk.c203
-rw-r--r--src/mess/drivers/dragon.c267
-rw-r--r--src/mess/drivers/dual68.c117
-rw-r--r--src/mess/drivers/eacc.c287
-rw-r--r--src/mess/drivers/ec65.c325
-rw-r--r--src/mess/drivers/einstein.c909
-rw-r--r--src/mess/drivers/electron.c206
-rw-r--r--src/mess/drivers/elekscmp.c152
-rw-r--r--src/mess/drivers/elf.c336
-rw-r--r--src/mess/drivers/elwro800.c644
-rw-r--r--src/mess/drivers/enterp.c549
-rw-r--r--src/mess/drivers/esq1.c349
-rw-r--r--src/mess/drivers/esq5505.c637
-rw-r--r--src/mess/drivers/et3400.c122
-rw-r--r--src/mess/drivers/eti660.c287
-rw-r--r--src/mess/drivers/ex800.c484
-rw-r--r--src/mess/drivers/exelv.c647
-rw-r--r--src/mess/drivers/exp85.c263
-rw-r--r--src/mess/drivers/fidelz80.c1447
-rw-r--r--src/mess/drivers/fk1.c504
-rw-r--r--src/mess/drivers/fm7.c2434
-rw-r--r--src/mess/drivers/fmtowns.c2892
-rw-r--r--src/mess/drivers/fp1100.c453
-rw-r--r--src/mess/drivers/fp6000.c342
-rw-r--r--src/mess/drivers/galaxy.c279
-rw-r--r--src/mess/drivers/galeb.c170
-rw-r--r--src/mess/drivers/gamecom.c157
-rw-r--r--src/mess/drivers/gamepock.c121
-rw-r--r--src/mess/drivers/gb.c742
-rw-r--r--src/mess/drivers/gba.c3216
-rw-r--r--src/mess/drivers/geneve.c807
-rw-r--r--src/mess/drivers/geniusiq.c476
-rw-r--r--src/mess/drivers/genpc.c301
-rw-r--r--src/mess/drivers/gizmondo.c255
-rw-r--r--src/mess/drivers/glasgow.c602
-rw-r--r--src/mess/drivers/gmaster.c261
-rw-r--r--src/mess/drivers/gp2x.c390
-rw-r--r--src/mess/drivers/gp32.c1786
-rw-r--r--src/mess/drivers/h19.c452
-rw-r--r--src/mess/drivers/h8.c256
-rw-r--r--src/mess/drivers/h89.c169
-rw-r--r--src/mess/drivers/hec2hrp.c807
-rw-r--r--src/mess/drivers/homelab.c913
-rw-r--r--src/mess/drivers/homez80.c315
-rw-r--r--src/mess/drivers/horizon.c122
-rw-r--r--src/mess/drivers/hp16500.c80
-rw-r--r--src/mess/drivers/hp48.c1035
-rw-r--r--src/mess/drivers/hp49gp.c352
-rw-r--r--src/mess/drivers/hp9k.c110
-rw-r--r--src/mess/drivers/hpz80unk.c159
-rw-r--r--src/mess/drivers/ht68k.c186
-rw-r--r--src/mess/drivers/huebler.c449
-rw-r--r--src/mess/drivers/hx20.c137
-rw-r--r--src/mess/drivers/ibmpc.c604
-rw-r--r--src/mess/drivers/if800.c119
-rw-r--r--src/mess/drivers/imds.c118
-rw-r--r--src/mess/drivers/indiana.c104
-rw-r--r--src/mess/drivers/instruct.c317
-rw-r--r--src/mess/drivers/interact.c327
-rw-r--r--src/mess/drivers/intv.c1014
-rw-r--r--src/mess/drivers/ip20.c627
-rw-r--r--src/mess/drivers/ip22.c1730
-rw-r--r--src/mess/drivers/ipc.c142
-rw-r--r--src/mess/drivers/ipds.c194
-rw-r--r--src/mess/drivers/iq151.c493
-rw-r--r--src/mess/drivers/irisha.c197
-rw-r--r--src/mess/drivers/isbc.c198
-rw-r--r--src/mess/drivers/itt3030.c154
-rw-r--r--src/mess/drivers/jr100.c410
-rw-r--r--src/mess/drivers/jr200.c574
-rw-r--r--src/mess/drivers/jtc.c763
-rw-r--r--src/mess/drivers/juicebox.c347
-rw-r--r--src/mess/drivers/junior.c261
-rw-r--r--src/mess/drivers/jupiter.c394
-rw-r--r--src/mess/drivers/k1003.c193
-rw-r--r--src/mess/drivers/k8915.c189
-rw-r--r--src/mess/drivers/kaypro.c423
-rw-r--r--src/mess/drivers/kc.c294
-rw-r--r--src/mess/drivers/kim1.c365
-rw-r--r--src/mess/drivers/konin.c109
-rw-r--r--src/mess/drivers/kramermc.c148
-rw-r--r--src/mess/drivers/kyocera.c1569
-rw-r--r--src/mess/drivers/lc80.c448
-rw-r--r--src/mess/drivers/lcmate2.c277
-rw-r--r--src/mess/drivers/lisa.c533
-rw-r--r--src/mess/drivers/llc.c290
-rw-r--r--src/mess/drivers/lviv.c485
-rw-r--r--src/mess/drivers/lx800.c296
-rw-r--r--src/mess/drivers/lynx.c193
-rw-r--r--src/mess/drivers/m20.c594
-rw-r--r--src/mess/drivers/m5.c779
-rw-r--r--src/mess/drivers/m79152pc.c142
-rw-r--r--src/mess/drivers/mac.c2174
-rw-r--r--src/mess/drivers/macpci.c175
-rw-r--r--src/mess/drivers/mbc200.c293
-rw-r--r--src/mess/drivers/mbc55x.c289
-rw-r--r--src/mess/drivers/mbee.c1148
-rw-r--r--src/mess/drivers/mc10.c626
-rw-r--r--src/mess/drivers/mc1000.c508
-rw-r--r--src/mess/drivers/mc80.c249
-rw-r--r--src/mess/drivers/mccpm.c153
-rw-r--r--src/mess/drivers/megadriv.c924
-rw-r--r--src/mess/drivers/mekd2.c372
-rw-r--r--src/mess/drivers/mephisto.c514
-rw-r--r--src/mess/drivers/mes.c141
-rw-r--r--src/mess/drivers/microdec.c151
-rw-r--r--src/mess/drivers/micronic.c406
-rw-r--r--src/mess/drivers/microtan.c287
-rw-r--r--src/mess/drivers/mikro80.c244
-rw-r--r--src/mess/drivers/mikromik.c860
-rw-r--r--src/mess/drivers/mikrosha.c254
-rw-r--r--src/mess/drivers/mini2440.c277
-rw-r--r--src/mess/drivers/mirage.c295
-rw-r--r--src/mess/drivers/mits680b.c118
-rw-r--r--src/mess/drivers/mk1.c213
-rw-r--r--src/mess/drivers/mk14.c168
-rw-r--r--src/mess/drivers/mk2.c229
-rw-r--r--src/mess/drivers/mk85.c91
-rw-r--r--src/mess/drivers/mk90.c101
-rw-r--r--src/mess/drivers/mmd1.c540
-rw-r--r--src/mess/drivers/mmodular.c1994
-rw-r--r--src/mess/drivers/mod8.c134
-rw-r--r--src/mess/drivers/mpf1.c487
-rw-r--r--src/mess/drivers/mpz80.c854
-rw-r--r--src/mess/drivers/ms0515.c291
-rw-r--r--src/mess/drivers/msbc1.c114
-rw-r--r--src/mess/drivers/mstation.c546
-rw-r--r--src/mess/drivers/msx.c4529
-rw-r--r--src/mess/drivers/mtx.c451
-rw-r--r--src/mess/drivers/multi16.c191
-rw-r--r--src/mess/drivers/multi8.c720
-rw-r--r--src/mess/drivers/myb3k.c303
-rw-r--r--src/mess/drivers/mycom.c633
-rw-r--r--src/mess/drivers/mz2000.c840
-rw-r--r--src/mess/drivers/mz2500.c2204
-rw-r--r--src/mess/drivers/mz6500.c209
-rw-r--r--src/mess/drivers/mz700.c439
-rw-r--r--src/mess/drivers/mz80.c370
-rw-r--r--src/mess/drivers/n64.c352
-rw-r--r--src/mess/drivers/nakajies.c836
-rw-r--r--src/mess/drivers/nanos.c571
-rw-r--r--src/mess/drivers/nascom1.c430
-rw-r--r--src/mess/drivers/nc.c1742
-rw-r--r--src/mess/drivers/nes.c618
-rw-r--r--src/mess/drivers/newbrain.c1548
-rw-r--r--src/mess/drivers/next.c1163
-rw-r--r--src/mess/drivers/ng_aes.c1788
-rw-r--r--src/mess/drivers/ngp.c862
-rw-r--r--src/mess/drivers/ob68k1a.c387
-rw-r--r--src/mess/drivers/odyssey2.c338
-rw-r--r--src/mess/drivers/okean240.c506
-rw-r--r--src/mess/drivers/ondra.c189
-rw-r--r--src/mess/drivers/orao.c220
-rw-r--r--src/mess/drivers/oric.c532
-rw-r--r--src/mess/drivers/orion.c366
-rw-r--r--src/mess/drivers/osbexec.c685
-rw-r--r--src/mess/drivers/osborne1.c301
-rw-r--r--src/mess/drivers/osi.c926
-rw-r--r--src/mess/drivers/p112.c123
-rw-r--r--src/mess/drivers/p2000t.c303
-rw-r--r--src/mess/drivers/p8k.c794
-rw-r--r--src/mess/drivers/palm.c511
-rw-r--r--src/mess/drivers/palm_dbg.c1192
-rw-r--r--src/mess/drivers/palmz22.c347
-rw-r--r--src/mess/drivers/partner.c246
-rw-r--r--src/mess/drivers/paso1600.c375
-rw-r--r--src/mess/drivers/pasogo.c555
-rw-r--r--src/mess/drivers/pasopia.c386
-rw-r--r--src/mess/drivers/pasopia7.c1167
-rw-r--r--src/mess/drivers/pb1000.c630
-rw-r--r--src/mess/drivers/pc.c2275
-rw-r--r--src/mess/drivers/pc100.c426
-rw-r--r--src/mess/drivers/pc1500.c317
-rw-r--r--src/mess/drivers/pc1512.c1504
-rw-r--r--src/mess/drivers/pc2000.c372
-rw-r--r--src/mess/drivers/pc4.c242
-rw-r--r--src/mess/drivers/pc6001.c2539
-rw-r--r--src/mess/drivers/pc8001.c652
-rw-r--r--src/mess/drivers/pc8401a.c695
-rw-r--r--src/mess/drivers/pc8801.c3042
-rw-r--r--src/mess/drivers/pc88va.c1762
-rw-r--r--src/mess/drivers/pc9801.c3062
-rw-r--r--src/mess/drivers/pce.c688
-rw-r--r--src/mess/drivers/pce220.c1048
-rw-r--r--src/mess/drivers/pcfx.c137
-rw-r--r--src/mess/drivers/pcm.c364
-rw-r--r--src/mess/drivers/pcw.c1457
-rw-r--r--src/mess/drivers/pcw16.c1541
-rw-r--r--src/mess/drivers/pda600.c240
-rw-r--r--src/mess/drivers/pdp1.c2001
-rw-r--r--src/mess/drivers/pdp11.c412
-rw-r--r--src/mess/drivers/pecom.c214
-rw-r--r--src/mess/drivers/pegasus.c578
-rw-r--r--src/mess/drivers/pentagon.c250
-rw-r--r--src/mess/drivers/pes.c295
-rw-r--r--src/mess/drivers/pet.c1163
-rw-r--r--src/mess/drivers/phc25.c411
-rw-r--r--src/mess/drivers/phunsy.c349
-rw-r--r--src/mess/drivers/pimps.c112
-rw-r--r--src/mess/drivers/pipbug.c187
-rw-r--r--src/mess/drivers/pk8000.c405
-rw-r--r--src/mess/drivers/pk8020.c302
-rw-r--r--src/mess/drivers/plan80.c252
-rw-r--r--src/mess/drivers/plus4.c1193
-rw-r--r--src/mess/drivers/pmd85.c717
-rw-r--r--src/mess/drivers/pmi80.c170
-rw-r--r--src/mess/drivers/pocketc.c1019
-rw-r--r--src/mess/drivers/pockstat.c1025
-rw-r--r--src/mess/drivers/pokemini.c111
-rw-r--r--src/mess/drivers/poly.c234
-rw-r--r--src/mess/drivers/poly88.c237
-rw-r--r--src/mess/drivers/poly880.c311
-rw-r--r--src/mess/drivers/portfoli.c921
-rw-r--r--src/mess/drivers/pp01.c257
-rw-r--r--src/mess/drivers/prestige.c520
-rw-r--r--src/mess/drivers/primo.c415
-rw-r--r--src/mess/drivers/pro80.c169
-rw-r--r--src/mess/drivers/prof180x.c320
-rw-r--r--src/mess/drivers/prof80.c684
-rw-r--r--src/mess/drivers/psion.c663
-rw-r--r--src/mess/drivers/psx.c956
-rw-r--r--src/mess/drivers/pt68k4.c91
-rw-r--r--src/mess/drivers/ptcsol.c772
-rw-r--r--src/mess/drivers/pv1000.c411
-rw-r--r--src/mess/drivers/pv2000.c452
-rw-r--r--src/mess/drivers/pv9234.c166
-rw-r--r--src/mess/drivers/px4.c1461
-rw-r--r--src/mess/drivers/px8.c876
-rw-r--r--src/mess/drivers/pyl601.c671
-rw-r--r--src/mess/drivers/ql.c1365
-rw-r--r--src/mess/drivers/qtsbc.c102
-rw-r--r--src/mess/drivers/qx10.c1065
-rw-r--r--src/mess/drivers/radio86.c541
-rw-r--r--src/mess/drivers/rainbow.c511
-rw-r--r--src/mess/drivers/rex6000.c728
-rw-r--r--src/mess/drivers/rm380z.c191
-rw-r--r--src/mess/drivers/rmnimbus.c390
-rw-r--r--src/mess/drivers/rt1715.c423
-rw-r--r--src/mess/drivers/rvoice.c403
-rw-r--r--src/mess/drivers/rx78.c529
-rw-r--r--src/mess/drivers/sacstate.c158
-rw-r--r--src/mess/drivers/sage2.c675
-rw-r--r--src/mess/drivers/samcoupe.c616
-rw-r--r--src/mess/drivers/sapi1.c273
-rw-r--r--src/mess/drivers/savia84.c206
-rw-r--r--src/mess/drivers/sbc6510.c294
-rw-r--r--src/mess/drivers/sc1.c208
-rw-r--r--src/mess/drivers/sc2.c245
-rw-r--r--src/mess/drivers/scorpion.c521
-rw-r--r--src/mess/drivers/scv.c885
-rw-r--r--src/mess/drivers/sdk85.c147
-rw-r--r--src/mess/drivers/sdk86.c174
-rw-r--r--src/mess/drivers/selz80.c171
-rw-r--r--src/mess/drivers/sg1000.c1277
-rw-r--r--src/mess/drivers/sgi_ip2.c567
-rw-r--r--src/mess/drivers/sgi_ip6.c271
-rw-r--r--src/mess/drivers/sitcom.c137
-rw-r--r--src/mess/drivers/slc1.c285
-rw-r--r--src/mess/drivers/sm1800.c224
-rw-r--r--src/mess/drivers/smc777.c1124
-rw-r--r--src/mess/drivers/sms.c756
-rw-r--r--src/mess/drivers/snes.c990
-rw-r--r--src/mess/drivers/socrates.c1061
-rw-r--r--src/mess/drivers/sorcerer.c521
-rw-r--r--src/mess/drivers/spc1000.c335
-rw-r--r--src/mess/drivers/spec128.c384
-rw-r--r--src/mess/drivers/special.c585
-rw-r--r--src/mess/drivers/specpls3.c505
-rw-r--r--src/mess/drivers/spectrum.c1051
-rw-r--r--src/mess/drivers/ssem.c661
-rw-r--r--src/mess/drivers/ssystem3.c350
-rw-r--r--src/mess/drivers/stopthie.c86
-rw-r--r--src/mess/drivers/studio2.c581
-rw-r--r--src/mess/drivers/sun1.c173
-rw-r--r--src/mess/drivers/sun2.c136
-rw-r--r--src/mess/drivers/sun3.c436
-rw-r--r--src/mess/drivers/sun4.c593
-rw-r--r--src/mess/drivers/super6.c616
-rw-r--r--src/mess/drivers/super80.c847
-rw-r--r--src/mess/drivers/supercon.c760
-rw-r--r--src/mess/drivers/supracan.c1942
-rw-r--r--src/mess/drivers/svi318.c579
-rw-r--r--src/mess/drivers/svision.c609
-rw-r--r--src/mess/drivers/swtpc.c135
-rw-r--r--src/mess/drivers/sym1.c169
-rw-r--r--src/mess/drivers/sys2900.c129
-rw-r--r--src/mess/drivers/systec.c124
-rw-r--r--src/mess/drivers/tandy2k.c784
-rw-r--r--src/mess/drivers/tdv2324.c495
-rw-r--r--src/mess/drivers/tec1.c427
-rw-r--r--src/mess/drivers/tek405x.c1401
-rw-r--r--src/mess/drivers/tek410x.c145
-rw-r--r--src/mess/drivers/terak.c119
-rw-r--r--src/mess/drivers/test_t400.c64
-rw-r--r--src/mess/drivers/thomson.c2330
-rw-r--r--src/mess/drivers/ti85.c787
-rw-r--r--src/mess/drivers/ti89.c668
-rw-r--r--src/mess/drivers/ti990_10.c308
-rw-r--r--src/mess/drivers/ti990_4.c353
-rw-r--r--src/mess/drivers/ti99_2.c425
-rw-r--r--src/mess/drivers/ti99_4p.c927
-rw-r--r--src/mess/drivers/ti99_4x.c1178
-rw-r--r--src/mess/drivers/ti99_8.c1082
-rw-r--r--src/mess/drivers/tiki100.c687
-rw-r--r--src/mess/drivers/tim011.c83
-rw-r--r--src/mess/drivers/timex.c724
-rw-r--r--src/mess/drivers/tk80bs.c462
-rw-r--r--src/mess/drivers/tm990189.c1021
-rw-r--r--src/mess/drivers/tmc1800.c921
-rw-r--r--src/mess/drivers/tmc2000e.c291
-rw-r--r--src/mess/drivers/tmc600.c332
-rw-r--r--src/mess/drivers/tricep.c96
-rw-r--r--src/mess/drivers/trs80.c923
-rw-r--r--src/mess/drivers/trs80m2.c1174
-rw-r--r--src/mess/drivers/tsispch.c524
-rw-r--r--src/mess/drivers/tutor.c814
-rw-r--r--src/mess/drivers/tvc.c784
-rw-r--r--src/mess/drivers/tx0.c1675
-rw-r--r--src/mess/drivers/uknc.c93
-rw-r--r--src/mess/drivers/unior.c351
-rw-r--r--src/mess/drivers/unistar.c104
-rw-r--r--src/mess/drivers/univac.c174
-rw-r--r--src/mess/drivers/unixpc.c247
-rw-r--r--src/mess/drivers/ut88.c255
-rw-r--r--src/mess/drivers/uzebox.c98
-rw-r--r--src/mess/drivers/v1050.c1155
-rw-r--r--src/mess/drivers/v6809.c290
-rw-r--r--src/mess/drivers/vax11.c179
-rw-r--r--src/mess/drivers/vboy.c1284
-rw-r--r--src/mess/drivers/vc4000.c833
-rw-r--r--src/mess/drivers/vcs80.c265
-rw-r--r--src/mess/drivers/vector06.c250
-rw-r--r--src/mess/drivers/vector4.c122
-rw-r--r--src/mess/drivers/vg5k.c434
-rw-r--r--src/mess/drivers/vic10.c664
-rw-r--r--src/mess/drivers/vic20.c989
-rw-r--r--src/mess/drivers/victor9k.c1004
-rw-r--r--src/mess/drivers/vidbrain.c630
-rw-r--r--src/mess/drivers/vii.c1223
-rw-r--r--src/mess/drivers/vip.c853
-rw-r--r--src/mess/drivers/vixen.c945
-rw-r--r--src/mess/drivers/vk100.c1140
-rw-r--r--src/mess/drivers/votrpss.c242
-rw-r--r--src/mess/drivers/votrtnt.c196
-rw-r--r--src/mess/drivers/vt100.c802
-rw-r--r--src/mess/drivers/vt220.c82
-rw-r--r--src/mess/drivers/vt240.c220
-rw-r--r--src/mess/drivers/vt320.c112
-rw-r--r--src/mess/drivers/vt520.c106
-rw-r--r--src/mess/drivers/vta2000.c187
-rw-r--r--src/mess/drivers/vtech1.c1107
-rw-r--r--src/mess/drivers/vtech2.c525
-rw-r--r--src/mess/drivers/wangpc.c1310
-rw-r--r--src/mess/drivers/wswan.c203
-rw-r--r--src/mess/drivers/x07.c1576
-rw-r--r--src/mess/drivers/x1.c2790
-rw-r--r--src/mess/drivers/x1twin.c641
-rw-r--r--src/mess/drivers/x68k.c2970
-rw-r--r--src/mess/drivers/xerox820.c1000
-rw-r--r--src/mess/drivers/xor100.c611
-rw-r--r--src/mess/drivers/z100.c830
-rw-r--r--src/mess/drivers/z1013.c493
-rw-r--r--src/mess/drivers/z80dev.c126
-rw-r--r--src/mess/drivers/z80ne.c631
-rw-r--r--src/mess/drivers/z88.c770
-rw-r--r--src/mess/drivers/z9001.c337
-rw-r--r--src/mess/drivers/zexall.c175
-rw-r--r--src/mess/drivers/zrt80.c327
-rw-r--r--src/mess/drivers/zsbc3.c127
-rw-r--r--src/mess/drivers/zx.c567
-rw-r--r--src/mess/formats/ace_ace.c114
-rw-r--r--src/mess/formats/ace_ace.h18
-rw-r--r--src/mess/formats/atom_atm.c76
-rw-r--r--src/mess/formats/atom_atm.h19
-rw-r--r--src/mess/formats/cbm_crt.c194
-rw-r--r--src/mess/formats/cbm_crt.h155
-rw-r--r--src/mess/formats/cbm_snqk.c184
-rw-r--r--src/mess/formats/cbm_snqk.h23
-rw-r--r--src/mess/formats/comx35_comx.c192
-rw-r--r--src/mess/formats/comx35_comx.h19
-rw-r--r--src/mess/formats/m65_snqk.c374
-rw-r--r--src/mess/formats/m65_snqk.h23
-rw-r--r--src/mess/formats/spec_snqk.c2579
-rw-r--r--src/mess/formats/spec_snqk.h183
-rw-r--r--src/mess/formats/studio2_st2.c87
-rw-r--r--src/mess/formats/studio2_st2.h18
-rw-r--r--src/mess/formats/timex_dck.c128
-rw-r--r--src/mess/formats/timex_dck.h33
-rw-r--r--src/mess/formats/trs_cmd.c91
-rw-r--r--src/mess/formats/trs_cmd.h19
-rw-r--r--src/mess/formats/z80bin.c208
-rw-r--r--src/mess/formats/z80bin.h20
-rw-r--r--src/mess/includes/a7800.h89
-rw-r--r--src/mess/includes/abc1600.h264
-rw-r--r--src/mess/includes/abc80.h155
-rw-r--r--src/mess/includes/abc80x.h335
-rw-r--r--src/mess/includes/ac1.h39
-rw-r--r--src/mess/includes/ace.h62
-rw-r--r--src/mess/includes/adam.h131
-rw-r--r--src/mess/includes/advision.h73
-rw-r--r--src/mess/includes/aim65.h73
-rw-r--r--src/mess/includes/aim65_40.h25
-rw-r--r--src/mess/includes/amstr_pc.h35
-rw-r--r--src/mess/includes/amstrad.h214
-rw-r--r--src/mess/includes/apollo.h325
-rw-r--r--src/mess/includes/apple1.h75
-rw-r--r--src/mess/includes/apple2.h287
-rw-r--r--src/mess/includes/apple2gs.h156
-rw-r--r--src/mess/includes/apple3.h82
-rw-r--r--src/mess/includes/apricotf.h83
-rw-r--r--src/mess/includes/apricotp.h110
-rw-r--r--src/mess/includes/aquarius.h46
-rw-r--r--src/mess/includes/arcadia.h90
-rw-r--r--src/mess/includes/at.h195
-rw-r--r--src/mess/includes/atarist.h394
-rw-r--r--src/mess/includes/atom.h104
-rw-r--r--src/mess/includes/avigo.h115
-rw-r--r--src/mess/includes/b2m.h68
-rw-r--r--src/mess/includes/bbc.h332
-rw-r--r--src/mess/includes/bebox.h83
-rw-r--r--src/mess/includes/beta.h54
-rw-r--r--src/mess/includes/bk.h51
-rw-r--r--src/mess/includes/bullet.h137
-rw-r--r--src/mess/includes/busicom.h38
-rw-r--r--src/mess/includes/bw12.h94
-rw-r--r--src/mess/includes/bw2.h98
-rw-r--r--src/mess/includes/c128.h109
-rw-r--r--src/mess/includes/c16.h83
-rw-r--r--src/mess/includes/c64.h183
-rw-r--r--src/mess/includes/c64_legacy.h128
-rw-r--r--src/mess/includes/c65.h88
-rw-r--r--src/mess/includes/c80.h49
-rw-r--r--src/mess/includes/cbm.h34
-rw-r--r--src/mess/includes/cbmb.h108
-rw-r--r--src/mess/includes/cgc7900.h96
-rw-r--r--src/mess/includes/cgenie.h134
-rw-r--r--src/mess/includes/channelf.h68
-rw-r--r--src/mess/includes/coco.h262
-rw-r--r--src/mess/includes/coco12.h62
-rw-r--r--src/mess/includes/coco3.h63
-rw-r--r--src/mess/includes/coleco.h48
-rw-r--r--src/mess/includes/compis.h202
-rw-r--r--src/mess/includes/comquest.h34
-rw-r--r--src/mess/includes/comx35.h110
-rw-r--r--src/mess/includes/concept.h70
-rw-r--r--src/mess/includes/corvushd.h182
-rw-r--r--src/mess/includes/cosmicos.h126
-rw-r--r--src/mess/includes/crvision.h97
-rw-r--r--src/mess/includes/cxhumax.h264
-rw-r--r--src/mess/includes/cybiko.h100
-rw-r--r--src/mess/includes/dai.h105
-rw-r--r--src/mess/includes/dgn_beta.h177
-rw-r--r--src/mess/includes/dgnalpha.h82
-rw-r--r--src/mess/includes/dm7000.h80
-rw-r--r--src/mess/includes/dragon.h62
-rw-r--r--src/mess/includes/einstein.h143
-rw-r--r--src/mess/includes/electron.h90
-rw-r--r--src/mess/includes/elf.h64
-rw-r--r--src/mess/includes/enterp.h41
-rw-r--r--src/mess/includes/eti660.h66
-rw-r--r--src/mess/includes/europc.h152
-rw-r--r--src/mess/includes/exp85.h39
-rw-r--r--src/mess/includes/fidelz80.h69
-rw-r--r--src/mess/includes/fm7.h255
-rw-r--r--src/mess/includes/fmtowns.h295
-rw-r--r--src/mess/includes/galaxy.h51
-rw-r--r--src/mess/includes/galeb.h30
-rw-r--r--src/mess/includes/gamecom.h261
-rw-r--r--src/mess/includes/gamepock.h41
-rw-r--r--src/mess/includes/gb.h288
-rw-r--r--src/mess/includes/gba.h246
-rw-r--r--src/mess/includes/genpc.h142
-rw-r--r--src/mess/includes/gmaster.h42
-rw-r--r--src/mess/includes/gp32.h167
-rw-r--r--src/mess/includes/hec2hrp.h180
-rw-r--r--src/mess/includes/hp48.h195
-rw-r--r--src/mess/includes/huebler.h49
-rw-r--r--src/mess/includes/intv.h156
-rw-r--r--src/mess/includes/irisha.h64
-rw-r--r--src/mess/includes/jtc.h88
-rw-r--r--src/mess/includes/jupiter.h57
-rw-r--r--src/mess/includes/kaypro.h109
-rw-r--r--src/mess/includes/kc.h191
-rw-r--r--src/mess/includes/kramermc.h37
-rw-r--r--src/mess/includes/kyocera.h208
-rw-r--r--src/mess/includes/lc80.h58
-rw-r--r--src/mess/includes/lisa.h185
-rw-r--r--src/mess/includes/llc.h73
-rw-r--r--src/mess/includes/lviv.h47
-rw-r--r--src/mess/includes/lynx.h271
-rw-r--r--src/mess/includes/m5.h75
-rw-r--r--src/mess/includes/mac.h483
-rw-r--r--src/mess/includes/macpci.h164
-rw-r--r--src/mess/includes/mbc55x.h228
-rw-r--r--src/mess/includes/mbee.h167
-rw-r--r--src/mess/includes/mc1000.h84
-rw-r--r--src/mess/includes/mc68328.h175
-rw-r--r--src/mess/includes/mc80.h85
-rw-r--r--src/mess/includes/micronic.h65
-rw-r--r--src/mess/includes/microtan.h75
-rw-r--r--src/mess/includes/mikro80.h48
-rw-r--r--src/mess/includes/mikromik.h123
-rw-r--r--src/mess/includes/mpf1.h60
-rw-r--r--src/mess/includes/mpz80.h103
-rw-r--r--src/mess/includes/msbc1.h20
-rw-r--r--src/mess/includes/msx.h149
-rw-r--r--src/mess/includes/msx_slot.h258
-rw-r--r--src/mess/includes/mtx.h82
-rw-r--r--src/mess/includes/mz700.h106
-rw-r--r--src/mess/includes/mz80.h75
-rw-r--r--src/mess/includes/nascom1.h75
-rw-r--r--src/mess/includes/nc.h103
-rw-r--r--src/mess/includes/nes.h287
-rw-r--r--src/mess/includes/newbrain.h226
-rw-r--r--src/mess/includes/next.h187
-rw-r--r--src/mess/includes/ob68k1a.h46
-rw-r--r--src/mess/includes/odyssey2.h147
-rw-r--r--src/mess/includes/ondra.h36
-rw-r--r--src/mess/includes/orao.h41
-rw-r--r--src/mess/includes/oric.h128
-rw-r--r--src/mess/includes/orion.h82
-rw-r--r--src/mess/includes/osborne1.h113
-rw-r--r--src/mess/includes/osi.h122
-rw-r--r--src/mess/includes/p2000t.h56
-rw-r--r--src/mess/includes/partner.h38
-rw-r--r--src/mess/includes/pc.h135
-rw-r--r--src/mess/includes/pc1251.h53
-rw-r--r--src/mess/includes/pc1350.h52
-rw-r--r--src/mess/includes/pc1401.h52
-rw-r--r--src/mess/includes/pc1403.h60
-rw-r--r--src/mess/includes/pc1512.h259
-rw-r--r--src/mess/includes/pc4.h67
-rw-r--r--src/mess/includes/pc8001.h82
-rw-r--r--src/mess/includes/pc8401a.h100
-rw-r--r--src/mess/includes/pce.h156
-rw-r--r--src/mess/includes/pcw.h109
-rw-r--r--src/mess/includes/pcw16.h108
-rw-r--r--src/mess/includes/pdp1.h273
-rw-r--r--src/mess/includes/pecom.h52
-rw-r--r--src/mess/includes/pes.h45
-rw-r--r--src/mess/includes/pet.h87
-rw-r--r--src/mess/includes/phc25.h54
-rw-r--r--src/mess/includes/pk8020.h61
-rw-r--r--src/mess/includes/plus4.h113
-rw-r--r--src/mess/includes/pmd85.h60
-rw-r--r--src/mess/includes/pocketc.h23
-rw-r--r--src/mess/includes/pokemini.h77
-rw-r--r--src/mess/includes/poly88.h53
-rw-r--r--src/mess/includes/poly880.h51
-rw-r--r--src/mess/includes/portfoli.h89
-rw-r--r--src/mess/includes/pp01.h46
-rw-r--r--src/mess/includes/primo.h51
-rw-r--r--src/mess/includes/prof180x.h39
-rw-r--r--src/mess/includes/prof80.h92
-rw-r--r--src/mess/includes/ps2.h17
-rw-r--r--src/mess/includes/psion.h92
-rw-r--r--src/mess/includes/px8.h82
-rw-r--r--src/mess/includes/ql.h138
-rw-r--r--src/mess/includes/radio86.h82
-rw-r--r--src/mess/includes/rm380z.h129
-rw-r--r--src/mess/includes/rmnimbus.h449
-rw-r--r--src/mess/includes/sage2.h88
-rw-r--r--src/mess/includes/samcoupe.h104
-rw-r--r--src/mess/includes/sapi1.h57
-rw-r--r--src/mess/includes/sg1000.h122
-rw-r--r--src/mess/includes/sms.h215
-rw-r--r--src/mess/includes/sorcerer.h99
-rw-r--r--src/mess/includes/special.h122
-rw-r--r--src/mess/includes/spectrum.h171
-rw-r--r--src/mess/includes/ssystem3.h64
-rw-r--r--src/mess/includes/studio2.h92
-rw-r--r--src/mess/includes/super6.h82
-rw-r--r--src/mess/includes/super80.h101
-rw-r--r--src/mess/includes/svi318.h99
-rw-r--r--src/mess/includes/svision.h71
-rw-r--r--src/mess/includes/sym1.h62
-rw-r--r--src/mess/includes/tandy1t.h28
-rw-r--r--src/mess/includes/tandy2k.h141
-rw-r--r--src/mess/includes/tdv2324.h86
-rw-r--r--src/mess/includes/tek405x.h146
-rw-r--r--src/mess/includes/thomson.h394
-rw-r--r--src/mess/includes/ti85.h121
-rw-r--r--src/mess/includes/ti89.h66
-rw-r--r--src/mess/includes/tiki100.h84
-rw-r--r--src/mess/includes/tmc1800.h177
-rw-r--r--src/mess/includes/tmc2000e.h71
-rw-r--r--src/mess/includes/tmc600.h75
-rw-r--r--src/mess/includes/trs80.h145
-rw-r--r--src/mess/includes/trs80m2.h137
-rw-r--r--src/mess/includes/tsispch.h49
-rw-r--r--src/mess/includes/tvc.h137
-rw-r--r--src/mess/includes/tx0.h277
-rw-r--r--src/mess/includes/ut88.h65
-rw-r--r--src/mess/includes/v1050.h167
-rw-r--r--src/mess/includes/vc4000.h113
-rw-r--r--src/mess/includes/vcs80.h41
-rw-r--r--src/mess/includes/vector06.h82
-rw-r--r--src/mess/includes/vic10.h84
-rw-r--r--src/mess/includes/vic20.h96
-rw-r--r--src/mess/includes/victor9k.h130
-rw-r--r--src/mess/includes/vidbrain.h87
-rw-r--r--src/mess/includes/vip.h113
-rw-r--r--src/mess/includes/vixen.h109
-rw-r--r--src/mess/includes/vtech2.h72
-rw-r--r--src/mess/includes/wangpc.h200
-rw-r--r--src/mess/includes/wswan.h178
-rw-r--r--src/mess/includes/x07.h262
-rw-r--r--src/mess/includes/x1.h221
-rw-r--r--src/mess/includes/x68k.h298
-rw-r--r--src/mess/includes/xerox820.h106
-rw-r--r--src/mess/includes/xor100.h71
-rw-r--r--src/mess/includes/z80ne.h122
-rw-r--r--src/mess/includes/z88.h96
-rw-r--r--src/mess/includes/zx.h75
-rw-r--r--src/mess/layout/4004clk.lay18
-rw-r--r--src/mess/layout/abc.lay114
-rw-r--r--src/mess/layout/abc1600.lay14
-rw-r--r--src/mess/layout/acrnsys1.lay58
-rw-r--r--src/mess/layout/aim65.lay100
-rw-r--r--src/mess/layout/aim65_40.lay145
-rw-r--r--src/mess/layout/amico2k.lay30
-rw-r--r--src/mess/layout/apollo.lay114
-rw-r--r--src/mess/layout/apollo_15i.lay119
-rw-r--r--src/mess/layout/apollo_dsp.lay74
-rw-r--r--src/mess/layout/apricotp.lay32
-rw-r--r--src/mess/layout/avigo.lay61
-rw-r--r--src/mess/layout/babbage.lay68
-rw-r--r--src/mess/layout/beta.lay49
-rw-r--r--src/mess/layout/bob85.lay39
-rw-r--r--src/mess/layout/borisdpl.lay35
-rw-r--r--src/mess/layout/c80.lay39
-rw-r--r--src/mess/layout/chessmst.lay351
-rw-r--r--src/mess/layout/chesstrv.lay23
-rw-r--r--src/mess/layout/coco3.lay14
-rw-r--r--src/mess/layout/cosmicos.lay139
-rw-r--r--src/mess/layout/cvicny.lay52
-rw-r--r--src/mess/layout/dectalk.lay16
-rw-r--r--src/mess/layout/digel804.lay222
-rw-r--r--src/mess/layout/dmv.lay115
-rw-r--r--src/mess/layout/dolphunk.lay42
-rw-r--r--src/mess/layout/eacc.lay134
-rw-r--r--src/mess/layout/elekscmp.lay45
-rw-r--r--src/mess/layout/elf2.lay37
-rw-r--r--src/mess/layout/esq1by22.lay95
-rw-r--r--src/mess/layout/esq2by40.lay269
-rw-r--r--src/mess/layout/et3400.lay39
-rw-r--r--src/mess/layout/ex800.lay14
-rw-r--r--src/mess/layout/fidelz80.lay62
-rw-r--r--src/mess/layout/glasgow.lay44
-rw-r--r--src/mess/layout/h8.lay95
-rw-r--r--src/mess/layout/instruct.lay53
-rw-r--r--src/mess/layout/junior.lay44
-rw-r--r--src/mess/layout/k1003.lay72
-rw-r--r--src/mess/layout/kim1.lay44
-rw-r--r--src/mess/layout/lc80.lay58
-rw-r--r--src/mess/layout/llc1.lay94
-rw-r--r--src/mess/layout/lx800.lay88
-rw-r--r--src/mess/layout/lynx.lay20
-rw-r--r--src/mess/layout/mac.lay13
-rw-r--r--src/mess/layout/mekd2.lay39
-rw-r--r--src/mess/layout/mephisto.lay62
-rw-r--r--src/mess/layout/mk1.lay42
-rw-r--r--src/mess/layout/mk14.lay45
-rw-r--r--src/mess/layout/mk2.lay64
-rw-r--r--src/mess/layout/mmd1.lay123
-rw-r--r--src/mess/layout/mmd2.lay204
-rw-r--r--src/mess/layout/mpf1.lay74
-rw-r--r--src/mess/layout/mpf1b.lay74
-rw-r--r--src/mess/layout/mpf1p.lay96
-rw-r--r--src/mess/layout/newbrain.lay65
-rw-r--r--src/mess/layout/pc1500.lay132
-rw-r--r--src/mess/layout/pc8500.lay13
-rw-r--r--src/mess/layout/pcw.lay23
-rw-r--r--src/mess/layout/pmi80.lay62
-rw-r--r--src/mess/layout/poly880.lay36
-rw-r--r--src/mess/layout/pro80.lay40
-rw-r--r--src/mess/layout/px4.lay30
-rw-r--r--src/mess/layout/px8.lay30
-rw-r--r--src/mess/layout/savia84.lay74
-rw-r--r--src/mess/layout/sc1.lay62
-rw-r--r--src/mess/layout/sc2.lay62
-rw-r--r--src/mess/layout/sdk85.lay39
-rw-r--r--src/mess/layout/sdk86.lay55
-rw-r--r--src/mess/layout/selz80.lay45
-rw-r--r--src/mess/layout/sitcom.lay63
-rw-r--r--src/mess/layout/slc1.lay53
-rw-r--r--src/mess/layout/sms1.lay62
-rw-r--r--src/mess/layout/stopthie.lay18
-rw-r--r--src/mess/layout/super80.lay36
-rw-r--r--src/mess/layout/supercon.lay18
-rw-r--r--src/mess/layout/svision.lay18
-rw-r--r--src/mess/layout/sym1.lay49
-rw-r--r--src/mess/layout/tec1.lay39
-rw-r--r--src/mess/layout/tk80.lay52
-rw-r--r--src/mess/layout/tm990189.lay78
-rw-r--r--src/mess/layout/tm990189v.lay146
-rw-r--r--src/mess/layout/unixpc.lay49
-rw-r--r--src/mess/layout/ut88mini.lay39
-rw-r--r--src/mess/layout/vboy.lay21
-rw-r--r--src/mess/layout/vcs80.lay39
-rw-r--r--src/mess/layout/vidbrain.lay8
-rw-r--r--src/mess/layout/vk100.lay110
-rw-r--r--src/mess/layout/votrpss.lay16
-rw-r--r--src/mess/layout/votrtnt.lay16
-rw-r--r--src/mess/layout/vsc.lay262
-rw-r--r--src/mess/layout/vt100.lay110
-rw-r--r--src/mess/layout/wswan.lay14
-rw-r--r--src/mess/layout/x68000.lay95
-rw-r--r--src/mess/layout/z80dev.lay40
-rw-r--r--src/mess/layout/z80ne.lay650
-rw-r--r--src/mess/layout/z80net.lay669
-rw-r--r--src/mess/layout/z80netb.lay59
-rw-r--r--src/mess/layout/z80netf.lay709
-rw-r--r--src/mess/machine/3c503.c308
-rw-r--r--src/mess/machine/3c503.h63
-rw-r--r--src/mess/machine/3c505.c1448
-rw-r--r--src/mess/machine/3c505.h297
-rw-r--r--src/mess/machine/64h156.c714
-rw-r--r--src/mess/machine/64h156.h204
-rw-r--r--src/mess/machine/6883sam.c427
-rw-r--r--src/mess/machine/6883sam.h229
-rw-r--r--src/mess/machine/74145.c178
-rw-r--r--src/mess/machine/74145.h83
-rw-r--r--src/mess/machine/8530scc.c675
-rw-r--r--src/mess/machine/8530scc.h101
-rw-r--r--src/mess/machine/990_dk.c881
-rw-r--r--src/mess/machine/990_dk.h10
-rw-r--r--src/mess/machine/990_hd.c1053
-rw-r--r--src/mess/machine/990_hd.h18
-rw-r--r--src/mess/machine/990_tap.c1093
-rw-r--r--src/mess/machine/990_tap.h25
-rw-r--r--src/mess/machine/a2alfam2.c112
-rw-r--r--src/mess/machine/a2alfam2.h48
-rw-r--r--src/mess/machine/a2bus.c285
-rw-r--r--src/mess/machine/a2bus.h166
-rw-r--r--src/mess/machine/a2cffa.c264
-rw-r--r--src/mess/machine/a2cffa.h83
-rw-r--r--src/mess/machine/a2diskii.c162
-rw-r--r--src/mess/machine/a2diskii.h65
-rw-r--r--src/mess/machine/a2eauxslot.c198
-rw-r--r--src/mess/machine/a2eauxslot.h144
-rw-r--r--src/mess/machine/a2echoii.c105
-rw-r--r--src/mess/machine/a2echoii.h47
-rw-r--r--src/mess/machine/a2lang.c117
-rw-r--r--src/mess/machine/a2lang.h43
-rw-r--r--src/mess/machine/a2memexp.c231
-rw-r--r--src/mess/machine/a2memexp.h71
-rw-r--r--src/mess/machine/a2mockingboard.c510
-rw-r--r--src/mess/machine/a2mockingboard.h85
-rw-r--r--src/mess/machine/a2sam.c88
-rw-r--r--src/mess/machine/a2sam.h47
-rw-r--r--src/mess/machine/a2scsi.c249
-rw-r--r--src/mess/machine/a2scsi.h57
-rw-r--r--src/mess/machine/a2softcard.c192
-rw-r--r--src/mess/machine/a2softcard.h54
-rw-r--r--src/mess/machine/a2ssc.c214
-rw-r--r--src/mess/machine/a2ssc.h53
-rw-r--r--src/mess/machine/a2swyft.c138
-rw-r--r--src/mess/machine/a2swyft.h47
-rw-r--r--src/mess/machine/a2themill.c345
-rw-r--r--src/mess/machine/a2themill.h57
-rw-r--r--src/mess/machine/a2thunderclock.c186
-rw-r--r--src/mess/machine/a2thunderclock.h56
-rw-r--r--src/mess/machine/a2videoterm.c376
-rw-r--r--src/mess/machine/a2videoterm.h108
-rw-r--r--src/mess/machine/a7800.c531
-rw-r--r--src/mess/machine/abc1600_bus.c564
-rw-r--r--src/mess/machine/abc1600_bus.h220
-rw-r--r--src/mess/machine/abc77.c667
-rw-r--r--src/mess/machine/abc77.h142
-rw-r--r--src/mess/machine/abc800kb.c518
-rw-r--r--src/mess/machine/abc800kb.h113
-rw-r--r--src/mess/machine/abc80kb.c228
-rw-r--r--src/mess/machine/abc80kb.h89
-rw-r--r--src/mess/machine/abc830.c143
-rw-r--r--src/mess/machine/abc830.h44
-rw-r--r--src/mess/machine/abc890.c305
-rw-r--r--src/mess/machine/abc890.h113
-rw-r--r--src/mess/machine/abc99.c858
-rw-r--r--src/mess/machine/abc99.h130
-rw-r--r--src/mess/machine/abc_dos.c143
-rw-r--r--src/mess/machine/abc_dos.h53
-rw-r--r--src/mess/machine/abc_fd2.c248
-rw-r--r--src/mess/machine/abc_fd2.h68
-rw-r--r--src/mess/machine/abc_hdc.c186
-rw-r--r--src/mess/machine/abc_hdc.h63
-rw-r--r--src/mess/machine/abc_sio.c196
-rw-r--r--src/mess/machine/abc_sio.h53
-rw-r--r--src/mess/machine/abc_slutprov.c77
-rw-r--r--src/mess/machine/abc_slutprov.h44
-rw-r--r--src/mess/machine/abc_turbo.c172
-rw-r--r--src/mess/machine/abc_turbo.h63
-rw-r--r--src/mess/machine/abc_uni800.c108
-rw-r--r--src/mess/machine/abc_uni800.h44
-rw-r--r--src/mess/machine/abc_xebec.c179
-rw-r--r--src/mess/machine/abc_xebec.h63
-rw-r--r--src/mess/machine/abcbus.c374
-rw-r--r--src/mess/machine/abcbus.h218
-rw-r--r--src/mess/machine/ac1.c121
-rw-r--r--src/mess/machine/advision.c176
-rw-r--r--src/mess/machine/aim65.c419
-rw-r--r--src/mess/machine/amigacd.c539
-rw-r--r--src/mess/machine/amigacd.h14
-rw-r--r--src/mess/machine/amigacrt.c463
-rw-r--r--src/mess/machine/amigacrt.h8
-rw-r--r--src/mess/machine/amigakbd.c254
-rw-r--r--src/mess/machine/amigakbd.h8
-rw-r--r--src/mess/machine/amstr_pc.c420
-rw-r--r--src/mess/machine/amstrad.c3307
-rw-r--r--src/mess/machine/ap2_lang.c122
-rw-r--r--src/mess/machine/ap2_lang.h35
-rw-r--r--src/mess/machine/ap2_slot.c233
-rw-r--r--src/mess/machine/ap2_slot.h85
-rw-r--r--src/mess/machine/apollo.c1475
-rw-r--r--src/mess/machine/apollo_dbg.c1185
-rw-r--r--src/mess/machine/apollo_eth.c355
-rw-r--r--src/mess/machine/apollo_kbd.c1182
-rw-r--r--src/mess/machine/apollo_kbd.h201
-rw-r--r--src/mess/machine/apollo_net.c890
-rw-r--r--src/mess/machine/apple1.c554
-rw-r--r--src/mess/machine/apple2.c1952
-rw-r--r--src/mess/machine/apple2gs.c2033
-rw-r--r--src/mess/machine/apple3.c738
-rw-r--r--src/mess/machine/applefdc.c863
-rw-r--r--src/mess/machine/applefdc.h93
-rw-r--r--src/mess/machine/apricotkb.c412
-rw-r--r--src/mess/machine/apricotkb.h97
-rw-r--r--src/mess/machine/at.c347
-rw-r--r--src/mess/machine/at29040a.c444
-rw-r--r--src/mess/machine/at29040a.h89
-rw-r--r--src/mess/machine/at45dbxx.c473
-rw-r--r--src/mess/machine/at45dbxx.h55
-rw-r--r--src/mess/machine/at_keybc.c229
-rw-r--r--src/mess/machine/at_keybc.h98
-rw-r--r--src/mess/machine/ataricrt.c718
-rw-r--r--src/mess/machine/ataridev.h55
-rw-r--r--src/mess/machine/atarifdc.c844
-rw-r--r--src/mess/machine/avr8.h297
-rw-r--r--src/mess/machine/ay31015.c746
-rw-r--r--src/mess/machine/ay31015.h108
-rw-r--r--src/mess/machine/ay3600.c629
-rw-r--r--src/mess/machine/ay3600.h20
-rw-r--r--src/mess/machine/b2m.c377
-rw-r--r--src/mess/machine/bbc.c2136
-rw-r--r--src/mess/machine/bebox.c1093
-rw-r--r--src/mess/machine/beta.c362
-rw-r--r--src/mess/machine/beta.h40
-rw-r--r--src/mess/machine/bk.c172
-rw-r--r--src/mess/machine/c128.c1307
-rw-r--r--src/mess/machine/c128_comal80.c101
-rw-r--r--src/mess/machine/c128_comal80.h53
-rw-r--r--src/mess/machine/c1541.c1030
-rw-r--r--src/mess/machine/c1541.h220
-rw-r--r--src/mess/machine/c1551.c574
-rw-r--r--src/mess/machine/c1551.h100
-rw-r--r--src/mess/machine/c1571.c881
-rw-r--r--src/mess/machine/c1571.h180
-rw-r--r--src/mess/machine/c1581.c503
-rw-r--r--src/mess/machine/c1581.h122
-rw-r--r--src/mess/machine/c16.c715
-rw-r--r--src/mess/machine/c2031.c502
-rw-r--r--src/mess/machine/c2031.h93
-rw-r--r--src/mess/machine/c2040.c1781
-rw-r--r--src/mess/machine/c2040.h235
-rw-r--r--src/mess/machine/c64.c2064
-rw-r--r--src/mess/machine/c64_16kb.c149
-rw-r--r--src/mess/machine/c64_16kb.h56
-rw-r--r--src/mess/machine/c64_4cga.c112
-rw-r--r--src/mess/machine/c64_4cga.h55
-rw-r--r--src/mess/machine/c64_4dxh.c109
-rw-r--r--src/mess/machine/c64_4dxh.h55
-rw-r--r--src/mess/machine/c64_4ksa.c109
-rw-r--r--src/mess/machine/c64_4ksa.h55
-rw-r--r--src/mess/machine/c64_4tba.c109
-rw-r--r--src/mess/machine/c64_4tba.h55
-rw-r--r--src/mess/machine/c64_bn1541.c160
-rw-r--r--src/mess/machine/c64_bn1541.h74
-rw-r--r--src/mess/machine/c64_comal80.c89
-rw-r--r--src/mess/machine/c64_comal80.h53
-rw-r--r--src/mess/machine/c64_cpm.c231
-rw-r--r--src/mess/machine/c64_cpm.h69
-rw-r--r--src/mess/machine/c64_currah_speech.c271
-rw-r--r--src/mess/machine/c64_currah_speech.h60
-rw-r--r--src/mess/machine/c64_dela_ep256.c179
-rw-r--r--src/mess/machine/c64_dela_ep256.h62
-rw-r--r--src/mess/machine/c64_dela_ep64.c170
-rw-r--r--src/mess/machine/c64_dela_ep64.h65
-rw-r--r--src/mess/machine/c64_dela_ep7x8.c157
-rw-r--r--src/mess/machine/c64_dela_ep7x8.h61
-rw-r--r--src/mess/machine/c64_dinamic.c77
-rw-r--r--src/mess/machine/c64_dinamic.h52
-rw-r--r--src/mess/machine/c64_dqbb.c124
-rw-r--r--src/mess/machine/c64_dqbb.h61
-rw-r--r--src/mess/machine/c64_easy_calc_result.c110
-rw-r--r--src/mess/machine/c64_easy_calc_result.h53
-rw-r--r--src/mess/machine/c64_easyflash.c239
-rw-r--r--src/mess/machine/c64_easyflash.h66
-rw-r--r--src/mess/machine/c64_epyx_fast_load.c119
-rw-r--r--src/mess/machine/c64_epyx_fast_load.h54
-rw-r--r--src/mess/machine/c64_exos.c70
-rw-r--r--src/mess/machine/c64_exos.h49
-rw-r--r--src/mess/machine/c64_final.c138
-rw-r--r--src/mess/machine/c64_final.h56
-rw-r--r--src/mess/machine/c64_final3.c154
-rw-r--r--src/mess/machine/c64_final3.h60
-rw-r--r--src/mess/machine/c64_fun_play.c101
-rw-r--r--src/mess/machine/c64_fun_play.h53
-rw-r--r--src/mess/machine/c64_geocable.c109
-rw-r--r--src/mess/machine/c64_geocable.h59
-rw-r--r--src/mess/machine/c64_georam.c101
-rw-r--r--src/mess/machine/c64_georam.h53
-rw-r--r--src/mess/machine/c64_ide64.c325
-rw-r--r--src/mess/machine/c64_ide64.h68
-rw-r--r--src/mess/machine/c64_ieee488.c322
-rw-r--r--src/mess/machine/c64_ieee488.h78
-rw-r--r--src/mess/machine/c64_kingsoft.c101
-rw-r--r--src/mess/machine/c64_kingsoft.h51
-rw-r--r--src/mess/machine/c64_mach5.c87
-rw-r--r--src/mess/machine/c64_mach5.h50
-rw-r--r--src/mess/machine/c64_magic_desk.c88
-rw-r--r--src/mess/machine/c64_magic_desk.h53
-rw-r--r--src/mess/machine/c64_magic_formel.c277
-rw-r--r--src/mess/machine/c64_magic_formel.h74
-rw-r--r--src/mess/machine/c64_mikro_assembler.c60
-rw-r--r--src/mess/machine/c64_mikro_assembler.h48
-rw-r--r--src/mess/machine/c64_multiscreen.c265
-rw-r--r--src/mess/machine/c64_multiscreen.h59
-rw-r--r--src/mess/machine/c64_neoram.c102
-rw-r--r--src/mess/machine/c64_neoram.h59
-rw-r--r--src/mess/machine/c64_ocean.c117
-rw-r--r--src/mess/machine/c64_ocean.h53
-rw-r--r--src/mess/machine/c64_pagefox.c136
-rw-r--r--src/mess/machine/c64_pagefox.h53
-rw-r--r--src/mess/machine/c64_prophet64.c87
-rw-r--r--src/mess/machine/c64_prophet64.h53
-rw-r--r--src/mess/machine/c64_ps64.c160
-rw-r--r--src/mess/machine/c64_ps64.h54
-rw-r--r--src/mess/machine/c64_rex.c81
-rw-r--r--src/mess/machine/c64_rex.h49
-rw-r--r--src/mess/machine/c64_rex_ep256.c188
-rw-r--r--src/mess/machine/c64_rex_ep256.h62
-rw-r--r--src/mess/machine/c64_ross.c95
-rw-r--r--src/mess/machine/c64_ross.h55
-rw-r--r--src/mess/machine/c64_sfx_sound_expander.c300
-rw-r--r--src/mess/machine/c64_sfx_sound_expander.h70
-rw-r--r--src/mess/machine/c64_silverrock.c135
-rw-r--r--src/mess/machine/c64_silverrock.h53
-rw-r--r--src/mess/machine/c64_simons_basic.c87
-rw-r--r--src/mess/machine/c64_simons_basic.h50
-rw-r--r--src/mess/machine/c64_stardos.c197
-rw-r--r--src/mess/machine/c64_stardos.h63
-rw-r--r--src/mess/machine/c64_std.c71
-rw-r--r--src/mess/machine/c64_std.h49
-rw-r--r--src/mess/machine/c64_structured_basic.c106
-rw-r--r--src/mess/machine/c64_structured_basic.h55
-rw-r--r--src/mess/machine/c64_super_explode.c128
-rw-r--r--src/mess/machine/c64_super_explode.h56
-rw-r--r--src/mess/machine/c64_super_games.c105
-rw-r--r--src/mess/machine/c64_super_games.h53
-rw-r--r--src/mess/machine/c64_sw8k.c116
-rw-r--r--src/mess/machine/c64_sw8k.h55
-rw-r--r--src/mess/machine/c64_system3.c86
-rw-r--r--src/mess/machine/c64_system3.h53
-rw-r--r--src/mess/machine/c64_tdos.c256
-rw-r--r--src/mess/machine/c64_tdos.h70
-rw-r--r--src/mess/machine/c64_vw64.c130
-rw-r--r--src/mess/machine/c64_vw64.h54
-rw-r--r--src/mess/machine/c64_warp_speed.c160
-rw-r--r--src/mess/machine/c64_warp_speed.h58
-rw-r--r--src/mess/machine/c64_westermann.c85
-rw-r--r--src/mess/machine/c64_westermann.h49
-rw-r--r--src/mess/machine/c64_xl80.c257
-rw-r--r--src/mess/machine/c64_xl80.h65
-rw-r--r--src/mess/machine/c64_zaxxon.c69
-rw-r--r--src/mess/machine/c64_zaxxon.h51
-rw-r--r--src/mess/machine/c64exp.c476
-rw-r--r--src/mess/machine/c64exp.h202
-rw-r--r--src/mess/machine/c64user.c141
-rw-r--r--src/mess/machine/c64user.h156
-rw-r--r--src/mess/machine/c65.c1068
-rw-r--r--src/mess/machine/c8280.c451
-rw-r--r--src/mess/machine/c8280.h82
-rw-r--r--src/mess/machine/cbm.c359
-rw-r--r--src/mess/machine/cbmb.c504
-rw-r--r--src/mess/machine/cbmiec.c659
-rw-r--r--src/mess/machine/cbmiec.h197
-rw-r--r--src/mess/machine/cbmipt.c1236
-rw-r--r--src/mess/machine/cbmipt.h165
-rw-r--r--src/mess/machine/cgenie.c620
-rw-r--r--src/mess/machine/cmdhd.c226
-rw-r--r--src/mess/machine/cmdhd.h73
-rw-r--r--src/mess/machine/cntr_covox.c112
-rw-r--r--src/mess/machine/cntr_covox.h62
-rw-r--r--src/mess/machine/coco.c1438
-rw-r--r--src/mess/machine/coco12.c158
-rw-r--r--src/mess/machine/coco3.c181
-rw-r--r--src/mess/machine/coco_232.c89
-rw-r--r--src/mess/machine/coco_232.h41
-rw-r--r--src/mess/machine/coco_fdc.c733
-rw-r--r--src/mess/machine/coco_fdc.h162
-rw-r--r--src/mess/machine/coco_multi.c266
-rw-r--r--src/mess/machine/coco_multi.h65
-rw-r--r--src/mess/machine/coco_orch90.c83
-rw-r--r--src/mess/machine/coco_orch90.h41
-rw-r--r--src/mess/machine/coco_pak.c199
-rw-r--r--src/mess/machine/coco_pak.h65
-rw-r--r--src/mess/machine/coco_vhd.c280
-rw-r--r--src/mess/machine/coco_vhd.h73
-rw-r--r--src/mess/machine/cococart.c477
-rw-r--r--src/mess/machine/cococart.h174
-rw-r--r--src/mess/machine/coleco.c267
-rw-r--r--src/mess/machine/coleco.h11
-rw-r--r--src/mess/machine/compis.c1404
-rw-r--r--src/mess/machine/comx_clm.c295
-rw-r--r--src/mess/machine/comx_clm.h68
-rw-r--r--src/mess/machine/comx_eb.c405
-rw-r--r--src/mess/machine/comx_eb.h86
-rw-r--r--src/mess/machine/comx_epr.c123
-rw-r--r--src/mess/machine/comx_epr.h58
-rw-r--r--src/mess/machine/comx_fd.c332
-rw-r--r--src/mess/machine/comx_fd.h82
-rw-r--r--src/mess/machine/comx_joy.c113
-rw-r--r--src/mess/machine/comx_joy.h52
-rw-r--r--src/mess/machine/comx_prn.c143
-rw-r--r--src/mess/machine/comx_prn.h57
-rw-r--r--src/mess/machine/comx_ram.c106
-rw-r--r--src/mess/machine/comx_ram.h55
-rw-r--r--src/mess/machine/comx_thm.c128
-rw-r--r--src/mess/machine/comx_thm.h57
-rw-r--r--src/mess/machine/comxexp.c228
-rw-r--r--src/mess/machine/comxexp.h163
-rw-r--r--src/mess/machine/comxpl80.c347
-rw-r--r--src/mess/machine/comxpl80.h98
-rw-r--r--src/mess/machine/concept.c728
-rw-r--r--src/mess/machine/corvushd.c1708
-rw-r--r--src/mess/machine/cpc_rom.c137
-rw-r--r--src/mess/machine/cpc_rom.h90
-rw-r--r--src/mess/machine/cpc_ssa1.c227
-rw-r--r--src/mess/machine/cpc_ssa1.h128
-rw-r--r--src/mess/machine/cpcexp.c109
-rw-r--r--src/mess/machine/cpcexp.h131
-rw-r--r--src/mess/machine/cs4031.c333
-rw-r--r--src/mess/machine/cs4031.h95
-rw-r--r--src/mess/machine/cs8221.c165
-rw-r--r--src/mess/machine/cs8221.h86
-rw-r--r--src/mess/machine/cuda.c563
-rw-r--r--src/mess/machine/cuda.h126
-rw-r--r--src/mess/machine/cybiko.c674
-rw-r--r--src/mess/machine/d9060.c601
-rw-r--r--src/mess/machine/d9060.h134
-rw-r--r--src/mess/machine/dai.c254
-rw-r--r--src/mess/machine/dccons.c709
-rw-r--r--src/mess/machine/dec_lk201.c264
-rw-r--r--src/mess/machine/dec_lk201.h68
-rw-r--r--src/mess/machine/dgn_beta.c1317
-rw-r--r--src/mess/machine/dgnalpha.c440
-rw-r--r--src/mess/machine/docg3.c828
-rw-r--r--src/mess/machine/docg3.h103
-rw-r--r--src/mess/machine/dp8390.c479
-rw-r--r--src/mess/machine/dp8390.h132
-rw-r--r--src/mess/machine/dragon.c175
-rw-r--r--src/mess/machine/ds1315.c268
-rw-r--r--src/mess/machine/ds1315.h42
-rw-r--r--src/mess/machine/e01.c824
-rw-r--r--src/mess/machine/e01.h129
-rw-r--r--src/mess/machine/e05a03.c242
-rw-r--r--src/mess/machine/e05a03.h54
-rw-r--r--src/mess/machine/ecb_grip.c947
-rw-r--r--src/mess/machine/ecb_grip.h125
-rw-r--r--src/mess/machine/ecbbus.c286
-rw-r--r--src/mess/machine/ecbbus.h163
-rw-r--r--src/mess/machine/econet.c355
-rw-r--r--src/mess/machine/econet.h175
-rw-r--r--src/mess/machine/egret.c477
-rw-r--r--src/mess/machine/egret.h117
-rw-r--r--src/mess/machine/einstein.c199
-rw-r--r--src/mess/machine/electron.c354
-rw-r--r--src/mess/machine/er59256.c252
-rw-r--r--src/mess/machine/er59256.h93
-rw-r--r--src/mess/machine/esqvfd.c358
-rw-r--r--src/mess/machine/esqvfd.h97
-rw-r--r--src/mess/machine/europc.c365
-rw-r--r--src/mess/machine/fd2000.c229
-rw-r--r--src/mess/machine/fd2000.h74
-rw-r--r--src/mess/machine/fm_scsi.c446
-rw-r--r--src/mess/machine/fm_scsi.h107
-rw-r--r--src/mess/machine/galaxy.c214
-rw-r--r--src/mess/machine/gamecom.c637
-rw-r--r--src/mess/machine/gamepock.c226
-rw-r--r--src/mess/machine/gb.c2237
-rw-r--r--src/mess/machine/genpc.c861
-rw-r--r--src/mess/machine/hd63450.c488
-rw-r--r--src/mess/machine/hd63450.h34
-rw-r--r--src/mess/machine/hd64610.c375
-rw-r--r--src/mess/machine/hd64610.h114
-rw-r--r--src/mess/machine/hec2hrp.c899
-rw-r--r--src/mess/machine/hecdisk2.c327
-rw-r--r--src/mess/machine/hp48.c1238
-rw-r--r--src/mess/machine/i82371ab.c263
-rw-r--r--src/mess/machine/i82371ab.h52
-rw-r--r--src/mess/machine/i82371sb.c185
-rw-r--r--src/mess/machine/i82371sb.h49
-rw-r--r--src/mess/machine/i82439tx.c331
-rw-r--r--src/mess/machine/i82439tx.h56
-rw-r--r--src/mess/machine/i8271.c1600
-rw-r--r--src/mess/machine/i8271.h48
-rw-r--r--src/mess/machine/ieee488.c685
-rw-r--r--src/mess/machine/ieee488.h226
-rw-r--r--src/mess/machine/interpod.c267
-rw-r--r--src/mess/machine/interpod.h84
-rw-r--r--src/mess/machine/intv.c853
-rw-r--r--src/mess/machine/iq151_disc2.c149
-rw-r--r--src/mess/machine/iq151_disc2.h51
-rw-r--r--src/mess/machine/iq151_minigraf.c165
-rw-r--r--src/mess/machine/iq151_minigraf.h55
-rw-r--r--src/mess/machine/iq151_ms151a.c165
-rw-r--r--src/mess/machine/iq151_ms151a.h55
-rw-r--r--src/mess/machine/iq151_rom.c227
-rw-r--r--src/mess/machine/iq151_rom.h143
-rw-r--r--src/mess/machine/iq151_staper.c149
-rw-r--r--src/mess/machine/iq151_staper.h58
-rw-r--r--src/mess/machine/iq151cart.c220
-rw-r--r--src/mess/machine/iq151cart.h147
-rw-r--r--src/mess/machine/irisha.c155
-rw-r--r--src/mess/machine/isa.c636
-rw-r--r--src/mess/machine/isa.h347
-rw-r--r--src/mess/machine/isa_adlib.c91
-rw-r--r--src/mess/machine/isa_adlib.h38
-rw-r--r--src/mess/machine/isa_aha1542.c210
-rw-r--r--src/mess/machine/isa_aha1542.h61
-rw-r--r--src/mess/machine/isa_com.c192
-rw-r--r--src/mess/machine/isa_com.h58
-rw-r--r--src/mess/machine/isa_fdc.c485
-rw-r--r--src/mess/machine/isa_fdc.h83
-rw-r--r--src/mess/machine/isa_finalchs.c127
-rw-r--r--src/mess/machine/isa_finalchs.h41
-rw-r--r--src/mess/machine/isa_gblaster.c89
-rw-r--r--src/mess/machine/isa_gblaster.h38
-rw-r--r--src/mess/machine/isa_gus.c1704
-rw-r--r--src/mess/machine/isa_gus.h284
-rw-r--r--src/mess/machine/isa_hdc.c828
-rw-r--r--src/mess/machine/isa_hdc.h102
-rw-r--r--src/mess/machine/isa_ibm_mfc.c537
-rw-r--r--src/mess/machine/isa_ibm_mfc.h97
-rw-r--r--src/mess/machine/isa_ide.c118
-rw-r--r--src/mess/machine/isa_ide.h42
-rw-r--r--src/mess/machine/isa_ide_cd.c464
-rw-r--r--src/mess/machine/isa_ide_cd.h93
-rw-r--r--src/mess/machine/isa_mpu401.c105
-rw-r--r--src/mess/machine/isa_mpu401.h39
-rw-r--r--src/mess/machine/isa_sblaster.c616
-rw-r--r--src/mess/machine/isa_sblaster.h115
-rw-r--r--src/mess/machine/isa_wdxt_gen.c398
-rw-r--r--src/mess/machine/isa_wdxt_gen.h87
-rw-r--r--src/mess/machine/jupiter.c119
-rw-r--r--src/mess/machine/k7659kb.c312
-rw-r--r--src/mess/machine/k7659kb.h77
-rw-r--r--src/mess/machine/kay_kbd.c517
-rw-r--r--src/mess/machine/kaypro.c391
-rw-r--r--src/mess/machine/kb3600.c178
-rw-r--r--src/mess/machine/kb3600.h144
-rw-r--r--src/mess/machine/kb_7007_3.h121
-rw-r--r--src/mess/machine/kb_keytro.c651
-rw-r--r--src/mess/machine/kb_keytro.h75
-rw-r--r--src/mess/machine/kb_msnat.c435
-rw-r--r--src/mess/machine/kb_msnat.h57
-rw-r--r--src/mess/machine/kc.c802
-rw-r--r--src/mess/machine/kc_d002.c210
-rw-r--r--src/mess/machine/kc_d002.h59
-rw-r--r--src/mess/machine/kc_d004.c530
-rw-r--r--src/mess/machine/kc_d004.h113
-rw-r--r--src/mess/machine/kc_keyb.c633
-rw-r--r--src/mess/machine/kc_keyb.h76
-rw-r--r--src/mess/machine/kc_ram.c447
-rw-r--r--src/mess/machine/kc_ram.h188
-rw-r--r--src/mess/machine/kc_rom.c228
-rw-r--r--src/mess/machine/kc_rom.h101
-rw-r--r--src/mess/machine/kcexp.c394
-rw-r--r--src/mess/machine/kcexp.h137
-rw-r--r--src/mess/machine/keyboard.c461
-rw-r--r--src/mess/machine/keyboard.h101
-rw-r--r--src/mess/machine/kr2376.c397
-rw-r--r--src/mess/machine/kr2376.h88
-rw-r--r--src/mess/machine/kramermc.c54
-rw-r--r--src/mess/machine/laser128.c123
-rw-r--r--src/mess/machine/laser128.h52
-rw-r--r--src/mess/machine/lh5810.c192
-rw-r--r--src/mess/machine/lh5810.h97
-rw-r--r--src/mess/machine/lisa.c2027
-rw-r--r--src/mess/machine/llc.c245
-rw-r--r--src/mess/machine/lux10828.c734
-rw-r--r--src/mess/machine/lux10828.h130
-rw-r--r--src/mess/machine/lux21046.c792
-rw-r--r--src/mess/machine/lux21046.h126
-rw-r--r--src/mess/machine/lux4105.c408
-rw-r--r--src/mess/machine/lux4105.h88
-rw-r--r--src/mess/machine/lviv.c372
-rw-r--r--src/mess/machine/lynx.c2137
-rw-r--r--src/mess/machine/mac.c3283
-rw-r--r--src/mess/machine/macadb.c987
-rw-r--r--src/mess/machine/mackbd.c142
-rw-r--r--src/mess/machine/mackbd.h59
-rw-r--r--src/mess/machine/macpci.c256
-rw-r--r--src/mess/machine/macrtc.c371
-rw-r--r--src/mess/machine/mb8795.c333
-rw-r--r--src/mess/machine/mb8795.h109
-rw-r--r--src/mess/machine/mb89352.c648
-rw-r--r--src/mess/machine/mb89352.h129
-rw-r--r--src/mess/machine/mbc55x.c480
-rw-r--r--src/mess/machine/mbee.c823
-rw-r--r--src/mess/machine/mboard.c557
-rw-r--r--src/mess/machine/mboard.h98
-rw-r--r--src/mess/machine/mc68328.c2833
-rw-r--r--src/mess/machine/mc68328.h541
-rw-r--r--src/mess/machine/mc6843.c856
-rw-r--r--src/mess/machine/mc6843.h41
-rw-r--r--src/mess/machine/mc6846.c635
-rw-r--r--src/mess/machine/mc6846.h65
-rw-r--r--src/mess/machine/mc6854.c1065
-rw-r--r--src/mess/machine/mc6854.h82
-rw-r--r--src/mess/machine/mc80.c203
-rw-r--r--src/mess/machine/mface2.c348
-rw-r--r--src/mess/machine/mface2.h70
-rw-r--r--src/mess/machine/micropolis.c395
-rw-r--r--src/mess/machine/micropolis.h66
-rw-r--r--src/mess/machine/microtan.c584
-rw-r--r--src/mess/machine/mikro80.c113
-rw-r--r--src/mess/machine/mm58274c.c542
-rw-r--r--src/mess/machine/mm58274c.h38
-rw-r--r--src/mess/machine/mos6530.c459
-rw-r--r--src/mess/machine/mos6530.h79
-rw-r--r--src/mess/machine/mpc105.c256
-rw-r--r--src/mess/machine/mpc105.h57
-rw-r--r--src/mess/machine/msx.c1184
-rw-r--r--src/mess/machine/msx_slot.c2487
-rw-r--r--src/mess/machine/mtx.c400
-rw-r--r--src/mess/machine/mz700.c679
-rw-r--r--src/mess/machine/mz80.c103
-rw-r--r--src/mess/machine/n82077aa.c1212
-rw-r--r--src/mess/machine/n82077aa.h203
-rw-r--r--src/mess/machine/nascom1.c295
-rw-r--r--src/mess/machine/nc.c144
-rw-r--r--src/mess/machine/ncr5380.c485
-rw-r--r--src/mess/machine/ncr5380.h89
-rw-r--r--src/mess/machine/ncr5390.c870
-rw-r--r--src/mess/machine/ncr5390.h228
-rw-r--r--src/mess/machine/ne1000.c101
-rw-r--r--src/mess/machine/ne1000.h34
-rw-r--r--src/mess/machine/ne2000.c111
-rw-r--r--src/mess/machine/ne2000.h32
-rw-r--r--src/mess/machine/nes.c1711
-rw-r--r--src/mess/machine/nes_ines.c465
-rw-r--r--src/mess/machine/nes_mmc.c707
-rw-r--r--src/mess/machine/nes_mmc.h147
-rw-r--r--src/mess/machine/nes_pcb.c13270
-rw-r--r--src/mess/machine/nes_unif.c176
-rw-r--r--src/mess/machine/nextkbd.c298
-rw-r--r--src/mess/machine/nextkbd.h57
-rw-r--r--src/mess/machine/nextmo.c197
-rw-r--r--src/mess/machine/nextmo.h56
-rw-r--r--src/mess/machine/northbridge.c46
-rw-r--r--src/mess/machine/northbridge.h32
-rw-r--r--src/mess/machine/nubus.c479
-rw-r--r--src/mess/machine/nubus.h167
-rw-r--r--src/mess/machine/nubus_asntmc3b.c214
-rw-r--r--src/mess/machine/nubus_asntmc3b.h66
-rw-r--r--src/mess/machine/null_modem.c27
-rw-r--r--src/mess/machine/null_modem.h27
-rw-r--r--src/mess/machine/odyssey2.c241
-rw-r--r--src/mess/machine/omti8621.c1363
-rw-r--r--src/mess/machine/omti8621.h58
-rw-r--r--src/mess/machine/ondra.c97
-rw-r--r--src/mess/machine/orao.c78
-rw-r--r--src/mess/machine/oric.c1430
-rw-r--r--src/mess/machine/orion.c626
-rw-r--r--src/mess/machine/osborne1.c543
-rw-r--r--src/mess/machine/p2000t.c160
-rw-r--r--src/mess/machine/partner.c390
-rw-r--r--src/mess/machine/pc.c1787
-rw-r--r--src/mess/machine/pc1251.c118
-rw-r--r--src/mess/machine/pc1350.c136
-rw-r--r--src/mess/machine/pc1401.c238
-rw-r--r--src/mess/machine/pc1403.c172
-rw-r--r--src/mess/machine/pc1512kb.c524
-rw-r--r--src/mess/machine/pc1512kb.h111
-rw-r--r--src/mess/machine/pc_fdc.c581
-rw-r--r--src/mess/machine/pc_fdc.h52
-rw-r--r--src/mess/machine/pc_joy.c91
-rw-r--r--src/mess/machine/pc_joy.h20
-rw-r--r--src/mess/machine/pc_kbdc.c252
-rw-r--r--src/mess/machine/pc_kbdc.h147
-rw-r--r--src/mess/machine/pc_keyboards.c16
-rw-r--r--src/mess/machine/pc_keyboards.h25
-rw-r--r--src/mess/machine/pc_lpt.c342
-rw-r--r--src/mess/machine/pc_lpt.h85
-rw-r--r--src/mess/machine/pc_turbo.c54
-rw-r--r--src/mess/machine/pc_turbo.h15
-rw-r--r--src/mess/machine/pce.c1827
-rw-r--r--src/mess/machine/pce220_ser.c306
-rw-r--r--src/mess/machine/pce220_ser.h94
-rw-r--r--src/mess/machine/pcf8593.c474
-rw-r--r--src/mess/machine/pcf8593.h41
-rw-r--r--src/mess/machine/pecom.c193
-rw-r--r--src/mess/machine/pet.c840
-rw-r--r--src/mess/machine/pf10.c162
-rw-r--r--src/mess/machine/pf10.h49
-rw-r--r--src/mess/machine/pk8020.c1012
-rw-r--r--src/mess/machine/plus4_sid.c184
-rw-r--r--src/mess/machine/plus4_sid.h63
-rw-r--r--src/mess/machine/plus4_std.c72
-rw-r--r--src/mess/machine/plus4_std.h49
-rw-r--r--src/mess/machine/plus4exp.c404
-rw-r--r--src/mess/machine/plus4exp.h197
-rw-r--r--src/mess/machine/plus4user.c104
-rw-r--r--src/mess/machine/plus4user.h126
-rw-r--r--src/mess/machine/pmd85.c966
-rw-r--r--src/mess/machine/pokemini.c1585
-rw-r--r--src/mess/machine/poly88.c332
-rw-r--r--src/mess/machine/pp01.c238
-rw-r--r--src/mess/machine/primo.c374
-rw-r--r--src/mess/machine/ps2.c96
-rw-r--r--src/mess/machine/psion_pack.c330
-rw-r--r--src/mess/machine/psion_pack.h78
-rw-r--r--src/mess/machine/psxcard.c258
-rw-r--r--src/mess/machine/psxcard.h42
-rw-r--r--src/mess/machine/psxcd.c1686
-rw-r--r--src/mess/machine/psxcd.h186
-rw-r--r--src/mess/machine/psxcddrv.c533
-rw-r--r--src/mess/machine/psxcddrv.h133
-rw-r--r--src/mess/machine/radio86.c282
-rw-r--r--src/mess/machine/rm380z.c300
-rw-r--r--src/mess/machine/rmnimbus.c3055
-rw-r--r--src/mess/machine/rx01.c263
-rw-r--r--src/mess/machine/rx01.h81
-rw-r--r--src/mess/machine/s100.c319
-rw-r--r--src/mess/machine/s100.h297
-rw-r--r--src/mess/machine/s100_dj2db.c517
-rw-r--r--src/mess/machine/s100_dj2db.h87
-rw-r--r--src/mess/machine/s100_djdma.c129
-rw-r--r--src/mess/machine/s100_djdma.h54
-rw-r--r--src/mess/machine/s100_mm65k16s.c269
-rw-r--r--src/mess/machine/s100_mm65k16s.h58
-rw-r--r--src/mess/machine/s100_wunderbus.c554
-rw-r--r--src/mess/machine/s100_wunderbus.h75
-rw-r--r--src/mess/machine/s1410.c227
-rw-r--r--src/mess/machine/s1410.h73
-rw-r--r--src/mess/machine/s3c44b0.c2058
-rw-r--r--src/mess/machine/s3c44b0.h688
-rw-r--r--src/mess/machine/samcoupe.c278
-rw-r--r--src/mess/machine/sapi1.c55
-rw-r--r--src/mess/machine/sc499.c1183
-rw-r--r--src/mess/machine/sc499.h159
-rw-r--r--src/mess/machine/scsibus.c1018
-rw-r--r--src/mess/machine/scsibus.h219
-rw-r--r--src/mess/machine/ser_mouse.c246
-rw-r--r--src/mess/machine/ser_mouse.h77
-rw-r--r--src/mess/machine/serial.c136
-rw-r--r--src/mess/machine/serial.h123
-rw-r--r--src/mess/machine/serialbox.c151
-rw-r--r--src/mess/machine/serialbox.h69
-rw-r--r--src/mess/machine/sgi.c512
-rw-r--r--src/mess/machine/sgi.h18
-rw-r--r--src/mess/machine/smartmed.c807
-rw-r--r--src/mess/machine/smartmed.h201
-rw-r--r--src/mess/machine/smc92x4.c2015
-rw-r--r--src/mess/machine/smc92x4.h219
-rw-r--r--src/mess/machine/sms.c2322
-rw-r--r--src/mess/machine/snescart.c1488
-rw-r--r--src/mess/machine/snescart.h19
-rw-r--r--src/mess/machine/softbox.c203
-rw-r--r--src/mess/machine/softbox.h63
-rw-r--r--src/mess/machine/sorcerer.c426
-rw-r--r--src/mess/machine/southbridge.c479
-rw-r--r--src/mess/machine/southbridge.h147
-rw-r--r--src/mess/machine/special.c395
-rw-r--r--src/mess/machine/sst39vfx.c223
-rw-r--r--src/mess/machine/sst39vfx.h72
-rw-r--r--src/mess/machine/strata.c695
-rw-r--r--src/mess/machine/strata.h15
-rw-r--r--src/mess/machine/super80.c227
-rw-r--r--src/mess/machine/svi318.c915
-rw-r--r--src/mess/machine/sym1.c310
-rw-r--r--src/mess/machine/tandy1t.c401
-rw-r--r--src/mess/machine/tandy2kb.c424
-rw-r--r--src/mess/machine/tandy2kb.h104
-rw-r--r--src/mess/machine/teleprinter.c237
-rw-r--r--src/mess/machine/teleprinter.h45
-rw-r--r--src/mess/machine/terminal.c548
-rw-r--r--src/mess/machine/terminal.h119
-rw-r--r--src/mess/machine/tf20.c388
-rw-r--r--src/mess/machine/tf20.h58
-rw-r--r--src/mess/machine/thomflop.c1951
-rw-r--r--src/mess/machine/thomflop.h53
-rw-r--r--src/mess/machine/thomson.c5466
-rw-r--r--src/mess/machine/ti85.c725
-rw-r--r--src/mess/machine/ti85_ser.c1544
-rw-r--r--src/mess/machine/ti85_ser.h34
-rw-r--r--src/mess/machine/ti99/bwg.c489
-rw-r--r--src/mess/machine/ti99/bwg.h94
-rw-r--r--src/mess/machine/ti99/datamux.c330
-rw-r--r--src/mess/machine/ti99/datamux.h115
-rw-r--r--src/mess/machine/ti99/evpc.c368
-rw-r--r--src/mess/machine/ti99/evpc.h62
-rw-r--r--src/mess/machine/ti99/genboard.c1493
-rw-r--r--src/mess/machine/ti99/genboard.h200
-rw-r--r--src/mess/machine/ti99/grom.c260
-rw-r--r--src/mess/machine/ti99/grom.h102
-rw-r--r--src/mess/machine/ti99/gromport.c2234
-rw-r--r--src/mess/machine/ti99/gromport.h497
-rw-r--r--src/mess/machine/ti99/handset.c536
-rw-r--r--src/mess/machine/ti99/handset.h90
-rw-r--r--src/mess/machine/ti99/hfdc.c586
-rw-r--r--src/mess/machine/ti99/hfdc.h116
-rw-r--r--src/mess/machine/ti99/horizon.c448
-rw-r--r--src/mess/machine/ti99/horizon.h66
-rw-r--r--src/mess/machine/ti99/hsgpl.c628
-rw-r--r--src/mess/machine/ti99/hsgpl.h81
-rw-r--r--src/mess/machine/ti99/joyport.c104
-rw-r--r--src/mess/machine/ti99/joyport.h94
-rw-r--r--src/mess/machine/ti99/mapper8.c570
-rw-r--r--src/mess/machine/ti99/mapper8.h169
-rw-r--r--src/mess/machine/ti99/mecmouse.c205
-rw-r--r--src/mess/machine/ti99/mecmouse.h46
-rw-r--r--src/mess/machine/ti99/memex.c175
-rw-r--r--src/mess/machine/ti99/memex.h44
-rw-r--r--src/mess/machine/ti99/myarcmem.c209
-rw-r--r--src/mess/machine/ti99/myarcmem.h44
-rw-r--r--src/mess/machine/ti99/p_code.c325
-rw-r--r--src/mess/machine/ti99/p_code.h49
-rw-r--r--src/mess/machine/ti99/peribox.c664
-rw-r--r--src/mess/machine/ti99/peribox.h251
-rw-r--r--src/mess/machine/ti99/samsmem.c133
-rw-r--r--src/mess/machine/ti99/samsmem.h43
-rw-r--r--src/mess/machine/ti99/spchsyn.c308
-rw-r--r--src/mess/machine/ti99/spchsyn.h53
-rw-r--r--src/mess/machine/ti99/speech8.c261
-rw-r--r--src/mess/machine/ti99/speech8.h71
-rw-r--r--src/mess/machine/ti99/ti32kmem.c110
-rw-r--r--src/mess/machine/ti99/ti32kmem.h36
-rw-r--r--src/mess/machine/ti99/ti99_hd.c504
-rw-r--r--src/mess/machine/ti99/ti99_hd.h87
-rw-r--r--src/mess/machine/ti99/ti99defs.h93
-rw-r--r--src/mess/machine/ti99/ti_fdc.c319
-rw-r--r--src/mess/machine/ti99/ti_fdc.h80
-rw-r--r--src/mess/machine/ti99/ti_rs232.c1125
-rw-r--r--src/mess/machine/ti99/ti_rs232.h156
-rw-r--r--src/mess/machine/ti99/tn_ide.c385
-rw-r--r--src/mess/machine/ti99/tn_ide.h61
-rw-r--r--src/mess/machine/ti99/tn_usbsm.c344
-rw-r--r--src/mess/machine/ti99/tn_usbsm.h55
-rw-r--r--src/mess/machine/ti99/videowrp.c236
-rw-r--r--src/mess/machine/ti99/videowrp.h183
-rw-r--r--src/mess/machine/ti990.c177
-rw-r--r--src/mess/machine/ti990.h23
-rw-r--r--src/mess/machine/tms5501.c463
-rw-r--r--src/mess/machine/tms5501.h101
-rw-r--r--src/mess/machine/trs80.c904
-rw-r--r--src/mess/machine/trs80m2kb.c389
-rw-r--r--src/mess/machine/trs80m2kb.h103
-rw-r--r--src/mess/machine/tvc_hbf.c196
-rw-r--r--src/mess/machine/tvc_hbf.h57
-rw-r--r--src/mess/machine/tvcexp.c187
-rw-r--r--src/mess/machine/tvcexp.h133
-rw-r--r--src/mess/machine/upd65031.c637
-rw-r--r--src/mess/machine/upd65031.h112
-rw-r--r--src/mess/machine/upd7002.c234
-rw-r--r--src/mess/machine/upd7002.h58
-rw-r--r--src/mess/machine/upd71071.c444
-rw-r--r--src/mess/machine/upd71071.h26
-rw-r--r--src/mess/machine/upd765.c2547
-rw-r--r--src/mess/machine/upd765.h165
-rw-r--r--src/mess/machine/ut88.c176
-rw-r--r--src/mess/machine/v1050kb.c424
-rw-r--r--src/mess/machine/v1050kb.h88
-rw-r--r--src/mess/machine/vb_money_minder.c77
-rw-r--r--src/mess/machine/vb_money_minder.h49
-rw-r--r--src/mess/machine/vb_std.c63
-rw-r--r--src/mess/machine/vb_std.h48
-rw-r--r--src/mess/machine/vb_timeshare.c76
-rw-r--r--src/mess/machine/vb_timeshare.h49
-rw-r--r--src/mess/machine/vcs_joy.c74
-rw-r--r--src/mess/machine/vcs_joy.h51
-rw-r--r--src/mess/machine/vcsctrl.c83
-rw-r--r--src/mess/machine/vcsctrl.h85
-rw-r--r--src/mess/machine/vector06.c190
-rw-r--r--src/mess/machine/vic1010.c162
-rw-r--r--src/mess/machine/vic1010.h72
-rw-r--r--src/mess/machine/vic10exp.c326
-rw-r--r--src/mess/machine/vic10exp.h186
-rw-r--r--src/mess/machine/vic10std.c81
-rw-r--r--src/mess/machine/vic10std.h50
-rw-r--r--src/mess/machine/vic1110.c117
-rw-r--r--src/mess/machine/vic1110.h53
-rw-r--r--src/mess/machine/vic1111.c75
-rw-r--r--src/mess/machine/vic1111.h50
-rw-r--r--src/mess/machine/vic1112.c272
-rw-r--r--src/mess/machine/vic1112.h76
-rw-r--r--src/mess/machine/vic1210.c80
-rw-r--r--src/mess/machine/vic1210.h51
-rw-r--r--src/mess/machine/vic20_megacart.c131
-rw-r--r--src/mess/machine/vic20_megacart.h63
-rw-r--r--src/mess/machine/vic20exp.c375
-rw-r--r--src/mess/machine/vic20exp.h185
-rw-r--r--src/mess/machine/vic20std.c72
-rw-r--r--src/mess/machine/vic20std.h49
-rw-r--r--src/mess/machine/vic20user.c136
-rw-r--r--src/mess/machine/vic20user.h151
-rw-r--r--src/mess/machine/victor9kb.c389
-rw-r--r--src/mess/machine/victor9kb.h102
-rw-r--r--src/mess/machine/vidbrain_exp.c247
-rw-r--r--src/mess/machine/vidbrain_exp.h175
-rw-r--r--src/mess/machine/vip_byteio.c132
-rw-r--r--src/mess/machine/vip_byteio.h148
-rw-r--r--src/mess/machine/vip_exp.c253
-rw-r--r--src/mess/machine/vip_exp.h182
-rw-r--r--src/mess/machine/vp550.c250
-rw-r--r--src/mess/machine/vp550.h68
-rw-r--r--src/mess/machine/vp570.c118
-rw-r--r--src/mess/machine/vp570.h54
-rw-r--r--src/mess/machine/vp575.c352
-rw-r--r--src/mess/machine/vp575.h96
-rw-r--r--src/mess/machine/vp585.c131
-rw-r--r--src/mess/machine/vp585.h55
-rw-r--r--src/mess/machine/vp590.c269
-rw-r--r--src/mess/machine/vp590.h72
-rw-r--r--src/mess/machine/vp595.c101
-rw-r--r--src/mess/machine/vp595.h55
-rw-r--r--src/mess/machine/vp620.c106
-rw-r--r--src/mess/machine/vp620.h59
-rw-r--r--src/mess/machine/vp700.c83
-rw-r--r--src/mess/machine/vp700.h54
-rw-r--r--src/mess/machine/vtech2.c536
-rw-r--r--src/mess/machine/wangpc_emb.c176
-rw-r--r--src/mess/machine/wangpc_emb.h58
-rw-r--r--src/mess/machine/wangpc_lic.c160
-rw-r--r--src/mess/machine/wangpc_lic.h56
-rw-r--r--src/mess/machine/wangpc_lvc.c363
-rw-r--r--src/mess/machine/wangpc_lvc.h71
-rw-r--r--src/mess/machine/wangpc_mcc.c336
-rw-r--r--src/mess/machine/wangpc_mcc.h63
-rw-r--r--src/mess/machine/wangpc_mvc.c354
-rw-r--r--src/mess/machine/wangpc_mvc.h72
-rw-r--r--src/mess/machine/wangpc_rtc.c349
-rw-r--r--src/mess/machine/wangpc_rtc.h70
-rw-r--r--src/mess/machine/wangpc_tig.c342
-rw-r--r--src/mess/machine/wangpc_tig.h68
-rw-r--r--src/mess/machine/wangpc_wdc.c356
-rw-r--r--src/mess/machine/wangpc_wdc.h84
-rw-r--r--src/mess/machine/wangpcbus.c328
-rw-r--r--src/mess/machine/wangpcbus.h207
-rw-r--r--src/mess/machine/wangpckb.c583
-rw-r--r--src/mess/machine/wangpckb.h87
-rw-r--r--src/mess/machine/wd11c00_17.c495
-rw-r--r--src/mess/machine/wd11c00_17.h128
-rw-r--r--src/mess/machine/wd1772.c1779
-rw-r--r--src/mess/machine/wd1772.h321
-rw-r--r--src/mess/machine/wd2010.c426
-rw-r--r--src/mess/machine/wd2010.h109
-rw-r--r--src/mess/machine/wswan.c1518
-rw-r--r--src/mess/machine/x1.c67
-rw-r--r--src/mess/machine/x68k_hdc.c430
-rw-r--r--src/mess/machine/x68k_hdc.h129
-rw-r--r--src/mess/machine/x68k_neptunex.c153
-rw-r--r--src/mess/machine/x68k_neptunex.h53
-rw-r--r--src/mess/machine/x68k_scsiext.c115
-rw-r--r--src/mess/machine/x68k_scsiext.h45
-rw-r--r--src/mess/machine/x68kexp.c98
-rw-r--r--src/mess/machine/x68kexp.h149
-rw-r--r--src/mess/machine/z80ne.c796
-rw-r--r--src/mess/machine/z88_flash.c92
-rw-r--r--src/mess/machine/z88_flash.h45
-rw-r--r--src/mess/machine/z88_ram.c108
-rw-r--r--src/mess/machine/z88_ram.h93
-rw-r--r--src/mess/machine/z88_rom.c88
-rw-r--r--src/mess/machine/z88_rom.h75
-rw-r--r--src/mess/machine/z88cart.c222
-rw-r--r--src/mess/machine/z88cart.h145
-rw-r--r--src/mess/machine/zx.c397
-rw-r--r--src/mess/machine/zx8302.c685
-rw-r--r--src/mess/machine/zx8302.h192
-rw-r--r--src/mess/mess.c56
-rw-r--r--src/mess/mess.lst2144
-rw-r--r--src/mess/mess.mak2200
-rw-r--r--src/mess/messcore.mak74
-rw-r--r--src/mess/osd/windows/mess.icobin0 -> 5430 bytes
-rw-r--r--src/mess/osd/windows/mess.rc49
-rw-r--r--src/mess/osd/windows/windows.mak32
-rw-r--r--src/mess/tiny.lst44
-rw-r--r--src/mess/tiny.mak48
-rw-r--r--src/mess/tools/castool/castool.mak38
-rw-r--r--src/mess/tools/castool/main.c196
-rw-r--r--src/mess/tools/floptool/floptool.mak38
-rw-r--r--src/mess/tools/floptool/main.c254
-rw-r--r--src/mess/tools/imgtool/charconv.c160
-rw-r--r--src/mess/tools/imgtool/charconv.h29
-rw-r--r--src/mess/tools/imgtool/filtbas.c2927
-rw-r--r--src/mess/tools/imgtool/filteoln.c125
-rw-r--r--src/mess/tools/imgtool/filter.c80
-rw-r--r--src/mess/tools/imgtool/filter.h63
-rw-r--r--src/mess/tools/imgtool/iflopimg.c371
-rw-r--r--src/mess/tools/imgtool/iflopimg.h39
-rw-r--r--src/mess/tools/imgtool/imghd.c279
-rw-r--r--src/mess/tools/imgtool/imghd.h40
-rw-r--r--src/mess/tools/imgtool/imgterrs.c53
-rw-r--r--src/mess/tools/imgtool/imgterrs.h68
-rw-r--r--src/mess/tools/imgtool/imgtool.c2812
-rw-r--r--src/mess/tools/imgtool/imgtool.h169
-rw-r--r--src/mess/tools/imgtool/imgtool.mak77
-rw-r--r--src/mess/tools/imgtool/library.c280
-rw-r--r--src/mess/tools/imgtool/library.h409
-rw-r--r--src/mess/tools/imgtool/main.c984
-rw-r--r--src/mess/tools/imgtool/main.h18
-rw-r--r--src/mess/tools/imgtool/modules.c115
-rw-r--r--src/mess/tools/imgtool/modules.h16
-rw-r--r--src/mess/tools/imgtool/modules/amiga.c2403
-rw-r--r--src/mess/tools/imgtool/modules/concept.c488
-rw-r--r--src/mess/tools/imgtool/modules/cybiko.c579
-rw-r--r--src/mess/tools/imgtool/modules/cybikoxt.c540
-rw-r--r--src/mess/tools/imgtool/modules/fat.c2114
-rw-r--r--src/mess/tools/imgtool/modules/fat.h1
-rw-r--r--src/mess/tools/imgtool/modules/mac.c6414
-rw-r--r--src/mess/tools/imgtool/modules/macbin.c375
-rw-r--r--src/mess/tools/imgtool/modules/macutil.c88
-rw-r--r--src/mess/tools/imgtool/modules/macutil.h40
-rw-r--r--src/mess/tools/imgtool/modules/os9.c1257
-rw-r--r--src/mess/tools/imgtool/modules/pc_flop.c171
-rw-r--r--src/mess/tools/imgtool/modules/pc_hard.c469
-rw-r--r--src/mess/tools/imgtool/modules/prodos.c2283
-rw-r--r--src/mess/tools/imgtool/modules/psion.c684
-rw-r--r--src/mess/tools/imgtool/modules/rsdos.c621
-rw-r--r--src/mess/tools/imgtool/modules/thomson.c1687
-rw-r--r--src/mess/tools/imgtool/modules/ti99.c5359
-rw-r--r--src/mess/tools/imgtool/modules/ti990hd.c1816
-rw-r--r--src/mess/tools/imgtool/modules/vzdos.c967
-rw-r--r--src/mess/tools/imgtool/stream.c536
-rw-r--r--src/mess/tools/imgtool/stream.h46
-rw-r--r--src/mess/tools/tools.mak23
-rw-r--r--src/mess/video/733_asr.c746
-rw-r--r--src/mess/video/733_asr.h95
-rw-r--r--src/mess/video/911_chr.h3516
-rw-r--r--src/mess/video/911_key.h4026
-rw-r--r--src/mess/video/911_vdt.c701
-rw-r--r--src/mess/video/911_vdt.h163
-rw-r--r--src/mess/video/a7800.c584
-rw-r--r--src/mess/video/abc1600.c1130
-rw-r--r--src/mess/video/abc80.c224
-rw-r--r--src/mess/video/abc800.c380
-rw-r--r--src/mess/video/abc802.c255
-rw-r--r--src/mess/video/abc806.c554
-rw-r--r--src/mess/video/ac1.c61
-rw-r--r--src/mess/video/advision.c115
-rw-r--r--src/mess/video/apollo.c882
-rw-r--r--src/mess/video/apple1.c401
-rw-r--r--src/mess/video/apple2.c537
-rw-r--r--src/mess/video/apple2gs.c164
-rw-r--r--src/mess/video/apple3.c401
-rw-r--r--src/mess/video/aquarius.c104
-rw-r--r--src/mess/video/arcadia.c682
-rw-r--r--src/mess/video/atarist.c1182
-rw-r--r--src/mess/video/atarist.h39
-rw-r--r--src/mess/video/avigo.c117
-rw-r--r--src/mess/video/b2m.c59
-rw-r--r--src/mess/video/bbc.c694
-rw-r--r--src/mess/video/bk.c39
-rw-r--r--src/mess/video/busicom.c1859
-rw-r--r--src/mess/video/cbmb.c100
-rw-r--r--src/mess/video/cgc7900.c255
-rw-r--r--src/mess/video/cgenie.c422
-rw-r--r--src/mess/video/channelf.c71
-rw-r--r--src/mess/video/cirrus.c233
-rw-r--r--src/mess/video/cirrus.h38
-rw-r--r--src/mess/video/comquest.c22
-rw-r--r--src/mess/video/comx35.c152
-rw-r--r--src/mess/video/crt.c223
-rw-r--r--src/mess/video/crt.h33
-rw-r--r--src/mess/video/crtc_ega.c695
-rw-r--r--src/mess/video/crtc_ega.h226
-rw-r--r--src/mess/video/dai.c768
-rw-r--r--src/mess/video/dgn_beta.c303
-rw-r--r--src/mess/video/dl1416.c325
-rw-r--r--src/mess/video/dl1416.h75
-rw-r--r--src/mess/video/ef9345.c1038
-rw-r--r--src/mess/video/ef9345.h123
-rw-r--r--src/mess/video/electron.c274
-rw-r--r--src/mess/video/epnick.c1044
-rw-r--r--src/mess/video/fm7.c1613
-rw-r--r--src/mess/video/fmtowns.c1867
-rw-r--r--src/mess/video/galaxy.c137
-rw-r--r--src/mess/video/galeb.c45
-rw-r--r--src/mess/video/gamecom.c72
-rw-r--r--src/mess/video/gb.c2392
-rw-r--r--src/mess/video/gba.c1811
-rw-r--r--src/mess/video/gbam345.c399
-rw-r--r--src/mess/video/gbamode0.c585
-rw-r--r--src/mess/video/gbamode1.c525
-rw-r--r--src/mess/video/gbamode2.c465
-rw-r--r--src/mess/video/gf4500.c172
-rw-r--r--src/mess/video/gf4500.h18
-rw-r--r--src/mess/video/gime.c2044
-rw-r--r--src/mess/video/gime.h297
-rw-r--r--src/mess/video/hd44352.c456
-rw-r--r--src/mess/video/hd44352.h87
-rw-r--r--src/mess/video/hd44780.c344
-rw-r--r--src/mess/video/hd44780.h96
-rw-r--r--src/mess/video/hd66421.c254
-rw-r--r--src/mess/video/hd66421.h80
-rw-r--r--src/mess/video/hec2video.c144
-rw-r--r--src/mess/video/hp48.c202
-rw-r--r--src/mess/video/intv.c855
-rw-r--r--src/mess/video/iq151_grafik.c198
-rw-r--r--src/mess/video/iq151_grafik.h62
-rw-r--r--src/mess/video/iq151_video32.c148
-rw-r--r--src/mess/video/iq151_video32.h46
-rw-r--r--src/mess/video/iq151_video64.c156
-rw-r--r--src/mess/video/iq151_video64.h47
-rw-r--r--src/mess/video/irisha.c43
-rw-r--r--src/mess/video/isa_cga.c2035
-rw-r--r--src/mess/video/isa_cga.h187
-rw-r--r--src/mess/video/isa_ega.c1408
-rw-r--r--src/mess/video/isa_ega.h106
-rw-r--r--src/mess/video/isa_mda.c740
-rw-r--r--src/mess/video/isa_mda.h91
-rw-r--r--src/mess/video/isa_svga_cirrus.c93
-rw-r--r--src/mess/video/isa_svga_cirrus.h36
-rw-r--r--src/mess/video/isa_svga_s3.c93
-rw-r--r--src/mess/video/isa_svga_s3.h36
-rw-r--r--src/mess/video/isa_svga_tseng.c91
-rw-r--r--src/mess/video/isa_svga_tseng.h36
-rw-r--r--src/mess/video/k1ge.c928
-rw-r--r--src/mess/video/k1ge.h44
-rw-r--r--src/mess/video/kaypro.c320
-rw-r--r--src/mess/video/kc.c236
-rw-r--r--src/mess/video/kramermc.c45
-rw-r--r--src/mess/video/kyocera.c84
-rw-r--r--src/mess/video/llc.c97
-rw-r--r--src/mess/video/lviv.c91
-rw-r--r--src/mess/video/mac.c1063
-rw-r--r--src/mess/video/mbc55x.c201
-rw-r--r--src/mess/video/mbee.c638
-rw-r--r--src/mess/video/mc68328.c66
-rw-r--r--src/mess/video/mc6847.c1627
-rw-r--r--src/mess/video/mc6847.h631
-rw-r--r--src/mess/video/mc80.c174
-rw-r--r--src/mess/video/microtan.c58
-rw-r--r--src/mess/video/mikro80.c39
-rw-r--r--src/mess/video/mikromik.c169
-rw-r--r--src/mess/video/mos6566.c2818
-rw-r--r--src/mess/video/mos6566.h488
-rw-r--r--src/mess/video/mz700.c135
-rw-r--r--src/mess/video/mz80.c145
-rw-r--r--src/mess/video/nascom1.c61
-rw-r--r--src/mess/video/nc.c119
-rw-r--r--src/mess/video/nes.c70
-rw-r--r--src/mess/video/newbrain.c132
-rw-r--r--src/mess/video/newport.c1689
-rw-r--r--src/mess/video/newport.h15
-rw-r--r--src/mess/video/nubus_48gc.c354
-rw-r--r--src/mess/video/nubus_48gc.h61
-rw-r--r--src/mess/video/nubus_cb264.c306
-rw-r--r--src/mess/video/nubus_cb264.h48
-rw-r--r--src/mess/video/nubus_m2hires.c320
-rw-r--r--src/mess/video/nubus_m2hires.h52
-rw-r--r--src/mess/video/nubus_radiustpd.c218
-rw-r--r--src/mess/video/nubus_radiustpd.h52
-rw-r--r--src/mess/video/nubus_spec8.c360
-rw-r--r--src/mess/video/nubus_spec8.h60
-rw-r--r--src/mess/video/nubus_specpdq.c490
-rw-r--r--src/mess/video/nubus_specpdq.h58
-rw-r--r--src/mess/video/nubus_vikbw.c178
-rw-r--r--src/mess/video/nubus_vikbw.h48
-rw-r--r--src/mess/video/nubus_wsportrait.c316
-rw-r--r--src/mess/video/nubus_wsportrait.h52
-rw-r--r--src/mess/video/odyssey2.c827
-rw-r--r--src/mess/video/ondra.c48
-rw-r--r--src/mess/video/orao.c40
-rw-r--r--src/mess/video/oric.c308
-rw-r--r--src/mess/video/orion.c116
-rw-r--r--src/mess/video/osi.c182
-rw-r--r--src/mess/video/p2000m.c60
-rw-r--r--src/mess/video/pc1251.c167
-rw-r--r--src/mess/video/pc1350.c170
-rw-r--r--src/mess/video/pc1401.c218
-rw-r--r--src/mess/video/pc1403.c264
-rw-r--r--src/mess/video/pc1512.c646
-rw-r--r--src/mess/video/pc1640.c401
-rw-r--r--src/mess/video/pc4.c194
-rw-r--r--src/mess/video/pc8401a.c114
-rw-r--r--src/mess/video/pc_aga.c879
-rw-r--r--src/mess/video/pc_aga.h43
-rw-r--r--src/mess/video/pc_t1t.c975
-rw-r--r--src/mess/video/pc_t1t.h10
-rw-r--r--src/mess/video/pcw.c188
-rw-r--r--src/mess/video/pcw16.c265
-rw-r--r--src/mess/video/pdp1.c609
-rw-r--r--src/mess/video/pecom.c121
-rw-r--r--src/mess/video/pet.c113
-rw-r--r--src/mess/video/pk8020.c58
-rw-r--r--src/mess/video/pmd85.c66
-rw-r--r--src/mess/video/pocketc.c70
-rw-r--r--src/mess/video/poly88.c103
-rw-r--r--src/mess/video/pp01.c57
-rw-r--r--src/mess/video/primo.c46
-rw-r--r--src/mess/video/psion.c107
-rw-r--r--src/mess/video/radio86.c129
-rw-r--r--src/mess/video/rm380z.c409
-rw-r--r--src/mess/video/rmnimbus.c679
-rw-r--r--src/mess/video/saa505x.c3581
-rw-r--r--src/mess/video/saa505x.h27
-rw-r--r--src/mess/video/samcoupe.c176
-rw-r--r--src/mess/video/sapi1.c150
-rw-r--r--src/mess/video/special.c155
-rw-r--r--src/mess/video/spectrum.c608
-rw-r--r--src/mess/video/ssystem3.c238
-rw-r--r--src/mess/video/stic.c187
-rw-r--r--src/mess/video/stic.h449
-rw-r--r--src/mess/video/super80.c469
-rw-r--r--src/mess/video/t6a04.c260
-rw-r--r--src/mess/video/t6a04.h71
-rw-r--r--src/mess/video/thomson.c1344
-rw-r--r--src/mess/video/ti85.c196
-rw-r--r--src/mess/video/timex.c262
-rw-r--r--src/mess/video/tmc1800.c123
-rw-r--r--src/mess/video/tmc600.c156
-rw-r--r--src/mess/video/tms3556.c584
-rw-r--r--src/mess/video/tms3556.h113
-rw-r--r--src/mess/video/trs80.c593
-rw-r--r--src/mess/video/tx0.c484
-rw-r--r--src/mess/video/upd7220.c1667
-rw-r--r--src/mess/video/upd7220.h233
-rw-r--r--src/mess/video/ut88.c44
-rw-r--r--src/mess/video/uv201.c603
-rw-r--r--src/mess/video/uv201.h165
-rw-r--r--src/mess/video/v1050.c147
-rw-r--r--src/mess/video/vc4000.c655
-rw-r--r--src/mess/video/vdc8563.c673
-rw-r--r--src/mess/video/vdc8563.h48
-rw-r--r--src/mess/video/vector06.c60
-rw-r--r--src/mess/video/vic4567.c2165
-rw-r--r--src/mess/video/vic4567.h157
-rw-r--r--src/mess/video/vic6567.c2815
-rw-r--r--src/mess/video/vic6567.h164
-rw-r--r--src/mess/video/vtech2.c313
-rw-r--r--src/mess/video/vtvideo.c477
-rw-r--r--src/mess/video/vtvideo.h57
-rw-r--r--src/mess/video/wswan.c584
-rw-r--r--src/mess/video/x68k.c1322
-rw-r--r--src/mess/video/z88.c173
-rw-r--r--src/mess/video/zx.c217
-rw-r--r--src/mess/video/zx8301.c346
-rw-r--r--src/mess/video/zx8301.h138
-rw-r--r--src/ume/ume.c49
-rw-r--r--src/ume/ume.lst14
-rw-r--r--src/ume/ume.mak22
2021 files changed, 768842 insertions, 0 deletions
diff --git a/src/mess/audio/arcadia.c b/src/mess/audio/arcadia.c
new file mode 100644
index 00000000000..575eb10dbd0
--- /dev/null
+++ b/src/mess/audio/arcadia.c
@@ -0,0 +1,166 @@
+/***************************************************************************
+
+ PeT mess@utanet.at
+ main part in video/
+
+ Refined with recording/analysis on MPT-03 (PAL UVI chip) by plgDavid
+
+ NTSC UVI sound clock: 15734Hz (arcadia)
+ PAL UVI sound clock: 15625Hz (Soundic MPT-03 - owned by plgDavid)
+***************************************************************************/
+
+
+#include "includes/arcadia.h"
+
+//known UVI audio clocks
+#define UVI_NTSC 15734
+#define UVI_PAL 15625
+
+/* we need to create pulse transitions that sound 'decent'
+ with the current mess/mame interp scheme
+
+ this is not needed anymore with the new trick in streams.c
+*/
+
+#define OSAMP 1
+
+//lfsr is 9 bits long (and same as Atari TIA pure noise)
+#define LFSR_MASK (1<<8)
+
+//makes alien invaders samples noise sync.
+#define LFSR_INIT 0x00f0
+
+//lfsr states at resynch borders
+//0x01c1
+//0x01e0
+//0x00f0 //good synch
+//0x0178
+//0x01bc
+
+
+// device type definition
+const device_type ARCADIA_SOUND = &device_creator<arcadia_sound_device>;
+
+//-------------------------------------------------
+// arcadia_sound_device - constructor
+//-------------------------------------------------
+
+arcadia_sound_device::arcadia_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ARCADIA_SOUND, "Arcadia Custom Sound", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+void arcadia_sound_device::device_start()
+{
+ m_channel = machine().sound().stream_alloc(*this, 0, 1, UVI_PAL*OSAMP, this);
+ m_lfsr = LFSR_INIT;
+ m_tval = 1;
+ logerror("arcadia_sound start\n");
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle update requests for
+// our sound stream
+//-------------------------------------------------
+
+void arcadia_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ int i;
+ stream_sample_t *buffer = outputs[0];
+
+ for (i = 0; i < samples; i++, buffer++)
+ {
+ *buffer = 0;
+
+ //if minimal pitch ?
+ if (m_reg[1]){
+ switch (m_mode){
+ //dont play anything
+ case 0:break;
+
+ //tone only
+ case 1:
+ *buffer = m_volume * m_tval;
+ break;
+
+ //noise only
+ case 2:
+ *buffer = m_volume * m_nval;
+ break;
+
+ //tone AND noise (bitwise and)
+ case 3:
+ *buffer = m_volume * (m_tval & m_nval);
+ break;
+ }
+
+ //counter
+ m_pos++;
+
+ if (m_pos >= m_size){
+
+ //calculate new noise bit ( taps: 0000T000T)
+ unsigned char newBit = m_lfsr & 1; //first tap
+ newBit = (newBit ^ ((m_lfsr & 0x10)?1:0) );//xor with second tap
+
+ m_nval = m_lfsr & 1; //taking new output from LSB
+ m_lfsr = m_lfsr >> 1;//shifting
+
+ //insert new bit at end position (size-1) (only if non null)
+ if (newBit)
+ m_lfsr |= LFSR_MASK;
+
+ //invert tone
+ m_tval = !m_tval;
+
+ m_pos = 0;
+ }
+ }
+ }
+}
+
+
+
+//-------------------------------------------------
+// soundport_w
+//-------------------------------------------------
+
+WRITE8_MEMBER(arcadia_sound_device::write)
+{
+ m_channel->update();
+ m_reg[offset] = data;
+
+ //logerror("arcadia_sound write:%x=%x\n",offset,data);
+
+ switch (offset)
+ {
+ case 1:
+ //as per Gobbler samples:
+ //the freq counter is only applied on the next change in the flip flop
+ m_size = (data & 0x7f)*OSAMP;
+ //logerror("arcadia_sound write: frq:%d\n",data);
+
+ //reset LFSR
+ if(!m_size)
+ m_lfsr = LFSR_INIT;
+ break;
+
+ case 2:
+ m_volume = (data & 0x07) * 0x800;
+ m_mode = (data & 0x18) >> 3;
+
+ //logerror("arcadia_sound write: vol:%d mode:%d\n",m_volume,m_mode );
+
+ if (m_mode != m_omode){
+ //not 100% sure about this, maybe we should not reset anything
+ //m_pos = 0;
+ m_tval = 0;
+ }
+ m_omode = m_mode;
+ break;
+ }
+}
diff --git a/src/mess/audio/arcadia.h b/src/mess/audio/arcadia.h
new file mode 100644
index 00000000000..32f903f108a
--- /dev/null
+++ b/src/mess/audio/arcadia.h
@@ -0,0 +1,41 @@
+#ifndef ARCADIA_SOUND_H_
+#define ARCADIA_SOUND_H_
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_ARCADIA_SOUND_ADD(_tag) \
+ MCFG_SOUND_ADD(_tag, ARCADIA_SOUND, 0)
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> arcadia_sound_device
+
+class arcadia_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ // construction/destruction
+ arcadia_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ DECLARE_WRITE8_MEMBER(write);
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+ sound_stream *m_channel;
+ UINT8 m_reg[3];
+ int m_size, m_pos,m_tval,m_nval;
+ unsigned m_mode, m_omode;
+ unsigned m_volume;
+ unsigned m_lfsr;
+};
+
+// device type definition
+extern const device_type ARCADIA_SOUND;
+
+#endif /* ARCADIA_SOUND_H_ */
diff --git a/src/mess/audio/channelf.c b/src/mess/audio/channelf.c
new file mode 100644
index 00000000000..e72884205da
--- /dev/null
+++ b/src/mess/audio/channelf.c
@@ -0,0 +1,152 @@
+#include "includes/channelf.h"
+
+
+static const int max_amplitude = 0x7fff;
+
+typedef struct _channelf_sound_state channelf_sound_state;
+struct _channelf_sound_state
+{
+ sound_stream *channel;
+ int sound_mode;
+ int incr;
+ float decay_mult;
+ int envelope;
+ UINT32 sample_counter;
+ int forced_ontime; // added for improved sound
+ int min_ontime; // added for improved sound
+};
+
+INLINE channelf_sound_state *get_safe_token(device_t *device)
+{
+ assert(device != NULL);
+ assert(device->type() == CHANNELF);
+ return (channelf_sound_state *)downcast<legacy_device_base *>(device)->token();
+}
+
+void channelf_sound_w(device_t *device, int mode)
+{
+ channelf_sound_state *state = get_safe_token(device);
+ if (mode == state->sound_mode)
+ return;
+
+ state->channel->update();
+ state->sound_mode = mode;
+
+ switch(mode)
+ {
+ case 0:
+ state->envelope = 0;
+ state->forced_ontime = 0; // added for improved sound
+ break;
+ case 1:
+ case 2:
+ case 3:
+ state->envelope = max_amplitude;
+ state->forced_ontime = state->min_ontime; // added for improved sound
+ break;
+ }
+}
+
+
+
+static STREAM_UPDATE( channelf_sh_update )
+{
+ channelf_sound_state *state = get_safe_token(device);
+ UINT32 mask = 0, target = 0;
+ stream_sample_t *buffer = outputs[0];
+ stream_sample_t *sample = buffer;
+
+ switch( state->sound_mode )
+ {
+ case 0: /* sound off */
+ memset(buffer,0,sizeof(*buffer)*samples);
+ return;
+
+ case 1: /* high tone (2V) - 1000Hz */
+ mask = 0x00010000;
+ target = 0x00010000;
+ break;
+ case 2: /* medium tone (4V) - 500Hz */
+ mask = 0x00020000;
+ target = 0x00020000;
+ break;
+ case 3: /* low (weird) tone (32V & 8V) */
+ mask = 0x00140000;
+ target = 0x00140000;
+ break;
+ }
+
+ while (samples-- > 0)
+ {
+ if ((state->forced_ontime > 0) || ((state->sample_counter & mask) == target)) // change made for improved sound
+ *sample++ = state->envelope;
+ else
+ *sample++ = 0;
+ state->sample_counter += state->incr;
+ state->envelope *= state->decay_mult;
+ if (state->forced_ontime > 0) // added for improved sound
+ state->forced_ontime -= 1; // added for improved sound
+ }
+}
+
+
+
+static DEVICE_START(channelf_sound)
+{
+ channelf_sound_state *state = get_safe_token(device);
+ int rate;
+
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, channelf_sh_update);
+ rate = device->machine().sample_rate();
+
+ /*
+ * 2V = 1000Hz ~= 3579535/224/16
+ * Note 2V on the schematic is not the 2V scanline counter -
+ * it is the 2V vertical pixel counter
+ * 1 pixel = 4 scanlines high
+ *
+ *
+ * This is a convenient way to generate the relevant frequencies,
+ * using a DDS (Direct Digital Synthesizer)
+ *
+ * Essentially, you want a counter to overflow some bit position
+ * at a fixed rate. So, you figure out a number which you can add
+ * to the counter at every sample, so that you will achieve this
+ *
+ * In this case, we want to overflow bit 16 and the 2V rate, 1000Hz.
+ * This means we also get bit 17 = 4V, bit 18 = 8V, etc.
+ */
+
+ /* This is the proper value to add per sample */
+ state->incr = 65536.0/(rate/1000.0/2.0);
+
+ // added for improved sound
+ /* This is the minimum forced ontime, in samples */
+ state->min_ontime = rate/1000*2; /* approx 2ms - estimated, not verified on HW */
+
+ /* This was measured, decay envelope with half life of ~9ms */
+ /* (this is decay multiplier per sample) */
+ state->decay_mult = exp((-0.693/9e-3)/rate);
+
+ /* initial conditions */
+ state->envelope = 0;
+}
+
+
+DEVICE_GET_INFO( channelf_sound )
+{
+ switch (state)
+ {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(channelf_sound_state); break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(channelf_sound); break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: strcpy(info->s, "Channel F"); break;
+ case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
+ }
+}
+
+DEFINE_LEGACY_SOUND_DEVICE(CHANNELF, channelf_sound);
diff --git a/src/mess/audio/dai.c b/src/mess/audio/dai.c
new file mode 100644
index 00000000000..89ba1beec62
--- /dev/null
+++ b/src/mess/audio/dai.c
@@ -0,0 +1,139 @@
+/***************************************************************************
+
+ audio/dai.c
+
+ Functions to emulate sound hardware of DAI Personal Computer
+
+ Krzysztof Strzecha
+
+****************************************************************************/
+
+#include "emu.h"
+#include "includes/dai.h"
+
+// device type definition
+const device_type DAI_SOUND = &device_creator<dai_sound_device>;
+
+
+//-------------------------------------------------
+// dai_sound_device - constructor
+//-------------------------------------------------
+
+dai_sound_device::dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DAI_SOUND, "DAI Custom Sound", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void dai_sound_device::device_start()
+{
+ m_mixer_channel = machine().sound().stream_alloc(*this, 0, 2, machine().sample_rate(), this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void dai_sound_device::device_reset()
+{
+ memset(m_dai_input, 0, sizeof(m_dai_input));
+ memset(m_osc_volume, 0, sizeof(m_osc_volume));
+ m_noise_volume = 0;
+}
+
+
+//-------------------------------------------------
+// channels 0/1/2 volume table
+//-------------------------------------------------
+
+const UINT16 dai_sound_device::s_osc_volume_table[] = {
+ 0, 500, 1000, 1500,
+ 2000, 2500, 3000, 3500,
+ 4000, 4500, 5000, 5500,
+ 6000, 6500, 7000, 7500
+};
+
+//-------------------------------------------------
+// noise volume table
+//-------------------------------------------------
+
+const UINT16 dai_sound_device::s_noise_volume_table[] = {
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 500, 1000, 1500, 2000,
+ 2500, 3000, 3500, 4000
+};
+
+
+//-------------------------------------------------
+// set_volume
+//-------------------------------------------------
+
+WRITE8_MEMBER(dai_sound_device::set_volume)
+{
+ m_mixer_channel->update();
+
+ switch (offset & 1)
+ {
+ case 0x00:
+ m_osc_volume[0] = data&0x0f;
+ m_osc_volume[1] = (data&0xf0)>>4;
+ break;
+
+ case 0x01:
+ m_osc_volume[2] = data&0x0f;
+ m_noise_volume = (data&0xf0)>>4;
+ }
+}
+
+//-------------------------------------------------
+// PIT callbacks
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER(dai_sound_device::set_input_ch0)
+{
+ m_mixer_channel->update();
+ m_dai_input[0] = state;
+}
+
+WRITE_LINE_MEMBER(dai_sound_device::set_input_ch1)
+{
+ m_mixer_channel->update();
+ m_dai_input[1] = state;
+}
+
+WRITE_LINE_MEMBER(dai_sound_device::set_input_ch2)
+{
+ m_mixer_channel->update();
+ m_dai_input[2] = state;
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle update requests for
+// our sound stream
+//-------------------------------------------------
+
+void dai_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ stream_sample_t *sample_left = outputs[0];
+ stream_sample_t *sample_right = outputs[1];
+
+ INT16 channel_0_signal = m_dai_input[0] ? s_osc_volume_table[m_osc_volume[0]] : -s_osc_volume_table[m_osc_volume[0]];
+ INT16 channel_1_signal = m_dai_input[1] ? s_osc_volume_table[m_osc_volume[1]] : -s_osc_volume_table[m_osc_volume[1]];
+ INT16 channel_2_signal = m_dai_input[2] ? s_osc_volume_table[m_osc_volume[2]] : -s_osc_volume_table[m_osc_volume[2]];
+
+ while (samples--)
+ {
+ INT16 noise = machine().rand()&0x01 ? s_noise_volume_table[m_noise_volume] : -s_noise_volume_table[m_noise_volume];
+
+ /* channel 0 + channel 1 + noise */
+ *sample_left++ = channel_0_signal + channel_1_signal + noise;
+
+ /* channel 1 + channel 2 + noise */
+ *sample_right++ = channel_1_signal + channel_2_signal + noise;
+ }
+}
diff --git a/src/mess/audio/dave.c b/src/mess/audio/dave.c
new file mode 100644
index 00000000000..023927c358d
--- /dev/null
+++ b/src/mess/audio/dave.c
@@ -0,0 +1,837 @@
+/**********************************************************************
+
+ "Dave" Sound Chip
+
+ DAVE SOUND CHIP FOUND IN ENTERPRISE
+
+ working:
+
+ - pure tone
+ - sampled sounds
+ - 1 kHz, 50 Hz and 1 Hz ints
+ - external ints (int1 and int2) - not correct speed yet
+
+**********************************************************************/
+
+#include "emu.h"
+#include "audio/dave.h"
+
+
+/***************************************************************************
+ MACROS / CONSTANTS
+***************************************************************************/
+
+#define STEP 0x08000
+
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+typedef struct _dave_t dave_t;
+struct _dave_t
+{
+ devcb_resolved_read8 reg_r;
+ devcb_resolved_write8 reg_w;
+ devcb_resolved_write_line int_callback;
+
+ unsigned char Regs[32];
+
+ /* int latches (used by 1Hz, int1 and int2) */
+ unsigned long int_latch;
+ /* int enables */
+ unsigned long int_enable;
+ /* int inputs */
+ unsigned long int_input;
+
+ unsigned long int_irq;
+
+ /* INTERRUPTS */
+
+ /* internal timer */
+ /* bit 2: 1kHz timer irq */
+ /* bit 1: 50kHz timer irq */
+ int timer_irq;
+ /* 1khz timer - divided into 1kHz, 50Hz and 1Hz timer */
+ emu_timer *int_timer;
+ /* state of 1kHz timer */
+ unsigned long one_khz_state;
+ /* state of 50Hz timer */
+ unsigned long fifty_hz_state;
+
+ /* counter used to trigger 50Hz from 1kHz timer */
+ unsigned long fifty_hz_count;
+ /* counter used to trigger 1Hz from 1kHz timer */
+ unsigned long one_hz_count;
+
+
+ /* SOUND SYNTHESIS */
+ int Period[4];
+ int Count[4];
+ int level[4];
+
+ /* these are used to force channels on/off */
+ /* if one of the or values is 0x0ff, this means
+ the volume will be forced on,else it is dependant on
+ the state of the wave */
+ int level_or[8];
+ /* if one of the values is 0x00, this means the
+ volume is forced off, else it is dependant on the wave */
+ int level_and[8];
+
+ /* these are the current channel volumes in MAME form */
+ int mame_volumes[8];
+
+ /* update step */
+ int UpdateStep;
+
+ sound_stream *sound_stream_var;
+
+ /* temp here */
+ int nick_virq;
+};
+
+
+/***************************************************************************
+ INLINE FUNCTIONS
+***************************************************************************/
+
+INLINE dave_t *get_token(device_t *device)
+{
+ assert(device != NULL);
+ assert(device->type() == DAVE);
+ return (dave_t *) downcast<legacy_device_base *>(device)->token();
+}
+
+
+
+INLINE const dave_interface *get_interface(device_t *device)
+{
+ assert(device != NULL);
+ assert(device->type() == DAVE);
+ return (const dave_interface *) device->static_config();
+}
+
+
+/***************************************************************************
+ PROTOTYPES
+***************************************************************************/
+
+static void dave_set_external_int_state(device_t *device, int IntID, int State);
+static TIMER_CALLBACK(dave_1khz_callback);
+static STREAM_UPDATE(dave_update_sound);
+
+
+/***************************************************************************
+ IMPLEMENTATION
+***************************************************************************/
+
+/*-------------------------------------------------
+ DEVICE_START( dave_sound )
+-------------------------------------------------*/
+
+static DEVICE_START( dave_sound )
+{
+ int i;
+ dave_t *dave = get_token(device);
+ const dave_interface *intf = get_interface(device);
+
+ memset(dave, 0, sizeof(*dave));
+
+ /* resolve callbacks */
+ dave->reg_r.resolve(intf->reg_r, *device);
+ dave->reg_w.resolve(intf->reg_w, *device);
+ dave->int_callback.resolve(intf->int_callback, *device);
+
+ /* temp! */
+ dave->nick_virq = 0;
+
+ /* initialise 1kHz timer */
+ dave->int_latch = 0;
+ dave->int_input = 0;
+ dave->int_enable = 0;
+ dave->timer_irq = 0;
+ dave->fifty_hz_state = 0;
+ dave->one_khz_state = 0;
+ dave->fifty_hz_count = DAVE_FIFTY_HZ_COUNTER_RELOAD;
+ dave->one_hz_count = DAVE_ONE_HZ_COUNTER_RELOAD;
+ device->machine().scheduler().timer_pulse(attotime::from_hz(1000), FUNC(dave_1khz_callback), 0, (void *) device);
+
+ for (i=0; i<3; i++)
+ {
+ dave->Period[i] = (STEP * device->machine().sample_rate()) / 125000;
+ dave->Count[i] = (STEP * device->machine().sample_rate()) / 125000;
+ dave->level[i] = 0;
+ }
+
+ /* dave has 3 tone channels and 1 noise channel.
+ the volumes are mixed internally and output as left and right volume */
+
+ /* 3 tone channels + 1 noise channel */
+ dave->sound_stream_var = device->machine().sound().stream_alloc(*device, 0, 2, device->machine().sample_rate(), NULL, dave_update_sound);
+}
+
+
+/*-------------------------------------------------
+ DEVICE_RESET( dave_sound )
+-------------------------------------------------*/
+
+static DEVICE_RESET( dave_sound )
+{
+ dave_t *dave = get_token(device);
+ int i;
+
+ for (i = 0; i < 32; i++)
+ dave->Regs[i] = 0;
+
+ dave_reg_w(device, 0x10, 0);
+ dave_reg_w(device, 0x11, 0);
+ dave_reg_w(device, 0x12, 0);
+ dave_reg_w(device, 0x13, 0);
+
+}
+
+
+/*-------------------------------------------------
+ dave_refresh_ints
+-------------------------------------------------*/
+
+static void dave_refresh_ints(device_t *device)
+{
+ dave_t *dave = get_token(device);
+ int int_wanted;
+
+ logerror("int latch: %02x enable: %02x input: %02x\n", (int) dave->int_latch, (int) dave->int_enable, (int) dave->int_input);
+
+ int_wanted = ((dave->int_enable<<1) & dave->int_latch) != 0;
+ dave->int_callback(int_wanted);
+}
+
+
+/*-------------------------------------------------
+ dave_refresh_selectable_int
+-------------------------------------------------*/
+
+static void dave_refresh_selectable_int(device_t *device)
+{
+ dave_t *dave = get_token(device);
+
+ /* update 1kHz/50Hz/tg latch and int input */
+ switch ((dave->Regs[7]>>5) & 0x03)
+ {
+ /* 1kHz */
+ case 0:
+ {
+ dave->int_latch &=~(1<<1);
+ dave->int_latch |= (dave->int_irq>>1) & 0x02;
+
+ /* set int input state */
+ dave->int_input &= ~(1<<0);
+ dave->int_input |= (dave->one_khz_state & 0x01)<<0;
+ }
+ break;
+
+ /* 50Hz */
+ case 1:
+ {
+ dave->int_latch &=~(1<<1);
+ dave->int_latch |= dave->int_irq & 0x02;
+
+ /* set int input state */
+ dave->int_input &= ~(1<<0);
+ dave->int_input |= (dave->fifty_hz_state & 0x01)<<0;
+ }
+ break;
+
+
+ default:
+ break;
+ }
+
+ dave_refresh_ints(device);
+}
+
+
+/*-------------------------------------------------
+ dave_1khz_callback
+-------------------------------------------------*/
+
+static TIMER_CALLBACK(dave_1khz_callback)
+{
+ device_t *device = (device_t *)ptr;
+ dave_t *dave = get_token(device);
+
+ /* time over - want int */
+ dave->one_khz_state ^= 0x0ffffffff;
+
+ /* lo-high transition causes int */
+ if (dave->one_khz_state!=0)
+ {
+ dave->int_irq |=(1<<2);
+ }
+
+
+ /* update fifty Hz counter */
+ dave->fifty_hz_count--;
+
+ if (dave->fifty_hz_count==0)
+ {
+ /* these two lines are temp here */
+ dave->nick_virq ^= 0x0ffffffff;
+ dave_set_external_int_state(device, DAVE_INT1_ID, dave->nick_virq);
+
+
+ dave->fifty_hz_count = DAVE_FIFTY_HZ_COUNTER_RELOAD;
+ dave->fifty_hz_state^=0x0ffffffff;
+
+ if (dave->fifty_hz_state!=0)
+ {
+ dave->int_irq |= (1<<1);
+ }
+ }
+
+ dave->one_hz_count--;
+
+ if (dave->one_hz_count==0)
+ {
+ /* reload counter */
+ dave->one_hz_count = DAVE_ONE_HZ_COUNTER_RELOAD;
+
+ /* change state */
+ dave->int_input ^= (1<<2);
+
+ if (dave->int_input & (1<<2))
+ {
+ /* transition from 0->1 */
+ /* int requested */
+ dave->int_latch |=(1<<3);
+ }
+ }
+
+ dave_refresh_selectable_int(device);
+}
+
+
+/*-------------------------------------------------
+ dave_update_sound
+-------------------------------------------------*/
+
+static STREAM_UPDATE( dave_update_sound )
+{
+ dave_t *dave = get_token(device);
+ stream_sample_t *buffer1, *buffer2;
+ /* 0 = channel 0 left volume, 1 = channel 0 right volume,
+ 2 = channel 1 left volume, 3 = channel 1 right volume,
+ 4 = channel 2 left volume, 5 = channel 2 right volume
+ 6 = noise channel left volume, 7 = noise channel right volume */
+ int output_volumes[8];
+ int left_volume;
+ int right_volume;
+
+ //logerror("sound update!\n");
+
+ buffer1 = outputs[0];
+ buffer2 = outputs[1];
+
+ while (samples)
+ {
+ int vol[4];
+ int i;
+
+ /* vol[] keeps track of how long each square wave stays */
+ /* in the 1 position during the sample period. */
+ vol[0] = vol[1] = vol[2] = vol[3] = 0;
+
+ for (i = 0;i < 3;i++)
+ {
+ if ((dave->Regs[7] & (1<<i))==0)
+ {
+
+ if (dave->level[i]) vol[i] += dave->Count[i];
+ dave->Count[i] -= STEP;
+ /* Period[i] is the half period of the square wave. Here, in each */
+ /* loop I add Period[i] twice, so that at the end of the loop the */
+ /* square wave is in the same status (0 or 1) it was at the start. */
+ /* vol[i] is also incremented by Period[i], since the wave has been 1 */
+ /* exactly half of the time, regardless of the initial position. */
+ /* If we exit the loop in the middle, Output[i] has to be inverted */
+ /* and vol[i] incremented only if the exit status of the square */
+ /* wave is 1. */
+ while (dave->Count[i] <= 0)
+ {
+ dave->Count[i] += dave->Period[i];
+ if (dave->Count[i] > 0)
+ {
+ dave->level[i] ^= 0x0ffffffff;
+ if (dave->level[i]) vol[i] += dave->Period[i];
+ break;
+ }
+ dave->Count[i] += dave->Period[i];
+ vol[i] += dave->Period[i];
+ }
+ if (dave->level[i])
+ vol[i] -= dave->Count[i];
+ }
+ }
+
+ /* update volume outputs */
+
+ /* setup output volumes for each channel */
+ /* channel 0 */
+ output_volumes[0] = ((dave->level[0] & dave->level_and[0]) | dave->level_or[0]) & dave->mame_volumes[0];
+ output_volumes[1] = ((dave->level[0] & dave->level_and[1]) | dave->level_or[1]) & dave->mame_volumes[4];
+ /* channel 1 */
+ output_volumes[2] = ((dave->level[1] & dave->level_and[2]) | dave->level_or[2]) & dave->mame_volumes[1];
+ output_volumes[3] = ((dave->level[1] & dave->level_and[3]) | dave->level_or[3]) & dave->mame_volumes[5];
+ /* channel 2 */
+ output_volumes[4] = ((dave->level[2] & dave->level_and[4]) | dave->level_or[4]) & dave->mame_volumes[2];
+ output_volumes[5] = ((dave->level[2] & dave->level_and[5]) | dave->level_or[5]) & dave->mame_volumes[6];
+ /* channel 3 */
+ output_volumes[6] = ((dave->level[3] & dave->level_and[6]) | dave->level_or[6]) & dave->mame_volumes[3];
+ output_volumes[7] = ((dave->level[3] & dave->level_and[7]) | dave->level_or[7]) & dave->mame_volumes[7];
+
+ left_volume = (output_volumes[0] + output_volumes[2] + output_volumes[4] + output_volumes[6])>>2;
+ right_volume = (output_volumes[1] + output_volumes[3] + output_volumes[5] + output_volumes[7])>>2;
+
+ *(buffer1++) = left_volume;
+ *(buffer2++) = right_volume;
+
+ samples--;
+ }
+}
+
+
+/*-------------------------------------------------
+ dave_sound_w - used to update sound output
+ based on data writes
+-------------------------------------------------*/
+
+static WRITE8_DEVICE_HANDLER(dave_sound_w)
+{
+ dave_t *dave = get_token(device);
+
+ /* update stream */
+ dave->sound_stream_var->update();
+
+ /* new write */
+ switch (offset)
+ {
+ /* channel 0 down-counter */
+ case 0:
+ case 1:
+ /* channel 1 down-counter */
+ case 2:
+ case 3:
+ /* channel 2 down-counter */
+ case 4:
+ case 5:
+ {
+ int count = 0;
+ int channel_index = offset>>1;
+
+ /* Fout = 125,000 / (n+1) Hz */
+
+ /* sample rate/clock */
+
+
+ /* get down-count */
+ switch (offset & 0x01)
+ {
+ case 0:
+ {
+ count = (data & 0x0ff) | ((dave->Regs[offset+1] & 0x0f)<<8);
+ }
+ break;
+
+ case 1:
+ {
+ count = (dave->Regs[offset-1] & 0x0ff) | ((data & 0x0f)<<8);
+
+ }
+ break;
+ }
+
+ count++;
+
+
+ dave->Period[channel_index] = ((STEP * device->machine().sample_rate())/125000) * count;
+
+ }
+ break;
+
+ /* channel 0 left volume */
+ case 8:
+ /* channel 1 left volume */
+ case 9:
+ /* channel 2 left volume */
+ case 10:
+ /* noise channel left volume */
+ case 11:
+ /* channel 0 right volume */
+ case 12:
+ /* channel 1 right volume */
+ case 13:
+ /* channel 2 right volume */
+ case 14:
+ /* noise channel right volume */
+ case 15:
+ {
+ /* update mame version of volume from data written */
+ /* 0x03f->0x07e00. Max is 0x07fff */
+ /* I believe the volume is linear - to be checked! */
+ dave->mame_volumes[offset-8] = (data & 0x03f)<<9;
+ }
+ break;
+
+ case 7:
+ {
+ /* force => the value of this register is forced regardless of the wave
+ state,
+ remove => this value is force to zero so that it has no influence over
+ the final volume calculation, regardless of wave state
+ use => the volume value is dependant on the wave state and is included
+ in the final volume calculation */
+
+ logerror("selectable int ");
+ switch ((data>>5) & 0x03)
+ {
+ case 0:
+ {
+ logerror("1kHz\n");
+ }
+ break;
+
+ case 1:
+ {
+ logerror("50Hz\n");
+ }
+ break;
+
+ case 2:
+ {
+ logerror("tone channel 0\n");
+ }
+ break;
+
+ case 3:
+ {
+ logerror("tone channel 1\n");
+ }
+ break;
+ }
+
+
+
+ /* turn L.H audio output into D/A, outputting value in R8 */
+ if (data & (1<<3))
+ {
+ /* force r8 value */
+ dave->level_or[0] = 0x0ffff;
+ dave->level_and[0] = 0x00;
+
+ /* remove r9 value */
+ dave->level_or[2] = 0x000;
+ dave->level_and[2] = 0x00;
+
+ /* remove r10 value */
+ dave->level_or[4] = 0x000;
+ dave->level_and[4] = 0x00;
+
+ /* remove r11 value */
+ dave->level_or[6] = 0x000;
+ dave->level_and[6] = 0x00;
+ }
+ else
+ {
+ /* use r8 value */
+ dave->level_or[0] = 0x000;
+ dave->level_and[0] = 0xffff;
+
+ /* use r9 value */
+ dave->level_or[2] = 0x000;
+ dave->level_and[2] = 0xffff;
+
+ /* use r10 value */
+ dave->level_or[4] = 0x000;
+ dave->level_and[4] = 0xffff;
+
+ /* use r11 value */
+ dave->level_or[6] = 0x000;
+ dave->level_and[6] = 0xffff;
+ }
+
+ /* turn L.H audio output into D/A, outputting value in R12 */
+ if (data & (1<<4))
+ {
+ /* force r12 value */
+ dave->level_or[1] = 0x0ffff;
+ dave->level_and[1] = 0x00;
+
+ /* remove r13 value */
+ dave->level_or[3] = 0x000;
+ dave->level_and[3] = 0x00;
+
+ /* remove r14 value */
+ dave->level_or[5] = 0x000;
+ dave->level_and[5] = 0x00;
+
+ /* remove r15 value */
+ dave->level_or[7] = 0x000;
+ dave->level_and[7] = 0x00;
+ }
+ else
+ {
+ /* use r12 value */
+ dave->level_or[1] = 0x000;
+ dave->level_and[1] = 0xffff;
+
+ /* use r13 value */
+ dave->level_or[3] = 0x000;
+ dave->level_and[3] = 0xffff;
+
+ /* use r14 value */
+ dave->level_or[5] = 0x000;
+ dave->level_and[5] = 0xffff;
+
+ /* use r15 value */
+ dave->level_or[7] = 0x000;
+ dave->level_and[7] = 0xffff;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+/*-------------------------------------------------
+ dave_reg_w
+-------------------------------------------------*/
+
+WRITE8_DEVICE_HANDLER ( dave_reg_w )
+{
+ dave_t *dave = get_token(device);
+
+ logerror("dave w: %04x %02x\n",offset,data);
+
+ dave_sound_w(device, offset, data);
+
+ dave->Regs[offset & 0x01f] = data;
+
+ switch (offset)
+ {
+ case 0x07:
+ {
+ dave_refresh_selectable_int(device);
+ }
+ break;
+
+ case 0x014:
+ {
+ /* enabled ints */
+ dave->int_enable = data & 0x055;
+ /* clear latches */
+ dave->int_latch &=~(data & 0x0aa);
+
+ /* reset 1kHz, 50Hz latch */
+ if (data & (1<<1))
+ {
+ dave->int_irq = 0;
+ }
+
+ /* refresh ints */
+ dave_refresh_ints(device);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ dave->reg_w(offset, data);
+}
+
+
+/*-------------------------------------------------
+ dave_set_reg
+-------------------------------------------------*/
+
+void dave_set_reg(device_t *device, offs_t offset, UINT8 data)
+{
+ dave_t *dave = get_token(device);
+ dave->Regs[offset & 0x01f] = data;
+}
+
+
+/*-------------------------------------------------
+ dave_reg_r
+-------------------------------------------------*/
+
+READ8_DEVICE_HANDLER( dave_reg_r )
+{
+ dave_t *dave = get_token(device);
+
+ logerror("dave r: %04x\n",offset);
+
+ dave->reg_r(offset);
+
+ switch (offset)
+ {
+ case 0x000:
+ case 0x001:
+ case 0x002:
+ case 0x003:
+ case 0x004:
+ case 0x005:
+ case 0x006:
+ case 0x007:
+ case 0x008:
+ case 0x009:
+ case 0x00a:
+ case 0x00b:
+ case 0x00c:
+ case 0x00d:
+ case 0x00e:
+ case 0x00f:
+ case 0x018:
+ case 0x019:
+ case 0x01a:
+ case 0x01b:
+ case 0x01c:
+ case 0x01d:
+ case 0x01e:
+ case 0x01f:
+ return 0x0ff;
+
+ case 0x014:
+ return (dave->int_latch & 0x0aa) | (dave->int_input & 0x055);
+
+
+ default:
+ break;
+ }
+
+ return dave->Regs[offset & 0x01f];
+}
+
+
+/*-------------------------------------------------
+ dave_set_external_int_state - negative edge
+ triggered
+-------------------------------------------------*/
+
+static void dave_set_external_int_state(device_t *device, int IntID, int State)
+{
+ dave_t *dave = get_token(device);
+
+ switch (IntID)
+ {
+ /* connected to Nick virq */
+ case DAVE_INT1_ID:
+ {
+ int previous_state;
+
+ previous_state = dave->int_input;
+
+ dave->int_input &=~(1<<4);
+
+ if (State)
+ {
+ dave->int_input |=(1<<4);
+ }
+
+ if ((previous_state ^ dave->int_input) & (1<<4))
+ {
+ /* changed state */
+
+ if (dave->int_input & (1<<4))
+ {
+ /* int request */
+ dave->int_latch |= (1<<5);
+
+ dave_refresh_ints(device);
+ }
+ }
+
+ }
+ break;
+
+ case DAVE_INT2_ID:
+ {
+ int previous_state;
+
+ previous_state = dave->int_input;
+
+ dave->int_input &= ~(1<<6);
+
+ if (State)
+ {
+ dave->int_input |=(1<<6);
+ }
+
+ if ((previous_state ^ dave->int_input) & (1<<6))
+ {
+ /* changed state */
+
+ if (dave->int_input & (1<<6))
+ {
+ /* int request */
+ dave->int_latch|=(1<<7);
+
+ dave_refresh_ints(device);
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+/*
+Reg 4 READ:
+
+b7 = 1: INT2 latch set
+b6 = INT2 input pin
+b5 = 1: INT1 latch set
+b4 = INT1 input pin
+b3 = 1: 1Hz latch set
+b2 = 1Hz input pin
+b1 = 1: 1kHz/50Hz/TG latch set
+b0 = 1kHz/50Hz/TG input
+
+Reg 4 WRITE:
+
+b7 = 1: Reset INT2 latch
+b6 = 1: Enable INT2
+b5 = 1: Reset INT1 latch
+b4 = 1: Enable INT1
+b3 = 1: Reset 1Hz interrupt latch
+b2 = 1: Enable 1Hz interrupt
+b1 = 1: Reset 1kHz/50Hz/TG latch
+b0 = 1: Enable 1kHz/50Hz/TG latch
+*/
+
+
+
+DEVICE_GET_INFO( dave_sound )
+{
+ switch (state)
+ {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(dave_t); break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(dave_sound); break;
+ case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(dave_sound); break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: strcpy(info->s, "Dave"); break;
+ case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
+ }
+}
+
+DEFINE_LEGACY_SOUND_DEVICE(DAVE, dave_sound);
diff --git a/src/mess/audio/dave.h b/src/mess/audio/dave.h
new file mode 100644
index 00000000000..dfe56b9e705
--- /dev/null
+++ b/src/mess/audio/dave.h
@@ -0,0 +1,57 @@
+/**********************************************************************
+
+ "Dave" Sound Chip
+
+**********************************************************************/
+
+#ifndef __DAVE_H__
+#define __DAVE_H__
+
+#include "devcb.h"
+
+
+/***************************************************************************
+ MACROS / CONSTANTS
+***************************************************************************/
+
+DECLARE_LEGACY_SOUND_DEVICE(DAVE, dave_sound);
+
+#define DAVE_INT_SELECTABLE 0
+#define DAVE_INT_1KHZ_50HZ_TG 1
+#define DAVE_INT_1HZ 2
+#define DAVE_INT_INT1 3
+#define DAVE_INT_INT2 4
+
+#define DAVE_FIFTY_HZ_COUNTER_RELOAD 20
+#define DAVE_ONE_HZ_COUNTER_RELOAD 1000
+
+/* id's of external ints */
+enum
+{
+ DAVE_INT1_ID,
+ DAVE_INT2_ID
+};
+
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+typedef struct _dave_interface dave_interface;
+struct _dave_interface
+{
+ devcb_read8 reg_r;
+ devcb_write8 reg_w;
+ devcb_write_line int_callback;
+};
+
+
+/***************************************************************************
+ PROTOTYPES
+***************************************************************************/
+void dave_set_reg(device_t *device, offs_t offset, UINT8 data);
+
+READ8_DEVICE_HANDLER ( dave_reg_r );
+WRITE8_DEVICE_HANDLER ( dave_reg_w );
+
+#endif /* __DAVE_H__ */
diff --git a/src/mess/audio/gb.c b/src/mess/audio/gb.c
new file mode 100644
index 00000000000..ba037c4c10e
--- /dev/null
+++ b/src/mess/audio/gb.c
@@ -0,0 +1,775 @@
+/**************************************************************************************
+* Game Boy sound emulation (c) Anthony Kruize (trandor@labyrinth.net.au)
+*
+* Anyways, sound on the Game Boy consists of 4 separate 'channels'
+* Sound1 = Quadrangular waves with SWEEP and ENVELOPE functions (NR10,11,12,13,14)
+* Sound2 = Quadrangular waves with ENVELOPE functions (NR21,22,23,24)
+* Sound3 = Wave patterns from WaveRAM (NR30,31,32,33,34)
+* Sound4 = White noise with an envelope (NR41,42,43,44)
+*
+* Each sound channel has 2 modes, namely ON and OFF... whoa
+*
+* These tend to be the two most important equations in
+* converting between Hertz and GB frequency registers:
+* (Sounds will have a 2.4% higher frequency on Super GB.)
+* gb = 2048 - (131072 / Hz)
+* Hz = 131072 / (2048 - gb)
+*
+* Changes:
+*
+* 10/2/2002 AK - Preliminary sound code.
+* 13/2/2002 AK - Added a hack for mode 4, other fixes.
+* 23/2/2002 AK - Use lookup tables, added sweep to mode 1. Re-wrote the square
+* wave generation.
+* 13/3/2002 AK - Added mode 3, better lookup tables, other adjustments.
+* 15/3/2002 AK - Mode 4 can now change frequencies.
+* 31/3/2002 AK - Accidently forgot to handle counter/consecutive for mode 1.
+* 3/4/2002 AK - Mode 1 sweep can still occur if shift is 0. Don't let frequency
+* go past the maximum allowed value. Fixed Mode 3 length table.
+* Slight adjustment to Mode 4's period table generation.
+* 5/4/2002 AK - Mode 4 is done correctly, using a polynomial counter instead
+* of being a total hack.
+* 6/4/2002 AK - Slight tweak to mode 3's frequency calculation.
+* 13/4/2002 AK - Reset envelope value when sound is initialized.
+* 21/4/2002 AK - Backed out the mode 3 frequency calculation change.
+* Merged init functions into gameboy_sound_w().
+* 14/5/2002 AK - Removed magic numbers in the fixed point math.
+* 12/6/2002 AK - Merged SOUNDx structs into one SOUND struct.
+* 26/10/2002 AK - Finally fixed channel 3!
+*
+***************************************************************************************/
+
+#include "emu.h"
+#include "gb.h"
+
+
+/***************************************************************************
+ CONSTANTS
+***************************************************************************/
+
+#define NR10 0x00
+#define NR11 0x01
+#define NR12 0x02
+#define NR13 0x03
+#define NR14 0x04
+#define NR21 0x06
+#define NR22 0x07
+#define NR23 0x08
+#define NR24 0x09
+#define NR30 0x0A
+#define NR31 0x0B
+#define NR32 0x0C
+#define NR33 0x0D
+#define NR34 0x0E
+#define NR41 0x10
+#define NR42 0x11
+#define NR43 0x12
+#define NR44 0x13
+#define NR50 0x14
+#define NR51 0x15
+#define NR52 0x16
+#define AUD3W0 0x20
+#define AUD3W1 0x21
+#define AUD3W2 0x22
+#define AUD3W3 0x23
+#define AUD3W4 0x24
+#define AUD3W5 0x25
+#define AUD3W6 0x26
+#define AUD3W7 0x27
+#define AUD3W8 0x28
+#define AUD3W9 0x29
+#define AUD3WA 0x2A
+#define AUD3WB 0x2B
+#define AUD3WC 0x2C
+#define AUD3WD 0x2D
+#define AUD3WE 0x2E
+#define AUD3WF 0x2F
+
+#define LEFT 1
+#define RIGHT 2
+#define MAX_FREQUENCIES 2048
+#define FIXED_POINT 16
+
+/* Represents wave duties of 12.5%, 25%, 50% and 75% */
+static const float wave_duty_table[4] = { 8.0f, 4.0f, 2.0f, 1.33f };
+
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+struct SOUND
+{
+ /* Common */
+ UINT8 on;
+ UINT8 channel;
+ INT32 length;
+ INT32 pos;
+ UINT32 period;
+ INT32 count;
+ INT8 mode;
+ /* Mode 1, 2, 3 */
+ INT8 duty;
+ /* Mode 1, 2, 4 */
+ INT32 env_value;
+ INT8 env_direction;
+ INT32 env_length;
+ INT32 env_count;
+ INT8 signal;
+ /* Mode 1 */
+ UINT32 frequency;
+ INT32 swp_shift;
+ INT32 swp_direction;
+ INT32 swp_time;
+ INT32 swp_count;
+ /* Mode 3 */
+ INT8 level;
+ UINT8 offset;
+ UINT32 dutycount;
+ /* Mode 4 */
+ INT32 ply_step;
+ INT16 ply_value;
+};
+
+struct SOUNDC
+{
+ UINT8 on;
+ UINT8 vol_left;
+ UINT8 vol_right;
+ UINT8 mode1_left;
+ UINT8 mode1_right;
+ UINT8 mode2_left;
+ UINT8 mode2_right;
+ UINT8 mode3_left;
+ UINT8 mode3_right;
+ UINT8 mode4_left;
+ UINT8 mode4_right;
+};
+
+
+typedef struct _gb_sound_t gb_sound_t;
+struct _gb_sound_t
+{
+ sound_stream *channel;
+ int rate;
+
+ INT32 env_length_table[8];
+ INT32 swp_time_table[8];
+ UINT32 period_table[MAX_FREQUENCIES];
+ UINT32 period_mode3_table[MAX_FREQUENCIES];
+ UINT32 period_mode4_table[8][16];
+ UINT32 length_table[64];
+ UINT32 length_mode3_table[256];
+
+ struct SOUND snd_1;
+ struct SOUND snd_2;
+ struct SOUND snd_3;
+ struct SOUND snd_4;
+ struct SOUNDC snd_control;
+
+ UINT8 snd_regs[0x30];
+};
+
+
+
+/***************************************************************************
+ INLINE FUNCTIONS
+***************************************************************************/
+
+INLINE gb_sound_t *get_token(device_t *device)
+{
+ assert(device != NULL);
+ assert(device->type() == GAMEBOY);
+ return (gb_sound_t *) downcast<legacy_device_base *>(device)->token();
+}
+
+
+/***************************************************************************
+ PROTOTYPES
+***************************************************************************/
+
+static STREAM_UPDATE( gameboy_update );
+
+
+/***************************************************************************
+ IMPLEMENTATION
+***************************************************************************/
+
+READ8_DEVICE_HANDLER( gb_wave_r )
+{
+ gb_sound_t *gb = get_token(device);
+
+ /* TODO: properly emulate scrambling of wave ram area when playback is active */
+ return ( gb->snd_regs[ AUD3W0 + offset ] | gb->snd_3.on );
+}
+
+WRITE8_DEVICE_HANDLER( gb_wave_w )
+{
+ gb_sound_t *gb = get_token(device);
+ gb->snd_regs[ AUD3W0 + offset ] = data;
+}
+
+READ8_DEVICE_HANDLER( gb_sound_r )
+{
+ gb_sound_t *gb = get_token(device);
+
+ switch( offset ) {
+ case 0x05:
+ case 0x0F:
+ return 0xFF;
+ case NR52:
+ return 0x70 | gb->snd_regs[offset];
+ default:
+ return gb->snd_regs[offset];
+ }
+}
+
+static void gb_sound_w_internal(device_t *device, int offset, UINT8 data )
+{
+ gb_sound_t *gb = get_token(device);
+
+ /* Store the value */
+ gb->snd_regs[offset] = data;
+
+ switch( offset )
+ {
+ /*MODE 1 */
+ case NR10: /* Sweep (R/W) */
+ gb->snd_1.swp_shift = data & 0x7;
+ gb->snd_1.swp_direction = (data & 0x8) >> 3;
+ gb->snd_1.swp_direction |= gb->snd_1.swp_direction - 1;
+ gb->snd_1.swp_time = gb->swp_time_table[ (data & 0x70) >> 4 ];
+ break;
+ case NR11: /* Sound length/Wave pattern duty (R/W) */
+ gb->snd_1.duty = (data & 0xC0) >> 6;
+ gb->snd_1.length = gb->length_table[data & 0x3F];
+ break;
+ case NR12: /* Envelope (R/W) */
+ gb->snd_1.env_value = data >> 4;
+ gb->snd_1.env_direction = (data & 0x8) >> 3;
+ gb->snd_1.env_direction |= gb->snd_1.env_direction - 1;
+ gb->snd_1.env_length = gb->env_length_table[data & 0x7];
+ break;
+ case NR13: /* Frequency lo (R/W) */
+ gb->snd_1.frequency = ((gb->snd_regs[NR14]&0x7)<<8) | gb->snd_regs[NR13];
+ gb->snd_1.period = gb->period_table[gb->snd_1.frequency];
+ break;
+ case NR14: /* Frequency hi / Initialize (R/W) */
+ gb->snd_1.mode = (data & 0x40) >> 6;
+ gb->snd_1.frequency = ((gb->snd_regs[NR14]&0x7)<<8) | gb->snd_regs[NR13];
+ gb->snd_1.period = gb->period_table[gb->snd_1.frequency];
+ if( data & 0x80 )
+ {
+ if( !gb->snd_1.on )
+ gb->snd_1.pos = 0;
+ gb->snd_1.on = 1;
+ gb->snd_1.count = 0;
+ gb->snd_1.env_value = gb->snd_regs[NR12] >> 4;
+ gb->snd_1.env_count = 0;
+ gb->snd_1.swp_count = 0;
+ gb->snd_1.signal = 0x1;
+ gb->snd_regs[NR52] |= 0x1;
+ }
+ break;
+
+ /*MODE 2 */
+ case NR21: /* Sound length/Wave pattern duty (R/W) */
+ gb->snd_2.duty = (data & 0xC0) >> 6;
+ gb->snd_2.length = gb->length_table[data & 0x3F];
+ break;
+ case NR22: /* Envelope (R/W) */
+ gb->snd_2.env_value = data >> 4;
+ gb->snd_2.env_direction = (data & 0x8 ) >> 3;
+ gb->snd_2.env_direction |= gb->snd_2.env_direction - 1;
+ gb->snd_2.env_length = gb->env_length_table[data & 0x7];
+ break;
+ case NR23: /* Frequency lo (R/W) */
+ gb->snd_2.period = gb->period_table[((gb->snd_regs[NR24]&0x7)<<8) | gb->snd_regs[NR23]];
+ break;
+ case NR24: /* Frequency hi / Initialize (R/W) */
+ gb->snd_2.mode = (data & 0x40) >> 6;
+ gb->snd_2.period = gb->period_table[((gb->snd_regs[NR24]&0x7)<<8) | gb->snd_regs[NR23]];
+ if( data & 0x80 )
+ {
+ if( !gb->snd_2.on )
+ gb->snd_2.pos = 0;
+ gb->snd_2.on = 1;
+ gb->snd_2.count = 0;
+ gb->snd_2.env_value = gb->snd_regs[NR22] >> 4;
+ gb->snd_2.env_count = 0;
+ gb->snd_2.signal = 0x1;
+ gb->snd_regs[NR52] |= 0x2;
+ }
+ break;
+
+ /*MODE 3 */
+ case NR30: /* Sound On/Off (R/W) */
+ gb->snd_3.on = (data & 0x80) >> 7;
+ break;
+ case NR31: /* Sound Length (R/W) */
+ gb->snd_3.length = gb->length_mode3_table[data];
+ break;
+ case NR32: /* Select Output Level */
+ gb->snd_3.level = (data & 0x60) >> 5;
+ break;
+ case NR33: /* Frequency lo (W) */
+ gb->snd_3.period = gb->period_mode3_table[((gb->snd_regs[NR34]&0x7)<<8) + gb->snd_regs[NR33]];
+ break;
+ case NR34: /* Frequency hi / Initialize (W) */
+ gb->snd_3.mode = (data & 0x40) >> 6;
+ gb->snd_3.period = gb->period_mode3_table[((gb->snd_regs[NR34]&0x7)<<8) + gb->snd_regs[NR33]];
+ if( data & 0x80 )
+ {
+ if( !gb->snd_3.on )
+ {
+ gb->snd_3.pos = 0;
+ gb->snd_3.offset = 0;
+ gb->snd_3.duty = 0;
+ }
+ gb->snd_3.on = 1;
+ gb->snd_3.count = 0;
+ gb->snd_3.duty = 1;
+ gb->snd_3.dutycount = 0;
+ gb->snd_regs[NR52] |= 0x4;
+ }
+ break;
+
+ /*MODE 4 */
+ case NR41: /* Sound Length (R/W) */
+ gb->snd_4.length = gb->length_table[data & 0x3F];
+ break;
+ case NR42: /* Envelope (R/W) */
+ gb->snd_4.env_value = data >> 4;
+ gb->snd_4.env_direction = (data & 0x8 ) >> 3;
+ gb->snd_4.env_direction |= gb->snd_4.env_direction - 1;
+ gb->snd_4.env_length = gb->env_length_table[data & 0x7];
+ break;
+ case NR43: /* Polynomial Counter/Frequency */
+ gb->snd_4.period = gb->period_mode4_table[data & 0x7][(data & 0xF0) >> 4];
+ gb->snd_4.ply_step = (data & 0x8) >> 3;
+ break;
+ case NR44: /* Counter/Consecutive / Initialize (R/W) */
+ gb->snd_4.mode = (data & 0x40) >> 6;
+ if( data & 0x80 )
+ {
+ if( !gb->snd_4.on )
+ gb->snd_4.pos = 0;
+ gb->snd_4.on = 1;
+ gb->snd_4.count = 0;
+ gb->snd_4.env_value = gb->snd_regs[NR42] >> 4;
+ gb->snd_4.env_count = 0;
+ gb->snd_4.signal = device->machine().rand();
+ gb->snd_4.ply_value = 0x7fff;
+ gb->snd_regs[NR52] |= 0x8;
+ }
+ break;
+
+ /* CONTROL */
+ case NR50: /* Channel Control / On/Off / Volume (R/W) */
+ gb->snd_control.vol_left = data & 0x7;
+ gb->snd_control.vol_right = (data & 0x70) >> 4;
+ break;
+ case NR51: /* Selection of Sound Output Terminal */
+ gb->snd_control.mode1_right = data & 0x1;
+ gb->snd_control.mode1_left = (data & 0x10) >> 4;
+ gb->snd_control.mode2_right = (data & 0x2) >> 1;
+ gb->snd_control.mode2_left = (data & 0x20) >> 5;
+ gb->snd_control.mode3_right = (data & 0x4) >> 2;
+ gb->snd_control.mode3_left = (data & 0x40) >> 6;
+ gb->snd_control.mode4_right = (data & 0x8) >> 3;
+ gb->snd_control.mode4_left = (data & 0x80) >> 7;
+ break;
+ case NR52: /* Sound On/Off (R/W) */
+ /* Only bit 7 is writable, writing to bits 0-3 does NOT enable or
+ disable sound. They are read-only */
+ gb->snd_control.on = (data & 0x80) >> 7;
+ if( !gb->snd_control.on )
+ {
+ gb_sound_w_internal( device, NR10, 0x80 );
+ gb_sound_w_internal( device, NR11, 0x3F );
+ gb_sound_w_internal( device, NR12, 0x00 );
+ gb_sound_w_internal( device, NR13, 0xFE );
+ gb_sound_w_internal( device, NR14, 0xBF );
+// gb_sound_w_internal( device, NR20, 0xFF );
+ gb_sound_w_internal( device, NR21, 0x3F );
+ gb_sound_w_internal( device, NR22, 0x00 );
+ gb_sound_w_internal( device, NR23, 0xFF );
+ gb_sound_w_internal( device, NR24, 0xBF );
+ gb_sound_w_internal( device, NR30, 0x7F );
+ gb_sound_w_internal( device, NR31, 0xFF );
+ gb_sound_w_internal( device, NR32, 0x9F );
+ gb_sound_w_internal( device, NR33, 0xFF );
+ gb_sound_w_internal( device, NR34, 0xBF );
+// gb_sound_w_internal( device, NR40, 0xFF );
+ gb_sound_w_internal( device, NR41, 0xFF );
+ gb_sound_w_internal( device, NR42, 0x00 );
+ gb_sound_w_internal( device, NR43, 0x00 );
+ gb_sound_w_internal( device, NR44, 0xBF );
+ gb_sound_w_internal( device, NR50, 0x00 );
+ gb_sound_w_internal( device, NR51, 0x00 );
+ gb->snd_1.on = 0;
+ gb->snd_2.on = 0;
+ gb->snd_3.on = 0;
+ gb->snd_4.on = 0;
+ gb->snd_regs[offset] = 0;
+ }
+ break;
+ }
+}
+
+WRITE8_DEVICE_HANDLER( gb_sound_w )
+{
+ gb_sound_t *gb = get_token(device);
+
+ /* change in registers so update first */
+ gb->channel->update();
+
+ /* Only register NR52 is accessible if the sound controller is disabled */
+ if( !gb->snd_control.on && offset != NR52 )
+ {
+ return;
+ }
+
+ gb_sound_w_internal( device, offset, data );
+}
+
+
+
+static STREAM_UPDATE( gameboy_update )
+{
+ gb_sound_t *gb = get_token(device);
+ stream_sample_t sample, left, right, mode4_mask;
+
+ while( samples-- > 0 )
+ {
+ left = right = 0;
+
+ /* Mode 1 - Wave with Envelope and Sweep */
+ if( gb->snd_1.on )
+ {
+ sample = gb->snd_1.signal * gb->snd_1.env_value;
+ gb->snd_1.pos++;
+ if( gb->snd_1.pos == (UINT32)(gb->snd_1.period / wave_duty_table[gb->snd_1.duty]) >> FIXED_POINT)
+ {
+ gb->snd_1.signal = -gb->snd_1.signal;
+ }
+ else if( gb->snd_1.pos > (gb->snd_1.period >> FIXED_POINT) )
+ {
+ gb->snd_1.pos = 0;
+ gb->snd_1.signal = -gb->snd_1.signal;
+ }
+
+ if( gb->snd_1.length && gb->snd_1.mode )
+ {
+ gb->snd_1.count++;
+ if( gb->snd_1.count >= gb->snd_1.length )
+ {
+ gb->snd_1.on = 0;
+ gb->snd_regs[NR52] &= 0xFE;
+ }
+ }
+
+ if( gb->snd_1.env_length )
+ {
+ gb->snd_1.env_count++;
+ if( gb->snd_1.env_count >= gb->snd_1.env_length )
+ {
+ gb->snd_1.env_count = 0;
+ gb->snd_1.env_value += gb->snd_1.env_direction;
+ if( gb->snd_1.env_value < 0 )
+ gb->snd_1.env_value = 0;
+ if( gb->snd_1.env_value > 15 )
+ gb->snd_1.env_value = 15;
+ }
+ }
+
+ if( gb->snd_1.swp_time )
+ {
+ gb->snd_1.swp_count++;
+ if( gb->snd_1.swp_count >= gb->snd_1.swp_time )
+ {
+ gb->snd_1.swp_count = 0;
+ if( gb->snd_1.swp_direction > 0 )
+ {
+ gb->snd_1.frequency -= gb->snd_1.frequency / (1 << gb->snd_1.swp_shift );
+ if( gb->snd_1.frequency <= 0 )
+ {
+ gb->snd_1.on = 0;
+ gb->snd_regs[NR52] &= 0xFE;
+ }
+ }
+ else
+ {
+ gb->snd_1.frequency += gb->snd_1.frequency / (1 << gb->snd_1.swp_shift );
+ if( gb->snd_1.frequency >= MAX_FREQUENCIES )
+ {
+ gb->snd_1.frequency = MAX_FREQUENCIES - 1;
+ }
+ }
+
+ gb->snd_1.period = gb->period_table[gb->snd_1.frequency];
+ }
+ }
+
+ if( gb->snd_control.mode1_left )
+ left += sample;
+ if( gb->snd_control.mode1_right )
+ right += sample;
+ }
+
+ /* Mode 2 - Wave with Envelope */
+ if( gb->snd_2.on )
+ {
+ sample = gb->snd_2.signal * gb->snd_2.env_value;
+ gb->snd_2.pos++;
+ if( gb->snd_2.pos == (UINT32)(gb->snd_2.period / wave_duty_table[gb->snd_2.duty]) >> FIXED_POINT)
+ {
+ gb->snd_2.signal = -gb->snd_2.signal;
+ }
+ else if( gb->snd_2.pos > (gb->snd_2.period >> FIXED_POINT) )
+ {
+ gb->snd_2.pos = 0;
+ gb->snd_2.signal = -gb->snd_2.signal;
+ }
+
+ if( gb->snd_2.length && gb->snd_2.mode )
+ {
+ gb->snd_2.count++;
+ if( gb->snd_2.count >= gb->snd_2.length )
+ {
+ gb->snd_2.on = 0;
+ gb->snd_regs[NR52] &= 0xFD;
+ }
+ }
+
+ if( gb->snd_2.env_length )
+ {
+ gb->snd_2.env_count++;
+ if( gb->snd_2.env_count >= gb->snd_2.env_length )
+ {
+ gb->snd_2.env_count = 0;
+ gb->snd_2.env_value += gb->snd_2.env_direction;
+ if( gb->snd_2.env_value < 0 )
+ gb->snd_2.env_value = 0;
+ if( gb->snd_2.env_value > 15 )
+ gb->snd_2.env_value = 15;
+ }
+ }
+
+ if( gb->snd_control.mode2_left )
+ left += sample;
+ if( gb->snd_control.mode2_right )
+ right += sample;
+ }
+
+ /* Mode 3 - Wave patterns from WaveRAM */
+ if( gb->snd_3.on )
+ {
+ /* NOTE: This is extremely close, but not quite right.
+ The problem is for GB frequencies above 2000 the frequency gets
+ clipped. This is caused because gb->snd_3.pos is never 0 at the test.*/
+ sample = gb->snd_regs[AUD3W0 + (gb->snd_3.offset/2)];
+ if( !(gb->snd_3.offset % 2) )
+ {
+ sample >>= 4;
+ }
+ sample = (sample & 0xF) - 8;
+
+ if( gb->snd_3.level )
+ sample >>= (gb->snd_3.level - 1);
+ else
+ sample = 0;
+
+ gb->snd_3.pos++;
+ if( gb->snd_3.pos >= ((UINT32)(((gb->snd_3.period ) >> 21)) + gb->snd_3.duty) )
+ {
+ gb->snd_3.pos = 0;
+ if( gb->snd_3.dutycount == ((UINT32)(((gb->snd_3.period ) >> FIXED_POINT)) % 32) )
+ {
+ gb->snd_3.duty--;
+ }
+ gb->snd_3.dutycount++;
+ gb->snd_3.offset++;
+ if( gb->snd_3.offset > 31 )
+ {
+ gb->snd_3.offset = 0;
+ gb->snd_3.duty = 1;
+ gb->snd_3.dutycount = 0;
+ }
+ }
+
+ if( gb->snd_3.length && gb->snd_3.mode )
+ {
+ gb->snd_3.count++;
+ if( gb->snd_3.count >= gb->snd_3.length )
+ {
+ gb->snd_3.on = 0;
+ gb->snd_regs[NR52] &= 0xFB;
+ }
+ }
+
+ if( gb->snd_control.mode3_left )
+ left += sample;
+ if( gb->snd_control.mode3_right )
+ right += sample;
+ }
+
+ /* Mode 4 - Noise with Envelope */
+ if( gb->snd_4.on )
+ {
+ /* Similar problem to Mode 3, we seem to miss some notes */
+ sample = gb->snd_4.signal & gb->snd_4.env_value;
+ gb->snd_4.pos++;
+ if( gb->snd_4.pos == (gb->snd_4.period >> (FIXED_POINT + 1)) )
+ {
+ /* Using a Polynomial Counter (aka Linear Feedback Shift Register)
+ Mode 4 has a 7 bit and 15 bit counter so we need to shift the
+ bits around accordingly */
+ mode4_mask = (((gb->snd_4.ply_value & 0x2) >> 1) ^ (gb->snd_4.ply_value & 0x1)) << (gb->snd_4.ply_step ? 6 : 14);
+ gb->snd_4.ply_value >>= 1;
+ gb->snd_4.ply_value |= mode4_mask;
+ gb->snd_4.ply_value &= (gb->snd_4.ply_step ? 0x7f : 0x7fff);
+ gb->snd_4.signal = (INT8)gb->snd_4.ply_value;
+ }
+ else if( gb->snd_4.pos > (gb->snd_4.period >> FIXED_POINT) )
+ {
+ gb->snd_4.pos = 0;
+ mode4_mask = (((gb->snd_4.ply_value & 0x2) >> 1) ^ (gb->snd_4.ply_value & 0x1)) << (gb->snd_4.ply_step ? 6 : 14);
+ gb->snd_4.ply_value >>= 1;
+ gb->snd_4.ply_value |= mode4_mask;
+ gb->snd_4.ply_value &= (gb->snd_4.ply_step ? 0x7f : 0x7fff);
+ gb->snd_4.signal = (INT8)gb->snd_4.ply_value;
+ }
+
+ if( gb->snd_4.length && gb->snd_4.mode )
+ {
+ gb->snd_4.count++;
+ if( gb->snd_4.count >= gb->snd_4.length )
+ {
+ gb->snd_4.on = 0;
+ gb->snd_regs[NR52] &= 0xF7;
+ }
+ }
+
+ if( gb->snd_4.env_length )
+ {
+ gb->snd_4.env_count++;
+ if( gb->snd_4.env_count >= gb->snd_4.env_length )
+ {
+ gb->snd_4.env_count = 0;
+ gb->snd_4.env_value += gb->snd_4.env_direction;
+ if( gb->snd_4.env_value < 0 )
+ gb->snd_4.env_value = 0;
+ if( gb->snd_4.env_value > 15 )
+ gb->snd_4.env_value = 15;
+ }
+ }
+
+ if( gb->snd_control.mode4_left )
+ left += sample;
+ if( gb->snd_control.mode4_right )
+ right += sample;
+ }
+
+ /* Adjust for master volume */
+ left *= gb->snd_control.vol_left;
+ right *= gb->snd_control.vol_right;
+
+ /* pump up the volume */
+ left <<= 6;
+ right <<= 6;
+
+ /* Update the buffers */
+ *(outputs[0]++) = left;
+ *(outputs[1]++) = right;
+ }
+
+ gb->snd_regs[NR52] = (gb->snd_regs[NR52]&0xf0) | gb->snd_1.on | (gb->snd_2.on << 1) | (gb->snd_3.on << 2) | (gb->snd_4.on << 3);
+}
+
+
+static DEVICE_START( gameboy_sound )
+{
+ gb_sound_t *gb = get_token(device);
+ int I, J;
+
+ memset(&gb->snd_1, 0, sizeof(gb->snd_1));
+ memset(&gb->snd_2, 0, sizeof(gb->snd_2));
+ memset(&gb->snd_3, 0, sizeof(gb->snd_3));
+ memset(&gb->snd_4, 0, sizeof(gb->snd_4));
+
+ gb->channel = device->machine().sound().stream_alloc(*device, 0, 2, device->machine().sample_rate(), 0, gameboy_update);
+ gb->rate = device->machine().sample_rate();
+
+ /* Calculate the envelope and sweep tables */
+ for( I = 0; I < 8; I++ )
+ {
+ gb->env_length_table[I] = (I * ((1 << FIXED_POINT) / 64) * gb->rate) >> FIXED_POINT;
+ gb->swp_time_table[I] = (((I << FIXED_POINT) / 128) * gb->rate) >> (FIXED_POINT - 1);
+ }
+
+ /* Calculate the period tables */
+ for( I = 0; I < MAX_FREQUENCIES; I++ )
+ {
+ gb->period_table[I] = ((1 << FIXED_POINT) / (131072 / (2048 - I))) * gb->rate;
+ gb->period_mode3_table[I] = ((1 << FIXED_POINT) / (65536 / (2048 - I))) * gb->rate;
+ }
+ /* Calculate the period table for mode 4 */
+ for( I = 0; I < 8; I++ )
+ {
+ for( J = 0; J < 16; J++ )
+ {
+ /* I is the dividing ratio of frequencies
+ J is the shift clock frequency */
+ gb->period_mode4_table[I][J] = ((1 << FIXED_POINT) / (524288 / ((I == 0)?0.5:I) / (1 << (J + 1)))) * gb->rate;
+ }
+ }
+
+ /* Calculate the length table */
+ for( I = 0; I < 64; I++ )
+ {
+ gb->length_table[I] = ((64 - I) * ((1 << FIXED_POINT)/256) * gb->rate) >> FIXED_POINT;
+ }
+ /* Calculate the length table for mode 3 */
+ for( I = 0; I < 256; I++ )
+ {
+ gb->length_mode3_table[I] = ((256 - I) * ((1 << FIXED_POINT)/256) * gb->rate) >> FIXED_POINT;
+ }
+
+ gb_sound_w_internal( device, NR52, 0x00 );
+ gb->snd_regs[AUD3W0] = 0xac;
+ gb->snd_regs[AUD3W1] = 0xdd;
+ gb->snd_regs[AUD3W2] = 0xda;
+ gb->snd_regs[AUD3W3] = 0x48;
+ gb->snd_regs[AUD3W4] = 0x36;
+ gb->snd_regs[AUD3W5] = 0x02;
+ gb->snd_regs[AUD3W6] = 0xcf;
+ gb->snd_regs[AUD3W7] = 0x16;
+ gb->snd_regs[AUD3W8] = 0x2c;
+ gb->snd_regs[AUD3W9] = 0x04;
+ gb->snd_regs[AUD3WA] = 0xe5;
+ gb->snd_regs[AUD3WB] = 0x2c;
+ gb->snd_regs[AUD3WC] = 0xac;
+ gb->snd_regs[AUD3WD] = 0xdd;
+ gb->snd_regs[AUD3WE] = 0xda;
+ gb->snd_regs[AUD3WF] = 0x48;
+}
+
+
+DEVICE_GET_INFO( gameboy_sound )
+{
+ switch (state)
+ {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(gb_sound_t); break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(gameboy_sound); break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: strcpy(info->s, "LR35902"); break;
+ case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
+ }
+}
+
+DEFINE_LEGACY_SOUND_DEVICE(GAMEBOY, gameboy_sound);
diff --git a/src/mess/audio/gb.h b/src/mess/audio/gb.h
new file mode 100644
index 00000000000..983d228b577
--- /dev/null
+++ b/src/mess/audio/gb.h
@@ -0,0 +1,6 @@
+DECLARE_LEGACY_SOUND_DEVICE(GAMEBOY, gameboy_sound);
+
+READ8_DEVICE_HANDLER( gb_sound_r );
+WRITE8_DEVICE_HANDLER( gb_sound_w );
+READ8_DEVICE_HANDLER( gb_wave_r );
+WRITE8_DEVICE_HANDLER( gb_wave_w );
diff --git a/src/mess/audio/gmaster.c b/src/mess/audio/gmaster.c
new file mode 100644
index 00000000000..deb7edb8b04
--- /dev/null
+++ b/src/mess/audio/gmaster.c
@@ -0,0 +1,86 @@
+/***************************************************************************
+ PeT mess@utanet.at march 2002
+***************************************************************************/
+
+#include <math.h>
+#include "emu.h"
+#include "cpu/upd7810/upd7810.h"
+#include "includes/gmaster.h"
+
+typedef struct _gmaster_sound gmaster_sound;
+struct _gmaster_sound
+{
+ /*bool*/int level;
+ sound_stream *mixer_channel;
+};
+
+
+static gmaster_sound *get_token(device_t *device)
+{
+ assert(device != NULL);
+ assert(device->type() == GMASTER);
+ return (gmaster_sound *) downcast<legacy_device_base *>(device)->token();
+}
+
+
+int gmaster_io_callback(device_t *device, int ioline, int state)
+{ /* comes across with cpu device - need to use sound device */
+ gmaster_sound *token = get_token(device->machine().device("custom"));
+
+ switch (ioline)
+ {
+ case UPD7810_TO:
+ token->mixer_channel->update();
+ token->level = state;
+ break;
+ default:
+ logerror("io changed %d %.2x\n",ioline, state);
+ break;
+ }
+ return 0;
+}
+
+
+/************************************/
+/* Sound handler update */
+/************************************/
+static STREAM_UPDATE( gmaster_update )
+{
+ int i;
+ gmaster_sound *token = get_token(device);
+ stream_sample_t *buffer = outputs[0];
+
+ for (i = 0; i < samples; i++, buffer++)
+ {
+ *buffer = token->level ? 0x4000 : 0;
+ }
+}
+
+/************************************/
+/* Sound handler start */
+/************************************/
+
+static DEVICE_START( gmaster_sound )
+{
+ gmaster_sound *token = get_token(device);
+ token->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, gmaster_update);
+}
+
+
+DEVICE_GET_INFO( gmaster_sound )
+{
+ switch (state)
+ {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(gmaster_sound); break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(gmaster_sound); break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: strcpy(info->s, "Game Master Custom"); break;
+ case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
+ }
+}
+
+DEFINE_LEGACY_SOUND_DEVICE(GMASTER, gmaster_sound);
diff --git a/src/mess/audio/lynx.c b/src/mess/audio/lynx.c
new file mode 100644
index 00000000000..c0f134e46f8
--- /dev/null
+++ b/src/mess/audio/lynx.c
@@ -0,0 +1,540 @@
+/******************************************************************************
+ PeT mess@utanet.at 2000,2001
+******************************************************************************/
+
+#include "emu.h"
+#include "includes/lynx.h"
+
+
+/* accordingly to atari's reference manual
+ there were no stereo lynx produced (the manual knows only production until mid 1991)
+ the howard/developement board might have stereo support
+ the revised lynx 2 hardware might have stereo support at least at the stereo jacks
+
+ some games support stereo
+*/
+
+
+/*
+AUDIO_A EQU $FD20
+AUDIO_B EQU $FD28
+AUDIO_C EQU $FD30
+AUDIO_D EQU $FD38
+
+VOLUME_CNTRL EQU 0
+FEEDBACK_ENABLE EQU 1 ; enables 11/10/5..0
+OUTPUT_VALUE EQU 2
+SHIFTER_L EQU 3
+AUD_BAKUP EQU 4
+AUD_CNTRL1 EQU 5
+AUD_COUNT EQU 6
+AUD_CNTRL2 EQU 7
+
+; AUD_CNTRL1
+FEEDBACK_7 EQU %10000000
+AUD_RESETDONE EQU %01000000
+AUD_INTEGRATE EQU %00100000
+AUD_RELOAD EQU %00010000
+AUD_CNTEN EQU %00001000
+AUD_LINK EQU %00000111
+; link timers (0->2->4 / 1->3->5->7->Aud0->Aud1->Aud2->Aud3->1
+AUD_64us EQU %00000110
+AUD_32us EQU %00000101
+AUD_16us EQU %00000100
+AUD_8us EQU %00000011
+AUD_4us EQU %00000010
+AUD_2us EQU %00000001
+AUD_1us EQU %00000000
+
+; AUD_CNTRL2 (read only)
+; B7..B4 ; shifter bits 11..8
+; B3 ; who knows
+; B2 ; last clock state (0->1 causes count)
+; B1 ; borrow in (1 causes count)
+; B0 ; borrow out (count EQU 0 and borrow in)
+
+ATTEN_A EQU $FD40
+ATTEN_B EQU $FD41
+ATTEN_C EQU $FD42
+ATTEN_D EQU $FD43
+; B7..B4 attenuation left ear (0 silent ..15/16 volume)
+; B3..B0 " right ear
+
+MPAN EQU $FD44
+; B7..B4 left ear
+; B3..B0 right ear
+; B7/B3 EQU Audio D
+; a 1 enables attenuation for channel and side
+
+
+MSTEREO EQU $FD50 ; a 1 disables audio connection
+AUD_D_LEFT EQU %10000000
+AUD_C_LEFT EQU %01000000
+AUD_B_LEFT EQU %00100000
+AUD_A_LEFT EQU %00010000
+AUD_D_RIGHT EQU %00001000
+AUD_C_RIGHT EQU %00000100
+AUD_B_RIGHT EQU %00000010
+AUD_A_RIGHT EQU %00000001
+
+ */
+
+#define LYNX_AUDIO_CHANNELS 4
+
+typedef struct {
+ struct {
+ INT8 volume;
+ UINT8 feedback;
+ INT8 output;
+ UINT8 shifter;
+ UINT8 bakup;
+ UINT8 control1;
+ UINT8 counter;
+ UINT8 control2;
+ } reg;
+ UINT8 attenuation;
+ UINT16 mask; // 12-bit
+ UINT16 shifter; // 12-bit
+ float ticks;
+ int count;
+} LYNX_AUDIO;
+
+typedef struct _lynx_sound_state lynx_sound_state;
+struct _lynx_sound_state
+{
+ sound_stream *mixer_channel;
+ float usec_per_sample;
+ int *shift_mask;
+ int *shift_xor;
+ UINT8 attenuation_enable;
+ UINT8 master_enable;
+ LYNX_AUDIO audio[4];
+};
+
+INLINE lynx_sound_state *get_safe_token(device_t *device)
+{
+ assert(device != NULL);
+ assert(device->type() == LYNX || device->type() == LYNX2);
+ return (lynx_sound_state *)downcast<legacy_device_base *>(device)->token();
+}
+
+static void lynx_audio_reset_channel(LYNX_AUDIO *This)
+{
+ This->reg.volume = 0;
+ This->reg.feedback = 0;
+ This->reg.output = 0;
+ This->reg.shifter = 0;
+ This->reg.bakup = 0;
+ This->reg.control1 = 0;
+ This->reg.counter = 0;
+ This->reg.control2 = 0;
+
+ This->attenuation = 0;
+ This->mask = 0;
+ This->shifter = 0;
+ This->ticks = 0;
+ This->count = 0;
+}
+
+void lynx_audio_count_down(device_t *device, int nr)
+{
+ lynx_sound_state *state = get_safe_token(device);
+ LYNX_AUDIO *This=state->audio+nr;
+ if (This->reg.control1&8 && (This->reg.control1&7)!=7) return;
+ if (nr==0) state->mixer_channel->update();
+ //if ((This->reg.control1&0x0f)==0x0f) //count down if linking enabled and count enabled
+ This->count--;
+}
+
+static void lynx_audio_shift(device_t *device, LYNX_AUDIO *channel)
+{
+ lynx_sound_state *state = get_safe_token(device);
+ INT16 out_temp;
+ UINT8 channel_number = (UINT8)(channel - state->audio);
+
+ //channel->shifter = ((channel->shifter<<1)&0xffe) | (state->shift_xor[ channel->shifter & channel->mask ]&1);
+
+ // alternative method (functionally the same as above)
+ UINT8 xor_out=0;
+ for(int bit=0;bit<12;bit++)
+ {
+ if((channel->mask>>bit)&1) xor_out ^= (channel->shifter>>bit)&1;
+ }
+ channel->shifter = ((channel->shifter<<1)&0xffe) | (xor_out ^ 1); // output of xor is inverted
+
+
+ if (channel->reg.control1&0x20) // integrate mode enabled
+ {
+ if (channel->shifter&1)
+ {
+ out_temp = channel->reg.output + channel->reg.volume;
+ }
+ else
+ {
+ out_temp = channel->reg.output - channel->reg.volume;
+ }
+
+ // clipping
+ if(out_temp > 127) out_temp = 127;
+ if(out_temp < -128) out_temp = -128;
+ channel->reg.output = (INT16)out_temp;
+ }
+
+ switch (channel_number)
+ {
+ case 0: lynx_audio_count_down(device, 1); break;
+ case 1: lynx_audio_count_down(device, 2); break;
+ case 2: lynx_audio_count_down(device, 3); break;
+ case 3: lynx_timer_count_down(device->machine(), 1); break;
+ default: logerror("Invalid channel number %d\n", channel_number); break;
+ }
+}
+
+static void lynx_audio_execute(device_t *device, LYNX_AUDIO *channel)
+{
+ lynx_sound_state *state = get_safe_token(device);
+ if (channel->reg.control1&8) // count enable
+ {
+ channel->ticks+=state->usec_per_sample;
+ if ((channel->reg.control1&7)==7) // link
+ {
+ if (channel->count<0) // counter finished
+ {
+ //channel->count+=channel->reg.counter; // reload (wrong?)
+ if (channel->reg.control1&0x10)
+ channel->count = channel->reg.bakup;
+ lynx_audio_shift(device, channel);
+ }
+ }
+ else
+ {
+ int t=1<<(channel->reg.control1&7); // microseconds per count
+ for (;;)
+ {
+ for (;(channel->ticks >= t) && (channel->count >= 0); channel->ticks-=t) // at least one sampled worth of time left, timer not expired
+ {
+ channel->count--;
+ }
+ if (channel->ticks<t) break;
+ if (channel->count<0)
+ {
+ lynx_audio_shift(device, channel);
+ if (channel->reg.control1&0x10)
+ channel->count = channel->reg.bakup;
+ else
+ break;
+ }
+ }
+ }
+ if (!(channel->reg.control1&0x20)) // normal mode
+ {
+ channel->reg.output = (channel->shifter & 1) ? channel->reg.volume : -channel->reg.volume;
+ }
+ }
+ else
+ {
+ channel->ticks=0;
+ channel->count=0;
+ }
+}
+
+
+UINT8 lynx_audio_read(device_t *device, int offset)
+{
+ lynx_sound_state *state = get_safe_token(device);
+ UINT8 value=0;
+ LYNX_AUDIO *channel=&state->audio[(offset>>3)&3];
+ state->mixer_channel->update();
+ if (offset < 0x40)
+ {
+ switch (offset&7) {
+ case 0:
+ value = channel->reg.volume;
+ break;
+ case 1:
+ value = channel->reg.feedback;
+ break;
+ case 2:
+ value = channel->reg.output;
+ break;
+ case 3:
+ // current shifter state (lower 8 bits)
+ value = channel->shifter&0xff;
+ break;
+ case 4:
+ value = channel->reg.bakup;
+ break;
+ case 5:
+ value = channel->reg.control1;
+ break;
+ case 6:
+ //current timer value
+ if (channel->count >=0)
+ value = channel->count;
+ else
+ value = 0;
+ break;
+ case 7:
+ // current shifter state (upper 4 bits), status bits
+ value = (channel->shifter>>4)&0xf0;
+ value |= channel->reg.control2&0x0f;
+ break;
+ }
+ }
+ else
+ {
+ switch (offset) // Lynx II stereo control registers
+ {
+ case 0x40: case 0x41: case 0x42: case 0x43:
+ value = state->audio[offset&3].attenuation;
+ break;
+ case 0x44:
+ value = state->attenuation_enable;
+ break;
+ case 0x50:
+ value = state->master_enable;
+ break;
+ }
+
+ }
+ return value;
+}
+
+void lynx_audio_write(device_t *device, int offset, UINT8 data)
+{
+ lynx_sound_state *state = get_safe_token(device);
+ //logerror("audio write %.2x %.2x\n", offset, data);
+ LYNX_AUDIO *channel=&state->audio[(offset>>3)&3];
+ state->mixer_channel->update();
+ if (offset < 0x40)
+ {
+ switch (offset & 0x07) {
+ // Volume control (signed)
+ case 0:
+ channel->reg.volume = data;
+ //logerror("write to volume %d\n", data);
+ break;
+ // Shift register feedback enable bits 0-5, 11,10
+ case 1:
+ channel->reg.feedback = data;
+ channel->mask &= 0x80;
+ channel->mask |= (data & 0x3f) | ((data & 0xc0)<<4);
+ break;
+ // Output value
+ case 2:
+ channel->reg.output = data;
+ //logerror("write to output %d\n", data);
+ break;
+ // Lower 8 bits of shift register
+ case 3:
+ channel->shifter &= 0xf00;
+ channel->shifter |= data;
+ break;
+ // Audio timer backup value
+ case 4:
+ channel->reg.bakup = data;
+ break;
+ // Audio control bits
+ case 5:
+ channel->mask &= ~0x80;
+ channel->mask |= (data&0x80);
+ channel->reg.control1 = data;
+ break;
+ // Current count
+ case 6:
+ channel->count=data;
+ break;
+ // Upper 4 bits of shift register and audio status bits
+ case 7:
+ channel->shifter&=0xff;
+ channel->shifter|=(data&0xf0)<<4;
+ channel->reg.control2 = data;
+ break;
+ }
+ }
+ else
+ {
+ switch (offset) // Stereo Registers
+ {
+ case 0x40: case 0x41: case 0x42: case 0x43:
+ state->audio[offset&3].attenuation=data;
+ break;
+ case 0x44:
+ state->attenuation_enable=data;
+ break;
+ case 0x50:
+ state->master_enable=data;
+ break;
+ }
+ }
+}
+
+/************************************/
+/* Sound handler update */
+/************************************/
+static STREAM_UPDATE( lynx_update )
+{
+ lynx_sound_state *state = get_safe_token(device);
+ int i, channel;
+ //LYNX_AUDIO *channel;
+ int v;
+ stream_sample_t *buffer = outputs[0];
+
+ for (i = 0; i < samples; i++, buffer++)
+ {
+ *buffer = 0;
+ for (channel=0; channel<LYNX_AUDIO_CHANNELS; channel++)
+ {
+ lynx_audio_execute(device, &state->audio[channel]);
+ v=state->audio[channel].reg.output;
+ *buffer+=v*15; // where does the *15 come from?
+ }
+ }
+}
+
+static STREAM_UPDATE( lynx2_update )
+{
+ lynx_sound_state *state = get_safe_token(device);
+ stream_sample_t *left=outputs[0], *right=outputs[1];
+ int i, j;
+ LYNX_AUDIO *channel;
+ int v;
+
+ for (i = 0; i < samples; i++, left++, right++)
+ {
+ *left = 0;
+ *right= 0;
+ for (channel=state->audio, j=0; j<ARRAY_LENGTH(state->audio); j++, channel++)
+ {
+ lynx_audio_execute(device, channel);
+ v=channel->reg.output;
+ if (!(state->master_enable&(0x10<<j)))
+ {
+ if (state->attenuation_enable&(0x10<<j)) {
+ *left+=v*(channel->attenuation>>4);
+ } else {
+ *left+=v*15;
+ }
+ }
+ if (!(state->master_enable&(1<<j)))
+ {
+ if (state->attenuation_enable&(1<<j)) {
+ *right+=v*(channel->attenuation&0xf);
+ } else {
+ *right+=v*15;
+ }
+ }
+ }
+ }
+}
+
+static void lynx_audio_init(device_t *device)
+{
+ lynx_sound_state *state = get_safe_token(device);
+ int i;
+ state->shift_mask = auto_alloc_array(device->machine(), int, 512);
+ assert(state->shift_mask);
+
+ state->shift_xor = auto_alloc_array(device->machine(), int, 4096);
+ assert(state->shift_xor);
+
+ for (i=0; i<512; i++)
+ {
+ state->shift_mask[i]=0;
+ if (i&1) state->shift_mask[i]|=1;
+ if (i&2) state->shift_mask[i]|=2;
+ if (i&4) state->shift_mask[i]|=4;
+ if (i&8) state->shift_mask[i]|=8;
+ if (i&0x10) state->shift_mask[i]|=0x10;
+ if (i&0x20) state->shift_mask[i]|=0x20;
+ if (i&0x40) state->shift_mask[i]|=0x400;
+ if (i&0x80) state->shift_mask[i]|=0x800;
+ if (i&0x100) state->shift_mask[i]|=0x80;
+ }
+ for (i=0; i<4096; i++)
+ {
+ int j;
+ state->shift_xor[i]=1;
+ for (j=4096/2; j>0; j>>=1)
+ {
+ if (i & j)
+ state->shift_xor[i] ^= 1;
+ }
+ }
+}
+
+static DEVICE_RESET( lynx_sound )
+{
+ lynx_sound_state *state = get_safe_token(device);
+ int i;
+ for (i=0; i<ARRAY_LENGTH(state->audio); i++)
+ {
+ lynx_audio_reset_channel(state->audio+i);
+ }
+}
+
+
+
+/************************************/
+/* Sound handler start */
+/************************************/
+
+static DEVICE_START(lynx_sound)
+{
+ lynx_sound_state *state = get_safe_token(device);
+ state->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, lynx_update);
+
+ state->usec_per_sample = 1000000 / device->machine().sample_rate();
+
+ lynx_audio_init(device);
+}
+
+
+static DEVICE_START(lynx2_sound)
+{
+ lynx_sound_state *state = get_safe_token(device);
+ state->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 2, device->machine().sample_rate(), 0, lynx2_update);
+
+ state->usec_per_sample = 1000000 / device->machine().sample_rate();
+
+ lynx_audio_init(device);
+}
+
+
+DEVICE_GET_INFO( lynx_sound )
+{
+ switch (state)
+ {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(lynx_sound_state); break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(lynx_sound); break;
+ case DEVINFO_FCT_RESET: info->start = DEVICE_RESET_NAME(lynx_sound); break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: strcpy(info->s, "Mikey"); break;
+ case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
+ }
+}
+
+
+DEVICE_GET_INFO( lynx2_sound )
+{
+ switch (state)
+ {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(lynx_sound_state); break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(lynx2_sound); break;
+ case DEVINFO_FCT_RESET: info->start = DEVICE_RESET_NAME(lynx_sound); break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: strcpy(info->s, "Mikey (Lynx II)"); break;
+ case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
+ }
+}
+
+DEFINE_LEGACY_SOUND_DEVICE(LYNX, lynx_sound);
+DEFINE_LEGACY_SOUND_DEVICE(LYNX2, lynx2_sound);
diff --git a/src/mess/audio/mac.c b/src/mess/audio/mac.c
new file mode 100644
index 00000000000..620c64c471a
--- /dev/null
+++ b/src/mess/audio/mac.c
@@ -0,0 +1,207 @@
+/***************************************************************************
+
+ mac.c
+
+ Sound handler
+
+****************************************************************************/
+
+
+#include "emu.h"
+#include "sound/asc.h"
+#include "includes/mac.h"
+#include "machine/ram.h"
+
+/***************************************************************************
+ MACROS / CONSTANTS
+***************************************************************************/
+
+#define MAC_MAIN_SND_BUF_OFFSET 0x0300
+#define MAC_ALT_SND_BUF_OFFSET 0x5F00
+#define MAC_SND_BUF_SIZE 370 /* total number of scan lines */
+#define MAC_SAMPLE_RATE ( MAC_SND_BUF_SIZE * 60 /*22255*/ ) /* scan line rate, should be 22254.5 Hz */
+
+
+/* intermediate buffer */
+#define SND_CACHE_SIZE 128
+
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+typedef struct _mac_sound mac_sound;
+struct _mac_sound
+{
+ sound_stream *mac_stream;
+ int sample_enable;
+ UINT16 *mac_snd_buf_ptr;
+ UINT8 *snd_cache;
+ int snd_cache_len;
+ int snd_cache_head;
+ int snd_cache_tail;
+ int indexx;
+};
+
+
+/***************************************************************************
+ INLINE FUNCTIONS
+***************************************************************************/
+
+INLINE mac_sound *get_token(device_t *device)
+{
+ assert(device != NULL);
+ assert(device->type() == MAC_SOUND);
+ return (mac_sound *) downcast<legacy_device_base *>(device)->token();
+}
+
+
+/***************************************************************************
+ IMPLEMENTATION
+***************************************************************************/
+
+/************************************/
+/* Stream updater */
+/************************************/
+
+static STREAM_UPDATE( mac_sound_update )
+{
+ INT16 last_val = 0;
+ stream_sample_t *buffer = outputs[0];
+ mac_sound *token = get_token(device);
+ mac_state *mac = device->machine().driver_data<mac_state>();
+
+ if ((mac->m_model == MODEL_MAC_PORTABLE) || (mac->m_model == MODEL_MAC_PB100))
+ {
+ memset(buffer, 0, samples * sizeof(*buffer));
+ return;
+ }
+
+ /* if we're not enabled, just fill with 0 */
+ if (device->machine().sample_rate() == 0)
+ {
+ memset(buffer, 0, samples * sizeof(*buffer));
+ return;
+ }
+
+ /* fill in the sample */
+ while (samples && token->snd_cache_len)
+ {
+ *buffer++ = last_val = ((token->snd_cache[token->snd_cache_head] << 8) ^ 0x8000) & 0xff00;
+ token->snd_cache_head++;
+ token->snd_cache_head %= SND_CACHE_SIZE;
+ token->snd_cache_len--;
+ samples--;
+ }
+
+ while (samples--)
+ {
+ /* should never happen */
+ *buffer++ = last_val;
+ }
+}
+
+
+
+/************************************/
+/* Sound handler start */
+/************************************/
+
+static DEVICE_START(mac_sound)
+{
+ mac_sound *token = get_token(device);
+
+ memset(token, 0, sizeof(*token));
+
+ token->snd_cache = auto_alloc_array(device->machine(), UINT8, SND_CACHE_SIZE);
+ token->mac_stream = device->machine().sound().stream_alloc(*device, 0, 1, MAC_SAMPLE_RATE, 0, mac_sound_update);
+}
+
+
+
+/*
+ Set the sound enable flag (VIA port line)
+*/
+void mac_enable_sound(device_t *device, int on)
+{
+ mac_sound *token = get_token(device);
+ token->sample_enable = on;
+}
+
+
+
+/*
+ Set the current sound buffer (one VIA port line)
+*/
+void mac_set_sound_buffer(device_t *device, int buffer)
+{
+ mac_sound *token = get_token(device);
+ ram_device *ram = device->machine().device<ram_device>(RAM_TAG);
+
+ if (buffer)
+ token->mac_snd_buf_ptr = (UINT16 *) (ram->pointer() + ram->size() - MAC_MAIN_SND_BUF_OFFSET);
+ else
+ token->mac_snd_buf_ptr = (UINT16 *) (ram->pointer() + ram->size() - MAC_ALT_SND_BUF_OFFSET);
+}
+
+
+
+/*
+ Set the current sound volume (3 VIA port line)
+*/
+void mac_set_volume(device_t *device, int volume)
+{
+ mac_sound *token = get_token(device);
+
+ token->mac_stream->update();
+ volume = (100 / 7) * volume;
+ token->mac_stream->set_output_gain(0, volume / 100.0);
+}
+
+
+
+/*
+ Fetch one byte from sound buffer and put it to sound output (called every scanline)
+*/
+void mac_sh_updatebuffer(device_t *device)
+{
+ mac_sound *token = get_token(device);
+ UINT16 *base = token->mac_snd_buf_ptr;
+
+ token->indexx++;
+ token->indexx %= 370;
+
+ if (token->snd_cache_len >= SND_CACHE_SIZE)
+ {
+ /* clear buffer */
+ token->mac_stream->update();
+ }
+
+ if (token->snd_cache_len >= SND_CACHE_SIZE)
+ /* should never happen */
+ return;
+
+ token->snd_cache[token->snd_cache_tail] = token->sample_enable ? (base[token->indexx] >> 8) & 0xff : 0;
+ token->snd_cache_tail++;
+ token->snd_cache_tail %= SND_CACHE_SIZE;
+ token->snd_cache_len++;
+}
+
+
+DEVICE_GET_INFO( mac_sound )
+{
+ switch (state)
+ {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(mac_sound); break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mac_sound); break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: strcpy(info->s, "Mac Custom"); break;
+ case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
+ }
+}
+
+DEFINE_LEGACY_SOUND_DEVICE(MAC_SOUND, mac_sound);
diff --git a/src/mess/audio/mea8000.c b/src/mess/audio/mea8000.c
new file mode 100644
index 00000000000..92b34d4fe6d
--- /dev/null
+++ b/src/mess/audio/mea8000.c
@@ -0,0 +1,726 @@
+/**********************************************************************
+
+ Copyright (C) Antoine Mine' 2006
+
+ Philips / Signetics MEA 8000 emulation.
+
+ The MEA 8000 is a speech synthesis chip.
+ The French company TMPI (Techni-musique & parole informatique) provided
+ speech extensions for several 8-bit computers (Thomson, Amstrad, Oric).
+ It was quite popular in France because of its ability to spell 'u'
+ (unlike the more widespread SPO 296 chip).
+
+ The synthesis is based on a 4-formant model.
+ First, an initial sawtooth noise signal is generated.
+ The signal passes through a cascade of 4 filters of increasing frequency.
+ Each filter is a second order digital filter with a programmable
+ frequency and bandwidth.
+ All parameters, including filter parameters, are smoothly interpolated
+ for the duration of a frame (8ms, 16ms, 32ms, or 64 ms).
+
+ TODO:
+ - REQ output pin
+ - optimize mea8000_compute_sample
+ - should we accept new frames in slow-stop mode ?
+
+**********************************************************************/
+
+#include <math.h>
+
+#include "emu.h"
+#include "mea8000.h"
+#include "sound/dac.h"
+
+
+#define VERBOSE 0
+
+/* define to use double instead of int (slow but useful for debugging) */
+#undef FLOAT_MODE
+
+
+
+/******************* internal chip data structure ******************/
+
+
+
+/* finite machine state controling frames */
+typedef enum
+{
+ MEA8000_STOPPED, /* nothing to do, timer disabled */
+ MEA8000_WAIT_FIRST, /* received pitch, wait for first full trame, timer disabled */
+ MEA8000_STARTED, /* playing a frame, timer on */
+ MEA8000_SLOWING, /* repating last frame with decreasing amplitude, timer on */
+} mea8000_state;
+
+ALLOW_SAVE_TYPE( mea8000_state );
+
+
+typedef struct
+{
+#ifdef FLOAT_MODE
+ double fm, last_fm; /* frequency, in Hz */
+ double bw, last_bw; /* band-width, in Hz */
+ double output, last_output; /* filter state */
+#else
+ UINT16 fm, last_fm;
+ UINT16 bw, last_bw;
+ INT32 output, last_output;
+#endif
+} filter_t;
+
+
+
+typedef struct
+{
+
+ /* configuration parameters */
+ const mea8000_interface* iface;
+
+ /* state */
+
+ mea8000_state state; /* current state */
+
+ UINT8 buf[4]; /* store 4 consecutive data to form a frame info */
+ UINT8 bufpos; /* new byte to write in frame info buffer */
+
+ UINT8 cont; /* if no data 0=stop 1=repeat last frame */
+ UINT8 roe; /* enable req output, now unimplemented */
+
+ UINT16 framelength; /* in samples */
+ UINT16 framepos; /* in samples */
+ UINT16 framelog; /* log2 of framelength */
+
+ INT16 lastsample, sample; /* output samples are interpolated */
+
+ UINT32 phi; /* absolute phase for frequency / noise generator */
+
+ filter_t f[4]; /* filters */
+
+ UINT16 last_ampl, ampl; /* amplitude * 1000 */
+ UINT16 last_pitch, pitch; /* pitch of sawtooth signal, in Hz */
+ UINT8 noise;
+
+ emu_timer *timer;
+
+} mea8000_t;
+
+
+
+/******************* utilitiy function and macros ********************/
+
+
+
+#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
+
+/* digital filters work at 8 kHz */
+#define F0 8096
+
+/* filtered output is supersampled x 8 */
+#define SUPERSAMPLING 8
+
+/* actual output pediod */
+#define SAMPLING attotime::from_hz((SUPERSAMPLING*F0))
+
+
+INLINE mea8000_t* get_safe_token( device_t *device )
+{
+ assert( device != NULL );
+ assert( device->type() == MEA8000);
+ return (mea8000_t*) downcast<legacy_device_base *>(device)->token();
+}
+
+
+/************************* quantization tables ***********************/
+
+
+
+/* frequency, in Hz */
+
+static const int fm1_table[32] =
+{
+ 150, 162, 174, 188, 202, 217, 233, 250,
+ 267, 286, 305, 325, 346, 368, 391, 415,
+ 440, 466, 494, 523, 554, 587, 622, 659,
+ 698, 740, 784, 830, 880, 932, 988, 1047
+};
+
+static const int fm2_table[32] =
+{
+ 440, 466, 494, 523, 554, 587, 622, 659,
+ 698, 740, 784, 830, 880, 932, 988, 1047,
+ 1100, 1179, 1254, 1337, 1428, 1528, 1639, 1761,
+ 1897, 2047, 2214, 2400, 2609, 2842, 3105, 3400
+};
+
+static const int fm3_table[8] =
+{
+ 1179, 1337, 1528, 1761, 2047, 2400, 2842, 3400
+};
+
+static const int fm4_table[1] = { 3500 };
+
+
+
+/* bandwidth, in Hz */
+static const int bw_table[4] = { 726, 309, 125, 50 };
+
+
+
+/* amplitude * 1000 */
+static const int ampl_table[16] =
+{
+ 0, 8, 11, 16, 22, 31, 44, 62,
+ 88, 125, 177, 250, 354, 500, 707, 1000
+};
+
+
+
+/* pitch increment, in Hz / 8 ms */
+static const int pi_table[32] =
+{
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 0 /* noise */, -15, -14, -13, -12, -11, -10, -9,
+ -8, -7, -6, -5, -4, -3, -2, -1
+};
+
+
+
+/***************************** REQ **********************************/
+
+
+
+static int mea8000_accept_byte( mea8000_t* mea8000 )
+{
+ return
+ mea8000->state == MEA8000_STOPPED ||
+ mea8000->state == MEA8000_WAIT_FIRST ||
+ (mea8000->state == MEA8000_STARTED && mea8000->bufpos < 4);
+}
+
+static void mea8000_update_req( device_t *device )
+{
+ mea8000_t* mea8000 = get_safe_token( device );
+ /* actually, req pulses less than 3us for each new byte,
+ it goes back up if there space left in the buffer, or stays low if the
+ buffer contains a complete frame and the CPU nees to wait for the next
+ frame end to compose a new frame.
+ */
+ if (mea8000->iface->req_out_func)
+ mea8000->iface->req_out_func( device, 0, mea8000_accept_byte( mea8000 ) );
+}
+
+
+
+/*********************** sound generation ***************************/
+
+
+
+/* table amplitude [-QUANT,QUANT] */
+#define QUANT 512
+
+/* filter coefficients from frequencies */
+#define TABLE_LEN 3600
+static int cos_table[TABLE_LEN]; /* fm => cos coefficient */
+static int exp_table[TABLE_LEN]; /* bw => exp coefficient */
+static int exp2_table[TABLE_LEN]; /* bw => 2*exp coefficient */
+
+/* noise generator table */
+#define NOISE_LEN 8192
+static int noise_table[NOISE_LEN];
+
+
+
+/* precompute tables */
+static void mea8000_init_tables( running_machine &machine )
+{
+ int i;
+ for (i=0; i<TABLE_LEN; i++)
+ {
+ double f = (double)i / F0;
+ cos_table[i] = 2. * cos(2.*M_PI*f) * QUANT;
+ exp_table[i] = exp(-M_PI*f) * QUANT;
+ exp2_table[i] = exp(-2*M_PI*f) * QUANT;
+ }
+ for (i=0; i<NOISE_LEN; i++)
+ noise_table[i] = (machine.rand() % (2*QUANT)) - QUANT;
+}
+
+
+#ifndef FLOAT_MODE /* UINT16 version */
+
+
+
+/* linear interpolation */
+static int mea8000_interp( mea8000_t* mea8000, UINT16 org, UINT16 dst )
+{
+ return org + (((dst-org) * mea8000->framepos) >> mea8000->framelog);
+}
+
+
+
+/* apply second order digital filter, sampling at F0 */
+static int mea8000_filter_step( mea8000_t* mea8000, int i, int input )
+{
+ /* frequency */
+ int fm = mea8000_interp(mea8000, mea8000->f[i].last_fm, mea8000->f[i].fm);
+ /* bandwidth */
+ int bw = mea8000_interp(mea8000, mea8000->f[i].last_bw, mea8000->f[i].bw);
+ /* filter coefficients */
+ int b = (cos_table[fm] * exp_table[bw]) / QUANT;
+ int c = exp2_table[bw];
+ /* transfer function */
+ int next_output = input + (b * mea8000->f[i].output - c * mea8000->f[i].last_output) / QUANT;
+ mea8000->f[i].last_output = mea8000->f[i].output;
+ mea8000->f[i].output = next_output;
+ return next_output;
+}
+
+
+/* random waveform, in [-QUANT,QUANT] */
+static int mea8000_noise_gen( mea8000_t* mea8000 )
+{
+ mea8000->phi = (mea8000->phi + 1) % NOISE_LEN;
+ return noise_table[mea8000->phi];
+}
+
+
+
+/* sawtooth waveform at F0, in [-QUANT,QUANT] */
+static int mea8000_freq_gen( mea8000_t* mea8000 )
+{
+ int pitch = mea8000_interp(mea8000, mea8000->last_pitch, mea8000->pitch);
+ mea8000->phi = (mea8000->phi + pitch) % F0;
+ return ((mea8000->phi % F0) * QUANT * 2) / F0 - QUANT;
+}
+
+
+
+/* sample in [-32768,32767], at F0 */
+static int mea8000_compute_sample( mea8000_t* mea8000 )
+{
+ int i;
+ int out;
+ int ampl = mea8000_interp(mea8000, mea8000->last_ampl, mea8000->ampl);
+
+ if (mea8000->noise)
+ out = mea8000_noise_gen(mea8000);
+ else
+ out = mea8000_freq_gen(mea8000);
+
+ out *= ampl / 32;
+
+ for (i=0; i<4; i++)
+ {
+ out = mea8000_filter_step(mea8000, i, out);
+ }
+
+ if ( out > 32767 )
+ out = 32767;
+ if ( out < -32767)
+ out = -32767;
+ return out;
+}
+
+
+
+#else /* float version */
+
+
+
+/* linear interpolation */
+static double mea8000_interp( mea8000_t* mea8000, double org, double dst )
+{
+ return org + ((dst-org) * mea8000->framepos) / mea8000->framelength;
+}
+
+
+
+/* apply second order digital filter, sampling at F0 */
+static double mea8000_filter_step( mea8000_t* mea8000, int i, double input )
+{
+ double fm = mea8000_interp(mea8000, mea8000->f[i].last_fm, mea8000->f[i].fm);
+ double bw = mea8000_interp(mea8000, mea8000->f[i].last_bw, mea8000->f[i].bw);
+ double b = 2.*cos(2.*M_PI*fm/F0);
+ double c = -exp(-M_PI*bw/F0);
+ double next_output =
+ input -
+ c * (b * mea8000->f[i].output + c * mea8000->f[i].last_output);
+ mea8000->f[i].last_output = mea8000->f[i].output;
+ mea8000->f[i].output = next_output;
+ return next_output;
+}
+
+
+
+/* noise, in [-1,1] */
+static double mea8000_noise_gen( mea8000_t* mea8000 )
+{
+ mea8000->phi++;
+ return (double) noise_table[mea8000->phi % NOISE_LEN] / QUANT;
+}
+
+
+
+/* sawtooth waveform at F0, in [-1,1] */
+static double mea8000_freq_gen( mea8000_t* mea8000 )
+{
+ int pitch = mea8000_interp(mea8000, mea8000->last_pitch, mea8000->pitch);
+ mea8000->phi += pitch;
+ return (double) (mea8000->phi % F0) / (F0/2.) - 1.;
+}
+
+
+/* sample in [-32767,32767], at F0 */
+static int mea8000_compute_sample( mea8000_t* mea8000 )
+{
+ int i;
+ double out;
+ double ampl = mea8000_interp(mea8000, 8.*mea8000->last_ampl, 8.*mea8000->ampl);
+
+ if (mea8000->noise)
+ out = mea8000_noise_gen(mea8000);
+ else
+ out = mea8000_freq_gen(mea8000);
+
+ out *= ampl;
+
+ for (i=0; i<4; i++)
+ {
+ out = mea8000_filter_step(mea8000, i, out);
+ }
+
+ if ( out > 32767 )
+ out = 32767;
+ if ( out < -32767)
+ out = -32767;
+ return out;
+}
+
+
+#endif
+
+
+
+/*********************** frame management ***************************/
+
+
+
+/* shift frame parameters from current to last */
+static void mea8000_shift_frame( mea8000_t* mea8000 )
+{
+ int i;
+ mea8000->last_pitch = mea8000->pitch;
+ for (i=0; i<4; i++)
+ {
+ mea8000->f[i].last_bw = mea8000->f[i].bw;
+ mea8000->f[i].last_fm = mea8000->f[i].fm;
+ }
+ mea8000->last_ampl = mea8000->ampl;
+}
+
+
+
+/* decode fields from buffer to current frame */
+static void mea8000_decode_frame( mea8000_t* mea8000 )
+{
+ int fd = (mea8000->buf[3] >> 5) & 3; /* 0=8ms, 1=16ms, 2=32ms, 3=64ms */
+ int pi = pi_table[ mea8000->buf[3] & 0x1f ] << fd;
+ mea8000->noise = (mea8000->buf[3] & 0x1f) == 16;
+ mea8000->pitch = mea8000->last_pitch + pi;
+ mea8000->f[0].bw = bw_table[ mea8000->buf[0] >> 6 ];
+ mea8000->f[1].bw = bw_table[ (mea8000->buf[0] >> 4) & 3 ];
+ mea8000->f[2].bw = bw_table[ (mea8000->buf[0] >> 2) & 3 ];
+ mea8000->f[3].bw = bw_table[ mea8000->buf[0] & 3 ];
+ mea8000->f[3].fm = fm4_table[ 0 ];
+ mea8000->f[2].fm = fm3_table[ mea8000->buf[1] >> 5 ];
+ mea8000->f[1].fm = fm2_table[ mea8000->buf[1] & 0x1f ];
+ mea8000->f[0].fm = fm1_table[ mea8000->buf[2] >> 3 ];
+ mea8000->ampl = ampl_table[ ((mea8000->buf[2] & 7) << 1) |
+ (mea8000->buf[3] >> 7) ];
+ mea8000->framelog = fd + 6 /* 64 samples / ms */ + 3;
+ mea8000->framelength = 1 << mea8000->framelog;
+ mea8000->bufpos = 0;
+#ifdef FLOAT_MODE
+ LOG(( "mea800_decode_frame: pitch=%i noise=%i fm1=%gHz bw1=%gHz fm2=%gHz bw2=%gHz fm3=%gHz bw3=%gHz fm4=%gHz bw4=%gHz ampl=%g fd=%ims\n",
+ mea8000->pitch, mea8000->noise,
+ mea8000->f[0].fm, mea8000->f[0].bw, mea8000->f[1].fm, mea8000->f[1].bw,
+ mea8000->f[2].fm, mea8000->f[2].bw, mea8000->f[3].fm, mea8000->f[3].bw,
+ mea8000->ampl/1000., 8 << fd ));
+#else
+ LOG(( "mea800_decode_frame: pitch=%i noise=%i fm1=%iHz bw1=%iHz fm2=%iHz bw2=%iHz fm3=%iHz bw3=%iHz fm4=%iHz bw4=%iHz ampl=%g fd=%ims\n",
+ mea8000->pitch, mea8000->noise,
+ mea8000->f[0].fm, mea8000->f[0].bw, mea8000->f[1].fm, mea8000->f[1].bw,
+ mea8000->f[2].fm, mea8000->f[2].bw, mea8000->f[3].fm, mea8000->f[3].bw,
+ mea8000->ampl/1000., 8 << fd ));
+#endif
+}
+
+
+
+static void mea8000_start_frame( mea8000_t* mea8000 )
+{
+ /* enter or stay in active mode */
+ mea8000->timer->reset( SAMPLING );
+ mea8000->framepos = 0;
+}
+
+
+
+static void mea8000_stop_frame( running_machine &machine, mea8000_t* mea8000 )
+{
+ /* enter stop mode */
+ mea8000->timer->reset( );
+ mea8000->state = MEA8000_STOPPED;
+ machine.device<dac_device>(mea8000->iface->channel)->write_signed16(0x8000);
+}
+
+
+
+/* next sample in frame, sampling at 64 kHz */
+static TIMER_CALLBACK( mea8000_timer_expire )
+{
+ device_t* device = (device_t*) ptr;
+ mea8000_t* mea8000 = get_safe_token( device );
+ int pos = mea8000->framepos % SUPERSAMPLING;
+
+ if (!pos)
+ {
+ /* sample is really computed only every 8-th time */
+ mea8000->lastsample = mea8000->sample;
+ mea8000->sample = mea8000_compute_sample(mea8000);
+ machine.device<dac_device>(mea8000->iface->channel)->write_signed16(0x8000+mea8000->lastsample);
+ }
+ else
+ {
+ /* other samples are simply interpolated */
+ int sample =
+ mea8000->lastsample +
+ ((pos*(mea8000->sample-mea8000->lastsample)) / SUPERSAMPLING);
+ machine.device<dac_device>(mea8000->iface->channel)->write_signed16(0x8000+sample);
+ }
+
+ mea8000->framepos++;
+ if (mea8000->framepos >= mea8000->framelength)
+ {
+ mea8000_shift_frame(mea8000);
+ /* end of frame */
+ if (mea8000->bufpos == 4)
+ {
+ /* we have a successor */
+ LOG(( "%f mea8000_timer_expire: new frame\n", machine.time().as_double() ));
+ mea8000_decode_frame(mea8000);
+ mea8000_start_frame(mea8000);
+ }
+ else if (mea8000->cont)
+ {
+ /* repeat mode */
+ LOG(( "%f mea8000_timer_expire: repeat frame\n", machine.time().as_double() ));
+ mea8000_start_frame(mea8000);
+ }
+ /* slow stop */
+ else if (mea8000->state == MEA8000_STARTED)
+ {
+ mea8000->ampl = 0;
+ LOG(( "%f mea8000_timer_expire: fade frame\n", machine.time().as_double() ));
+ mea8000_start_frame(mea8000);
+ mea8000->state = MEA8000_SLOWING;
+ }
+ else if (mea8000->state == MEA8000_SLOWING)
+ {
+ LOG(( "%f mea8000_timer_expire: stop frame\n", machine.time().as_double() ));
+ mea8000_stop_frame(machine, mea8000);
+ }
+ mea8000_update_req(device);
+ }
+ else
+ {
+ /* continue frame */
+ mea8000->timer->reset( SAMPLING );
+ }
+}
+
+
+
+/************************** CPU interface ****************************/
+
+
+
+READ8_DEVICE_HANDLER ( mea8000_r )
+{
+ mea8000_t* mea8000 = get_safe_token( device );
+ switch ( offset )
+ {
+
+ case 0: /* status register */
+ case 1:
+ /* ready to accept next frame */
+#if 0
+ LOG(( "$%04x %f: mea8000_r ready=%i\n", cpu_get_previouspc( device->machine().firstcpu ), machine.time().as_double(), mea8000_accept_byte( mea8000 ) ));
+#endif
+ return mea8000_accept_byte(mea8000) << 7;
+
+ default:
+ logerror( "$%04x mea8000_r invalid read offset %i\n", cpu_get_previouspc( device->machine().firstcpu ), offset );
+ }
+ return 0;
+}
+
+WRITE8_DEVICE_HANDLER ( mea8000_w )
+{
+ mea8000_t* mea8000 = get_safe_token( device );
+ switch ( offset )
+ {
+
+ case 0: /* data register */
+ if (mea8000->state == MEA8000_STOPPED)
+ {
+ /* got pitch byte before first frame */
+ mea8000->pitch = 2 * data;
+ LOG(( "$%04x %f: mea8000_w pitch %i\n", cpu_get_previouspc( device->machine().firstcpu ), device->machine().time().as_double(), mea8000->pitch ));
+ mea8000->state = MEA8000_WAIT_FIRST;
+ mea8000->bufpos = 0;
+ }
+ else if (mea8000->bufpos == 4)
+ {
+ /* overflow */
+ LOG(( "$%04x %f: mea8000_w data overflow %02X\n", cpu_get_previouspc( device->machine().firstcpu ), device->machine().time().as_double(), data ));
+ }
+ else
+ {
+ /* enqueue frame byte */
+ LOG(( "$%04x %f: mea8000_w data %02X in frame pos %i\n", cpu_get_previouspc( device->machine().firstcpu ), device->machine().time().as_double(),
+ data, mea8000->bufpos ));
+ mea8000->buf[mea8000->bufpos] = data;
+ mea8000->bufpos++;
+ if (mea8000->bufpos == 4 && mea8000->state == MEA8000_WAIT_FIRST)
+ {
+ /* fade-in first frame */
+ int old_pitch = mea8000->pitch;
+ mea8000->last_pitch = old_pitch;
+ mea8000_decode_frame(mea8000);
+ mea8000_shift_frame(mea8000);
+ mea8000->last_pitch = old_pitch;
+ mea8000->ampl = 0;
+ mea8000_start_frame(mea8000);
+ mea8000->state = MEA8000_STARTED;
+ }
+ }
+ mea8000_update_req(device);
+ break;
+
+ case 1: /* command register */
+ {
+ int stop = (data >> 4) & 1;
+
+ if (data & 8)
+ mea8000->cont = (data >> 2) & 1;
+
+ if (data & 2)
+ mea8000->roe = data & 1;
+
+ if (stop)
+ mea8000_stop_frame(device->machine(), mea8000);
+
+ LOG(( "$%04x %f: mea8000_w command %02X stop=%i cont=%i roe=%i\n",
+ cpu_get_previouspc(device->machine().firstcpu), device->machine().time().as_double(), data,
+ stop, mea8000->cont, mea8000->roe ));
+
+ mea8000_update_req(device);
+ break;
+ }
+
+ default:
+ logerror( "$%04x mea8000_w invalid write offset %i\n", cpu_get_previouspc( device->machine().firstcpu ), offset );
+ }
+}
+
+
+
+/************************ reset *****************************/
+
+static DEVICE_RESET( mea8000 )
+{
+ mea8000_t* mea8000 = get_safe_token( device );
+ int i;
+ LOG (( "mea8000_reset\n" ));
+ mea8000->timer->reset( );
+ mea8000->phi = 0;
+ mea8000->cont = 0;
+ mea8000->roe = 0;
+ mea8000->state = MEA8000_STOPPED;
+ mea8000_update_req(device);
+ for (i=0; i<4; i++)
+ {
+ mea8000->f[i].last_output = 0;
+ mea8000->f[i].output = 0;
+ }
+
+}
+
+
+
+/****************************** start ********************************/
+
+
+static DEVICE_START( mea8000 )
+{
+ mea8000_t* mea8000 = get_safe_token( device );
+ int i;
+ mea8000->iface = (const mea8000_interface*)device->static_config();
+
+ mea8000_init_tables(device->machine());
+
+ mea8000->timer = device->machine().scheduler().timer_alloc(FUNC(mea8000_timer_expire), (void*)device );
+
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->state );
+ state_save_register_item_array( device->machine(), "mea8000", device->tag(), 0, mea8000->buf );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->bufpos );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->cont );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->roe );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->framelength );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->framepos );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->framelog );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->lastsample );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->sample );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->phi );
+ for (i=0; i<4; i++)
+ {
+ state_save_register_item( device->machine(), "mea8000", device->tag(), i, mea8000->f[i].fm );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), i, mea8000->f[i].last_fm );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), i, mea8000->f[i].bw );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), i, mea8000->f[i].last_bw );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), i, mea8000->f[i].output );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), i, mea8000->f[i].last_output );
+ }
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->last_ampl );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->ampl );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->last_pitch );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->pitch );
+ state_save_register_item( device->machine(), "mea8000", device->tag(), 0, mea8000->noise );
+}
+
+
+/************************** configuration ****************************/
+
+DEVICE_GET_INFO( mea8000 ) {
+ switch ( state ) {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(mea8000_t); break;
+ case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mea8000); break;
+ case DEVINFO_FCT_STOP: /* nothing */ break;
+ case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mea8000); break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: strcpy(info->s, "Philips / Signetics MEA 8000 speech synthesizer"); break;
+ case DEVINFO_STR_FAMILY: strcpy(info->s, "MEA8000"); break;
+ case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break;
+ case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
+ case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break;
+ }
+}
+
+DEFINE_LEGACY_DEVICE(MEA8000, mea8000);
diff --git a/src/mess/audio/mea8000.h b/src/mess/audio/mea8000.h
new file mode 100644
index 00000000000..b1bbbdf5e49
--- /dev/null
+++ b/src/mess/audio/mea8000.h
@@ -0,0 +1,37 @@
+/**********************************************************************
+
+ Copyright (C) Antoine Mine' 2006
+
+ Philips MEA 8000 emulation.
+
+**********************************************************************/
+
+#ifndef MEA8000_H
+#define MEA8000_H
+
+#include "devlegcy.h"
+
+DECLARE_LEGACY_DEVICE(MEA8000, mea8000);
+
+/* ---------- configuration ------------ */
+
+typedef struct _mea8000_interface mea8000_interface;
+struct _mea8000_interface
+{
+ /* output channel */
+ const char * channel;
+
+ /* 1-bit 'ready' output, not negated */
+ write8_device_func req_out_func;
+};
+
+
+#define MCFG_MEA8000_ADD(_tag, _intrf) \
+ MCFG_DEVICE_ADD(_tag, MEA8000, 0) \
+ MCFG_DEVICE_CONFIG(_intrf)
+
+/* interface to CPU via address/data bus*/
+extern READ8_DEVICE_HANDLER ( mea8000_r );
+extern WRITE8_DEVICE_HANDLER ( mea8000_w );
+
+#endif
diff --git a/src/mess/audio/mos7360.c b/src/mess/audio/mos7360.c
new file mode 100644
index 00000000000..17deda8535f
--- /dev/null
+++ b/src/mess/audio/mos7360.c
@@ -0,0 +1,1143 @@
+/**********************************************************************
+
+ MOS 7360/8360 Text Edit Device (TED) emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "emu.h"
+#include "mos7360.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define LOG 0
+
+
+#define VERBOSE_LEVEL 0
+#define DBG_LOG(N,M,A) \
+ do { \
+ if(VERBOSE_LEVEL >= N) \
+ { \
+ if( M ) \
+ logerror("%11.6f: %-24s", machine().time().as_double(), (char*) M ); \
+ logerror A; \
+ } \
+ } while(0)
+
+
+#define VREFRESHINLINES 28
+
+#define TIMER1HELPER (m_reg[0] | (m_reg[1] << 8))
+#define TIMER2HELPER (m_reg[2] | (m_reg[3] << 8))
+#define TIMER3HELPER (m_reg[4] | (m_reg[5] << 8))
+#define TIMER1 (TIMER1HELPER ? TIMER1HELPER : 0x10000)
+#define TIMER2 (TIMER2HELPER ? TIMER2HELPER : 0x10000)
+#define TIMER3 (TIMER3HELPER ? TIMER3HELPER : 0x10000)
+
+#define TED7360_YPOS 40
+#define RASTERLINE_2_C16(a) ((a + m_lines - TED7360_YPOS - 5) % m_lines)
+#define C16_2_RASTERLINE(a) ((a + TED7360_YPOS + 5) % m_lines)
+#define XPOS 8
+#define YPOS 8
+
+#define SCREENON (m_reg[6] & 0x10)
+#define TEST (m_reg[6] & 0x80)
+#define VERTICALPOS (m_reg[6] & 0x07)
+#define HORICONTALPOS (m_reg[7] & 0x07)
+#define ECMON (m_reg[6] & 0x40)
+#define HIRESON (m_reg[6] & 0x20)
+#define MULTICOLORON (m_reg[7] & 0x10)
+#define REVERSEON (!(m_reg[7] & 0x80))
+
+/* hardware inverts character when bit 7 set (character taken &0x7f) */
+/* instead of fetching character with higher number! */
+#define LINES25 (m_reg[6] & 0x08) /* else 24 Lines */
+#define LINES (LINES25 ? 25 : 24)
+#define YSIZE (LINES * 8)
+#define COLUMNS40 (m_reg[7] & 0x08) /* else 38 Columns */
+#define COLUMNS (COLUMNS40 ? 40 : 38)
+#define XSIZE (COLUMNS * 8)
+
+#define INROM (m_reg[0x12] & 0x04)
+#define CHARGENADDR (REVERSEON && !HIRESON && !MULTICOLORON ? ((m_reg[0x13] & 0xfc) << 8) : ((m_reg[0x13] & 0xf8) << 8))
+#define BITMAPADDR ((m_reg[0x12] & 0x38) << 10)
+#define VIDEOADDR ((m_reg[0x14] & 0xf8) << 8)
+
+#define RASTERLINE (((m_reg[0xa] & 0x01) << 8) | m_reg[0xb])
+#define CURSOR1POS (m_reg[0xd] | ((m_reg[0xc] & 0x03) << 8))
+#define CURSOR2POS (m_reg[0x1b] | ((m_reg[0x1a] & 0x03) << 8))
+#define CURSORRATE ((m_reg[0x1f] & 0x7c) >> 2)
+
+#define BACKGROUNDCOLOR (m_reg[0x15] & 0x7f)
+#define FOREGROUNDCOLOR (m_reg[0x16] & 0x7f)
+#define MULTICOLOR1 (m_reg[0x17] & 0x7f)
+#define MULTICOLOR2 (m_reg[0x18] & 0x7f)
+#define FRAMECOLOR (m_reg[0x19] & 0x7f)
+
+#define TED7360_CLOCK (m_clock / 4)
+#define TED7360_VRETRACERATE ((m_clock == TED7360PAL_CLOCK) ? TED7360PAL_VRETRACERATE : TED7360NTSC_VRETRACERATE)
+#define TED7360_LINES ((m_clock == TED7360PAL_CLOCK) ? TED7360PAL_LINES : TED7360NTSC_LINES)
+
+static attotime TEDTIME_IN_CYCLES(int cycles)
+{
+ double d = (double)(cycles) / clock();
+ return attotime::from_double(d);
+}
+
+static int TEDTIME_TO_CYCLES(attotime t)
+{
+ double d = t.as_double();
+ return (int)(d * clock());
+}
+
+static const UINT8 PALETTE[] =
+{
+/* black, white, red, cyan */
+/* purple, green, blue, yellow */
+/* orange, light orange, pink, light cyan, */
+/* light violett, light green, light blue, light yellow */
+/* these 16 colors are 8 times here in different luminance (dark..light) */
+/* taken from digitized tv screenshot */
+ 0x06, 0x01, 0x03, 0x2b, 0x2b, 0x2b, 0x67, 0x0e, 0x0f, 0x00, 0x3f, 0x42,
+ 0x57, 0x00, 0x6d, 0x00, 0x4e, 0x00, 0x19, 0x1c, 0x94, 0x38, 0x38, 0x00,
+ 0x56, 0x20, 0x00, 0x4b, 0x28, 0x00, 0x16, 0x48, 0x00, 0x69, 0x07, 0x2f,
+ 0x00, 0x46, 0x26, 0x06, 0x2a, 0x80, 0x2a, 0x14, 0x9b, 0x0b, 0x49, 0x00,
+
+ 0x00, 0x03, 0x02, 0x3d, 0x3d, 0x3d, 0x75, 0x1e, 0x20, 0x00, 0x50, 0x4f,
+ 0x6a, 0x10, 0x78, 0x04, 0x5c, 0x00, 0x2a, 0x2a, 0xa3, 0x4c, 0x47, 0x00,
+ 0x69, 0x2f, 0x00, 0x59, 0x38, 0x00, 0x26, 0x56, 0x00, 0x75, 0x15, 0x41,
+ 0x00, 0x58, 0x3d, 0x15, 0x3d, 0x8f, 0x39, 0x22, 0xae, 0x19, 0x59, 0x00,
+
+ 0x00, 0x03, 0x04, 0x42, 0x42, 0x42, 0x7b, 0x28, 0x20, 0x02, 0x56, 0x59,
+ 0x6f, 0x1a, 0x82, 0x0a, 0x65, 0x09, 0x30, 0x34, 0xa7, 0x50, 0x51, 0x00,
+ 0x6e, 0x36, 0x00, 0x65, 0x40, 0x00, 0x2c, 0x5c, 0x00, 0x7d, 0x1e, 0x45,
+ 0x01, 0x61, 0x45, 0x1c, 0x45, 0x99, 0x42, 0x2d, 0xad, 0x1d, 0x62, 0x00,
+
+ 0x05, 0x00, 0x02, 0x56, 0x55, 0x5a, 0x90, 0x3c, 0x3b, 0x17, 0x6d, 0x72,
+ 0x87, 0x2d, 0x99, 0x1f, 0x7b, 0x15, 0x46, 0x49, 0xc1, 0x66, 0x63, 0x00,
+ 0x84, 0x4c, 0x0d, 0x73, 0x55, 0x00, 0x40, 0x72, 0x00, 0x91, 0x33, 0x5e,
+ 0x19, 0x74, 0x5c, 0x32, 0x59, 0xae, 0x59, 0x3f, 0xc3, 0x32, 0x76, 0x00,
+
+ 0x02, 0x01, 0x06, 0x84, 0x7e, 0x85, 0xbb, 0x67, 0x68, 0x45, 0x96, 0x96,
+ 0xaf, 0x58, 0xc3, 0x4a, 0xa7, 0x3e, 0x73, 0x73, 0xec, 0x92, 0x8d, 0x11,
+ 0xaf, 0x78, 0x32, 0xa1, 0x80, 0x20, 0x6c, 0x9e, 0x12, 0xba, 0x5f, 0x89,
+ 0x46, 0x9f, 0x83, 0x61, 0x85, 0xdd, 0x84, 0x6c, 0xef, 0x5d, 0xa3, 0x29,
+
+ 0x02, 0x00, 0x0a, 0xb2, 0xac, 0xb3, 0xe9, 0x92, 0x92, 0x6c, 0xc3, 0xc1,
+ 0xd9, 0x86, 0xf0, 0x79, 0xd1, 0x76, 0x9d, 0xa1, 0xff, 0xbd, 0xbe, 0x40,
+ 0xdc, 0xa2, 0x61, 0xd1, 0xa9, 0x4c, 0x93, 0xc8, 0x3d, 0xe9, 0x8a, 0xb1,
+ 0x6f, 0xcd, 0xab, 0x8a, 0xb4, 0xff, 0xb2, 0x9a, 0xff, 0x88, 0xcb, 0x59,
+
+ 0x02, 0x00, 0x0a, 0xc7, 0xca, 0xc9, 0xff, 0xac, 0xac, 0x85, 0xd8, 0xe0,
+ 0xf3, 0x9c, 0xff, 0x92, 0xea, 0x8a, 0xb7, 0xba, 0xff, 0xd6, 0xd3, 0x5b,
+ 0xf3, 0xbe, 0x79, 0xe6, 0xc5, 0x65, 0xb0, 0xe0, 0x57, 0xff, 0xa4, 0xcf,
+ 0x89, 0xe5, 0xc8, 0xa4, 0xca, 0xff, 0xca, 0xb3, 0xff, 0xa2, 0xe5, 0x7a,
+
+ 0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, 0xf6, 0xf2, 0xd1, 0xff, 0xff,
+ 0xff, 0xe9, 0xff, 0xdb, 0xff, 0xd3, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xa3,
+ 0xff, 0xff, 0xc1, 0xff, 0xff, 0xb2, 0xfc, 0xff, 0xa2, 0xff, 0xee, 0xff,
+ 0xd1, 0xff, 0xff, 0xeb, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xed, 0xff, 0xbc
+};
+
+
+#define NOISE_BUFFER_SIZE_SEC 5
+
+#define TONE_ON (!(m_reg[0x11] & 0x80)) /* or tone update!? */
+#define TONE1_ON ((m_reg[0x11] & 0x10))
+#define TONE1_VALUE (m_reg[0x0e] | ((m_reg[0x12] & 3) << 8))
+#define TONE2_ON ((m_reg[0x11] & 0x20))
+#define TONE2_VALUE (m_reg[0x0f] | ((m_reg[0x10] & 3) << 8))
+#define VOLUME (m_reg[0x11] & 0x0f)
+#define NOISE_ON (m_reg[0x11] & 0x40)
+
+/*
+ * pal 111860.781
+ * ntsc 111840.45
+ */
+#define TONE_FREQUENCY(reg) ((TED7360_CLOCK >> 3) / (1024 - reg))
+#define TONE_FREQUENCY_MIN (TONE_FREQUENCY(0))
+#define NOISE_FREQUENCY (TED7360_CLOCK / 8 / (1024 - TONE2_VALUE))
+#define NOISE_FREQUENCY_MAX (TED7360_CLOCK / 8)
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// device type definition
+const device_type MOS7360 = &device_creator<mos7360_device>;
+
+
+
+//**************************************************************************
+// INLINE HELPERS
+//**************************************************************************
+
+inline void mos7360_device::set_interrupt(int mask)
+{
+ /* kernel itself polls for timer 2 shot (interrupt disabled!) when cassette loading */
+ m_reg[9] |= mask;
+ if ((m_reg[0xa] & m_reg[9] & 0x5e))
+ {
+ if (!(m_reg[9] & 0x80))
+ {
+ //DBG_LOG(1, "ted7360", ("irq start %.2x\n", mask));
+ m_reg[9] |= 0x80;
+ m_out_irq_func(ASSERT_LINE);
+ }
+ }
+ m_reg[9] |= mask;
+}
+
+inline void mos7360_device::clear_interrupt(int mask)
+{
+ m_reg[9] &= ~mask;
+ if ((m_reg[9] & 0x80) && !(m_reg[9] & m_reg[0xa] & 0x5e))
+ {
+ DBG_LOG(1, "ted7360", ("irq end %.2x\n", mask));
+ m_reg[9] &= ~0x80;
+ m_out_irq_func(CLEAR_LINE);
+ }
+}
+
+inline int mos7360_device::rastercolumn()
+{
+ return (int) ((machine().time().as_double() - m_rastertime) * TED7360_VRETRACERATE * m_lines * 57 * 8 + 0.5);
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// mos7360_device - constructor
+//-------------------------------------------------
+
+mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MOS7360, "MOS7360", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_stream(NULL)
+{
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void mos7360_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const mos7360_interface *intf = reinterpret_cast<const mos7360_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<mos7360_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
+ memset(&m_in_ram_cb, 0, sizeof(m_in_ram_cb));
+ memset(&m_in_rom_cb, 0, sizeof(m_in_rom_cb));
+ memset(&m_in_k_cb, 0, sizeof(m_in_k_cb));
+ }
+}
+
+
+//------------------------------