summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2014-10-15 07:19:47 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2014-10-15 07:19:47 +0000
commitc93ed344fbd26a9c2c49bdbc99014d8dc0cbe9ef (patch)
treea5017b8341bdadc5bcd1185ae49fe4c0a85424b8
parenta4dd32afb6cbfaae0e452c90486060682ab1c31c (diff)
Cleanups and version bumpmame0155
-rw-r--r--hash/a7800.xml6
-rw-r--r--hash/amiga_a3000.xml8
-rw-r--r--hash/amiga_hardware.xml22
-rw-r--r--hash/coleco.xml12
-rw-r--r--hash/fm7_disk.xml2
-rw-r--r--hash/fmtowns_cd.xml4
-rw-r--r--hash/gamegear.xml14
-rw-r--r--hash/gameking.xml32
-rw-r--r--hash/gbcolor.xml2
-rw-r--r--hash/intvecs.xml2
-rw-r--r--hash/msx1_cart.xml22
-rw-r--r--hash/nes.xml2
-rw-r--r--hash/pencil2.xml4
-rw-r--r--hash/psx.xml22
-rw-r--r--hash/timex_dock.xml2
-rw-r--r--src/emu/bus/a2bus/a2corvus.c2
-rw-r--r--src/emu/bus/a2bus/a2lang.c2
-rw-r--r--src/emu/bus/a2bus/corvfdc01.c17
-rw-r--r--src/emu/bus/a2bus/corvfdc02.c38
-rw-r--r--src/emu/bus/a2bus/corvfdc02.h2
-rw-r--r--src/emu/bus/a2bus/laser128.c6
-rw-r--r--src/emu/bus/a2bus/mouse.c136
-rw-r--r--src/emu/bus/a2bus/timemasterho.c43
-rw-r--r--src/emu/bus/a7800/a78_carts.h8
-rw-r--r--src/emu/bus/a7800/a78_slot.c86
-rw-r--r--src/emu/bus/a7800/a78_slot.h32
-rw-r--r--src/emu/bus/a7800/cpuwiz.c20
-rw-r--r--src/emu/bus/a7800/cpuwiz.h14
-rw-r--r--src/emu/bus/a7800/hiscore.c3
-rw-r--r--src/emu/bus/a7800/hiscore.h4
-rw-r--r--src/emu/bus/a7800/rom.c51
-rw-r--r--src/emu/bus/a7800/rom.h54
-rw-r--r--src/emu/bus/a7800/xboard.c30
-rw-r--r--src/emu/bus/a7800/xboard.h10
-rw-r--r--src/emu/bus/a800/a800_carts.h6
-rw-r--r--src/emu/bus/a800/a800_slot.c53
-rw-r--r--src/emu/bus/a800/a800_slot.h18
-rw-r--r--src/emu/bus/a800/oss.c31
-rw-r--r--src/emu/bus/a800/oss.h16
-rw-r--r--src/emu/bus/a800/rom.c89
-rw-r--r--src/emu/bus/a800/rom.h50
-rw-r--r--src/emu/bus/a800/sparta.c15
-rw-r--r--src/emu/bus/a800/sparta.h6
-rw-r--r--src/emu/bus/apf/rom.h2
-rw-r--r--src/emu/bus/apf/slot.c6
-rw-r--r--src/emu/bus/apf/slot.h7
-rw-r--r--src/emu/bus/arcadia/slot.c3
-rw-r--r--src/emu/bus/arcadia/slot.h3
-rw-r--r--src/emu/bus/c64/dela_ep256.c2
-rw-r--r--src/emu/bus/c64/rex_ep256.h2
-rw-r--r--src/emu/bus/centronics/digiblst.h8
-rw-r--r--src/emu/bus/chanf/rom.c11
-rw-r--r--src/emu/bus/chanf/rom.h26
-rw-r--r--src/emu/bus/chanf/slot.c14
-rw-r--r--src/emu/bus/chanf/slot.h7
-rw-r--r--src/emu/bus/cpc/amdrum.h2
-rw-r--r--src/emu/bus/cpc/symbfac2.c50
-rw-r--r--src/emu/bus/cpc/symbfac2.h2
-rw-r--r--src/emu/bus/crvision/rom.c2
-rw-r--r--src/emu/bus/crvision/rom.h10
-rw-r--r--src/emu/bus/crvision/slot.c5
-rw-r--r--src/emu/bus/crvision/slot.h3
-rw-r--r--src/emu/bus/gameboy/gb_slot.h8
-rw-r--r--src/emu/bus/gameboy/mbc.h4
-rw-r--r--src/emu/bus/gba/gba_slot.h6
-rw-r--r--src/emu/bus/generic/carts.c4
-rw-r--r--src/emu/bus/generic/ram.c15
-rw-r--r--src/emu/bus/generic/ram.h12
-rw-r--r--src/emu/bus/generic/rom.c9
-rw-r--r--src/emu/bus/generic/rom.h8
-rw-r--r--src/emu/bus/generic/slot.c21
-rw-r--r--src/emu/bus/generic/slot.h10
-rw-r--r--src/emu/bus/intv/ecs.c55
-rw-r--r--src/emu/bus/intv/ecs.h42
-rw-r--r--src/emu/bus/intv/rom.c1
-rw-r--r--src/emu/bus/intv/rom.h8
-rw-r--r--src/emu/bus/intv/slot.c83
-rw-r--r--src/emu/bus/intv/slot.h13
-rw-r--r--src/emu/bus/intv/voice.h24
-rw-r--r--src/emu/bus/isa/sb16.c12
-rw-r--r--src/emu/bus/isa/svga_trident.c4
-rw-r--r--src/emu/bus/isa/trident.c120
-rw-r--r--src/emu/bus/megadrive/ggenie.c26
-rw-r--r--src/emu/bus/msx_cart/disk.c3
-rw-r--r--src/emu/bus/msx_slot/disk.c3
-rw-r--r--src/emu/bus/nes/disksys.c79
-rw-r--r--src/emu/bus/nes/nes_slot.c20
-rw-r--r--src/emu/bus/nes/nes_slot.h4
-rw-r--r--src/emu/bus/odyssey2/chess.h5
-rw-r--r--src/emu/bus/odyssey2/rom.c5
-rw-r--r--src/emu/bus/odyssey2/rom.h12
-rw-r--r--src/emu/bus/odyssey2/slot.c5
-rw-r--r--src/emu/bus/odyssey2/slot.h5
-rw-r--r--src/emu/bus/odyssey2/voice.c2
-rw-r--r--src/emu/bus/odyssey2/voice.h2
-rw-r--r--src/emu/bus/pet/cb2snd.c1
-rw-r--r--src/emu/bus/rs232/xvd701.c4
-rw-r--r--src/emu/bus/saturn/sat_slot.c6
-rw-r--r--src/emu/bus/scv/rom.h16
-rw-r--r--src/emu/bus/scv/slot.c5
-rw-r--r--src/emu/bus/scv/slot.h7
-rw-r--r--src/emu/bus/sega8/ccatch.c4
-rw-r--r--src/emu/bus/sega8/mgear.h4
-rw-r--r--src/emu/bus/sega8/rom.c2
-rw-r--r--src/emu/bus/sega8/sega8_slot.c1
-rw-r--r--src/emu/bus/sega8/sega8_slot.h2
-rw-r--r--src/emu/bus/sms_ctrl/graphic.c21
-rw-r--r--src/emu/bus/snes/snes_slot.h6
-rw-r--r--src/emu/bus/vboy/rom.h4
-rw-r--r--src/emu/bus/vboy/slot.c6
-rw-r--r--src/emu/bus/vboy/slot.h7
-rw-r--r--src/emu/bus/vc4000/rom.c106
-rw-r--r--src/emu/bus/vc4000/rom.h4
-rw-r--r--src/emu/bus/vc4000/slot.c8
-rw-r--r--src/emu/bus/vc4000/slot.h7
-rw-r--r--src/emu/bus/vcs/compumat.c4
-rw-r--r--src/emu/bus/vcs/compumat.h4
-rw-r--r--src/emu/bus/vcs/dpc.c11
-rw-r--r--src/emu/bus/vcs/dpc.h8
-rwxr-xr-xsrc/emu/bus/vcs/rom.c131
-rwxr-xr-xsrc/emu/bus/vcs/rom.h76
-rw-r--r--src/emu/bus/vcs/scharger.c38
-rw-r--r--src/emu/bus/vcs/scharger.h6
-rwxr-xr-xsrc/emu/bus/vcs/vcs_slot.c86
-rwxr-xr-xsrc/emu/bus/vcs/vcs_slot.h6
-rw-r--r--src/emu/bus/vectrex/rom.h6
-rw-r--r--src/emu/bus/vectrex/slot.c24
-rw-r--r--src/emu/bus/vectrex/slot.h3
-rw-r--r--src/emu/bus/vic20/fe3.c48
-rw-r--r--src/emu/bus/vic20/fe3.h2
-rw-r--r--src/emu/bus/wswan/rom.c108
-rw-r--r--src/emu/bus/wswan/rom.h8
-rw-r--r--src/emu/bus/wswan/slot.c28
-rw-r--r--src/emu/bus/wswan/slot.h7
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.c9
-rw-r--r--src/emu/cpu/hd61700/hd61700.c2
-rw-r--r--src/emu/cpu/hd61700/hd61700.h4
-rw-r--r--src/emu/cpu/i86/i186.c8
-rw-r--r--src/emu/cpu/mcs96/mcs96.c8
-rw-r--r--src/emu/cpu/mips/mips3drc.c2
-rw-r--r--src/emu/cpu/rsp/rsp.c52
-rw-r--r--src/emu/cpu/rsp/rspdrc.c1
-rw-r--r--src/emu/cpu/sh4/sh4.c4
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.c90
-rw-r--r--src/emu/cpu/tms32031/tms32031.h2
-rw-r--r--src/emu/cpu/tms32051/tms32051.c4
-rw-r--r--src/emu/cpu/tms32051/tms32051.h2
-rw-r--r--src/emu/cpu/tms34010/tms34010.c4
-rw-r--r--src/emu/cpu/tms34010/tms34010.h34
-rw-r--r--src/emu/cpu/tms7000/tms7000.c4
-rw-r--r--src/emu/cpu/tms7000/tms7000.h2
-rw-r--r--src/emu/debug/debugcpu.c2
-rw-r--r--src/emu/devcpu.c1
-rw-r--r--src/emu/diimage.c6
-rw-r--r--src/emu/imagedev/floppy.c2
-rw-r--r--src/emu/machine.c2
-rw-r--r--src/emu/machine/mb8421.c6
-rw-r--r--src/emu/machine/pit8253.c2
-rw-r--r--src/emu/machine/rp5h01.c2
-rw-r--r--src/emu/machine/smpc.c2
-rw-r--r--src/emu/machine/wozfdc.c6
-rw-r--r--src/emu/sound/flt_rc.h10
-rw-r--r--src/emu/sound/k053260.c4
-rw-r--r--src/emu/sound/k053260.h2
-rw-r--r--src/emu/sound/samples.c2
-rw-r--r--src/emu/sound/samples.h6
-rw-r--r--src/emu/sound/speaker.h4
-rw-r--r--src/emu/sound/ymf278b.c2
-rw-r--r--src/emu/sound/zsg2.c2
-rw-r--r--src/emu/ui/swlist.c2
-rw-r--r--src/emu/ui/ui.c4
-rw-r--r--src/emu/video/315_5124.c2
-rw-r--r--src/emu/video/epic12.c2
-rw-r--r--src/emu/video/upd7220.c2
-rw-r--r--src/emu/video/vooddefs.h18
-rw-r--r--src/emu/video/voodoo.c4
-rw-r--r--src/emu/webengine.c222
-rw-r--r--src/lib/formats/ap2_dsk.c4
-rw-r--r--src/lib/formats/dmk_dsk.c1
-rw-r--r--src/lib/formats/dmk_dsk.h1
-rw-r--r--src/lib/formats/mfi_dsk.c4
-rw-r--r--src/lib/web/mongoose.c7301
-rw-r--r--src/lib/web/mongoose.h104
-rw-r--r--src/mame/audio/cclimber.h4
-rw-r--r--src/mame/audio/leland.c6
-rw-r--r--src/mame/audio/mario.c1
-rw-r--r--src/mame/drivers/20pacgal.c2
-rw-r--r--src/mame/drivers/4enraya.c14
-rw-r--r--src/mame/drivers/8080bw.c6
-rw-r--r--src/mame/drivers/aces1.c18
-rw-r--r--src/mame/drivers/alg.c24
-rw-r--r--src/mame/drivers/aristmk4.c2
-rw-r--r--src/mame/drivers/arkanoid.c10
-rw-r--r--src/mame/drivers/atarisy4.c16
-rw-r--r--src/mame/drivers/bartop52.c2
-rw-r--r--src/mame/drivers/battlera.c2
-rw-r--r--src/mame/drivers/bfm_sc1.c2
-rw-r--r--src/mame/drivers/bfm_sc2.c6
-rw-r--r--src/mame/drivers/bmcpokr.c76
-rw-r--r--src/mame/drivers/btoads.c2
-rw-r--r--src/mame/drivers/bublbobl.c2
-rw-r--r--src/mame/drivers/calchase.c19
-rw-r--r--src/mame/drivers/capr1.c18
-rw-r--r--src/mame/drivers/caprcyc.c6
-rw-r--r--src/mame/drivers/centiped.c16
-rw-r--r--src/mame/drivers/chqflag.c2
-rw-r--r--src/mame/drivers/coinmvga.c2
-rw-r--r--src/mame/drivers/coolpool.c2
-rw-r--r--src/mame/drivers/cops.c62
-rw-r--r--src/mame/drivers/cps1.c42
-rw-r--r--src/mame/drivers/cv1k.c8
-rw-r--r--src/mame/drivers/dkong.c4
-rw-r--r--src/mame/drivers/dlair.c2
-rw-r--r--src/mame/drivers/dlair2.c2
-rw-r--r--src/mame/drivers/dragrace.c2
-rw-r--r--src/mame/drivers/fcrash.c12
-rw-r--r--src/mame/drivers/foodf.c8
-rw-r--r--src/mame/drivers/fuukifg2.c2
-rw-r--r--src/mame/drivers/gaiden.c2
-rw-r--r--src/mame/drivers/galaxian.c8
-rw-r--r--src/mame/drivers/galpani3.c6
-rw-r--r--src/mame/drivers/galpanic.c2
-rw-r--r--src/mame/drivers/hikaru.c64
-rw-r--r--src/mame/drivers/igs011.c6
-rw-r--r--src/mame/drivers/igs017.c34
-rw-r--r--src/mame/drivers/iqblock.c6
-rw-r--r--src/mame/drivers/itech32.c28
-rw-r--r--src/mame/drivers/jchan.c2
-rw-r--r--src/mame/drivers/jclub2.c2
-rw-r--r--src/mame/drivers/jeutel.c2
-rw-r--r--src/mame/drivers/karnov.c8
-rw-r--r--src/mame/drivers/legionna.c14
-rw-r--r--src/mame/drivers/ltd.c2
-rw-r--r--src/mame/drivers/macs.c4
-rw-r--r--src/mame/drivers/mario.c22
-rw-r--r--src/mame/drivers/maxaflex.c4
-rw-r--r--src/mame/drivers/mazerbla.c2
-rw-r--r--src/mame/drivers/megatech.c18
-rw-r--r--src/mame/drivers/metro.c12
-rw-r--r--src/mame/drivers/mgavegas.c276
-rw-r--r--src/mame/drivers/midtunit.c2
-rw-r--r--src/mame/drivers/midwunit.c2
-rw-r--r--src/mame/drivers/midxunit.c2
-rw-r--r--src/mame/drivers/midyunit.c4
-rw-r--r--src/mame/drivers/model1.c4
-rw-r--r--src/mame/drivers/model3.c28
-rw-r--r--src/mame/drivers/mpu5hw.c38
-rw-r--r--src/mame/drivers/namcops2.c16
-rw-r--r--src/mame/drivers/namcos21.c2
-rw-r--r--src/mame/drivers/naomi.c30
-rw-r--r--src/mame/drivers/nmk16.c139
-rw-r--r--src/mame/drivers/pacman.c10
-rw-r--r--src/mame/drivers/peplus.c12
-rw-r--r--src/mame/drivers/potgoldu.c6
-rw-r--r--src/mame/drivers/punchout.c20
-rw-r--r--src/mame/drivers/r2dx_v33.c68
-rw-r--r--src/mame/drivers/raiden2.c20
-rw-r--r--src/mame/drivers/rainbow.c4
-rw-r--r--src/mame/drivers/rastersp.c2
-rw-r--r--src/mame/drivers/redclash.c2
-rw-r--r--src/mame/drivers/segac2.c2
-rw-r--r--src/mame/drivers/segas18.c2
-rw-r--r--src/mame/drivers/segas32.c40
-rw-r--r--src/mame/drivers/segaybd.c4
-rw-r--r--src/mame/drivers/simple_st0016.c4
-rw-r--r--src/mame/drivers/skimaxx.c10
-rw-r--r--src/mame/drivers/snesb.c66
-rw-r--r--src/mame/drivers/snk6502.c2
-rw-r--r--src/mame/drivers/snowbros.c2
-rw-r--r--src/mame/drivers/speedbal.c30
-rw-r--r--src/mame/drivers/speglsht.c2
-rw-r--r--src/mame/drivers/splash.c64
-rw-r--r--src/mame/drivers/srmp5.c8
-rw-r--r--src/mame/drivers/st_mp100.c2
-rw-r--r--src/mame/drivers/stv.c10
-rw-r--r--src/mame/drivers/system16.c4
-rw-r--r--src/mame/drivers/taito_z.c18
-rw-r--r--src/mame/drivers/tatsumi.c2
-rw-r--r--src/mame/drivers/tickee.c16
-rw-r--r--src/mame/drivers/travrusa.c1
-rw-r--r--src/mame/drivers/twinkle.c4
-rw-r--r--src/mame/drivers/vamphalf.c6
-rw-r--r--src/mame/drivers/vectrex.c2
-rw-r--r--src/mame/drivers/warpsped.c4
-rw-r--r--src/mame/drivers/xtheball.c2
-rw-r--r--src/mame/includes/8080bw.h2
-rw-r--r--src/mame/includes/artmagic.h8
-rw-r--r--src/mame/includes/bfm_sc45.h2
-rw-r--r--src/mame/includes/cinemat.h4
-rw-r--r--src/mame/includes/coolpool.h4
-rw-r--r--src/mame/includes/cosmic.h4
-rw-r--r--src/mame/includes/exterm.h4
-rw-r--r--src/mame/includes/fuukifg2.h2
-rw-r--r--src/mame/includes/fuukifg3.h2
-rw-r--r--src/mame/includes/harddriv.h12
-rw-r--r--src/mame/includes/jpmimpct.h4
-rw-r--r--src/mame/includes/konamigx.h2
-rw-r--r--src/mame/includes/legionna.h4
-rw-r--r--src/mame/includes/meadows.h4
-rw-r--r--src/mame/includes/micro3d.h4
-rw-r--r--src/mame/includes/midtunit.h2
-rw-r--r--src/mame/includes/midyunit.h4
-rw-r--r--src/mame/includes/model1.h4
-rw-r--r--src/mame/includes/model3.h4
-rw-r--r--src/mame/includes/namcos2.h2
-rw-r--r--src/mame/includes/polyplay.h6
-rw-r--r--src/mame/includes/raiden2.h50
-rw-r--r--src/mame/includes/simple_st0016.h2
-rw-r--r--src/mame/includes/snk.h8
-rw-r--r--src/mame/includes/splash.h2
-rw-r--r--src/mame/includes/sslam.h4
-rw-r--r--src/mame/includes/stv.h2
-rw-r--r--src/mame/includes/suna8.h2
-rw-r--r--src/mame/includes/suprnova.h4
-rw-r--r--src/mame/includes/taito_f3.h6
-rw-r--r--src/mame/includes/tatsumi.h4
-rw-r--r--src/mame/includes/thepit.h4
-rw-r--r--src/mame/includes/tnzs.h4
-rw-r--r--src/mame/includes/vectrex.h2
-rw-r--r--src/mame/layout/mgavegas.lay64
-rw-r--r--src/mame/layout/s11a.lay2
-rw-r--r--src/mame/machine/315_5296.c28
-rw-r--r--src/mame/machine/amiga.c2
-rw-r--r--src/mame/machine/asic65.c2
-rw-r--r--src/mame/machine/atari.c2
-rw-r--r--src/mame/machine/awboard.h4
-rw-r--r--src/mame/machine/inder_vid.c2
-rw-r--r--src/mame/machine/inder_vid.h4
-rw-r--r--src/mame/machine/kaneko_calc3.h6
-rw-r--r--src/mame/machine/kaneko_toybox.h4
-rw-r--r--src/mame/machine/konppc.c2
-rw-r--r--src/mame/machine/model1.c96
-rw-r--r--src/mame/machine/nmk004.c2
-rw-r--r--src/mame/machine/raiden2cop.c143
-rw-r--r--src/mame/machine/raiden2cop.h7
-rw-r--r--src/mame/machine/seicop.c12
-rw-r--r--src/mame/machine/seicop.h1
-rw-r--r--src/mame/machine/st0016.c53
-rw-r--r--src/mame/machine/st0016.h2
-rw-r--r--src/mame/machine/vectrex.c4
-rw-r--r--src/mame/mame.lst72
-rw-r--r--src/mame/mame.mak2
-rw-r--r--src/mame/video/antic.c131
-rw-r--r--src/mame/video/antic.h24
-rw-r--r--src/mame/video/battlera.c1
-rw-r--r--src/mame/video/decmxc06.h2
-rw-r--r--src/mame/video/dooyong.c5
-rw-r--r--src/mame/video/fuukifg.c6
-rw-r--r--src/mame/video/fuukifg.h7
-rw-r--r--src/mame/video/fuukifg3.c4
-rw-r--r--src/mame/video/gtia.c14
-rw-r--r--src/mame/video/gtia.h24
-rw-r--r--src/mame/video/k054156_k054157_k056832.c2
-rw-r--r--src/mame/video/legionna.c15
-rw-r--r--src/mame/video/mario.c7
-rw-r--r--src/mame/video/model3.c676
-rw-r--r--src/mame/video/seibuspi.c4
-rw-r--r--src/mame/video/sknsspr.h2
-rw-r--r--src/mame/video/skyfox.c2
-rw-r--r--src/mame/video/snk.c2
-rw-r--r--src/mame/video/taito_f3.c2
-rw-r--r--src/mame/video/tc0480scp.c2
-rw-r--r--src/mess/audio/vc4000snd.h8
-rw-r--r--src/mess/audio/wswan_snd.h12
-rw-r--r--src/mess/drivers/a2600.c6
-rw-r--r--src/mess/drivers/a7800.c26
-rw-r--r--src/mess/drivers/aim65.c2
-rw-r--r--src/mess/drivers/apf.c4
-rw-r--r--src/mess/drivers/apple2.c38
-rw-r--r--src/mess/drivers/apple2gs.c2
-rw-r--r--src/mess/drivers/apple3.c2
-rw-r--r--src/mess/drivers/atari400.c114
-rw-r--r--src/mess/drivers/atarist.c4
-rw-r--r--src/mess/drivers/atom.c8
-rw-r--r--src/mess/drivers/bbcbc.c2
-rw-r--r--src/mess/drivers/beta.c22
-rw-r--r--src/mess/drivers/casloopy.c8
-rw-r--r--src/mess/drivers/cc40.c14
-rw-r--r--src/mess/drivers/cgenie.c8
-rw-r--r--src/mess/drivers/channelf.c2
-rw-r--r--src/mess/drivers/concept.c4
-rw-r--r--src/mess/drivers/crvision.c4
-rw-r--r--src/mess/drivers/electron.c2
-rw-r--r--src/mess/drivers/ep64.c2
-rw-r--r--src/mess/drivers/exelv.c6
-rw-r--r--src/mess/drivers/fc100.c2
-rw-r--r--src/mess/drivers/fm7.c196
-rw-r--r--src/mess/drivers/gameking.c8
-rw-r--r--src/mess/drivers/gamepock.c2
-rw-r--r--src/mess/drivers/gba.c2
-rw-r--r--src/mess/drivers/geniusiq.c4
-rw-r--r--src/mess/drivers/gmaster.c2
-rw-r--r--src/mess/drivers/ibmpcjr.c2
-rw-r--r--src/mess/drivers/intv.c22
-rw-r--r--src/mess/drivers/itt3030.c46
-rw-r--r--src/mess/drivers/kyocera.c12
-rw-r--r--src/mess/drivers/laser3k.c162
-rw-r--r--src/mess/drivers/m5.c2
-rw-r--r--src/mess/drivers/msx.c43
-rw-r--r--src/mess/drivers/myvision.c8
-rw-r--r--src/mess/drivers/nc.c6
-rw-r--r--src/mess/drivers/nes.c20
-rw-r--r--src/mess/drivers/ngp.c14
-rw-r--r--src/mess/drivers/pc2000.c6
-rw-r--r--src/mess/drivers/pc6001.c16
-rw-r--r--src/mess/drivers/pc8401a.c2
-rw-r--r--src/mess/drivers/pc9801.c16
-rw-r--r--src/mess/drivers/pegasus.c16
-rw-r--r--src/mess/drivers/pencil2.c2
-rw-r--r--src/mess/drivers/pet.c4
-rw-r--r--src/mess/drivers/pockstat.c2
-rw-r--r--src/mess/drivers/pokemini.c6
-rw-r--r--src/mess/drivers/pt68k4.c34
-rw-r--r--src/mess/drivers/pv1000.c12
-rw-r--r--src/mess/drivers/pv2000.c10
-rw-r--r--src/mess/drivers/rx78.c12
-rw-r--r--src/mess/drivers/scv.c6
-rw-r--r--src/mess/drivers/socrates.c4
-rw-r--r--src/mess/drivers/sorcerer.c4
-rw-r--r--src/mess/drivers/spc1000.c48
-rw-r--r--src/mess/drivers/specpls3.c22
-rw-r--r--src/mess/drivers/spectrum.c8
-rw-r--r--src/mess/drivers/studio2.c36
-rw-r--r--src/mess/drivers/supracan.c8
-rw-r--r--src/mess/drivers/sv8000.c10
-rw-r--r--src/mess/drivers/svision.c8
-rw-r--r--src/mess/drivers/thomson.c2
-rw-r--r--src/mess/drivers/ti74.c32
-rw-r--r--src/mess/drivers/timex.c14
-rw-r--r--src/mess/drivers/tsispch.c6
-rw-r--r--src/mess/drivers/tutor.c6
-rw-r--r--src/mess/drivers/tvc.c12
-rw-r--r--src/mess/drivers/uzebox.c2
-rw-r--r--src/mess/drivers/vboy.c4
-rw-r--r--src/mess/drivers/vc4000.c30
-rw-r--r--src/mess/drivers/vii.c30
-rw-r--r--src/mess/drivers/x07.c6
-rw-r--r--src/mess/includes/apple2.h4
-rw-r--r--src/mess/includes/atom.h10
-rw-r--r--src/mess/includes/concept.h2
-rw-r--r--src/mess/includes/electron.h4
-rw-r--r--src/mess/includes/intv.h4
-rw-r--r--src/mess/includes/radio86.h2
-rw-r--r--src/mess/includes/svi318.h18
-rw-r--r--src/mess/machine/aim65.c2
-rw-r--r--src/mess/machine/amigakbd.c28
-rw-r--r--src/mess/machine/amstrad.c12
-rw-r--r--src/mess/machine/apple2.c8
-rw-r--r--src/mess/machine/apple3.c1
-rw-r--r--src/mess/machine/bbc.c26
-rw-r--r--src/mess/machine/concept.c8
-rw-r--r--src/mess/machine/electron.c10
-rw-r--r--src/mess/machine/gamecom.c8
-rw-r--r--src/mess/machine/gamepock.c2
-rw-r--r--src/mess/machine/intv.c8
-rw-r--r--src/mess/machine/lynx.c17
-rw-r--r--src/mess/machine/nc.c11
-rw-r--r--src/mess/machine/nes.c2
-rw-r--r--src/mess/machine/primo.c2
-rw-r--r--src/mess/machine/svi318.c16
-rw-r--r--src/mess/machine/thomson.c8
-rw-r--r--src/mess/machine/vtech2.c12
-rw-r--r--src/mess/machine/wswan.c38
-rw-r--r--src/mess/mess.mak16
-rw-r--r--src/mess/tiny.lst2
-rw-r--r--src/mess/tools/imgtool/modules/amiga.c6
-rw-r--r--src/mess/video/advision.c2
-rw-r--r--src/mess/video/apple2.c14
-rw-r--r--src/mess/video/apple3.c2
-rw-r--r--src/mess/video/maria.c28
-rw-r--r--src/mess/video/maria.h10
-rw-r--r--src/mess/video/nes.c4
-rw-r--r--src/mess/video/thomson.c44
-rw-r--r--src/osd/sdl/osdsdl.h2
-rw-r--r--src/osd/sdl/sdlfile.c2
-rw-r--r--src/osd/sdl/sdlptty_win32.c1
-rw-r--r--src/osd/sdl/sdlsocket.c2
-rw-r--r--src/osd/sdl/sdlsync_win32.c2
-rw-r--r--src/osd/sdl/video.c2
-rw-r--r--src/osd/windows/vconv.c2
-rw-r--r--src/osd/windows/video.c10
-rw-r--r--src/osd/windows/video.h6
-rw-r--r--src/osd/windows/window.c12
-rw-r--r--src/osd/windows/window.h4
-rw-r--r--src/osd/windows/winos.c2
-rw-r--r--src/osd/windows/winos.h2
-rw-r--r--src/osd/windows/winsync.c2
-rw-r--r--src/osd/windows/winsync.h2
-rw-r--r--src/version.c2
489 files changed, 7744 insertions, 7847 deletions
diff --git a/hash/a7800.xml b/hash/a7800.xml
index 8234a34d5dd..8539b816d36 100644
--- a/hash/a7800.xml
+++ b/hash/a7800.xml
@@ -1318,8 +1318,8 @@ the buttons not work in emulators.
</software>
<!--
-The code has some race conditions for NMIs (related to input readings)
-and often fails to boot on real systems too. To successfully start the
+The code has some race conditions for NMIs (related to input readings)
+and often fails to boot on real systems too. To successfully start the
game, you can keep pressed Button 1 during Atari logo (thanks to Mike
Saarna for debugging the problem)
-->
@@ -2369,7 +2369,7 @@ almost nothing like the prototype.
<!-- This version features a lot *LESS* sounds than the newer version:
e.g. no sound in bobsled ans ski jump games!
- Dump is confirmed from multiple carts, and it was probably used in
+ Dump is confirmed from multiple carts, and it was probably used in
some erlier production run, until they found out the mistake and
replaced it with the complete version -->
<software name="wingameso" cloneof="wingames">
diff --git a/hash/amiga_a3000.xml b/hash/amiga_a3000.xml
index 932381fc1e0..3b066cc6ebd 100644
--- a/hash/amiga_a3000.xml
+++ b/hash/amiga_a3000.xml
@@ -31,9 +31,9 @@
</dataarea>
</part>
</software>
-
+
<!-- A3000 Installation disks -->
-
+
<software name="a3kin203">
<description>A3000 Install Disk 2.03</description>
<year>1991</year>
@@ -44,11 +44,11 @@
<rom name="335603-04_install.adf" size="901120" crc="9a3cc466" sha1="b12a225890a3957bb01dcbfba44c046c19e19c8f" offset="0"/>
</dataarea>
</part>
- </software>
+ </software>
<!-- Amiga UNIX System V Release 4 -->
<!-- TODO: Part numbers -->
-
+
<software name="amix11">
<description>UNIX System V Release 4 Amiga Version 1.1</description>
<year>1990</year>
diff --git a/hash/amiga_hardware.xml b/hash/amiga_hardware.xml
index 984a9054921..7f5416bccfe 100644
--- a/hash/amiga_hardware.xml
+++ b/hash/amiga_hardware.xml
@@ -12,7 +12,7 @@
<dataarea name="flop" size="901120">
<rom name="370132_a570_utilities.adf" size="901120" crc="30097474" sha1="958b97674e3e99fb9b0e3117009f27d4e7a9220b" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a590">
@@ -25,7 +25,7 @@
<dataarea name="flop" size="901120">
<rom name="317734-01_a590_scsi.adf" size="901120" crc="a560a938" sha1="9c6136c6580779a948cd1c0b50cb229512af415c" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a590_wd" cloneof="a590">
@@ -40,7 +40,7 @@
<dataarea name="flop" size="901120">
<rom name="317734-03_a590_wd.adf" size="901120" crc="a88fda41" sha1="7424f8645e1903e3e4ec8bb824186868319be1f3" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a590_seagate" cloneof="a590">
@@ -52,7 +52,7 @@
<dataarea name="flop" size="901120">
<rom name="317734-04_a590_seagate.adf" size="901120" status="nodump" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a590_ram">
@@ -64,7 +64,7 @@
<dataarea name="flop" size="901120">
<rom name="317830-01_a590_ram_test.adf" size="901120" crc="6583d1d0" sha1="7779b825b8555956d341ff7e909ab71d89e2321c" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a2024">
@@ -76,7 +76,7 @@
<dataarea name="flop" size="901120">
<rom name="317809-01_a2024_jumpstart.adf" size="901120" crc="dad46588" sha1="30c2c1f1d98bd008b2c67f3b23480181935d4b01" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a2091">
@@ -90,7 +90,7 @@
<dataarea name="flop" size="901120">
<rom name="317806-04_a2091_setup.adf" size="901120" crc="122c8f93" sha1="603e106c1a44a209171610af8d48bc35ad31c9bc" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a2058">
@@ -102,7 +102,7 @@
<dataarea name="flop" size="901120">
<rom name="317719-01_a2058_ram_test.adf" size="901120" crc="5dba7fc3" sha1="76fbce4bef7df0f6042c85376d9bdfd4d4911e74" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a2232">
@@ -114,7 +114,7 @@
<dataarea name="flop" size="901120">
<rom name="317769-01_a2232_install.adf" size="901120" crc="3caa21b7" sha1="24f47f6f88712f046303b8812a598043440a5e6d" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a2300">
@@ -126,7 +126,7 @@
<dataarea name="flop" size="901120">
<rom name="317718-02_a2300_genlock_demo.adf" size="901120" crc="464ff0f6" sha1="26b94e8d52d35e2746b74610bb9b65eb2f899297" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
<software name="a2320">
@@ -138,7 +138,7 @@
<dataarea name="flop" size="901120">
<rom name="317210-01_a2320_test_demo.adf" size="901120" crc="cff98aae" sha1="f46f7de0d908ed68abfd784d84b964cbce7dc503" offset="0"/>
</dataarea>
- </part>
+ </part>
</software>
</softwarelist>
diff --git a/hash/coleco.xml b/hash/coleco.xml
index a1bf7ccee63..011b4fec841 100644
--- a/hash/coleco.xml
+++ b/hash/coleco.xml
@@ -437,7 +437,7 @@
<software name="choplift">
<!-- Choplifter (1984)(Coleco)[a].bin -->
- <!-- Other available dump has corrupted gfx -->
+ <!-- Other available dump has corrupted gfx -->
<description>Choplifter!</description>
<year>1984</year>
<publisher>Coleco / CBS</publisher>
@@ -699,7 +699,7 @@
<part name="cart" interface="coleco_cart">
<dataarea name="rom" size="16384">
<rom name="apshai.1" size="8192" crc="aa3ec181" sha1="7f79628c298ad6e410af82eeb33871869ad23de8" offset="0x0000" />
- <!-- 2nd 8K chunk containes two copies of the same 4K data -->
+ <!-- 2nd 8K chunk containes two copies of the same 4K data -->
<rom name="apshai.2" size="8192" crc="0e440f8f" sha1="09ffaeb79cdd8173882b77a8398a4e00ba826de1" offset="0x2000" />
</dataarea>
</part>
@@ -2262,7 +2262,7 @@
<dataarea name="rom" size="24576">
<rom name="subroc.1" size="8192" crc="ff56b769" sha1="612a0abd13c4c7790890cbcb265a7fd786c7ec5c" offset="0x0000" />
<rom name="subroc.2" size="8192" crc="e9e60d4c" sha1="bfc94db65985b7a906099465a47d900f7a9a9106" offset="0x2000" />
- <!-- 3rd 8K chunk containes two copies of the same 4K data -->
+ <!-- 3rd 8K chunk containes two copies of the same 4K data -->
<rom name="subroc.3" size="8192" crc="abe18f08" sha1="6ebdc68397c7b20dceba12ff754f88c955d5f98a" offset="0x4000" />
</dataarea>
</part>
@@ -2369,9 +2369,9 @@
</software>
<software name="zaxxont" cloneof="zaxxon">
- <!-- The Taiwan Cooper cart contains a 32K ROM, the last 8K of which was found to
- contain 0x4000-0x4fff from Super Action Baseball followed by 0x1000-0x1fff
- from Meteoric Shower! -->
+ <!-- The Taiwan Cooper cart contains a 32K ROM, the last 8K of which was found to
+ contain 0x4000-0x4fff from Super Action Baseball followed by 0x1000-0x1fff
+ from Meteoric Shower! -->
<description>Zaxxon (Taiwan Cooper)</description>
<year>198?</year>
<publisher>Taiwan Cooper</publisher>
diff --git a/hash/fm7_disk.xml b/hash/fm7_disk.xml
index 0c6918f409e..f75a5b179a4 100644
--- a/hash/fm7_disk.xml
+++ b/hash/fm7_disk.xml
@@ -1657,7 +1657,7 @@ Titles, serial #s, publishers and release dates taken from:
</dataarea>
</part>
</software>
-
+
<software name="mdos7_09">
<description>M-DOS7 Volume 9</description>
<year>19??</year>
diff --git a/hash/fmtowns_cd.xml b/hash/fmtowns_cd.xml
index e2fc0a5f96c..f6d18346620 100644
--- a/hash/fmtowns_cd.xml
+++ b/hash/fmtowns_cd.xml
@@ -2,8 +2,8 @@
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
<softwarelist name="fmtowns" description="FM Towns CD-ROMs">
<!-- skeleton test list -->
-
- <!-- works well on fmtmarty, keyboard seems to interfere with movements on fmtowns -->
+
+ <!-- works well on fmtmarty, keyboard seems to interfere with movements on fmtowns -->
<software name="raiden">
<description>Raiden Densetsu / Raiden Trad</description>
<year>1991</year>
diff --git a/hash/gamegear.xml b/hash/gamegear.xml
index b99fe8e7104..805b3957d50 100644
--- a/hash/gamegear.xml
+++ b/hash/gamegear.xml
@@ -768,9 +768,9 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<!-- some disassembling performed by Paul Baker suggests that this version is a prototype
-e.g. the mapper control register at $fffc gets set to $80, you cannot switch characters
-on the pause screen, some messages are not displayed ("Sorry boys, no tickets, no show!"
-to explain why it is not possible to progress beyond a certain point in the game without
+e.g. the mapper control register at $fffc gets set to $80, you cannot switch characters
+on the pause screen, some messages are not displayed ("Sorry boys, no tickets, no show!"
+to explain why it is not possible to progress beyond a certain point in the game without
a certain item) -->
<software name="beavisp" cloneof="beavis">
<description>Beavis and Butt-head (Prototype?)</description>
@@ -7285,7 +7285,7 @@ a certain item) -->
</software>
<software name="soniclab">
- <!-- A final pre-release version of this same dump was found on a proto board with 4x128K sockets and no labels -->
+ <!-- A final pre-release version of this same dump was found on a proto board with 4x128K sockets and no labels -->
<description>Sonic Labyrinth (World)</description>
<year>1995</year>
<publisher>Sega</publisher>
@@ -7594,7 +7594,7 @@ a certain item) -->
</software>
<software name="sonic2d" cloneof="sonic2">
- <!-- This predates the final release and contains some different tiles & sprites compared to the final game -->
+ <!-- This predates the final release and contains some different tiles & sprites compared to the final game -->
<description>Sonic The Hedgehog 2 (Rolling Demo)</description>
<year>1992</year>
<publisher>Sega</publisher>
@@ -7609,7 +7609,7 @@ a certain item) -->
<feature name="batt" value="" />
<feature name="sw" value="ON = 1M / OFF = 256" />
<dataarea name="rom" size="262144">
- <!-- The ROM should be split in two halves -->
+ <!-- The ROM should be split in two halves -->
<rom name="sonic_2_auto_demo_prototype_(1991-12-05)_tmr_sega_cb06_ffff.bin" size="262144" crc="15ad37a5" sha1="b780c6f059b48d1bb48ee2ad521552dab1487c88" offset="000000" />
</dataarea>
</part>
@@ -8634,7 +8634,7 @@ a certain item) -->
</software>
<software name="tailsadv">
- <!-- A final pre-release version of this same dump was found on a proto board with 4x128K sockets and no labels -->
+ <!-- A final pre-release version of this same dump was found on a proto board with 4x128K sockets and no labels -->
<description>Tails Adventures (World)</description>
<year>1995</year>
<publisher>Sega</publisher>
diff --git a/hash/gameking.xml b/hash/gameking.xml
index b3335de0509..0764a60e97a 100644
--- a/hash/gameking.xml
+++ b/hash/gameking.xml
@@ -4,7 +4,7 @@
<!-- dumps are not yet verified as good, the 3-in-1 internal ROM is not yet dumped -->
<softwarelist name="gameking" description="TimeTop GameKing cartridges">
-
+
<software name="2004">
<description>2004</description>
<year>200?</year>
@@ -25,7 +25,7 @@
<rom name="adventure legend carlo.bin" size="0x20000" crc="7d61d215" sha1="741684b5379d4be732a98beace5d09f37ff19bbf" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="aries">
<description>Aries</description>
@@ -36,7 +36,7 @@
<rom name="aries.bin" size="0x20000" crc="b854f1f2" sha1="1ad7a325aba2cf3593165b53e7ae3973388335f7" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="dinoadv">
<description>Dino Adventure Legend</description>
@@ -47,7 +47,7 @@
<rom name="dino adventure legend.bin" size="0x20000" crc="2df0c1e6" sha1="df4b5dc80a758d9e3c9b00384e3099ad8331faad" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="duckman">
<description>Duck Man</description>
@@ -58,7 +58,7 @@
<rom name="duck man.bin" size="0x20000" crc="9d12950a" sha1="376606097f66105d1a9e97e9793362f6f1e3b1a7" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="happybal">
<description>Happy Ball</description>
@@ -69,7 +69,7 @@
<rom name="happy ball.bin" size="0x20000" crc="79d4e738" sha1="fc14712260ed6e3d6313055046546d37b7c838d2" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="happykil">
<description>Happy Killer</description>
@@ -80,7 +80,7 @@
<rom name="happy killer.bin" size="0x20000" crc="9fd7ec65" sha1="705309829ee87689793c15be1f781d52471908d6" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="lanner">
<description>Lanneret</description>
@@ -91,7 +91,7 @@
<rom name="lanneret.bin" size="0x20000" crc="249df6a5" sha1="bcf92ab85cc97ffe94d6a363a87b0b5de62c3c66" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="penguin">
<description>Penguin</description>
@@ -102,8 +102,8 @@
<rom name="penguin.bin" size="0x20000" crc="8c7b81c9" sha1="2f253b6ab6f6b9fc114ffca120d13df2e1e5f860" offset="0x00000" />
</dataarea>
</part>
- </software>
-
+ </software>
+
<software name="popper">
<description>Popper</description>
<year>200?</year>
@@ -113,7 +113,7 @@
<rom name="popper.bin" size="0x20000" crc="a704617b" sha1="314931548578303e5e80a2bcb03c92472cb014d9" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="sthero">
<description>Street Hero</description>
@@ -124,8 +124,8 @@
<rom name="street hero.bin" size="0x20000" crc="9e0fe489" sha1="2c442126999e4b112a48e42a82dfa9ad9d6efa22" offset="0x00000" />
</dataarea>
</part>
- </software>
-
+ </software>
+
<software name="smotor">
<description>Supermotor</description>
<year>200?</year>
@@ -135,7 +135,7 @@
<rom name="supermotor.bin" size="0x20000" crc="6290b94b" sha1="0c3011da35170241637907bb23d79355db38f343" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
<software name="trojanl">
<description>Trojan Legend</description>
@@ -146,8 +146,8 @@
<rom name="trojan legend.bin" size="0x20000" crc="7ce3975e" sha1="e925e4f28efc85ce69fb504b85a98a60883aa30d" offset="0x00000" />
</dataarea>
</part>
- </software>
+ </software>
+
-
</softwarelist>
diff --git a/hash/gbcolor.xml b/hash/gbcolor.xml
index 467b29a918f..a1aa94e5170 100644
--- a/hash/gbcolor.xml
+++ b/hash/gbcolor.xml
@@ -23639,7 +23639,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
* CBA078 Shuma Baolong - Diannao Pian æ•°ç æš´é¾™-电脑篇
* CBA079 Yingxiong Tianxia 英雄天下
* CBA080 Sanguozhi Wudai 三国志五代
- * CBA083 Tai Kong Bao Bei 太空å®è´
+ * CBA083 Tai Kong Bao Bei 太空å®è´
* CBA085 Shu Ma Bao Bei - Huojian Bingtuan æ•°ç å®è´-ç«ç®­å…µå›¢
* CBA086 Shu Ma Bao Bei - Chao Mengmeng Fanji Zhan æ•°ç å®è´-超梦梦å击战
* CBA087 Shu Ma Bao Bei - Hai Zhi Shen æ•°ç å®è´-海之神
diff --git a/hash/intvecs.xml b/hash/intvecs.xml
index 1136c341ace..b8663df873e 100644
--- a/hash/intvecs.xml
+++ b/hash/intvecs.xml
@@ -100,7 +100,7 @@
<dataarea name="D000" size="0x4000">
<rom name="world series major league baseball.d0" size="0x4000" crc="839fa5c7" sha1="1ef12665079d1ce50bd2419b668344a08c9a872f" offset="0x0000"/>
</dataarea>
- <!-- two ROM pages -->
+ <!-- two ROM pages -->
<dataarea name="F000" size="0x4000">
<rom name="world series major league baseball (page 0).f0" size="0x2000" crc="a0f2fe49" sha1="fab397b49c5a7db53a501caea42fce169da5a31a" offset="0x0000"/>
<rom name="world series major league baseball (page 1).f0" size="0x2000" crc="94d6b056" sha1="df2a8c950dd1c398db901a624c04322d2b4f2782" offset="0x2000"/>
diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml
index 1a04999d34c..c4863b1214c 100644
--- a/hash/msx1_cart.xml
+++ b/hash/msx1_cart.xml
@@ -14536,12 +14536,12 @@ kept for now until finding out what those bytes affect...
<feature name="mapper" value="NOMAPPER" />
<dataarea name="rom" size="131072">
<!--
- 20140725:
- There are 3 versions of this rom floating around:
- 930eae7057af1652abae794072b296a59decd61b - a "dirty" dump; it seems to be a direct memory copy made on an MSX and contains RAM contents at 3000-3FFF and 7000-7FFF
- a45692849acf29ddb653707a62747985439f6d4f - RAM areas are set to FFs
- 36d47cf70618fdb460f97a8ceb75013ec4529063 - A dump made using an eeprom reader. This dump differs one bit with the dump above (offset 8a49, bit 3)
- By looking the code it is not yet possible to say which one is 100% correct, so marking it as baddump for the moment.
+ 20140725:
+ There are 3 versions of this rom floating around:
+ 930eae7057af1652abae794072b296a59decd61b - a "dirty" dump; it seems to be a direct memory copy made on an MSX and contains RAM contents at 3000-3FFF and 7000-7FFF
+ a45692849acf29ddb653707a62747985439f6d4f - RAM areas are set to FFs
+ 36d47cf70618fdb460f97a8ceb75013ec4529063 - A dump made using an eeprom reader. This dump differs one bit with the dump above (offset 8a49, bit 3)
+ By looking the code it is not yet possible to say which one is 100% correct, so marking it as baddump for the moment.
-->
<rom name="msx audio (japan) (fs-ca1) (program).rom" size="131072" crc="78584d2e" sha1="a45692849acf29ddb653707a62747985439f6d4f" status="baddump" offset="0" />
</dataarea>
@@ -17109,8 +17109,8 @@ legacy FM implementations cannot find it.
</part>
<!-- The package came with a copy of MSX-DOS -->
<!--
- <part name="flop1" interface="floppy_3_5">
- </part>
+ <part name="flop1" interface="floppy_3_5">
+ </part>
-->
</software>
@@ -17126,9 +17126,9 @@ legacy FM implementations cannot find it.
</dataarea>
</part>
<!--
- The floppy drive was most likely bundled with a copy of MSX-DOS, but we are not 100% sure yet
- <part name="flop1" interface="floppy_3_5">
- </part>
+ The floppy drive was most likely bundled with a copy of MSX-DOS, but we are not 100% sure yet
+ <part name="flop1" interface="floppy_3_5">
+ </part>
-->
</software>
diff --git a/hash/nes.xml b/hash/nes.xml
index 5d6494e8dff..834b9152f5b 100644
--- a/hash/nes.xml
+++ b/hash/nes.xml
@@ -35601,7 +35601,7 @@
<feature name="pcb_model" value="NR8OV2-1" />
<feature name="u1" value="U1 PRG" />
<feature name="u2" value="U2 CHR" />
- <feature name="u3" value="CME-01" /> <!-- CIC clone? -->
+ <feature name="u3" value="CME-01" /> <!-- CIC clone? -->
<feature name="mirroring" value="vertical" />
<dataarea name="prg" size="262144">
<rom name="sup.adv.quest.u1" size="262144" crc="6a7bf037" sha1="22b430d7d4167f16751facd3515f7c8e1133a3d9" offset="00000" />
diff --git a/hash/pencil2.xml b/hash/pencil2.xml
index 0cd0b01f526..ea5eaa46645 100644
--- a/hash/pencil2.xml
+++ b/hash/pencil2.xml
@@ -2,7 +2,7 @@
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
<softwarelist name="pencil2" description="Hanimex Pencil II cartridges">
-<!--
+<!--
Undumped known carts
@@ -16,7 +16,7 @@ Zaxxon
-->
-<!--
+<!--
BASIC CART PEN-700 11-50332-31 Rev.0
SD-BASIC VERSION 2.0 FOR PENCIL II
diff --git a/hash/psx.xml b/hash/psx.xml
index f87627969ab..c58f7e2b157 100644
--- a/hash/psx.xml
+++ b/hash/psx.xml
@@ -704,9 +704,9 @@ A few comments on these:
</part>
</software>
- <!-- Redump.org sets -->
-
- <software name="raidendx" supported="yes"> <!-- Hamster re-release) -->
+ <!-- Redump.org sets -->
+
+ <software name="raidendx" supported="yes"> <!-- Hamster re-release) -->
<description>Raiden DX (Japan, V1.1)</description>
<year>199?</year>
<publisher>Seibu / Hamster</publisher>
@@ -717,8 +717,8 @@ A few comments on these:
</diskarea>
</part>
</software>
-
- <software name="raidendxo" cloneof="raidendx" supported="yes"> <!-- original release) -->
+
+ <software name="raidendxo" cloneof="raidendx" supported="yes"> <!-- original release) -->
<description>Raiden DX (Japan, V1.0)</description>
<year>199?</year>
<publisher>Seibu</publisher>
@@ -729,7 +729,7 @@ A few comments on these:
</diskarea>
</part>
</software>
-
+
<software name="raidenpr" supported="yes">
<description>Raiden Project (USA)</description>
<year>199?</year>
@@ -740,9 +740,9 @@ A few comments on these:
<disk name="raiden project, the (usa)" sha1="cb1e4fae25d42e70fcb3eec5e1c1afcbdc5c2af3"/>
</diskarea>
</part>
- </software>
-
- <!-- this image doesn't boot, some kind of copy protection? could be bad -->
+ </software>
+
+ <!-- this image doesn't boot, some kind of copy protection? could be bad -->
<software name="raidenprj" cloneof="raidenpr" supported="no">
<description>Raiden Project (Japan)</description>
<year>1995</year>
@@ -753,8 +753,8 @@ A few comments on these:
<disk name="raiden project (japan)" sha1="12ec8ee3117df1f95752dc65155a611f43725251"/>
</diskarea>
</part>
- </software>
-
+ </software>
+
<!-- Images below are 'low-grade' ie not dumped to any specific standard, or verified to be of any specific quality, they could have bad gaps or audio tracks etc. -->
<!-- They should be replaced with better quality images once said images are available (and verified to be the same versions) -->
diff --git a/hash/timex_dock.xml b/hash/timex_dock.xml
index 0f1f7954229..ba2eb4bce67 100644
--- a/hash/timex_dock.xml
+++ b/hash/timex_dock.xml
@@ -235,7 +235,7 @@
</part>
</software>
- <!-- TODO: add support for RAM in this cart (0xa000-0xffff) -->
+ <!-- TODO: add support for RAM in this cart (0xa000-0xffff) -->
<software name="rwp32" supported="no">
<description>rWP32</description>
<year>19??</year>
diff --git a/src/emu/bus/a2bus/a2corvus.c b/src/emu/bus/a2bus/a2corvus.c
index 7c6351537d0..e8a91030884 100644
--- a/src/emu/bus/a2bus/a2corvus.c
+++ b/src/emu/bus/a2bus/a2corvus.c
@@ -32,7 +32,7 @@
7) When the format completes, type "RUN APPLESOFT BOOT PREP" and press Enter.
8) Once it finishes, quit MESS. Remove the diskii(ng) from slot 7 and
the system will boot into DOS 3.3 from the Corvus HD.
-
+
TODO: but there are no Corvus drivers present after that, only
Disk II?
diff --git a/src/emu/bus/a2bus/a2lang.c b/src/emu/bus/a2bus/a2lang.c
index 581ce7d9dff..1f257789e55 100644
--- a/src/emu/bus/a2bus/a2lang.c
+++ b/src/emu/bus/a2bus/a2lang.c
@@ -112,7 +112,7 @@ UINT8 a2bus_lang_device::read_c0nx(address_space &space, UINT8 offset)
// likely to be interrupt-safe.
if (state->m_machinetype == APPLE_II)
{
- switch (offset & 0x03)
+ switch (offset & 0x03)
{
case 1:
case 3:
diff --git a/src/emu/bus/a2bus/corvfdc01.c b/src/emu/bus/a2bus/corvfdc01.c
index 14cb6034c62..baf1f17a2d3 100644
--- a/src/emu/bus/a2bus/corvfdc01.c
+++ b/src/emu/bus/a2bus/corvfdc01.c
@@ -3,10 +3,10 @@
corvfdc01.c
Implemention of the Corvus Systems CORVUS01 floppy controller
-
+
Boot PROM 0.8 fixes this at: 8", 500 blocks total, 128 bytes/block,
- 26 sectors/track, 77 tracks.
-
+ 26 sectors/track, 77 tracks.
+
*********************************************************************/
#include "corvfdc01.h"
@@ -21,8 +21,8 @@
const device_type A2BUS_CORVFDC01 = &device_creator<a2bus_corvfdc01_device>;
-#define FDC01_ROM_REGION "fdc01_rom"
-#define FDC01_FDC_TAG "fdc01_fdc"
+#define FDC01_ROM_REGION "fdc01_rom"
+#define FDC01_FDC_TAG "fdc01_fdc"
FLOPPY_FORMATS_MEMBER( a2bus_corvfdc01_device::corv_floppy_formats )
FLOPPY_IMD_FORMAT
@@ -161,7 +161,7 @@ UINT8 a2bus_corvfdc01_device::read_c0nx(address_space &space, UINT8 offset)
{
switch (offset)
{
- case 0: // local status
+ case 0: // local status
if (m_curfloppy)
{
m_fdc_local_status &= ~LS_DSKCHG_mask;
@@ -169,7 +169,7 @@ UINT8 a2bus_corvfdc01_device::read_c0nx(address_space &space, UINT8 offset)
}
return m_fdc_local_status | LS_8IN_mask;
- case 8: // WD1793 at 8-11
+ case 8: // WD1793 at 8-11
return m_wdfdc->status_r(space, offset);
case 9:
@@ -225,7 +225,7 @@ void a2bus_corvfdc01_device::write_c0nx(address_space &space, UINT8 offset, UINT
if (m_curfloppy != NULL)
{
// side select
- m_curfloppy->ss_w((data & LC_FLPSD1_mask) != 0);
+ m_curfloppy->ss_w((data & LC_FLPSD1_mask) != 0);
// motor control (active low)
m_curfloppy->mon_w((data & LC_MOTOROF_mask) ? 1 : 0);
@@ -278,4 +278,3 @@ WRITE_LINE_MEMBER(a2bus_corvfdc01_device::drq_w)
else
m_fdc_local_status &= ~LS_DRQ_mask;
}
-
diff --git a/src/emu/bus/a2bus/corvfdc02.c b/src/emu/bus/a2bus/corvfdc02.c
index 44a27718ec5..170438073a6 100644
--- a/src/emu/bus/a2bus/corvfdc02.c
+++ b/src/emu/bus/a2bus/corvfdc02.c
@@ -4,10 +4,10 @@
Implemention of the Corvus Systems CORVUS02 floppy controller
aka the "Buffered Floppy Controller"
-
+
Boot PROM 0.8 says 8" SSDD or 5.25" DSDD; we stick with 5.25" here
and let the FDC01 handle 8".
-
+
*********************************************************************/
#include "corvfdc02.h"
@@ -23,8 +23,8 @@
const device_type A2BUS_CORVFDC02 = &device_creator<a2bus_corvfdc02_device>;
-#define FDC02_ROM_REGION "fdc02_rom"
-#define FDC02_FDC_TAG "fdc02_fdc"
+#define FDC02_ROM_REGION "fdc02_rom"
+#define FDC02_FDC_TAG "fdc02_fdc"
FLOPPY_FORMATS_MEMBER( a2bus_corvfdc02_device::corv_floppy_formats )
FLOPPY_CONCEPT_525DSDD_FORMAT,
@@ -86,7 +86,6 @@ a2bus_corvfdc02_device::a2bus_corvfdc02_device(const machine_config &mconfig, de
m_con3(*this, FDC02_FDC_TAG":2"),
m_con4(*this, FDC02_FDC_TAG":3")
{
-
}
a2bus_corvfdc02_device::a2bus_corvfdc02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
@@ -143,20 +142,20 @@ UINT8 a2bus_corvfdc02_device::read_c0nx(address_space &space, UINT8 offset)
{
switch (offset)
{
- case 0: // 765 FIFO
+ case 0: // 765 FIFO
return m_fdc->fifo_r(space, 0);
- case 1: // 765 MSR
+ case 1: // 765 MSR
return m_fdc->msr_r(space, 0);
- case 2: // buffer address
+ case 2: // buffer address
return (m_bufptr>>1) & 0xff;
- case 3:
-// printf("Read buffer @ %x = %02x\n", m_bufptr, m_buffer[m_bufptr]);
+ case 3:
+// printf("Read buffer @ %x = %02x\n", m_bufptr, m_buffer[m_bufptr]);
return m_buffer[m_bufptr--];
- case 4: // local status
+ case 4: // local status
if (m_curfloppy)
{
m_fdc_local_status &= ~(1 | 0x40);
@@ -188,13 +187,13 @@ void a2bus_corvfdc02_device::write_c0nx(address_space &space, UINT8 offset, UINT
case 1: // FDC ???
break;
- case 2: // buffer address
+ case 2: // buffer address
m_bufptr = (data << 1) | (data & 1);
-// printf("%02x to buffer address yields %x\n", data, m_bufptr);
+// printf("%02x to buffer address yields %x\n", data, m_bufptr);
break;
- case 3: // buffer write
-// printf("%02x to buffer[%x]\n", data, m_bufptr);
+ case 3: // buffer write
+// printf("%02x to buffer[%x]\n", data, m_bufptr);
m_buffer[m_bufptr--] = data;
break;
@@ -233,12 +232,12 @@ void a2bus_corvfdc02_device::write_c0nx(address_space &space, UINT8 offset, UINT
{
// motor control (active low)
m_curfloppy->mon_w((data & 8) ? 1 : 0);
-// printf("Cur drive %p motor %s\n", m_curfloppy, (data & 8) ? "OFF" : "ON");
+// printf("Cur drive %p motor %s\n", m_curfloppy, (data & 8) ? "OFF" : "ON");
}
if (data & 0x80)
{
-// printf("Reset NEC765\n");
+// printf("Reset NEC765\n");
m_fdc->reset();
}
break;
@@ -266,7 +265,7 @@ WRITE_LINE_MEMBER(a2bus_corvfdc02_device::intrq_w)
}
else
{
- m_fdc_local_status |= 2; // clear IRQ
+ m_fdc_local_status |= 2; // clear IRQ
lower_slot_irq();
}
}
@@ -279,7 +278,7 @@ WRITE_LINE_MEMBER(a2bus_corvfdc02_device::drq_w)
if (m_fdc_local_command & 0x40)
{
m_buffer[m_bufptr] = m_fdc->dma_r();
-// printf("DMA %02x to buffer[%x]\n", m_buffer[m_bufptr], m_bufptr);
+// printf("DMA %02x to buffer[%x]\n", m_buffer[m_bufptr], m_bufptr);
if (!m_bufptr)
{
@@ -296,4 +295,3 @@ WRITE_LINE_MEMBER(a2bus_corvfdc02_device::drq_w)
}
}
}
-
diff --git a/src/emu/bus/a2bus/corvfdc02.h b/src/emu/bus/a2bus/corvfdc02.h
index 83c3a4c4ed9..7b16e1c899d 100644
--- a/src/emu/bus/a2bus/corvfdc02.h
+++ b/src/emu/bus/a2bus/corvfdc02.h
@@ -56,7 +56,7 @@ private:
UINT8 *m_rom;
UINT8 m_fdc_local_status, m_fdc_local_command;
UINT16 m_bufptr;
- UINT8 m_buffer[2048]; // 1x6116 SRAM
+ UINT8 m_buffer[2048]; // 1x6116 SRAM
floppy_image_device *m_curfloppy;
bool m_in_drq;
emu_timer *m_timer;
diff --git a/src/emu/bus/a2bus/laser128.c b/src/emu/bus/a2bus/laser128.c
index bc42e977305..81315311ae3 100644
--- a/src/emu/bus/a2bus/laser128.c
+++ b/src/emu/bus/a2bus/laser128.c
@@ -108,7 +108,7 @@ UINT8 a2bus_laser128_device::read_c800(address_space &space, UINT16 offset)
{
return m_slot7_ram[offset];
}
- return m_rom[(offset & 0x3ff) + 0x6000 + m_slot7_bank];
+ return m_rom[(offset & 0x3ff) + 0x6000 + m_slot7_bank];
}
return 0xff;
@@ -124,12 +124,12 @@ void a2bus_laser128_device::write_c800(address_space &space, UINT16 offset, UINT
// UDCREG
if ((m_slot == 7) && (offset == 0x7f8))
{
-// printf("%02x to UDCREG\n", data);
+// printf("%02x to UDCREG\n", data);
m_slot7_ram_bank = (data & 0x8) ? 0x400 : 0;
m_slot7_bank = (((data >> 4) & 0x7) * 0x400);
-// printf("\tRAM bank %x, ROM bank %x\n", m_slot7_ram_bank, m_slot7_bank);
+// printf("\tRAM bank %x, ROM bank %x\n", m_slot7_ram_bank, m_slot7_bank);
}
}
diff --git a/src/emu/bus/a2bus/mouse.c b/src/emu/bus/a2bus/mouse.c
index d3828e3db32..a0340174034 100644
--- a/src/emu/bus/a2bus/mouse.c
+++ b/src/emu/bus/a2bus/mouse.c
@@ -3,18 +3,18 @@
mouse.c
Implemention of the Apple II Mouse Card
-
+
Apple II Mouse Interface PCB
- Apple 1983
+ Apple 1983
- This is a mouse interface for the Apple II
+ This is a mouse interface for the Apple II
- PCB Layout
- ----------
- apple computer
- MOUSE INTERFACE
- 670-0030-C (C) 1983
- Printed on back side - MOUSE INTERFACE 820-0104-B (C) 1983 APPLE COMPUTER
+ PCB Layout
+ ----------
+ apple computer
+ MOUSE INTERFACE
+ 670-0030-C (C) 1983
+ Printed on back side - MOUSE INTERFACE 820-0104-B (C) 1983 APPLE COMPUTER
|-----------------------------------|
| PAL16R4 6821 |
| |
@@ -25,40 +25,40 @@
|-------------------| |-|
|-------------|
- Notes:
- J1 - 9 pin flat cable with female DB9 connector
- 68705P3 - Motorola MC68705P3 microcontroller (DIP28) labelled '341-0269 (C) APPLE'
- PCB printed '(C) APPLE 1983 341-0269 or 342-0285'
- 8516 - Fujitsu MB8516 2k x8-bit EPROM (DIP24) labelled '341-0270-C (C) APPLE 1983'
- PCB printed '(C) APPLE 1983 342-0270'
- PAL16R4 - MMI PAL16R4ACN (DIP20) marked '341-0268-A'
- PCB printed '(C) APPLE 1983 342-0268'
- 6821 - AMI 6821 Peripheral Interface Adapter (DIP40)
- X1/X2 - Jumper pads. X1 is open, X2 is closed.
-
-
+ Notes:
+ J1 - 9 pin flat cable with female DB9 connector
+ 68705P3 - Motorola MC68705P3 microcontroller (DIP28) labelled '341-0269 (C) APPLE'
+ PCB printed '(C) APPLE 1983 341-0269 or 342-0285'
+ 8516 - Fujitsu MB8516 2k x8-bit EPROM (DIP24) labelled '341-0270-C (C) APPLE 1983'
+ PCB printed '(C) APPLE 1983 342-0270'
+ PAL16R4 - MMI PAL16R4ACN (DIP20) marked '341-0268-A'
+ PCB printed '(C) APPLE 1983 342-0268'
+ 6821 - AMI 6821 Peripheral Interface Adapter (DIP40)
+ X1/X2 - Jumper pads. X1 is open, X2 is closed.
+
+
Hookup notes:
- PIA port A connects to 68705 port A in its entirety (bi-directional)
- PIA PB4-PB7 connects to 68705 PC0-3 (bi-directional)
- PIA PB0 is 'sync latch'
- PIA PB1 is A8 on the EPROM
- PIA PB2 is A9 on the EPROM
- PIA PB3 is A10 on the EPROM
-
- 68705 PB0 is mouse X1
- 68705 PB1 is mouse X0
- 68705 PB2 is mouse Y0
- 68705 PB3 is mouse Y1
- 68705 PB4 and 5 are N/C
- 68705 PB6 is IRQ for the slot
- 68705 PB7 is the mouse button
-
- 68705 is clocked at 2M
- PIA is clocked at 1M
-
+ PIA port A connects to 68705 port A in its entirety (bi-directional)
+ PIA PB4-PB7 connects to 68705 PC0-3 (bi-directional)
+ PIA PB0 is 'sync latch'
+ PIA PB1 is A8 on the EPROM
+ PIA PB2 is A9 on the EPROM
+ PIA PB3 is A10 on the EPROM
+
+ 68705 PB0 is mouse X1
+ 68705 PB1 is mouse X0
+ 68705 PB2 is mouse Y0
+ 68705 PB3 is mouse Y1
+ 68705 PB4 and 5 are N/C
+ 68705 PB6 is IRQ for the slot
+ 68705 PB7 is the mouse button
+
+ 68705 is clocked at 2M
+ PIA is clocked at 1M
+
See the schematic at:
- http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/Digitizers/Apple%20Mouse%20Interface%20Card/Schematics/
-
+ http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/Digitizers/Apple%20Mouse%20Interface%20Card/Schematics/
+
*********************************************************************/
#include "mouse.h"
@@ -73,17 +73,17 @@
const device_type A2BUS_MOUSE = &device_creator<a2bus_mouse_device>;
-#define MOUSE_ROM_REGION "a2mse_rom"
-#define MOUSE_PIA_TAG "a2mse_pia"
-#define MOUSE_MCU_TAG "a2mse_mcu"
-#define MOUSE_MCU_ROM "a2mse_mcurom"
+#define MOUSE_ROM_REGION "a2mse_rom"
+#define MOUSE_PIA_TAG "a2mse_pia"
+#define MOUSE_MCU_TAG "a2mse_mcu"
+#define MOUSE_MCU_ROM "a2mse_mcurom"
-#define MOUSE_BUTTON_TAG "a2mse_button"
-#define MOUSE_XAXIS_TAG "a2mse_x"
-#define MOUSE_YAXIS_TAG "a2mse_y"
+#define MOUSE_BUTTON_TAG "a2mse_button"
+#define MOUSE_XAXIS_TAG "a2mse_x"
+#define MOUSE_YAXIS_TAG "a2mse_y"
-#define TIMER_68705 0
-#define TIMER_QUADRATURE 1
+#define TIMER_68705 0
+#define TIMER_QUADRATURE 1
static ADDRESS_MAP_START( mcu_mem, AS_PROGRAM, 8, a2bus_mouse_device )
ADDRESS_MAP_GLOBAL_MASK(0x7ff)
@@ -113,14 +113,14 @@ MACHINE_CONFIG_END
ROM_START( mouse )
ROM_REGION(0x800, MOUSE_ROM_REGION, 0)
- ROM_LOAD( "341-0270-c.4b", 0x000000, 0x000800, CRC(0bcd1e8e) SHA1(3a9d881a8a8d30f55b9719aceebbcf717f829d6f) )
+ ROM_LOAD( "341-0270-c.4b", 0x000000, 0x000800, CRC(0bcd1e8e) SHA1(3a9d881a8a8d30f55b9719aceebbcf717f829d6f) )
ROM_REGION(0x800, MOUSE_MCU_ROM, 0)
- ROM_LOAD( "341-0269.2b", 0x000000, 0x000800, CRC(94067f16) SHA1(3a2baa6648efe4456d3ec3721216e57c64f7acfc) )
+ ROM_LOAD( "341-0269.2b", 0x000000, 0x000800, CRC(94067f16) SHA1(3a2baa6648efe4456d3ec3721216e57c64f7acfc) )
ROM_REGION(0xc00, "pal", 0)
- ROM_LOAD( "mmi_pal16r4a(jedec).2a", 0x000000, 0x000b04, CRC(1d620ee5) SHA1(5aa9a515c919ff7a18878649cac5d44f0c2abf28) )
- ROM_LOAD( "mmi_pal16r4a(binary).2a", 0x000000, 0x000100, CRC(1da5c745) SHA1(ba267b69a2fda2a2348b140979ece562411bb37b) )
+ ROM_LOAD( "mmi_pal16r4a(jedec).2a", 0x000000, 0x000b04, CRC(1d620ee5) SHA1(5aa9a515c919ff7a18878649cac5d44f0c2abf28) )
+ ROM_LOAD( "mmi_pal16r4a(binary).2a", 0x000000, 0x000100, CRC(1da5c745) SHA1(ba267b69a2fda2a2348b140979ece562411bb37b) )
ROM_END
static INPUT_PORTS_START( mouse )
@@ -241,7 +241,7 @@ void a2bus_mouse_device::device_reset()
m_rom_bank = 0;
last_mx = last_my = count_x = count_y = 0;
m_timer_cnt = 0xff;
- m_timer_ctl = 0x40; // disable interrupt, everything else clear
+ m_timer_ctl = 0x40; // disable interrupt, everything else clear
m_port_a_in = 0;
m_port_b_in = 0x80;
m_port_c_in = 0;
@@ -261,7 +261,7 @@ void a2bus_mouse_device::device_reset()
UINT8 a2bus_mouse_device::read_c0nx(address_space &space, UINT8 offset)
{
- return m_pia->read(space, offset & 3);
+ return m_pia->read(space, offset & 3);
}
@@ -394,10 +394,10 @@ WRITE8_MEMBER(a2bus_mouse_device::mcu_timer_w)
m_timer_cnt = data;
recalc = true;
}
- // offset 1 = timer control: b7 = IRQ, b6 = IRQ mask (1=suppress),
- // b5 = input select (0=CPU clk, 1=ext),
- // b4 = enable external timer input,
- // b3 = clear, b2-b0 = scaler (1/2/4/8/16/32/64/128)
+ // offset 1 = timer control: b7 = IRQ, b6 = IRQ mask (1=suppress),
+ // b5 = input select (0=CPU clk, 1=ext),
+ // b4 = enable external timer input,
+ // b3 = clear, b2-b0 = scaler (1/2/4/8/16/32/64/128)
else
{
// clearing the interrupt?
@@ -425,7 +425,7 @@ WRITE8_MEMBER(a2bus_mouse_device::mcu_timer_w)
recalc = true;
}
- m_timer_ctl = data;
+ m_timer_ctl = data;
}
}
@@ -445,15 +445,15 @@ WRITE8_MEMBER(a2bus_mouse_device::mcu_timer_w)
X1 = gate, must go 0/1 for each pixel moved
Y0 = direction, 0 = up, 1 = down
Y1 = gate, must go 0/1 for each pixel moved
-
+
The direction must stay constant for a given train of gate pulses or the MCU will get confused.
*/
void a2bus_mouse_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- if (id == TIMER_68705) // 68705's built-in timer
+ if (id == TIMER_68705) // 68705's built-in timer
{
m_timer_ctl |= 0x80; // indicate timer expired
- if (!(m_timer_ctl & 0x40)) // if interrupt not suppressed, fire!
+ if (!(m_timer_ctl & 0x40)) // if interrupt not suppressed, fire!
{
m_mcu->set_input_line(M68705_INT_TIMER, ASSERT_LINE);
}
@@ -509,9 +509,9 @@ void a2bus_mouse_device::device_timer(emu_timer &timer, device_timer_id id, int
else
{
count_x--;
- m_port_b_in |= 0x01; // X1
+ m_port_b_in |= 0x01; // X1
}
- m_port_b_in |= 0x02; // X0
+ m_port_b_in |= 0x02; // X0
}
else if (count_y)
{
@@ -522,9 +522,9 @@ void a2bus_mouse_device::device_timer(emu_timer &timer, device_timer_id id, int
else
{
count_y--;
- m_port_b_in |= 0x04; // Y0
+ m_port_b_in |= 0x04; // Y0
}
- m_port_b_in |= 0x08; // Y1
+ m_port_b_in |= 0x08; // Y1
}
}
}
diff --git a/src/emu/bus/a2bus/timemasterho.c b/src/emu/bus/a2bus/timemasterho.c
index 7fc4b8dcd8f..9c1191d3aa9 100644
--- a/src/emu/bus/a2bus/timemasterho.c
+++ b/src/emu/bus/a2bus/timemasterho.c
@@ -20,17 +20,17 @@
|____________________________ _|
| |
|______________________|
-
-
+
+
DIPS: 1:SET 2:MODE 3:NMI 4:IRQ
1 & 4 are on by default.
-
+
J1: 8 pins for X10 home control functions (top to bottom)
1: ADJ 2: 5V 3: MODE 4: GND
5: A 6: 5V 7: B 8: GND
-
+
X10 functions not supported.
-
+
*********************************************************************/
#include "timemasterho.h"
@@ -45,9 +45,9 @@
const device_type A2BUS_TIMEMASTERHO = &device_creator<a2bus_timemasterho_device>;
-#define TIMEMASTER_ROM_REGION "timemst_rom"
-#define TIMEMASTER_PIA_TAG "timemst_pia"
-#define TIMEMASTER_M5832_TAG "timemst_msm"
+#define TIMEMASTER_ROM_REGION "timemst_rom"
+#define TIMEMASTER_PIA_TAG "timemst_pia"
+#define TIMEMASTER_M5832_TAG "timemst_msm"
MACHINE_CONFIG_FRAGMENT( timemaster )
MCFG_DEVICE_ADD(TIMEMASTER_PIA_TAG, PIA6821, 1021800)
@@ -61,26 +61,26 @@ MACHINE_CONFIG_END
ROM_START( timemaster )
ROM_REGION(0x1000, TIMEMASTER_ROM_REGION, 0)
- ROM_LOAD( "ae timemaster ii h.o. rom rev. 5.bin", 0x000000, 0x001000, CRC(ff5bd644) SHA1(ae0173da61581a06188c1bee89e95a0aa536c411) )
+ ROM_LOAD( "ae timemaster ii h.o. rom rev. 5.bin", 0x000000, 0x001000, CRC(ff5bd644) SHA1(ae0173da61581a06188c1bee89e95a0aa536c411) )
ROM_END
static INPUT_PORTS_START( tmho )
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, "Set")
- PORT_DIPSETTING( 0x00, "Apple can't set clock")
- PORT_DIPSETTING( 0x01, "Apple can set clock")
+ PORT_DIPSETTING( 0x00, "Apple can't set clock")
+ PORT_DIPSETTING( 0x01, "Apple can set clock")
PORT_DIPNAME( 0x02, 0x00, "Mode")
- PORT_DIPSETTING( 0x00, "TimeMaster")
- PORT_DIPSETTING( 0x02, "Mountain AppleClock")
+ PORT_DIPSETTING( 0x00, "TimeMaster")
+ PORT_DIPSETTING( 0x02, "Mountain AppleClock")
PORT_DIPNAME( 0x04, 0x00, "NMI")
- PORT_DIPSETTING( 0x00, DEF_STR(Off))
- PORT_DIPSETTING( 0x04, DEF_STR(On))
+ PORT_DIPSETTING( 0x00, DEF_STR(Off))
+ PORT_DIPSETTING( 0x04, DEF_STR(On))
PORT_DIPNAME( 0x08, 0x08, "IRQ")
- PORT_DIPSETTING( 0x00, DEF_STR(Off))
- PORT_DIPSETTING( 0x08, DEF_STR(On))
+ PORT_DIPSETTING( 0x00, DEF_STR(Off))
+ PORT_DIPSETTING( 0x08, DEF_STR(On))
INPUT_PORTS_END
/***************************************************************************
@@ -154,7 +154,7 @@ void a2bus_timemasterho_device::device_start()
void a2bus_timemasterho_device::device_reset()
{
- m_msm5832->cs_w(ASSERT_LINE); // CS is tied to Vcc
+ m_msm5832->cs_w(ASSERT_LINE); // CS is tied to Vcc
m_started = true;
}
@@ -167,7 +167,7 @@ UINT8 a2bus_timemasterho_device::read_c0nx(address_space &space, UINT8 offset)
{
if (offset <= 3)
{
- return m_pia->read(space, offset);
+ return m_pia->read(space, offset);
}
return 0xff;
@@ -194,7 +194,7 @@ UINT8 a2bus_timemasterho_device::read_cnxx(address_space &space, UINT8 offset)
{
if (m_started)
{
- if (!(m_dsw1->read() & 2)) // TimeMaster native
+ if (!(m_dsw1->read() & 2)) // TimeMaster native
{
return m_rom[offset+0xc00];
}
@@ -228,7 +228,7 @@ WRITE8_MEMBER(a2bus_timemasterho_device::pia_out_b)
{
if (m_dsw1->read() & 1)
{
- m_msm5832->write_w((data >> 6) & 1 ? ASSERT_LINE : CLEAR_LINE);
+ m_msm5832->write_w((data >> 6) & 1 ? ASSERT_LINE : CLEAR_LINE);
}
}
@@ -277,4 +277,3 @@ WRITE_LINE_MEMBER(a2bus_timemasterho_device::pia_irqb_w)
m_irqb = state;
update_irqs();
}
-
diff --git a/src/emu/bus/a7800/a78_carts.h b/src/emu/bus/a7800/a78_carts.h
index 1d31e22acdb..73739dddcf8 100644
--- a/src/emu/bus/a7800/a78_carts.h
+++ b/src/emu/bus/a7800/a78_carts.h
@@ -20,10 +20,10 @@ static SLOT_INTERFACE_START(a7800_cart)
SLOT_INTERFACE_INTERNAL("a78_abs", A78_ROM_ABSOLUTE)
SLOT_INTERFACE_INTERNAL("a78_act", A78_ROM_ACTIVISION)
SLOT_INTERFACE_INTERNAL("a78_hsc", A78_HISCORE)
- SLOT_INTERFACE_INTERNAL("a78_xboard", A78_XBOARD) // the actual XBoarD expansion (as passthru)
- SLOT_INTERFACE_INTERNAL("a78_xm", A78_XM) // the actual XM expansion (as passthru)
- SLOT_INTERFACE_INTERNAL("a78_megacart", A78_ROM_MEGACART)
- SLOT_INTERFACE_INTERNAL("a78_versa", A78_ROM_VERSABOARD)
+ SLOT_INTERFACE_INTERNAL("a78_xboard", A78_XBOARD) // the actual XBoarD expansion (as passthru)
+ SLOT_INTERFACE_INTERNAL("a78_xm", A78_XM) // the actual XM expansion (as passthru)
+ SLOT_INTERFACE_INTERNAL("a78_megacart", A78_ROM_MEGACART)
+ SLOT_INTERFACE_INTERNAL("a78_versa", A78_ROM_VERSABOARD)
// cart variants with a POKEY at 0x0450 (typically a VersaBoard variant, or an homebrew pcb)
SLOT_INTERFACE_INTERNAL("a78_p450_t0", A78_ROM_P450)
SLOT_INTERFACE_INTERNAL("a78_p450_t1", A78_ROM_P450_POKEY)
diff --git a/src/emu/bus/a7800/a78_slot.c b/src/emu/bus/a7800/a78_slot.c
index 9deac1afdd4..d1d6130ba26 100644
--- a/src/emu/bus/a7800/a78_slot.c
+++ b/src/emu/bus/a7800/a78_slot.c
@@ -21,7 +21,7 @@
- read_40xx/write_40xx for accesses in the $4000 to $ffff range
even if not all carts use all of them (in particular no cart type
seems to use access to the ranges $0500 to $0fff and $2800 to $2fff)
-
+
***********************************************************************************************************/
@@ -70,15 +70,15 @@ void device_a78_cart_interface::rom_alloc(UINT32 size, const char *tag)
tempstring.cat(A78SLOT_ROM_REGION_TAG);
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
m_rom_size = size;
-
+
// setup other helpers
if ((size / 0x4000) & 1) // compensate for SuperGame carts with 9 x 16K banks (to my knowledge no other cart has m_bank_mask != power of 2)
m_bank_mask = (size / 0x4000) - 2;
else
m_bank_mask = (size / 0x4000) - 1;
-
+
// the rom is mapped to the top of the memory area
- // so we store the starting point of data to simplify
+ // so we store the starting point of data to simplify
// the access handling
m_base_rom = 0x10000 - size;
}
@@ -272,7 +272,7 @@ int a78_cart_slot_device::validate_header(int head, bool log)
}
head &= 0xff00;
}
-
+
if ((head & 0xff00) > 0x300)
{
if (log)
@@ -282,7 +282,7 @@ int a78_cart_slot_device::validate_header(int head, bool log)
}
head &= 0x00ff;
}
-
+
return head;
}
@@ -329,7 +329,7 @@ static int a78_get_pcb_id(const char *slot)
if (!core_stricmp(slot_list[i].slot_option, slot))
return slot_list[i].pcb_id;
}
-
+
return 0;
}
@@ -340,7 +340,7 @@ static const char *a78_get_slot(int type)
if (slot_list[i].pcb_id == type)
return slot_list[i].slot_option;
}
-
+
return "a78_rom";
}
@@ -349,17 +349,17 @@ bool a78_cart_slot_device::call_load()
if (m_cart)
{
UINT32 len;
-
+
if (software_entry() != NULL)
{
const char *pcb_name;
bool has_ram = get_software_region("ram") ? TRUE : FALSE;
bool has_nvram = get_software_region("nvram") ? TRUE : FALSE;
len = get_software_region_length("rom");
-
+
m_cart->rom_alloc(len, tag());
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
-
+
if ((pcb_name = get_feature("slot")) != NULL)
m_type = a78_get_pcb_id(pcb_name);
else
@@ -377,19 +377,19 @@ bool a78_cart_slot_device::call_load()
{
// Load and check the header
int mapper;
- char head[128];
+ char head[128];
fread(head, 128);
-
+
if (verify_header((char *)head) == IMAGE_VERIFY_FAIL)
return IMAGE_INIT_FAIL;
-
+
len = (head[49] << 24) | (head[50] << 16) | (head[51] << 8) | head[52];
if (len + 128 > length())
{
logerror("Invalid length in the header. The game might be corrupted.\n");
len = length() - 128;
}
-
+
// let's try to auto-fix some common errors in the header
mapper = validate_header((head[53] << 8) | head[54], TRUE);
@@ -415,7 +415,7 @@ bool a78_cart_slot_device::call_load()
m_type = A78_VERSABOARD;
break;
}
-
+
// check if cart has a POKEY at $0450 (typically a VersaBoard variant)!
if (mapper & 0x40)
{
@@ -425,7 +425,7 @@ bool a78_cart_slot_device::call_load()
m_type += A78_POKEY0450;
}
}
-
+
// check special bits, which override the previous
if ((mapper & 0xff00) == 0x0100)
m_type = A78_ACTIVISION;
@@ -452,10 +452,10 @@ bool a78_cart_slot_device::call_load()
}
internal_header_logging((UINT8 *)head, length());
-
+
m_cart->rom_alloc(len, tag());
fread(m_cart->get_rom_base(), len);
-
+
if (m_type == A78_TYPE6)
m_cart->ram_alloc(0x4000);
if (m_type == A78_MEGACART || (m_type >= A78_VERSABOARD && m_type <= A78_VERSA_POK450))
@@ -468,7 +468,7 @@ bool a78_cart_slot_device::call_load()
battery_load(m_cart->get_nvram_base(), 0x800, 0xff);
}
}
-
+
//printf("Type: %s\n", a78_get_slot(m_type));
}
return IMAGE_INIT_PASS;
@@ -476,7 +476,7 @@ bool a78_cart_slot_device::call_load()
void a78_partialhash(hash_collection &dest, const unsigned char *data,
- unsigned long length, const char *functions)
+ unsigned long length, const char *functions)
{
if (length <= 128)
return;
@@ -537,13 +537,13 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
const char *slot_string = "a78_rom";
dynamic_buffer head(128);
int type = A78_TYPE0, mapper;
-
+
// Load and check the header
- core_fread(m_file, head, 128);
+ core_fread(m_file, head, 128);
// let's try to auto-fix some common errors in the header
mapper = validate_header((head[53] << 8) | head[54], FALSE);
-
+
switch (mapper & 0x2e)
{
case 0x0000:
@@ -566,7 +566,7 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
type = A78_VERSABOARD;
break;
}
-
+
// check if cart has a POKEY at $0450 (typically a VersaBoard variant)!
if (mapper & 0x40)
{
@@ -576,18 +576,18 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
type += A78_POKEY0450;
}
}
-
+
// check special bits, which override the previous
if ((mapper & 0xff00) == 0x0100)
type = A78_ACTIVISION;
else if ((mapper & 0xff00) == 0x0200)
type = A78_ABSOLUTE;
-
+
logerror("Cart type: %x\n", type);
slot_string = a78_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -663,9 +663,9 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
/*-------------------------------------------------
A78 header logging
-
+
A78 HEADER FORMAT
-
+
Bytes | Content | Length
========================================
0 | Header version | 1 byte
@@ -679,7 +679,7 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
53..54 | Cart type [*] | 2 bytes
-------|-------------------|------------
55 | Controller 1 type | 1 byte
- | |
+ | |
| 0 = None |
| 1 = Joystick |
| 2 = Light Gun |
@@ -690,23 +690,23 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
-------|-------------------|------------
57 | TV System | 1 byte
| |
- | 0 = NTSC/1 = PAL |
+ | 0 = NTSC/1 = PAL |
-------|-------------------|------------
58 | Save data | 1 byte
| | (only v2)
| 0 = None / Unk |
| 1 = High Score |
| 2 = Savekey |
- -------|-------------------|-----------
+ -------|-------------------|-----------
63 | Expansion module | 1 byte
| |
| 0 = No expansion |
| module |
| 1 = Expansion |
| required |
- -------|-------------------|-----------
-
-
+ -------|-------------------|-----------
+
+
[*] Cart type:
bit 0-7 - Hardware "flags"
@@ -716,13 +716,13 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
bit 3 [0x08] - bank 0 of 144K ROM at $4000
bit 4 [0x10] - bank 6 at $4000
bit 5 [0x20] - banked RAM at $4000
-
+
bit 8-15 - Special values
0 = Normal cart
1 = Absolute (F18 Hornet)
2 = Activision (Double Dragon & Rampage)
3 = POKEY at $0450
-
+
-------------------------------------------------*/
void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
@@ -788,7 +788,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
ctrl1.cpy("Unknown controller");
break;
}
-
+
switch (head_ctrl2)
{
case 0x00:
@@ -804,10 +804,10 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
ctrl2.cpy("Unknown controller");
break;
}
-
+
logerror( "ROM DETAILS\n" );
logerror( "===========\n\n" );
- logerror( "\tTotal length (with header): 0x%x (%dK + 128b header)\n\n", len, len/0x400);
+ logerror( "\tTotal length (with header): 0x%x (%dK + 128b header)\n\n", len, len/0x400);
logerror( "HEADER DETAILS\n" );
logerror( "==============\n\n" );
logerror( "\tTitle: %.32s\n", head_title);
@@ -829,5 +829,5 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
logerror( "\n");
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.cstr());
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.cstr());
- logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
+ logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
}
diff --git a/src/emu/bus/a7800/a78_slot.h b/src/emu/bus/a7800/a78_slot.h
index b9c7e935d40..528c8932c04 100644
--- a/src/emu/bus/a7800/a78_slot.h
+++ b/src/emu/bus/a7800/a78_slot.h
@@ -12,19 +12,19 @@
/* PCB */
enum
{
- A78_TYPE0 = 0, // standard 8K/16K/32K games, no bankswitch
- A78_TYPE1, // as TYPE0 + POKEY chip on the PCB
- A78_TYPE2, // Atari SuperGame pcb (8x16K banks with bankswitch)
- A78_TYPE3, // as TYPE1 + POKEY chip on the PCB
- A78_TYPE6, // as TYPE1 + RAM IC on the PCB
- A78_TYPEA, // Alien Brigade, Crossbow (9x16K banks with diff bankswitch)
- A78_ABSOLUTE, // F18 Hornet
- A78_ACTIVISION, // Double Dragon, Rampage
- A78_HSC, // Atari HighScore cart
- A78_XB_BOARD, // A7800 Expansion Board (it shall more or less apply to the Expansion Module too, but this is not officially released yet)
- A78_XM_BOARD, // A7800 XM Expansion Module (theoretical specs only, since this is not officially released yet)
- A78_MEGACART, // Homebrew by CPUWIZ, consists of SuperGame bank up to 512K + 32K RAM banked
- A78_VERSABOARD = 0x10, // Homebrew by CPUWIZ, consists of SuperGame bank up to 256K + 32K RAM banked
+ A78_TYPE0 = 0, // standard 8K/16K/32K games, no bankswitch
+ A78_TYPE1, // as TYPE0 + POKEY chip on the PCB
+ A78_TYPE2, // Atari SuperGame pcb (8x16K banks with bankswitch)
+ A78_TYPE3, // as TYPE1 + POKEY chip on the PCB
+ A78_TYPE6, // as TYPE1 + RAM IC on the PCB
+ A78_TYPEA, // Alien Brigade, Crossbow (9x16K banks with diff bankswitch)
+ A78_ABSOLUTE, // F18 Hornet
+ A78_ACTIVISION, // Double Dragon, Rampage
+ A78_HSC, // Atari HighScore cart
+ A78_XB_BOARD, // A7800 Expansion Board (it shall more or less apply to the Expansion Module too, but this is not officially released yet)
+ A78_XM_BOARD, // A7800 XM Expansion Module (theoretical specs only, since this is not officially released yet)
+ A78_MEGACART, // Homebrew by CPUWIZ, consists of SuperGame bank up to 512K + 32K RAM banked
+ A78_VERSABOARD = 0x10, // Homebrew by CPUWIZ, consists of SuperGame bank up to 256K + 32K RAM banked
// VersaBoard variants configured as Type 1/3/A or VersaBoard + POKEY at $0450
A78_TYPE0_POK450 = 0x20,
A78_TYPE1_POK450 = 0x21,
@@ -68,7 +68,7 @@ protected:
UINT8 *m_rom;
UINT32 m_rom_size;
dynamic_buffer m_ram;
- dynamic_buffer m_nvram; // HiScore cart can save scores!
+ dynamic_buffer m_nvram; // HiScore cart can save scores!
// helpers
UINT32 m_base_rom;
int m_bank_mask;
@@ -101,7 +101,7 @@ public:
int get_cart_type() { return m_type; };
int identify_cart_type(UINT8 *ROM, UINT32 len);
bool has_cart() { return m_cart != NULL; }
-
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
@@ -125,7 +125,7 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_10xx);
virtual DECLARE_WRITE8_MEMBER(write_30xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
private:
device_a78_cart_interface* m_cart;
int m_type;
diff --git a/src/emu/bus/a7800/cpuwiz.c b/src/emu/bus/a7800/cpuwiz.c
index c5d6ef74532..f25580a1c08 100644
--- a/src/emu/bus/a7800/cpuwiz.c
+++ b/src/emu/bus/a7800/cpuwiz.c
@@ -3,26 +3,26 @@
/***********************************************************************************************************
A7800 CPUWIZ's homebrew boards (MegaCart+ and VersaBoard)
-
+
Here we emulate the base configurations of these two boards:
MegaCart+ = up to 512K (31 banks at $8000, 1 at $C000) of ROM and 2 x 16K RAM @ $4000
VersaBoard = up to 256K of ROM and 2 x 16K RAM
-
- Plus, for the moment, a VersaBoard with POKEY mapped at 0x0450 and support for 144K ROM,
- since a few demo homebrew programs seems to use this to combine compatibility with
+
+ Plus, for the moment, a VersaBoard with POKEY mapped at 0x0450 and support for 144K ROM,
+ since a few demo homebrew programs seems to use this to combine compatibility with
XBoarD & XM expansions
Note that the VersaBoard can be configured to work with different banking hardware
e.g. with SG 9bank games or with SG + RAM (so to allow reproduction of games which
- could have worked on old carts without sacrifying original carts), but games running
+ could have worked on old carts without sacrifying original carts), but games running
on those "standard" variants can be emulated with the standard code from rom.c ;-)
-
-
+
+
TO DO:
- investigate whether the POKEY detection routines in homebrew do fail due to emulation
issues or not
-
+
***********************************************************************************************************/
@@ -86,7 +86,7 @@ READ8_MEMBER(a78_versaboard_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_versaboard_device::write_40xx)
@@ -130,5 +130,3 @@ machine_config_constructor a78_rom_p450_vb_device::device_mconfig_additions() co
{
return MACHINE_CONFIG_NAME( a78_pokeyvb );
}
-
-
diff --git a/src/emu/bus/a7800/cpuwiz.h b/src/emu/bus/a7800/cpuwiz.h
index ab019433b70..193ba336b96 100644
--- a/src/emu/bus/a7800/cpuwiz.h
+++ b/src/emu/bus/a7800/cpuwiz.h
@@ -15,15 +15,15 @@ public:
// construction/destruction
a78_versaboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_versaboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_ram_bank;
};
@@ -36,7 +36,7 @@ class a78_megacart_device : public a78_versaboard_device
public:
// construction/destruction
a78_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_WRITE8_MEMBER(write_40xx);
};
@@ -51,14 +51,14 @@ class a78_rom_p450_vb_device : public a78_versaboard_device
public:
// construction/destruction
a78_rom_p450_vb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
diff --git a/src/emu/bus/a7800/hiscore.c b/src/emu/bus/a7800/hiscore.c
index 2e941af9fbd..c51d1c26b74 100644
--- a/src/emu/bus/a7800/hiscore.c
+++ b/src/emu/bus/a7800/hiscore.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
A7800 HighScore passthrough cart emulation
-
+
***********************************************************************************************************/
@@ -75,4 +75,3 @@ WRITE8_MEMBER(a78_hiscore_device::write_40xx)
{
m_hscslot->write_40xx(space, offset, data);
}
-
diff --git a/src/emu/bus/a7800/hiscore.h b/src/emu/bus/a7800/hiscore.h
index d848becfea7..d1750c77486 100644
--- a/src/emu/bus/a7800/hiscore.h
+++ b/src/emu/bus/a7800/hiscore.h
@@ -14,10 +14,10 @@ class a78_hiscore_device : public a78_rom_device
public:
// construction/destruction
a78_hiscore_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
diff --git a/src/emu/bus/a7800/rom.c b/src/emu/bus/a7800/rom.c
index 508c9cc895b..d2bfc5d78a4 100644
--- a/src/emu/bus/a7800/rom.c
+++ b/src/emu/bus/a7800/rom.c
@@ -10,7 +10,7 @@
- 9 banks or not
etc...
But we might merge many of these if they become too many
-
+
TODO:
- Are POKEY regs readable somewhere in SG 144K + POKEY homebrew? How do they detect
the POKEY otherwise?!?
@@ -232,11 +232,11 @@ READ8_MEMBER(a78_rom_device::read_40xx)
/*-------------------------------------------------
Carts with no bankswitch + POKEY chip
- The Pokey chips is accessed by writing at
+ The Pokey chips is accessed by writing at
0x4000-0x7fff.
-
+
GAMES: Ballblazer, Beef Drop (homebrew)
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_pokey_device::read_40xx)
@@ -274,19 +274,19 @@ machine_config_constructor a78_rom_pokey_device::device_mconfig_additions() cons
some test is run)
Note that the code is written so that also
homebrew games with larger ROMs work!
-
+
GAMES: Crack'd, Fatal Run, Ikari Warriors...
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_device::read_40xx)
{
if (offset < 0x4000)
- return m_rom[(offset & 0x3fff) + ((m_bank_mask - 1) * 0x4000)]; // second to last bank (is this always ok?!?)
+ return m_rom[(offset & 0x3fff) + ((m_bank_mask - 1) * 0x4000)]; // second to last bank (is this always ok?!?)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_device::write_40xx)
@@ -300,9 +300,9 @@ WRITE8_MEMBER(a78_rom_sg_device::write_40xx)
Carts with SuperGame bankswitch + POKEY chip
As above + Pokey chip access
-
+
GAMES: Commando
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_pokey_device::read_40xx)
@@ -312,7 +312,7 @@ READ8_MEMBER(a78_rom_sg_pokey_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_pokey_device::write_40xx)
@@ -332,12 +332,12 @@ machine_config_constructor a78_rom_sg_pokey_device::device_mconfig_additions() c
/*-------------------------------------------------
Carts with SuperGame bankswitch + 16K RAM
- FIXME: Some games contained only 8K of RAM, but
+ FIXME: Some games contained only 8K of RAM, but
for the moment we treat all as 16K of RAM even if
from softlist we shall differentiate between them.
-
+
GAMES: Impossible Mission, Jinks and some protos
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_ram_device::read_40xx)
@@ -347,7 +347,7 @@ READ8_MEMBER(a78_rom_sg_ram_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_ram_device::write_40xx)
@@ -364,11 +364,11 @@ WRITE8_MEMBER(a78_rom_sg_ram_device::write_40xx)
Carts with SuperGame bankswitch 9banks:
9 x 16K banks mappable in 0x8000-0xbfff
bank 7 is always mapped in 0xc000-0xffff
-
- GAMES: Alien Brigade & Crossbow + some homebrew
- like Donkey Kong XM demo, Bentley Bear's Crystal
+
+ GAMES: Alien Brigade & Crossbow + some homebrew
+ like Donkey Kong XM demo, Bentley Bear's Crystal
Quest
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg9_device::read_40xx)
@@ -378,7 +378,7 @@ READ8_MEMBER(a78_rom_sg9_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + ((m_bank_mask + 1) * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + ((m_bank_mask + 1) * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg9_device::write_40xx)
@@ -388,14 +388,14 @@ WRITE8_MEMBER(a78_rom_sg9_device::write_40xx)
}
/*-------------------------------------------------
-
+
Carts with Absolute bankswitch:
64K games. Lower 32K are 2 banks of 16K to be mapped
in 0x4000-0x7fff, depending on the value written
at 0x8000. Higher 32K are fixed in 0x8000-0xffff
-
+
GAMES: F-18 Hornet
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_abs_device::read_40xx)
@@ -431,9 +431,9 @@ WRITE8_MEMBER(a78_rom_abs_device::write_40xx)
0x6000-0x7fff first 8kb of bank 6
0x8000-0x9fff second 8kb of bank 7
0xe000-0xffff first 8kb of bank 7
-
+
GAMES: Double Dragon, Rampage.
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_act_device::read_40xx)
@@ -495,4 +495,3 @@ machine_config_constructor a78_rom_p450_sg9_device::device_mconfig_additions() c
{
return MACHINE_CONFIG_NAME( a78_pokey450 );
}
-
diff --git a/src/emu/bus/a7800/rom.h b/src/emu/bus/a7800/rom.h
index 425513d02d7..16f31360a74 100644
--- a/src/emu/bus/a7800/rom.h
+++ b/src/emu/bus/a7800/rom.h
@@ -34,14 +34,14 @@ public:
// construction/destruction
a78_rom_pokey_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
required_device<pokey_device> m_pokey;
};
@@ -55,11 +55,11 @@ public:
// construction/destruction
a78_rom_sg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -76,14 +76,14 @@ class a78_rom_sg_pokey_device : public a78_rom_sg_device
public:
// construction/destruction
a78_rom_sg_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
required_device<pokey_device> m_pokey;
};
@@ -97,7 +97,7 @@ public:
// construction/destruction
a78_rom_sg_ram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -112,7 +112,7 @@ public:
// construction/destruction
a78_rom_sg9_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -126,15 +126,15 @@ class a78_rom_abs_device : public a78_rom_device
public:
// construction/destruction
a78_rom_abs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_bank;
};
@@ -147,15 +147,15 @@ class a78_rom_act_device : public a78_rom_device
public:
// construction/destruction
a78_rom_act_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_bank;
};
@@ -170,13 +170,13 @@ class a78_rom_p450_device : public a78_rom_device
public:
// construction/destruction
a78_rom_p450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -189,13 +189,13 @@ class a78_rom_p450_pokey_device : public a78_rom_pokey_device
public:
// construction/destruction
a78_rom_p450_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -208,13 +208,13 @@ class a78_rom_p450_sg_ram_device : public a78_rom_sg_ram_device
public:
// construction/destruction
a78_rom_p450_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -227,13 +227,13 @@ class a78_rom_p450_sg9_device : public a78_rom_sg9_device
public:
// construction/destruction
a78_rom_p450_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
diff --git a/src/emu/bus/a7800/xboard.c b/src/emu/bus/a7800/xboard.c
index 66c89d3d05c..4a7d3742f1b 100644
--- a/src/emu/bus/a7800/xboard.c
+++ b/src/emu/bus/a7800/xboard.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
A7800 XBoarD & XM expansions emulation
-
+
The XBoarD should be socketed in the A7800 pcb in place of the Maria chip.
It adds to the system additional 128K of RAM and an onboard pokey.
The XM seems to work the same as XBoarD, but it also features HighScore savings
@@ -12,31 +12,31 @@
Currently, we emulate both of these as a passthru cart, even if not 100% accurate for the XBoarD
-
+
Memory map:
POKEY1 $0450 $045F 16 bytes
POKEY2* $0460 $046F 16 bytes
XCTRL $0470 $047F 1 byte
RAM $4000 $7FFF 16384 bytes
-
+
XCTRL Bit Description
-
+
+-------------------------------+
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+-------------------------------+
| | | | | | | |
| | | | | | | +-- Bank select bit 0 \
| | | | | | +------ Bank select bit 1 | Totally 128 KByte in 16 KByte banks
- | | | | | +---------- Bank select bit 2 /
+ | | | | | +---------- Bank select bit 2 /
| | | | +-------------- Enable memory bit (1 = Memory enabled, 0 after power on)
| | | +------------------ Enable POKEY bit** (1 = POKEY enabled, 0 after power on)
| | |
NA NA NA = Not Available or Not Used
-
+
* = Can be mounted piggy back on the first POKEY. Description how to do this will come when i have tried it out.
** This bit controls both POKEY chip select signals.
-
+
TODO:
- verify what happens when 2 POKEYs are present
@@ -142,9 +142,9 @@ machine_config_constructor a78_xm_device::device_mconfig_additions() const
-------------------------------------------------*/
/*-------------------------------------------------
-
+
XBoarD: passthru + 128K RAM + POKEY
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_xboard_device::read_40xx)
@@ -168,7 +168,7 @@ READ8_MEMBER(a78_xboard_device::read_04xx)
if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60)
return m_pokey->read(space, offset & 0x0f);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
+ return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
else
return 0xff;
}
@@ -178,7 +178,7 @@ WRITE8_MEMBER(a78_xboard_device::write_04xx)
if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60)
m_pokey->write(space, offset & 0x0f, data);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
+ m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
else if (offset >= 0x70 && offset < 0x80)
{
m_reg = data;
@@ -188,9 +188,9 @@ WRITE8_MEMBER(a78_xboard_device::write_04xx)
/*-------------------------------------------------
-
+
XM: Same as above but also featuring High Score savings
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_xm_device::read_10xx)
@@ -215,7 +215,7 @@ READ8_MEMBER(a78_xm_device::read_04xx)
else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61)
return m_ym->read(space, offset & 1);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
+ return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
else
return 0xff;
}
@@ -227,7 +227,7 @@ WRITE8_MEMBER(a78_xm_device::write_04xx)
else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61)
m_ym->write(space, offset & 1, data);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
+ m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
else if (offset >= 0x70 && offset < 0x80)
{
//printf("regs 0x%X\n", data);
diff --git a/src/emu/bus/a7800/xboard.h b/src/emu/bus/a7800/xboard.h
index 2eb63462b47..0e5e7f26cf0 100644
--- a/src/emu/bus/a7800/xboard.h
+++ b/src/emu/bus/a7800/xboard.h
@@ -17,12 +17,12 @@ public:
// construction/destruction
a78_xboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_xboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
@@ -43,19 +43,19 @@ class a78_xm_device : public a78_xboard_device
public:
// construction/destruction
a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
virtual DECLARE_READ8_MEMBER(read_10xx);
virtual DECLARE_WRITE8_MEMBER(write_10xx);
virtual DECLARE_READ8_MEMBER(read_30xx);
-
+
protected:
required_device<ym2151_device> m_ym;
int m_ym_enabled;
diff --git a/src/emu/bus/a800/a800_carts.h b/src/emu/bus/a800/a800_carts.h
index 8a67ef656a0..eb28c9c3b2c 100644
--- a/src/emu/bus/a800/a800_carts.h
+++ b/src/emu/bus/a800/a800_carts.h
@@ -14,7 +14,7 @@ static SLOT_INTERFACE_START(a800_left)
SLOT_INTERFACE_INTERNAL("a800_8k", A800_ROM)
SLOT_INTERFACE_INTERNAL("a800_8k_right", A800_ROM)
SLOT_INTERFACE_INTERNAL("a800_16k", A800_ROM)
- SLOT_INTERFACE_INTERNAL("a800_phoenix", A800_ROM) // not really emulated at this stage
+ SLOT_INTERFACE_INTERNAL("a800_phoenix", A800_ROM) // not really emulated at this stage
SLOT_INTERFACE_INTERNAL("a800_bbsb", A800_ROM_BBSB)
SLOT_INTERFACE_INTERNAL("a800_oss8k", A800_ROM_OSS8K)
SLOT_INTERFACE_INTERNAL("a800_oss034m", A800_ROM_OSS34)
@@ -23,13 +23,13 @@ static SLOT_INTERFACE_START(a800_left)
SLOT_INTERFACE_INTERNAL("a800_williams", A800_ROM_WILLIAMS)
SLOT_INTERFACE_INTERNAL("a800_diamond", A800_ROM_EXPRESS)
SLOT_INTERFACE_INTERNAL("a800_express", A800_ROM_EXPRESS)
- SLOT_INTERFACE_INTERNAL("a800_sparta", A800_ROM_SPARTADOS) // this is a passthru cart with unemulated (atm) subslot
+ SLOT_INTERFACE_INTERNAL("a800_sparta", A800_ROM_SPARTADOS) // this is a passthru cart with unemulated (atm) subslot
SLOT_INTERFACE_INTERNAL("a800_blizzard", A800_ROM)
SLOT_INTERFACE_INTERNAL("a800_turbo64", A800_ROM_TURBO)
SLOT_INTERFACE_INTERNAL("a800_turbo128", A800_ROM_TURBO)
SLOT_INTERFACE_INTERNAL("a800_tlink2", A800_ROM_TELELINK2)
SLOT_INTERFACE_INTERNAL("a800_sitsa", A800_ROM_MICROCALC)
- SLOT_INTERFACE_INTERNAL("a800_corina", A800_ROM) // NOT SUPPORTED YET!
+ SLOT_INTERFACE_INTERNAL("a800_corina", A800_ROM) // NOT SUPPORTED YET!
SLOT_INTERFACE_INTERNAL("xegs", XEGS_ROM)
SLOT_INTERFACE_END
diff --git a/src/emu/bus/a800/a800_slot.c b/src/emu/bus/a800/a800_slot.c
index 0a86342247f..e6d06c936e6 100644
--- a/src/emu/bus/a800/a800_slot.c
+++ b/src/emu/bus/a800/a800_slot.c
@@ -6,12 +6,12 @@
Atari 8 bit cart emulation
(through slot devices)
- Emulation of the cartslot(s) for Atari 8bit series of home computers
-
+ Emulation of the cartslot(s) for Atari 8bit series of home computers
+
Accessors to ROM are typically given in the area 0xa000-0xbfff, but some
carts (and the right slot in A800) maps ROM to 0x8000-0x9fff too
Bankswitch typically happens by accessing addresses in 0xd500-0xd5ff
-
+
Accordingly, this device offers the following handlers
- read_80xx/write_80xx
- read_d5xx/write_d5xx
@@ -67,9 +67,9 @@ void device_a800_cart_interface::rom_alloc(UINT32 size, const char *tag)
tempstring.cat(A800SLOT_ROM_REGION_TAG);
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
m_rom_size = size;
-
+
// setup other helpers
- m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking
+ m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking
}
}
@@ -243,15 +243,15 @@ bool a800_cart_slot_device::call_load()
if (m_cart)
{
UINT32 len;
-
+
if (software_entry() != NULL)
{
const char *pcb_name;
len = get_software_region_length("rom");
-
+
m_cart->rom_alloc(len, tag());
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
-
+
if ((pcb_name = get_feature("slot")) != NULL)
m_type = a800_get_pcb_id(pcb_name);
else
@@ -267,9 +267,9 @@ bool a800_cart_slot_device::call_load()
UINT8 header[16];
fread(header, 0x10);
m_type = identify_cart_type(header);
- len -= 0x10; // in identify_cart_type the first 0x10 bytes are read, so we need to adjust here
+ len -= 0x10; // in identify_cart_type the first 0x10 bytes are read, so we need to adjust here
}
- else // otherwise try to guess based on size
+ else // otherwise try to guess based on size
{
if (len == 0x8000)
m_type = A5200_32K;
@@ -323,7 +323,7 @@ int a800_cart_slot_device::identify_cart_type(UINT8 *header)
// check CART format
if (strncmp((const char *)header, "CART", 4))
fatalerror("Invalid header detected!\n");
-
+
switch ((header[4] << 24) + (header[5] << 16) + (header[6] << 8) + (header[7] << 0))
{
case 1:
@@ -400,7 +400,7 @@ int a800_cart_slot_device::identify_cart_type(UINT8 *header)
osd_printf_info("Cart type \"%d\" is currently unsupported.\n", (header[4] << 24) + (header[5] << 16) + (header[6] << 8) + (header[7] << 0));
break;
}
-
+
return type;
}
@@ -420,10 +420,10 @@ void a800_cart_slot_device::get_default_card_software(astring &result)
// check whether there is an header, to identify the cart type
if ((len % 0x1000) == 0x10)
{
- core_fread(m_file, head, 0x10);
+ core_fread(m_file, head, 0x10);
type = identify_cart_type(head);
}
- else // otherwise try to guess based on size
+ else // otherwise try to guess based on size
{
if (len == 0x4000)
type = A800_16K;
@@ -435,9 +435,9 @@ void a800_cart_slot_device::get_default_card_software(astring &result)
osd_printf_info("This game is not designed for A800. You might want to run it in A5200.\n");
slot_string = a800_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -453,11 +453,11 @@ void a5200_cart_slot_device::get_default_card_software(astring &result)
dynamic_buffer head(0x10);
UINT32 len = core_fsize(m_file);
int type = A5200_8K;
-
+
// check whether there is an header, to identify the cart type
if ((len % 0x1000) == 0x10)
{
- core_fread(m_file, head, 0x10);
+ core_fread(m_file, head, 0x10);
type = identify_cart_type(head);
astring info;
@@ -466,11 +466,11 @@ void a5200_cart_slot_device::get_default_card_software(astring &result)
}
if (type < A5200_4K)
osd_printf_info("This game is not designed for A5200. You might want to run it in A800 or A800XL.\n");
-
+
slot_string = a800_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -486,11 +486,11 @@ void xegs_cart_slot_device::get_default_card_software(astring &result)
dynamic_buffer head(0x10);
UINT32 len = core_fsize(m_file);
int type = A800_8K;
-
+
// check whether there is an header, to identify the cart type
if ((len % 0x1000) == 0x10)
{
- core_fread(m_file, head, 0x10);
+ core_fread(m_file, head, 0x10);
type = identify_cart_type(head);
}
if (type != A800_XEGS)
@@ -501,11 +501,11 @@ void xegs_cart_slot_device::get_default_card_software(astring &result)
else
osd_printf_info("You might want to run it in A800 or A800XL.\n");
}
-
+
slot_string = a800_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -549,4 +549,3 @@ WRITE8_MEMBER(a800_cart_slot_device::write_d5xx)
if (m_cart)
m_cart->write_d5xx(space, offset, data, mem_mask);
}
-
diff --git a/src/emu/bus/a800/a800_slot.h b/src/emu/bus/a800/a800_slot.h
index 536ed38da3e..b9e4f491d73 100644
--- a/src/emu/bus/a800/a800_slot.h
+++ b/src/emu/bus/a800/a800_slot.h
@@ -20,11 +20,11 @@ enum
A800_OSSM091,
A800_OSS8K,
A800_PHOENIX,
- A800_XEGS,
- A800_BBSB,
+ A800_XEGS,
+ A800_BBSB,
A800_DIAMOND,
A800_WILLIAMS,
- A800_EXPRESS,
+ A800_EXPRESS,
A800_SPARTADOS,
A800_BLIZZARD,
A800_TURBO64,
@@ -71,7 +71,7 @@ protected:
UINT8 *m_rom;
UINT32 m_rom_size;
dynamic_buffer m_ram;
- dynamic_buffer m_nvram; // HiScore cart can save scores!
+ dynamic_buffer m_nvram; // HiScore cart can save scores!
// helpers
int m_bank_mask;
};
@@ -101,7 +101,7 @@ public:
int get_cart_type() { return m_type; };
int identify_cart_type(UINT8 *header);
bool has_cart() { return m_cart != NULL; }
-
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
@@ -120,7 +120,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_d5xx);
virtual DECLARE_WRITE8_MEMBER(write_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
private:
device_a800_cart_interface* m_cart;
int m_type;
@@ -138,9 +138,9 @@ public:
// construction/destruction
a5200_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~a5200_cart_slot_device();
-
+
virtual const char *file_extensions() const { return "bin,rom,car,a52"; }
-
+
// slot interface overrides
virtual void get_default_card_software(astring &result);
};
@@ -155,7 +155,7 @@ public:
virtual ~xegs_cart_slot_device();
virtual const char *file_extensions() const { return "bin,rom,car"; }
-
+
// slot interface overrides
virtual void get_default_card_software(astring &result);
};
diff --git a/src/emu/bus/a800/oss.c b/src/emu/bus/a800/oss.c
index 1cf4d176d68..3df4f2b0ed4 100644
--- a/src/emu/bus/a800/oss.c
+++ b/src/emu/bus/a800/oss.c
@@ -95,11 +95,11 @@ void a800_rom_oss91_device::device_reset()
-------------------------------------------------*/
/*-------------------------------------------------
-
+
OSS 8K
-
+
This is used by The Writer's Tool only.
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss8k_device::read_80xx)
@@ -128,12 +128,12 @@ WRITE8_MEMBER(a800_rom_oss8k_device::write_d5xx)
/*-------------------------------------------------
-
+
OSS 034M
-
+
This apparently comes from a dump with the wrong bank order...
investigate whether we should remove it!
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss34_device::read_80xx)
@@ -156,7 +156,7 @@ WRITE8_MEMBER(a800_rom_oss34_device::write_d5xx)
break;
case 2:
case 6:
- m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
+ m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
break;
case 3:
case 7:
@@ -173,11 +173,11 @@ WRITE8_MEMBER(a800_rom_oss34_device::write_d5xx)
/*-------------------------------------------------
-
+
OSS 043M
-
+
Same as above but with correct bank order
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss43_device::read_80xx)
@@ -200,7 +200,7 @@ WRITE8_MEMBER(a800_rom_oss43_device::write_d5xx)
break;
case 2:
case 6:
- m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
+ m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
break;
case 3:
case 7:
@@ -217,12 +217,12 @@ WRITE8_MEMBER(a800_rom_oss43_device::write_d5xx)
/*-------------------------------------------------
-
+
OSS M091
-
- Simplified banking system which only uses two
+
+ Simplified banking system which only uses two
address lines (A0 & A3)
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss91_device::read_80xx)
@@ -250,4 +250,3 @@ WRITE8_MEMBER(a800_rom_oss91_device::write_d5xx)
break;
}
}
-
diff --git a/src/emu/bus/a800/oss.h b/src/emu/bus/a800/oss.h
index 5aef80526df..ad772689277 100644
--- a/src/emu/bus/a800/oss.h
+++ b/src/emu/bus/a800/oss.h
@@ -13,14 +13,14 @@ class a800_rom_oss8k_device : public a800_rom_device
public:
// construction/destruction
a800_rom_oss8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -53,14 +53,14 @@ class a800_rom_oss43_device : public a800_rom_device
public:
// construction/destruction
a800_rom_oss43_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -73,14 +73,14 @@ class a800_rom_oss91_device : public a800_rom_device
public:
// construction/destruction
a800_rom_oss91_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
diff --git a/src/emu/bus/a800/rom.c b/src/emu/bus/a800/rom.c
index b527c3b228d..ed11faa7d7b 100644
--- a/src/emu/bus/a800/rom.c
+++ b/src/emu/bus/a800/rom.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
A800/A5200/XEGS ROM cart emulation
-
+
Basic carts work the same (in addition of being mostly compatible) for all these systems
and thus we deal with them in a single file
@@ -196,7 +196,7 @@ void a5200_rom_bbsb_device::device_reset()
/*-------------------------------------------------
Carts with no bankswitch (8K, 16K)
-
+
The cart accessors are mapped in the correct
range at driver start
@@ -210,14 +210,14 @@ READ8_MEMBER(a800_rom_device::read_80xx)
/*-------------------------------------------------
-
+
Bounty Bob Strikes Back! cart (40K)
-
+
Area 0xa000-0xbfff always point to last 8K bank
- Areas 0x8000-0x8fff and 0x9000-0x9fff are
+ Areas 0x8000-0x8fff and 0x9000-0x9fff are
separate banks of 4K mapped either in the first
16K chunk or in the second 16K chunk
- Bankswitch is controlled by data written in
+ Bankswitch is controlled by data written in
0x8000-0x8fff and 0x9000-0x9fff respectively
-------------------------------------------------*/
@@ -240,12 +240,12 @@ WRITE8_MEMBER(a800_rom_bbsb_device::write_80xx)
}
/*-------------------------------------------------
-
+
XEGS carts (32K, 64K or 128K)
-
- Bankswitch is controlled by data written in
+
+ Bankswitch is controlled by data written in
0xd500-0xd5ff
-
+
-------------------------------------------------*/
READ8_MEMBER(xegs_rom_device::read_80xx)
@@ -253,8 +253,8 @@ READ8_MEMBER(xegs_rom_device::read_80xx)
if (offset < 0x2000)
return m_rom[(offset & 0x1fff) + (m_bank * 0x2000)];
else
- return m_rom[(offset & 0x1fff) + (m_bank_mask * 0x2000)]; // always last 8K bank
-
+ return m_rom[(offset & 0x1fff) + (m_bank_mask * 0x2000)]; // always last 8K bank
+
}
WRITE8_MEMBER(xegs_rom_device::write_d5xx)
@@ -264,16 +264,16 @@ WRITE8_MEMBER(xegs_rom_device::write_d5xx)
/*-------------------------------------------------
-
+
Williams 64K
-
+
The rom is accessed in 8K chunks at 0xa000-0xbfff
Bankswitch is controlled by writing to 7 diff
- offsets (their location varies with the cart type):
- offs 0 points to bank 0, offs 1 points to bank 1,
- and so on... the rom can be disabled by writing to
+ offsets (their location varies with the cart type):
+ offs 0 points to bank 0, offs 1 points to bank 1,
+ and so on... the rom can be disabled by writing to
the offsets 0x8-0xf of the same range as the bankswitch
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_williams_device::read_80xx)
@@ -287,16 +287,16 @@ WRITE8_MEMBER(a800_rom_williams_device::write_d5xx)
}
/*-------------------------------------------------
-
+
Express 64K / Diamond 64K carts
-
+
The rom is accessed in 8K chunks at 0xa000-0xbfff
- Bankswitch is the same as above, but writes trigger
- banks in reverse order: offs 7 points to bank 0, offs 6
+ Bankswitch is the same as above, but writes trigger
+ banks in reverse order: offs 7 points to bank 0, offs 6
points to bank 1, and so on... the rom can be disabled
by writing to the offsets 0x8-0xf of the same range
as the bankswitch
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_express_device::read_80xx)
@@ -311,10 +311,10 @@ WRITE8_MEMBER(a800_rom_express_device::write_d5xx)
/*-------------------------------------------------
-
+
Turbosoft 64K / 128K
-
-
+
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_turbo_device::read_80xx)
@@ -329,10 +329,10 @@ WRITE8_MEMBER(a800_rom_turbo_device::write_d5xx)
/*-------------------------------------------------
-
+
Telelink II
-
-
+
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_telelink2_device::read_80xx)
@@ -347,7 +347,7 @@ READ8_MEMBER(a800_rom_telelink2_device::read_80xx)
WRITE8_MEMBER(a800_rom_telelink2_device::write_80xx)
{
- m_nvram[offset & 0xff] = data | 0xf0; // low 4bits only
+ m_nvram[offset & 0xff] = data | 0xf0; // low 4bits only
}
READ8_MEMBER(a800_rom_telelink2_device::read_d5xx)
@@ -364,10 +364,10 @@ WRITE8_MEMBER(a800_rom_telelink2_device::write_d5xx)
/*-------------------------------------------------
-
+
SITSA Microcalc
-
-
+
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_microcalc_device::read_80xx)
@@ -386,21 +386,21 @@ WRITE8_MEMBER(a800_rom_microcalc_device::write_d5xx)
/*-------------------------------------------------
-
+
Carts with no bankswitch (4K, 8K, 16K, 32K)
-
+
Same as base carts above
-
+
-------------------------------------------------*/
/*-------------------------------------------------
-
+
Carts with 2x8K (16K) with A13 line not connected
-
+
Range 0x4000-0x7fff contains two copies of the low
8K, range 0x8000-0xbfff contains two copies of the
high 8K
-
+
-------------------------------------------------*/
READ8_MEMBER(a5200_rom_2chips_device::read_80xx)
@@ -413,18 +413,18 @@ READ8_MEMBER(a5200_rom_2chips_device::read_80xx)
/*-------------------------------------------------
-
+
Bounty Bob Strikes Back! cart (40K)
-
+
Similar to the A800 version, but:
Area 0x8000-0xbfff always point to last 8K bank
(repeated twice)
- Areas 0x4000-0x4fff and 0x5000-0x5fff are
+ Areas 0x4000-0x4fff and 0x5000-0x5fff are
separate banks of 4K mapped either in the first
16K chunk or in the second 16K chunk
- Bankswitch is controlled by data written in
+ Bankswitch is controlled by data written in
0x4000-0x4fff and 0x5000-0x5fff respectively
-
+
-------------------------------------------------*/
READ8_MEMBER(a5200_rom_bbsb_device::read_80xx)
@@ -445,4 +445,3 @@ WRITE8_MEMBER(a5200_rom_bbsb_device::write_80xx)
if (addr >= 0xff6 && addr <= 0xff9)
m_banks[BIT(offset, 12)] = (addr - 0xff6);
}
-
diff --git a/src/emu/bus/a800/rom.h b/src/emu/bus/a800/rom.h
index 55bb728a94f..4c4ea9b30c2 100644
--- a/src/emu/bus/a800/rom.h
+++ b/src/emu/bus/a800/rom.h
@@ -31,14 +31,14 @@ class a800_rom_bbsb_device : public a800_rom_device
public:
// construction/destruction
a800_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_80xx);
-
+
protected:
int m_banks[2];
};
@@ -51,14 +51,14 @@ class a800_rom_williams_device : public a800_rom_device
public:
// construction/destruction
a800_rom_williams_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -71,14 +71,14 @@ class a800_rom_express_device : public a800_rom_device
public:
// construction/destruction
a800_rom_express_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -91,11 +91,11 @@ class a800_rom_blizzard_device : public a800_rom_device
public:
// construction/destruction
a800_rom_blizzard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
};
@@ -107,14 +107,14 @@ class a800_rom_turbo_device : public a800_rom_device
public:
// construction/destruction
a800_rom_turbo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -127,7 +127,7 @@ class a800_rom_telelink2_device : public a800_rom_device
public:
// construction/destruction
a800_rom_telelink2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_80xx);
virtual DECLARE_READ8_MEMBER(read_d5xx);
@@ -142,14 +142,14 @@ class a800_rom_microcalc_device : public a800_rom_device
public:
// construction/destruction
a800_rom_microcalc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -162,14 +162,14 @@ class xegs_rom_device : public a800_rom_device
public:
// construction/destruction
xegs_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -182,7 +182,7 @@ class a5200_rom_2chips_device : public a800_rom_device
public:
// construction/destruction
a5200_rom_2chips_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
};
@@ -194,14 +194,14 @@ class a5200_rom_bbsb_device : public a800_rom_device
public:
// construction/destruction
a5200_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_80xx);
-
+
protected:
int m_banks[2];
};
diff --git a/src/emu/bus/a800/sparta.c b/src/emu/bus/a800/sparta.c
index 316dacb9fe9..a742be866c3 100644
--- a/src/emu/bus/a800/sparta.c
+++ b/src/emu/bus/a800/sparta.c
@@ -43,14 +43,14 @@ void a800_rom_spartados_device::device_reset()
-------------------------------------------------*/
/*-------------------------------------------------
-
+
SpartaDOS 64K carts
-
- Similar to Express / Diamond carts, because
- bankswitch is controlled by writing to 7 diff
- offsets in reverse order, but writes to offsets
+
+ Similar to Express / Diamond carts, because
+ bankswitch is controlled by writing to 7 diff
+ offsets in reverse order, but writes to offsets
0x8-0xf also enable/disable subslot
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_spartados_device::read_80xx)
@@ -58,7 +58,7 @@ READ8_MEMBER(a800_rom_spartados_device::read_80xx)
if (!m_subslot_enabled)
return m_rom[(offset & 0x1fff) + (m_bank * 0x2000)];
else
- return 0xff; // subslot, currently not implemented
+ return 0xff; // subslot, currently not implemented
}
WRITE8_MEMBER(a800_rom_spartados_device::write_d5xx)
@@ -69,4 +69,3 @@ WRITE8_MEMBER(a800_rom_spartados_device::write_d5xx)
m_bank = (offset ^ 0x07) & 0x0f;
}
-
diff --git a/src/emu/bus/a800/sparta.h b/src/emu/bus/a800/sparta.h
index ef6033e7716..983c5ba9200 100644
--- a/src/emu/bus/a800/sparta.h
+++ b/src/emu/bus/a800/sparta.h
@@ -13,14 +13,14 @@ class a800_rom_spartados_device : public a800_rom_device
public:
// construction/destruction
a800_rom_spartados_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank, m_subslot_enabled;
};
diff --git a/src/emu/bus/apf/rom.h b/src/emu/bus/apf/rom.h
index c1a674803cd..0db205afda5 100644
--- a/src/emu/bus/apf/rom.h
+++ b/src/emu/bus/apf/rom.h
@@ -43,7 +43,7 @@ class apf_spacedst_device : public apf_rom_device
public:
// construction/destruction
apf_spacedst_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
diff --git a/src/emu/bus/apf/slot.c b/src/emu/bus/apf/slot.c
index 504bd699389..6a92271fc7c 100644
--- a/src/emu/bus/apf/slot.c
+++ b/src/emu/bus/apf/slot.c
@@ -169,9 +169,9 @@ bool apf_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for an APF cart");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), size);
else
@@ -294,5 +294,3 @@ WRITE8_MEMBER(apf_cart_slot_device::write_ram)
if (m_cart)
m_cart->write_ram(space, offset, data);
}
-
-
diff --git a/src/emu/bus/apf/slot.h b/src/emu/bus/apf/slot.h
index d0c5903bc21..e40894b2cbe 100644
--- a/src/emu/bus/apf/slot.h
+++ b/src/emu/bus/apf/slot.h
@@ -39,7 +39,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
protected:
// internal state
@@ -71,7 +71,7 @@ public:
int get_type() { return m_type; }
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -112,6 +112,5 @@ extern const device_type APF_CART_SLOT;
#define MCFG_APF_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, APF_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/arcadia/slot.c b/src/emu/bus/arcadia/slot.c
index 96eba58bfcc..13ed093e412 100644
--- a/src/emu/bus/arcadia/slot.c
+++ b/src/emu/bus/arcadia/slot.c
@@ -155,7 +155,7 @@ bool arcadia_cart_slot_device::call_load()
UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom");
m_cart->rom_alloc(len, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), len);
else
@@ -260,4 +260,3 @@ READ8_MEMBER(arcadia_cart_slot_device::extra_rom)
else
return 0xff;
}
-
diff --git a/src/emu/bus/arcadia/slot.h b/src/emu/bus/arcadia/slot.h
index 71cd5e0dc96..ce9f6363dbd 100644
--- a/src/emu/bus/arcadia/slot.h
+++ b/src/emu/bus/arcadia/slot.h
@@ -99,6 +99,5 @@ extern const device_type EA2001_CART_SLOT;
#define MCFG_ARCADIA_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, EA2001_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/c64/dela_ep256.c b/src/emu/bus/c64/dela_ep256.c
index 9a9e6748c11..aa360b6c7b3 100644
--- a/src/emu/bus/c64/dela_ep256.c
+++ b/src/emu/bus/c64/dela_ep256.c
@@ -73,7 +73,7 @@ c64_dela_ep256_cartridge_device::c64_dela_ep256_cartridge_device(const machine_c
char str[6];
sprintf(str, "rom%i", i + 1);
m_eproms[i] = subdevice<generic_slot_device>(str);
- }
+ }
}
diff --git a/src/emu/bus/c64/rex_ep256.h b/src/emu/bus/c64/rex_ep256.h
index e69c8c2fba2..8e791966ac9 100644
--- a/src/emu/bus/c64/rex_ep256.h
+++ b/src/emu/bus/c64/rex_ep256.h
@@ -49,7 +49,7 @@ protected:
private:
generic_slot_device *m_eproms[8];
-
+
UINT8 m_bank, m_socket;
int m_reset;
};
diff --git a/src/emu/bus/centronics/digiblst.h b/src/emu/bus/centronics/digiblst.h
index 8ff24c8c434..3e66942961b 100644
--- a/src/emu/bus/centronics/digiblst.h
+++ b/src/emu/bus/centronics/digiblst.h
@@ -1,11 +1,11 @@
/*
* digiblst.h
*
- * Digiblaster - a DIY printer port DAC for the Amstrad CPC
- * Printed in the German magazine CPC Amstrad International issue 8-9/1991
- * Uses Strobe (inverted on the CPC) for the 8th bit (CPCs only have 7-bit printer ports)
+ * Digiblaster - a DIY printer port DAC for the Amstrad CPC
+ * Printed in the German magazine CPC Amstrad International issue 8-9/1991
+ * Uses Strobe (inverted on the CPC) for the 8th bit (CPCs only have 7-bit printer ports)
*
- * Code borrows from the Covox Speech Thing device.
+ * Code borrows from the Covox Speech Thing device.
*
* Created on: 23/08/2014
*/
diff --git a/src/emu/bus/chanf/rom.c b/src/emu/bus/chanf/rom.c
index 01d681bf59b..d2b946269b7 100644
--- a/src/emu/bus/chanf/rom.c
+++ b/src/emu/bus/chanf/rom.c
@@ -164,7 +164,7 @@ UINT8 chanf_rom_device::common_read_2102(UINT32 offset)
m_data0 = m_ram[m_addr] & 1;
return (m_latch[0] & 0x7f) | (m_data0 << 7);
}
-
+
return m_latch[0];
}
else
@@ -176,10 +176,10 @@ void chanf_rom_device::common_write_2102(UINT32 offset, UINT8 data)
if (offset == 0)
{
m_latch[0] = data;
-
+
m_read_write = BIT(data, 0);
- m_addr_latch = (m_addr_latch & 0x3f3) | (BIT(data, 2) << 2) | (BIT(data, 1) << 3); // bits 2,3 come from this write!
+ m_addr_latch = (m_addr_latch & 0x3f3) | (BIT(data, 2) << 2) | (BIT(data, 1) << 3); // bits 2,3 come from this write!
m_addr = m_addr_latch;
m_data0 = BIT(data, 3);
@@ -199,7 +199,7 @@ void chanf_rom_device::common_write_2102(UINT32 offset, UINT8 data)
// These are shared among Schach & Multigame cart types (not directly used by base chanf_rom_device)
UINT8 chanf_rom_device::common_read_3853(UINT32 offset)
-{
+{
if (offset < m_ram.count())
return m_ram[offset];
else
@@ -207,7 +207,7 @@ UINT8 chanf_rom_device::common_read_3853(UINT32 offset)
}
void chanf_rom_device::common_write_3853(UINT32 offset, UINT8 data)
-{
+{
if (offset < m_ram.count())
m_ram[offset] = data;
}
@@ -240,4 +240,3 @@ WRITE8_MEMBER(chanf_multi_final_device::write_bank)
m_base_bank = data & 0x1f;
m_half_bank = BIT(data, 5);
}
-
diff --git a/src/emu/bus/chanf/rom.h b/src/emu/bus/chanf/rom.h
index 272f0301012..e2afa9da580 100644
--- a/src/emu/bus/chanf/rom.h
+++ b/src/emu/bus/chanf/rom.h
@@ -24,14 +24,14 @@ public:
UINT8 common_read_3853(UINT32 offset);
void common_write_2102(UINT32 offset, UINT8 data);
void common_write_3853(UINT32 offset, UINT8 data);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
-
+
protected:
// used for RAM chip in Hangman & Maze
- UINT8 m_latch[2]; // PORT A & PORT B
+ UINT8 m_latch[2]; // PORT A & PORT B
UINT16 m_addr_latch, m_addr;
int m_read_write, m_data0;
};
@@ -43,11 +43,11 @@ class chanf_maze_device : public chanf_rom_device
public:
// construction/destruction
chanf_maze_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_2102(offset); }
virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_2102(offset, data); }
@@ -61,11 +61,11 @@ class chanf_hangman_device : public chanf_rom_device
public:
// construction/destruction
chanf_hangman_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_2102(offset); }
virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_2102(offset, data); }
@@ -79,7 +79,7 @@ class chanf_chess_device : public chanf_rom_device
public:
// construction/destruction
chanf_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); }
virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_3853(offset, data); }
@@ -93,11 +93,11 @@ class chanf_multi_old_device : public chanf_rom_device
public:
// construction/destruction
chanf_multi_old_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); }
@@ -116,17 +116,17 @@ class chanf_multi_final_device : public chanf_rom_device
public:
// construction/destruction
chanf_multi_final_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); }
virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_3853(offset, data); }
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
private:
int m_base_bank, m_half_bank;
};
diff --git a/src/emu/bus/chanf/slot.c b/src/emu/bus/chanf/slot.c
index 32f2e470b0d..e42a69629b9 100644
--- a/src/emu/bus/chanf/slot.c
+++ b/src/emu/bus/chanf/slot.c
@@ -178,9 +178,9 @@ bool channelf_cart_slot_device::call_load()
// we default to "chess" slot because some homebrew programs have been written to run
// on PCBs with RAM at $2000-$2800 as Saba Schach!
if (len == 0x40000)
- m_type = CF_MULTI; // TODO1: differentiate multicart final and earlier from fullpath
+ m_type = CF_MULTI; // TODO1: differentiate multicart final and earlier from fullpath
else
- m_type = CF_CHESS; // TODO2: is there any way to detect Maze and Hangman from fullpath?
+ m_type = CF_CHESS; // TODO2: is there any way to detect Maze and Hangman from fullpath?
m_cart->ram_alloc(0x800);
}
@@ -226,17 +226,17 @@ void channelf_cart_slot_device::get_default_card_software(astring &result)
const char *slot_string = "chess";
UINT32 len = core_fsize(m_file);
int type;
-
+
if (len == 0x40000)
type = CF_MULTI;
else
- type = CF_CHESS; // is there any way to detect the other carts from fullpath?
-
+ type = CF_CHESS; // is there any way to detect the other carts from fullpath?
+
slot_string = chanf_get_slot(type);
-
+
//printf("type: %s\n", slot_string);
clear();
-
+
result.cpy(slot_string);
return;
}
diff --git a/src/emu/bus/chanf/slot.h b/src/emu/bus/chanf/slot.h
index 24752c05df5..161eef039f8 100644
--- a/src/emu/bus/chanf/slot.h
+++ b/src/emu/bus/chanf/slot.h
@@ -42,7 +42,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
protected:
// internal state
@@ -74,7 +74,7 @@ public:
int get_type() { return m_type; }
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -115,6 +115,5 @@ extern const device_type CHANF_CART_SLOT;
#define MCFG_CHANNELF_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, CHANF_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/cpc/amdrum.h b/src/emu/bus/cpc/amdrum.h
index 0abcdefb558..5439855943c 100644
--- a/src/emu/bus/cpc/amdrum.h
+++ b/src/emu/bus/cpc/amdrum.h
@@ -18,7 +18,7 @@
#include "sound/dac.h"
class cpc_amdrum_device : public device_t,
- public device_cpc_expansion_card_interface
+ public device_cpc_expansion_card_interface
{
public:
// construction/destruction
diff --git a/src/emu/bus/cpc/symbfac2.c b/src/emu/bus/cpc/symbfac2.c
index 87df7e214d2..ccbc700f38d 100644
--- a/src/emu/bus/cpc/symbfac2.c
+++ b/src/emu/bus/cpc/symbfac2.c
@@ -47,11 +47,11 @@ static INPUT_PORTS_START(cpc_symbiface2)
PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("PS/2 Mouse forward button") PORT_CODE(MOUSECODE_BUTTON5) PORT_CHANGED_MEMBER(DEVICE_SELF,cpc_symbiface2_device,mouse_change_x,NULL)
// TODO: mouse scroll wheel support
-// PORT_START("sf2_mouse_scroll")
-// PORT_BIT(0x1f , 0, IPT_TRACKBALL_Y)
-// PORT_SENSITIVITY(100)
-// PORT_KEYDELTA(10)
-// PORT_PLAYER(1)
+// PORT_START("sf2_mouse_scroll")
+// PORT_BIT(0x1f , 0, IPT_TRACKBALL_Y)
+// PORT_SENSITIVITY(100)
+// PORT_KEYDELTA(10)
+// PORT_PLAYER(1)
INPUT_PORTS_END
@@ -189,26 +189,26 @@ WRITE8_MEMBER(cpc_symbiface2_device::rtc_w)
// PS/2 Mouse connector
// #FD10 (read only) read mouse status
/*
- Status byte
- Bit 76543210
- Use mmDDDDDD
-
- m: Mode
- D: Use-Data
-
- If read and...
-
- m = 00 -> no more data available, you can stop reading the status for a while
- m = 01 -> D = X offset (signed); you will receive positive values, if the user
- is moving the mouse to the right
- m = 10 -> D = Y offset (signed); you will receive positive values, if the user
- is moving the mouse upwards
- m = 11 -> D[bit5] = 0 -> D[bit0] = left button
- D[bit1] = right button
- D[bit2] = middle button
- D[bit3] = forward button
- D[bit4] = backward button
- D[bit5] = 1 -> D[bit0-4] = scroll wheel offset (signed)
+ Status byte
+ Bit 76543210
+ Use mmDDDDDD
+
+ m: Mode
+ D: Use-Data
+
+ If read and...
+
+ m = 00 -> no more data available, you can stop reading the status for a while
+ m = 01 -> D = X offset (signed); you will receive positive values, if the user
+ is moving the mouse to the right
+ m = 10 -> D = Y offset (signed); you will receive positive values, if the user
+ is moving the mouse upwards
+ m = 11 -> D[bit5] = 0 -> D[bit0] = left button
+ D[bit1] = right button
+ D[bit2] = middle button
+ D[bit3] = forward button
+ D[bit4] = backward button
+ D[bit5] = 1 -> D[bit0-4] = scroll wheel offset (signed)
*/
READ8_MEMBER(cpc_symbiface2_device::mouse_r)
{
diff --git a/src/emu/bus/cpc/symbfac2.h b/src/emu/bus/cpc/symbfac2.h
index 58a97ae12ad..bcc8f0eedba 100644
--- a/src/emu/bus/cpc/symbfac2.h
+++ b/src/emu/bus/cpc/symbfac2.h
@@ -14,7 +14,7 @@
#include "cpcexp.h"
class cpc_symbiface2_device : public device_t,
- public device_cpc_expansion_card_interface
+ public device_cpc_expansion_card_interface
{
public:
// construction/destruction
diff --git a/src/emu/bus/crvision/rom.c b/src/emu/bus/crvision/rom.c
index 61eebfb92ac..f67a27a054e 100644
--- a/src/emu/bus/crvision/rom.c
+++ b/src/emu/bus/crvision/rom.c
@@ -88,7 +88,7 @@ READ8_MEMBER(crvision_rom6k_device::read_rom80)
offset &= 0x1fff;
if (offset < 0x1000)
return m_rom[0x1000 + (offset & 0x7ff)];
-
+
return m_rom[offset & 0xfff];
}
diff --git a/src/emu/bus/crvision/rom.h b/src/emu/bus/crvision/rom.h
index 118a398b7a6..eb44fee4ef9 100644
--- a/src/emu/bus/crvision/rom.h
+++ b/src/emu/bus/crvision/rom.h
@@ -43,7 +43,7 @@ class crvision_rom8k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom80);
};
@@ -55,7 +55,7 @@ class crvision_rom10k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom10k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom40);
virtual DECLARE_READ8_MEMBER(read_rom80);
@@ -68,7 +68,7 @@ class crvision_rom12k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom12k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom40);
virtual DECLARE_READ8_MEMBER(read_rom80);
@@ -81,7 +81,7 @@ class crvision_rom16k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom80);
};
@@ -93,7 +93,7 @@ class crvision_rom18k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom18k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom40);
virtual DECLARE_READ8_MEMBER(read_rom80);
diff --git a/src/emu/bus/crvision/slot.c b/src/emu/bus/crvision/slot.c
index b72bebd00a1..195dd476588 100644
--- a/src/emu/bus/crvision/slot.c
+++ b/src/emu/bus/crvision/slot.c
@@ -163,9 +163,9 @@ bool crvision_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for an APF cart");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), size);
else
@@ -295,4 +295,3 @@ READ8_MEMBER(crvision_cart_slot_device::read_rom80)
else
return 0xff;
}
-
diff --git a/src/emu/bus/crvision/slot.h b/src/emu/bus/crvision/slot.h
index db59daed13c..4219c153d1f 100644
--- a/src/emu/bus/crvision/slot.h
+++ b/src/emu/bus/crvision/slot.h
@@ -104,6 +104,5 @@ extern const device_type CRVISION_CART_SLOT;
#define MCFG_CRVISION_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, CRVISION_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/gameboy/gb_slot.h b/src/emu/bus/gameboy/gb_slot.h
index b4c16bbce74..ea6036a1481 100644
--- a/src/emu/bus/gameboy/gb_slot.h
+++ b/src/emu/bus/gameboy/gb_slot.h
@@ -71,8 +71,8 @@ public:
void set_has_battery(bool val) { has_battery = val; }
bool get_has_battery() { return has_battery; }
- void save_ram() { device().save_item(NAME(m_ram)); }
-
+ void save_ram() { device().save_item(NAME(m_ram)); }
+
// internal state
UINT8 *m_rom;
UINT32 m_rom_size;
@@ -122,8 +122,8 @@ public:
void setup_ram(UINT8 banks);
void internal_header_logging(UINT8 *ROM, UINT32 len);
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
-
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
diff --git a/src/emu/bus/gameboy/mbc.h b/src/emu/bus/gameboy/mbc.h
index 504f2327397..f480dc875fd 100644
--- a/src/emu/bus/gameboy/mbc.h
+++ b/src/emu/bus/gameboy/mbc.h
@@ -183,11 +183,11 @@ class gb_rom_188in1_device : public gb_rom_mbc1_device
public:
// construction/destruction
gb_rom_188in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start() { shared_start(); save_item(NAME(m_game_base)); };
virtual void device_reset() { shared_reset(); m_game_base = 0; };
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
diff --git a/src/emu/bus/gba/gba_slot.h b/src/emu/bus/gba/gba_slot.h
index 339666db18b..79ac615d25e 100644
--- a/src/emu/bus/gba/gba_slot.h
+++ b/src/emu/bus/gba/gba_slot.h
@@ -42,7 +42,7 @@ public:
UINT32 get_nvram_size() { return m_nvram.bytes(); }
void set_rom_size(UINT32 val) { m_rom_size = val; }
- void save_nvram() { device().save_item(NAME(m_nvram)); }
+ void save_nvram() { device().save_item(NAME(m_nvram)); }
// internal state
UINT32 *m_rom; // this points to the cart rom region
@@ -77,7 +77,7 @@ public:
void setup_ram(UINT8 banks);
void internal_header_logging(UINT8 *ROM, UINT32 len);
- void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); }
+ void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -175,7 +175,7 @@ static const gba_chip_fix_conflict_item gba_chip_fix_conflict_list[] =
{ "BR4J", GBA_CHIP_FLASH }, // 1586 - Rockman EXE 4.5 - Real Operation (JPN)
{ "BG8J", GBA_CHIP_EEPROM_64K }, // 1853 - Ganbare! Dodge Fighters (JPN)
{ "AROP", GBA_CHIP_EEPROM_4K }, // 1862 - Rocky (EUR)
-// "A2YE" - 1906 - Top Gun - Combat Zones (USA) - multiple NVRAM chips detected, but none present (protection against emu?)
+// "A2YE" - 1906 - Top Gun - Combat Zones (USA) - multiple NVRAM chips detected, but none present (protection against emu?)
{ "BKMJ", GBA_CHIP_EEPROM_4K }, // 2039 - Kim Possible (JPN)
{ "BKEJ", GBA_CHIP_EEPROM_64K }, // 2047 - Konjiki no Gashbell - The Card Battle for GBA (JPN)
{ "BKMP", GBA_CHIP_EEPROM_4K }, // 2297 - Kim Possible 2 - Drakken's Demise (EUR)
diff --git a/src/emu/bus/generic/carts.c b/src/emu/bus/generic/carts.c
index 244f9a28b70..91f53077054 100644
--- a/src/emu/bus/generic/carts.c
+++ b/src/emu/bus/generic/carts.c
@@ -1,9 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:etabeta
/**********************************************************************
-
+
Generic ROM / RAM socket slots
-
+
**********************************************************************/
diff --git a/src/emu/bus/generic/ram.c b/src/emu/bus/generic/ram.c
index 2750cd5de7e..4632c614cbc 100644
--- a/src/emu/bus/generic/ram.c
+++ b/src/emu/bus/generic/ram.c
@@ -1,21 +1,21 @@
// license:BSD-3-Clause
// copyright-holders:etabeta
/***********************************************************************************************************
-
-
+
+
Generic RAM socket emulation
-
+
This offers generic access to RAM
-
+
generic_ram_plain : returns 0xff when the system reads beyond the end of the RAM
- generic_ram_linear : maps linearly the RAM in the accessed area (i.e., read/write offset is masked with
+ generic_ram_linear : maps linearly the RAM in the accessed area (i.e., read/write offset is masked with
(RAM size - 1) )
-
+
TODO:
- support variable RAM size
- possibly support linear mapping when non-power of 2 RAMs are mapped
- add support for 16bit & 32bit RAM access
-
+
***********************************************************************************************************/
@@ -121,4 +121,3 @@ WRITE8_MEMBER(generic_ram_linear_device::write_ram)
{
m_ram[offset % m_ram.bytes()] = data;
}
-
diff --git a/src/emu/bus/generic/ram.h b/src/emu/bus/generic/ram.h
index be777167a6a..7d5637286f3 100644
--- a/src/emu/bus/generic/ram.h
+++ b/src/emu/bus/generic/ram.h
@@ -14,14 +14,14 @@ class generic_ram_plain_device : public device_t,
public:
// construction/destruction
generic_ram_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source);
-
+
// device-level overrides
virtual void device_start();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
-
+
private:
UINT32 m_size;
};
@@ -35,14 +35,14 @@ class generic_ram_linear_device : public device_t,
public:
// construction/destruction
generic_ram_linear_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source);
-
+
// device-level overrides
virtual void device_start();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
-
+
private:
UINT32 m_size;
};
diff --git a/src/emu/bus/generic/rom.c b/src/emu/bus/generic/rom.c
index 352acc4c141..fd2107eb798 100644
--- a/src/emu/bus/generic/rom.c
+++ b/src/emu/bus/generic/rom.c
@@ -4,18 +4,18 @@
Generic ROM emulation (for carts and ROM sockets)
-
+
This offers generic access to a ROM
-
+
generic_rom_plain : returns 0xff when the system reads beyond the end of the ROM
generic_rom_linear : maps linearly the ROM in the accessed area (i.e., read offset is masked with (ROM size - 1) )
generic_romram_plain : allows support for carts always containing ROM + RAM (e.g. X07)
-
+
TODO:
- possibly support linear mapping when non-power of 2 ROMs are mapped
-
+
***********************************************************************************************************/
@@ -120,4 +120,3 @@ WRITE8_MEMBER(generic_romram_plain_device::write_ram)
if (offset < m_ram.bytes())
m_ram[offset] = data;
}
-
diff --git a/src/emu/bus/generic/rom.h b/src/emu/bus/generic/rom.h
index c41fc427018..1a9b0bd1883 100644
--- a/src/emu/bus/generic/rom.h
+++ b/src/emu/bus/generic/rom.h
@@ -14,7 +14,7 @@ class generic_rom_device : public device_t,
public:
// construction/destruction
generic_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
+
// device-level overrides
virtual void device_start() {}
};
@@ -28,7 +28,7 @@ public:
// construction/destruction
generic_rom_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
generic_rom_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ16_MEMBER(read16_rom);
@@ -43,7 +43,7 @@ class generic_romram_plain_device : public generic_rom_plain_device
public:
// construction/destruction
generic_romram_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -57,7 +57,7 @@ class generic_rom_linear_device : public generic_rom_device
public:
// construction/destruction
generic_rom_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ16_MEMBER(read16_rom);
diff --git a/src/emu/bus/generic/slot.c b/src/emu/bus/generic/slot.c
index 119478fe38e..40f959e404e 100644
--- a/src/emu/bus/generic/slot.c
+++ b/src/emu/bus/generic/slot.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
Generic ROM / RAM Socket and Cartslot device
-
+
This device offers basic RAM / ROM allocation and access
The available handlers are suited for any situation where a system opens a
@@ -12,12 +12,12 @@
This device is not suited whenever the system exposes additional lines to
the socket/slot: e.g. whenever input/output lines are present, whenever
there are lines controlling bankswitch / paging, and whenever different
- cart configurations have to be supported (like some PCBs containing ROM
+ cart configurations have to be supported (like some PCBs containing ROM
only, and other containing both ROM and RAM)
In the latter situations, per-system slot devices have to be created (see
e.g. APF cart slot device for an example of a simple device with multiple
pcbs supported)
-
+
***********************************************************************************************************/
@@ -136,15 +136,15 @@ void generic_slot_device::device_config_complete()
bool generic_slot_device::call_load()
{
if (m_cart)
- {
+ {
if (!m_device_image_load.isnull())
return m_device_image_load(*this);
else
{
UINT32 len = common_get_size("rom");
-
+
rom_alloc(len, m_width, m_endianness);
- common_load_rom(get_rom_base(), len, "rom");
+ common_load_rom(get_rom_base(), len, "rom");
return IMAGE_INIT_PASS;
}
@@ -189,13 +189,13 @@ void generic_slot_device::get_default_card_software(astring &result)
/**************************************************
- Implementation
-
+ Implementation
+
**************************************************/
/*-------------------------------------------------
- common_get_size - it gets image file size both
+ common_get_size - it gets image file size both
for fullpath and for softlist
-------------------------------------------------*/
@@ -208,7 +208,7 @@ UINT32 generic_slot_device::common_get_size(const char *region)
}
/*-------------------------------------------------
- common_load_rom - it loads from image file both
+ common_load_rom - it loads from image file both
for fullpath and for softlist
-------------------------------------------------*/
@@ -283,4 +283,3 @@ WRITE8_MEMBER(generic_slot_device::write_ram)
if (m_cart)
m_cart->write_ram(space, offset, data);
}
-
diff --git a/src/emu/bus/generic/slot.h b/src/emu/bus/generic/slot.h
index 9d90d3a2253..a93d7d8904e 100644
--- a/src/emu/bus/generic/slot.h
+++ b/src/emu/bus/generic/slot.h
@@ -93,14 +93,14 @@ public:
static void static_set_device_load(device_t &device, device_image_load_delegate callback) { downcast<generic_slot_device &>(device).m_device_image_load = callback; }
static void static_set_device_unload(device_t &device, device_image_func_delegate callback) { downcast<generic_slot_device &>(device).m_device_image_unload = callback; }
-
+
void set_interface(const char * interface) { m_interface = interface; }
void set_default_card(const char * def) { m_default_card = def; }
void set_extensions(const char * exts) { m_extensions = exts; }
void set_must_be_loaded(bool mandatory) { m_must_be_loaded = mandatory; }
void set_width(int width) { m_width = width; }
void set_endian(endianness_t end) { m_endianness = end; }
-
+
// device-level overrides
virtual void device_start();
virtual void device_config_complete();
@@ -168,11 +168,9 @@ extern const device_type GENERIC_SOCKET;
#define MCFG_GENERIC_CARTSLOT_ADD(_tag, _slot_intf, _dev_intf) \
MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, NULL, false) \
- MCFG_GENERIC_INTERFACE(_dev_intf) \
-
+ MCFG_GENERIC_INTERFACE(_dev_intf)
#define MCFG_GENERIC_SOCKET_ADD(_tag, _slot_intf, _dev_intf) \
MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, NULL, false) \
- MCFG_GENERIC_INTERFACE(_dev_intf) \
-
+ MCFG_GENERIC_INTERFACE(_dev_intf)
#endif
diff --git a/src/emu/bus/intv/ecs.c b/src/emu/bus/intv/ecs.c
index 6b42f004bab..4400b5e8839 100644
--- a/src/emu/bus/intv/ecs.c
+++ b/src/emu/bus/intv/ecs.c
@@ -4,10 +4,10 @@
Mattel Intellivision Entertainment Computer System expansion emulation
TODO:
- - Make paged rom emulation more accurate (according to
+ - Make paged rom emulation more accurate (according to
http://spatula-city.org/~im14u2c/intv/tech/ecs.html
- writes to $xa5y should be available for every x and every y, i.e. we shall
- have writes to every 4K chunk of the memory map, and there shall be 16 pages
+ writes to $xa5y should be available for every x and every y, i.e. we shall
+ have writes to every 4K chunk of the memory map, and there shall be 16 pages
for each)
Current emulation is instead tailored around the minimal usage necessary to
make the main expansion and World Series Major League Baseball happy
@@ -67,12 +67,12 @@ void intv_ecs_device::device_start()
}
void intv_ecs_device::device_reset()
-{
+{
memset(m_bank_base, 0, sizeof(m_bank_base));
}
void intv_ecs_device::late_subslot_setup()
-{
+{
switch (m_subslot->get_type())
{
case INTV_RAM:
@@ -107,13 +107,13 @@ UINT8 intv_ecs_device::intv_control_r(int hand)
0xFF, 0x3F, 0x9F, 0x5F, 0xD7, 0xB7, 0x77, 0xDB,
0xBB, 0x7B, 0xDD, 0xBD, 0x7D, 0xDE, 0xBE, 0x7E
};
-
+
static const UINT8 disc_table[] =
{
0xF3, 0xE3, 0xE7, 0xF7, 0xF6, 0xE6, 0xEE, 0xFE,
0xFC, 0xEC, 0xED, 0xFD, 0xF9, 0xE9, 0xEB, 0xFB
};
-
+
static const UINT8 discyx_table[5][5] =
{
{ 0xE3, 0xF3, 0xFB, 0xEB, 0xE9 },
@@ -122,10 +122,10 @@ UINT8 intv_ecs_device::intv_control_r(int hand)
{ 0xF6, 0xE6, 0xFE, 0xEC, 0xED },
{ 0xE6, 0xEE, 0xFE, 0xFC, 0xEC }
};
-
+
int x, y;
UINT8 val = 0xff;
-
+
/* keypad */
x = m_keypad[hand]->read();
for (y = 0; y < 16; y++)
@@ -135,12 +135,12 @@ UINT8 intv_ecs_device::intv_control_r(int hand)
val &= keypad_table[y];
}
}
-
+
switch ((m_options->read() >> hand) & 4)
{
case 0: /* disc == digital */
default:
-
+
x = m_disc[hand]->read();
for (y = 0; y < 16; y++)
{
@@ -150,14 +150,14 @@ UINT8 intv_ecs_device::intv_control_r(int hand)
}
}
break;
-
+
case 1: /* disc == _fake_ analog */
-
+
x = m_discx[hand]->read();
y = m_discy[hand]->read();
val &= discyx_table[y / 32][x / 32];
}
-
+
return val;
}
@@ -252,7 +252,7 @@ static INPUT_PORTS_START( intv_ecs_kbd )
Bit 4 D E 2 3 W S Z X
Bit 5 A CTL (right) 1 Q (up) (down) (space)
Bit 6 SHIFT NC NC NC NC NC NC NC
-
+
Shifted keys that differ from pc:
Key : 1 2 5 6 7 (left) (right) (up) (down)
Shift + key: = " + - / % ' ^ ?
@@ -530,32 +530,32 @@ ioport_constructor intv_ecs_device::device_input_ports() const
Paged ROM handling
-------------------------------------------------*/
-READ16_MEMBER(intv_ecs_device::read_rom20)
-{
+READ16_MEMBER(intv_ecs_device::read_rom20)
+{
if (m_bank_base[2])
- return INTV_ROM16_READ(offset + 0x2000);
+ return INTV_ROM16_READ(offset + 0x2000);
else
return 0xffff;
}
-READ16_MEMBER(intv_ecs_device::read_rom70)
-{
+READ16_MEMBER(intv_ecs_device::read_rom70)
+{
if (m_bank_base[7])
return 0xffff;
else
- return INTV_ROM16_READ(offset + 0x7000);
+ return INTV_ROM16_READ(offset + 0x7000);
}
-READ16_MEMBER(intv_ecs_device::read_rome0)
-{
+READ16_MEMBER(intv_ecs_device::read_rome0)
+{
if (m_bank_base[14])
- return INTV_ROM16_READ(offset + 0xe000);
- else // if WSMLB is loaded, it shall go here, otherwise 0xffff
+ return INTV_ROM16_READ(offset + 0xe000);
+ else // if WSMLB is loaded, it shall go here, otherwise 0xffff
return m_subslot->read_rome0(space, offset, mem_mask);
}
-READ16_MEMBER(intv_ecs_device::read_romf0)
-{
+READ16_MEMBER(intv_ecs_device::read_romf0)
+{
// only WSMLB should come here with bank_base = 1
if (m_bank_base[15])
return m_subslot->read_romf0(space, offset + 0x1000, mem_mask);
@@ -585,4 +585,3 @@ WRITE16_MEMBER(intv_ecs_device::write_ay)
if (ACCESSING_BITS_0_7)
return m_snd->write(space, offset, data, mem_mask);
}
-
diff --git a/src/emu/bus/intv/ecs.h b/src/emu/bus/intv/ecs.h
index 6db3609c7ce..52ca99b76e5 100644
--- a/src/emu/bus/intv/ecs.h
+++ b/src/emu/bus/intv/ecs.h
@@ -14,14 +14,14 @@ class intv_ecs_device : public intv_rom_device
public:
// construction/destruction
intv_ecs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
virtual const rom_entry *device_rom_region() const;
-
+
// reading and writing
// actual ECS accesses
@@ -32,14 +32,14 @@ public:
virtual DECLARE_READ16_MEMBER(read_romf0);
// RAM
virtual DECLARE_READ16_MEMBER(read_ram) { return (int)m_ram[offset & (m_ram.count() - 1)]; }
- virtual DECLARE_WRITE16_MEMBER(write_ram) { m_ram[offset & (m_ram.count() - 1)] = data & 0xff; }
+ virtual DECLARE_WRITE16_MEMBER(write_ram) { m_ram[offset & (m_ram.count() - 1)] = data & 0xff; }
// AY8914
virtual DECLARE_READ16_MEMBER(read_ay);
virtual DECLARE_WRITE16_MEMBER(write_ay);
DECLARE_READ8_MEMBER(ay_porta_r);
DECLARE_READ8_MEMBER(ay_portb_r);
DECLARE_WRITE8_MEMBER(ay_porta_w);
-
+
// passthru accesses
virtual DECLARE_READ16_MEMBER(read_rom04) { return m_subslot->read_rom04(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom40) { return m_subslot->read_rom40(space, offset, mem_mask); }
@@ -47,27 +47,27 @@ public:
virtual DECLARE_READ16_MEMBER(read_rom50) { return m_subslot->read_rom50(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom60) { return m_subslot->read_rom60(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom80)
- {
+ {
if (m_ram88_enabled && offset >= 0x800)
- return m_subslot->read_ram(space, offset & 0x7ff, mem_mask);
+ return m_subslot->read_ram(space, offset & 0x7ff, mem_mask);
else
- return m_subslot->read_rom80(space, offset, mem_mask);
+ return m_subslot->read_rom80(space, offset, mem_mask);
}
virtual DECLARE_READ16_MEMBER(read_rom90) { return m_subslot->read_rom90(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_roma0) { return m_subslot->read_roma0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romb0) { return m_subslot->read_romb0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romc0) { return m_subslot->read_romc0(space, offset, mem_mask); }
- virtual DECLARE_READ16_MEMBER(read_romd0)
- {
+ virtual DECLARE_READ16_MEMBER(read_romd0)
+ {
if (m_ramd0_enabled && offset < 0x800)
- return m_subslot->read_ram(space, offset, mem_mask);
+ return m_subslot->read_ram(space, offset, mem_mask);
else
- return m_subslot->read_romd0(space, offset, mem_mask);
+ return m_subslot->read_romd0(space, offset, mem_mask);
}
// paged ROM banking
- virtual DECLARE_WRITE16_MEMBER(write_rom20)
- {
+ virtual DECLARE_WRITE16_MEMBER(write_rom20)
+ {
if (offset == 0xfff)
{
if (data == 0x2a50)
@@ -76,8 +76,8 @@ public:
m_bank_base[2] = 1;
}
}
- virtual DECLARE_WRITE16_MEMBER(write_rom70)
- {
+ virtual DECLARE_WRITE16_MEMBER(write_rom70)
+ {
if (offset == 0xfff)
{
if (data == 0x7a50)
@@ -86,8 +86,8 @@ public:
m_bank_base[7] = 1;
}
}
- virtual DECLARE_WRITE16_MEMBER(write_rome0)
- {
+ virtual DECLARE_WRITE16_MEMBER(write_rome0)
+ {
if (offset == 0xfff)
{
if (data == 0xea50)
@@ -96,8 +96,8 @@ public:
m_bank_base[14] = 1;
}
}
- virtual DECLARE_WRITE16_MEMBER(write_romf0)
- {
+ virtual DECLARE_WRITE16_MEMBER(write_romf0)
+ {
if (offset == 0xfff)
{
if (data == 0xfa50)
@@ -112,11 +112,11 @@ public:
// IntelliVoice passthru
virtual DECLARE_READ16_MEMBER(read_speech) { if (m_voice_enabled) return m_subslot->read_speech(space, offset, mem_mask); else return 0xffff; }
virtual DECLARE_WRITE16_MEMBER(write_speech) { if (m_voice_enabled) m_subslot->write_speech(space, offset, data, mem_mask); }
-
+
virtual void late_subslot_setup();
UINT8 intv_control_r(int hand);
-
+
private:
required_device<ay8914_device> m_snd;
diff --git a/src/emu/bus/intv/rom.c b/src/emu/bus/intv/rom.c
index 6bc190f4a83..6ff9cbd58d7 100644
--- a/src/emu/bus/intv/rom.c
+++ b/src/emu/bus/intv/rom.c
@@ -47,4 +47,3 @@ intv_wsmlb_device::intv_wsmlb_device(const machine_config &mconfig, const char *
: intv_rom_device(mconfig, INTV_ROM_WSMLB, "Intellivision World Series Baseball Cart", tag, owner, clock, "intv_wsmlb", __FILE__)
{
}
-
diff --git a/src/emu/bus/intv/rom.h b/src/emu/bus/intv/rom.h
index 2eb13cc5c76..cb6947b833c 100644
--- a/src/emu/bus/intv/rom.h
+++ b/src/emu/bus/intv/rom.h
@@ -13,7 +13,7 @@ public:
// construction/destruction
intv_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
intv_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ16_MEMBER(read_rom04) { return INTV_ROM16_READ(offset + 0x0400); }
virtual DECLARE_READ16_MEMBER(read_rom20) { return INTV_ROM16_READ(offset + 0x2000); }
@@ -30,7 +30,7 @@ public:
virtual DECLARE_READ16_MEMBER(read_romd0) { return INTV_ROM16_READ(offset + 0xd000); }
virtual DECLARE_READ16_MEMBER(read_rome0) { return INTV_ROM16_READ(offset + 0xe000); }
virtual DECLARE_READ16_MEMBER(read_romf0) { return INTV_ROM16_READ(offset + 0xf000); }
-
+
// device-level overrides
virtual void device_start() {}
virtual void device_reset() {}
@@ -43,7 +43,7 @@ class intv_ram_device : public intv_rom_device
public:
// construction/destruction
intv_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ16_MEMBER(read_ram) { return (int)m_ram[offset & (m_ram.count() - 1)]; }
virtual DECLARE_WRITE16_MEMBER(write_ram) { m_ram[offset & (m_ram.count() - 1)] = data & 0xff; }
@@ -56,7 +56,7 @@ class intv_gfact_device : public intv_rom_device
public:
// construction/destruction
intv_gfact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ16_MEMBER(read_ram) { return (int)m_ram[offset & (m_ram.count() - 1)]; }
virtual DECLARE_WRITE16_MEMBER(write_ram) { m_ram[offset & (m_ram.count() - 1)] = data & 0xff; }
diff --git a/src/emu/bus/intv/slot.c b/src/emu/bus/intv/slot.c
index 0b60e504593..4b633fdb997 100644
--- a/src/emu/bus/intv/slot.c
+++ b/src/emu/bus/intv/slot.c
@@ -3,18 +3,18 @@
Mattel Intellivision cart emulation
(through slot devices)
-
+
This is a strange beast, because INTV carts had potentially access to
a *LOT* of memory ranges!
Quoting Joe Zbiciak's documentation for his emu (jzIntv):
-
-
+
+
The Intellivision leaves many addresses available to cartridges. However,
several address ranges come with caveats, such as interactions with other
- devices in the system, or incompatibilities with various peripherals.
-
+ devices in the system, or incompatibilities with various peripherals.
+
Below is a summary.
-
+
ADDRESSES NOTES
-------------- --------------------------------------------------------------
$0400 - $04FF RAM/ROM ok on all but Intellivision 2.
@@ -26,7 +26,7 @@
$4800 ROM ok. RAM ok only if boot ROM at $7000.
$4801 - $4FFF RAM/ROM ok.
$5000 - $5014 ROM ok. RAM ok only if boot ROM at $7000 or $4800.
- $5015 - $6FFF RAM/ROM ok.
+ $5015 - $6FFF RAM/ROM ok.
$7000 ROM ok if no ECS. RAM at $7000 confuses EXEC boot sequence.
$7001 - $77FF RAM/ROM ok if no ECS.
$7800 - $7FFF ROM ok if no ECS. Do not map RAM here due to GRAM alias.
@@ -38,8 +38,8 @@
$E000 - $EFFF RAM/ROM ok if no ECS.
$F000 - $F7FF RAM/ROM ok.
$F800 - $FFFF ROM ok. Do not map RAM here due to GRAM alias.
-
-
+
+
We handle this, by always creating a 0x10000 wide ROM region to load the
cart image and exposing the following (long list of) read handlers:
read_rom04
@@ -58,7 +58,7 @@
read_rome0
read_romf0
Each pcb types will then use the correct ones for its wiring setup.
-
+
The BIN+CFG format introduced by INTVPC emulator includes metadata about where to
load ROM into memory in the CFG file, but we don't support it (because we don't parse
the CFG at all) and we rely instead on the intv.hsi metadata for fullpath loading of
@@ -69,7 +69,7 @@
TODO:
- Convert also the keyboard component to be a passthru slot device
- Merge some of the ROM accessor above, once it is clear which ones can be merged
-
+
***********************************************************************************************************/
@@ -239,16 +239,16 @@ int intv_cart_slot_device::load_fullpath()
UINT8 num_segments;
UINT8 start_seg;
UINT8 end_seg;
-
+
UINT32 current_address;
UINT32 end_address;
-
+
UINT8 high_byte;
UINT8 low_byte;
-
+
UINT8 *ROM;
const char *file_type = filetype();
-
+
/* if it is in .rom format, we enter here */
if (!core_stricmp (file_type, "rom"))
{
@@ -256,9 +256,9 @@ int intv_cart_slot_device::load_fullpath()
fread(&temp, 1);
if (temp != 0xa8)
return IMAGE_INIT_FAIL;
-
+
fread(&num_segments, 1);
-
+
fread(&temp, 1);
if (temp != (num_segments ^ 0xff))
return IMAGE_INIT_FAIL;
@@ -270,10 +270,10 @@ int intv_cart_slot_device::load_fullpath()
{
fread(&start_seg, 1);
current_address = start_seg * 0x100;
-
+
fread(&end_seg, 1);
end_address = end_seg * 0x100 + 0xff;
-
+
while (current_address <= end_address)
{
fread(&low_byte, 1);
@@ -282,12 +282,12 @@ int intv_cart_slot_device::load_fullpath()
ROM[current_address << 1] = high_byte;
current_address++;
}
-
+
// Here we should calculate and compare the CRC16...
fread(&temp, 1);
fread(&temp, 1);
}
-
+
// Access tables and fine address restriction tables are not supported ATM
for (int i = 0; i < (16 + 32 + 2); i++)
{
@@ -300,7 +300,7 @@ int intv_cart_slot_device::load_fullpath()
{
// This code is a blatant hack, due to impossibility to load a separate .cfg file in MESS.
// It shall be eventually replaced by the .xml loading
-
+
// extrainfo format
// 1. mapper number (to deal with bankswitch). no bankswitch is mapper 0 (most games).
// 2.->5. current images have at most 4 chunks of data. we store here block size and location to load
@@ -314,7 +314,7 @@ int intv_cart_slot_device::load_fullpath()
m_cart->rom_alloc(0x20000, tag());
ROM = (UINT8 *)m_cart->get_rom_base();
-
+
if (!hashfile_extrainfo(*this, extrainfo))
{
// If no extrainfo, we assume a single 0x2000 chunk at 0x5000
@@ -329,12 +329,12 @@ int intv_cart_slot_device::load_fullpath()
else
{
sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
- &rom[3], &ram, &extra);
+ &rom[3], &ram, &extra);
//printf("extrainfo: %d %d %d %d %d %d %d \n", mapper, rom[0], rom[1], rom[2], rom[3], ram, extra);
-
+
if (mapper)
logerror("Bankswitch not yet implemented!\n");
-
+
if (ram)
{
start = ((ram & 0xf0) >> 4) * 0x1000;
@@ -355,25 +355,25 @@ int intv_cart_slot_device::load_fullpath()
}
if (extra & INTELLIVOICE_MASK)
{
- printf("WARNING: This game requires emulation of the IntelliVoice module.\n");
+ printf("WARNING: This game requires emulation of the IntelliVoice module.\n");
}
-
+
if (extra & ECS_MASK)
{
printf("WARNING: This game requires emulation of the ECS module.\n");
}
-
+
for (int j = 0; j < 4; j++)
{
start = ((rom[j] & 0xf0) >> 4) * 0x1000;
size = (rom[j] & 0x0f) * 0x800;
- // some cart has to be loaded to 0x4800, but none of the available ones goes to 0x4000.
+ // some cart has to be loaded to 0x4800, but none of the available ones goes to 0x4000.
// Hence, we use 0x04 << 4 in extrainfo (to reduce the stored values) and fix the value here.
if (start == 0x4000) start += 0x800;
-
+
// logerror("step %d: %d %d \n", j, start / 0x1000, size / 0x1000);
-
+
for (int i = 0; i < size; i++)
{
fread(&low_byte, 1);
@@ -383,7 +383,7 @@ int intv_cart_slot_device::load_fullpath()
}
}
}
-
+
return IMAGE_INIT_PASS;
}
}
@@ -408,7 +408,7 @@ bool intv_cart_slot_device::call_load()
// so if we are loading one of these, we allocate additional 0x2000 bytes for the paged bank
if (m_type == INTV_WSMLB)
extra_bank = true;
-
+
UINT32 size = 0;
UINT16 address = 0;
UINT8 *ROM, *region;
@@ -423,7 +423,7 @@ bool intv_cart_slot_device::call_load()
if (size)
{
region = get_software_region(region_name[i]);
-
+
for (int j = 0; j < size / 2; j++)
{
ROM[((address + j) << 1) + 1] = region[2 * j];
@@ -467,7 +467,7 @@ void intv_cart_slot_device::get_default_card_software(astring &result)
UINT32 len = core_fsize(m_file);
dynamic_buffer rom(len);
int type = INTV_STD;
-
+
core_fread(m_file, rom, len);
if (rom[0] == 0xa8 && (rom[1] == (rom[2] ^ 0xff)))
@@ -480,12 +480,12 @@ void intv_cart_slot_device::get_default_card_software(astring &result)
int start;
int mapper, rom[5], ram, extra;
astring extrainfo;
-
+
if (hashfile_extrainfo(*this, extrainfo))
{
sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
- &rom[3], &ram, &extra);
-
+ &rom[3], &ram, &extra);
+
if (ram)
{
start = ((ram & 0xf0) >> 4) * 0x1000;
@@ -495,7 +495,7 @@ void intv_cart_slot_device::get_default_card_software(astring &result)
type = INTV_GFACT;
}
}
-
+
}
slot_string = intv_get_slot(type);
@@ -567,6 +567,5 @@ SLOT_INTERFACE_START(intv_cart)
SLOT_INTERFACE_INTERNAL("intv_wsmlb", INTV_ROM_WSMLB)
SLOT_INTERFACE_INTERNAL("intv_voice", INTV_ROM_VOICE)
SLOT_INTERFACE_INTERNAL("intv_ecs", INTV_ROM_ECS)
-// SLOT_INTERFACE_INTERNAL("intv_keycomp", INTV_ROM_KEYCOMP)
+// SLOT_INTERFACE_INTERNAL("intv_keycomp", INTV_ROM_KEYCOMP)
SLOT_INTERFACE_END
-
diff --git a/src/emu/bus/intv/slot.h b/src/emu/bus/intv/slot.h
index e14243f190f..03b3792349b 100644
--- a/src/emu/bus/intv/slot.h
+++ b/src/emu/bus/intv/slot.h
@@ -11,7 +11,7 @@ enum
{
INTV_STD = 0,
INTV_RAM,
- INTV_GFACT, // has RAM too but at diff offset
+ INTV_GFACT, // has RAM too but at diff offset
INTV_WSMLB,
INTV_VOICE,
INTV_ECS,
@@ -51,7 +51,7 @@ public:
virtual DECLARE_READ16_MEMBER(read_ram) { return 0xffff; }
virtual DECLARE_WRITE16_MEMBER(write_ram) {}
-
+
// Used by IntelliVoice & ECS
virtual DECLARE_READ16_MEMBER(read_ay) { return 0xffff; }
virtual DECLARE_WRITE16_MEMBER(write_ay) {}
@@ -71,7 +71,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
virtual void late_subslot_setup() {}
protected:
@@ -105,7 +105,7 @@ public:
int get_type() { return m_type; }
int load_fullpath();
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -136,7 +136,7 @@ public:
virtual DECLARE_READ16_MEMBER(read_romd0) { if (m_cart) return m_cart->read_romd0(space, offset, mem_mask); else return 0xffff; }
virtual DECLARE_READ16_MEMBER(read_rome0) { if (m_cart) return m_cart->read_rome0(space, offset, mem_mask); else return 0xffff; }
virtual DECLARE_READ16_MEMBER(read_romf0) { if (m_cart) return m_cart->read_romf0(space, offset, mem_mask); else return 0xffff; }
-
+
virtual DECLARE_READ16_MEMBER(read_ay);
virtual DECLARE_WRITE16_MEMBER(write_ay);
virtual DECLARE_READ16_MEMBER(read_speech);
@@ -176,8 +176,7 @@ extern const device_type INTV_CART_SLOT;
#define MCFG_INTV_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, INTV_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
SLOT_INTERFACE_EXTERN(intv_cart);
diff --git a/src/emu/bus/intv/voice.h b/src/emu/bus/intv/voice.h
index 9ba16aef358..96e92bbf44c 100644
--- a/src/emu/bus/intv/voice.h
+++ b/src/emu/bus/intv/voice.h
@@ -13,7 +13,7 @@ class intv_voice_device : public intv_rom_device
public:
// construction/destruction
intv_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
@@ -23,7 +23,7 @@ public:
// actual IntelliVoice access
virtual DECLARE_READ16_MEMBER(read_speech);
virtual DECLARE_WRITE16_MEMBER(write_speech);
-
+
// passthru access
virtual DECLARE_READ16_MEMBER(read_rom04) { return m_subslot->read_rom04(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom20) { return m_subslot->read_rom20(space, offset, mem_mask); }
@@ -33,34 +33,34 @@ public:
virtual DECLARE_READ16_MEMBER(read_rom60) { return m_subslot->read_rom60(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom70) { return m_subslot->read_rom70(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom80)
- {
+ {
if (m_ram88_enabled && offset >= 0x800)
- return m_subslot->read_ram(space, offset & 0x7ff, mem_mask);
+ return m_subslot->read_ram(space, offset & 0x7ff, mem_mask);
else
- return m_subslot->read_rom80(space, offset, mem_mask);
+ return m_subslot->read_rom80(space, offset, mem_mask);
}
virtual DECLARE_READ16_MEMBER(read_rom90) { return m_subslot->read_rom90(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_roma0) { return m_subslot->read_roma0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romb0) { return m_subslot->read_romb0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romc0) { return m_subslot->read_romc0(space, offset, mem_mask); }
- virtual DECLARE_READ16_MEMBER(read_romd0)
- {
+ virtual DECLARE_READ16_MEMBER(read_romd0)
+ {
if (m_ramd0_enabled && offset < 0x800)
- return m_subslot->read_ram(space, offset, mem_mask);
+ return m_subslot->read_ram(space, offset, mem_mask);
else
- return m_subslot->read_romd0(space, offset, mem_mask);
+ return m_subslot->read_romd0(space, offset, mem_mask);
}
virtual DECLARE_READ16_MEMBER(read_rome0) { return m_subslot->read_rome0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romf0) { return m_subslot->read_romf0(space, offset, mem_mask); }
-
+
// RAM passthru write
virtual DECLARE_WRITE16_MEMBER(write_88) { if (m_ram88_enabled) m_subslot->write_ram(space, offset, data, mem_mask); }
virtual DECLARE_WRITE16_MEMBER(write_d0) { if (m_ramd0_enabled) m_subslot->write_ram(space, offset, data, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_ram) { return m_subslot->read_ram(space, offset, mem_mask); }
virtual DECLARE_WRITE16_MEMBER(write_ram) { m_subslot->write_ram(space, offset, data, mem_mask); }
-
+
virtual void late_subslot_setup();
-
+
private:
required_device<sp0256_device> m_speech;
required_device<intv_cart_slot_device> m_subslot;
diff --git a/src/emu/bus/isa/sb16.c b/src/emu/bus/isa/sb16.c
index 9c4e39d92b9..cff27627c2c 100644
--- a/src/emu/bus/isa/sb16.c
+++ b/src/emu/bus/isa/sb16.c
@@ -370,12 +370,12 @@ ROM_END
static ADDRESS_MAP_START(sb16_io, AS_IO, 8, sb16_lle_device)
AM_RANGE(0x0000, 0x0000) AM_MIRROR(0xff00) AM_READWRITE(dsp_data_r, dsp_data_w)
-// AM_RANGE(0x0001, 0x0001) // MIDI related?
-// AM_RANGE(0x0002, 0x0002)
+// AM_RANGE(0x0001, 0x0001) // MIDI related?
+// AM_RANGE(0x0002, 0x0002)
AM_RANGE(0x0004, 0x0004) AM_MIRROR(0xff00) AM_READWRITE(mode_r, mode_w)
AM_RANGE(0x0005, 0x0005) AM_MIRROR(0xff00) AM_READWRITE(dac_ctrl_r, dac_ctrl_w)
AM_RANGE(0x0006, 0x0006) AM_MIRROR(0xff00) AM_READ(dma_stat_r)
-// AM_RANGE(0x0007, 0x0007) // unknown
+// AM_RANGE(0x0007, 0x0007) // unknown
AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff00) AM_READWRITE(ctrl8_r, ctrl8_w)
AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xff00) AM_WRITE(rate_w)
AM_RANGE(0x000A, 0x000A) AM_MIRROR(0xff00) AM_READ(dma8_cnt_lo_r)
@@ -393,9 +393,9 @@ static ADDRESS_MAP_START(sb16_io, AS_IO, 8, sb16_lle_device)
AM_RANGE(0x001B, 0x001B) AM_MIRROR(0xff00) AM_READ(adc_data_r)
AM_RANGE(0x001D, 0x001D) AM_MIRROR(0xff00) AM_WRITE(dma8_w)
AM_RANGE(0x001F, 0x001F) AM_MIRROR(0xff00) AM_READ(dma8_r)
-// AM_RANGE(0x0080, 0x0080) // ASP comms
-// AM_RANGE(0x0081, 0x0081)
-// AM_RANGE(0x0082, 0x0082)
+// AM_RANGE(0x0080, 0x0080) // ASP comms
+// AM_RANGE(0x0081, 0x0081)
+// AM_RANGE(0x0082, 0x0082)
AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READWRITE(p1_r, p1_w)
AM_RANGE(MCS51_PORT_P2, MCS51_PORT_P2) AM_READWRITE(p2_r, p2_w)
ADDRESS_MAP_END
diff --git a/src/emu/bus/isa/svga_trident.c b/src/emu/bus/isa/svga_trident.c
index f5885769e2a..feea3722dde 100644
--- a/src/emu/bus/isa/svga_trident.c
+++ b/src/emu/bus/isa/svga_trident.c
@@ -87,10 +87,10 @@ void isa8_svga_tgui9680_device::device_start()
m_isa->install_memory(0xa0000, 0xbffff, 0, 0, read8_delegate(FUNC(trident_vga_device::mem_r),m_vga), write8_delegate(FUNC(trident_vga_device::mem_w),m_vga));
// uncomment to test Windows 3.1 TGUI9440AGi driver
-// m_isa->install_memory(0x4400000, 0x45fffff, 0, 0, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga));
+// m_isa->install_memory(0x4400000, 0x45fffff, 0, 0, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga));
// win95 drivers
-// m_isa->install_memory(0x4000000, 0x41fffff, 0, 0, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga));
+// m_isa->install_memory(0x4000000, 0x41fffff, 0, 0, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga));
// acceleration ports
m_isa->install_device(0x2120, 0x21ff, 0, 0, read8_delegate(FUNC(trident_vga_device::accel_r),m_vga), write8_delegate(FUNC(trident_vga_device::accel_w),m_vga));
diff --git a/src/emu/bus/isa/trident.c b/src/emu/bus/isa/trident.c
index 2ed9c76bbbd..a4afa62d9f8 100644
--- a/src/emu/bus/isa/trident.c
+++ b/src/emu/bus/isa/trident.c
@@ -45,21 +45,21 @@ UINT8 trident_vga_device::READPIXEL8(INT16 x, INT16 y)
UINT16 trident_vga_device::READPIXEL15(INT16 x, INT16 y)
{
return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*2) % vga.svga_intf.vram_size] |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8));
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8));
}
UINT16 trident_vga_device::READPIXEL16(INT16 x, INT16 y)
{
return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*2) % vga.svga_intf.vram_size] |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8));
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8));
}
UINT32 trident_vga_device::READPIXEL32(INT16 x, INT16 y)
{
return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*4) % vga.svga_intf.vram_size] |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+1) % vga.svga_intf.vram_size] << 8) |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+2) % vga.svga_intf.vram_size] << 16) |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+3) % vga.svga_intf.vram_size] << 24));
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+1) % vga.svga_intf.vram_size] << 8) |
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+2) % vga.svga_intf.vram_size] << 16) |
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+3) % vga.svga_intf.vram_size] << 24));
}
void trident_vga_device::WRITEPIXEL8(INT16 x, INT16 y, UINT8 data)
@@ -249,9 +249,9 @@ UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bi
for(x=0;x<cursor_size;x++)
{
UINT32 bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size]
- | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)
- | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 16)
- | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 24));
+ | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)
+ | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 16)
+ | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 24));
UINT32 bita = (vga.memory[(src+7) % vga.svga_intf.vram_size]
| ((vga.memory[(src+6) % vga.svga_intf.vram_size]) << 8)
| ((vga.memory[(src+5) % vga.svga_intf.vram_size]) << 16)
@@ -1131,60 +1131,60 @@ UINT8 trident_vga_device::old_mmio_r(address_space& space, UINT32 offset)
/*
Graphics Engine for 9440/9660/9680
-#define GER_STATUS 0x2120
-#define GE_BUSY 0x80
-#define GER_OPERMODE 0x2122 Byte for 9440, Word for 96xx
-#define DST_ENABLE 0x200 // Destination Transparency
-#define GER_COMMAND 0x2124
-#define GE_NOP 0x00 // No Operation
-#define GE_BLT 0x01 // BitBLT ROP3 only
-#define GE_BLT_ROP4 0x02 // BitBLT ROP4 (96xx only)
-#define GE_SCANLINE 0x03 // Scan Line
-#define GE_BRESLINE 0x04 // Bresenham Line
-#define GE_SHVECTOR 0x05 // Short Vector
-#define GE_FASTLINE 0x06 // Fast Line (96xx only)
-#define GE_TRAPEZ 0x07 // Trapezoidal fill (96xx only)
-#define GE_ELLIPSE 0x08 // Ellipse (96xx only) (RES)
-#define GE_ELLIP_FILL 0x09 // Ellipse Fill (96xx only) (RES)
-#define GER_FMIX 0x2127
-#define GER_DRAWFLAG 0x2128 // long
-#define FASTMODE 1<<28
-#define STENCIL 0x8000
-#define SOLIDFILL 0x4000
-#define TRANS_ENABLE 0x1000
-#define TRANS_REVERSE 0x2000
-#define YMAJ 0x0400
-#define XNEG 0x0200
-#define YNEG 0x0100
-#define SRCMONO 0x0040
-#define PATMONO 0x0020
-#define SCR2SCR 0x0004
-#define PAT2SCR 0x0002
-#define GER_FCOLOUR 0x212C // Word for 9440, long for 96xx
-#define GER_BCOLOUR 0x2130 // Word for 9440, long for 96xx
-#define GER_PATLOC 0x2134 // Word
-#define GER_DEST_XY 0x2138
-#define GER_DEST_X 0x2138 // Word
-#define GER_DEST_Y 0x213A // Word
-#define GER_SRC_XY 0x213C
-#define GER_SRC_X 0x213C // Word
-#define GER_SRC_Y 0x213E // Word
-#define GER_DIM_XY 0x2140
-#define GER_DIM_X 0x2140 // Word
-#define GER_DIM_Y 0x2142 // Word
-#define GER_STYLE 0x2144 // Long
-#define GER_CKEY 0x2168 // Long
-#define GER_FPATCOL 0x2178
-#define GER_BPATCOL 0x217C
-#define GER_PATTERN 0x2180 // from 0x2180 to 0x21FF
+#define GER_STATUS 0x2120
+#define GE_BUSY 0x80
+#define GER_OPERMODE 0x2122 Byte for 9440, Word for 96xx
+#define DST_ENABLE 0x200 // Destination Transparency
+#define GER_COMMAND 0x2124
+#define GE_NOP 0x00 // No Operation
+#define GE_BLT 0x01 // BitBLT ROP3 only
+#define GE_BLT_ROP4 0x02 // BitBLT ROP4 (96xx only)
+#define GE_SCANLINE 0x03 // Scan Line
+#define GE_BRESLINE 0x04 // Bresenham Line
+#define GE_SHVECTOR 0x05 // Short Vector
+#define GE_FASTLINE 0x06 // Fast Line (96xx only)
+#define GE_TRAPEZ 0x07 // Trapezoidal fill (96xx only)
+#define GE_ELLIPSE 0x08 // Ellipse (96xx only) (RES)
+#define GE_ELLIP_FILL 0x09 // Ellipse Fill (96xx only) (RES)
+#define GER_FMIX 0x2127
+#define GER_DRAWFLAG 0x2128 // long
+#define FASTMODE 1<<28
+#define STENCIL 0x8000
+#define SOLIDFILL 0x4000
+#define TRANS_ENABLE 0x1000
+#define TRANS_REVERSE 0x2000
+#define YMAJ 0x0400
+#define XNEG 0x0200
+#define YNEG 0x0100
+#define SRCMONO 0x0040
+#define PATMONO 0x0020
+#define SCR2SCR 0x0004
+#define PAT2SCR 0x0002
+#define GER_FCOLOUR 0x212C // Word for 9440, long for 96xx
+#define GER_BCOLOUR 0x2130 // Word for 9440, long for 96xx
+#define GER_PATLOC 0x2134 // Word
+#define GER_DEST_XY 0x2138
+#define GER_DEST_X 0x2138 // Word
+#define GER_DEST_Y 0x213A // Word
+#define GER_SRC_XY 0x213C
+#define GER_SRC_X 0x213C // Word
+#define GER_SRC_Y 0x213E // Word
+#define GER_DIM_XY 0x2140
+#define GER_DIM_X 0x2140 // Word
+#define GER_DIM_Y 0x2142 // Word
+#define GER_STYLE 0x2144 // Long
+#define GER_CKEY 0x2168 // Long
+#define GER_FPATCOL 0x2178
+#define GER_BPATCOL 0x217C
+#define GER_PATTERN 0x2180 // from 0x2180 to 0x21FF
Additional - Graphics Engine for 96xx
-#define GER_SRCCLIP_XY 0x2148
-#define GER_SRCCLIP_X 0x2148 // Word
-#define GER_SRCCLIP_Y 0x214A // Word
-#define GER_DSTCLIP_XY 0x214C
-#define GER_DSTCLIP_X 0x214C // Word
-#define GER_DSTCLIP_Y 0x214E // Word
+#define GER_SRCCLIP_XY 0x2148
+#define GER_SRCCLIP_X 0x2148 // Word
+#define GER_SRCCLIP_Y 0x214A // Word
+#define GER_DSTCLIP_XY 0x214C
+#define GER_DSTCLIP_X 0x214C // Word
+#define GER_DSTCLIP_Y 0x214E // Word
*/
READ8_MEMBER(trident_vga_device::accel_r)
diff --git a/src/emu/bus/megadrive/ggenie.c b/src/emu/bus/megadrive/ggenie.c
index 1f1dc8ceab1..62ebfbb55aa 100644
--- a/src/emu/bus/megadrive/ggenie.c
+++ b/src/emu/bus/megadrive/ggenie.c
@@ -5,17 +5,17 @@
based on Charles MacDonald's docs: http://cgfm2.emuviews.com/txt/genie.txt
-
+
There is an interesting difference between Rev.0 and Rev.A
- After the codes has been entered, the former just performs
- a last write to the MODE register (m_gg_regs[0]) which both
- sets the enable bits for the 6 available cheats (in the low
- 8 bits) and locks the GG so that later reads goes to the
+ After the codes has been entered, the former just performs
+ a last write to the MODE register (m_gg_regs[0]) which both
+ sets the enable bits for the 6 available cheats (in the low
+ 8 bits) and locks the GG so that later reads goes to the
piggyback cart. The latter revision, instead, performs the
- same operations in two subsequent 8bit writes, accessing
+ same operations in two subsequent 8bit writes, accessing
separately the low and high bits of the register.
-
+
***********************************************************************************************************/
#include "emu.h"
@@ -86,7 +86,7 @@ READ16_MEMBER(md_rom_ggenie_device::read)
return m_gg_data[5];
else
return m_exp->m_cart->read(space, offset);
- }
+ }
else
return 0xffff;
}
@@ -114,7 +114,7 @@ WRITE16_MEMBER(md_rom_ggenie_device::write)
else
{
m_gg_bypass = 0;
-
+
// bit9 set = read goes to ASIC registers
if (data & 0x200)
m_reg_enable = 1;
@@ -122,7 +122,7 @@ WRITE16_MEMBER(md_rom_ggenie_device::write)
else
m_reg_enable = 0;
}
-
+
// LOCK bit
if (data & 0x100)
{
@@ -133,7 +133,7 @@ WRITE16_MEMBER(md_rom_ggenie_device::write)
m_gg_addr[3] = ((m_gg_regs[11] & 0x3f) << 16) | m_gg_regs[12];
m_gg_addr[4] = ((m_gg_regs[14] & 0x3f) << 16) | m_gg_regs[15];
m_gg_addr[5] = ((m_gg_regs[17] & 0x3f) << 16) | m_gg_regs[18];
-
+
// data
m_gg_data[0] = m_gg_regs[4];
m_gg_data[1] = m_gg_regs[7];
@@ -144,9 +144,9 @@ WRITE16_MEMBER(md_rom_ggenie_device::write)
//printf("mode %X\n", data);
//for (int i = 0; i < 6; i++)
- // printf("addr %d = 0x%X - data 0x%X\n", i, m_gg_addr[i], m_gg_data[i]);
+ // printf("addr %d = 0x%X - data 0x%X\n", i, m_gg_addr[i], m_gg_data[i]);
}
- }
+ }
else if (offset == 1)
{
// RESET
diff --git a/src/emu/bus/msx_cart/disk.c b/src/emu/bus/msx_cart/disk.c
index a49285fc28e..93def4a5adf 100644
--- a/src/emu/bus/msx_cart/disk.c
+++ b/src/emu/bus/msx_cart/disk.c
@@ -164,7 +164,7 @@ msx_cart_fsfd1::msx_cart_fsfd1(const machine_config &mconfig, const char *tag, d
msx_cart_fscf351::msx_cart_fscf351(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : msx_cart_disk_type2(mconfig, MSX_CART_FSCF351, "MSX Cartridge - FS-CF351", tag, owner, clock, "msx_cart_fscf351")
+ : msx_cart_disk_type2(mconfig, MSX_CART_FSCF351, "MSX Cartridge - FS-CF351", tag, owner, clock, "msx_cart_fscf351")
{
}
@@ -624,4 +624,3 @@ WRITE8_MEMBER(msx_cart_fsfd1a::write_cart)
break;
}
}
-
diff --git a/src/emu/bus/msx_slot/disk.c b/src/emu/bus/msx_slot/disk.c
index 04f398ef6ef..998ab6e9899 100644
--- a/src/emu/bus/msx_slot/disk.c
+++ b/src/emu/bus/msx_slot/disk.c
@@ -677,7 +677,7 @@ void msx_slot_disk6_device::post_load()
void msx_slot_disk6_device::select_drive()
{
- if (m_drive_select1)
+ if (m_drive_select1)
{
m_floppy = m_floppy1 ? m_floppy1->get_device() : NULL;
if (!m_floppy)
@@ -809,4 +809,3 @@ WRITE8_MEMBER(msx_slot_disk6_device::write)
break;
}
}
-
diff --git a/src/emu/bus/nes/disksys.c b/src/emu/bus/nes/disksys.c
index 23eee5c4573..ae95074102c 100644
--- a/src/emu/bus/nes/disksys.c
+++ b/src/emu/bus/nes/disksys.c
@@ -11,7 +11,7 @@
Famicom Disk System.
Based on info from NESDev wiki ( http://wiki.nesdev.com/w/index.php/Family_Computer_Disk_System )
-
+
TODO:
- convert floppy drive + fds format to modern code!
- add sound bits
@@ -124,14 +124,14 @@ void nes_disksys_device::device_start()
irq_timer = timer_alloc(TIMER_IRQ);
irq_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1));
-
+
save_item(NAME(m_fds_motor_on));
save_item(NAME(m_fds_door_closed));
save_item(NAME(m_fds_current_side));
save_item(NAME(m_fds_head_position));
save_item(NAME(m_fds_status0));
save_item(NAME(m_read_mode));
- save_item(NAME(m_drive_ready));
+ save_item(NAME(m_drive_ready));
save_item(NAME(m_irq_enable));
save_item(NAME(m_irq_transfer));
save_item(NAME(m_irq_count));
@@ -173,8 +173,8 @@ void nes_disksys_device::pcb_reset()
RAM is in 0x6000-0xdfff (32K)
ROM is in 0xe000-0xffff (8K)
-
- registers + disk drive are accessed in
+
+ registers + disk drive are accessed in
0x4020-0x403f (read_ex/write_ex below)
-------------------------------------------------*/
@@ -210,7 +210,7 @@ READ8_MEMBER(nes_disksys_device::read_m)
}
void nes_disksys_device::hblank_irq(int scanline, int vblank, int blanked)
-{
+{
if (m_irq_transfer)
m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
}
@@ -218,7 +218,7 @@ void nes_disksys_device::hblank_irq(int scanline, int vblank, int blanked)
WRITE8_MEMBER(nes_disksys_device::write_ex)
{
LOG_MMC(("Famicom Disk System write_ex, offset: %04x, data: %02x\n", offset, data));
-
+
if (offset >= 0x20 && offset < 0x60)
{
// wavetable
@@ -255,34 +255,34 @@ WRITE8_MEMBER(nes_disksys_device::write_ex)
// bit4 - CRC control (set during CRC calculation of transfer)
// bit5 - Always set to '1'
// bit6 - Read/Write Start (Set to 1 when the drive becomes ready for read/write)
- // bit7 - Interrupt Transfer (0: Transfer without using IRQ; 1: Enable IRQ when
+ // bit7 - Interrupt Transfer (0: Transfer without using IRQ; 1: Enable IRQ when
// the drive becomes ready)
m_fds_motor_on = BIT(data, 0);
-
+
if (BIT(data, 1))
m_fds_head_position = 0;
-
+
if (!(data & 0x40) && m_drive_ready && m_fds_head_position > 2)
m_fds_head_position -= 2; // ??? is this some sort of compensation??
-
+
m_read_mode = BIT(data, 2);
- set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
m_drive_ready = data & 0x40;
m_irq_transfer = BIT(data, 7);
break;
case 0x06:
// external connector
break;
- case 0x60: // $4080 - Volume envelope - read through $4090
- case 0x62: // $4082 - Frequency low
- case 0x63: // $4083 - Frequency high
- case 0x64: // $4084 - Mod envelope - read through $4092
- case 0x65: // $4085 - Mod counter
- case 0x66: // $4086 - Mod frequency low
- case 0x67: // $4087 - Mod frequency high
- case 0x68: // $4088 - Mod table write
- case 0x69: // $4089 - Wave write / master volume
- case 0x6a: // $408a - Envelope speed
+ case 0x60: // $4080 - Volume envelope - read through $4090
+ case 0x62: // $4082 - Frequency low
+ case 0x63: // $4083 - Frequency high
+ case 0x64: // $4084 - Mod envelope - read through $4092
+ case 0x65: // $4085 - Mod counter
+ case 0x66: // $4086 - Mod frequency low
+ case 0x67: // $4087 - Mod frequency high
+ case 0x68: // $4088 - Mod table write
+ case 0x69: // $4089 - Wave write / master volume
+ case 0x6a: // $408a - Envelope speed
break;
}
}
@@ -299,11 +299,11 @@ READ8_MEMBER(nes_disksys_device::read_ex)
switch (offset)
{
- case 0x10:
+ case 0x10:
// $4030 - disk status 0
// bit0 - Timer Interrupt (1: an IRQ occurred)
- // bit1 - Byte transfer flag (Set to 1 every time 8 bits have been transfered between
- // the RAM adaptor & disk drive through $4024/$4031; Reset to 0 when $4024,
+ // bit1 - Byte transfer flag (Set to 1 every time 8 bits have been transfered between
+ // the RAM adaptor & disk drive through $4024/$4031; Reset to 0 when $4024,
// $4031, or $4030 has been serviced)
// bit4 - CRC control (0: CRC passed; 1: CRC error)
// bit6 - End of Head (1 when disk head is on the most inner track)
@@ -312,7 +312,7 @@ READ8_MEMBER(nes_disksys_device::read_ex)
// clear the disk IRQ detect flag
m_fds_status0 &= ~0x01;
break;
- case 0x11:
+ case 0x11:
// $4031 - data latch
// don't read data if disk is unloaded
if (!m_fds_data)
@@ -330,8 +330,8 @@ READ8_MEMBER(nes_disksys_device::read_ex)
else
ret = 0;
break;
- case 0x12:
- // $4032 - disk status 1:
+ case 0x12:
+ // $4032 - disk status 1:
// bit0 - Disk flag (0: Disk inserted; 1: Disk not inserted)
// bit1 - Ready flag (0: Disk ready; 1: Disk not ready)
// bit2 - Protect flag (0: Not write protected; 1: Write protected or disk ejected)
@@ -351,17 +351,17 @@ READ8_MEMBER(nes_disksys_device::read_ex)
else
ret = (m_fds_current_side == 0) ? 1 : 0; // 0 if a disk is inserted
break;
- case 0x13:
+ case 0x13:
// $4033 - external connector (bits 0-6) + battery status (bit 7)
ret = 0x80;
break;
- case 0x70: // $4090 - Volume gain - write through $4080
- case 0x72: // $4092 - Mod gain - read through $4084
+ case 0x70: // $4090 - Volume gain - write through $4080
+ case 0x72: // $4092 - Mod gain - read through $4084
default:
ret = 0x00;
break;
}
-
+
return ret;
}
@@ -372,7 +372,7 @@ READ8_MEMBER(nes_disksys_device::read_ex)
void nes_disksys_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
if (id == TIMER_IRQ)
- {
+ {
if (m_irq_enable && m_irq_count)
{
m_irq_count--;
@@ -381,7 +381,7 @@ void nes_disksys_device::device_timer(emu_timer &timer, device_timer_id id, int
m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
m_irq_enable = 0;
m_fds_status0 |= 0x01;
- m_irq_count_latch = 0; // used in Kaettekita Mario Bros
+ m_irq_count_latch = 0; // used in Kaettekita Mario Bros
}
}
}
@@ -399,7 +399,7 @@ void nes_disksys_device::disk_flip_side()
if (m_fds_current_side == 0)
popmessage("No disk inserted.");
else
- popmessage("Disk set to side %d", m_fds_current_side);
+ popmessage("Disk set to side %d", m_fds_current_side);
}
@@ -410,15 +410,15 @@ void nes_disksys_device::load_disk(device_image_interface &image)
{
int header = 0;
m_fds_sides = 0;
-
+
if (image.length() % 65500)
header = 0x10;
-
+
m_fds_sides = (image.length() - header) / 65500;
-
+
if (!m_fds_data)
m_fds_data = auto_alloc_array(machine(), UINT8, m_fds_sides * 65500);
-
+
// if there is an header, skip it
image.fseek(header, SEEK_SET);
image.fread(m_fds_data, 65500 * m_fds_sides);
@@ -430,4 +430,3 @@ void nes_disksys_device::unload_disk(device_image_interface &image)
/* TODO: should write out changes here as well */
m_fds_sides = 0;
}
-
diff --git a/src/emu/bus/nes/nes_slot.c b/src/emu/bus/nes/nes_slot.c
index bcd22d74381..89107fb1664 100644
--- a/src/emu/bus/nes/nes_slot.c
+++ b/src/emu/bus/nes/nes_slot.c
@@ -161,9 +161,9 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
printf("Warning! The loaded PRG has size not a multiple of 8KB (0x%X)\n", (UINT32)size);
m_prg_chunks--;
}
-
+
m_prg_mask = ((m_prg_chunks << 1) - 1);
-
+
// printf("first mask %x!\n", m_prg_mask);
if ((m_prg_chunks << 1) & m_prg_mask)
{
@@ -172,7 +172,7 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
// only half a dozen of NES carts have PRG which is not a power of 2
// so we use this bank_map only as an exception
// printf("uneven rom!\n");
-
+
// 1. redefine mask as (next power of 2)-1
for (; temp; )
{
@@ -182,15 +182,15 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
m_prg_mask = (1 << mask_bits) - 1;
// printf("new mask %x!\n", m_prg_mask);
mapsize = (1 << mask_bits)/2;
-
+
// 2. create a bank_map for banks in the range mask/2 -> mask
m_prg_bank_map.resize(mapsize);
-
+
// 3. fill the bank_map accounting for mirrors
int j;
for (j = mapsize; j < (m_prg_chunks << 1); j++)
m_prg_bank_map[j - mapsize] = j;
-
+
while (j % mapsize)
{
int k = 0, repeat_banks;
@@ -201,7 +201,7 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
m_prg_bank_map[(j - mapsize) + l] = m_prg_bank_map[(j - mapsize) + l - repeat_banks];
j += repeat_banks;
}
-
+
// check bank map!
// for (int i = 0; i < mapsize; i++)
// {
@@ -674,7 +674,7 @@ void device_nes_cart_interface::pcb_start(running_machine &machine, UINT8 *ciram
// main NES CPU here, even if it does not belong to this device.
m_maincpu = machine.device<cpu_device>("maincpu");
- if (cart_mounted) // disksys expansion can arrive here without the memory banks!
+ if (cart_mounted) // disksys expansion can arrive here without the memory banks!
{
// Setup PRG
m_prg_bank_mem[0] = machine.root_device().membank("prg0");
@@ -691,11 +691,11 @@ void device_nes_cart_interface::pcb_start(running_machine &machine, UINT8 *ciram
}
}
}
-
+
// Setup CHR (VRAM can be present also without PRG rom)
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
chr8(0, m_chr_source);
-
+
// Setup NT
m_ciram = ciram_ptr;
diff --git a/src/emu/bus/nes/nes_slot.h b/src/emu/bus/nes/nes_slot.h
index 02e017b0923..9c73d95d17d 100644
--- a/src/emu/bus/nes/nes_slot.h
+++ b/src/emu/bus/nes/nes_slot.h
@@ -376,10 +376,10 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_m);
virtual DECLARE_WRITE8_MEMBER(write_h);
virtual DECLARE_WRITE8_MEMBER(write_ex);
-
+
// hack until disk system is made modern!
virtual void disk_flip_side() { if (m_cart) m_cart->disk_flip_side(); }
-
+
int get_pcb_id() { return m_pcb_id; };
void pcb_start(UINT8 *ciram_ptr);
diff --git a/src/emu/bus/odyssey2/chess.h b/src/emu/bus/odyssey2/chess.h
index 8b71f56ed93..66015c033cb 100644
--- a/src/emu/bus/odyssey2/chess.h
+++ b/src/emu/bus/odyssey2/chess.h
@@ -12,10 +12,9 @@
class o2_chess_device : public o2_rom_device
{
-
virtual machine_config_constructor device_mconfig_additions() const;
-// virtual const rom_entry *device_rom_region() const;
-
+// virtual const rom_entry *device_rom_region() const;
+
public:
// construction/destruction
o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
diff --git a/src/emu/bus/odyssey2/rom.c b/src/emu/bus/odyssey2/rom.c
index da0f02f6941..d741dcdd802 100644
--- a/src/emu/bus/odyssey2/rom.c
+++ b/src/emu/bus/odyssey2/rom.c
@@ -50,12 +50,12 @@ o2_rom16_device::o2_rom16_device(const machine_config &mconfig, const char *tag,
//-------------------------------------------------
void o2_rom_device::device_start()
-{
+{
save_item(NAME(m_bank_base));
}
void o2_rom_device::device_reset()
-{
+{
m_bank_base = 0;
}
@@ -94,4 +94,3 @@ READ8_MEMBER(o2_rom16_device::read_rom0c)
{
return m_rom[offset + 0xc00 + (m_bank_base & 0x03) * 0x1000];
}
-
diff --git a/src/emu/bus/odyssey2/rom.h b/src/emu/bus/odyssey2/rom.h
index 52b08a0e5e4..7a4af0a32b5 100644
--- a/src/emu/bus/odyssey2/rom.h
+++ b/src/emu/bus/odyssey2/rom.h
@@ -15,17 +15,17 @@ public:
// construction/destruction
o2_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
o2_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom04);
virtual DECLARE_READ8_MEMBER(read_rom0c);
-
+
virtual void write_bank(int bank);
-
+
protected:
int m_bank_base;
};
@@ -37,7 +37,7 @@ class o2_rom12_device : public o2_rom_device
public:
// construction/destruction
o2_rom12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom04);
virtual DECLARE_READ8_MEMBER(read_rom0c);
@@ -50,7 +50,7 @@ class o2_rom16_device : public o2_rom_device
public:
// construction/destruction
o2_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom04);
virtual DECLARE_READ8_MEMBER(read_rom0c);
diff --git a/src/emu/bus/odyssey2/slot.c b/src/emu/bus/odyssey2/slot.c
index 12bde81adc1..c8dc8e053f5 100644
--- a/src/emu/bus/odyssey2/slot.c
+++ b/src/emu/bus/odyssey2/slot.c
@@ -166,7 +166,7 @@ bool o2_cart_slot_device::call_load()
{
UINT32 size = (software_entry() == NULL) ? length() : get_software_region_length("rom");
m_cart->rom_alloc(size, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), size);
else
@@ -223,7 +223,7 @@ void o2_cart_slot_device::get_default_card_software(astring &result)
type = O2_ROM12;
if (size == 16384)
type = O2_ROM16;
-
+
slot_string = o2_get_slot(type);
//printf("type: %s\n", slot_string);
@@ -278,4 +278,3 @@ SLOT_INTERFACE_START(o2_cart)
SLOT_INTERFACE_INTERNAL("o2_chess", O2_ROM_CHESS)
SLOT_INTERFACE_INTERNAL("o2_voice", O2_ROM_VOICE)
SLOT_INTERFACE_END
-
diff --git a/src/emu/bus/odyssey2/slot.h b/src/emu/bus/odyssey2/slot.h
index 4de4d26b9b0..fad028fc10a 100644
--- a/src/emu/bus/odyssey2/slot.h
+++ b/src/emu/bus/odyssey2/slot.h
@@ -92,7 +92,7 @@ public:
virtual DECLARE_WRITE8_MEMBER(io_write);
virtual DECLARE_READ8_MEMBER(t0_read) { if (m_cart) return m_cart->t0_read(space, offset); else return 0; }
- virtual void write_bank(int bank) { if (m_cart) m_cart->write_bank(bank); }
+ virtual void write_bank(int bank) { if (m_cart) m_cart->write_bank(bank); }
protected:
@@ -114,8 +114,7 @@ extern const device_type O2_CART_SLOT;
#define MCFG_O2_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, O2_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
SLOT_INTERFACE_EXTERN(o2_cart);
diff --git a/src/emu/bus/odyssey2/voice.c b/src/emu/bus/odyssey2/voice.c
index d229ab21934..c3f5fce565e 100644
--- a/src/emu/bus/odyssey2/voice.c
+++ b/src/emu/bus/odyssey2/voice.c
@@ -33,7 +33,7 @@ o2_voice_device::o2_voice_device(const machine_config &mconfig, const char *tag,
void o2_voice_device::device_start()
-{
+{
save_item(NAME(m_lrq_state));
}
diff --git a/src/emu/bus/odyssey2/voice.h b/src/emu/bus/odyssey2/voice.h
index 85339aa699f..83b8c532e1f 100644
--- a/src/emu/bus/odyssey2/voice.h
+++ b/src/emu/bus/odyssey2/voice.h
@@ -27,7 +27,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_rom04) { if (m_subslot->exists()) return m_subslot->read_rom04(space, offset); else return 0xff; }
virtual DECLARE_READ8_MEMBER(read_rom0c) { if (m_subslot->exists()) return m_subslot->read_rom0c(space, offset); else return 0xff; }
- virtual void write_bank(int bank) { if (m_subslot->exists()) m_subslot->write_bank(bank); }
+ virtual void write_bank(int bank) { if (m_subslot->exists()) m_subslot->write_bank(bank); }
DECLARE_WRITE_LINE_MEMBER(lrq_callback);
DECLARE_WRITE8_MEMBER(io_write);
diff --git a/src/emu/bus/pet/cb2snd.c b/src/emu/bus/pet/cb2snd.c
index b9e916b0e49..0ff4659a24c 100644
--- a/src/emu/bus/pet/cb2snd.c
+++ b/src/emu/bus/pet/cb2snd.c
@@ -65,4 +65,3 @@ DECLARE_WRITE_LINE_MEMBER( pet_userport_cb2_sound_device::input_m )
{
m_dac->write_unsigned8(state ? 0xff : 0x00);
}
-
diff --git a/src/emu/bus/rs232/xvd701.c b/src/emu/bus/rs232/xvd701.c
index 4484bb2ba36..a7a1ba40eab 100644
--- a/src/emu/bus/rs232/xvd701.c
+++ b/src/emu/bus/rs232/xvd701.c
@@ -93,7 +93,7 @@ void jvc_xvd701_device::send_response()
{
if (m_response_index < sizeof(m_response) && is_transmit_register_empty())
{
-// printf("sending %02x\n", m_response[m_response_index]);
+// printf("sending %02x\n", m_response[m_response_index]);
transmit_register_setup(m_response[m_response_index++]);
}
}
@@ -115,7 +115,7 @@ void jvc_xvd701_device::rcv_complete()
// printf("xvd701");
//for (int i = 0; i < sizeof(m_command); i++)
- // printf(" %02x", m_command[i]);
+ // printf(" %02x", m_command[i]);
//printf("\n");
diff --git a/src/emu/bus/saturn/sat_slot.c b/src/emu/bus/saturn/sat_slot.c
index 1868c23de15..ebd9c6e8890 100644
--- a/src/emu/bus/saturn/sat_slot.c
+++ b/src/emu/bus/saturn/sat_slot.c
@@ -156,15 +156,15 @@ bool sat_cart_slot_device::call_load()
// from fullpath, only ROM carts
UINT32 len = (software_entry() != NULL) ? get_software_region_length("rom") : length();
UINT32 *ROM;
-
+
m_cart->rom_alloc(len, tag());
ROM = m_cart->get_rom_base();
-
+
if (software_entry() != NULL)
memcpy(ROM, get_software_region("rom"), len);
else
fread(ROM, len);
-
+
// fix endianness....
for (int i = 0; i < len/4; i ++)
ROM[i] = BITSWAP32(ROM[i],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8,23,22,21,20,19,18,17,16,31,30,29,28,27,26,25,24);
diff --git a/src/emu/bus/scv/rom.h b/src/emu/bus/scv/rom.h
index e765df921c9..6d8ccff4d49 100644
--- a/src/emu/bus/scv/rom.h
+++ b/src/emu/bus/scv/rom.h
@@ -79,11 +79,11 @@ class scv_rom64_device : public scv_rom8_device
public:
// construction/destruction
scv_rom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -100,15 +100,15 @@ class scv_rom128_device : public scv_rom8_device
public:
// construction/destruction
scv_rom128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
private:
UINT8 m_bank_base;
};
@@ -121,16 +121,16 @@ class scv_rom128ram4_device : public scv_rom8_device
public:
// construction/destruction
scv_rom128ram4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
private:
UINT8 m_bank_base, m_ram_enabled;
};
diff --git a/src/emu/bus/scv/slot.c b/src/emu/bus/scv/slot.c
index ffffe98fcc2..dcd3639c1ed 100644
--- a/src/emu/bus/scv/slot.c
+++ b/src/emu/bus/scv/slot.c
@@ -175,11 +175,11 @@ bool scv_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(len, tag());
if (has_ram)
m_cart->ram_alloc(get_software_region_length("ram"));
-
+
ROM = m_cart->get_rom_base();
if (software_entry() == NULL)
@@ -317,4 +317,3 @@ WRITE8_MEMBER(scv_cart_slot_device::write_bank)
if (m_cart)
m_cart->write_bank(space, offset, data);
}
-
diff --git a/src/emu/bus/scv/slot.h b/src/emu/bus/scv/slot.h
index 3be1c8734b3..7db8b6eee9e 100644
--- a/src/emu/bus/scv/slot.h
+++ b/src/emu/bus/scv/slot.h
@@ -42,7 +42,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
protected:
// internal state
@@ -75,7 +75,7 @@ public:
int get_type() { return m_type; }
int get_cart_type(UINT8 *ROM, UINT32 len);
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -115,6 +115,5 @@ extern const device_type SCV_CART_SLOT;
#define MCFG_SCV_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, SCV_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/sega8/ccatch.c b/src/emu/bus/sega8/ccatch.c
index 3e917fa8d09..0f1b464660d 100644
--- a/src/emu/bus/sega8/ccatch.c
+++ b/src/emu/bus/sega8/ccatch.c
@@ -1,10 +1,10 @@
/***********************************************************************************************************
SG-1000 Card Catcher emulation
-
+
Sega Card Catcher is a passthrough adapter for
SG-1000 to load games in MyCard format into the
- main cartslot
+ main cartslot
***********************************************************************************************************/
diff --git a/src/emu/bus/sega8/mgear.h b/src/emu/bus/sega8/mgear.h
index 27672464ced..d4e800c19e8 100644
--- a/src/emu/bus/sega8/mgear.h
+++ b/src/emu/bus/sega8/mgear.h
@@ -12,11 +12,11 @@ class sega8_mgear_device : public sega8_rom_device
public:
// construction/destruction
sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart) { return m_subslot->read_cart(space, offset); }
virtual DECLARE_WRITE8_MEMBER(write_cart) { m_subslot->write_cart(space, offset, data); }
diff --git a/src/emu/bus/sega8/rom.c b/src/emu/bus/sega8/rom.c
index 9b222867ba3..436b710545c 100644
--- a/src/emu/bus/sega8/rom.c
+++ b/src/emu/bus/sega8/rom.c
@@ -752,7 +752,7 @@ READ8_MEMBER(sega8_4pak_device::read_cart)
{
int bank = offset / 0x4000;
- return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
+ return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
}
diff --git a/src/emu/bus/sega8/sega8_slot.c b/src/emu/bus/sega8/sega8_slot.c
index 2933929081c..5a64c283f66 100644
--- a/src/emu/bus/sega8/sega8_slot.c
+++ b/src/emu/bus/sega8/sega8_slot.c
@@ -873,4 +873,3 @@ SLOT_INTERFACE_START(gg_cart)
SLOT_INTERFACE_INTERNAL("codemasters", SEGA8_ROM_CODEMASTERS)
SLOT_INTERFACE_INTERNAL("mgear", SEGA8_ROM_MGEAR)
SLOT_INTERFACE_END
-
diff --git a/src/emu/bus/sega8/sega8_slot.h b/src/emu/bus/sega8/sega8_slot.h
index d70ae51a805..8a1caf8df9f 100644
--- a/src/emu/bus/sega8/sega8_slot.h
+++ b/src/emu/bus/sega8/sega8_slot.h
@@ -121,7 +121,7 @@ public:
int verify_cart(UINT8 *magic, int size);
void set_lphaser_xoffset(UINT8 *rom, int size);
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
void set_mandatory(bool val) { m_must_be_loaded = val; }
void set_intf(const char * interface) { m_interface = interface; }
diff --git a/src/emu/bus/sms_ctrl/graphic.c b/src/emu/bus/sms_ctrl/graphic.c
index 6b0024d91af..20a1f68dcda 100644
--- a/src/emu/bus/sms_ctrl/graphic.c
+++ b/src/emu/bus/sms_ctrl/graphic.c
@@ -9,18 +9,18 @@ I/O 3f write | this method
0x20 | 0x7f
0x00 | 0x3f
0x30 | 0xff
-
+
Typical sequence:
- 3f write 0x20
- read dc
- 3f write 0x00
-- read dc
+- read dc
- 3f write 0x20
- read dc
- 3f write 0x30
Suspect from kind of counter that is reset by a 0x30 write to I/O port 0x3f.
Once reset reads from i/O port dc expect to see 0xE0.
-And then any write with differing bits goes through several internal I/O ports
+And then any write with differing bits goes through several internal I/O ports
with the first port being the one with the buttons
In the reset/start state the lower four/five bits are 0.
@@ -45,11 +45,11 @@ const device_type SMS_GRAPHIC = &device_creator<sms_graphic_device>;
static INPUT_PORTS_START( sms_graphic )
- PORT_START("BUTTONS")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // MENU
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // DO
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) // PEN
- PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_START("BUTTONS")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // MENU
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // DO
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) // PEN
+ PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("X")
PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15)
@@ -110,8 +110,8 @@ UINT8 sms_graphic_device::peripheral_r()
{
case 0: // Initial state / "I am a board"
// If any regular button is pressed raise/lower TL ?
-// if ((m_buttons->read() & 0x07) != 0x07)
-// return 0xf0;
+// if ((m_buttons->read() & 0x07) != 0x07)
+// return 0xf0;
return 0xd0;
case 1: // Read buttons (active low)
@@ -155,4 +155,3 @@ void sms_graphic_device::peripheral_w(UINT8 data)
m_previous_write = data;
}
-
diff --git a/src/emu/bus/snes/snes_slot.h b/src/emu/bus/snes/snes_slot.h
index 808c2105f82..7d440437eaa 100644
--- a/src/emu/bus/snes/snes_slot.h
+++ b/src/emu/bus/snes/snes_slot.h
@@ -125,8 +125,8 @@ public:
UINT32 get_rtc_ram_size() { return m_rtc_ram.count(); };
void rom_map_setup(UINT32 size);
- void save_nvram() { device().save_item(NAME(m_nvram)); }
- void save_rtc_ram() { device().save_item(NAME(m_rtc_ram)); }
+ void save_nvram() { device().save_item(NAME(m_nvram)); }
+ void save_rtc_ram() { device().save_item(NAME(m_rtc_ram)); }
// internal state
UINT8 *m_rom;
@@ -166,7 +166,7 @@ public:
void setup_nvram();
void internal_header_logging(UINT8 *ROM, UINT32 len);
- void save_ram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram();
+ void save_ram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram();
if (m_cart && m_cart->get_rtc_ram_size()) m_cart->save_rtc_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
diff --git a/src/emu/bus/vboy/rom.h b/src/emu/bus/vboy/rom.h
index 6d474256d33..0101c303790 100644
--- a/src/emu/bus/vboy/rom.h
+++ b/src/emu/bus/vboy/rom.h
@@ -15,10 +15,10 @@ public:
// construction/destruction
vboy_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
vboy_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start() {}
-
+
// reading and writing
virtual DECLARE_READ32_MEMBER(read_cart);
};
diff --git a/src/emu/bus/vboy/slot.c b/src/emu/bus/vboy/slot.c
index a20d8ef5933..bcc3961e842 100644
--- a/src/emu/bus/vboy/slot.c
+++ b/src/emu/bus/vboy/slot.c
@@ -151,7 +151,7 @@ static const char *vboy_get_slot(int type)
if (slot_list[i].pcb_id == type)
return slot_list[i].slot_option;
}
-
+
return "vb_rom";
}
#endif
@@ -179,7 +179,7 @@ bool vboy_cart_slot_device::call_load()
m_cart->rom_alloc(0x200000, tag());
if (has_eeprom)
m_cart->eeprom_alloc(get_software_region_length("eeprom"));
-
+
ROM = (UINT8 *)m_cart->get_rom_base();
if (software_entry() == NULL)
@@ -190,7 +190,7 @@ bool vboy_cart_slot_device::call_load()
if (len < 0x080000) { memcpy(ROM + 0x040000, ROM, 0x040000); }
if (len < 0x100000) { memcpy(ROM + 0x080000, ROM, 0x080000); }
if (len < 0x200000) { memcpy(ROM + 0x100000, ROM, 0x100000); }
-
+
if (software_entry() == NULL)
m_type = vboy_get_pcb_id("vb_rom");
else
diff --git a/src/emu/bus/vboy/slot.h b/src/emu/bus/vboy/slot.h
index 910d61ab2ea..afa33c600d4 100644
--- a/src/emu/bus/vboy/slot.h
+++ b/src/emu/bus/vboy/slot.h
@@ -37,7 +37,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_eeprom_size() { return m_eeprom.count(); }
- void save_eeprom() { device().save_item(NAME(m_eeprom)); }
+ void save_eeprom() { device().save_item(NAME(m_eeprom)); }
protected:
// internal state
@@ -71,7 +71,7 @@ public:
int get_type() { return m_type; }
int get_cart_type(UINT8 *ROM, UINT32 len);
- void save_eeprom() { if (m_cart && m_cart->get_eeprom_size()) m_cart->save_eeprom(); }
+ void save_eeprom() { if (m_cart && m_cart->get_eeprom_size()) m_cart->save_eeprom(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -111,6 +111,5 @@ extern const device_type VBOY_CART_SLOT;
#define MCFG_VBOY_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, VBOY_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/vc4000/rom.c b/src/emu/bus/vc4000/rom.c
index f8b41852921..200d5d4127f 100644
--- a/src/emu/bus/vc4000/rom.c
+++ b/src/emu/bus/vc4000/rom.c
@@ -10,173 +10,173 @@
/* Game List and Emulation Status
-
+
When you load a game it will normally appear to be unresponsive. Most carts contain a number of variants
of each game (e.g. Difficulty, Player1 vs Player2 or Player1 vs Computer, etc).
-
+
Press F2 (if needed) to select which game variant you would like to play. The variant number will increment
on-screen. When you've made your choice, press F1 to start. The main keys are unlabelled, because an overlay
is provided with each cart. See below for a guide. You need to read the instructions that come with each game.
-
+
In some games, the joystick is used like 4 buttons, and other games like a paddle. The two modes are
incompatible when using a keyboard. Therefore (in the emulation) a config dipswitch is used. The preferred
setting is listed below.
-
+
(AC = Auto-centre, NAC = no auto-centre, 90 = turn controller 90 degrees).
-
+
The list is rather incomplete, information will be added as it becomes available.
-
+
The game names and numbers were obtained from the Amigan Software site.
-
+
Cart Num Name
----------------------------------------------
1. Grand Prix / Car Races / Autosport / Motor Racing / Road Race
Config: Paddle, NAC
Status: Working
Controls: Left-Right: Steer; Up: Accelerate
-
+
2. Black Jack
Status: Not working (some digits missing; indicator missing; dealer's cards missing)
Controls: set bet with S and D; A to deal; 1 to hit, 2 to stay; Q accept insurance, E to decline; double-up (unknown key)
Indicator: E make a bet then deal; I choose insurance; - you lost; + you won; X hit or stay
-
+
3. Olympics / Paddle Games / Bat & Ball / Pro Sport 60 / Sportsworld
Config: Paddle, NAC
Status: Working
-
+
4. Tank Battle / Combat
Config: Button, 90
Status: Working
Controls: Left-Right: Steer; Up: Accelerate; Fire: Shoot
-
+
5. Maths 1
Status: Working
Controls: Z difficulty; X = addition or subtraction; C ask question; A=1;S=2;D=3;Q=4;W=5;E=6;1=7;2=8;3=9;0=0; C enter
-
+
6. Maths 2
Status: Not working
Controls: Same as above.
-
+
7. Air Sea Attack / Air Sea Battle
Config: Button, 90
Status: Working
Controls: Left-Right: Move; Fire: Shoot
-
+
8. Treasure Hunt / Capture the Flag / Concentration / Memory Match
Config: Buttons
Status: Working
-
+
9. Labyrinth / Maze / Intelligence 1
Config: Buttons
Status: Working
-
+
10. Winter Sports
Notes: Background colours should be Cyan and White instead of Red and Black
-
+
11. Hippodrome / Horse Race
-
+
12. Hunting / Shooting Gallery
-
+
13. Chess 1
Status: Can't see what you're typing, wrong colours
-
+
14. Moto-cros
-
+
15. Four in a row / Intelligence 2
Config: Buttons
Status: Working
Notes: Seems the unused squares should be black. The screen jumps about while the computer is "thinking".
-
+
16. Code Breaker / Master Mind / Intelligence 3 / Challenge
-
+
17. Circus
STatus: severe gfx issues
-
+
18. Boxing / Prize Fight
-
+
19. Outer Space / Spacewar / Space Attack / Outer Space Combat
-
+
20. Melody Simon / Musical Memory / Follow the Leader / Musical Games / Electronic Music / Face the Music
-
+
21. Capture / Othello / Reversi / Attack / Intelligence 4
Config: Buttons
Status: Working
Notes: Seems the unused squares should be black
-
+
22. Chess 2
Status: Can't see what you're typing, wrong colours
-
+
23. Pinball / Flipper / Arcade
Status: gfx issues
-
+
24. Soccer
-
+
25. Bowling / NinePins
Config: Paddle, rotated 90 degrees, up/down autocentre, left-right does not
Status: Working
-
+
26. Draughts
-
+
27. Golf
Status: gfx issues
-
+
28. Cockpit
Status: gfx issues
-
+
29. Metropolis / Hangman
Status: gfx issues
-
+
30. Solitaire
-
+
31. Casino
Status: gfx issues, items missing and unplayable
Controls: 1 or 3=START; q=GO; E=STOP; D=$; Z=^; X=tens; C=units
-
+
32. Invaders / Alien Invasion / Earth Invasion
Status: Works
Config: Buttons
-
+
33. Super Invaders
Status: Stars are missing, colours are wrong
Config: Buttons (90)
-
+
36. BackGammon
Status: Not all counters are visible, Dice & game number not visible.
Controls: Fire=Exec; 1=D+; 3=D-; Q,W,E=4,5,6; A,S,D=1,2,3; Z=CL; X=STOP; C=SET
-
+
37. Monster Man / Spider's Web
Status: Works
Config: Buttons
-
+
38. Hyperspace
Status: Works
Config: Buttons (90)
Controls: 3 - status button; Q,W,E,A,S,D,Z,X,C selects which galaxy to visit
-
-
+
+
40. Super Space
Status: Works, some small gfx issues near the bottom
Config: Buttons
-
-
-
+
+
+
Acetronic: (dumps are compatible)
------------
-
+
* Shooting Gallery
Status: works but screen flickers
Config: Buttons
-
+
* Planet Defender
Status: Works
Config: Paddle (NAC)
-
+
* Laser Attack
Status: Works
Config: Buttons
-
-
-
+
+
+
Public Domain: (written for emulators, may not work on real hardware)
---------------
* Picture (no controls) - works
diff --git a/src/emu/bus/vc4000/rom.h b/src/emu/bus/vc4000/rom.h
index ac64abee2de..53ef34a4805 100644
--- a/src/emu/bus/vc4000/rom.h
+++ b/src/emu/bus/vc4000/rom.h
@@ -31,7 +31,7 @@ class vc4000_ram1k_device : public vc4000_rom_device
public:
// construction/destruction
vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -44,7 +44,7 @@ class vc4000_chess2_device : public vc4000_rom_device
public:
// construction/destruction
vc4000_chess2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(extra_rom);
virtual DECLARE_READ8_MEMBER(read_ram);
diff --git a/src/emu/bus/vc4000/slot.c b/src/emu/bus/vc4000/slot.c
index b9524565f77..43fbfa992e2 100644
--- a/src/emu/bus/vc4000/slot.c
+++ b/src/emu/bus/vc4000/slot.c
@@ -169,9 +169,9 @@ bool vc4000_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for a VC4000 cart");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), size);
else
@@ -236,7 +236,7 @@ void vc4000_cart_slot_device::get_default_card_software(astring &result)
type = VC4000_CHESS2;
else if (size > 0x0800) // some 4k roms have 1k of mirrored ram
type = VC4000_RAM1K;
-
+
slot_string = vc4000_get_slot(type);
//printf("type: %s\n", slot_string);
@@ -294,5 +294,3 @@ WRITE8_MEMBER(vc4000_cart_slot_device::write_ram)
if (m_cart)
m_cart->write_ram(space, offset, data);
}
-
-
diff --git a/src/emu/bus/vc4000/slot.h b/src/emu/bus/vc4000/slot.h
index 5f992d342aa..c4226d1c9b9 100644
--- a/src/emu/bus/vc4000/slot.h
+++ b/src/emu/bus/vc4000/slot.h
@@ -39,7 +39,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
protected:
// internal state
@@ -71,7 +71,7 @@ public:
int get_type() { return m_type; }
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -112,6 +112,5 @@ extern const device_type VC4000_CART_SLOT;
#define MCFG_VC4000_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, VC4000_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/vcs/compumat.c b/src/emu/bus/vcs/compumat.c
index fe67e120c41..57de9257711 100644
--- a/src/emu/bus/vcs/compumat.c
+++ b/src/emu/bus/vcs/compumat.c
@@ -1,10 +1,10 @@
/***************************************************************************
- Atari 2600 cart Spectravideo Compumate (Cart + keyboard!)
+ Atari 2600 cart Spectravideo Compumate (Cart + keyboard!)
This is tricky to implement and it is only a skeleton ATM.
The device needs to interface with both the TIA and the RIOT.
-
+
***************************************************************************/
diff --git a/src/emu/bus/vcs/compumat.h b/src/emu/bus/vcs/compumat.h
index d2d81fc83f0..b18988181ac 100644
--- a/src/emu/bus/vcs/compumat.h
+++ b/src/emu/bus/vcs/compumat.h
@@ -19,10 +19,10 @@ public:
virtual void device_start();
virtual ioport_constructor device_input_ports() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
-
+
private:
};
diff --git a/src/emu/bus/vcs/dpc.c b/src/emu/bus/vcs/dpc.c
index 85d8689067d..7387c6dbb34 100644
--- a/src/emu/bus/vcs/dpc.c
+++ b/src/emu/bus/vcs/dpc.c
@@ -37,7 +37,7 @@ void dpc_device::device_reset()
m_df[data_fetcher].music_mode = 0;
}
m_oscillator->adjust(attotime::from_hz(18400), 0, attotime::from_hz(18400));
-
+
}
void dpc_device::check_flag(UINT8 data_fetcher)
@@ -60,7 +60,7 @@ void dpc_device::decrement_counter(UINT8 data_fetcher)
if (data_fetcher > 4 && m_df[data_fetcher].music_mode)
m_df[data_fetcher].low = m_df[data_fetcher].top;
}
-
+
check_flag(data_fetcher);
}
@@ -149,7 +149,7 @@ READ8_MEMBER(dpc_device::read)
data = m_df[data_fetcher].flag ? 0xff : 0x00;
break;
}
-
+
if (data_fetcher < 5 || !m_df[data_fetcher].osc_clk)
{
decrement_counter(data_fetcher);
@@ -161,7 +161,7 @@ READ8_MEMBER(dpc_device::read)
WRITE8_MEMBER(dpc_device::write)
{
UINT8 data_fetcher = offset & 0x07;
-
+
switch (offset & 0x38)
{
case 0x00: // Top count
@@ -235,7 +235,7 @@ void a26_rom_dpc_device::device_reset()
m_base_bank = 0;
}
-void a26_rom_dpc_device::setup_addon_ptr(UINT8 *ptr)
+void a26_rom_dpc_device::setup_addon_ptr(UINT8 *ptr)
{
m_dpc->set_display_data(ptr);
}
@@ -279,4 +279,3 @@ DIRECT_UPDATE_MEMBER(a26_rom_dpc_device::cart_opbase)
}
return address;
}
-
diff --git a/src/emu/bus/vcs/dpc.h b/src/emu/bus/vcs/dpc.h
index 8cf12d893eb..a54e67e5778 100644
--- a/src/emu/bus/vcs/dpc.h
+++ b/src/emu/bus/vcs/dpc.h
@@ -19,7 +19,7 @@ struct df_t {
UINT8 osc_clk; /* Only used by data fetchers 5,6, and 7 */
};
-// m_dpc.oscillator = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2600_state::modeDPC_timer_callback),this));
+// m_dpc.oscillator = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2600_state::modeDPC_timer_callback),this));
class dpc_device : public device_t
{
@@ -74,16 +74,16 @@ public:
virtual void device_reset();
required_device<dpc_device> m_dpc;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
virtual DECLARE_DIRECT_UPDATE_MEMBER(cart_opbase);
virtual void setup_addon_ptr(UINT8 *ptr);
-
+
protected:
-// int m_reset_bank;
+// int m_reset_bank;
};
diff --git a/src/emu/bus/vcs/rom.c b/src/emu/bus/vcs/rom.c
index a585734c6f4..f9cc271b316 100755
--- a/src/emu/bus/vcs/rom.c
+++ b/src/emu/bus/vcs/rom.c
@@ -62,13 +62,13 @@ a26_rom_4k_device::a26_rom_4k_device(const machine_config &mconfig, const char *
a26_rom_f6_device::a26_rom_f6_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: a26_rom_2k_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_base_bank(-1) // set to -1 to help the Xin1 multicart...
+ m_base_bank(-1) // set to -1 to help the Xin1 multicart...
{
}
a26_rom_f6_device::a26_rom_f6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: a26_rom_2k_device(mconfig, A26_ROM_F6, "Atari VCS 2600 ROM Carts w/F6 bankswitch", tag, owner, clock, "vcs_f6", __FILE__),
- m_base_bank(-1) // set to -1 to help the Xin1 multicart...
+ m_base_bank(-1) // set to -1 to help the Xin1 multicart...
{
}
@@ -337,7 +337,7 @@ READ8_MEMBER(a26_rom_2k_device::read_rom)
/*-------------------------------------------------
"F4 Bankswitch" Carts:
- read/write access to 0x1ff4-0x1ffb determines the
+ read/write access to 0x1ff4-0x1ffb determines the
4K ROM bank to be read
GAMES: Fatal Run
@@ -350,7 +350,7 @@ READ8_MEMBER(a26_rom_f4_device::read_rom)
{
return m_ram[offset & (m_ram.count() - 1)];
}
-
+
// update banks
if (!space.debugger_access())
{
@@ -368,7 +368,7 @@ READ8_MEMBER(a26_rom_f4_device::read_rom)
break;
}
}
-
+
return m_rom[offset + (m_base_bank * 0x1000)];
}
@@ -380,7 +380,7 @@ WRITE8_MEMBER(a26_rom_f4_device::write_bank)
m_ram[offset & (m_ram.count() - 1)] = data;
return;
}
-
+
switch (offset)
{
case 0x0ff4:
@@ -401,10 +401,10 @@ WRITE8_MEMBER(a26_rom_f4_device::write_bank)
/*-------------------------------------------------
"F6 Bankswitch" Carts:
- read/write access to 0x1ff6-0x1ff9 determines the
+ read/write access to 0x1ff6-0x1ff9 determines the
4K ROM bank to be read
- GAMES: Atari 16K games, like Crossbow, Crystal
+ GAMES: Atari 16K games, like Crossbow, Crystal
Castles and the 2-in-1 carts
-------------------------------------------------*/
@@ -469,7 +469,7 @@ DIRECT_UPDATE_MEMBER(a26_rom_f6_device::cart_opbase)
/*-------------------------------------------------
"F8 Bankswitch" Carts:
- read/write access to 0x1ff8-0x1ff9 determines the
+ read/write access to 0x1ff8-0x1ff9 determines the
4K ROM bank to be read
GAMES: Atari 8K games, like Asteroids, Battlezone
@@ -484,7 +484,7 @@ READ8_MEMBER(a26_rom_f8_device::read_rom)
{
return m_ram[offset & (m_ram.count() - 1)];
}
-
+
// update banks
if (!space.debugger_access())
{
@@ -496,7 +496,7 @@ READ8_MEMBER(a26_rom_f8_device::read_rom)
break;
}
}
-
+
return m_rom[offset + (m_base_bank * 0x1000)];
}
@@ -508,7 +508,7 @@ WRITE8_MEMBER(a26_rom_f8_device::write_bank)
m_ram[offset & (m_ram.count() - 1)] = data;
return;
}
-
+
switch (offset)
{
case 0x0ff8:
@@ -523,12 +523,12 @@ WRITE8_MEMBER(a26_rom_f8_device::write_bank)
/*-------------------------------------------------
"FA Bankswitch" Carts:
- read/write access to 0x1ff8-0x1ffa determines the
+ read/write access to 0x1ff8-0x1ffa determines the
4K ROM bank to be read
- These games contained the CBS RAM+ chip (256bytes
+ These games contained the CBS RAM+ chip (256bytes
of RAM)
-
- GAMES: CBS RAM Plus games like Omega Race and Tunnel
+
+ GAMES: CBS RAM Plus games like Omega Race and Tunnel
Runner
-------------------------------------------------*/
@@ -540,7 +540,7 @@ READ8_MEMBER(a26_rom_fa_device::read_rom)
{
return m_ram[offset & (m_ram.count() - 1)];
}
-
+
// update banks
if (!space.debugger_access())
{
@@ -553,7 +553,7 @@ READ8_MEMBER(a26_rom_fa_device::read_rom)
break;
}
}
-
+
return m_rom[offset + (m_base_bank * 0x1000)];
}
@@ -563,8 +563,8 @@ WRITE8_MEMBER(a26_rom_fa_device::write_bank)
if (m_ram && offset < 0x100)
{
m_ram[offset & (m_ram.count() - 1)] = data;
- }
-
+ }
+
switch (offset)
{
case 0x0ff8:
@@ -580,22 +580,22 @@ WRITE8_MEMBER(a26_rom_fa_device::write_bank)
/*-------------------------------------------------
"FE Bankswitch" Carts:
- read/write access to 0x01fe-0x1ff determines the
+ read/write access to 0x01fe-0x1ff determines the
4K ROM bank to be read
-
+
GAMES: Activision 8K games like Decathlon
-------------------------------------------------*/
/*
-
+
There seems to be a kind of lag between the writing to address 0x1FE and the
Activision switcher springing into action. It waits for the next byte to arrive
on the data bus, which is the new PCH in the case of a JSR, and the PCH of the
stored PC on the stack in the case of an RTS.
-
+
depending on last byte & 0x20 -> 0x00 -> switch to bank #1
-> 0x20 -> switch to bank #0
-
+
*/
READ8_MEMBER(a26_rom_fe_device::read_rom)
@@ -607,9 +607,9 @@ READ8_MEMBER(a26_rom_fe_device::read_rom)
{
return m_ram[offset & (m_ram.count() - 1)];
}
-
+
data = m_rom[offset + (m_base_bank * 0x1000)];
-
+
if (!space.debugger_access())
{
if (m_trigger_on_next_access)
@@ -618,7 +618,7 @@ READ8_MEMBER(a26_rom_fe_device::read_rom)
m_trigger_on_next_access = 0;
}
}
-
+
return data;
}
@@ -634,7 +634,7 @@ WRITE8_MEMBER(a26_rom_fe_device::write_ram)
READ8_MEMBER(a26_rom_fe_device::read_bank)
{
UINT8 data = space.read_byte(0xfe + offset);
-
+
if (!space.debugger_access())
{
switch (offset & 1)
@@ -643,7 +643,7 @@ READ8_MEMBER(a26_rom_fe_device::read_bank)
// The next byte on the data bus determines which bank to switch to
m_trigger_on_next_access = 1;
break;
-
+
case 1:
if (m_trigger_on_next_access)
{
@@ -667,11 +667,11 @@ WRITE8_MEMBER(a26_rom_fe_device::write_bank)
}
/*-------------------------------------------------
- "3E Bankswitch" Carts:
- write access to 0x3e determines the 2K ROM bank to
- be read, write access to 0x3f determines the RAM bank
+ "3E Bankswitch" Carts:
+ write access to 0x3e determines the 2K ROM bank to
+ be read, write access to 0x3f determines the RAM bank
to be read
-
+
GAMES: Boulder Dash (Homebrew)
-------------------------------------------------*/
@@ -680,7 +680,7 @@ READ8_MEMBER(a26_rom_3e_device::read_rom)
{
if (m_ram && m_ram_enable && offset < 0x400)
return m_ram[offset + (m_ram_bank * 0x400)];
-
+
if (offset >= 0x800)
return m_rom[(offset & 0x7ff) + (m_num_bank - 1) * 0x800];
else
@@ -709,11 +709,11 @@ WRITE8_MEMBER(a26_rom_3e_device::write_ram)
/*-------------------------------------------------
- "3F Bankswitch" Carts:
- write access to 0x00-0x3f determines the 2K ROM bank
+ "3F Bankswitch" Carts:
+ write access to 0x00-0x3f determines the 2K ROM bank
to be read
- GAMES: Tigervision 8K games like Espial and Miner
+ GAMES: Tigervision 8K games like Espial and Miner
2049er. Extended version with bankswitch up to 512K
shall be supported as well (but we lack a test case)
@@ -733,8 +733,8 @@ WRITE8_MEMBER(a26_rom_3f_device::write_bank)
}
/*-------------------------------------------------
- "E0 Bankswitch" Carts:
- read/write access to 0x1fe0-0x1ff8 determines the
+ "E0 Bankswitch" Carts:
+ read/write access to 0x1fe0-0x1ff8 determines the
1K ROM bank to be read in each 1K chunk (0x1c00-0x1fff
always points to the last 1K of the ROM)
@@ -769,16 +769,16 @@ WRITE8_MEMBER(a26_rom_e0_device::write_bank)
1800-19ff is RAM
1a00-1fff is fixed to the last 0x600 of ROM
- The selectable bank can be ROM (if selected by
- 0x1fe0-0x1fe6 access) or a first 1K of RAM (if
+ The selectable bank can be ROM (if selected by
+ 0x1fe0-0x1fe6 access) or a first 1K of RAM (if
selected by 0x1fe7 access).
- The other 256byte RAM bank can be one of the
+ The other 256byte RAM bank can be one of the
four different chunks forming the other 1K of RAM
(the bank is selected by accessing 0x1fe8-0x1feb)
- GAMES: M Network 16K games like Burgertime and
+ GAMES: M Network 16K games like Burgertime and
Bump'n Jump
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_e7_device::read_rom)
@@ -833,12 +833,12 @@ WRITE8_MEMBER(a26_rom_e7_device::write_bank)
}
/*-------------------------------------------------
- "UA Bankswitch" Carts:
- read/write access to 0x200-0x27f determines the
+ "UA Bankswitch" Carts:
+ read/write access to 0x200-0x27f determines the
4K ROM bank to be read (0x220-0x23f for low 4K,
0x240-0x27f for high 4K)
- GAMES: UA Ltd. 8K games like Funky Flash and
+ GAMES: UA Ltd. 8K games like Funky Flash and
Pleaides
-------------------------------------------------*/
@@ -863,9 +863,9 @@ WRITE8_MEMBER(a26_rom_ua_device::write_bank)
/*-------------------------------------------------
- Commavid Carts:
+ Commavid Carts:
It allows for both ROM and RAM on the cartridge,
- without using bankswitching. There's 2K of ROM
+ without using bankswitching. There's 2K of ROM
and 1K of RAM.
GAMES: Magicard and Video Life by Commavid
@@ -894,8 +894,8 @@ WRITE8_MEMBER(a26_rom_cv_device::write_bank)
/*-------------------------------------------------
- Dynacom Megaboy Carts (aka "F0 Banswitch"):
- read/write access to 0x1ff0 determines the 4K ROM
+ Dynacom Megaboy Carts (aka "F0 Banswitch"):
+ read/write access to 0x1ff0 determines the 4K ROM
bank to be read (each access increases the bank index
up to 16, since the cart was 64K wide)
@@ -925,8 +925,8 @@ WRITE8_MEMBER(a26_rom_dc_device::write_bank)
/*-------------------------------------------------
- "FV Bankswitch" Carts:
- The first access to 0x1fd0 switch the bank, but
+ "FV Bankswitch" Carts:
+ The first access to 0x1fd0 switch the bank, but
only if pc() & 0x1f00 == 0x1f00!
GAMES: Challenge by HES
@@ -964,14 +964,14 @@ WRITE8_MEMBER(a26_rom_fv_device::write_bank)
/*-------------------------------------------------
- "JVP Bankswitch" Carts:
- read/write access to 0x0fa0-0x0fc0 determines the
+ "JVP Bankswitch" Carts:
+ read/write access to 0x0fa0-0x0fc0 determines the
4K ROM bank to be read (notice that this overlaps
the RIOT, currently handled in the main driver until
I can better investigate the behavior)
-
+
GAMES: No test case!?!
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_jvp_device::read_rom)
@@ -997,9 +997,9 @@ WRITE8_MEMBER(a26_rom_jvp_device::write_bank)
/*-------------------------------------------------
4 in 1 Carts (Reset based):
the 4K bank changes at each reset
-
+
GAMES: 4 in 1 carts
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_4in1_device::read_rom)
@@ -1012,9 +1012,9 @@ READ8_MEMBER(a26_rom_4in1_device::read_rom)
8 in 1 Carts (Reset based):
the 8K banks change at each reset, and internally
each game runs as a F8-bankswitched cart
-
+
GAMES: 8 in 1 cart
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_8in1_device::read_rom)
@@ -1029,7 +1029,7 @@ READ8_MEMBER(a26_rom_8in1_device::read_rom)
break;
}
}
-
+
return m_rom[offset + (m_base_bank * 0x1000) + (m_reset_bank * 0x2000)];
}
@@ -1037,13 +1037,12 @@ READ8_MEMBER(a26_rom_8in1_device::read_rom)
/*-------------------------------------------------
32 in 1 Carts (Reset based):
the 2K banks change at each reset
-
+
GAMES: 32 in 1 cart
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_32in1_device::read_rom)
{
return m_rom[(offset & 0x7ff) + (m_base_bank * 0x800)];
}
-
diff --git a/src/emu/bus/vcs/rom.h b/src/emu/bus/vcs/rom.h
index 33b00d0b5ea..a0434bd35c4 100755
--- a/src/emu/bus/vcs/rom.h
+++ b/src/emu/bus/vcs/rom.h
@@ -30,7 +30,7 @@ class a26_rom_4k_device : public a26_rom_2k_device
public:
// construction/destruction
a26_rom_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
// accesses just use the 2K ones, since it is just direct access to ROM/RAM
@@ -46,16 +46,16 @@ public:
// construction/destruction
a26_rom_f6_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a26_rom_f6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
virtual DECLARE_DIRECT_UPDATE_MEMBER(cart_opbase);
-
+
protected:
int m_base_bank;
};
@@ -68,10 +68,10 @@ class a26_rom_f4_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_f4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -86,7 +86,7 @@ public:
// construction/destruction
a26_rom_f8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a26_rom_f8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -100,7 +100,7 @@ class a26_rom_f8_sw_device : public a26_rom_f8_device
public:
// construction/destruction
a26_rom_f8_sw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
};
@@ -113,7 +113,7 @@ class a26_rom_fa_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_fa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -127,17 +127,17 @@ class a26_rom_fe_device : public a26_rom_2k_device
public:
// construction/destruction
a26_rom_fe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ8_MEMBER(read_bank);
virtual DECLARE_WRITE8_MEMBER(write_ram);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_base_bank;
int m_trigger_on_next_access;
@@ -151,16 +151,16 @@ class a26_rom_3e_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_3e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
virtual DECLARE_WRITE8_MEMBER(write_ram);
-
+
protected:
int m_num_bank;
int m_ram_bank;
@@ -175,14 +175,14 @@ class a26_rom_3f_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_3f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_num_bank;
};
@@ -195,15 +195,15 @@ class a26_rom_e0_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_e0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_base_banks[4];
};
@@ -216,15 +216,15 @@ class a26_rom_e7_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_e7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_ram_bank;
};
@@ -237,10 +237,10 @@ class a26_rom_ua_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_ua_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ8_MEMBER(read_bank);
@@ -255,7 +255,7 @@ class a26_rom_cv_device : public a26_rom_2k_device
public:
// construction/destruction
a26_rom_cv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -269,7 +269,7 @@ class a26_rom_dc_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -283,15 +283,15 @@ class a26_rom_fv_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_fv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_locked;
};
@@ -304,7 +304,7 @@ class a26_rom_jvp_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_jvp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -318,10 +318,10 @@ class a26_rom_4in1_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_4in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
};
@@ -334,11 +334,11 @@ class a26_rom_8in1_device : public a26_rom_f8_device
public:
// construction/destruction
a26_rom_8in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
@@ -354,10 +354,10 @@ class a26_rom_32in1_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_32in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
};
diff --git a/src/emu/bus/vcs/scharger.c b/src/emu/bus/vcs/scharger.c
index efd685a5969..e536a474c18 100644
--- a/src/emu/bus/vcs/scharger.c
+++ b/src/emu/bus/vcs/scharger.c
@@ -2,31 +2,31 @@
Atari 2600 cart Starpath Supercharger (Cart + Tape drive!)
-
-
+
+
From kevtris notes ( http://blog.kevtris.org/blogfiles/Atari%202600%20Mappers.txt ):
-
+
- Control register [0x1ff8]
-
+
7 0
---------
1FF8: DDDB BBWE
-
+
D: write delay (see below)
B: bankswitching mode (see below)
W: RAM write enable (1 = enabled, 0 = disabled)
E: ROM power enable (0 = enabled, 1 = turn off ROM)
-
+
- Audio input register [0x1ff9]
-
+
7 0
- ---------
+ ---------
1FF9: 0000 000A
-
+
A: Supercharger audio data. 0 = low input, 1 = high input.
-
-
+
+
***************************************************************************/
@@ -83,8 +83,8 @@ static MACHINE_CONFIG_FRAGMENT( a26_ss )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)
MCFG_CASSETTE_INTERFACE("a2600_cass")
-// MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+// MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
+// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
machine_config_constructor a26_rom_ss_device::device_mconfig_additions() const
@@ -109,17 +109,17 @@ READ8_MEMBER(a26_rom_ss_device::read_rom)
if (space.debugger_access())
return read_byte(offset);
- // Bankswitch
+ // Bankswitch
if (offset == 0xff8)
{
//logerror("%04X: Access to control register data = %02X\n", m_maincpu->pc(), m_modeSS_byte);
m_write_delay = m_reg >> 5;
m_ram_write_enabled = BIT(m_reg, 1);
m_rom_enabled = !BIT(m_reg, 0);
-
+
// compensate time spent in this access to avoid spurious RAM write
m_byte_started -= 5;
-
+
// handle bankswitch
switch (m_reg & 0x1c)
{
@@ -164,10 +164,10 @@ READ8_MEMBER(a26_rom_ss_device::read_rom)
{
//logerror("%04X: Cassette port read, tap_val = %f\n", m_maincpu->pc(), tap_val);
double tap_val = m_cassette->input();
-
+
// compensate time spent in this access to avoid spurious RAM write
m_byte_started -= 5;
-
+
if (tap_val < 0)
return 0x00;
else
@@ -181,7 +181,7 @@ READ8_MEMBER(a26_rom_ss_device::read_rom)
/* Check for dummy read from same address */
if (m_last_address == offset)
m_diff_adjust++;
-
+
int diff = m_maincpu->total_cycles() - m_byte_started;
//logerror("%04X: offset = %04X, %d\n", m_maincpu->pc(), offset, diff);
diff --git a/src/emu/bus/vcs/scharger.h b/src/emu/bus/vcs/scharger.h
index d13d8e5b6d7..94ffda7230c 100644
--- a/src/emu/bus/vcs/scharger.h
+++ b/src/emu/bus/vcs/scharger.h
@@ -22,14 +22,14 @@ public:
virtual void device_reset();
required_device<cassette_image_device> m_cassette;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
-
+
private:
cpu_device *m_maincpu;
inline UINT8 read_byte(UINT32 offset);
-
+
int m_base_banks[2];
UINT8 m_reg;
UINT8 m_write_delay, m_ram_write_enabled, m_rom_enabled;
diff --git a/src/emu/bus/vcs/vcs_slot.c b/src/emu/bus/vcs/vcs_slot.c
index a60cf55da52..a1a8797c18b 100755
--- a/src/emu/bus/vcs/vcs_slot.c
+++ b/src/emu/bus/vcs/vcs_slot.c
@@ -186,14 +186,14 @@ bool vcs_cart_slot_device::call_load()
{
UINT8 *ROM;
UINT32 len;
-
+
if (software_entry() != NULL)
len = get_software_region_length("rom");
else
len = length();
-
+
//printf("Size: 0x%X\n", len);
-
+
// check that filesize is among the supported ones
switch (len)
{
@@ -208,21 +208,21 @@ bool vcs_cart_slot_device::call_load()
case 0x10000:
case 0x80000:
break;
-
+
default:
seterror(IMAGE_ERROR_UNSUPPORTED, "Invalid rom file size" );
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(len, tag());
ROM = m_cart->get_rom_base();
-
+
if (software_entry() != NULL)
{
const char *pcb_name;
bool has_ram = get_software_region("ram") ? TRUE : FALSE;
memcpy(ROM, get_software_region("rom"), len);
-
+
if ((pcb_name = get_feature("slot")) != NULL)
m_type = vcs_get_pcb_id(pcb_name);
else
@@ -272,7 +272,7 @@ bool vcs_cart_slot_device::call_load()
{
fread(ROM, len);
m_type = identify_cart_type(ROM, len);
-
+
// check for Special Chip (128bytes of RAM)
if (len == 0x2000 || len == 0x4000 || len == 0x8000)
if (detect_super_chip(ROM, len))
@@ -284,7 +284,7 @@ bool vcs_cart_slot_device::call_load()
// dig dig, crystal castles, millipede, stargate, defender ii, jr. Pac Man,
// desert falcon, dark chambers, super football, sprintmaster, fatal run,
// off the wall, shooting arcade, secret quest, radar lock, save mary, klax
-
+
// add CBS RAM+ (256bytes of RAM)
if (m_type == A26_FA)
m_cart->ram_alloc(0x100);
@@ -301,16 +301,16 @@ bool vcs_cart_slot_device::call_load()
else if (m_type == A26_3E)
m_cart->ram_alloc(0x8000);
}
-
+
//printf("Type: %s\n", vcs_get_slot(m_type));
-
+
// pass a pointer to the now allocated ROM for the DPC chip
if (m_type == A26_DPC)
m_cart->setup_addon_ptr((UINT8 *)m_cart->get_rom_base() + 0x2000);
-
+
return IMAGE_INIT_PASS;
}
-
+
return IMAGE_INIT_PASS;
}
@@ -356,7 +356,7 @@ int vcs_cart_slot_device::detect_modeDC(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -376,7 +376,7 @@ int vcs_cart_slot_device::detect_modeF6(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -408,7 +408,7 @@ int vcs_cart_slot_device::detect_mode3E(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -428,7 +428,7 @@ int vcs_cart_slot_device::detect_modeSS(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -456,7 +456,7 @@ int vcs_cart_slot_device::detect_modeFE(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -486,7 +486,7 @@ int vcs_cart_slot_device::detect_modeE0(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -512,7 +512,7 @@ int vcs_cart_slot_device::detect_modeCV(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -535,7 +535,7 @@ int vcs_cart_slot_device::detect_modeFV(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -561,7 +561,7 @@ int vcs_cart_slot_device::detect_modeJVP(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -587,7 +587,7 @@ int vcs_cart_slot_device::detect_modeE7(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -607,7 +607,7 @@ int vcs_cart_slot_device::detect_modeUA(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound)
+ if (numfound)
return 1;
return 0;
}
@@ -633,7 +633,7 @@ int vcs_cart_slot_device::detect_8K_mode3F(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound == 0x03)
+ if (numfound == 0x03)
return 1;
return 0;
}
@@ -653,7 +653,7 @@ int vcs_cart_slot_device::detect_32K_mode3F(UINT8 *cart, UINT32 len)
}
}
}
- if (numfound > 1)
+ if (numfound > 1)
return 1;
return 0;
}
@@ -705,33 +705,33 @@ int vcs_cart_slot_device::identify_cart_type(UINT8 *ROM, UINT32 len)
int type = 0xff;
// auto-detect bank mode
- if (detect_modeDC(ROM, len))
+ if (detect_modeDC(ROM, len))
type = A26_DC;
- else if (detect_mode3E(ROM, len))
+ else if (detect_mode3E(ROM, len))
type = A26_3E;
- else if (detect_modeFE(ROM, len))
+ else if (detect_modeFE(ROM, len))
type = A26_FE;
- else if (detect_modeSS(ROM, len))
+ else if (detect_modeSS(ROM, len))
type = A26_SS;
- else if (detect_modeE0(ROM, len))
+ else if (detect_modeE0(ROM, len))
type = A26_E0;
else if (detect_modeCV(ROM, len))
type = A26_CV;
- else if (detect_modeFV(ROM, len))
+ else if (detect_modeFV(ROM, len))
type = A26_FV;
- else if (detect_modeJVP(ROM, len))
+ else if (detect_modeJVP(ROM, len))
type = A26_JVP;
- else if (detect_modeUA(ROM, len))
+ else if (detect_modeUA(ROM, len))
type = A26_UA;
- else if (detect_8K_mode3F(ROM, len))
+ else if (detect_8K_mode3F(ROM, len))
type = A26_3F;
- else if (detect_32K_mode3F(ROM, len))
+ else if (detect_32K_mode3F(ROM, len))
type = A26_3F;
- else if (detect_modeE7(ROM, len))
+ else if (detect_modeE7(ROM, len))
type = A26_E7;
else if (detect_snowhite(ROM, len))
type = A26_F8SW;
-
+
// otherwise, choose based on size
if (type == 0xff)
{
@@ -771,7 +771,7 @@ int vcs_cart_slot_device::identify_cart_type(UINT8 *ROM, UINT32 len)
break;
}
}
-
+
return type;
}
@@ -787,14 +787,14 @@ void vcs_cart_slot_device::get_default_card_software(astring &result)
UINT32 len = core_fsize(m_file);
dynamic_buffer rom(len);
int type;
-
+
core_fread(m_file, rom, len);
-
+
type = identify_cart_type(rom, len);
slot_string = vcs_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
diff --git a/src/emu/bus/vcs/vcs_slot.h b/src/emu/bus/vcs/vcs_slot.h
index 18d604b1a69..3d393395f5a 100755
--- a/src/emu/bus/vcs/vcs_slot.h
+++ b/src/emu/bus/vcs/vcs_slot.h
@@ -18,7 +18,7 @@ enum
A26_F8SW,
A26_FA,
A26_FE,
- A26_3E, // to test
+ A26_3E, // to test
A26_3F,
A26_E0,
A26_E7,
@@ -26,7 +26,7 @@ enum
A26_DC,
A26_CV,
A26_FV,
- A26_JVP, // to test
+ A26_JVP, // to test
A26_32IN1,
A26_8IN1,
A26_4IN1,
@@ -49,7 +49,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; }
// writing to RAM chips (sometimes it is in a different range than write_bank!)
virtual DECLARE_WRITE8_MEMBER(write_ram) {}
-
+
// read/write to bankswitch address
virtual DECLARE_READ8_MEMBER(read_bank) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_bank) {}
diff --git a/src/emu/bus/vectrex/rom.h b/src/emu/bus/vectrex/rom.h
index a88ba20795d..6515b0227fb 100644
--- a/src/emu/bus/vectrex/rom.h
+++ b/src/emu/bus/vectrex/rom.h
@@ -31,11 +31,11 @@ class vectrex_rom64k_device : public vectrex_rom_device
public:
// construction/destruction
vectrex_rom64k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -51,7 +51,7 @@ class vectrex_sram_device : public vectrex_rom_device
public:
// construction/destruction
vectrex_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_WRITE8_MEMBER(write_ram);
};
diff --git a/src/emu/bus/vectrex/slot.c b/src/emu/bus/vectrex/slot.c
index d4db8b2c047..448b48beebd 100644
--- a/src/emu/bus/vectrex/slot.c
+++ b/src/emu/bus/vectrex/slot.c
@@ -156,44 +156,44 @@ bool vectrex_cart_slot_device::call_load()
{
UINT32 size = (software_entry() == NULL) ? length() : get_software_region_length("rom");
UINT8 *ROM;
-
+
if (size > 0x10000)
{
seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc((size < 0x1000) ? 0x1000 : size, tag());
ROM = m_cart->get_rom_base();
-
+
if (software_entry() == NULL)
fread(ROM, size);
else
memcpy(ROM, get_software_region("rom"), size);
-
+
// Verify the file is accepted by the Vectrex bios
if (memcmp(ROM, "g GCE", 5))
{
seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid image");
return IMAGE_INIT_FAIL;
}
-
+
// determine type
m_type = VECTREX_STD;
if (!memcmp(ROM + 0x06, "SRAM", 4))
- m_type = VECTREX_SRAM;
+ m_type = VECTREX_SRAM;
if (size > 0x8000)
m_type = VECTREX_64K;
-
+
//printf("Type: %s\n", vectrex_get_slot(m_type));
// determine 3D setup (to help video setup at machine_start)
if (!memcmp(ROM + 0x11, "NARROW", 6) && (ROM[0x39] == 0x0c))
m_vec3d = VEC3D_NARROW;
-
+
if (!memcmp(ROM + 0x11, "CRAZY COASTER", 13))
m_vec3d = VEC3D_CCOAST;
-
+
if (!memcmp(ROM + 0x11, "3D MINE STORM", 13))
m_vec3d = VEC3D_MINEST;
@@ -229,9 +229,9 @@ void vectrex_cart_slot_device::get_default_card_software(astring &result)
int type = VECTREX_STD;
core_fread(m_file, rom, size);
-
+
if (!memcmp(rom + 0x06, "SRAM", 4))
- type = VECTREX_SRAM;
+ type = VECTREX_SRAM;
if (size > 0x8000)
type = VECTREX_64K;
@@ -278,5 +278,3 @@ WRITE8_MEMBER(vectrex_cart_slot_device::write_bank)
if (m_cart)
m_cart->write_bank(space, offset, data);
}
-
-
diff --git a/src/emu/bus/vectrex/slot.h b/src/emu/bus/vectrex/slot.h
index 1fd7b0299cc..10682f7204a 100644
--- a/src/emu/bus/vectrex/slot.h
+++ b/src/emu/bus/vectrex/slot.h
@@ -111,6 +111,5 @@ extern const device_type VECTREX_CART_SLOT;
#define MCFG_VECTREX_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, VECTREX_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/vic20/fe3.c b/src/emu/bus/vic20/fe3.c
index 7aeecb9e12c..d7a7616cfca 100644
--- a/src/emu/bus/vic20/fe3.c
+++ b/src/emu/bus/vic20/fe3.c
@@ -11,11 +11,11 @@
/*
- TODO:
+ TODO:
- - fe3diag register error#2 hp=5592 (same error in VICE)
- - SD card
- - RTC
+ - fe3diag register error#2 hp=5592 (same error in VICE)
+ - SD card
+ - RTC
*/
@@ -32,25 +32,25 @@
#define ATF1504AS_TAG "ic4"
#define REG1_BANK \
- ((m_reg1 & 0x7f) << 15)
+ ((m_reg1 & 0x7f) << 15)
#define LORAM_HIDDEN \
- (m_reg2 & REG2_BLK0)
+ (m_reg2 & REG2_BLK0)
#define BLK1_HIDDEN \
- (m_reg2 & REG2_BLK1)
+ (m_reg2 & REG2_BLK1)
#define BLK2_HIDDEN \
- (m_reg2 & REG2_BLK2)
+ (m_reg2 & REG2_BLK2)
#define BLK3_HIDDEN \
- (m_reg2 & REG2_BLK3)
+ (m_reg2 & REG2_BLK3)
#define BLK5_HIDDEN \
- (m_reg2 & REG2_BLK5)
+ (m_reg2 & REG2_BLK5)
#define REGISTERS_HIDDEN \
- ((m_lockbit && ((m_reg1 & REG1_MODE_MASK) == REG1_START)) || (m_reg2 & REG2_IO3))
+ ((m_lockbit && ((m_reg1 & REG1_MODE_MASK) == REG1_START)) || (m_reg2 & REG2_IO3))
@@ -178,7 +178,7 @@ UINT8 vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset,
{
data = m_ram[get_address(0, 0, offset)];
}
-
+
// read from ROM
if (!blk1 && !BLK1_HIDDEN)
{
@@ -203,7 +203,7 @@ UINT8 vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset,
data = read_register(BIT(offset, 0));
}
break;
-
+
case REG1_RAM_1:
// read from RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN)
@@ -235,7 +235,7 @@ UINT8 vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset,
data = read_register(BIT(offset, 0));
}
break;
-
+
case REG1_RAM_2:
// read from RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN)
@@ -267,7 +267,7 @@ UINT8 vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset,
data = read_register(BIT(offset, 0));
}
break;
-
+
case REG1_SUPER_RAM:
// read from RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN)
@@ -299,14 +299,14 @@ UINT8 vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset,
data = read_register(BIT(offset, 0));
}
break;
-
+
case REG1_RAM_ROM:
// read from RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN)
{
data = m_ram[get_address(0, 0, offset)];
}
-
+
// read from ROM bank 0 or RAM bank 1
if (!blk1 && !BLK1_HIDDEN)
{
@@ -331,7 +331,7 @@ UINT8 vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset,
data = read_register(BIT(offset, 0));
}
break;
-
+
case REG1_FLASH:
// read from RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN)
@@ -392,7 +392,7 @@ void vic20_final_expansion_3_t::vic20_cd_w(address_space &space, offs_t offset,
write_register(BIT(offset, 0), data);
}
break;
-
+
case REG1_SUPER_ROM:
// write to RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN)
@@ -424,7 +424,7 @@ void vic20_final_expansion_3_t::vic20_cd_w(address_space &space, offs_t offset,
write_register(BIT(offset, 0), data);
}
break;
-
+
case REG1_RAM_1:
// write to RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN && REG1_BLK0)
@@ -456,7 +456,7 @@ void vic20_final_expansion_3_t::vic20_cd_w(address_space &space, offs_t offset,
write_register(BIT(offset, 0), data);
}
break;
-
+
case REG1_RAM_2:
// write to RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN && REG1_BLK0)
@@ -488,7 +488,7 @@ void vic20_final_expansion_3_t::vic20_cd_w(address_space &space, offs_t offset,
write_register(BIT(offset, 0), data);
}
break;
-
+
case REG1_SUPER_RAM:
// write to RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN)
@@ -520,7 +520,7 @@ void vic20_final_expansion_3_t::vic20_cd_w(address_space &space, offs_t offset,
write_register(BIT(offset, 0), data);
}
break;
-
+
case REG1_RAM_ROM:
// write to RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN && REG1_BLK0)
@@ -552,7 +552,7 @@ void vic20_final_expansion_3_t::vic20_cd_w(address_space &space, offs_t offset,
write_register(BIT(offset, 0), data);
}
break;
-
+
case REG1_FLASH:
// write to RAM bank 0
if ((!ram1 || !ram2 || !ram3) && !LORAM_HIDDEN)
diff --git a/src/emu/bus/vic20/fe3.h b/src/emu/bus/vic20/fe3.h
index 81ab92748c6..9a209f44fbe 100644
--- a/src/emu/bus/vic20/fe3.h
+++ b/src/emu/bus/vic20/fe3.h
@@ -27,7 +27,7 @@
// ======================> vic20_final_expansion_3_t
class vic20_final_expansion_3_t : public device_t,
- public device_vic20_expansion_card_interface
+ public device_vic20_expansion_card_interface
{
public:
// construction/destruction
diff --git a/src/emu/bus/wswan/rom.c b/src/emu/bus/wswan/rom.c
index 4b27d7fe348..1bac91a4a5d 100644
--- a/src/emu/bus/wswan/rom.c
+++ b/src/emu/bus/wswan/rom.c
@@ -154,7 +154,7 @@ void ws_rom_device::device_timer(emu_timer &timer, device_timer_id id, int param
m_rtc_second++;
if ((m_rtc_second & 0x0f) > 9)
m_rtc_second = (m_rtc_second & 0xf0) + 0x10;
-
+
// check for minute passed
if (m_rtc_second >= 0x60)
{
@@ -163,7 +163,7 @@ void ws_rom_device::device_timer(emu_timer &timer, device_timer_id id, int param
if ((m_rtc_minute & 0x0f) > 9)
m_rtc_minute = (m_rtc_minute & 0xf0) + 0x10;
}
-
+
// check for hour passed
if (m_rtc_minute >= 0x60)
{
@@ -174,7 +174,7 @@ void ws_rom_device::device_timer(emu_timer &timer, device_timer_id id, int param
if (m_rtc_hour == 0x12)
m_rtc_hour |= 0x80;
}
-
+
// check for day passed
if (m_rtc_hour >= 0x24)
{
@@ -217,7 +217,7 @@ READ8_MEMBER(ws_rom_device::read_io)
case 0x0b: // RTC data
if (!m_has_rtc)
break;
-
+
if (m_io_regs[0x0a] == 0x95 && (m_rtc_index < 7))
{
switch (m_rtc_index)
@@ -307,7 +307,7 @@ WRITE8_MEMBER(ws_rom_device::write_io)
case 0x0b: // RTC Data
if (!m_has_rtc)
break;
-
+
if (m_io_regs[0x0a] == 0x94 && m_rtc_index < 7)
{
switch (m_rtc_index)
@@ -339,7 +339,7 @@ WRITE8_MEMBER(ws_rom_sram_device::write_ram)
}
WRITE8_MEMBER(ws_rom_sram_device::write_io)
-{
+{
switch (offset)
{
case 0x01: // SRAM bank to select
@@ -354,7 +354,7 @@ WRITE8_MEMBER(ws_rom_sram_device::write_io)
READ8_MEMBER(ws_rom_eeprom_device::read_io)
{
UINT8 value = m_io_regs[offset];
-
+
switch (offset)
{
case 0x04:
@@ -368,29 +368,29 @@ READ8_MEMBER(ws_rom_eeprom_device::read_io)
value = ws_rom_device::read_io(space, offset);
break;
}
-
+
return value;
}
WRITE8_MEMBER(ws_rom_eeprom_device::write_io)
-{
+{
switch (offset)
{
case 0x06: /* EEPROM address lower bits port/EEPROM address and command port
- 1KBit EEPROM:
- Bit 0-5 - EEPROM address bit 1-6
- Bit 6-7 - Command
- 00 - Extended command address bit 4-5:
- 00 - Write disable
- 01 - Write all
- 10 - Erase all
- 11 - Write enable
- 01 - Write
- 10 - Read
- 11 - Erase
- 16KBit EEPROM:
- Bit 0-7 - EEPROM address bit 1-8
- */
+ 1KBit EEPROM:
+ Bit 0-5 - EEPROM address bit 1-6
+ Bit 6-7 - Command
+ 00 - Extended command address bit 4-5:
+ 00 - Write disable
+ 01 - Write all
+ 10 - Erase all
+ 11 - Write enable
+ 01 - Write
+ 10 - Read
+ 11 - Erase
+ 16KBit EEPROM:
+ Bit 0-7 - EEPROM address bit 1-8
+ */
switch (m_eeprom_mode)
{
case EEPROM_1K:
@@ -412,23 +412,23 @@ WRITE8_MEMBER(ws_rom_eeprom_device::write_io)
break;
case 0x07: /* EEPROM higher bits/command bits port
- 1KBit EEPROM:
- Bit 0 - Start
- Bit 1-7 - Unknown
- 16KBit EEPROM:
- Bit 0-1 - EEPROM address bit 9-10
- Bit 2-3 - Command
- 00 - Extended command address bit 0-1:
- 00 - Write disable
- 01 - Write all
- 10 - Erase all
- 11 - Write enable
- 01 - Write
- 10 - Read
- 11 - Erase
- Bit 4 - Start
- Bit 5-7 - Unknown
- */
+ 1KBit EEPROM:
+ Bit 0 - Start
+ Bit 1-7 - Unknown
+ 16KBit EEPROM:
+ Bit 0-1 - EEPROM address bit 9-10
+ Bit 2-3 - Command
+ 00 - Extended command address bit 0-1:
+ 00 - Write disable
+ 01 - Write all
+ 10 - Erase all
+ 11 - Write enable
+ 01 - Write
+ 10 - Read
+ 11 - Erase
+ Bit 4 - Start
+ Bit 5-7 - Unknown
+ */
switch (m_eeprom_mode)
{
case EEPROM_1K:
@@ -450,7 +450,7 @@ WRITE8_MEMBER(ws_rom_eeprom_device::write_io)
m_eeprom_command = m_eeprom_command & 0x0c;
m_eeprom_start = (data >> 4) & 0x01;
break;
-
+
default:
logerror( "Write EEPROM address/command register C7 for unsupported EEPROM type\n" );
break;
@@ -458,19 +458,19 @@ WRITE8_MEMBER(ws_rom_eeprom_device::write_io)
break;
case 0x08: /* EEPROM command
- Bit 0 - Read complete (read only)
- Bit 1 - Write complete (read only)
- Bit 2-3 - Unknown
- Bit 4 - Read
- Bit 5 - Write
- Bit 6 - Protect
- Bit 7 - Initialize
- */
- if (data & 0x80) // Initialize
+ Bit 0 - Read complete (read only)
+ Bit 1 - Write complete (read only)
+ Bit 2-3 - Unknown
+ Bit 4 - Read
+ Bit 5 - Write
+ Bit 6 - Protect
+ Bit 7 - Initialize
+ */
+ if (data & 0x80) // Initialize
logerror("Unsupported EEPROM command 'Initialize'\n");
- if (data & 0x40) // Protect
- {
+ if (data & 0x40) // Protect
+ {
switch (m_eeprom_command)
{
case 0x00:
@@ -487,7 +487,7 @@ WRITE8_MEMBER(ws_rom_eeprom_device::write_io)
}
}
- if (data & 0x20) // Write
+ if (data & 0x20) // Write
{
if (m_eeprom_write_enabled)
{
@@ -505,7 +505,7 @@ WRITE8_MEMBER(ws_rom_eeprom_device::write_io)
}
}
- if (data & 0x10) // Read
+ if (data & 0x10) // Read
{
m_io_regs[0x04] = m_nvram[(m_eeprom_address << 1) + 1];
m_io_regs[0x05] = m_nvram[m_eeprom_address << 1];
diff --git a/src/emu/bus/wswan/rom.h b/src/emu/bus/wswan/rom.h
index 2ee51e35d43..7c64f8cda02 100644
--- a/src/emu/bus/wswan/rom.h
+++ b/src/emu/bus/wswan/rom.h
@@ -53,11 +53,11 @@ class ws_rom_sram_device : public ws_rom_device
public:
// construction/destruction
ws_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -75,11 +75,11 @@ class ws_rom_eeprom_device : public ws_rom_device
public:
// construction/destruction
ws_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_io);
virtual DECLARE_WRITE8_MEMBER(write_io);
diff --git a/src/emu/bus/wswan/slot.c b/src/emu/bus/wswan/slot.c
index 9d5772fd479..72fa3d21677 100644
--- a/src/emu/bus/wswan/slot.c
+++ b/src/emu/bus/wswan/slot.c
@@ -167,10 +167,10 @@ bool ws_cart_slot_device::call_load()
UINT8 *ROM;
UINT32 size = (software_entry() == NULL) ? length() : get_software_region_length("rom");
UINT32 nvram_size = 0;
-
+
m_cart->rom_alloc(size, tag());
ROM = m_cart->get_rom_base();
-
+
if (software_entry() == NULL)
fread(ROM, size);
else
@@ -261,35 +261,35 @@ int ws_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len, UINT32 &nvram_len
{
case 0x00:
break;
- case 0x01: // SRAM 64Kbit
+ case 0x01: // SRAM 64Kbit
type = WS_SRAM;
nvram_len = 0x2000;
break;
- case 0x02: // SRAM 256Kbit
+ case 0x02: // SRAM 256Kbit
type = WS_SRAM;
nvram_len = 0x8000;
break;
- case 0x05: // SRAM 512Kbit
+ case 0x05: // SRAM 512Kbit
type = WS_SRAM;
nvram_len = 0x10000;
break;
- case 0x03: // SRAM 1Mbit
+ case 0x03: // SRAM 1Mbit
type = WS_SRAM;
nvram_len = 0x20000;
break;
- case 0x04: // SRAM 2Mbit
+ case 0x04: // SRAM 2Mbit
type = WS_SRAM;
nvram_len = 0x40000;
break;
- case 0x10: // EEPROM 1Kbit
+ case 0x10: // EEPROM 1Kbit
type = WS_EEPROM;
nvram_len = 0x80;
break;
- case 0x50: // EEPROM 8Kbit
+ case 0x50: // EEPROM 8Kbit
type = WS_EEPROM;
nvram_len = 0x400;
break;
- case 0x20: // EEPROM 16Kbit
+ case 0x20: // EEPROM 16Kbit
type = WS_EEPROM;
nvram_len = 0x800;
break;
@@ -298,7 +298,7 @@ int ws_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len, UINT32 &nvram_len
logerror("Unknown RAM size [0x%X]\n", ROM[(chunks - 1) * 0x10000 + 0xfffb]);
break;
}
-
+
return type;
}
@@ -315,7 +315,7 @@ void ws_cart_slot_device::get_default_card_software(astring &result)
dynamic_buffer rom(size);
int type;
UINT32 nvram;
-
+
core_fread(m_file, rom, size);
// nvram size is not really used here, but we set it up nevertheless
@@ -427,9 +427,9 @@ void ws_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 offs, UINT3
int sum = 0, banks = len / 0x10000;
UINT8 romsize, ramtype, ramsize;
romsize = ROM[offs + 0xfffa];
- ramtype = (ROM[offs + 0xfffb] & 0xf0) ? 1 : 0; // 1 = EEPROM, 0 = SRAM
+ ramtype = (ROM[offs + 0xfffb] & 0xf0) ? 1 : 0; // 1 = EEPROM, 0 = SRAM
ramsize = ramtype ? ((ROM[offs + 0xfffb] & 0xf0) >> 4) : (ROM[offs + 0xfffb] & 0x0f);
-
+
logerror( "ROM DETAILS\n" );
logerror( "===========\n\n" );
diff --git a/src/emu/bus/wswan/slot.h b/src/emu/bus/wswan/slot.h
index cde3d81c3a6..97e838be793 100644
--- a/src/emu/bus/wswan/slot.h
+++ b/src/emu/bus/wswan/slot.h
@@ -40,7 +40,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_nvram_size() { return m_nvram.count(); }
- void save_nvram() { device().save_item(NAME(m_nvram)); }
+ void save_nvram() { device().save_item(NAME(m_nvram)); }
void set_has_rtc(bool val) { m_has_rtc = val; }
void set_is_rotated(bool val) { m_is_rotated = val; }
int get_is_rotated() { return m_is_rotated ? 1 : 0; }
@@ -81,7 +81,7 @@ public:
int get_cart_type(UINT8 *ROM, UINT32 len, UINT32 &nvram_len);
void internal_header_logging(UINT8 *ROM, UINT32 offs, UINT32 len);
- void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); }
+ void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -125,6 +125,5 @@ extern const device_type WS_CART_SLOT;
#define MCFG_WSWAN_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, WS_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c
index ba275d9dc37..33de16f4709 100644
--- a/src/emu/cpu/dsp56k/dsp56k.c
+++ b/src/emu/cpu/dsp56k/dsp56k.c
@@ -106,13 +106,13 @@ const device_type DSP56156 = &device_creator<dsp56k_device>;
* Internal Memory Maps
****************************************************************************/
static ADDRESS_MAP_START( dsp56156_program_map, AS_PROGRAM, 16, dsp56k_device )
- AM_RANGE(0x0000,0x07ff) AM_READWRITE(program_r, program_w) /* 1-5 */
+ AM_RANGE(0x0000,0x07ff) AM_READWRITE(program_r, program_w) /* 1-5 */
// AM_RANGE(0x2f00,0x2fff) AM_ROM /* 1-5 PROM reserved memory. Is this the right spot for it? */
ADDRESS_MAP_END
static ADDRESS_MAP_START( dsp56156_x_data_map, AS_DATA, 16, dsp56k_device )
- AM_RANGE(0x0000,0x07ff) AM_RAM /* 1-5 */
- AM_RANGE(0xffc0,0xffff) AM_READWRITE(peripheral_register_r, peripheral_register_w) /* 1-5 On-chip peripheral registers memory mapped in data space */
+ AM_RANGE(0x0000,0x07ff) AM_RAM /* 1-5 */
+ AM_RANGE(0xffc0,0xffff) AM_READWRITE(peripheral_register_r, peripheral_register_w) /* 1-5 On-chip peripheral registers memory mapped in data space */
ADDRESS_MAP_END
@@ -288,7 +288,7 @@ void dsp56k_device::device_start()
save_item(NAME(m_dsp56k_core.HI.trxh));
save_item(NAME(m_dsp56k_core.HI.trxl));
save_item(NAME(m_dsp56k_core.HI.bootstrap_offset));
-
+
save_item(NAME(m_dsp56k_core.peripheral_ram));
save_item(NAME(m_dsp56k_core.program_ram));
@@ -514,4 +514,3 @@ offs_t dsp56k_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o
extern CPU_DISASSEMBLE( dsp56k );
return CPU_DISASSEMBLE_NAME(dsp56k)(this, buffer, pc, oprom, opram, options);
}
-
diff --git a/src/emu/cpu/hd61700/hd61700.c b/src/emu/cpu/hd61700/hd61700.c
index 8aeee1faad2..21c040851da 100644
--- a/src/emu/cpu/hd61700/hd61700.c
+++ b/src/emu/cpu/hd61700/hd61700.c
@@ -138,7 +138,7 @@ void hd61700_cpu_device::device_start()
m_kb_write_cb.resolve_safe();
m_port_read_cb.resolve_safe(0xff);
m_port_write_cb.resolve_safe();
-
+
// save state
save_item(NAME(m_ppc));
save_item(NAME(m_curpc));
diff --git a/src/emu/cpu/hd61700/hd61700.h b/src/emu/cpu/hd61700/hd61700.h
index 35ede0a3edc..255fc128aa8 100644
--- a/src/emu/cpu/hd61700/hd61700.h
+++ b/src/emu/cpu/hd61700/hd61700.h
@@ -76,7 +76,7 @@ public:
template<class _Object> static devcb_base &set_kb_read_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_kb_read_cb.set_callback(object); }
template<class _Object> static devcb_base &set_port_write_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_port_write_cb.set_callback(object); }
template<class _Object> static devcb_base &set_port_read_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_port_read_cb.set_callback(object); }
-
+
protected:
// device-level overrides
virtual void device_start();
@@ -155,7 +155,7 @@ protected:
devcb_write8 m_kb_write_cb; //keyboard matrix write
devcb_read8 m_port_read_cb; //8 bit port read
devcb_write8 m_port_write_cb; //8 bit port write
-
+
// flag definitions
static const int FLAG_Z = 0x80;
static const int FLAG_C = 0x40;
diff --git a/src/emu/cpu/i86/i186.c b/src/emu/cpu/i86/i186.c
index 6d6e418ec7f..801bf76a400 100644
--- a/src/emu/cpu/i86/i186.c
+++ b/src/emu/cpu/i86/i186.c
@@ -594,14 +594,14 @@ void i80186_cpu_device::device_start()
save_item(NAME(m_mem.middle_size));
save_item(NAME(m_mem.peripheral));
save_item(NAME(m_reloc));
-
+
// zerofill
memset(m_timer, 0, sizeof(m_timer));
memset(m_dma, 0, sizeof(m_dma));
memset(&m_intr, 0, sizeof(intr_state));
memset(&m_mem, 0, sizeof(mem_state));
m_reloc = 0;
-
+
m_timer[0].int_timer = timer_alloc(TIMER_INT0);
m_timer[1].int_timer = timer_alloc(TIMER_INT1);
m_timer[2].int_timer = timer_alloc(TIMER_INT2);
@@ -633,7 +633,7 @@ void i80186_cpu_device::device_reset()
m_intr.poll_status = 0x0000;
m_intr.ext_state = 0x00;
m_reloc = 0x20ff;
-
+
for (int i = 0; i < ARRAY_LENGTH(m_dma); i++)
{
m_dma[i].drq_state = false;
@@ -1477,7 +1477,7 @@ READ16_MEMBER(i80186_cpu_device::internal_port_r)
WRITE16_MEMBER(i80186_cpu_device::internal_port_w)
{
int which;
-
+
switch (offset)
{
case 0x11:
diff --git a/src/emu/cpu/mcs96/mcs96.c b/src/emu/cpu/mcs96/mcs96.c
index 4212039cc6d..e180a69a9ea 100644
--- a/src/emu/cpu/mcs96/mcs96.c
+++ b/src/emu/cpu/mcs96/mcs96.c
@@ -112,8 +112,8 @@ void mcs96_device::execute_run()
{
internal_update(total_cycles());
- // if(inst_substate)
- // do_exec_partial();
+ // if(inst_substate)
+ // do_exec_partial();
while(icount > 0) {
while(icount > bcount) {
@@ -125,8 +125,8 @@ void mcs96_device::execute_run()
}
while(bcount && icount <= bcount)
internal_update(total_cycles() + icount - bcount);
- // if(inst_substate)
- // do_exec_partial();
+ // if(inst_substate)
+ // do_exec_partial();
}
}
diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c
index a91465dd494..b8c67dc8694 100644
--- a/src/emu/cpu/mips/mips3drc.c
+++ b/src/emu/cpu/mips/mips3drc.c
@@ -2483,7 +2483,7 @@ int mips3_device::generate_get_cop0_reg(drcuml_block *block, compiler_state *com
void mips3_device::generate_badcop(drcuml_block *block, const int cop)
{
UML_TEST(block, CPR032(COP0_Status), SR_COP0 << cop); // test [Status], SR_COP0 << cop
- UML_EXHc(block, COND_Z, *m_exception[EXCEPTION_BADCOP], cop); // exh badcop,cop,Z
+ UML_EXHc(block, COND_Z, *m_exception[EXCEPTION_BADCOP], cop); // exh badcop,cop,Z
}
/*-------------------------------------------------------------------------
diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c
index 939eb069f13..8bd0b6ec454 100644
--- a/src/emu/cpu/rsp/rsp.c
+++ b/src/emu/cpu/rsp/rsp.c
@@ -466,30 +466,30 @@ void rsp_device::device_start()
m_regmap[regnum] = (regnum == 0) ? uml::parameter(0) : uml::parameter::make_memory(&m_rsp_state->r[regnum]);
}
- /*
- drcbe_info beinfo;
- m_drcuml->get_backend_info(beinfo);
- if (beinfo.direct_iregs > 2)
- {
- m_regmap[30] = I2;
- }
- if (beinfo.direct_iregs > 3)
- {
- m_regmap[31] = I3;
- }
- if (beinfo.direct_iregs > 4)
- {
- m_regmap[2] = I4;
- }
- if (beinfo.direct_iregs > 5)
- {
- m_regmap[3] = I5;
- }
- if (beinfo.direct_iregs > 6)
- {
- m_regmap[4] = I6;
- }
- */
+ /*
+ drcbe_info beinfo;
+ m_drcuml->get_backend_info(beinfo);
+ if (beinfo.direct_iregs > 2)
+ {
+ m_regmap[30] = I2;
+ }
+ if (beinfo.direct_iregs > 3)
+ {
+ m_regmap[31] = I3;
+ }
+ if (beinfo.direct_iregs > 4)
+ {
+ m_regmap[2] = I4;
+ }
+ if (beinfo.direct_iregs > 5)
+ {
+ m_regmap[3] = I5;
+ }
+ if (beinfo.direct_iregs > 6)
+ {
+ m_regmap[4] = I6;
+ }
+ */
/* mark the cache dirty so it is updated on next execute */
m_cache_dirty = TRUE;
@@ -870,7 +870,7 @@ void rsp_device::device_stop()
}
if (m_drcfe )
{
- auto_free(machine(), m_drcfe);
+ auto_free(machine(), m_drcfe);
}
}
@@ -3565,5 +3565,3 @@ void rsp_device::execute_run()
}
}
-
-
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index e56f791d595..e2f5e9bb805 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -9029,4 +9029,3 @@ void rsp_device::log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 o
block->append_comment("%08X: %s", pc, buffer); // comment
#endif
}
-
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index c231b6cd8b4..0b27614c209 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -3080,8 +3080,8 @@ void sh4_base_device::device_reset()
inline void sh34_base_device::execute_one_0000(const UINT16 opcode)
{
- switch(opcode & 0xff)
- {
+ switch(opcode & 0xff)
+ {
// 0x00
case 0x00: NOP(opcode); break;
case 0x10: NOP(opcode); break;
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index b002cae45f7..c5854ba8a6f 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -2415,54 +2415,54 @@ TIMER_CALLBACK_MEMBER( tlcs90_device::t90_timer_callback )
if ( (m_internal_registers[ T90_TRUN - T90_IOBASE ] & (1 << i)) == 0 )
return;
- timer_fired = 0;
+ timer_fired = 0;
mode = (m_internal_registers[ T90_TMOD - T90_IOBASE ] >> ((i & ~1) + 2)) & 0x03;
// Match
- switch (mode)
- {
- case 0x02: // 8bit PPG
- case 0x03: // 8bit PWM
- logerror("CPU Timer %d expired with unhandled mode %d\n", i, mode);
- // TODO: hmm...
- case 0x00: // 8bit
- m_timer_value[i]++;
- if ( m_timer_value[i] == m_internal_registers[ T90_TREG0+i - T90_IOBASE ] )
- timer_fired = 1;
- break;
-
- case 0x01: // 16bit
- if(i & 1)
- break;
- m_timer_value[i]++;
- if(m_timer_value[i] == 0) m_timer_value[i+1]++;
- if(m_timer_value[i+1] == m_internal_registers[ T90_TREG0+i+1 - T90_IOBASE ])
- if(m_timer_value[i] == m_internal_registers[ T90_TREG0+i - T90_IOBASE ])
- timer_fired = 1;
- break;
- }
-
- if(timer_fired) {
- // special stuff handling
- switch(mode) {
- case 0x02: // 8bit PPG
- case 0x03: // 8bit PWM
- // TODO: hmm...
- case 0x00: // 8bit
- if(i & 1)
- break;
- if ( (m_internal_registers[ T90_TCLK - T90_IOBASE ] & (0x0C << (i * 2))) == 0 ) // T0/T1 match signal clocks T1/T3
- t90_timer_callback(ptr, i+1);
- break;
- case 0x01: // 16bit, only can happen for i=0,2
- m_timer_value[i+1] = 0;
- set_irq_line(INTT0 + i+1, 1);
- break;
- }
- // regular handling
- m_timer_value[i] = 0;
- set_irq_line(INTT0 + i, 1);
- }
+ switch (mode)
+ {
+ case 0x02: // 8bit PPG
+ case 0x03: // 8bit PWM
+ logerror("CPU Timer %d expired with unhandled mode %d\n", i, mode);
+ // TODO: hmm...
+ case 0x00: // 8bit
+ m_timer_value[i]++;
+ if ( m_timer_value[i] == m_internal_registers[ T90_TREG0+i - T90_IOBASE ] )
+ timer_fired = 1;
+ break;
+
+ case 0x01: // 16bit
+ if(i & 1)
+ break;
+ m_timer_value[i]++;
+ if(m_timer_value[i] == 0) m_timer_value[i+1]++;
+ if(m_timer_value[i+1] == m_internal_registers[ T90_TREG0+i+1 - T90_IOBASE ])
+ if(m_timer_value[i] == m_internal_registers[ T90_TREG0+i - T90_IOBASE ])
+ timer_fired = 1;
+ break;
+ }
+
+ if(timer_fired) {
+ // special stuff handling
+ switch(mode) {
+ case 0x02: // 8bit PPG
+ case 0x03: // 8bit PWM
+ // TODO: hmm...
+ case 0x00: // 8bit
+ if(i & 1)
+ break;
+ if ( (m_internal_registers[ T90_TCLK - T90_IOBASE ] & (0x0C << (i * 2))) == 0 ) // T0/T1 match signal clocks T1/T3
+ t90_timer_callback(ptr, i+1);
+ break;
+ case 0x01: // 16bit, only can happen for i=0,2
+ m_timer_value[i+1] = 0;
+ set_irq_line(INTT0 + i+1, 1);
+ break;
+ }
+ // regular handling
+ m_timer_value[i] = 0;
+ set_irq_line(INTT0 + i, 1);
+ }
}
TIMER_CALLBACK_MEMBER( tlcs90_device::t90_timer4_callback )
diff --git a/src/emu/cpu/tms32031/tms32031.h b/src/emu/cpu/tms32031/tms32031.h
index 427d0cd6d3d..92e1f35d80c 100644
--- a/src/emu/cpu/tms32031/tms32031.h
+++ b/src/emu/cpu/tms32031/tms32031.h
@@ -775,7 +775,7 @@ protected:
devcb_write8 m_xf0_cb;
devcb_write8 m_xf1_cb;
devcb_write8 m_iack_cb;
-
+
// tables
static void (tms3203x_device::*const s_tms32031ops[])(UINT32 op);
static UINT32 (tms3203x_device::*const s_indirect_d[0x20])(UINT32, UINT8);
diff --git a/src/emu/cpu/tms32051/tms32051.c b/src/emu/cpu/tms32051/tms32051.c
index 5df21dac096..2347ddf0632 100644
--- a/src/emu/cpu/tms32051/tms32051.c
+++ b/src/emu/cpu/tms32051/tms32051.c
@@ -45,7 +45,7 @@ const device_type TMS32051 = &device_creator<tms32051_device>;
**************************************************************************/
static ADDRESS_MAP_START( internal_pgm, AS_PROGRAM, 16, tms32051_device )
-// AM_RANGE(0x0000, 0x1fff) AM_ROM // ROM TODO: is off-chip if MP/_MC = 0
+// AM_RANGE(0x0000, 0x1fff) AM_ROM // ROM TODO: is off-chip if MP/_MC = 0
AM_RANGE(0x2000, 0x23ff) AM_RAM AM_SHARE("saram") // SARAM TODO: is off-chip if RAM bit = 0
AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE("daram_b0") // DARAM B0 TODO: is off-chip if CNF = 0
ADDRESS_MAP_END
@@ -406,7 +406,7 @@ READ16_MEMBER( tms32051_device::cpuregs_r )
case 0x1d: return m_cber2;
case 0x1e: return m_cbcr;
case 0x1f: return m_bmar;
-
+
case 0x20: return m_serial.drr;
case 0x21: return m_serial.dxr;
diff --git a/src/emu/cpu/tms32051/tms32051.h b/src/emu/cpu/tms32051/tms32051.h
index 97304de2ddf..ee1630311ef 100644
--- a/src/emu/cpu/tms32051/tms32051.h
+++ b/src/emu/cpu/tms32051/tms32051.h
@@ -134,7 +134,7 @@ private:
UINT16 tim;
UINT16 prd;
} m_timer;
-
+
struct
{
UINT16 drr;
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index 78e558575a8..22db4ceecad 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -37,7 +37,7 @@ tms340x0_device::tms340x0_device(const machine_config &mconfig, device_type type
, m_program_config("program", ENDIANNESS_LITTLE, 16, 32, 3)
, m_reset_deferred(FALSE)
, m_pixclock(0)
- , m_pixperclock(0)
+ , m_pixperclock(0)
, m_output_int_cb(*this)
{
}
@@ -574,7 +574,7 @@ void tms340x0_device::device_start()
m_output_int_cb.resolve();
m_to_shiftreg_cb.bind_relative_to(*owner());
m_from_shiftreg_cb.bind_relative_to(*owner());
-
+
m_external_host_access = FALSE;
m_program = &space(AS_PROGRAM);
diff --git a/src/emu/cpu/tms34010/tms34010.h b/src/emu/cpu/tms34010/tms34010.h
index d890555735e..c2feb5746ef 100644
--- a/src/emu/cpu/tms34010/tms34010.h
+++ b/src/emu/cpu/tms34010/tms34010.h
@@ -190,29 +190,29 @@ struct tms34010_display_params
#define MCFG_TMS340X0_HALT_ON_RESET(_value) \
tms340x0_device::set_halt_on_reset(*device, _value);
-
+
#define MCFG_TMS340X0_PIXEL_CLOCK(_value) \
tms340x0_device::set_pixel_clock(*device, _value);
-
+
#define MCFG_TMS340X0_PIXELS_PER_CLOCK(_value) \
tms340x0_device::set_pixels_per_clock(*device, _value);
-
+
typedef device_delegate<void (screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)> scanline_ind16_cb_delegate;
#define TMS340X0_SCANLINE_IND16_CB_MEMBER(_name) void _name(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params)
-
+
#define MCFG_TMS340X0_SCANLINE_IND16_CB(_class, _method) \
- tms340x0_device::set_scanline_ind16_callback(*device, scanline_ind16_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
-
+ tms340x0_device::set_scanline_ind16_callback(*device, scanline_ind16_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
+
typedef device_delegate<void (screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)> scanline_rgb32_cb_delegate;
#define TMS340X0_SCANLINE_RGB32_CB_MEMBER(_name) void _name(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
#define MCFG_TMS340X0_SCANLINE_RGB32_CB(_class, _method) \
- tms340x0_device::set_scanline_rgb32_callback(*device, scanline_rgb32_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
+ tms340x0_device::set_scanline_rgb32_callback(*device, scanline_rgb32_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
+
-
#define MCFG_TMS340X0_OUTPUT_INT_CB(_devcb) \
devcb = &tms340x0_device::set_output_int_callback(*device, DEVCB_##_devcb);
@@ -220,21 +220,21 @@ typedef device_delegate<void (screen_device &screen, bitmap_rgb32 &bitmap, int s
typedef device_delegate<void (address_space &space, offs_t address, UINT16 *shiftreg)> to_shiftreg_cb_delegate;
#define TMS340X0_TO_SHIFTREG_CB_MEMBER(_name) void _name(address_space &space, offs_t address, UINT16 *shiftreg)
-
+
#define MCFG_TMS340X0_TO_SHIFTREG_CB(_class, _method) \
- tms340x0_device::set_to_shiftreg_callback(*device, to_shiftreg_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
-
+ tms340x0_device::set_to_shiftreg_callback(*device, to_shiftreg_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
+
typedef device_delegate<void (address_space &space, offs_t address, UINT16 *shiftreg)> from_shiftreg_cb_delegate;
#define TMS340X0_FROM_SHIFTREG_CB_MEMBER(_name) void _name(address_space &space, offs_t address, UINT16 *shiftreg)
#define MCFG_TMS340X0_FROM_SHIFTREG_CB(_class, _method) \
- tms340x0_device::set_from_shiftreg_callback(*device, from_shiftreg_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
+ tms340x0_device::set_from_shiftreg_callback(*device, from_shiftreg_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
+
-
class tms340x0_device : public cpu_device,
- public device_video_interface
+ public device_video_interface
{
public:
// construction/destruction
@@ -337,9 +337,9 @@ protected:
int m_pixperclock; /* pixels per clock */
emu_timer *m_scantimer;
int m_icount;
-
- scanline_ind16_cb_delegate m_scanline_ind16_cb;
- scanline_rgb32_cb_delegate m_scanline_rgb32_cb;
+
+ scanline_ind16_cb_delegate m_scanline_ind16_cb;
+ scanline_rgb32_cb_delegate m_scanline_rgb32_cb;
devcb_write_line m_output_int_cb; /* output interrupt callback */
to_shiftreg_cb_delegate m_to_shiftreg_cb; /* shift register write */
from_shiftreg_cb_delegate m_from_shiftreg_cb; /* shift register read */
diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c
index ed0b0276012..b6ab60ab9b0 100644
--- a/src/emu/cpu/tms7000/tms7000.c
+++ b/src/emu/cpu/tms7000/tms7000.c
@@ -899,7 +899,7 @@ void tms70c46_device::device_start()
{
// init/zerofill
m_control = 0;
-
+
// register for savestates
save_item(NAME(m_control));
@@ -910,7 +910,7 @@ void tms70c46_device::device_reset()
{
m_control = 0;
m_io->write_byte(TMS7000_PORTE, 0xff);
-
+
tms7000_device::device_reset();
}
diff --git a/src/emu/cpu/tms7000/tms7000.h b/src/emu/cpu/tms7000/tms7000.h
index 20fa8d9b993..633015fe0bb 100644
--- a/src/emu/cpu/tms7000/tms7000.h
+++ b/src/emu/cpu/tms7000/tms7000.h
@@ -313,7 +313,7 @@ public:
DECLARE_READ8_MEMBER(control_r);
DECLARE_WRITE8_MEMBER(control_w);
-
+
DECLARE_READ8_MEMBER(dockbus_status_r);
DECLARE_WRITE8_MEMBER(dockbus_status_w);
DECLARE_READ8_MEMBER(dockbus_data_r);
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index 0b8a9d33d51..b05c702b587 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -1931,7 +1931,7 @@ void device_debug::instruction_hook(offs_t curpc)
machine.debug_view().flush_osd_updates();
machine.manager().web()->serve();
-
+
// clear the memory modified flag and wait
global->memory_modified = false;
if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
diff --git a/src/emu/devcpu.c b/src/emu/devcpu.c
index 797a8b49efa..d67752d68a6 100644
--- a/src/emu/devcpu.c
+++ b/src/emu/devcpu.c
@@ -38,4 +38,3 @@ cpu_device::cpu_device(const machine_config &mconfig, device_type type, const ch
cpu_device::~cpu_device()
{
}
-
diff --git a/src/emu/diimage.c b/src/emu/diimage.c
index a965c5bf5e0..5345db27ec4 100644
--- a/src/emu/diimage.c
+++ b/src/emu/diimage.c
@@ -1229,9 +1229,9 @@ software_part *device_image_interface::find_software_item(const char *path, bool
if (swinfo_name == swlistdev->list_name())
{
- // ad hoc handling for the case path = swlist_name:swinfo_name (e.g.
- // gameboy:sml) which is not handled properly by software_name_split
- // since the function cannot distinguish between this and the case
+ // ad hoc handling for the case path = swlist_name:swinfo_name (e.g.
+ // gameboy:sml) which is not handled properly by software_name_split
+ // since the function cannot distinguish between this and the case
// path = swinfo_name:swpart_name
software_info *info = swlistdev->find(swpart_name);
if (info != NULL)
diff --git a/src/emu/imagedev/floppy.c b/src/emu/imagedev/floppy.c
index a73463f77b7..bcdf93073fb 100644
--- a/src/emu/imagedev/floppy.c
+++ b/src/emu/imagedev/floppy.c
@@ -885,7 +885,7 @@ void ui_menu_control_floppy_image::hook_load(astring filename, bool softlist)
input_filename = filename;
input_format = static_cast<floppy_image_device *>(image)->identify(filename);
- if (!input_format)
+ if (!input_format)
{
popmessage("Error: %s\n", image->error());
ui_menu::stack_pop(machine());
diff --git a/src/emu/machine.c b/src/emu/machine.c
index 0c89f6866ca..496becef381 100644
--- a/src/emu/machine.c
+++ b/src/emu/machine.c
@@ -379,7 +379,7 @@ int running_machine::run(bool firstrun)
#endif
manager().web()->serve();
-
+
// execute CPUs if not paused
if (!m_paused)
m_scheduler.timeslice();
diff --git a/src/emu/machine/mb8421.c b/src/emu/machine/mb8421.c
index 12f912971be..0d3cb819a66 100644
--- a/src/emu/machine/mb8421.c
+++ b/src/emu/machine/mb8421.c
@@ -4,7 +4,7 @@
Fujitsu MB8421/22/31/32-90/-90L/-90LL/-12/-12L/-12LL
CMOS 16K-bit (2KB) dual-port SRAM
-
+
MB84x2 lacks interrupt pins, it's basically as simple as AM_RAM AM_SHARE("x")
MB843x is same as MB842x, except that it supports slave mode. It makes
sure there are no clashes, with the _BUSY pin.
@@ -70,7 +70,7 @@ READ8_MEMBER(mb8421_device::left_r)
if (offset == 0x7fe && !space.debugger_access())
m_intl_handler(0);
-
+
return m_ram[offset];
}
@@ -89,6 +89,6 @@ READ8_MEMBER(mb8421_device::right_r)
if (offset == 0x7ff && !space.debugger_access())
m_intr_handler(0);
-
+
return m_ram[offset];
}
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c
index f75e18c6cd0..2b9448582dd 100644
--- a/src/emu/machine/pit8253.c
+++ b/src/emu/machine/pit8253.c
@@ -103,7 +103,7 @@ void pit8253_device::device_start()
for (int timerno = 0; timerno < PIT8253_MAX_TIMER; timerno++)
{
pit8253_timer *timer = get_timer(timerno);
-
+
/* initialize timer */
timer->updatetimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pit8253_device::update_timer_cb),this));
timer->updatetimer->adjust(attotime::never, timerno);
diff --git a/src/emu/machine/rp5h01.c b/src/emu/machine/rp5h01.c
index 40279665ca0..3535cbe0f4e 100644
--- a/src/emu/machine/rp5h01.c
+++ b/src/emu/machine/rp5h01.c
@@ -7,7 +7,7 @@
with a mask of %1010111. For example if the 8 dummy bits are $7c,
bits 64 to 127 are read as $7c $7c $00 $00 $7c $7c $00 $00.
To simplify this, our emulation expects 'overdumps', 128bits total.
-
+
TODO:
- not sure if the polarity of our PROM dumps (playch10) is correct,
same goes for the bit order (note: does not require new dumps)
diff --git a/src/emu/machine/smpc.c b/src/emu/machine/smpc.c
index 20bde988d77..add9009417c 100644
--- a/src/emu/machine/smpc.c
+++ b/src/emu/machine/smpc.c
@@ -172,7 +172,7 @@ void saturn_state::stv_select_game(int gameno)
memcpy(memregion("abus")->base(), m_cart_reg[gameno]->base(), 0x3000000);
else
memset(memregion("abus")->base(), 0x00, 0x3000000);
-
+
m_prev_bankswitch = gameno;
}
}
diff --git a/src/emu/machine/wozfdc.c b/src/emu/machine/wozfdc.c
index 0f9e79a0a35..a6f2a10167e 100644
--- a/src/emu/machine/wozfdc.c
+++ b/src/emu/machine/wozfdc.c
@@ -80,7 +80,7 @@ void wozfdc_device::device_start()
save_item(NAME(cur_lss.data_reg));
save_item(NAME(cur_lss.address));
save_item(NAME(cur_lss.write_start_time));
-// save_item(NAME(cur_lss.write_buffer));
+// save_item(NAME(cur_lss.write_buffer));
save_item(NAME(cur_lss.write_position));
save_item(NAME(cur_lss.write_line_active));
save_item(NAME(predicted_lss.tm));
@@ -88,7 +88,7 @@ void wozfdc_device::device_start()
save_item(NAME(predicted_lss.data_reg));
save_item(NAME(predicted_lss.address));
save_item(NAME(predicted_lss.write_start_time));
-// save_item(NAME(predicted_lss.write_buffer));
+// save_item(NAME(predicted_lss.write_buffer));
save_item(NAME(predicted_lss.write_position));
save_item(NAME(predicted_lss.write_line_active));
save_item(NAME(drvsel));
@@ -582,6 +582,6 @@ void appleiii_fdc::control_dx(int offset)
if (offset < 8)
{
- a3_update_drive_sel();
+ a3_update_drive_sel();
}
}
diff --git a/src/emu/sound/flt_rc.h b/src/emu/sound/flt_rc.h
index 8bfdecec973..aed08d8c0fe 100644
--- a/src/emu/sound/flt_rc.h
+++ b/src/emu/sound/flt_rc.h
@@ -73,7 +73,7 @@ public:
// static configuration
static void static_set_rc(device_t &device, int type, double R1, double R2, double R3, double C);
-
+
void filter_rc_set_RC(int type, double R1, double R2, double R3, double C);
protected:
@@ -91,10 +91,10 @@ private:
int m_k;
int m_memory;
int m_type;
- double m_R1;
- double m_R2;
- double m_R3;
- double m_C;
+ double m_R1;
+ double m_R2;
+ double m_R3;
+ double m_C;
};
extern const device_type FILTER_RC;
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index b4d0710fd78..32fc2921eb1 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -385,7 +385,7 @@ void k053260_device::KDSC_Voice::key_on()
else if (m_start + m_length >= m_device->m_rom_size)
logerror("K053260: Attempting to play past the end of the ROM ( start = %06x, length = %06x )\n",
- m_start, m_length);
+ m_start, m_length);
else
{
@@ -464,7 +464,7 @@ UINT8 k053260_device::KDSC_Voice::read_rom()
if (offs >= m_device->m_rom_size)
{
logerror("%s: K053260: Attempting to read past the end of the ROM (offs = %06x, size = %06x)\n",
- m_device->machine().describe_context(), offs, m_device->m_rom_size);
+ m_device->machine().describe_context(), offs, m_device->m_rom_size);
return 0;
}
diff --git a/src/emu/sound/k053260.h b/src/emu/sound/k053260.h
index 8e2e4731d29..735978fb32b 100644
--- a/src/emu/sound/k053260.h
+++ b/src/emu/sound/k053260.h
@@ -60,7 +60,7 @@ private:
UINT32 m_rom_size;
// live state
- UINT8 m_portdata[4];
+ UINT8 m_portdata[4];
UINT8 m_keyon;
UINT8 m_mode;
diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c
index 367b5dbcd8e..568d68e536c 100644
--- a/src/emu/sound/samples.c
+++ b/src/emu/sound/samples.c
@@ -264,7 +264,7 @@ void samples_device::device_start()
// initialize any custom handlers
m_samples_start_cb.bind_relative_to(*owner());
-
+
if (!m_samples_start_cb.isnull())
m_samples_start_cb();
}
diff --git a/src/emu/sound/samples.h b/src/emu/sound/samples.h
index 28639cc6e95..cb436329a0e 100644
--- a/src/emu/sound/samples.h
+++ b/src/emu/sound/samples.h
@@ -23,11 +23,11 @@
#define MCFG_SAMPLES_NAMES(_names) \
samples_device::static_set_samples_names(*device, _names);
-
+
typedef device_delegate<void ()> samples_start_cb_delegate;
#define SAMPLES_START_CB_MEMBER(_name) void _name()
-
+
#define MCFG_SAMPLES_START_CB(_class, _method) \
samples_device::set_samples_start_callback(*device, samples_start_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
@@ -74,7 +74,7 @@ public:
dynamic_array<INT16> data; // 16-bit signed data
};
static bool read_sample(emu_file &file, sample_t &sample);
-
+
// interface
UINT8 m_channels; // number of discrete audio channels needed
const char *const *m_names; // array of sample names
diff --git a/src/emu/sound/speaker.h b/src/emu/sound/speaker.h
index cc61ddf1101..ee6b3297f37 100644
--- a/src/emu/sound/speaker.h
+++ b/src/emu/sound/speaker.h
@@ -26,7 +26,7 @@ class speaker_sound_device : public device_t,
public:
speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~speaker_sound_device() {}
-
+
// static configuration
static void static_set_levels(device_t &device, int num_levels, const INT16 *levels) { downcast<speaker_sound_device &>(device).m_num_levels = num_levels; downcast<speaker_sound_device &>(device).m_levels = levels;}
@@ -80,7 +80,7 @@ private:
// DC blocker state
double m_prevx, m_prevy;
-
+
int m_num_levels; /* optional: number of levels (if not two) */
const INT16 *m_levels; /* optional: pointer to level lookup table */
};
diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c
index 93ea2d58c10..1e97e2673d2 100644
--- a/src/emu/sound/ymf278b.c
+++ b/src/emu/sound/ymf278b.c
@@ -75,7 +75,7 @@
// default address map
static ADDRESS_MAP_START( ymf278b, AS_0, 8, ymf278b_device )
- AM_RANGE(0x000000, 0x3fffff) AM_ROM
+ AM_RANGE(0x000000, 0x3fffff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/emu/sound/zsg2.c b/src/emu/sound/zsg2.c
index b8d1102b07d..08bff142957 100644
--- a/src/emu/sound/zsg2.c
+++ b/src/emu/sound/zsg2.c
@@ -142,7 +142,7 @@ void zsg2_device::device_reset()
prepare_samples(i);
FILE* f;
-
+
f = fopen("zoom_samples.bin","wb");
fwrite(m_mem_copy,1,m_mem_blocks*4,f);
fclose(f);
diff --git a/src/emu/ui/swlist.c b/src/emu/ui/swlist.c
index 95c4a489098..a2b6b7e46c5 100644
--- a/src/emu/ui/swlist.c
+++ b/src/emu/ui/swlist.c
@@ -68,7 +68,7 @@ void ui_menu_software_parts::populate()
entry2->part = 0;
item_append("[file manager]", 0, 0, entry2);
-
+
software_part_menu_entry *entry3 = (software_part_menu_entry *) m_pool_alloc(sizeof(*entry3));
entry3->type = T_SWLIST;
entry3->part = 0;
diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c
index 8d922696098..0d70c7e774a 100644
--- a/src/emu/ui/ui.c
+++ b/src/emu/ui/ui.c
@@ -1554,7 +1554,7 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
machine.pause();
return machine.ui().set_handler(ui_gfx_ui_handler, is_paused);
}
-
+
// handle a tape control key
if (ui_input_pressed(machine, IPT_UI_TAPE_START))
{
@@ -1574,7 +1574,7 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
return 0;
}
}
-
+
// handle a save state request
if (ui_input_pressed(machine, IPT_UI_SAVE_STATE))
{
diff --git a/src/emu/video/315_5124.c b/src/emu/video/315_5124.c
index e4a525d41cc..48aa0b670b9 100644
--- a/src/emu/video/315_5124.c
+++ b/src/emu/video/315_5124.c
@@ -677,7 +677,7 @@ WRITE8_MEMBER( sega315_5124_device::register_write )
reg_num = data & 0x0f;
m_reg[reg_num] = m_addr & 0xff;
//logerror("%s: %s: setting register %x to %02x\n", machine().describe_context(), tag(), reg_num, m_addr & 0xf );
-
+
switch (reg_num)
{
case 0:
diff --git a/src/emu/video/epic12.c b/src/emu/video/epic12.c
index de5e98e5c2c..3d42c07783f 100644
--- a/src/emu/video/epic12.c
+++ b/src/emu/video/epic12.c
@@ -41,7 +41,7 @@ void epic12_device::device_start()
m_bitmaps = auto_bitmap_rgb32_alloc(machine(), 0x2000, 0x1000);
m_clip = m_bitmaps->cliprect();
m_clip.set(0, 0x2000-1, 0, 0x1000-1);
-
+
m_ram16_copy = auto_alloc_array(machine(), UINT16, m_main_ramsize/2);
m_blitter_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(epic12_device::blitter_delay_callback),this));
diff --git a/src/emu/video/upd7220.c b/src/emu/video/upd7220.c
index fd322499047..d9a61c0bbec 100644
--- a/src/emu/video/upd7220.c
+++ b/src/emu/video/upd7220.c
@@ -764,7 +764,7 @@ void upd7220_device::draw_pixel(int x, int y, int xi, UINT16 tile_data)
UINT8 data = readbyte(addr);
UINT8 new_pixel = (xi & 8 ? tile_data >> 8 : tile_data & 0xff) & (0x80 >> (xi & 7));
new_pixel = new_pixel ? (0xff & (0x80 >> (x & 7))) : 0;
-
+
switch(m_bitmap_mod)
{
case 0: //replace
diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h
index bae8fbfbee7..819c285f290 100644
--- a/src/emu/video/vooddefs.h
+++ b/src/emu/video/vooddefs.h
@@ -1726,8 +1726,8 @@ struct voodoo_state
raster_info rasterizer[MAX_RASTERIZERS]; /* array of rasterizers */
raster_info * raster_hash[RASTER_HASH_SIZE]; /* hash table of rasterizers */
- bool send_config;
- UINT32 tmu_config;
+ bool send_config;
+ UINT32 tmu_config;
};
@@ -3646,18 +3646,18 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co
/* result in texel */ \
/* note that they set LOD min to 8 to "disable" a TMU */ \
if (TMUS >= 1 && v->tmu[0].lodmin < (8 << 8)) \
- { \
+ { \
if (!v->send_config) \
- { \
+ { \
TEXTURE_PIPELINE(&v->tmu[0], x, dither4, TEXMODE0, texel, \
v->tmu[0].lookup, extra->lodbase0, \
iters0, itert0, iterw0, texel); \
- } \
- else \
- { \
+ } \
+ else \
+ { \
texel.u=v->tmu_config; \
- } \
- } \
+ } \
+ } \
\
/* colorpath pipeline selects source colors and does blending */ \
CLAMPED_ARGB(iterr, iterg, iterb, itera, FBZCOLORPATH, iterargb); \
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index b4f38a606a1..d84fef0261f 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -4915,7 +4915,7 @@ void voodoo_device::common_start_voodoo(UINT8 type)
}
}
- v->tmu_config = 0x11; // revision 1
+ v->tmu_config = 0x11; // revision 1
/* configure type-specific values */
switch (v->type)
@@ -4969,7 +4969,7 @@ void voodoo_device::common_start_voodoo(UINT8 type)
assert_always(v->cpu != NULL, "Unable to find CPU attached to voodoo");
if (m_tmumem1 != 0)
- v->tmu_config |= 0xc0; // two TMUs
+ v->tmu_config |= 0xc0; // two TMUs
v->chipmask = 0x01;
v->attoseconds_per_cycle = ATTOSECONDS_PER_SECOND / v->freq;
diff --git a/src/emu/webengine.c b/src/emu/webengine.c
index 3b26990fb90..c7fc8952f8a 100644
--- a/src/emu/webengine.c
+++ b/src/emu/webengine.c
@@ -133,128 +133,128 @@ int web_engine::json_slider_handler(struct mg_connection *conn)
}
void reg_string(struct lua_State *L, const char *name, const char *val) {
- lua_pushstring(L, name);
- lua_pushstring(L, val);
- lua_rawset(L, -3);
+ lua_pushstring(L, name);
+ lua_pushstring(L, val);
+ lua_rawset(L, -3);
}
void reg_int(struct lua_State *L, const char *name, int val) {
- lua_pushstring(L, name);
- lua_pushinteger(L, val);
- lua_rawset(L, -3);
+ lua_pushstring(L, name);
+ lua_pushinteger(L, val);
+ lua_rawset(L, -3);
}
void reg_function(struct lua_State *L, const char *name,
- lua_CFunction func, struct mg_connection *conn) {
- lua_pushstring(L, name);
- lua_pushlightuserdata(L, conn);
- lua_pushcclosure(L, func, 1);
- lua_rawset(L, -3);
+ lua_CFunction func, struct mg_connection *conn) {
+ lua_pushstring(L, name);
+ lua_pushlightuserdata(L, conn);
+ lua_pushcclosure(L, func, 1);
+ lua_rawset(L, -3);
}
static int lua_write(lua_State *L) {
- int i, num_args;
- const char *str;
- size_t size;
- struct mg_connection *conn = (struct mg_connection *)
- lua_touserdata(L, lua_upvalueindex(1));
-
- num_args = lua_gettop(L);
- for (i = 1; i <= num_args; i++) {
- if (lua_isstring(L, i)) {
- str = lua_tolstring(L, i, &size);
- mg_send_data(conn, str, size);
- }
- }
-
- return 0;
+ int i, num_args;
+ const char *str;
+ size_t size;
+ struct mg_connection *conn = (struct mg_connection *)
+ lua_touserdata(L, lua_upvalueindex(1));
+
+ num_args = lua_gettop(L);
+ for (i = 1; i <= num_args; i++) {
+ if (lua_isstring(L, i)) {
+ str = lua_tolstring(L, i, &size);
+ mg_send_data(conn, str, size);
+ }
+ }
+
+ return 0;
}
static int lua_header(lua_State *L) {
- struct mg_connection *conn = (struct mg_connection *)
- lua_touserdata(L, lua_upvalueindex(1));
+ struct mg_connection *conn = (struct mg_connection *)
+ lua_touserdata(L, lua_upvalueindex(1));
+
+ const char *header = luaL_checkstring(L,1);
+ const char *value = luaL_checkstring(L,2);
- const char *header = luaL_checkstring(L,1);
- const char *value = luaL_checkstring(L,2);
-
- mg_send_header(conn, header, value);
+ mg_send_header(conn, header, value);
- return 0;
+ return 0;
}
static void prepare_lua_environment(struct mg_connection *ri, lua_State *L) {
- extern void luaL_openlibs(lua_State *);
- int i;
-
- luaL_openlibs(L);
-
- if (ri == NULL) return;
-
- // Register mg module
- lua_newtable(L);
- reg_function(L, "write", lua_write, ri);
- reg_function(L, "header", lua_header, ri);
-
- // Export request_info
- lua_pushstring(L, "request_info");
- lua_newtable(L);
- reg_string(L, "request_method", ri->request_method);
- reg_string(L, "uri", ri->uri);
- reg_string(L, "http_version", ri->http_version);
- reg_string(L, "query_string", ri->query_string);
- reg_string(L, "remote_ip", ri->remote_ip);
- reg_int(L, "remote_port", ri->remote_port);
- reg_string(L, "local_ip", ri->local_ip);
- reg_int(L, "local_port", ri->local_port);
- lua_pushstring(L, "content");
- lua_pushlstring(L, ri->content == NULL ? "" : ri->content, ri->content_len);
- lua_rawset(L, -3);
- reg_int(L, "num_headers", ri->num_headers);
- lua_pushstring(L, "http_headers");
- lua_newtable(L);
- for (i = 0; i < ri->num_headers; i++) {
- reg_string(L, ri->http_headers[i].name, ri->http_headers[i].value);
- }
- lua_rawset(L, -3);
- lua_rawset(L, -3);
-
- lua_setglobal(L, "mg");
+ extern void luaL_openlibs(lua_State *);
+ int i;
+
+ luaL_openlibs(L);
+
+ if (ri == NULL) return;
+
+ // Register mg module
+ lua_newtable(L);
+ reg_function(L, "write", lua_write, ri);
+ reg_function(L, "header", lua_header, ri);
+
+ // Export request_info
+ lua_pushstring(L, "request_info");
+ lua_newtable(L);
+ reg_string(L, "request_method", ri->request_method);
+ reg_string(L, "uri", ri->uri);
+ reg_string(L, "http_version", ri->http_version);
+ reg_string(L, "query_string", ri->query_string);
+ reg_string(L, "remote_ip", ri->remote_ip);
+ reg_int(L, "remote_port", ri->remote_port);
+ reg_string(L, "local_ip", ri->local_ip);
+ reg_int(L, "local_port", ri->local_port);
+ lua_pushstring(L, "content");
+ lua_pushlstring(L, ri->content == NULL ? "" : ri->content, ri->content_len);
+ lua_rawset(L, -3);
+ reg_int(L, "num_headers", ri->num_headers);
+ lua_pushstring(L, "http_headers");
+ lua_newtable(L);
+ for (i = 0; i < ri->num_headers; i++) {
+ reg_string(L, ri->http_headers[i].name, ri->http_headers[i].value);
+ }
+ lua_rawset(L, -3);
+ lua_rawset(L, -3);
+
+ lua_setglobal(L, "mg");
}
static void lsp(struct mg_connection *conn, const char *p, int len, lua_State *L) {
- int i, j, pos = 0;
- for (i = 0; i < len; i++) {
- if (p[i] == '<' && p[i + 1] == '?') {
- for (j = i + 1; j < len ; j++) {
- if (p[j] == '?' && p[j + 1] == '>') {
- if (i-pos!=0) mg_send_data(conn, p + pos, i - pos);
- if (luaL_loadbuffer(L, p + (i + 2), j - (i + 2), "") == 0) {
- lua_pcall(L, 0, LUA_MULTRET, 0);
- }
- pos = j + 2;
- i = pos - 1;
- break;
- }
- }
- }
- }
- if (i > pos) {
+ int i, j, pos = 0;
+ for (i = 0; i < len; i++) {
+ if (p[i] == '<' && p[i + 1] == '?') {
+ for (j = i + 1; j < len ; j++) {
+ if (p[j] == '?' && p[j + 1] == '>') {
+ if (i-pos!=0) mg_send_data(conn, p + pos, i - pos);
+ if (luaL_loadbuffer(L, p + (i + 2), j - (i + 2), "") == 0) {
+ lua_pcall(L, 0, LUA_MULTRET, 0);
+ }
+ pos = j + 2;
+ i = pos - 1;
+ break;
+ }
+ }
+ }
+ }
+ if (i > pos) {
mg_send_data(conn, p + pos, i - pos);
- }
+ }
}
static int filename_endswith(const char *str, const char *suffix)
{
- if (!str || !suffix)
- return 0;
- size_t lenstr = strlen(str);
- size_t lensuffix = strlen(suffix);
- if (lensuffix > lenstr)
- return 0;
- return strncmp(str + lenstr - lensuffix, suffix, lensuffix) == 0;
+ if (!str || !suffix)
+ return 0;
+ size_t lenstr = strlen(str);
+ size_t lensuffix = strlen(suffix);
+ if (lensuffix > lenstr)
+ return 0;
+ return strncmp(str + lenstr - lensuffix, suffix, lensuffix) == 0;
}
// This function will be called by mongoose on every new request.
@@ -263,24 +263,24 @@ int web_engine::begin_request_handler(struct mg_connection *conn)
astring file_path(mg_get_option(m_server, "document_root"), PATH_SEPARATOR, conn->uri);
if (filename_endswith(file_path,".lp"))
{
- FILE *fp = NULL;
- if ((fp = fopen(file_path, "rb")) != NULL) {
- fseek (fp, 0, SEEK_END);
+ FILE *fp = NULL;
+ if ((fp = fopen(file_path, "rb")) != NULL) {
+ fseek (fp, 0, SEEK_END);
size_t size = ftell(fp);
- fseek (fp, 0, SEEK_SET);
+ fseek (fp, 0, SEEK_SET);
char *data = (char*)mg_mmap(fp,size);
lua_State *L = luaL_newstate();
- prepare_lua_environment(conn, L);
+ prepare_lua_environment(conn, L);
lsp(conn, data, (int) size, L);
if (L != NULL) lua_close(L);
mg_munmap(data,size);
- fclose(fp);
- return MG_TRUE;
- } else {
- return MG_FALSE;
- }
- }
+ fclose(fp);
+ return MG_TRUE;
+ } else {
+ return MG_FALSE;
+ }
+ }
else if (!strncmp(conn->uri, "/json/",6))
{
if (!strcmp(conn->uri, "/json/game"))
@@ -295,13 +295,13 @@ int web_engine::begin_request_handler(struct mg_connection *conn)
else if (!strncmp(conn->uri, "/keypost",8))
{
// Is there any sane way to determine the length of the buffer before getting it?
- // A request for a way was previously filed with the mongoose devs,
+ // A request for a way was previously filed with the mongoose devs,
// but it looks like it was never implemented.
-
- // For now, we'll allow a paste buffer of 32k.
+
+ // For now, we'll allow a paste buffer of 32k.
// To-do: Send an error if the paste is too big?
char cmd_val[32768];
-
+
int pastelength = mg_get_var(conn, "val", cmd_val, sizeof(cmd_val));
if (pastelength > 0) {
machine().ioport().natkeyboard().post_utf8(cmd_val);
@@ -326,10 +326,10 @@ int web_engine::begin_request_handler(struct mg_connection *conn)
while ((ofs = mg_parse_multipart(conn->content + ofs, conn->content_len - ofs, var_name, sizeof(var_name), file_name, sizeof(file_name), (const char **)&upload_data, &data_length)) > 0) {
mg_printf_data(conn, "File: %s, size: %d bytes", file_name, data_length);
}
-
+
// That upload_data contains more than we need. It also has the headers.
// We'll need to strip it down to just what we want.
-
+
if ((&data_length > 0) && (sizeof(file_name) > 0))
{
// MSVC doesn't yet support variable-length arrays, so chop the string the old-fashioned way
diff --git a/src/lib/formats/ap2_dsk.c b/src/lib/formats/ap2_dsk.c
index 1e1f81ef1a8..8293ee9e565 100644
--- a/src/lib/formats/ap2_dsk.c
+++ b/src/lib/formats/ap2_dsk.c
@@ -624,7 +624,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im
if (!memcmp("PRODOS", &sector_data[0x103], 6))
{
m_prodos_order = true;
- } // check for alternate version ProDOS boot block
+ } // check for alternate version ProDOS boot block
if (!memcmp("PRODOS", &sector_data[0x121], 6))
{
m_prodos_order = true;
@@ -654,7 +654,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im
else if (!memcmp(dos33_block1, &sector_data[0x100], 4))
{
m_prodos_order = true;
- } // check for a later version of the Pascal boot block
+ } // check for a later version of the Pascal boot block
else if (!memcmp(pascal2_block1, &sector_data[0x100], 4))
{
m_prodos_order = true;
diff --git a/src/lib/formats/dmk_dsk.c b/src/lib/formats/dmk_dsk.c
index af1f134f94a..2af453d66fa 100644
--- a/src/lib/formats/dmk_dsk.c
+++ b/src/lib/formats/dmk_dsk.c
@@ -226,4 +226,3 @@ bool dmk_format::supports_save() const
const floppy_format_type FLOPPY_DMK_FORMAT = &floppy_image_format_creator<dmk_format>;
-
diff --git a/src/lib/formats/dmk_dsk.h b/src/lib/formats/dmk_dsk.h
index 68c4d8deea3..5167f0502cc 100644
--- a/src/lib/formats/dmk_dsk.h
+++ b/src/lib/formats/dmk_dsk.h
@@ -31,4 +31,3 @@ public:
extern const floppy_format_type FLOPPY_DMK_FORMAT;
#endif /* DMK_DSK_H */
-
diff --git a/src/lib/formats/mfi_dsk.c b/src/lib/formats/mfi_dsk.c
index 8033b0207e4..13a23abe94b 100644
--- a/src/lib/formats/mfi_dsk.c
+++ b/src/lib/formats/mfi_dsk.c
@@ -99,8 +99,8 @@ int mfi_format::identify(io_generic *io, UINT32 form_factor)
io_generic_read(io, &h, 0, sizeof(header));
if(memcmp( h.sign, sign, 16 ) == 0 &&
- (h.cyl_count & CYLINDER_MASK) <= 84 &&
- (h.cyl_count >> RESOLUTION_SHIFT) < 3 &&
+ (h.cyl_count & CYLINDER_MASK) <= 84 &&
+ (h.cyl_count >> RESOLUTION_SHIFT) < 3 &&
h.head_count <= 2 &&
(!form_factor || !h.form_factor || h.form_factor == form_factor))
return 100;
diff --git a/src/lib/web/mongoose.c b/src/lib/web/mongoose.c
index 3b2259fd149..e9305981bac 100644
--- a/src/lib/web/mongoose.c
+++ b/src/lib/web/mongoose.c
@@ -128,7 +128,7 @@ typedef int sock_t;
#ifdef NS_ENABLE_DEBUG
#define DBG(x) do { printf("%-20s ", __func__); printf x; putchar('\n'); \
- fflush(stdout); } while(0)
+ fflush(stdout); } while(0)
#else
#define DBG(x)
#endif
@@ -150,20 +150,20 @@ extern "C" {
#endif // __cplusplus
union socket_address {
- struct sockaddr sa;
- struct sockaddr_in sin;
+ struct sockaddr sa;
+ struct sockaddr_in sin;
#ifdef NS_ENABLE_IPV6
- struct sockaddr_in6 sin6;
+ struct sockaddr_in6 sin6;
#else
- struct sockaddr sin6;
+ struct sockaddr sin6;
#endif
};
// IO buffers interface
struct iobuf {
- char *buf;
- size_t len;
- size_t size;
+ char *buf;
+ size_t len;
+ size_t size;
};
void iobuf_init(struct iobuf *, size_t initial_size);
@@ -174,12 +174,12 @@ void iobuf_remove(struct iobuf *, size_t data_size);
// Net skeleton interface
// Events. Meaning of event parameter (evp) is given in the comment.
enum ns_event {
- NS_POLL, // Sent to each connection on each call to ns_server_poll()
- NS_ACCEPT, // New connection accept()-ed. union socket_address *remote_addr
- NS_CONNECT, // connect() succeeded or failed. int *success_status
- NS_RECV, // Data has benn received. int *num_bytes
- NS_SEND, // Data has been written to a socket. int *num_bytes
- NS_CLOSE // Connection is closed. NULL
+ NS_POLL, // Sent to each connection on each call to ns_server_poll()
+ NS_ACCEPT, // New connection accept()-ed. union socket_address *remote_addr
+ NS_CONNECT, // connect() succeeded or failed. int *success_status
+ NS_RECV, // Data has benn received. int *num_bytes
+ NS_SEND, // Data has been written to a socket. int *num_bytes
+ NS_CLOSE // Connection is closed. NULL
};
// Callback function (event handler) prototype, must be defined by user.
@@ -188,27 +188,27 @@ struct ns_connection;
typedef void (*ns_callback_t)(struct ns_connection *, enum ns_event, void *evp);
struct ns_server {
- void *server_data;
- sock_t listening_sock;
- struct ns_connection *active_connections;
- ns_callback_t callback;
- SSL_CTX *ssl_ctx;
- SSL_CTX *client_ssl_ctx;
- const char *hexdump_file;
- sock_t ctl[2];
+ void *server_data;
+ sock_t listening_sock;
+ struct ns_connection *active_connections;
+ ns_callback_t callback;
+ SSL_CTX *ssl_ctx;
+ SSL_CTX *client_ssl_ctx;
+ const char *hexdump_file;
+ sock_t ctl[2];
};
struct ns_connection {
- struct ns_connection *prev, *next;
- struct ns_server *server;
- sock_t sock;
- union socket_address sa;
- struct iobuf recv_iobuf;
- struct iobuf send_iobuf;
- SSL *ssl;
- void *connection_data;
- time_t last_io_time;
- unsigned int flags;
+ struct ns_connection *prev, *next;
+ struct ns_server *server;
+ sock_t sock;
+ union socket_address sa;
+ struct iobuf recv_iobuf;
+ struct iobuf send_iobuf;
+ SSL *ssl;
+ void *connection_data;
+ time_t last_io_time;
+ unsigned int flags;
#define NSF_FINISHED_SENDING_DATA (1 << 0)
#define NSF_BUFFER_BUT_DONT_SEND (1 << 1)
#define NSF_SSL_HANDSHAKE_DONE (1 << 2)
@@ -239,7 +239,7 @@ int ns_bind(struct ns_server *, const char *addr);
int ns_set_ssl_cert(struct ns_server *, const char *ssl_cert);
int ns_set_ssl_ca_cert(struct ns_server *, const char *ssl_ca_cert);
struct ns_connection *ns_connect(struct ns_server *, const char *host,
- int port, int ssl, void *connection_param);
+ int port, int ssl, void *connection_param);
int ns_send(struct ns_connection *, const void *buf, int len);
int ns_printf(struct ns_connection *, const char *fmt, ...);
@@ -289,832 +289,832 @@ int ns_avprintf(char **buf, size_t size, const char *fmt, va_list ap);
#endif
struct ctl_msg {
- ns_callback_t callback;
- char message[1024 * 8];
+ ns_callback_t callback;
+ char message[1024 * 8];
};
void iobuf_init(struct iobuf *iobuf, size_t size) {
- iobuf->len = iobuf->size = 0;
- iobuf->buf = NULL;
+ iobuf->len = iobuf->size = 0;
+ iobuf->buf = NULL;
- if (size > 0 && (iobuf->buf = (char *) NS_MALLOC(size)) != NULL) {
- iobuf->size = size;
- }
+ if (size > 0 && (iobuf->buf = (char *) NS_MALLOC(size)) != NULL) {
+ iobuf->size = size;
+ }
}
void iobuf_free(struct iobuf *iobuf) {
- if (iobuf != NULL) {
- if (iobuf->buf != NULL) NS_FREE(iobuf->buf);
- iobuf_init(iobuf, 0);
- }
+ if (iobuf != NULL) {
+ if (iobuf->buf != NULL) NS_FREE(iobuf->buf);
+ iobuf_init(iobuf, 0);
+ }
}
size_t iobuf_append(struct iobuf *io, const void *buf, size_t len) {
- char *p = NULL;
+ char *p = NULL;
- assert(io != NULL);
- assert(io->len <= io->size);
+ assert(io != NULL);
+ assert(io->len <= io->size);
- if (len <= 0) {
- } else if (io->len + len <= io->size) {
- memcpy(io->buf + io->len, buf, len);
- io->len += len;
- } else if ((p = (char *) NS_REALLOC(io->buf, io->len + len)) != NULL) {
- io->buf = p;
- memcpy(io->buf + io->len, buf, len);
- io->len += len;
- io->size = io->len;
- } else {
- len = 0;
- }
+ if (len <= 0) {
+ } else if (io->len + len <= io->size) {
+ memcpy(io->buf + io->len, buf, len);
+ io->len += len;
+ } else if ((p = (char *) NS_REALLOC(io->buf, io->len + len)) != NULL) {
+ io->buf = p;
+ memcpy(io->buf + io->len, buf, len);
+ io->len += len;
+ io->size = io->len;
+ } else {
+ len = 0;
+ }
- return len;
+ return len;
}
void iobuf_remove(struct iobuf *io, size_t n) {
- if (n > 0 && n <= io->len) {
- memmove(io->buf, io->buf + n, io->len - n);
- io->len -= n;
- }
+ if (n > 0 && n <= io->len) {
+ memmove(io->buf, io->buf + n, io->len - n);
+ io->len -= n;
+ }
}
#ifndef NS_DISABLE_THREADS
void *ns_start_thread(void *(*f)(void *), void *p) {
#ifdef _WIN32
- return (void *) _beginthread((void (__cdecl *)(void *)) f, 0, p);
+ return (void *) _beginthread((void (__cdecl *)(void *)) f, 0, p);
#else
- pthread_t thread_id = (pthread_t) 0;
- pthread_attr_t attr;
+ pthread_t thread_id = (pthread_t) 0;
+ pthread_attr_t attr;
- (void) pthread_attr_init(&attr);
- (void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ (void) pthread_attr_init(&attr);
+ (void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
#if defined(NS_STACK_SIZE) && NS_STACK_SIZE > 1
- (void) pthread_attr_setstacksize(&attr, NS_STACK_SIZE);
+ (void) pthread_attr_setstacksize(&attr, NS_STACK_SIZE);
#endif
- pthread_create(&thread_id, &attr, f, p);
- pthread_attr_destroy(&attr);
+ pthread_create(&thread_id, &attr, f, p);
+ pthread_attr_destroy(&attr);
- return (void *) thread_id;
+ return (void *) thread_id;
#endif
}
#endif // NS_DISABLE_THREADS
static void ns_add_conn(struct ns_server *server, struct ns_connection *c) {
- c->next = server->active_connections;
- server->active_connections = c;
- c->prev = NULL;
- if (c->next != NULL) c->next->prev = c;
+ c->next = server->active_connections;
+ server->active_connections = c;
+ c->prev = NULL;
+ if (c->next != NULL) c->next->prev = c;
}
static void ns_remove_conn(struct ns_connection *conn) {
- if (conn->prev == NULL) conn->server->active_connections = conn->next;
- if (conn->prev) conn->prev->next = conn->next;
- if (conn->next) conn->next->prev = conn->prev;
+ if (conn->prev == NULL) conn->server->active_connections = conn->next;
+ if (conn->prev) conn->prev->next = conn->next;
+ if (conn->next) conn->next->prev = conn->prev;
}
// Print message to buffer. If buffer is large enough to hold the message,
// return buffer. If buffer is to small, allocate large enough buffer on heap,
// and return allocated buffer.
int ns_avprintf(char **buf, size_t size, const char *fmt, va_list ap) {
- va_list ap_copy;
- int len;
-
- va_copy(ap_copy, ap);
- len = vsnprintf(*buf, size, fmt, ap_copy);
- va_end(ap_copy);
-
- if (len < 0) {
- // eCos and Windows are not standard-compliant and return -1 when
- // the buffer is too small. Keep allocating larger buffers until we
- // succeed or out of memory.
- *buf = NULL;
- while (len < 0) {
- if (*buf) free(*buf);
- size *= 2;
- if ((*buf = (char *) NS_MALLOC(size)) == NULL) break;
- va_copy(ap_copy, ap);
- len = vsnprintf(*buf, size, fmt, ap_copy);
- va_end(ap_copy);
- }
- } else if (len > (int) size) {
- // Standard-compliant code path. Allocate a buffer that is large enough.
- if ((*buf = (char *) NS_MALLOC(len + 1)) == NULL) {
- len = -1;
- } else {
- va_copy(ap_copy, ap);
- len = vsnprintf(*buf, len + 1, fmt, ap_copy);
- va_end(ap_copy);
- }
- }
-
- return len;
+ va_list ap_copy;
+ int len;
+
+ va_copy(ap_copy, ap);
+ len = vsnprintf(*buf, size, fmt, ap_copy);
+ va_end(ap_copy);
+
+ if (len < 0) {
+ // eCos and Windows are not standard-compliant and return -1 when
+ // the buffer is too small. Keep allocating larger buffers until we
+ // succeed or out of memory.
+ *buf = NULL;
+ while (len < 0) {
+ if (*buf) free(*buf);
+ size *= 2;
+ if ((*buf = (char *) NS_MALLOC(size)) == NULL) break;
+ va_copy(ap_copy, ap);
+ len = vsnprintf(*buf, size, fmt, ap_copy);
+ va_end(ap_copy);
+ }
+ } else if (len > (int) size) {
+ // Standard-compliant code path. Allocate a buffer that is large enough.
+ if ((*buf = (char *) NS_MALLOC(len + 1)) == NULL) {
+ len = -1;
+ } else {
+ va_copy(ap_copy, ap);
+ len = vsnprintf(*buf, len + 1, fmt, ap_copy);
+ va_end(ap_copy);
+ }
+ }
+
+ return len;
}
int ns_vprintf(struct ns_connection *conn, const char *fmt, va_list ap) {
- char mem[2000], *buf = mem;
- int len;
+ char mem[2000], *buf = mem;
+ int len;
- if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) {
- iobuf_append(&conn->send_iobuf, buf, len);
- }
- if (buf != mem && buf != NULL) {
- free(buf);
- }
+ if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) {
+ iobuf_append(&conn->send_iobuf, buf, len);
+ }
+ if (buf != mem && buf != NULL) {
+ free(buf);
+ }
- return len;
+ return len;
}
int ns_printf(struct ns_connection *conn, const char *fmt, ...) {
- int len;
- va_list ap;
- va_start(ap, fmt);
- len = ns_vprintf(conn, fmt, ap);
- va_end(ap);
- return len;
+ int len;
+ va_list ap;
+ va_start(ap, fmt);
+ len = ns_vprintf(conn, fmt, ap);
+ va_end(ap);
+ return len;
}
static void hexdump(struct ns_connection *nc, const char *path,
- int num_bytes, enum ns_event ev) {
- const struct iobuf *io = ev == NS_SEND ? &nc->send_iobuf : &nc->recv_iobuf;
- FILE *fp;
- char *buf, src[60], dst[60];
- int buf_size = num_bytes * 5 + 100;
-
- if ((fp = fopen(path, "a")) != NULL) {
- ns_sock_to_str(nc->sock, src, sizeof(src), 3);
- ns_sock_to_str(nc->sock, dst, sizeof(dst), 7);
- fprintf(fp, "%lu %p %s %s %s %d\n", (unsigned long) time(NULL),
- nc->connection_data, src,
- ev == NS_RECV ? "<-" : ev == NS_SEND ? "->" :
- ev == NS_ACCEPT ? "<A" : ev == NS_CONNECT ? "C>" : "XX",
- dst, num_bytes);
- if (num_bytes > 0 && (buf = (char *) malloc(buf_size)) != NULL) {
- ns_hexdump(io->buf + (ev == NS_SEND ? 0 : io->len) -
- (ev == NS_SEND ? 0 : num_bytes), num_bytes, buf, buf_size);
- fprintf(fp, "%s", buf);
- free(buf);
- }
- fclose(fp);
- }
+ int num_bytes, enum ns_event ev) {
+ const struct iobuf *io = ev == NS_SEND ? &nc->send_iobuf : &nc->recv_iobuf;
+ FILE *fp;
+ char *buf, src[60], dst[60];
+ int buf_size = num_bytes * 5 + 100;
+
+ if ((fp = fopen(path, "a")) != NULL) {
+ ns_sock_to_str(nc->sock, src, sizeof(src), 3);
+ ns_sock_to_str(nc->sock, dst, sizeof(dst), 7);
+ fprintf(fp, "%lu %p %s %s %s %d\n", (unsigned long) time(NULL),
+ nc->connection_data, src,
+ ev == NS_RECV ? "<-" : ev == NS_SEND ? "->" :
+ ev == NS_ACCEPT ? "<A" : ev == NS_CONNECT ? "C>" : "XX",
+ dst, num_bytes);
+ if (num_bytes > 0 && (buf = (char *) malloc(buf_size)) != NULL) {
+ ns_hexdump(io->buf + (ev == NS_SEND ? 0 : io->len) -
+ (ev == NS_SEND ? 0 : num_bytes), num_bytes, buf, buf_size);
+ fprintf(fp, "%s", buf);
+ free(buf);
+ }
+ fclose(fp);
+ }
}
static void ns_call(struct ns_connection *conn, enum ns_event ev, void *p) {
- if (conn->server->hexdump_file != NULL && ev != NS_POLL) {
- int len = (ev == NS_RECV || ev == NS_SEND) ? * (int *) p : 0;
- hexdump(conn, conn->server->hexdump_file, len, ev);
- }
- if (conn->server->callback) conn->server->callback(conn, ev, p);
+ if (conn->server->hexdump_file != NULL && ev != NS_POLL) {
+ int len = (ev == NS_RECV || ev == NS_SEND) ? * (int *) p : 0;
+ hexdump(conn, conn->server->hexdump_file, len, ev);
+ }
+ if (conn->server->callback) conn->server->callback(conn, ev, p);
}
static void ns_close_conn(struct ns_connection *conn) {
- DBG(("%p %d", conn, conn->flags));
- ns_call(conn, NS_CLOSE, NULL);
- ns_remove_conn(conn);
- closesocket(conn->sock);
- iobuf_free(&conn->recv_iobuf);
- iobuf_free(&conn->send_iobuf);
+ DBG(("%p %d", conn, conn->flags));
+ ns_call(conn, NS_CLOSE, NULL);
+ ns_remove_conn(conn);
+ closesocket(conn->sock);
+ iobuf_free(&conn->recv_iobuf);
+ iobuf_free(&conn->send_iobuf);
#ifdef NS_ENABLE_SSL
- if (conn->ssl != NULL) {
- SSL_free(conn->ssl);
- }
+ if (conn->ssl != NULL) {
+ SSL_free(conn->ssl);
+ }
#endif
- NS_FREE(conn);
+ NS_FREE(conn);
}
void ns_set_close_on_exec(sock_t sock) {
#ifdef _WIN32
- (void) SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0);
+ (void) SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0);
#else
- fcntl(sock, F_SETFD, FD_CLOEXEC);
+ fcntl(sock, F_SETFD, FD_CLOEXEC);
#endif
}
static void ns_set_non_blocking_mode(sock_t sock) {
#ifdef _WIN32
- unsigned long on = 1;
- ioctlsocket(sock, FIONBIO, &on);
+ unsigned long on = 1;
+ ioctlsocket(sock, FIONBIO, &on);
#else
- int flags = fcntl(sock, F_GETFL, 0);
- fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+ int flags = fcntl(sock, F_GETFL, 0);
+ fcntl(sock, F_SETFL, flags | O_NONBLOCK);
#endif
}
#ifndef NS_DISABLE_SOCKETPAIR
int ns_socketpair2(sock_t sp[2], int sock_type) {
- union socket_address sa;
- sock_t sock;
- socklen_t len = sizeof(sa.sin);
- int ret = 0;
-
- sp[0] = sp[1] = INVALID_SOCKET;
-
- (void) memset(&sa, 0, sizeof(sa));
- sa.sin.sin_family = AF_INET;
- sa.sin.sin_port = htons(0);
- sa.sin.sin_addr.s_addr = htonl(0x7f000001);
-
- if ((sock = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET &&
- !bind(sock, &sa.sa, len) &&
- (sock_type == SOCK_DGRAM || !listen(sock, 1)) &&
- !getsockname(sock, &sa.sa, &len) &&
- (sp[0] = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET &&
- !connect(sp[0], &sa.sa, len) &&
- (sock_type == SOCK_STREAM ||
- (!getsockname(sp[0], &sa.sa, &len) && !connect(sock, &sa.sa, len))) &&
- (sp[1] = (sock_type == SOCK_DGRAM ? sock :
- accept(sock, &sa.sa, &len))) != INVALID_SOCKET) {
- ns_set_close_on_exec(sp[0]);
- ns_set_close_on_exec(sp[1]);
- ret = 1;
- } else {
- if (sp[0] != INVALID_SOCKET) closesocket(sp[0]);
- if (sp[1] != INVALID_SOCKET) closesocket(sp[1]);
- sp[0] = sp[1] = INVALID_SOCKET;
- }
- if (sock_type != SOCK_DGRAM) closesocket(sock);
-
- return ret;
+ union socket_address sa;
+ sock_t sock;
+ socklen_t len = sizeof(sa.sin);
+ int ret = 0;
+
+ sp[0] = sp[1] = INVALID_SOCKET;
+
+ (void) memset(&sa, 0, sizeof(sa));
+ sa.sin.sin_family = AF_INET;
+ sa.sin.sin_port = htons(0);
+ sa.sin.sin_addr.s_addr = htonl(0x7f000001);
+
+ if ((sock = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET &&
+ !bind(sock, &sa.sa, len) &&
+ (sock_type == SOCK_DGRAM || !listen(sock, 1)) &&
+ !getsockname(sock, &sa.sa, &len) &&
+ (sp[0] = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET &&
+ !connect(sp[0], &sa.sa, len) &&
+ (sock_type == SOCK_STREAM ||
+ (!getsockname(sp[0], &sa.sa, &len) && !connect(sock, &sa.sa, len))) &&
+ (sp[1] = (sock_type == SOCK_DGRAM ? sock :
+ accept(sock, &sa.sa, &len))) != INVALID_SOCKET) {
+ ns_set_close_on_exec(sp[0]);
+ ns_set_close_on_exec(sp[1]);
+ ret = 1;
+ } else {
+ if (sp[0] != INVALID_SOCKET) closesocket(sp[0]);
+ if (sp[1] != INVALID_SOCKET) closesocket(sp[1]);
+ sp[0] = sp[1] = INVALID_SOCKET;
+ }
+ if (sock_type != SOCK_DGRAM) closesocket(sock);
+
+ return ret;
}
int ns_socketpair(sock_t sp[2]) {
- return ns_socketpair2(sp, SOCK_STREAM);
+ return ns_socketpair2(sp, SOCK_STREAM);
}
#endif // NS_DISABLE_SOCKETPAIR
// Valid listening port spec is: [ip_address:]port, e.g. "80", "127.0.0.1:3128"
static int ns_parse_port_string(const char *str, union socket_address *sa) {
- unsigned int a, b, c, d, port;
- int len = 0;
+ unsigned int a, b, c, d, port;
+ int len = 0;
#ifdef NS_ENABLE_IPV6
- char buf[100];
+ char buf[100];
#endif
- // MacOS needs that. If we do not zero it, subsequent bind() will fail.
- // Also, all-zeroes in the socket address means binding to all addresses
- // for both IPv4 and IPv6 (INADDR_ANY and IN6ADDR_ANY_INIT).
- memset(sa, 0, sizeof(*sa));
- sa->sin.sin_family = AF_INET;
+ // MacOS needs that. If we do not zero it, subsequent bind() will fail.
+ // Also, all-zeroes in the socket address means binding to all addresses
+ // for both IPv4 and IPv6 (INADDR_ANY and IN6ADDR_ANY_INIT).
+ memset(sa, 0, sizeof(*sa));
+ sa->sin.sin_family = AF_INET;
- if (sscanf(str, "%u.%u.%u.%u:%u%n", &a, &b, &c, &d, &port, &len) == 5) {
- // Bind to a specific IPv4 address, e.g. 192.168.1.5:8080
- sa->sin.sin_addr.s_addr = htonl((a << 24) | (b << 16) | (c << 8) | d);
- sa->sin.sin_port = htons((uint16_t) port);
+ if (sscanf(str, "%u.%u.%u.%u:%u%n", &a, &b, &c, &d, &port, &len) == 5) {
+ // Bind to a specific IPv4 address, e.g. 192.168.1.5:8080
+ sa->sin.sin_addr.s_addr = htonl((a << 24) | (b << 16) | (c << 8) | d);
+ sa->sin.sin_port = htons((uint16_t) port);
#ifdef NS_ENABLE_IPV6
- } else if (sscanf(str, "[%49[^]]]:%u%n", buf, &port, &len) == 2 &&
- inet_pton(AF_INET6, buf, &sa->sin6.sin6_addr)) {
- // IPv6 address, e.g. [3ffe:2a00:100:7031::1]:8080
- sa->sin6.sin6_family = AF_INET6;
- sa->sin6.sin6_port = htons((uint16_t) port);
+ } else if (sscanf(str, "[%49[^]]]:%u%n", buf, &port, &len) == 2 &&
+ inet_pton(AF_INET6, buf, &sa->sin6.sin6_addr)) {
+ // IPv6 address, e.g. [3ffe:2a00:100:7031::1]:8080
+ sa->sin6.sin6_family = AF_INET6;
+ sa->sin6.sin6_port = htons((uint16_t) port);
#endif
- } else if (sscanf(str, "%u%n", &port, &len) == 1) {
- // If only port is specified, bind to IPv4, INADDR_ANY
- sa->sin.sin_port = htons((uint16_t) port);
- } else {
- port = 0; // Parsing failure. Make port invalid.
- }
+ } else if (sscanf(str, "%u%n", &port, &len) == 1) {
+ // If only port is specified, bind to IPv4, INADDR_ANY
+ sa->sin.sin_port = htons((uint16_t) port);
+ } else {
+ port = 0; // Parsing failure. Make port invalid.
+ }
- return port <= 0xffff && str[len] == '\0';
+ return port <= 0xffff && str[len] == '\0';
}
// 'sa' must be an initialized address to bind to
static sock_t ns_open_listening_socket(union socket_address *sa) {
- socklen_t len = sizeof(*sa);
- sock_t sock = INVALID_SOCKET;
+ socklen_t len = sizeof(*sa);
+ sock_t sock = INVALID_SOCKET;
#ifndef _WIN32
- int on = 1;
+ int on = 1;
#endif
- if ((sock = socket(sa->sa.sa_family, SOCK_STREAM, 6)) != INVALID_SOCKET &&
+ if ((sock = socket(sa->sa.sa_family, SOCK_STREAM, 6)) != INVALID_SOCKET &&
#ifndef _WIN32
- // SO_RESUSEADDR is not enabled on Windows because the semantics of
- // SO_REUSEADDR on UNIX and Windows is different. On Windows,
- // SO_REUSEADDR allows to bind a socket to a port without error even if
- // the port is already open by another program. This is not the behavior
- // SO_REUSEADDR was designed for, and leads to hard-to-track failure
- // scenarios. Therefore, SO_REUSEADDR was disabled on Windows.
- !setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)) &&
+ // SO_RESUSEADDR is not enabled on Windows because the semantics of
+ // SO_REUSEADDR on UNIX and Windows is different. On Windows,
+ // SO_REUSEADDR allows to bind a socket to a port without error even if
+ // the port is already open by another program. This is not the behavior
+ // SO_REUSEADDR was designed for, and leads to hard-to-track failure
+ // scenarios. Therefore, SO_REUSEADDR was disabled on Windows.
+ !setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)) &&
#endif
- !bind(sock, &sa->sa, sa->sa.sa_family == AF_INET ?
- sizeof(sa->sin) : sizeof(sa->sin6)) &&
- !listen(sock, SOMAXCONN)) {
- ns_set_non_blocking_mode(sock);
- // In case port was set to 0, get the real port number
- (void) getsockname(sock, &sa->sa, &len);
- } else if (sock != INVALID_SOCKET) {
- closesocket(sock);
- sock = INVALID_SOCKET;
- }
+ !bind(sock, &sa->sa, sa->sa.sa_family == AF_INET ?
+ sizeof(sa->sin) : sizeof(sa->sin6)) &&
+ !listen(sock, SOMAXCONN)) {
+ ns_set_non_blocking_mode(sock);
+ // In case port was set to 0, get the real port number
+ (void) getsockname(sock, &sa->sa, &len);
+ } else if (sock != INVALID_SOCKET) {
+ closesocket(sock);
+ sock = INVALID_SOCKET;
+ }
- return sock;
+ return sock;
}
// Certificate generation script is at
// https://github.com/cesanta/net_skeleton/blob/master/examples/gen_certs.sh
int ns_set_ssl_ca_cert(struct ns_server *server, const char *cert) {
#ifdef NS_ENABLE_SSL
- STACK_OF(X509_NAME) *list = SSL_load_client_CA_file(cert);
- if (cert != NULL && server->ssl_ctx != NULL && list != NULL) {
- SSL_CTX_set_client_CA_list(server->ssl_ctx, list);
- SSL_CTX_set_verify(server->ssl_ctx, SSL_VERIFY_PEER |
- SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL);
- return 0;
- }
+ STACK_OF(X509_NAME) *list = SSL_load_client_CA_file(cert);
+ if (cert != NULL && server->ssl_ctx != NULL && list != NULL) {
+ SSL_CTX_set_client_CA_list(server->ssl_ctx, list);
+ SSL_CTX_set_verify(server->ssl_ctx, SSL_VERIFY_PEER |
+ SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL);
+ return 0;
+ }
#endif
- return server != NULL && cert == NULL ? 0 : -1;
+ return server != NULL && cert == NULL ? 0 : -1;
}
int ns_set_ssl_cert(struct ns_server *server, const char *cert) {
#ifdef NS_ENABLE_SSL
- if (cert != NULL &&
- (server->ssl_ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) {
- return -1;
- } else if (SSL_CTX_use_certificate_file(server->ssl_ctx, cert, 1) == 0 ||
- SSL_CTX_use_PrivateKey_file(server->ssl_ctx, cert, 1) == 0) {
- return -2;
- } else {
- SSL_CTX_set_mode(server->ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
- SSL_CTX_use_certificate_chain_file(server->ssl_ctx, cert);
- return 0;
- }
+ if (cert != NULL &&
+ (server->ssl_ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) {
+ return -1;
+ } else if (SSL_CTX_use_certificate_file(server->ssl_ctx, cert, 1) == 0 ||
+ SSL_CTX_use_PrivateKey_file(server->ssl_ctx, cert, 1) == 0) {
+ return -2;
+ } else {
+ SSL_CTX_set_mode(server->ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+ SSL_CTX_use_certificate_chain_file(server->ssl_ctx, cert);
+ return 0;
+ }
#endif
- return server != NULL && cert == NULL ? 0 : -3;
+ return server != NULL && cert == NULL ? 0 : -3;
}
int ns_bind(struct ns_server *server, const char *str) {
- union socket_address sa;
- ns_parse_port_string(str, &sa);
- if (server->listening_sock != INVALID_SOCKET) {
- closesocket(server->listening_sock);
- }
- server->listening_sock = ns_open_listening_socket(&sa);
- return server->listening_sock == INVALID_SOCKET ? -1 :
- (int) ntohs(sa.sin.sin_port);
+ union socket_address sa;
+ ns_parse_port_string(str, &sa);
+ if (server->listening_sock != INVALID_SOCKET) {
+ closesocket(server->listening_sock);
+ }
+ server->listening_sock = ns_open_listening_socket(&sa);
+ return server->listening_sock == INVALID_SOCKET ? -1 :
+ (int) ntohs(sa.sin.sin_port);
}
static struct ns_connection *accept_conn(struct ns_server *server) {
- struct ns_connection *c = NULL;
- union socket_address sa;
- socklen_t len = sizeof(sa);
- sock_t sock = INVALID_SOCKET;
-
- // NOTE(lsm): on Windows, sock is always > FD_SETSIZE
- if ((sock = accept(server->listening_sock, &sa.sa, &len)) == INVALID_SOCKET) {
- } else if ((c = (struct ns_connection *) NS_MALLOC(sizeof(*c))) == NULL ||
- memset(c, 0, sizeof(*c)) == NULL) {
- closesocket(sock);
+ struct ns_connection *c = NULL;
+ union socket_address sa;
+ socklen_t len = sizeof(sa);
+ sock_t sock = INVALID_SOCKET;
+
+ // NOTE(lsm): on Windows, sock is always > FD_SETSIZE
+ if ((sock = accept(server->listening_sock, &sa.sa, &len)) == INVALID_SOCKET) {
+ } else if ((c = (struct ns_connection *) NS_MALLOC(sizeof(*c))) == NULL ||
+ memset(c, 0, sizeof(*c)) == NULL) {
+ closesocket(sock);
#ifdef NS_ENABLE_SSL
- } else if (server->ssl_ctx != NULL &&
- ((c->ssl = SSL_new(server->ssl_ctx)) == NULL ||
- SSL_set_fd(c->ssl, sock) != 1)) {
- DBG(("SSL error"));
- closesocket(sock);
- free(c);
- c = NULL;
+ } else if (server->ssl_ctx != NULL &&
+ ((c->ssl = SSL_new(server->ssl_ctx)) == NULL ||
+ SSL_set_fd(c->ssl, sock) != 1)) {
+ DBG(("SSL error"));
+ closesocket(sock);
+ free(c);
+ c = NULL;
#endif
- } else {
- ns_set_close_on_exec(sock);
- ns_set_non_blocking_mode(sock);
- c->server = server;
- c->sock = sock;
- c->flags |= NSF_ACCEPTED;
+ } else {
+ ns_set_close_on_exec(sock);
+ ns_set_non_blocking_mode(sock);
+ c->server = server;
+ c->sock = sock;
+ c->flags |= NSF_ACCEPTED;
- ns_add_conn(server, c);
- ns_call(c, NS_ACCEPT, &sa);
- DBG(("%p %d %p %p", c, c->sock, c->ssl, server->ssl_ctx));
- }
+ ns_add_conn(server, c);
+ ns_call(c, NS_ACCEPT, &sa);
+ DBG(("%p %d %p %p", c, c->sock, c->ssl, server->ssl_ctx));
+ }
- return c;
+ return c;
}
static int ns_is_error(int n) {
- return n == 0 ||
- (n < 0 && errno != EINTR && errno != EINPROGRESS &&
- errno != EAGAIN && errno != EWOULDBLOCK
+ return n == 0 ||
+ (n < 0 && errno != EINTR && errno != EINPROGRESS &&
+ errno != EAGAIN && errno != EWOULDBLOCK
#ifdef _WIN32
- && WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK
+ && WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK
#endif
- );
+ );
}
void ns_sock_to_str(sock_t sock, char *buf, size_t len, int flags) {
- union socket_address sa;
- socklen_t slen = sizeof(sa);
-
- if (buf != NULL && len > 0) {
- buf[0] = '\0';
- memset(&sa, 0, sizeof(sa));
- if (flags & 4) {
- getpeername(sock, &sa.sa, &slen);
- } else {
- getsockname(sock, &sa.sa, &slen);
- }
- if (flags & 1) {
+ union socket_address sa;
+ socklen_t slen = sizeof(sa);
+
+ if (buf != NULL && len > 0) {
+ buf[0] = '\0';
+ memset(&sa, 0, sizeof(sa));
+ if (flags & 4) {
+ getpeername(sock, &sa.sa, &slen);
+ } else {
+ getsockname(sock, &sa.sa, &slen);
+ }
+ if (flags & 1) {
#if defined(NS_ENABLE_IPV6)
- inet_ntop(sa.sa.sa_family, sa.sa.sa_family == AF_INET ?
- (void *) &sa.sin.sin_addr :
- (void *) &sa.sin6.sin6_addr, buf, len);
+ inet_ntop(sa.sa.sa_family, sa.sa.sa_family == AF_INET ?
+ (void *) &sa.sin.sin_addr :
+ (void *) &sa.sin6.sin6_addr, buf, len);
#elif defined(_WIN32)
- // Only Windoze Vista (and newer) have inet_ntop()
- strncpy(buf, inet_ntoa(sa.sin.sin_addr), len);
+ // Only Windoze Vista (and newer) have inet_ntop()
+ strncpy(buf, inet_ntoa(sa.sin.sin_addr), len);
#else
- inet_ntop(sa.sa.sa_family, (void *) &sa.sin.sin_addr, buf, len);
+ inet_ntop(sa.sa.sa_family, (void *) &sa.sin.sin_addr, buf, len);
#endif
- }
- if (flags & 2) {
- snprintf(buf + strlen(buf), len - (strlen(buf) + 1), "%s%d",
- flags & 1 ? ":" : "", (int) ntohs(sa.sin.sin_port));
- }
- }
+ }
+ if (flags & 2) {
+ snprintf(buf + strlen(buf), len - (strlen(buf) + 1), "%s%d",
+ flags & 1 ? ":" : "", (int) ntohs(sa.sin.sin_port));
+ }
+ }
}
int ns_hexdump(const void *buf, int len, char *dst, int dst_len) {
- const unsigned char *p = (const unsigned char *) buf;
- char ascii[17] = "";
- int i, idx, n = 0;
+ const unsigned char *p = (const unsigned char *) buf;
+ char ascii[17] = "";
+ int i, idx, n = 0;
- for (i = 0; i < len; i++) {
- idx = i % 16;
- if (idx == 0) {
- if (i > 0) n += snprintf(dst + n, dst_len - n, " %s\n", ascii);
- n += snprintf(dst + n, dst_len - n, "%04x ", i);
- }
- n += snprintf(dst + n, dst_len - n, " %02x", p[i]);
- ascii[idx] = p[i] < 0x20 || p[i] > 0x7e ? '.' : p[i];
- ascii[idx + 1] = '\0';
- }
+ for (i = 0; i < len; i++) {
+ idx = i % 16;
+ if (idx == 0) {
+ if (i > 0) n += snprintf(dst + n, dst_len - n, " %s\n", ascii);
+ n += snprintf(dst + n, dst_len - n, "%04x ", i);
+ }
+ n += snprintf(dst + n, dst_len - n, " %02x", p[i]);
+ ascii[idx] = p[i] < 0x20 || p[i] > 0x7e ? '.' : p[i];
+ ascii[idx + 1] = '\0';
+ }
- while (i++ % 16) n += snprintf(dst + n, dst_len - n, "%s", " ");
- n += snprintf(dst + n, dst_len - n, " %s\n\n", ascii);
+ while (i++ % 16) n += snprintf(dst + n, dst_len - n, "%s", " ");
+ n += snprintf(dst + n, dst_len - n, " %s\n\n", ascii);
- return n;
+ return n;
}
#ifdef NS_ENABLE_SSL
static int ns_ssl_err(struct ns_connection *conn, int res) {
- int ssl_err = SSL_get_error(conn->ssl, res);
- if (ssl_err == SSL_ERROR_WANT_READ) conn->flags |= NSF_WANT_READ;
- if (ssl_err == SSL_ERROR_WANT_WRITE) conn->flags |= NSF_WANT_WRITE;
- return ssl_err;
+ int ssl_err = SSL_get_error(conn->ssl, res);
+ if (ssl_err == SSL_ERROR_WANT_READ) conn->flags |= NSF_WANT_READ;
+ if (ssl_err == SSL_ERROR_WANT_WRITE) conn->flags |= NSF_WANT_WRITE;
+ return ssl_err;
}
#endif
static void ns_read_from_socket(struct ns_connection *conn) {
- char buf[2048];
- int n = 0;
+ char buf[2048];
+ int n = 0;
- if (conn->flags & NSF_CONNECTING) {
- int ok = 1, ret;
- socklen_t len = sizeof(ok);
+ if (conn->flags & NSF_CONNECTING) {
+ int ok = 1, ret;
+ socklen_t len = sizeof(ok);
- ret = getsockopt(conn->sock, SOL_SOCKET, SO_ERROR, (char *) &ok, &len);
- (void) ret;
+ ret = getsockopt(conn->sock, SOL_SOCKET, SO_ERROR, (char *) &ok, &len);
+ (void) ret;
#ifdef NS_ENABLE_SSL
- if (ret == 0 && ok == 0 && conn->ssl != NULL) {
- int res = SSL_connect(conn->ssl);
- int ssl_err = ns_ssl_err(conn, res);
- if (res == 1) {
- conn->flags |= NSF_SSL_HANDSHAKE_DONE;
- } else if (ssl_err == SSL_ERROR_WANT_READ ||
- ssl_err == SSL_ERROR_WANT_WRITE) {
- return; // Call us again
- } else {
- ok = 1;
- }
- }
+ if (ret == 0 && ok == 0 && conn->ssl != NULL) {
+ int res = SSL_connect(conn->ssl);
+ int ssl_err = ns_ssl_err(conn, res);
+ if (res == 1) {
+ conn->flags |= NSF_SSL_HANDSHAKE_DONE;
+ } else if (ssl_err == SSL_ERROR_WANT_READ ||
+ ssl_err == SSL_ERROR_WANT_WRITE) {
+ return; // Call us again
+ } else {
+ ok = 1;
+ }
+ }
#endif
- conn->flags &= ~NSF_CONNECTING;
- DBG(("%p ok=%d", conn, ok));
- if (ok != 0) {
- conn->flags |= NSF_CLOSE_IMMEDIATELY;
- }
- ns_call(conn, NS_CONNECT, &ok);
- return;
- }
+ conn->flags &= ~NSF_CONNECTING;
+ DBG(("%p ok=%d", conn, ok));
+ if (ok != 0) {
+ conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ }
+ ns_call(conn, NS_CONNECT, &ok);
+ return;
+ }
#ifdef NS_ENABLE_SSL
- if (conn->ssl != NULL) {
- if (conn->flags & NSF_SSL_HANDSHAKE_DONE) {
- // SSL library may have more bytes ready to read then we ask to read.
- // Therefore, read in a loop until we read everything. Without the loop,
- // we skip to the next select() cycle which can just timeout.
- while ((n = SSL_read(conn->ssl, buf, sizeof(buf))) > 0) {
- DBG(("%p %d <- %d bytes (SSL)", conn, conn->flags, n));
- iobuf_append(&conn->recv_iobuf, buf, n);
- ns_call(conn, NS_RECV, &n);
- }
- ns_ssl_err(conn, n);
- } else {
- int res = SSL_accept(conn->ssl);
- int ssl_err = ns_ssl_err(conn, res);
- if (res == 1) {
- conn->flags |= NSF_SSL_HANDSHAKE_DONE;
- } else if (ssl_err == SSL_ERROR_WANT_READ ||
- ssl_err == SSL_ERROR_WANT_WRITE) {
- return; // Call us again
- } else {
- conn->flags |= NSF_CLOSE_IMMEDIATELY;
- }
- return;
- }
- } else
+ if (conn->ssl != NULL) {
+ if (conn->flags & NSF_SSL_HANDSHAKE_DONE) {
+ // SSL library may have more bytes ready to read then we ask to read.
+ // Therefore, read in a loop until we read everything. Without the loop,
+ // we skip to the next select() cycle which can just timeout.
+ while ((n = SSL_read(conn->ssl, buf, sizeof(buf))) > 0) {
+ DBG(("%p %d <- %d bytes (SSL)", conn, conn->flags, n));
+ iobuf_append(&conn->recv_iobuf, buf, n);
+ ns_call(conn, NS_RECV, &n);
+ }
+ ns_ssl_err(conn, n);
+ } else {
+ int res = SSL_accept(conn->ssl);
+ int ssl_err = ns_ssl_err(conn, res);
+ if (res == 1) {
+ conn->flags |= NSF_SSL_HANDSHAKE_DONE;
+ } else if (ssl_err == SSL_ERROR_WANT_READ ||
+ ssl_err == SSL_ERROR_WANT_WRITE) {
+ return; // Call us again
+ } else {
+ conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ }
+ return;
+ }
+ } else
#endif
- {
- while ((n = recv(conn->sock, buf, sizeof(buf), 0)) > 0) {
- DBG(("%p %d <- %d bytes (PLAIN)", conn, conn->flags, n));
- iobuf_append(&conn->recv_iobuf, buf, n);
- ns_call(conn, NS_RECV, &n);
- }
- }
+ {
+ while ((n = recv(conn->sock, buf, sizeof(buf), 0)) > 0) {
+ DBG(("%p %d <- %d bytes (PLAIN)", conn, conn->flags, n));
+ iobuf_append(&conn->recv_iobuf, buf, n);
+ ns_call(conn, NS_RECV, &n);
+ }
+ }
- if (ns_is_error(n)) {
- conn->flags |= NSF_CLOSE_IMMEDIATELY;
- }
+ if (ns_is_error(n)) {
+ conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ }
}
static void ns_write_to_socket(struct ns_connection *conn) {
- struct iobuf *io = &conn->send_iobuf;
- int n = 0;
+ struct iobuf *io = &conn->send_iobuf;
+ int n = 0;
#ifdef NS_ENABLE_SSL
- if (conn->ssl != NULL) {
- n = SSL_write(conn->ssl, io->buf, io->len);
- if (n <= 0) {
- int ssl_err = ns_ssl_err(conn, n);
- if (ssl_err == SSL_ERROR_WANT_READ || ssl_err == SSL_ERROR_WANT_WRITE) {
- return; // Call us again
- } else {
- conn->flags |= NSF_CLOSE_IMMEDIATELY;
- }
- }
- } else
+ if (conn->ssl != NULL) {
+ n = SSL_write(conn->ssl, io->buf, io->len);
+ if (n <= 0) {
+ int ssl_err = ns_ssl_err(conn, n);
+ if (ssl_err == SSL_ERROR_WANT_READ || ssl_err == SSL_ERROR_WANT_WRITE) {
+ return; // Call us again
+ } else {
+ conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ }
+ }
+ } else
#endif
- { n = send(conn->sock, io->buf, io->len, 0); }
+ { n = send(conn->sock, io->buf, io->len, 0); }
- DBG(("%p %d -> %d bytes", conn, conn->flags, n));
+ DBG(("%p %d -> %d bytes", conn, conn->flags, n));
- ns_call(conn, NS_SEND, &n);
- if (ns_is_error(n)) {
- conn->flags |= NSF_CLOSE_IMMEDIATELY;
- } else if (n > 0) {
- iobuf_remove(io, n);
- }
+ ns_call(conn, NS_SEND, &n);
+ if (ns_is_error(n)) {
+ conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ } else if (n > 0) {
+ iobuf_remove(io, n);
+ }
}
int ns_send(struct ns_connection *conn, const void *buf, int len) {
- return iobuf_append(&conn->send_iobuf, buf, len);
+ return iobuf_append(&conn->send_iobuf, buf, len);
}
static void ns_add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) {
- if (sock != INVALID_SOCKET) {
- FD_SET(sock, set);
- if (*max_fd == INVALID_SOCKET || sock > *max_fd) {
- *max_fd = sock;
- }
- }
+ if (sock != INVALID_SOCKET) {
+ FD_SET(sock, set);
+ if (*max_fd == INVALID_SOCKET || sock > *max_fd) {
+ *max_fd = sock;
+ }
+ }
}
int ns_server_poll(struct ns_server *server, int milli) {
- struct ns_connection *conn, *tmp_conn;
- struct timeval tv;
- fd_set read_set, write_set;
- int num_active_connections = 0;
- sock_t max_fd = INVALID_SOCKET;
- time_t current_time = time(NULL);
-
- if (server->listening_sock == INVALID_SOCKET &&
- server->active_connections == NULL) return 0;
-
- FD_ZERO(&read_set);
- FD_ZERO(&write_set);
- ns_add_to_set(server->listening_sock, &read_set, &max_fd);
- ns_add_to_set(server->ctl[1], &read_set, &max_fd);
-
- for (conn = server->active_connections; conn != NULL; conn = tmp_conn) {
- tmp_conn = conn->next;
- ns_call(conn, NS_POLL, &current_time);
- if (!(conn->flags & NSF_WANT_WRITE)) {
- //DBG(("%p read_set", conn));
- ns_add_to_set(conn->sock, &read_set, &max_fd);
- }
- if (((conn->flags & NSF_CONNECTING) && !(conn->flags & NSF_WANT_READ)) ||
- (conn->send_iobuf.len > 0 && !(conn->flags & NSF_CONNECTING) &&
- !(conn->flags & NSF_BUFFER_BUT_DONT_SEND))) {
- //DBG(("%p write_set", conn));
- ns_add_to_set(conn->sock, &write_set, &max_fd);
- }
- if (conn->flags & NSF_CLOSE_IMMEDIATELY) {
- ns_close_conn(conn);
- }
- }
-
- tv.tv_sec = milli / 1000;
- tv.tv_usec = (milli % 1000) * 1000;
-
- if (select((int) max_fd + 1, &read_set, &write_set, NULL, &tv) > 0) {
- // select() might have been waiting for a long time, reset current_time
- // now to prevent last_io_time being set to the past.
- current_time = time(NULL);
-
- // Accept new connections
- if (server->listening_sock != INVALID_SOCKET &&
- FD_ISSET(server->listening_sock, &read_set)) {
- // We're not looping here, and accepting just one connection at
- // a time. The reason is that eCos does not respect non-blocking
- // flag on a listening socket and hangs in a loop.
- if ((conn = accept_conn(server)) != NULL) {
- conn->last_io_time = current_time;
- }
- }
-
- // Read wakeup messages
- if (server->ctl[1] != INVALID_SOCKET &&
- FD_ISSET(server->ctl[1], &read_set)) {
- struct ctl_msg ctl_msg;
- int len = recv(server->ctl[1], (char *) &ctl_msg, sizeof(ctl_msg), 0);
- send(server->ctl[1], ctl_msg.message, 1, 0);
- if (len >= (int) sizeof(ctl_msg.callback) && ctl_msg.callback != NULL) {
- ns_iterate(server, ctl_msg.callback, ctl_msg.message);
- }
- }
-
- for (conn = server->active_connections; conn != NULL; conn = tmp_conn) {
- tmp_conn = conn->next;
- if (FD_ISSET(conn->sock, &read_set)) {
- conn->last_io_time = current_time;
- ns_read_from_socket(conn);
- }
- if (FD_ISSET(conn->sock, &write_set)) {
- if (conn->flags & NSF_CONNECTING) {
- ns_read_from_socket(conn);
- } else if (!(conn->flags & NSF_BUFFER_BUT_DONT_SEND)) {
- conn->last_io_time = current_time;
- ns_write_to_socket(conn);
- }
- }
- }
- }
-
- for (conn = server->active_connections; conn != NULL; conn = tmp_conn) {
- tmp_conn = conn->next;
- num_active_connections++;
- if ((conn->flags & NSF_CLOSE_IMMEDIATELY) ||
- (conn->send_iobuf.len == 0 &&
- (conn->flags & NSF_FINISHED_SENDING_DATA))) {
- ns_close_conn(conn);
- }
- }
- //DBG(("%d active connections", num_active_connections));
-
- return num_active_connections;
+ struct ns_connection *conn, *tmp_conn;
+ struct timeval tv;
+ fd_set read_set, write_set;
+ int num_active_connections = 0;
+ sock_t max_fd = INVALID_SOCKET;
+ time_t current_time = time(NULL);
+
+ if (server->listening_sock == INVALID_SOCKET &&
+ server->active_connections == NULL) return 0;
+
+ FD_ZERO(&read_set);
+ FD_ZERO(&write_set);
+ ns_add_to_set(server->listening_sock, &read_set, &max_fd);
+ ns_add_to_set(server->ctl[1], &read_set, &max_fd);
+
+ for (conn = server->active_connections; conn != NULL; conn = tmp_conn) {
+ tmp_conn = conn->next;
+ ns_call(conn, NS_POLL, &current_time);
+ if (!(conn->flags & NSF_WANT_WRITE)) {
+ //DBG(("%p read_set", conn));
+ ns_add_to_set(conn->sock, &read_set, &max_fd);
+ }
+ if (((conn->flags & NSF_CONNECTING) && !(conn->flags & NSF_WANT_READ)) ||
+ (conn->send_iobuf.len > 0 && !(conn->flags & NSF_CONNECTING) &&
+ !(conn->flags & NSF_BUFFER_BUT_DONT_SEND))) {
+ //DBG(("%p write_set", conn));
+ ns_add_to_set(conn->sock, &write_set, &max_fd);
+ }
+ if (conn->flags & NSF_CLOSE_IMMEDIATELY) {
+ ns_close_conn(conn);
+ }
+ }
+
+ tv.tv_sec = milli / 1000;
+ tv.tv_usec = (milli % 1000) * 1000;
+
+ if (select((int) max_fd + 1, &read_set, &write_set, NULL, &tv) > 0) {
+ // select() might have been waiting for a long time, reset current_time
+ // now to prevent last_io_time being set to the past.
+ current_time = time(NULL);
+
+ // Accept new connections
+ if (server->listening_sock != INVALID_SOCKET &&
+ FD_ISSET(server->listening_sock, &read_set)) {
+ // We're not looping here, and accepting just one connection at
+ // a time. The reason is that eCos does not respect non-blocking
+ // flag on a listening socket and hangs in a loop.
+ if ((conn = accept_conn(server)) != NULL) {
+ conn->last_io_time = current_time;
+ }
+ }
+
+ // Read wakeup messages
+ if (server->ctl[1] != INVALID_SOCKET &&
+ FD_ISSET(server->ctl[1], &read_set)) {
+ struct ctl_msg ctl_msg;
+ int len = recv(server->ctl[1], (char *) &ctl_msg, sizeof(ctl_msg), 0);
+ send(server->ctl[1], ctl_msg.message, 1, 0);
+ if (len >= (int) sizeof(ctl_msg.callback) && ctl_msg.callback != NULL) {
+ ns_iterate(server, ctl_msg.callback, ctl_msg.message);
+ }
+ }
+
+ for (conn = server->active_connections; conn != NULL; conn = tmp_conn) {
+ tmp_conn = conn->next;
+ if (FD_ISSET(conn->sock, &read_set)) {
+ conn->last_io_time = current_time;
+ ns_read_from_socket(conn);
+ }
+ if (FD_ISSET(conn->sock, &write_set)) {
+ if (conn->flags & NSF_CONNECTING) {
+ ns_read_from_socket(conn);
+ } else if (!(conn->flags & NSF_BUFFER_BUT_DONT_SEND)) {
+ conn->last_io_time = current_time;
+ ns_write_to_socket(conn);
+ }
+ }
+ }
+ }
+
+ for (conn = server->active_connections; conn != NULL; conn = tmp_conn) {
+ tmp_conn = conn->next;
+ num_active_connections++;
+ if ((conn->flags & NSF_CLOSE_IMMEDIATELY) ||
+ (conn->send_iobuf.len == 0 &&
+ (conn->flags & NSF_FINISHED_SENDING_DATA))) {
+ ns_close_conn(conn);
+ }
+ }
+ //DBG(("%d active connections", num_active_connections));
+
+ return num_active_connections;
}
struct ns_connection *ns_connect(struct ns_server *server, const char *host,
- int port, int use_ssl, void *param) {
- sock_t sock = INVALID_SOCKET;
- struct sockaddr_in sin;
- struct hostent *he = NULL;
- struct ns_connection *conn = NULL;
- int connect_ret_val;
-
- (void) use_ssl;
-
- if (host == NULL || (he = gethostbyname(host)) == NULL ||
- (sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
- DBG(("gethostbyname(%s) failed: %s", host, strerror(errno)));
- return NULL;
- }
-
- sin.sin_family = AF_INET;
- sin.sin_port = htons((uint16_t) port);
- sin.sin_addr = * (struct in_addr *) he->h_addr_list[0];
- ns_set_non_blocking_mode(sock);
-
- connect_ret_val = connect(sock, (struct sockaddr *) &sin, sizeof(sin));
- if (ns_is_error(connect_ret_val)) {
- closesocket(sock);
- return NULL;
- } else if ((conn = (struct ns_connection *)
- NS_MALLOC(sizeof(*conn))) == NULL) {
- closesocket(sock);
- return NULL;
- }
-
- memset(conn, 0, sizeof(*conn));
- conn->server = server;
- conn->sock = sock;
- conn->connection_data = param;
- conn->flags = NSF_CONNECTING;
- conn->last_io_time = time(NULL);
+ int port, int use_ssl, void *param) {
+ sock_t sock = INVALID_SOCKET;
+ struct sockaddr_in sin;
+ struct hostent *he = NULL;
+ struct ns_connection *conn = NULL;
+ int connect_ret_val;
+
+ (void) use_ssl;
+
+ if (host == NULL || (he = gethostbyname(host)) == NULL ||
+ (sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
+ DBG(("gethostbyname(%s) failed: %s", host, strerror(errno)));
+ return NULL;
+ }
+
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons((uint16_t) port);
+ sin.sin_addr = * (struct in_addr *) he->h_addr_list[0];
+ ns_set_non_blocking_mode(sock);
+
+ connect_ret_val = connect(sock, (struct sockaddr *) &sin, sizeof(sin));
+ if (ns_is_error(connect_ret_val)) {
+ closesocket(sock);
+ return NULL;
+ } else if ((conn = (struct ns_connection *)
+ NS_MALLOC(sizeof(*conn))) == NULL) {
+ closesocket(sock);
+ return NULL;
+ }
+
+ memset(conn, 0, sizeof(*conn));
+ conn->server = server;
+ conn->sock = sock;
+ conn->connection_data = param;
+ conn->flags = NSF_CONNECTING;
+ conn->last_io_time = time(NULL);
#ifdef NS_ENABLE_SSL
- if (use_ssl &&
- (conn->ssl = SSL_new(server->client_ssl_ctx)) != NULL) {
- SSL_set_fd(conn->ssl, sock);
- }
+ if (use_ssl &&
+ (conn->ssl = SSL_new(server->client_ssl_ctx)) != NULL) {
+ SSL_set_fd(conn->ssl, sock);
+ }
#endif
- ns_add_conn(server, conn);
- DBG(("%p %s:%d %d %p", conn, host, port, conn->sock, conn->ssl));
+ ns_add_conn(server, conn);
+ DBG(("%p %s:%d %d %p", conn, host, port, conn->sock, conn->ssl));
- return conn;
+ return conn;
}
struct ns_connection *ns_add_sock(struct ns_server *s, sock_t sock, void *p) {
- struct ns_connection *conn;
- if ((conn = (struct ns_connection *) NS_MALLOC(sizeof(*conn))) != NULL) {
- memset(conn, 0, sizeof(*conn));
- ns_set_non_blocking_mode(sock);
- conn->sock = sock;
- conn->connection_data = p;
- conn->server = s;
- conn->last_io_time = time(NULL);
- ns_add_conn(s, conn);
- DBG(("%p %d", conn, sock));
- }
- return conn;
+ struct ns_connection *conn;
+ if ((conn = (struct ns_connection *) NS_MALLOC(sizeof(*conn))) != NULL) {
+ memset(conn, 0, sizeof(*conn));
+ ns_set_non_blocking_mode(sock);
+ conn->sock = sock;
+ conn->connection_data = p;
+ conn->server = s;
+ conn->last_io_time = time(NULL);
+ ns_add_conn(s, conn);
+ DBG(("%p %d", conn, sock));
+ }
+ return conn;
}
struct ns_connection *ns_next(struct ns_server *s, struct ns_connection *conn) {
- return conn == NULL ? s->active_connections : conn->next;
+ return conn == NULL ? s->active_connections : conn->next;
}
void ns_iterate(struct ns_server *server, ns_callback_t cb, void *param) {
- struct ns_connection *conn, *tmp_conn;
+ struct ns_connection *conn, *tmp_conn;
- for (conn = server->active_connections; conn != NULL; conn = tmp_conn) {
- tmp_conn = conn->next;
- cb(conn, NS_POLL, param);
- }
+ for (conn = server->active_connections; conn != NULL; conn = tmp_conn) {
+ tmp_conn = conn->next;
+ cb(conn, NS_POLL, param);
+ }
}
void ns_server_wakeup_ex(struct ns_server *server, ns_callback_t cb,
- void *data, size_t len) {
- struct ctl_msg ctl_msg;
- if (server->ctl[0] != INVALID_SOCKET && data != NULL &&
- len < sizeof(ctl_msg.message)) {
- ctl_msg.callback = cb;
- memcpy(ctl_msg.message, data, len);
- send(server->ctl[0], (char *) &ctl_msg,
- offsetof(struct ctl_msg, message) + len, 0);
- recv(server->ctl[0], (char *) &len, 1, 0);
- }
+ void *data, size_t len) {
+ struct ctl_msg ctl_msg;
+ if (server->ctl[0] != INVALID_SOCKET && data != NULL &&
+ len < sizeof(ctl_msg.message)) {
+ ctl_msg.callback = cb;
+ memcpy(ctl_msg.message, data, len);
+ send(server->ctl[0], (char *) &ctl_msg,
+ offsetof(struct ctl_msg, message) + len, 0);
+ recv(server->ctl[0], (char *) &len, 1, 0);
+ }
}
void ns_server_wakeup(struct ns_server *server) {
- ns_server_wakeup_ex(server, NULL, (void *) "", 0);
+ ns_server_wakeup_ex(server, NULL, (void *) "", 0);
}
void ns_server_init(struct ns_server *s, void *server_data, ns_callback_t cb) {
- memset(s, 0, sizeof(*s));
- s->listening_sock = s->ctl[0] = s->ctl[1] = INVALID_SOCKET;
- s->server_data = server_data;
- s->callback = cb;
+ memset(s, 0, sizeof(*s));
+ s->listening_sock = s->ctl[0] = s->ctl[1] = INVALID_SOCKET;
+ s->server_data = server_data;
+ s->callback = cb;
#ifdef _WIN32
- { WSADATA data; WSAStartup(MAKEWORD(2, 2), &data); }
+ { WSADATA data; WSAStartup(MAKEWORD(2, 2), &data); }
#else
- // Ignore SIGPIPE signal, so if client cancels the request, it
- // won't kill the whole process.
- signal(SIGPIPE, SIG_IGN);
+ // Ignore SIGPIPE signal, so if client cancels the request, it
+ // won't kill the whole process.
+ signal(SIGPIPE, SIG_IGN);
#endif
#ifndef NS_DISABLE_SOCKETPAIR
- do {
- ns_socketpair2(s->ctl, SOCK_DGRAM);
- } while (s->ctl[0] == INVALID_SOCKET);
+ do {
+ ns_socketpair2(s->ctl, SOCK_DGRAM);
+ } while (s->ctl[0] == INVALID_SOCKET);
#endif
#ifdef NS_ENABLE_SSL
- {static int init_done; if (!init_done) { SSL_library_init(); init_done++; }}
- s->client_ssl_ctx = SSL_CTX_new(SSLv23_client_method());
+ {static int init_done; if (!init_done) { SSL_library_init(); init_done++; }}
+ s->client_ssl_ctx = SSL_CTX_new(SSLv23_client_method());
#endif
}
void ns_server_free(struct ns_server *s) {
- struct ns_connection *conn, *tmp_conn;
+ struct ns_connection *conn, *tmp_conn;
- DBG(("%p", s));
- if (s == NULL) return;
- // Do one last poll, see https://github.com/cesanta/mongoose/issues/286
- ns_server_poll(s, 0);
+ DBG(("%p", s));
+ if (s == NULL) return;
+ // Do one last poll, see https://github.com/cesanta/mongoose/issues/286
+ ns_server_poll(s, 0);
- if (s->listening_sock != INVALID_SOCKET) closesocket(s->listening_sock);
- if (s->ctl[0] != INVALID_SOCKET) closesocket(s->ctl[0]);
- if (s->ctl[1] != INVALID_SOCKET) closesocket(s->ctl[1]);
- s->listening_sock = s->ctl[0] = s->ctl[1] = INVALID_SOCKET;
+ if (s->listening_sock != INVALID_SOCKET) closesocket(s->listening_sock);
+ if (s->ctl[0] != INVALID_SOCKET) closesocket(s->ctl[0]);
+ if (s->ctl[1] != INVALID_SOCKET) closesocket(s->ctl[1]);
+ s->listening_sock = s->ctl[0] = s->ctl[1] = INVALID_SOCKET;
- for (conn = s->active_connections; conn != NULL; conn = tmp_conn) {
- tmp_conn = conn->next;
- ns_close_conn(conn);
- }
+ for (conn = s->active_connections; conn != NULL; conn = tmp_conn) {
+ tmp_conn = conn->next;
+ ns_close_conn(conn);
+ }
#ifdef NS_ENABLE_SSL
- if (s->ssl_ctx != NULL) SSL_CTX_free(s->ssl_ctx);
- if (s->client_ssl_ctx != NULL) SSL_CTX_free(s->client_ssl_ctx);
- s->ssl_ctx = s->client_ssl_ctx = NULL;
+ if (s->ssl_ctx != NULL) SSL_CTX_free(s->ssl_ctx);
+ if (s->client_ssl_ctx != NULL) SSL_CTX_free(s->client_ssl_ctx);
+ s->ssl_ctx = s->client_ssl_ctx = NULL;
#endif
}
// net_skeleton end
@@ -1219,119 +1219,119 @@ typedef pid_t process_id_t;
#endif
struct vec {
- const char *ptr;
- int len;
+ const char *ptr;
+ int len;
};
// For directory listing and WevDAV support
struct dir_entry {
- struct connection *conn;
- char *file_name;
- file_stat_t st;
+ struct connection *conn;
+ char *file_name;
+ file_stat_t st;
};
// NOTE(lsm): this enum shoulds be in sync with the config_options.
enum {
- ACCESS_CONTROL_LIST,
+ ACCESS_CONTROL_LIST,
#ifndef MONGOOSE_NO_FILESYSTEM
- ACCESS_LOG_FILE,
+ ACCESS_LOG_FILE,
#ifndef MONGOOSE_NO_AUTH
- AUTH_DOMAIN,
+ AUTH_DOMAIN,
#endif
#ifndef MONGOOSE_NO_CGI
- CGI_INTERPRETER,
- CGI_PATTERN,
+ CGI_INTERPRETER,
+ CGI_PATTERN,
#endif
- DAV_AUTH_FILE,
- DOCUMENT_ROOT,
+ DAV_AUTH_FILE,
+ DOCUMENT_ROOT,
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
- ENABLE_DIRECTORY_LISTING,
+ ENABLE_DIRECTORY_LISTING,
#endif
#endif
- ENABLE_PROXY,
- EXTRA_MIME_TYPES,
+ ENABLE_PROXY,
+ EXTRA_MIME_TYPES,
#if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_AUTH)
- GLOBAL_AUTH_FILE,
+ GLOBAL_AUTH_FILE,
#endif
#ifndef MONGOOSE_NO_FILESYSTEM
- HIDE_FILES_PATTERN,
- HEXDUMP_FILE,
- INDEX_FILES,
+ HIDE_FILES_PATTERN,
+ HEXDUMP_FILE,
+ INDEX_FILES,
#endif
- LISTENING_PORT,
+ LISTENING_PORT,
#ifndef _WIN32
- RUN_AS_USER,
+ RUN_AS_USER,
#endif
#ifndef MONGOOSE_NO_SSI
- SSI_PATTERN,
+ SSI_PATTERN,
#endif
#ifdef NS_ENABLE_SSL
- SSL_CERTIFICATE,
- SSL_CA_CERTIFICATE,
- SSL_MITM_CERTS,
+ SSL_CERTIFICATE,
+ SSL_CA_CERTIFICATE,
+ SSL_MITM_CERTS,
#endif
- URL_REWRITES,
- NUM_OPTIONS
+ URL_REWRITES,
+ NUM_OPTIONS
};
static const char *static_config_options[] = {
- "access_control_list", NULL,
+ "access_control_list", NULL,
#ifndef MONGOOSE_NO_FILESYSTEM
- "access_log_file", NULL,
+ "access_log_file", NULL,
#ifndef MONGOOSE_NO_AUTH
- "auth_domain", "mydomain.com",
+ "auth_domain", "mydomain.com",
#endif
#ifndef MONGOOSE_NO_CGI
- "cgi_interpreter", NULL,
- "cgi_pattern", DEFAULT_CGI_PATTERN,
+ "cgi_interpreter", NULL,
+ "cgi_pattern", DEFAULT_CGI_PATTERN,
#endif
- "dav_auth_file", NULL,
- "document_root", NULL,
+ "dav_auth_file", NULL,
+ "document_root", NULL,
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
- "enable_directory_listing", "yes",
+ "enable_directory_listing", "yes",
#endif
#endif
- "enable_proxy", NULL,
- "extra_mime_types", NULL,
+ "enable_proxy", NULL,
+ "extra_mime_types", NULL,
#if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_AUTH)
- "global_auth_file", NULL,
+ "global_auth_file", NULL,
#endif
#ifndef MONGOOSE_NO_FILESYSTEM
- "hide_files_patterns", NULL,
- "hexdump_file", NULL,
- "index_files","index.html,index.htm,index.shtml,index.cgi,index.php,index.lp",
+ "hide_files_patterns", NULL,
+ "hexdump_file", NULL,
+ "index_files","index.html,index.htm,index.shtml,index.cgi,index.php,index.lp",
#endif
- "listening_port", NULL,
+ "listening_port", NULL,
#ifndef _WIN32
- "run_as_user", NULL,
+ "run_as_user", NULL,
#endif
#ifndef MONGOOSE_NO_SSI
- "ssi_pattern", "**.shtml$|**.shtm$",
+ "ssi_pattern", "**.shtml$|**.shtm$",
#endif
#ifdef NS_ENABLE_SSL
- "ssl_certificate", NULL,
- "ssl_ca_certificate", NULL,
- "ssl_mitm_certs", NULL,
+ "ssl_certificate", NULL,
+ "ssl_ca_certificate", NULL,
+ "ssl_mitm_certs", NULL,
#endif
- "url_rewrites", NULL,
- NULL
+ "url_rewrites", NULL,
+ NULL
};
struct mg_server {
- struct ns_server ns_server;
- union socket_address lsa; // Listening socket address
- mg_handler_t event_handler;
- char *config_options[NUM_OPTIONS];
+ struct ns_server ns_server;
+ union socket_address lsa; // Listening socket address
+ mg_handler_t event_handler;
+ char *config_options[NUM_OPTIONS];
};
// Local endpoint representation
union endpoint {
- int fd; // Opened regular local file
- struct ns_connection *nc; // CGI or proxy->target connection
+ int fd; // Opened regular local file
+ struct ns_connection *nc; // CGI or proxy->target connection
};
enum endpoint_type {
- EP_NONE, EP_FILE, EP_CGI, EP_USER, EP_PUT, EP_CLIENT, EP_PROXY
+ EP_NONE, EP_FILE, EP_CGI, EP_USER, EP_PUT, EP_CLIENT, EP_PROXY
};
#define MG_HEADERS_SENT NSF_USER_1
@@ -1341,82 +1341,82 @@ enum endpoint_type {
#define MG_PROXY_DONT_PARSE NSF_USER_5
struct connection {
- struct ns_connection *ns_conn; // NOTE(lsm): main.c depends on this order
- struct mg_connection mg_conn;
- struct mg_server *server;
- union endpoint endpoint;
- enum endpoint_type endpoint_type;
- char *path_info;
- char *request;
- int64_t num_bytes_recv; // Total number of bytes received
- int64_t cl; // Reply content length, for Range support
- int request_len; // Request length, including last \r\n after last header
+ struct ns_connection *ns_conn; // NOTE(lsm): main.c depends on this order
+ struct mg_connection mg_conn;
+ struct mg_server *server;
+ union endpoint endpoint;
+ enum endpoint_type endpoint_type;
+ char *path_info;
+ char *request;
+ int64_t num_bytes_recv; // Total number of bytes received
+ int64_t cl; // Reply content length, for Range support
+ int request_len; // Request length, including last \r\n after last header
};
#define MG_CONN_2_CONN(c) ((struct connection *) ((char *) (c) - \
- offsetof(struct connection, mg_conn)))
+ offsetof(struct connection, mg_conn)))
static void open_local_endpoint(struct connection *conn, int skip_user);
static void close_local_endpoint(struct connection *conn);
static const struct {
- const char *extension;
- size_t ext_len;
- const char *mime_type;
+ const char *extension;
+ size_t ext_len;
+ const char *mime_type;
} static_builtin_mime_types[] = {
- {".html", 5, "text/html"},
- {".htm", 4, "text/html"},
- {".shtm", 5, "text/html"},
- {".shtml", 6, "text/html"},
- {".css", 4, "text/css"},
- {".js", 3, "application/x-javascript"},
- {".ico", 4, "image/x-icon"},
- {".gif", 4, "image/gif"},
- {".jpg", 4, "image/jpeg"},
- {".jpeg", 5, "image/jpeg"},
- {".png", 4, "image/png"},
- {".svg", 4, "image/svg+xml"},
- {".txt", 4, "text/plain"},
- {".torrent", 8, "application/x-bittorrent"},
- {".wav", 4, "audio/x-wav"},
- {".mp3", 4, "audio/x-mp3"},
- {".mid", 4, "audio/mid"},
- {".m3u", 4, "audio/x-mpegurl"},
- {".ogg", 4, "application/ogg"},
- {".ram", 4, "audio/x-pn-realaudio"},
- {".xml", 4, "text/xml"},
- {".json", 5, "application/json"},
- {".xslt", 5, "application/xml"},
- {".xsl", 4, "application/xml"},
- {".ra", 3, "audio/x-pn-realaudio"},
- {".doc", 4, "application/msword"},
- {".exe", 4, "application/octet-stream"},
- {".zip", 4, "application/x-zip-compressed"},
- {".xls", 4, "application/excel"},
- {".tgz", 4, "application/x-tar-gz"},
- {".tar", 4, "application/x-tar"},
- {".gz", 3, "application/x-gunzip"},
- {".arj", 4, "application/x-arj-compressed"},
- {".rar", 4, "application/x-rar-compressed"},
- {".rtf", 4, "application/rtf"},
- {".pdf", 4, "application/pdf"},
- {".swf", 4, "application/x-shockwave-flash"},
- {".mpg", 4, "video/mpeg"},
- {".webm", 5, "video/webm"},
- {".mpeg", 5, "video/mpeg"},
- {".mov", 4, "video/quicktime"},
- {".mp4", 4, "video/mp4"},
- {".m4v", 4, "video/x-m4v"},
- {".asf", 4, "video/x-ms-asf"},
- {".avi", 4, "video/x-msvideo"},
- {".bmp", 4, "image/bmp"},
- {".ttf", 4, "application/x-font-ttf"},
- {NULL, 0, NULL}
+ {".html", 5, "text/html"},
+ {".htm", 4, "text/html"},
+ {".shtm", 5, "text/html"},
+ {".shtml", 6, "text/html"},
+ {".css", 4, "text/css"},
+ {".js", 3, "application/x-javascript"},
+ {".ico", 4, "image/x-icon"},
+ {".gif", 4, "image/gif"},
+ {".jpg", 4, "image/jpeg"},
+ {".jpeg", 5, "image/jpeg"},
+ {".png", 4, "image/png"},
+ {".svg", 4, "image/svg+xml"},
+ {".txt", 4, "text/plain"},
+ {".torrent", 8, "application/x-bittorrent"},
+ {".wav", 4, "audio/x-wav"},
+ {".mp3", 4, "audio/x-mp3"},
+ {".mid", 4, "audio/mid"},
+ {".m3u", 4, "audio/x-mpegurl"},
+ {".ogg", 4, "application/ogg"},
+ {".ram", 4, "audio/x-pn-realaudio"},
+ {".xml", 4, "text/xml"},
+ {".json", 5, "application/json"},
+ {".xslt", 5, "application/xml"},
+ {".xsl", 4, "application/xml"},
+ {".ra", 3, "audio/x-pn-realaudio"},
+ {".doc", 4, "application/msword"},
+ {".exe", 4, "application/octet-stream"},
+ {".zip", 4, "application/x-zip-compressed"},
+ {".xls", 4, "application/excel"},
+ {".tgz", 4, "application/x-tar-gz"},
+ {".tar", 4, "application/x-tar"},
+ {".gz", 3, "application/x-gunzip"},
+ {".arj", 4, "application/x-arj-compressed"},
+ {".rar", 4, "application/x-rar-compressed"},
+ {".rtf", 4, "application/rtf"},
+ {".pdf", 4, "application/pdf"},
+ {".swf", 4, "application/x-shockwave-flash"},
+ {".mpg", 4, "video/mpeg"},
+ {".webm", 5, "video/webm"},
+ {".mpeg", 5, "video/mpeg"},
+ {".mov", 4, "video/quicktime"},
+ {".mp4", 4, "video/mp4"},
+ {".m4v", 4, "video/x-m4v"},
+ {".asf", 4, "video/x-ms-asf"},
+ {".avi", 4, "video/x-msvideo"},
+ {".bmp", 4, "image/bmp"},
+ {".ttf", 4, "application/x-font-ttf"},
+ {NULL, 0, NULL}
};
#ifndef MONGOOSE_NO_THREADS
void *mg_start_thread(void *(*f)(void *), void *p) {
- return ns_start_thread(f, p);
+ return ns_start_thread(f, p);
}
#endif // MONGOOSE_NO_THREADS
@@ -1424,44 +1424,44 @@ void *mg_start_thread(void *(*f)(void *), void *p) {
// Encode 'path' which is assumed UTF-8 string, into UNICODE string.
// wbuf and wbuf_len is a target buffer and its length.
static void to_wchar(const char *path, wchar_t *wbuf, size_t wbuf_len) {
- char buf[MAX_PATH_SIZE * 2], buf2[MAX_PATH_SIZE * 2], *p;
+ char buf[MAX_PATH_SIZE * 2], buf2[MAX_PATH_SIZE * 2], *p;
- strncpy(buf, path, sizeof(buf));
- buf[sizeof(buf) - 1] = '\0';
+ strncpy(buf, path, sizeof(buf));
+ buf[sizeof(buf) - 1] = '\0';
- // Trim trailing slashes. Leave backslash for paths like "X:\"
- p = buf + strlen(buf) - 1;
- while (p > buf && p[-1] != ':' && (p[0] == '\\' || p[0] == '/')) *p-- = '\0';
+ // Trim trailing slashes. Leave backslash for paths like "X:\"
+ p = buf + strlen(buf) - 1;
+ while (p > buf && p[-1] != ':' && (p[0] == '\\' || p[0] == '/')) *p-- = '\0';
- // Convert to Unicode and back. If doubly-converted string does not
- // match the original, something is fishy, reject.
- memset(wbuf, 0, wbuf_len * sizeof(wchar_t));
- MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, (int) wbuf_len);
- WideCharToMultiByte(CP_UTF8, 0, wbuf, (int) wbuf_len, buf2, sizeof(buf2),
- NULL, NULL);
- if (strcmp(buf, buf2) != 0) {
- wbuf[0] = L'\0';
- }
+ // Convert to Unicode and back. If doubly-converted string does not
+ // match the original, something is fishy, reject.
+ memset(wbuf, 0, wbuf_len * sizeof(wchar_t));
+ MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, (int) wbuf_len);
+ WideCharToMultiByte(CP_UTF8, 0, wbuf, (int) wbuf_len, buf2, sizeof(buf2),
+ NULL, NULL);
+ if (strcmp(buf, buf2) != 0) {
+ wbuf[0] = L'\0';
+ }
}
static int mg_stat(const char *path, file_stat_t *st) {
- wchar_t wpath[MAX_PATH_SIZE];
- to_wchar(path, wpath, ARRAY_SIZE(wpath));
- DBG(("[%ls] -> %d", wpath, _wstati64(wpath, st)));
- return _wstati64(wpath, st);
+ wchar_t wpath[MAX_PATH_SIZE];
+ to_wchar(path, wpath, ARRAY_SIZE(wpath));
+ DBG(("[%ls] -> %d", wpath, _wstati64(wpath, st)));
+ return _wstati64(wpath, st);
}
static FILE *mg_fopen(const char *path, const char *mode) {
- wchar_t wpath[MAX_PATH_SIZE], wmode[10];
- to_wchar(path, wpath, ARRAY_SIZE(wpath));
- to_wchar(mode, wmode, ARRAY_SIZE(wmode));
- return _wfopen(wpath, wmode);
+ wchar_t wpath[MAX_PATH_SIZE], wmode[10];
+ to_wchar(path, wpath, ARRAY_SIZE(wpath));
+ to_wchar(mode, wmode, ARRAY_SIZE(wmode));
+ return _wfopen(wpath, wmode);
}
static int mg_open(const char *path, int flag) {
- wchar_t wpath[MAX_PATH_SIZE];
- to_wchar(path, wpath, ARRAY_SIZE(wpath));
- return _wopen(wpath, flag);
+ wchar_t wpath[MAX_PATH_SIZE];
+ to_wchar(path, wpath, ARRAY_SIZE(wpath));
+ return _wopen(wpath, flag);
}
#endif // _WIN32 && !MONGOOSE_NO_FILESYSTEM
@@ -1472,60 +1472,60 @@ static int mg_open(const char *path, int flag) {
// vector is initialized to point to the "y" part, and val vector length
// is adjusted to point only to "x".
static const char *next_option(const char *list, struct vec *val,
- struct vec *eq_val) {
- if (list == NULL || *list == '\0') {
- // End of the list
- list = NULL;
- } else {
- val->ptr = list;
- if ((list = strchr(val->ptr, ',')) != NULL) {
- // Comma found. Store length and shift the list ptr
- val->len = list - val->ptr;
- list++;
- } else {
- // This value is the last one
- list = val->ptr + strlen(val->ptr);
- val->len = list - val->ptr;
- }
-
- if (eq_val != NULL) {
- // Value has form "x=y", adjust pointers and lengths
- // so that val points to "x", and eq_val points to "y".
- eq_val->len = 0;
- eq_val->ptr = (const char *) memchr(val->ptr, '=', val->len);
- if (eq_val->ptr != NULL) {
- eq_val->ptr++; // Skip over '=' character
- eq_val->len = val->ptr + val->len - eq_val->ptr;
- val->len = (eq_val->ptr - val->ptr) - 1;
- }
- }
- }
-
- return list;
+ struct vec *eq_val) {
+ if (list == NULL || *list == '\0') {
+ // End of the list
+ list = NULL;
+ } else {
+ val->ptr = list;
+ if ((list = strchr(val->ptr, ',')) != NULL) {
+ // Comma found. Store length and shift the list ptr
+ val->len = list - val->ptr;
+ list++;
+ } else {
+ // This value is the last one
+ list = val->ptr + strlen(val->ptr);
+ val->len = list - val->ptr;
+ }
+
+ if (eq_val != NULL) {
+ // Value has form "x=y", adjust pointers and lengths
+ // so that val points to "x", and eq_val points to "y".
+ eq_val->len = 0;
+ eq_val->ptr = (const char *) memchr(val->ptr, '=', val->len);
+ if (eq_val->ptr != NULL) {
+ eq_val->ptr++; // Skip over '=' character
+ eq_val->len = val->ptr + val->len - eq_val->ptr;
+ val->len = (eq_val->ptr - val->ptr) - 1;
+ }
+ }
+ }
+
+ return list;
}
// Like snprintf(), but never returns negative value, or a value
// that is larger than a supplied buffer.
static int mg_vsnprintf(char *buf, size_t buflen, const char *fmt, va_list ap) {
- int n;
- if (buflen < 1) return 0;
- n = vsnprintf(buf, buflen, fmt, ap);
- if (n < 0) {
- n = 0;
- } else if (n >= (int) buflen) {
- n = (int) buflen - 1;
- }
- buf[n] = '\0';
- return n;
+ int n;
+ if (buflen < 1) return 0;
+ n = vsnprintf(buf, buflen, fmt, ap);
+ if (n < 0) {
+ n = 0;
+ } else if (n >= (int) buflen) {
+ n = (int) buflen - 1;
+ }
+ buf[n] = '\0';
+ return n;
}
static int mg_snprintf(char *buf, size_t buflen, const char *fmt, ...) {
- va_list ap;
- int n;
- va_start(ap, fmt);
- n = mg_vsnprintf(buf, buflen, fmt, ap);
- va_end(ap);
- return n;
+ va_list ap;
+ int n;
+ va_start(ap, fmt);
+ n = mg_vsnprintf(buf, buflen, fmt, ap);
+ va_end(ap);
+ return n;
}
// Check whether full request is buffered. Return:
@@ -1533,383 +1533,382 @@ static int mg_snprintf(char *buf, size_t buflen, const char *fmt, ...) {
// 0 if request is not yet fully buffered
// >0 actual request length, including last \r\n\r\n
static int get_request_len(const char *s, int buf_len) {
- const unsigned char *buf = (unsigned char *) s;
- int i;
+ const unsigned char *buf = (unsigned char *) s;
+ int i;
- for (i = 0; i < buf_len; i++) {
- // Control characters are not allowed but >=128 are.
- // Abort scan as soon as one malformed character is found.
- if (!isprint(buf[i]) && buf[i] != '\r' && buf[i] != '\n' && buf[i] < 128) {
- return -1;
- } else if (buf[i] == '\n' && i + 1 < buf_len && buf[i + 1] == '\n') {
- return i + 2;
- } else if (buf[i] == '\n' && i + 2 < buf_len && buf[i + 1] == '\r' &&
- buf[i + 2] == '\n') {
- return i + 3;
- }
- }
+ for (i = 0; i < buf_len; i++) {
+ // Control characters are not allowed but >=128 are.
+ // Abort scan as soon as one malformed character is found.
+ if (!isprint(buf[i]) && buf[i] != '\r' && buf[i] != '\n' && buf[i] < 128) {
+ return -1;
+ } else if (buf[i] == '\n' && i + 1 < buf_len && buf[i + 1] == '\n') {
+ return i + 2;
+ } else if (buf[i] == '\n' && i + 2 < buf_len && buf[i + 1] == '\r' &&
+ buf[i + 2] == '\n') {
+ return i + 3;
+ }
+ }
- return 0;
+ return 0;
}
// Skip the characters until one of the delimiters characters found.
// 0-terminate resulting word. Skip the rest of the delimiters if any.
// Advance pointer to buffer to the next word. Return found 0-terminated word.
static char *skip(char **buf, const char *delimiters) {
- char *p, *begin_word, *end_word, *end_delimiters;
+ char *p, *begin_word, *end_word, *end_delimiters;
- begin_word = *buf;
- end_word = begin_word + strcspn(begin_word, delimiters);
- end_delimiters = end_word + strspn(end_word, delimiters);
+ begin_word = *buf;
+ end_word = begin_word + strcspn(begin_word, delimiters);
+ end_delimiters = end_word + strspn(end_word, delimiters);
- for (p = end_word; p < end_delimiters; p++) {
- *p = '\0';
- }
+ for (p = end_word; p < end_delimiters; p++) {
+ *p = '\0';
+ }
- *buf = end_delimiters;
+ *buf = end_delimiters;
- return begin_word;
+ return begin_word;
}
// Parse HTTP headers from the given buffer, advance buffer to the point
// where parsing stopped.
static void parse_http_headers(char **buf, struct mg_connection *ri) {
- size_t i;
+ size_t i;
- for (i = 0; i < ARRAY_SIZE(ri->http_headers); i++) {
- ri->http_headers[i].name = skip(buf, ": ");
- ri->http_headers[i].value = skip(buf, "\r\n");
- if (ri->http_headers[i].name[0] == '\0')
- break;
- ri->num_headers = i + 1;
- }
+ for (i = 0; i < ARRAY_SIZE(ri->http_headers); i++) {
+ ri->http_headers[i].name = skip(buf, ": ");
+ ri->http_headers[i].value = skip(buf, "\r\n");
+ if (ri->http_headers[i].name[0] == '\0')
+ break;
+ ri->num_headers = i + 1;
+ }
}
static const char *status_code_to_str(int status_code) {
- switch (status_code) {
-
- case 100: return "Continue";
- case 101: return "Switching Protocols";
- case 102: return "Processing";
-
- case 200: return "OK";
- case 201: return "Created";
- case 202: return "Accepted";
- case 203: return "Non-Authoritative Information";
- case 204: return "No Content";
- case 205: return "Reset Content";
- case 206: return "Partial Content";
- case 207: return "Multi-Status";
- case 208: return "Already Reported";
- case 226: return "IM Used";
-
- case 300: return "Multiple Choices";
- case 301: return "Moved Permanently";
- case 302: return "Found";
- case 303: return "See Other";
- case 304: return "Not Modified";
- case 305: return "Use Proxy";
- case 306: return "Switch Proxy";
- case 307: return "Temporary Redirect";
- case 308: return "Permanent Redirect";
-
- case 400: return "Bad Request";
- case 401: return "Unauthorized";
- case 402: return "Payment Required";
- case 403: return "Forbidden";
- case 404: return "Not Found";
- case 405: return "Method Not Allowed";
- case 406: return "Not Acceptable";
- case 407: return "Proxy Authentication Required";
- case 408: return "Request Timeout";
- case 409: return "Conflict";
- case 410: return "Gone";
- case 411: return "Length Required";
- case 412: return "Precondition Failed";
- case 413: return "Payload Too Large";
- case 414: return "URI Too Long";
- case 415: return "Unsupported Media Type";
- case 416: return "Requested Range Not Satisfiable";
- case 417: return "Expectation Failed";
- case 418: return "I\'m a teapot";
- case 422: return "Unprocessable Entity";
- case 423: return "Locked";
- case 424: return "Failed Dependency";
- case 426: return "Upgrade Required";
- case 428: return "Precondition Required";
- case 429: return "Too Many Requests";
- case 431: return "Request Header Fields Too Large";
- case 451: return "Unavailable For Legal Reasons";
-
- case 500: return "Internal Server Error";
- case 501: return "Not Implemented";
- case 502: return "Bad Gateway";
- case 503: return "Service Unavailable";
- case 504: return "Gateway Timeout";
- case 505: return "HTTP Version Not Supported";
- case 506: return "Variant Also Negotiates";
- case 507: return "Insufficient Storage";
- case 508: return "Loop Detected";
- case 510: return "Not Extended";
- case 511: return "Network Authentication Required";
-
- default: return "Server Error";
- }
+ switch (status_code) {
+ case 100: return "Continue";
+ case 101: return "Switching Protocols";
+ case 102: return "Processing";
+
+ case 200: return "OK";
+ case 201: return "Created";
+ case 202: return "Accepted";
+ case 203: return "Non-Authoritative Information";
+ case 204: return "No Content";
+ case 205: return "Reset Content";
+ case 206: return "Partial Content";
+ case 207: return "Multi-Status";
+ case 208: return "Already Reported";
+ case 226: return "IM Used";
+
+ case 300: return "Multiple Choices";
+ case 301: return "Moved Permanently";
+ case 302: return "Found";
+ case 303: return "See Other";
+ case 304: return "Not Modified";
+ case 305: return "Use Proxy";
+ case 306: return "Switch Proxy";
+ case 307: return "Temporary Redirect";
+ case 308: return "Permanent Redirect";
+
+ case 400: return "Bad Request";
+ case 401: return "Unauthorized";
+ case 402: return "Payment Required";
+ case 403: return "Forbidden";
+ case 404: return "Not Found";
+ case 405: return "Method Not Allowed";
+ case 406: return "Not Acceptable";
+ case 407: return "Proxy Authentication Required";
+ case 408: return "Request Timeout";
+ case 409: return "Conflict";
+ case 410: return "Gone";
+ case 411: return "Length Required";
+ case 412: return "Precondition Failed";
+ case 413: return "Payload Too Large";
+ case 414: return "URI Too Long";
+ case 415: return "Unsupported Media Type";
+ case 416: return "Requested Range Not Satisfiable";
+ case 417: return "Expectation Failed";
+ case 418: return "I\'m a teapot";
+ case 422: return "Unprocessable Entity";
+ case 423: return "Locked";
+ case 424: return "Failed Dependency";
+ case 426: return "Upgrade Required";
+ case 428: return "Precondition Required";
+ case 429: return "Too Many Requests";
+ case 431: return "Request Header Fields Too Large";
+ case 451: return "Unavailable For Legal Reasons";
+
+ case 500: return "Internal Server Error";
+ case 501: return "Not Implemented";
+ case 502: return "Bad Gateway";
+ case 503: return "Service Unavailable";
+ case 504: return "Gateway Timeout";
+ case 505: return "HTTP Version Not Supported";
+ case 506: return "Variant Also Negotiates";
+ case 507: return "Insufficient Storage";
+ case 508: return "Loop Detected";
+ case 510: return "Not Extended";
+ case 511: return "Network Authentication Required";
+
+ default: return "Server Error";
+ }
}
static int call_user(struct connection *conn, enum mg_event ev) {
- return conn != NULL && conn->server != NULL &&
- conn->server->event_handler != NULL ?
- conn->server->event_handler(&conn->mg_conn, ev) : MG_FALSE;
+ return conn != NULL && conn->server != NULL &&
+ conn->server->event_handler != NULL ?
+ conn->server->event_handler(&conn->mg_conn, ev) : MG_FALSE;
}
static void send_http_error(struct connection *conn, int code,
- const char *fmt, ...) {
- const char *message = status_code_to_str(code);
- const char *rewrites = conn->server->config_options[URL_REWRITES];
- char headers[200], body[200];
- struct vec a, b;
- va_list ap;
- int body_len, headers_len, match_code;
-
- conn->mg_conn.status_code = code;
-
- // Invoke error handler if it is set
- if (call_user(conn, MG_HTTP_ERROR) == MG_TRUE) {
- close_local_endpoint(conn);
- return;
- }
-
- // Handle error code rewrites
- while ((rewrites = next_option(rewrites, &a, &b)) != NULL) {
- if ((match_code = atoi(a.ptr)) > 0 && match_code == code) {
- struct mg_connection *c = &conn->mg_conn;
- c->status_code = 302;
- mg_printf(c, "HTTP/1.1 %d Moved\r\n"
- "Location: %.*s?code=%d&orig_uri=%s&query_string=%s\r\n\r\n",
- c->status_code, b.len, b.ptr, code, c->uri,
- c->query_string == NULL ? "" : c->query_string);
- close_local_endpoint(conn);
- return;
- }
- }
-
- body_len = mg_snprintf(body, sizeof(body), "%d %s\n", code, message);
- if (fmt != NULL) {
- va_start(ap, fmt);
- body_len += mg_vsnprintf(body + body_len, sizeof(body) - body_len, fmt, ap);
- va_end(ap);
- }
- if ((code >= 300 && code <= 399) || code == 204) {
- // 3xx errors do not have body
- body_len = 0;
- }
- headers_len = mg_snprintf(headers, sizeof(headers),
- "HTTP/1.1 %d %s\r\nContent-Length: %d\r\n"
- "Content-Type: text/plain\r\n\r\n",
- code, message, body_len);
- ns_send(conn->ns_conn, headers, headers_len);
- ns_send(conn->ns_conn, body, body_len);
- close_local_endpoint(conn); // This will write to the log file
+ const char *fmt, ...) {
+ const char *message = status_code_to_str(code);
+ const char *rewrites = conn->server->config_options[URL_REWRITES];
+ char headers[200], body[200];
+ struct vec a, b;
+ va_list ap;
+ int body_len, headers_len, match_code;
+
+ conn->mg_conn.status_code = code;
+
+ // Invoke error handler if it is set
+ if (call_user(conn, MG_HTTP_ERROR) == MG_TRUE) {
+ close_local_endpoint(conn);
+ return;
+ }
+
+ // Handle error code rewrites
+ while ((rewrites = next_option(rewrites, &a, &b)) != NULL) {
+ if ((match_code = atoi(a.ptr)) > 0 && match_code == code) {
+ struct mg_connection *c = &conn->mg_conn;
+ c->status_code = 302;
+ mg_printf(c, "HTTP/1.1 %d Moved\r\n"
+ "Location: %.*s?code=%d&orig_uri=%s&query_string=%s\r\n\r\n",
+ c->status_code, b.len, b.ptr, code, c->uri,
+ c->query_string == NULL ? "" : c->query_string);
+ close_local_endpoint(conn);
+ return;
+ }
+ }
+
+ body_len = mg_snprintf(body, sizeof(body), "%d %s\n", code, message);
+ if (fmt != NULL) {
+ va_start(ap, fmt);
+ body_len += mg_vsnprintf(body + body_len, sizeof(body) - body_len, fmt, ap);
+ va_end(ap);
+ }
+ if ((code >= 300 && code <= 399) || code == 204) {
+ // 3xx errors do not have body
+ body_len = 0;
+ }
+ headers_len = mg_snprintf(headers, sizeof(headers),
+ "HTTP/1.1 %d %s\r\nContent-Length: %d\r\n"
+ "Content-Type: text/plain\r\n\r\n",
+ code, message, body_len);
+ ns_send(conn->ns_conn, headers, headers_len);
+ ns_send(conn->ns_conn, body, body_len);
+ close_local_endpoint(conn); // This will write to the log file
}
static void write_chunk(struct connection *conn, const char *buf, int len) {
- char chunk_size[50];
- int n = mg_snprintf(chunk_size, sizeof(chunk_size), "%X\r\n", len);
- ns_send(conn->ns_conn, chunk_size, n);
- ns_send(conn->ns_conn, buf, len);
- ns_send(conn->ns_conn, "\r\n", 2);
+ char chunk_size[50];
+ int n = mg_snprintf(chunk_size, sizeof(chunk_size), "%X\r\n", len);
+ ns_send(conn->ns_conn, chunk_size, n);
+ ns_send(conn->ns_conn, buf, len);
+ ns_send(conn->ns_conn, "\r\n", 2);
}
size_t mg_printf(struct mg_connection *conn, const char *fmt, ...) {
- struct connection *c = MG_CONN_2_CONN(conn);
- va_list ap;
+ struct connection *c = MG_CONN_2_CONN(conn);
+ va_list ap;
- va_start(ap, fmt);
- ns_vprintf(c->ns_conn, fmt, ap);
- va_end(ap);
+ va_start(ap, fmt);
+ ns_vprintf(c->ns_conn, fmt, ap);
+ va_end(ap);
- return c->ns_conn->send_iobuf.len;
+ return c->ns_conn->send_iobuf.len;
}
static void ns_forward(struct ns_connection *from, struct ns_connection *to) {
- DBG(("%p -> %p %lu bytes", from, to, (unsigned long)from->recv_iobuf.len));
- ns_send(to, from->recv_iobuf.buf, from->recv_iobuf.len);
- iobuf_remove(&from->recv_iobuf, from->recv_iobuf.len);
+ DBG(("%p -> %p %lu bytes", from, to, (unsigned long)from->recv_iobuf.len));
+ ns_send(to, from->recv_iobuf.buf, from->recv_iobuf.len);
+ iobuf_remove(&from->recv_iobuf, from->recv_iobuf.len);
}
#ifndef MONGOOSE_NO_CGI
#ifdef _WIN32
struct threadparam {
- sock_t s;
- HANDLE hPipe;
+ sock_t s;
+ HANDLE hPipe;
};
static int wait_until_ready(sock_t sock, int for_read) {
- fd_set set;
- FD_ZERO(&set);
- FD_SET(sock, &set);
- select(sock + 1, for_read ? &set : 0, for_read ? 0 : &set, 0, 0);
- return 1;
+ fd_set set;
+ FD_ZERO(&set);
+ FD_SET(sock, &set);
+ select(sock + 1, for_read ? &set : 0, for_read ? 0 : &set, 0, 0);
+ return 1;
}
static void *push_to_stdin(void *arg) {
- struct threadparam *tp = (struct threadparam *)arg;
- int n, sent, stop = 0;
- DWORD k;
- char buf[IOBUF_SIZE];
-
- while (!stop && wait_until_ready(tp->s, 1) &&
- (n = recv(tp->s, buf, sizeof(buf), 0)) > 0) {
- if (n == -1 && GetLastError() == WSAEWOULDBLOCK) continue;
- for (sent = 0; !stop && sent < n; sent += k) {
- if (!WriteFile(tp->hPipe, buf + sent, n - sent, &k, 0)) stop = 1;
- }
- }
- DBG(("%s", "FORWARED EVERYTHING TO CGI"));
- CloseHandle(tp->hPipe);
- free(tp);
- _endthread();
- return NULL;
+ struct threadparam *tp = (struct threadparam *)arg;
+ int n, sent, stop = 0;
+ DWORD k;
+ char buf[IOBUF_SIZE];
+
+ while (!stop && wait_until_ready(tp->s, 1) &&
+ (n = recv(tp->s, buf, sizeof(buf), 0)) > 0) {
+ if (n == -1 && GetLastError() == WSAEWOULDBLOCK) continue;
+ for (sent = 0; !stop && sent < n; sent += k) {
+ if (!WriteFile(tp->hPipe, buf + sent, n - sent, &k, 0)) stop = 1;
+ }
+ }
+ DBG(("%s", "FORWARED EVERYTHING TO CGI"));
+ CloseHandle(tp->hPipe);
+ free(tp);
+ _endthread();
+ return NULL;
}
static void *pull_from_stdout(void *arg) {
- struct threadparam *tp = (struct threadparam *)arg;
- int k = 0, stop = 0;
- DWORD n, sent;
- char buf[IOBUF_SIZE];
-
- while (!stop && ReadFile(tp->hPipe, buf, sizeof(buf), &n, NULL)) {
- for (sent = 0; !stop && sent < n; sent += k) {
- if (wait_until_ready(tp->s, 0) &&
- (k = send(tp->s, buf + sent, n - sent, 0)) <= 0) stop = 1;
- }
- }
- DBG(("%s", "EOF FROM CGI"));
- CloseHandle(tp->hPipe);
- shutdown(tp->s, 2); // Without this, IO thread may get truncated data
- closesocket(tp->s);
- free(tp);
- _endthread();
- return NULL;
+ struct threadparam *tp = (struct threadparam *)arg;
+ int k = 0, stop = 0;
+ DWORD n, sent;
+ char buf[IOBUF_SIZE];
+
+ while (!stop && ReadFile(tp->hPipe, buf, sizeof(buf), &n, NULL)) {
+ for (sent = 0; !stop && sent < n; sent += k) {
+ if (wait_until_ready(tp->s, 0) &&
+ (k = send(tp->s, buf + sent, n - sent, 0)) <= 0) stop = 1;
+ }
+ }
+ DBG(("%s", "EOF FROM CGI"));
+ CloseHandle(tp->hPipe);
+ shutdown(tp->s, 2); // Without this, IO thread may get truncated data
+ closesocket(tp->s);
+ free(tp);
+ _endthread();
+ return NULL;
}
static void spawn_stdio_thread(sock_t sock, HANDLE hPipe,
- void *(*func)(void *)) {
- struct threadparam *tp = (struct threadparam *)malloc(sizeof(*tp));
- if (tp != NULL) {
- tp->s = sock;
- tp->hPipe = hPipe;
- mg_start_thread(func, tp);
- }
+ void *(*func)(void *)) {
+ struct threadparam *tp = (struct threadparam *)malloc(sizeof(*tp));
+ if (tp != NULL) {
+ tp->s = sock;
+ tp->hPipe = hPipe;
+ mg_start_thread(func, tp);
+ }
}
static void abs_path(const char *utf8_path, char *abs_path, size_t len) {
- wchar_t buf[MAX_PATH_SIZE], buf2[MAX_PATH_SIZE];
- to_wchar(utf8_path, buf, ARRAY_SIZE(buf));
- GetFullPathNameW(buf, ARRAY_SIZE(buf2), buf2, NULL);
- WideCharToMultiByte(CP_UTF8, 0, buf2, wcslen(buf2) + 1, abs_path, len, 0, 0);
+ wchar_t buf[MAX_PATH_SIZE], buf2[MAX_PATH_SIZE];
+ to_wchar(utf8_path, buf, ARRAY_SIZE(buf));
+ GetFullPathNameW(buf, ARRAY_SIZE(buf2), buf2, NULL);
+ WideCharToMultiByte(CP_UTF8, 0, buf2, wcslen(buf2) + 1, abs_path, len, 0, 0);
}
static process_id_t start_process(char *interp, const char *cmd,
- const char *env, const char *envp[],
- const char *dir, sock_t sock) {
- STARTUPINFOW si;
- PROCESS_INFORMATION pi;
- HANDLE a[2], b[2], me = GetCurrentProcess();
- wchar_t wcmd[MAX_PATH_SIZE], full_dir[MAX_PATH_SIZE];
- char buf[MAX_PATH_SIZE], buf4[MAX_PATH_SIZE], buf5[MAX_PATH_SIZE],
- cmdline[MAX_PATH_SIZE], *p;
- DWORD flags = DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS;
- FILE *fp;
-
- memset(&si, 0, sizeof(si));
- memset(&pi, 0, sizeof(pi));
-
- si.cb = sizeof(si);
- si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_HIDE;
- si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
-
- CreatePipe(&a[0], &a[1], NULL, 0);
- CreatePipe(&b[0], &b[1], NULL, 0);
- DuplicateHandle(me, a[0], me, &si.hStdInput, 0, TRUE, flags);
- DuplicateHandle(me, b[1], me, &si.hStdOutput, 0, TRUE, flags);
-
- if (interp == NULL && (fp = fopen(cmd, "r")) != NULL) {
- buf[0] = buf[1] = '\0';
- fgets(buf, sizeof(buf), fp);
- buf[sizeof(buf) - 1] = '\0';
- if (buf[0] == '#' && buf[1] == '!') {
- interp = buf + 2;
- for (p = interp + strlen(interp);
- isspace(* (uint8_t *) p) && p > interp; p--) *p = '\0';
- }
- fclose(fp);
- }
-
- if (interp != NULL) {
- abs_path(interp, buf4, ARRAY_SIZE(buf4));
- interp = buf4;
- }
- abs_path(dir, buf5, ARRAY_SIZE(buf5));
- to_wchar(dir, full_dir, ARRAY_SIZE(full_dir));
- mg_snprintf(cmdline, sizeof(cmdline), "%s%s\"%s\"",
- interp ? interp : "", interp ? " " : "", cmd);
- to_wchar(cmdline, wcmd, ARRAY_SIZE(wcmd));
-
- if (CreateProcessW(NULL, wcmd, NULL, NULL, TRUE, CREATE_NEW_PROCESS_GROUP,
- (void *) env, full_dir, &si, &pi) != 0) {
- spawn_stdio_thread(sock, a[1], push_to_stdin);
- spawn_stdio_thread(sock, b[0], pull_from_stdout);
- } else {
- CloseHandle(a[1]);
- CloseHandle(b[0]);
- closesocket(sock);
- }
- DBG(("CGI command: [%ls] -> %p", wcmd, pi.hProcess));
-
- // Not closing a[0] and b[1] because we've used DUPLICATE_CLOSE_SOURCE
- CloseHandle(si.hStdOutput);
- CloseHandle(si.hStdInput);
- //CloseHandle(pi.hThread);
- //CloseHandle(pi.hProcess);
-
- return pi.hProcess;
+ const char *env, const char *envp[],
+ const char *dir, sock_t sock) {
+ STARTUPINFOW si;
+ PROCESS_INFORMATION pi;
+ HANDLE a[2], b[2], me = GetCurrentProcess();
+ wchar_t wcmd[MAX_PATH_SIZE], full_dir[MAX_PATH_SIZE];
+ char buf[MAX_PATH_SIZE], buf4[MAX_PATH_SIZE], buf5[MAX_PATH_SIZE],
+ cmdline[MAX_PATH_SIZE], *p;
+ DWORD flags = DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS;
+ FILE *fp;
+
+ memset(&si, 0, sizeof(si));
+ memset(&pi, 0, sizeof(pi));
+
+ si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+ si.wShowWindow = SW_HIDE;
+ si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
+
+ CreatePipe(&a[0], &a[1], NULL, 0);
+ CreatePipe(&b[0], &b[1], NULL, 0);
+ DuplicateHandle(me, a[0], me, &si.hStdInput, 0, TRUE, flags);
+ DuplicateHandle(me, b[1], me, &si.hStdOutput, 0, TRUE, flags);
+
+ if (interp == NULL && (fp = fopen(cmd, "r")) != NULL) {
+ buf[0] = buf[1] = '\0';
+ fgets(buf, sizeof(buf), fp);
+ buf[sizeof(buf) - 1] = '\0';
+ if (buf[0] == '#' && buf[1] == '!') {
+ interp = buf + 2;
+ for (p = interp + strlen(interp);
+ isspace(* (uint8_t *) p) && p > interp; p--) *p = '\0';
+ }
+ fclose(fp);
+ }
+
+ if (interp != NULL) {
+ abs_path(interp, buf4, ARRAY_SIZE(buf4));
+ interp = buf4;
+ }
+ abs_path(dir, buf5, ARRAY_SIZE(buf5));
+ to_wchar(dir, full_dir, ARRAY_SIZE(full_dir));
+ mg_snprintf(cmdline, sizeof(cmdline), "%s%s\"%s\"",
+ interp ? interp : "", interp ? " " : "", cmd);
+ to_wchar(cmdline, wcmd, ARRAY_SIZE(wcmd));
+
+ if (CreateProcessW(NULL, wcmd, NULL, NULL, TRUE, CREATE_NEW_PROCESS_GROUP,
+ (void *) env, full_dir, &si, &pi) != 0) {
+ spawn_stdio_thread(sock, a[1], push_to_stdin);
+ spawn_stdio_thread(sock, b[0], pull_from_stdout);
+ } else {
+ CloseHandle(a[1]);
+ CloseHandle(b[0]);
+ closesocket(sock);
+ }
+ DBG(("CGI command: [%ls] -> %p", wcmd, pi.hProcess));
+
+ // Not closing a[0] and b[1] because we've used DUPLICATE_CLOSE_SOURCE
+ CloseHandle(si.hStdOutput);
+ CloseHandle(si.hStdInput);
+ //CloseHandle(pi.hThread);
+ //CloseHandle(pi.hProcess);
+
+ return pi.hProcess;
}
#else
static process_id_t start_process(const char *interp, const char *cmd,
- const char *env, const char *envp[],
- const char *dir, sock_t sock) {
- char buf[500];
- process_id_t pid = fork();
- (void) env;
-
- if (pid == 0) {
- (void) chdir(dir);
- (void) dup2(sock, 0);
- (void) dup2(sock, 1);
- closesocket(sock);
-
- // After exec, all signal handlers are restored to their default values,
- // with one exception of SIGCHLD. According to POSIX.1-2001 and Linux's
- // implementation, SIGCHLD's handler will leave unchanged after exec
- // if it was set to be ignored. Restore it to default action.
- signal(SIGCHLD, SIG_DFL);
-
- if (interp == NULL) {
- execle(cmd, cmd, (char *) 0, envp); // Using (char *) 0 to avoid warning
- } else {
- execle(interp, interp, cmd, (char *) 0, envp);
- }
- snprintf(buf, sizeof(buf), "Status: 500\r\n\r\n"
- "500 Server Error: %s%s%s: %s", interp == NULL ? "" : interp,
- interp == NULL ? "" : " ", cmd, strerror(errno));
- send(1, buf, strlen(buf), 0);
- exit(EXIT_FAILURE); // exec call failed
- }
-
- return pid;
+ const char *env, const char *envp[],
+ const char *dir, sock_t sock) {
+ char buf[500];
+ process_id_t pid = fork();
+ (void) env;
+
+ if (pid == 0) {
+ (void) chdir(dir);
+ (void) dup2(sock, 0);
+ (void) dup2(sock, 1);
+ closesocket(sock);
+
+ // After exec, all signal handlers are restored to their default values,
+ // with one exception of SIGCHLD. According to POSIX.1-2001 and Linux's
+ // implementation, SIGCHLD's handler will leave unchanged after exec
+ // if it was set to be ignored. Restore it to default action.
+ signal(SIGCHLD, SIG_DFL);
+
+ if (interp == NULL) {
+ execle(cmd, cmd, (char *) 0, envp); // Using (char *) 0 to avoid warning
+ } else {
+ execle(interp, interp, cmd, (char *) 0, envp);
+ }
+ snprintf(buf, sizeof(buf), "Status: 500\r\n\r\n"
+ "500 Server Error: %s%s%s: %s", interp == NULL ? "" : interp,
+ interp == NULL ? "" : " ", cmd, strerror(errno));
+ send(1, buf, strlen(buf), 0);
+ exit(EXIT_FAILURE); // exec call failed
+ }
+
+ return pid;
}
#endif // _WIN32
@@ -1922,337 +1921,337 @@ static process_id_t start_process(const char *interp, const char *cmd,
// We satisfy both worlds: we create an envp array (which is vars), all
// entries are actually pointers inside buf.
struct cgi_env_block {
- struct mg_connection *conn;
- char buf[CGI_ENVIRONMENT_SIZE]; // Environment buffer
- const char *vars[MAX_CGI_ENVIR_VARS]; // char *envp[]
- int len; // Space taken
- int nvars; // Number of variables in envp[]
+ struct mg_connection *conn;
+ char buf[CGI_ENVIRONMENT_SIZE]; // Environment buffer
+ const char *vars[MAX_CGI_ENVIR_VARS]; // char *envp[]
+ int len; // Space taken
+ int nvars; // Number of variables in envp[]
};
// Append VARIABLE=VALUE\0 string to the buffer, and add a respective
// pointer into the vars array.
static char *addenv(struct cgi_env_block *block, const char *fmt, ...) {
- int n, space;
- char *added;
- va_list ap;
+ int n, space;
+ char *added;
+ va_list ap;
- // Calculate how much space is left in the buffer
- space = sizeof(block->buf) - block->len - 2;
- assert(space >= 0);
+ // Calculate how much space is left in the buffer
+ space = sizeof(block->buf) - block->len - 2;
+ assert(space >= 0);
- // Make a pointer to the free space int the buffer
- added = block->buf + block->len;
+ // Make a pointer to the free space int the buffer
+ added = block->buf + block->len;
- // Copy VARIABLE=VALUE\0 string into the free space
- va_start(ap, fmt);
- n = mg_vsnprintf(added, (size_t) space, fmt, ap);
- va_end(ap);
+ // Copy VARIABLE=VALUE\0 string into the free space
+ va_start(ap, fmt);
+ n = mg_vsnprintf(added, (size_t) space, fmt, ap);
+ va_end(ap);
- // Make sure we do not overflow buffer and the envp array
- if (n > 0 && n + 1 < space &&
- block->nvars < (int) ARRAY_SIZE(block->vars) - 2) {
- // Append a pointer to the added string into the envp array
- block->vars[block->nvars++] = added;
- // Bump up used length counter. Include \0 terminator
- block->len += n + 1;
- }
+ // Make sure we do not overflow buffer and the envp array
+ if (n > 0 && n + 1 < space &&
+ block->nvars < (int) ARRAY_SIZE(block->vars) - 2) {
+ // Append a pointer to the added string into the envp array
+ block->vars[block->nvars++] = added;
+ // Bump up used length counter. Include \0 terminator
+ block->len += n + 1;
+ }
- return added;
+ return added;
}
static void addenv2(struct cgi_env_block *blk, const char *name) {
- const char *s;
- if ((s = getenv(name)) != NULL) addenv(blk, "%s=%s", name, s);
+ const char *s;
+ if ((s = getenv(name)) != NULL) addenv(blk, "%s=%s", name, s);
}
static void prepare_cgi_environment(struct connection *conn,
- const char *prog,
- struct cgi_env_block *blk) {
- struct mg_connection *ri = &conn->mg_conn;
- const char *s, *slash;
- char *p, **opts = conn->server->config_options;
- int i;
-
- blk->len = blk->nvars = 0;
- blk->conn = ri;
-
- if ((s = getenv("SERVER_NAME")) != NULL) {
- addenv(blk, "SERVER_NAME=%s", s);
- } else {
- addenv(blk, "SERVER_NAME=%s", ri->local_ip);
- }
- addenv(blk, "SERVER_ROOT=%s", opts[DOCUMENT_ROOT]);
- addenv(blk, "DOCUMENT_ROOT=%s", opts[DOCUMENT_ROOT]);
- addenv(blk, "SERVER_SOFTWARE=%s/%s", "Mongoose", MONGOOSE_VERSION);
-
- // Prepare the environment block
- addenv(blk, "%s", "GATEWAY_INTERFACE=CGI/1.1");
- addenv(blk, "%s", "SERVER_PROTOCOL=HTTP/1.1");
- addenv(blk, "%s", "REDIRECT_STATUS=200"); // For PHP
-
- // TODO(lsm): fix this for IPv6 case
- //addenv(blk, "SERVER_PORT=%d", ri->remote_port);
-
- addenv(blk, "REQUEST_METHOD=%s", ri->request_method);
- addenv(blk, "REMOTE_ADDR=%s", ri->remote_ip);
- addenv(blk, "REMOTE_PORT=%d", ri->remote_port);
- addenv(blk, "REQUEST_URI=%s%s%s", ri->uri,
- ri->query_string == NULL ? "" : "?",
- ri->query_string == NULL ? "" : ri->query_string);
-
- // SCRIPT_NAME
- if (conn->path_info != NULL) {
- addenv(blk, "SCRIPT_NAME=%.*s",
- (int) (strlen(ri->uri) - strlen(conn->path_info)), ri->uri);
- addenv(blk, "PATH_INFO=%s", conn->path_info);
- } else {
- s = strrchr(prog, '/');
- slash = strrchr(ri->uri, '/');
- addenv(blk, "SCRIPT_NAME=%.*s%s",
- slash == NULL ? 0 : (int) (slash - ri->uri), ri->uri,
- s == NULL ? prog : s);
- }
-
- addenv(blk, "SCRIPT_FILENAME=%s", prog);
- addenv(blk, "PATH_TRANSLATED=%s", prog);
- addenv(blk, "HTTPS=%s", conn->ns_conn->ssl != NULL ? "on" : "off");
-
- if ((s = mg_get_header(ri, "Content-Type")) != NULL)
- addenv(blk, "CONTENT_TYPE=%s", s);
-
- if (ri->query_string != NULL)
- addenv(blk, "QUERY_STRING=%s", ri->query_string);
-
- if ((s = mg_get_header(ri, "Content-Length")) != NULL)
- addenv(blk, "CONTENT_LENGTH=%s", s);
-
- addenv2(blk, "PATH");
- addenv2(blk, "TMP");
- addenv2(blk, "TEMP");
- addenv2(blk, "TMPDIR");
- addenv2(blk, "PERLLIB");
- addenv2(blk, ENV_EXPORT_TO_CGI);
+ const char *prog,
+ struct cgi_env_block *blk) {
+ struct mg_connection *ri = &conn->mg_conn;
+ const char *s, *slash;
+ char *p, **opts = conn->server->config_options;
+ int i;
+
+ blk->len = blk->nvars = 0;
+ blk->conn = ri;
+
+ if ((s = getenv("SERVER_NAME")) != NULL) {
+ addenv(blk, "SERVER_NAME=%s", s);
+ } else {
+ addenv(blk, "SERVER_NAME=%s", ri->local_ip);
+ }
+ addenv(blk, "SERVER_ROOT=%s", opts[DOCUMENT_ROOT]);
+ addenv(blk, "DOCUMENT_ROOT=%s", opts[DOCUMENT_ROOT]);
+ addenv(blk, "SERVER_SOFTWARE=%s/%s", "Mongoose", MONGOOSE_VERSION);
+
+ // Prepare the environment block
+ addenv(blk, "%s", "GATEWAY_INTERFACE=CGI/1.1");
+ addenv(blk, "%s", "SERVER_PROTOCOL=HTTP/1.1");
+ addenv(blk, "%s", "REDIRECT_STATUS=200"); // For PHP
+
+ // TODO(lsm): fix this for IPv6 case
+ //addenv(blk, "SERVER_PORT=%d", ri->remote_port);
+
+ addenv(blk, "REQUEST_METHOD=%s", ri->request_method);
+ addenv(blk, "REMOTE_ADDR=%s", ri->remote_ip);
+ addenv(blk, "REMOTE_PORT=%d", ri->remote_port);
+ addenv(blk, "REQUEST_URI=%s%s%s", ri->uri,
+ ri->query_string == NULL ? "" : "?",
+ ri->query_string == NULL ? "" : ri->query_string);
+
+ // SCRIPT_NAME
+ if (conn->path_info != NULL) {
+ addenv(blk, "SCRIPT_NAME=%.*s",
+ (int) (strlen(ri->uri) - strlen(conn->path_info)), ri->uri);
+ addenv(blk, "PATH_INFO=%s", conn->path_info);
+ } else {
+ s = strrchr(prog, '/');
+ slash = strrchr(ri->uri, '/');
+ addenv(blk, "SCRIPT_NAME=%.*s%s",
+ slash == NULL ? 0 : (int) (slash - ri->uri), ri->uri,
+ s == NULL ? prog : s);
+ }
+
+ addenv(blk, "SCRIPT_FILENAME=%s", prog);
+ addenv(blk, "PATH_TRANSLATED=%s", prog);
+ addenv(blk, "HTTPS=%s", conn->ns_conn->ssl != NULL ? "on" : "off");
+
+ if ((s = mg_get_header(ri, "Content-Type")) != NULL)
+ addenv(blk, "CONTENT_TYPE=%s", s);
+
+ if (ri->query_string != NULL)
+ addenv(blk, "QUERY_STRING=%s", ri->query_string);
+
+ if ((s = mg_get_header(ri, "Content-Length")) != NULL)
+ addenv(blk, "CONTENT_LENGTH=%s", s);
+
+ addenv2(blk, "PATH");
+ addenv2(blk, "TMP");
+ addenv2(blk, "TEMP");
+ addenv2(blk, "TMPDIR");
+ addenv2(blk, "PERLLIB");
+ addenv2(blk, ENV_EXPORT_TO_CGI);
#if defined(_WIN32)
- addenv2(blk, "COMSPEC");
- addenv2(blk, "SYSTEMROOT");
- addenv2(blk, "SystemDrive");
- addenv2(blk, "ProgramFiles");
- addenv2(blk, "ProgramFiles(x86)");
- addenv2(blk, "CommonProgramFiles(x86)");
+ addenv2(blk, "COMSPEC");
+ addenv2(blk, "SYSTEMROOT");
+ addenv2(blk, "SystemDrive");
+ addenv2(blk, "ProgramFiles");
+ addenv2(blk, "ProgramFiles(x86)");
+ addenv2(blk, "CommonProgramFiles(x86)");
#else
- addenv2(blk, "LD_LIBRARY_PATH");
+ addenv2(blk, "LD_LIBRARY_PATH");
#endif // _WIN32
- // Add all headers as HTTP_* variables
- for (i = 0; i < ri->num_headers; i++) {
- p = addenv(blk, "HTTP_%s=%s",
- ri->http_headers[i].name, ri->http_headers[i].value);
+ // Add all headers as HTTP_* variables
+ for (i = 0; i < ri->num_headers; i++) {
+ p = addenv(blk, "HTTP_%s=%s",
+ ri->http_headers[i].name, ri->http_headers[i].value);
- // Convert variable name into uppercase, and change - to _
- for (; *p != '=' && *p != '\0'; p++) {
- if (*p == '-')
- *p = '_';
- *p = (char) toupper(* (unsigned char *) p);
- }
- }
+ // Convert variable name into uppercase, and change - to _
+ for (; *p != '=' && *p != '\0'; p++) {
+ if (*p == '-')
+ *p = '_';
+ *p = (char) toupper(* (unsigned char *) p);
+ }
+ }
- blk->vars[blk->nvars++] = NULL;
- blk->buf[blk->len++] = '\0';
+ blk->vars[blk->nvars++] = NULL;
+ blk->buf[blk->len++] = '\0';
- assert(blk->nvars < (int) ARRAY_SIZE(blk->vars));
- assert(blk->len > 0);
- assert(blk->len < (int) sizeof(blk->buf));
+ assert(blk->nvars < (int) ARRAY_SIZE(blk->vars));
+ assert(blk->len > 0);
+ assert(blk->len < (int) sizeof(blk->buf));
}
static const char cgi_status[] = "HTTP/1.1 200 OK\r\n";
static void open_cgi_endpoint(struct connection *conn, const char *prog) {
- struct cgi_env_block blk;
- char dir[MAX_PATH_SIZE];
- const char *p;
- sock_t fds[2];
-
- prepare_cgi_environment(conn, prog, &blk);
- // CGI must be executed in its own directory. 'dir' must point to the
- // directory containing executable program, 'p' must point to the
- // executable program name relative to 'dir'.
- if ((p = strrchr(prog, '/')) == NULL) {
- mg_snprintf(dir, sizeof(dir), "%s", ".");
- } else {
- mg_snprintf(dir, sizeof(dir), "%.*s", (int) (p - prog), prog);
- }
-
- // Try to create socketpair in a loop until success. ns_socketpair()
- // can be interrupted by a signal and fail.
- // TODO(lsm): use sigaction to restart interrupted syscall
- do {
- ns_socketpair(fds);
- } while (fds[0] == INVALID_SOCKET);
-
- if (start_process(conn->server->config_options[CGI_INTERPRETER],
- prog, blk.buf, blk.vars, dir, fds[1]) != 0) {
- conn->endpoint_type = EP_CGI;
- conn->endpoint.nc = ns_add_sock(&conn->server->ns_server, fds[0], conn);
- conn->endpoint.nc->flags |= MG_CGI_CONN;
- ns_send(conn->ns_conn, cgi_status, sizeof(cgi_status) - 1);
- conn->mg_conn.status_code = 200;
- conn->ns_conn->flags |= NSF_BUFFER_BUT_DONT_SEND;
- // Pass POST data to the CGI process
- conn->endpoint.nc->send_iobuf = conn->ns_conn->recv_iobuf;
- iobuf_init(&conn->ns_conn->recv_iobuf, 0);
- } else {
- closesocket(fds[0]);
- send_http_error(conn, 500, "start_process(%s) failed", prog);
- }
+ struct cgi_env_block blk;
+ char dir[MAX_PATH_SIZE];
+ const char *p;
+ sock_t fds[2];
+
+ prepare_cgi_environment(conn, prog, &blk);
+ // CGI must be executed in its own directory. 'dir' must point to the
+ // directory containing executable program, 'p' must point to the
+ // executable program name relative to 'dir'.
+ if ((p = strrchr(prog, '/')) == NULL) {
+ mg_snprintf(dir, sizeof(dir), "%s", ".");
+ } else {
+ mg_snprintf(dir, sizeof(dir), "%.*s", (int) (p - prog), prog);
+ }
+
+ // Try to create socketpair in a loop until success. ns_socketpair()
+ // can be interrupted by a signal and fail.
+ // TODO(lsm): use sigaction to restart interrupted syscall
+ do {
+ ns_socketpair(fds);
+ } while (fds[0] == INVALID_SOCKET);
+
+ if (start_process(conn->server->config_options[CGI_INTERPRETER],
+ prog, blk.buf, blk.vars, dir, fds[1]) != 0) {
+ conn->endpoint_type = EP_CGI;
+ conn->endpoint.nc = ns_add_sock(&conn->server->ns_server, fds[0], conn);
+ conn->endpoint.nc->flags |= MG_CGI_CONN;
+ ns_send(conn->ns_conn, cgi_status, sizeof(cgi_status) - 1);
+ conn->mg_conn.status_code = 200;
+ conn->ns_conn->flags |= NSF_BUFFER_BUT_DONT_SEND;
+ // Pass POST data to the CGI process
+ conn->endpoint.nc->send_iobuf = conn->ns_conn->recv_iobuf;
+ iobuf_init(&conn->ns_conn->recv_iobuf, 0);
+ } else {
+ closesocket(fds[0]);
+ send_http_error(conn, 500, "start_process(%s) failed", prog);
+ }
#ifndef _WIN32
- closesocket(fds[1]); // On Windows, CGI stdio thread closes that socket
+ closesocket(fds[1]); // On Windows, CGI stdio thread closes that socket
#endif
}
static void on_cgi_data(struct ns_connection *nc) {
- struct connection *conn = (struct connection *) nc->connection_data;
- const char *status = "500";
- struct mg_connection c;
-
- if (!conn) return;
-
- // Copy CGI data from CGI socket to the client send buffer
- ns_forward(nc, conn->ns_conn);
-
- // If reply has not been parsed yet, parse it
- if (conn->ns_conn->flags & NSF_BUFFER_BUT_DONT_SEND) {
- struct iobuf *io = &conn->ns_conn->send_iobuf;
- int s_len = sizeof(cgi_status) - 1;
- int len = get_request_len(io->buf + s_len, io->len - s_len);
- char buf[MAX_REQUEST_SIZE], *s = buf;
-
- if (len == 0) return;
-
- if (len < 0 || len > (int) sizeof(buf)) {
- len = io->len;
- iobuf_remove(io, io->len);
- send_http_error(conn, 500, "CGI program sent malformed headers: [%.*s]",
- len, io->buf);
- } else {
- memset(&c, 0, sizeof(c));
- memcpy(buf, io->buf + s_len, len);
- buf[len - 1] = '\0';
- parse_http_headers(&s, &c);
- if (mg_get_header(&c, "Location") != NULL) {
- status = "302";
- } else if ((status = (char *) mg_get_header(&c, "Status")) == NULL) {
- status = "200";
- }
- memcpy(io->buf + 9, status, 3);
- conn->mg_conn.status_code = atoi(status);
- }
- conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND;
- }
+ struct connection *conn = (struct connection *) nc->connection_data;
+ const char *status = "500";
+ struct mg_connection c;
+
+ if (!conn) return;
+
+ // Copy CGI data from CGI socket to the client send buffer
+ ns_forward(nc, conn->ns_conn);
+
+ // If reply has not been parsed yet, parse it
+ if (conn->ns_conn->flags & NSF_BUFFER_BUT_DONT_SEND) {
+ struct iobuf *io = &conn->ns_conn->send_iobuf;
+ int s_len = sizeof(cgi_status) - 1;
+ int len = get_request_len(io->buf + s_len, io->len - s_len);
+ char buf[MAX_REQUEST_SIZE], *s = buf;
+
+ if (len == 0) return;
+
+ if (len < 0 || len > (int) sizeof(buf)) {
+ len = io->len;
+ iobuf_remove(io, io->len);
+ send_http_error(conn, 500, "CGI program sent malformed headers: [%.*s]",
+ len, io->buf);
+ } else {
+ memset(&c, 0, sizeof(c));
+ memcpy(buf, io->buf + s_len, len);
+ buf[len - 1] = '\0';
+ parse_http_headers(&s, &c);
+ if (mg_get_header(&c, "Location") != NULL) {
+ status = "302";
+ } else if ((status = (char *) mg_get_header(&c, "Status")) == NULL) {
+ status = "200";
+ }
+ memcpy(io->buf + 9, status, 3);
+ conn->mg_conn.status_code = atoi(status);
+ }
+ conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND;
+ }
}
#endif // !MONGOOSE_NO_CGI
static char *mg_strdup(const char *str) {
- char *copy = (char *) malloc(strlen(str) + 1);
- if (copy != NULL) {
- strcpy(copy, str);
- }
- return copy;
+ char *copy = (char *) malloc(strlen(str) + 1);
+ if (copy != NULL) {
+ strcpy(copy, str);
+ }
+ return copy;
}
static int isbyte(int n) {
- return n >= 0 && n <= 255;
+ return n >= 0 && n <= 255;
}
static int parse_net(const char *spec, uint32_t *net, uint32_t *mask) {
- int n, a, b, c, d, slash = 32, len = 0;
+ int n, a, b, c, d, slash = 32, len = 0;
- if ((sscanf(spec, "%d.%d.%d.%d/%d%n", &a, &b, &c, &d, &slash, &n) == 5 ||
- sscanf(spec, "%d.%d.%d.%d%n", &a, &b, &c, &d, &n) == 4) &&
- isbyte(a) && isbyte(b) && isbyte(c) && isbyte(d) &&
- slash >= 0 && slash < 33) {
- len = n;
- *net = ((uint32_t)a << 24) | ((uint32_t)b << 16) | ((uint32_t)c << 8) | d;
- *mask = slash ? 0xffffffffU << (32 - slash) : 0;
- }
+ if ((sscanf(spec, "%d.%d.%d.%d/%d%n", &a, &b, &c, &d, &slash, &n) == 5 ||
+ sscanf(spec, "%d.%d.%d.%d%n", &a, &b, &c, &d, &n) == 4) &&
+ isbyte(a) && isbyte(b) && isbyte(c) && isbyte(d) &&
+ slash >= 0 && slash < 33) {
+ len = n;
+ *net = ((uint32_t)a << 24) | ((uint32_t)b << 16) | ((uint32_t)c << 8) | d;
+ *mask = slash ? 0xffffffffU << (32 - slash) : 0;
+ }
- return len;
+ return len;
}
// Verify given socket address against the ACL.
// Return -1 if ACL is malformed, 0 if address is disallowed, 1 if allowed.
static int check_acl(const char *acl, uint32_t remote_ip) {
- int allowed, flag;
- uint32_t net, mask;
- struct vec vec;
+ int allowed, flag;
+ uint32_t net, mask;
+ struct vec vec;
- // If any ACL is set, deny by default
- allowed = acl == NULL ? '+' : '-';
+ // If any ACL is set, deny by default
+ allowed = acl == NULL ? '+' : '-';
- while ((acl = next_option(acl, &vec, NULL)) != NULL) {
- flag = vec.ptr[0];
- if ((flag != '+' && flag != '-') ||
- parse_net(&vec.ptr[1], &net, &mask) == 0) {
- return -1;
- }
+ while ((acl = next_option(acl, &vec, NULL)) != NULL) {
+ flag = vec.ptr[0];
+ if ((flag != '+' && flag != '-') ||
+ parse_net(&vec.ptr[1], &net, &mask) == 0) {
+ return -1;
+ }
- if (net == (remote_ip & mask)) {
- allowed = flag;
- }
- }
+ if (net == (remote_ip & mask)) {
+ allowed = flag;
+ }
+ }
- return allowed == '+';
+ return allowed == '+';
}
// Protect against directory disclosure attack by removing '..',
// excessive '/' and '\' characters
static void remove_double_dots_and_double_slashes(char *s) {
- char *p = s;
-
- while (*s != '\0') {
- *p++ = *s++;
- if (s[-1] == '/' || s[-1] == '\\') {
- // Skip all following slashes, backslashes and double-dots
- while (s[0] != '\0') {
- if (s[0] == '/' || s[0] == '\\') { s++; }
- else if (s[0] == '.' && s[1] == '.') { s += 2; }
- else { break; }
- }
- }
- }
- *p = '\0';
+ char *p = s;
+
+ while (*s != '\0') {
+ *p++ = *s++;
+ if (s[-1] == '/' || s[-1] == '\\') {
+ // Skip all following slashes, backslashes and double-dots
+ while (s[0] != '\0') {
+ if (s[0] == '/' || s[0] == '\\') { s++; }
+ else if (s[0] == '.' && s[1] == '.') { s += 2; }
+ else { break; }
+ }
+ }
+ }
+ *p = '\0';
}
int mg_url_decode(const char *src, int src_len, char *dst,
- int dst_len, int is_form_url_encoded) {
- int i, j, a, b;
+ int dst_len, int is_form_url_encoded) {
+ int i, j, a, b;
#define HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W')
- for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) {
- if (src[i] == '%' && i < src_len - 2 &&
- isxdigit(* (const unsigned char *) (src + i + 1)) &&
- isxdigit(* (const unsigned char *) (src + i + 2))) {
- a = tolower(* (const unsigned char *) (src + i + 1));
- b = tolower(* (const unsigned char *) (src + i + 2));
- dst[j] = (char) ((HEXTOI(a) << 4) | HEXTOI(b));
- i += 2;
- } else if (is_form_url_encoded && src[i] == '+') {
- dst[j] = ' ';
- } else {
- dst[j] = src[i];
- }
- }
+ for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) {
+ if (src[i] == '%' && i < src_len - 2 &&
+ isxdigit(* (const unsigned char *) (src + i + 1)) &&
+ isxdigit(* (const unsigned char *) (src + i + 2))) {
+ a = tolower(* (const unsigned char *) (src + i + 1));
+ b = tolower(* (const unsigned char *) (src + i + 2));
+ dst[j] = (char) ((HEXTOI(a) << 4) | HEXTOI(b));
+ i += 2;
+ } else if (is_form_url_encoded && src[i] == '+') {
+ dst[j] = ' ';
+ } else {
+ dst[j] = src[i];
+ }
+ }
- dst[j] = '\0'; // Null-terminate the destination
+ dst[j] = '\0'; // Null-terminate the destination
- return i >= src_len ? j : -1;
+ return i >= src_len ? j : -1;
}
static int is_valid_http_method(const char *s) {
- return !strcmp(s, "GET") || !strcmp(s, "POST") || !strcmp(s, "HEAD") ||
- !strcmp(s, "CONNECT") || !strcmp(s, "PUT") || !strcmp(s, "DELETE") ||
- !strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL");
+ return !strcmp(s, "GET") || !strcmp(s, "POST") || !strcmp(s, "HEAD") ||
+ !strcmp(s, "CONNECT") || !strcmp(s, "PUT") || !strcmp(s, "DELETE") ||
+ !strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL");
}
// Parse HTTP request, fill in mg_request structure.
@@ -2260,120 +2259,120 @@ static int is_valid_http_method(const char *s) {
// HTTP request components, header names and header values.
// Note that len must point to the last \n of HTTP headers.
static int parse_http_message(char *buf, int len, struct mg_connection *ri) {
- int is_request, n;
-
- // Reset the connection. Make sure that we don't touch fields that are
- // set elsewhere: remote_ip, remote_port, server_param
- ri->request_method = ri->uri = ri->http_version = ri->query_string = NULL;
- ri->num_headers = ri->status_code = ri->is_websocket = ri->content_len = 0;
-
- buf[len - 1] = '\0';
-
- // RFC says that all initial whitespaces should be ingored
- while (*buf != '\0' && isspace(* (unsigned char *) buf)) {
- buf++;
- }
- ri->request_method = skip(&buf, " ");
- ri->uri = skip(&buf, " ");
- ri->http_version = skip(&buf, "\r\n");
-
- // HTTP message could be either HTTP request or HTTP response, e.g.
- // "GET / HTTP/1.0 ...." or "HTTP/1.0 200 OK ..."
- is_request = is_valid_http_method(ri->request_method);
- if ((is_request && memcmp(ri->http_version, "HTTP/", 5) != 0) ||
- (!is_request && memcmp(ri->request_method, "HTTP/", 5) != 0)) {
- len = -1;
- } else {
- if (is_request) {
- ri->http_version += 5;
- }
- parse_http_headers(&buf, ri);
-
- if ((ri->query_string = strchr(ri->uri, '?')) != NULL) {
- *(char *) ri->query_string++ = '\0';
- }
- n = (int) strlen(ri->uri);
- mg_url_decode(ri->uri, n, (char *) ri->uri, n + 1, 0);
- if (*ri->uri == '/' || *ri->uri == '.') {
- remove_double_dots_and_double_slashes((char *) ri->uri);
- }
- }
-
- return len;
+ int is_request, n;
+
+ // Reset the connection. Make sure that we don't touch fields that are
+ // set elsewhere: remote_ip, remote_port, server_param
+ ri->request_method = ri->uri = ri->http_version = ri->query_string = NULL;
+ ri->num_headers = ri->status_code = ri->is_websocket = ri->content_len = 0;
+
+ buf[len - 1] = '\0';
+
+ // RFC says that all initial whitespaces should be ingored
+ while (*buf != '\0' && isspace(* (unsigned char *) buf)) {
+ buf++;
+ }
+ ri->request_method = skip(&buf, " ");
+ ri->uri = skip(&buf, " ");
+ ri->http_version = skip(&buf, "\r\n");
+
+ // HTTP message could be either HTTP request or HTTP response, e.g.
+ // "GET / HTTP/1.0 ...." or "HTTP/1.0 200 OK ..."
+ is_request = is_valid_http_method(ri->request_method);
+ if ((is_request && memcmp(ri->http_version, "HTTP/", 5) != 0) ||
+ (!is_request && memcmp(ri->request_method, "HTTP/", 5) != 0)) {
+ len = -1;
+ } else {
+ if (is_request) {
+ ri->http_version += 5;
+ }
+ parse_http_headers(&buf, ri);
+
+ if ((ri->query_string = strchr(ri->uri, '?')) != NULL) {
+ *(char *) ri->query_string++ = '\0';
+ }
+ n = (int) strlen(ri->uri);
+ mg_url_decode(ri->uri, n, (char *) ri->uri, n + 1, 0);
+ if (*ri->uri == '/' || *ri->uri == '.') {
+ remove_double_dots_and_double_slashes((char *) ri->uri);
+ }
+ }
+
+ return len;
}
static int lowercase(const char *s) {
- return tolower(* (const unsigned char *) s);
+ return tolower(* (const unsigned char *) s);
}
static int mg_strcasecmp(const char *s1, const char *s2) {
- int diff;
+ int diff;
- do {
- diff = lowercase(s1++) - lowercase(s2++);
- } while (diff == 0 && s1[-1] != '\0');
+ do {
+ diff = lowercase(s1++) - lowercase(s2++);
+ } while (diff == 0 && s1[-1] != '\0');
- return diff;
+ return diff;
}
static int mg_strncasecmp(const char *s1, const char *s2, size_t len) {
- int diff = 0;
+ int diff = 0;
- if (len > 0)
- do {
- diff = lowercase(s1++) - lowercase(s2++);
- } while (diff == 0 && s1[-1] != '\0' && --len > 0);
+ if (len > 0)
+ do {
+ diff = lowercase(s1++) - lowercase(s2++);
+ } while (diff == 0 && s1[-1] != '\0' && --len > 0);
- return diff;
+ return diff;
}
// Return HTTP header value, or NULL if not found.
const char *mg_get_header(const struct mg_connection *ri, const char *s) {
- int i;
+ int i;
- for (i = 0; i < ri->num_headers; i++)
- if (!mg_strcasecmp(s, ri->http_headers[i].name))
- return ri->http_headers[i].value;
+ for (i = 0; i < ri->num_headers; i++)
+ if (!mg_strcasecmp(s, ri->http_headers[i].name))
+ return ri->http_headers[i].value;
- return NULL;
+ return NULL;
}
// Perform case-insensitive match of string against pattern
int mg_match_prefix(const char *pattern, int pattern_len, const char *str) {
- const char *or_str;
- int len, res, i = 0, j = 0;
-
- if ((or_str = (const char *) memchr(pattern, '|', pattern_len)) != NULL) {
- res = mg_match_prefix(pattern, or_str - pattern, str);
- return res > 0 ? res : mg_match_prefix(or_str + 1,
- (pattern + pattern_len) - (or_str + 1), str);
- }
-
- for (; i < pattern_len; i++, j++) {
- if (pattern[i] == '?' && str[j] != '\0') {
- continue;
- } else if (pattern[i] == '$') {
- return str[j] == '\0' ? j : -1;
- } else if (pattern[i] == '*') {
- i++;
- if (pattern[i] == '*') {
- i++;
- len = (int) strlen(str + j);
- } else {
- len = (int) strcspn(str + j, "/");
- }
- if (i == pattern_len) {
- return j + len;
- }
- do {
- res = mg_match_prefix(pattern + i, pattern_len - i, str + j + len);
- } while (res == -1 && len-- > 0);
- return res == -1 ? -1 : j + res + len;
- } else if (lowercase(&pattern[i]) != lowercase(&str[j])) {
- return -1;
- }
- }
- return j;
+ const char *or_str;
+ int len, res, i = 0, j = 0;
+
+ if ((or_str = (const char *) memchr(pattern, '|', pattern_len)) != NULL) {
+ res = mg_match_prefix(pattern, or_str - pattern, str);
+ return res > 0 ? res : mg_match_prefix(or_str + 1,
+ (pattern + pattern_len) - (or_str + 1), str);
+ }
+
+ for (; i < pattern_len; i++, j++) {
+ if (pattern[i] == '?' && str[j] != '\0') {
+ continue;
+ } else if (pattern[i] == '$') {
+ return str[j] == '\0' ? j : -1;
+ } else if (pattern[i] == '*') {
+ i++;
+ if (pattern[i] == '*') {
+ i++;
+ len = (int) strlen(str + j);
+ } else {
+ len = (int) strcspn(str + j, "/");
+ }
+ if (i == pattern_len) {
+ return j + len;
+ }
+ do {
+ res = mg_match_prefix(pattern + i, pattern_len - i, str + j + len);
+ } while (res == -1 && len-- > 0);
+ return res == -1 ? -1 : j + res + len;
+ } else if (lowercase(&pattern[i]) != lowercase(&str[j])) {
+ return -1;
+ }
+ }
+ return j;
}
// This function prints HTML pages, and expands "{{something}}" blocks
@@ -2381,182 +2380,182 @@ int mg_match_prefix(const char *pattern, int pattern_len, const char *str) {
// Note that {{@path/to/file}} construct outputs embedded file's contents,
// which provides SSI-like functionality.
void mg_template(struct mg_connection *conn, const char *s,
- struct mg_expansion *expansions) {
- int i, j, pos = 0, inside_marker = 0;
-
- for (i = 0; s[i] != '\0'; i++) {
- if (inside_marker == 0 && !memcmp(&s[i], "{{", 2)) {
- if (i > pos) {
- mg_send_data(conn, &s[pos], i - pos);
- }
- pos = i;
- inside_marker = 1;
- }
- if (inside_marker == 1 && !memcmp(&s[i], "}}", 2)) {
- for (j = 0; expansions[j].keyword != NULL; j++) {
- const char *kw = expansions[j].keyword;
- if ((int) strlen(kw) == i - (pos + 2) &&
- memcmp(kw, &s[pos + 2], i - (pos + 2)) == 0) {
- expansions[j].handler(conn);
- pos = i + 2;
- break;
- }
- }
- inside_marker = 0;
- }
- }
- if (i > pos) {
- mg_send_data(conn, &s[pos], i - pos);
- }
+ struct mg_expansion *expansions) {
+ int i, j, pos = 0, inside_marker = 0;
+
+ for (i = 0; s[i] != '\0'; i++) {
+ if (inside_marker == 0 && !memcmp(&s[i], "{{", 2)) {
+ if (i > pos) {
+ mg_send_data(conn, &s[pos], i - pos);
+ }
+ pos = i;
+ inside_marker = 1;
+ }
+ if (inside_marker == 1 && !memcmp(&s[i], "}}", 2)) {
+ for (j = 0; expansions[j].keyword != NULL; j++) {
+ const char *kw = expansions[j].keyword;
+ if ((int) strlen(kw) == i - (pos + 2) &&
+ memcmp(kw, &s[pos + 2], i - (pos + 2)) == 0) {
+ expansions[j].handler(conn);
+ pos = i + 2;
+ break;
+ }
+ }
+ inside_marker = 0;
+ }
+ }
+ if (i > pos) {
+ mg_send_data(conn, &s[pos], i - pos);
+ }
}
#ifndef MONGOOSE_NO_FILESYSTEM
static int must_hide_file(struct connection *conn, const char *path) {
- const char *pw_pattern = "**" PASSWORDS_FILE_NAME "$";
- const char *pattern = conn->server->config_options[HIDE_FILES_PATTERN];
- return mg_match_prefix(pw_pattern, strlen(pw_pattern), path) > 0 ||
- (pattern != NULL && mg_match_prefix(pattern, strlen(pattern), path) > 0);
+ const char *pw_pattern = "**" PASSWORDS_FILE_NAME "$";
+ const char *pattern = conn->server->config_options[HIDE_FILES_PATTERN];
+ return mg_match_prefix(pw_pattern, strlen(pw_pattern), path) > 0 ||
+ (pattern != NULL && mg_match_prefix(pattern, strlen(pattern), path) > 0);
}
// Return 1 if real file has been found, 0 otherwise
static int convert_uri_to_file_name(struct connection *conn, char *buf,
- size_t buf_len, file_stat_t *st) {
- struct vec a, b;
- const char *rewrites = conn->server->config_options[URL_REWRITES];
- const char *root = conn->server->config_options[DOCUMENT_ROOT];
+ size_t buf_len, file_stat_t *st) {
+ struct vec a, b;
+ const char *rewrites = conn->server->config_options[URL_REWRITES];
+ const char *root = conn->server->config_options[DOCUMENT_ROOT];
#ifndef MONGOOSE_NO_CGI
- const char *cgi_pat = conn->server->config_options[CGI_PATTERN];
- char *p;
+ const char *cgi_pat = conn->server->config_options[CGI_PATTERN];
+ char *p;
#endif
- const char *uri = conn->mg_conn.uri;
- const char *domain = mg_get_header(&conn->mg_conn, "Host");
- int match_len, root_len = root == NULL ? 0 : strlen(root);
-
- // Perform virtual hosting rewrites
- if (rewrites != NULL && domain != NULL) {
- const char *colon = strchr(domain, ':');
- int domain_len = colon == NULL ? (int) strlen(domain) : colon - domain;
-
- while ((rewrites = next_option(rewrites, &a, &b)) != NULL) {
- if (a.len > 1 && a.ptr[0] == '@' && a.len == domain_len + 1 &&
- mg_strncasecmp(a.ptr + 1, domain, domain_len) == 0) {
- root = b.ptr;
- root_len = b.len;
- break;
- }
- }
- }
-
- // No filesystem access
- if (root == NULL || root_len == 0) return 0;
-
- // Handle URL rewrites
- mg_snprintf(buf, buf_len, "%.*s%s", root_len, root, uri);
- rewrites = conn->server->config_options[URL_REWRITES]; // Re-initialize!
- while ((rewrites = next_option(rewrites, &a, &b)) != NULL) {
- if ((match_len = mg_match_prefix(a.ptr, a.len, uri)) > 0) {
- mg_snprintf(buf, buf_len, "%.*s%s", (int) b.len, b.ptr, uri + match_len);
- break;
- }
- }
-
- if (stat(buf, st) == 0) return 1;
+ const char *uri = conn->mg_conn.uri;
+ const char *domain = mg_get_header(&conn->mg_conn, "Host");
+ int match_len, root_len = root == NULL ? 0 : strlen(root);
+
+ // Perform virtual hosting rewrites
+ if (rewrites != NULL && domain != NULL) {
+ const char *colon = strchr(domain, ':');
+ int domain_len = colon == NULL ? (int) strlen(domain) : colon - domain;
+
+ while ((rewrites = next_option(rewrites, &a, &b)) != NULL) {
+ if (a.len > 1 && a.ptr[0] == '@' && a.len == domain_len + 1 &&
+ mg_strncasecmp(a.ptr + 1, domain, domain_len) == 0) {
+ root = b.ptr;
+ root_len = b.len;
+ break;
+ }
+ }
+ }
+
+ // No filesystem access
+ if (root == NULL || root_len == 0) return 0;
+
+ // Handle URL rewrites
+ mg_snprintf(buf, buf_len, "%.*s%s", root_len, root, uri);
+ rewrites = conn->server->config_options[URL_REWRITES]; // Re-initialize!
+ while ((rewrites = next_option(rewrites, &a, &b)) != NULL) {
+ if ((match_len = mg_match_prefix(a.ptr, a.len, uri)) > 0) {
+ mg_snprintf(buf, buf_len, "%.*s%s", (int) b.len, b.ptr, uri + match_len);
+ break;
+ }
+ }
+
+ if (stat(buf, st) == 0) return 1;
#ifndef MONGOOSE_NO_CGI
- // Support PATH_INFO for CGI scripts.
- for (p = buf + strlen(root) + 2; *p != '\0'; p++) {
- if (*p == '/') {
- *p = '\0';
- if (mg_match_prefix(cgi_pat, strlen(cgi_pat), buf) > 0 &&
- !stat(buf, st)) {
- DBG(("!!!! [%s]", buf));
- *p = '/';
- conn->path_info = mg_strdup(p);
- *p = '\0';
- return 1;
- }
- *p = '/';
- }
- }
+ // Support PATH_INFO for CGI scripts.
+ for (p = buf + strlen(root) + 2; *p != '\0'; p++) {
+ if (*p == '/') {
+ *p = '\0';
+ if (mg_match_prefix(cgi_pat, strlen(cgi_pat), buf) > 0 &&
+ !stat(buf, st)) {
+ DBG(("!!!! [%s]", buf));
+ *p = '/';
+ conn->path_info = mg_strdup(p);
+ *p = '\0';
+ return 1;
+ }
+ *p = '/';
+ }
+ }
#endif
- return 0;
+ return 0;
}
#endif // MONGOOSE_NO_FILESYSTEM
static int should_keep_alive(const struct mg_connection *conn) {
- struct connection *c = MG_CONN_2_CONN(conn);
- const char *method = conn->request_method;
- const char *http_version = conn->http_version;
- const char *header = mg_get_header(conn, "Connection");
- return method != NULL &&
- (!strcmp(method, "GET") || c->endpoint_type == EP_USER) &&
- ((header != NULL && !mg_strcasecmp(header, "keep-alive")) ||
- (header == NULL && http_version && !strcmp(http_version, "1.1")));
+ struct connection *c = MG_CONN_2_CONN(conn);
+ const char *method = conn->request_method;
+ const char *http_version = conn->http_version;
+ const char *header = mg_get_header(conn, "Connection");
+ return method != NULL &&
+ (!strcmp(method, "GET") || c->endpoint_type == EP_USER) &&
+ ((header != NULL && !mg_strcasecmp(header, "keep-alive")) ||
+ (header == NULL && http_version && !strcmp(http_version, "1.1")));
}
size_t mg_write(struct mg_connection *c, const void *buf, int len) {
- struct connection *conn = MG_CONN_2_CONN(c);
- ns_send(conn->ns_conn, buf, len);
- return conn->ns_conn->send_iobuf.len;
+ struct connection *conn = MG_CONN_2_CONN(c);
+ ns_send(conn->ns_conn, buf, len);
+ return conn->ns_conn->send_iobuf.len;
}
void mg_send_status(struct mg_connection *c, int status) {
- if (c->status_code == 0) {
- c->status_code = status;
- mg_printf(c, "HTTP/1.1 %d %s\r\n", status, status_code_to_str(status));
- }
+ if (c->status_code == 0) {
+ c->status_code = status;
+ mg_printf(c, "HTTP/1.1 %d %s\r\n", status, status_code_to_str(status));
+ }
}
void mg_send_header(struct mg_connection *c, const char *name, const char *v) {
- if (c->status_code == 0) {
- c->status_code = 200;
- mg_printf(c, "HTTP/1.1 %d %s\r\n", 200, status_code_to_str(200));
- }
- mg_printf(c, "%s: %s\r\n", name, v);
+ if (c->status_code == 0) {
+ c->status_code = 200;
+ mg_printf(c, "HTTP/1.1 %d %s\r\n", 200, status_code_to_str(200));
+ }
+ mg_printf(c, "%s: %s\r\n", name, v);
}
static void terminate_headers(struct mg_connection *c) {
- struct connection *conn = MG_CONN_2_CONN(c);
- if (!(conn->ns_conn->flags & MG_HEADERS_SENT)) {
- mg_send_header(c, "Transfer-Encoding", "chunked");
- mg_write(c, "\r\n", 2);
- conn->ns_conn->flags |= MG_HEADERS_SENT;
- }
+ struct connection *conn = MG_CONN_2_CONN(c);
+ if (!(conn->ns_conn->flags & MG_HEADERS_SENT)) {
+ mg_send_header(c, "Transfer-Encoding", "chunked");
+ mg_write(c, "\r\n", 2);
+ conn->ns_conn->flags |= MG_HEADERS_SENT;
+ }
}
size_t mg_send_data(struct mg_connection *c, const void *data, int data_len) {
- struct connection *conn = MG_CONN_2_CONN(c);
- terminate_headers(c);
- write_chunk(MG_CONN_2_CONN(c), (const char *) data, data_len);
- return conn->ns_conn->send_iobuf.len;
+ struct connection *conn = MG_CONN_2_CONN(c);
+ terminate_headers(c);
+ write_chunk(MG_CONN_2_CONN(c), (const char *) data, data_len);
+ return conn->ns_conn->send_iobuf.len;
}
size_t mg_printf_data(struct mg_connection *c, const char *fmt, ...) {
- struct connection *conn = MG_CONN_2_CONN(c);
- va_list ap;
- int len;
- char mem[IOBUF_SIZE], *buf = mem;
+ struct connection *conn = MG_CONN_2_CONN(c);
+ va_list ap;
+ int len;
+ char mem[IOBUF_SIZE], *buf = mem;
- terminate_headers(c);
+ terminate_headers(c);
- va_start(ap, fmt);
- len = ns_avprintf(&buf, sizeof(mem), fmt, ap);
- va_end(ap);
+ va_start(ap, fmt);
+ len = ns_avprintf(&buf, sizeof(mem), fmt, ap);
+ va_end(ap);
- if (len >= 0) {
- write_chunk((struct connection *) conn, buf, len);
- }
- if (buf != mem && buf != NULL) {
- free(buf);
- }
- return conn->ns_conn->send_iobuf.len;
+ if (len >= 0) {
+ write_chunk((struct connection *) conn, buf, len);
+ }
+ if (buf != mem && buf != NULL) {
+ free(buf);
+ }
+ return conn->ns_conn->send_iobuf.len;
}
#if !defined(MONGOOSE_NO_WEBSOCKET) || !defined(MONGOOSE_NO_AUTH)
static int is_big_endian(void) {
- static const int n = 1;
- return ((char *) &n)[0] == 0;
+ static const int n = 1;
+ return ((char *) &n)[0] == 0;
}
#endif
@@ -2573,16 +2572,16 @@ union char64long16 { unsigned char c[64]; uint32_t l[16]; };
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
static uint32_t blk0(union char64long16 *block, int i) {
- // Forrest: SHA expect BIG_ENDIAN, swap if LITTLE_ENDIAN
- if (!is_big_endian()) {
- block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) |
- (rol(block->l[i], 8) & 0x00FF00FF);
- }
- return block->l[i];
+ // Forrest: SHA expect BIG_ENDIAN, swap if LITTLE_ENDIAN
+ if (!is_big_endian()) {
+ block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) |
+ (rol(block->l[i], 8) & 0x00FF00FF);
+ }
+ return block->l[i];
}
#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
- ^block->l[(i+2)&15]^block->l[i&15],1))
+ ^block->l[(i+2)&15]^block->l[i&15],1))
#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(block, i)+0x5A827999+rol(v,5);w=rol(w,30);
#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
@@ -2590,1056 +2589,1055 @@ static uint32_t blk0(union char64long16 *block, int i) {
#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
typedef struct {
- uint32_t state[5];
- uint32_t count[2];
- unsigned char buffer[64];
+ uint32_t state[5];
+ uint32_t count[2];
+ unsigned char buffer[64];
} SHA1_CTX;
static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) {
- uint32_t a, b, c, d, e;
- union char64long16 block[1];
-
- memcpy(block, buffer, 64);
- a = state[0];
- b = state[1];
- c = state[2];
- d = state[3];
- e = state[4];
- R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
- R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
- R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
- R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
- R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
- R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
- R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
- R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
- R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
- R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
- R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
- R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
- R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
- R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
- R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
- R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
- R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
- R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
- R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
- R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
- state[0] += a;
- state[1] += b;
- state[2] += c;
- state[3] += d;
- state[4] += e;
- // Erase working structures. The order of operations is important,
- // used to ensure that compiler doesn't optimize those out.
- memset(block, 0, sizeof(block));
- a = b = c = d = e = 0;
- (void) a; (void) b; (void) c; (void) d; (void) e;
+ uint32_t a, b, c, d, e;
+ union char64long16 block[1];
+
+ memcpy(block, buffer, 64);
+ a = state[0];
+ b = state[1];
+ c = state[2];
+ d = state[3];
+ e = state[4];
+ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
+ R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
+ R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
+ R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
+ R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
+ R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
+ R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
+ R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
+ R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
+ R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
+ R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
+ R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
+ R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
+ R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
+ R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
+ R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
+ R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
+ R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
+ R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
+ R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+ state[4] += e;
+ // Erase working structures. The order of operations is important,
+ // used to ensure that compiler doesn't optimize those out.
+ memset(block, 0, sizeof(block));
+ a = b = c = d = e = 0;
+ (void) a; (void) b; (void) c; (void) d; (void) e;
}
static void SHA1Init(SHA1_CTX *context) {
- context->state[0] = 0x67452301;
- context->state[1] = 0xEFCDAB89;
- context->state[2] = 0x98BADCFE;
- context->state[3] = 0x10325476;
- context->state[4] = 0xC3D2E1F0;
- context->count[0] = context->count[1] = 0;
+ context->state[0] = 0x67452301;
+ context->state[1] = 0xEFCDAB89;
+ context->state[2] = 0x98BADCFE;
+ context->state[3] = 0x10325476;
+ context->state[4] = 0xC3D2E1F0;
+ context->count[0] = context->count[1] = 0;
}
static void SHA1Update(SHA1_CTX *context, const unsigned char *data,
- uint32_t len) {
- uint32_t i, j;
-
- j = context->count[0];
- if ((context->count[0] += len << 3) < j)
- context->count[1]++;
- context->count[1] += (len>>29);
- j = (j >> 3) & 63;
- if ((j + len) > 63) {
- memcpy(&context->buffer[j], data, (i = 64-j));
- SHA1Transform(context->state, context->buffer);
- for ( ; i + 63 < len; i += 64) {
- SHA1Transform(context->state, &data[i]);
- }
- j = 0;
- }
- else i = 0;
- memcpy(&context->buffer[j], &data[i], len - i);
+ uint32_t len) {
+ uint32_t i, j;
+
+ j = context->count[0];
+ if ((context->count[0] += len << 3) < j)
+ context->count[1]++;
+ context->count[1] += (len>>29);
+ j = (j >> 3) & 63;
+ if ((j + len) > 63) {
+ memcpy(&context->buffer[j], data, (i = 64-j));
+ SHA1Transform(context->state, context->buffer);
+ for ( ; i + 63 < len; i += 64) {
+ SHA1Transform(context->state, &data[i]);
+ }
+ j = 0;
+ }
+ else i = 0;
+ memcpy(&context->buffer[j], &data[i], len - i);
}
static void SHA1Final(unsigned char digest[20], SHA1_CTX *context) {
- unsigned i;
- unsigned char finalcount[8], c;
-
- for (i = 0; i < 8; i++) {
- finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
- >> ((3-(i & 3)) * 8) ) & 255);
- }
- c = 0200;
- SHA1Update(context, &c, 1);
- while ((context->count[0] & 504) != 448) {
- c = 0000;
- SHA1Update(context, &c, 1);
- }
- SHA1Update(context, finalcount, 8);
- for (i = 0; i < 20; i++) {
- digest[i] = (unsigned char)
- ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
- }
- memset(context, '\0', sizeof(*context));
- memset(&finalcount, '\0', sizeof(finalcount));
+ unsigned i;
+ unsigned char finalcount[8], c;
+
+ for (i = 0; i < 8; i++) {
+ finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
+ >> ((3-(i & 3)) * 8) ) & 255);
+ }
+ c = 0200;
+ SHA1Update(context, &c, 1);
+ while ((context->count[0] & 504) != 448) {
+ c = 0000;
+ SHA1Update(context, &c, 1);
+ }
+ SHA1Update(context, finalcount, 8);
+ for (i = 0; i < 20; i++) {
+ digest[i] = (unsigned char)
+ ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
+ }
+ memset(context, '\0', sizeof(*context));
+ memset(&finalcount, '\0', sizeof(finalcount));
}
// END OF SHA1 CODE
static void base64_encode(const unsigned char *src, int src_len, char *dst) {
- static const char *b64 =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- int i, j, a, b, c;
-
- for (i = j = 0; i < src_len; i += 3) {
- a = src[i];
- b = i + 1 >= src_len ? 0 : src[i + 1];
- c = i + 2 >= src_len ? 0 : src[i + 2];
-
- dst[j++] = b64[a >> 2];
- dst[j++] = b64[((a & 3) << 4) | (b >> 4)];
- if (i + 1 < src_len) {
- dst[j++] = b64[(b & 15) << 2 | (c >> 6)];
- }
- if (i + 2 < src_len) {
- dst[j++] = b64[c & 63];
- }
- }
- while (j % 4 != 0) {
- dst[j++] = '=';
- }
- dst[j++] = '\0';
+ static const char *b64 =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ int i, j, a, b, c;
+
+ for (i = j = 0; i < src_len; i += 3) {
+ a = src[i];
+ b = i + 1 >= src_len ? 0 : src[i + 1];
+ c = i + 2 >= src_len ? 0 : src[i + 2];
+
+ dst[j++] = b64[a >> 2];
+ dst[j++] = b64[((a & 3) << 4) | (b >> 4)];
+ if (i + 1 < src_len) {
+ dst[j++] = b64[(b & 15) << 2 | (c >> 6)];
+ }
+ if (i + 2 < src_len) {
+ dst[j++] = b64[c & 63];
+ }
+ }
+ while (j % 4 != 0) {
+ dst[j++] = '=';
+ }
+ dst[j++] = '\0';
}
static void send_websocket_handshake(struct mg_connection *conn,
- const char *key) {
- static const char *magic = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
- char buf[500], sha[20], b64_sha[sizeof(sha) * 2];
- SHA1_CTX sha_ctx;
+ const char *key) {
+ static const char *magic = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
+ char buf[500], sha[20], b64_sha[sizeof(sha) * 2];
+ SHA1_CTX sha_ctx;
- mg_snprintf(buf, sizeof(buf), "%s%s", key, magic);
- SHA1Init(&sha_ctx);
- SHA1Update(&sha_ctx, (unsigned char *) buf, strlen(buf));
- SHA1Final((unsigned char *) sha, &sha_ctx);
- base64_encode((unsigned char *) sha, sizeof(sha), b64_sha);
- mg_snprintf(buf, sizeof(buf), "%s%s%s",
- "HTTP/1.1 101 Switching Protocols\r\n"
- "Upgrade: websocket\r\n"
- "Connection: Upgrade\r\n"
- "Sec-WebSocket-Accept: ", b64_sha, "\r\n\r\n");
+ mg_snprintf(buf, sizeof(buf), "%s%s", key, magic);
+ SHA1Init(&sha_ctx);
+ SHA1Update(&sha_ctx, (unsigned char *) buf, strlen(buf));
+ SHA1Final((unsigned char *) sha, &sha_ctx);
+ base64_encode((unsigned char *) sha, sizeof(sha), b64_sha);
+ mg_snprintf(buf, sizeof(buf), "%s%s%s",
+ "HTTP/1.1 101 Switching Protocols\r\n"
+ "Upgrade: websocket\r\n"
+ "Connection: Upgrade\r\n"
+ "Sec-WebSocket-Accept: ", b64_sha, "\r\n\r\n");
- mg_write(conn, buf, strlen(buf));
+ mg_write(conn, buf, strlen(buf));
}
static int deliver_websocket_frame(struct connection *conn) {
- // Having buf unsigned char * is important, as it is used below in arithmetic
- unsigned char *buf = (unsigned char *) conn->ns_conn->recv_iobuf.buf;
- int i, len, buf_len = conn->ns_conn->recv_iobuf.len, frame_len = 0,
- mask_len = 0, header_len = 0, data_len = 0, buffered = 0;
-
- if (buf_len >= 2) {
- len = buf[1] & 127;
- mask_len = buf[1] & 128 ? 4 : 0;
- if (len < 126 && buf_len >= mask_len) {
- data_len = len;
- header_len = 2 + mask_len;
- } else if (len == 126 && buf_len >= 4 + mask_len) {
- header_len = 4 + mask_len;
- data_len = ((((int) buf[2]) << 8) + buf[3]);
- } else if (buf_len >= 10 + mask_len) {
- header_len = 10 + mask_len;
- data_len = (int) (((uint64_t) htonl(* (uint32_t *) &buf[2])) << 32) +
- htonl(* (uint32_t *) &buf[6]);
- }
- }
-
- frame_len = header_len + data_len;
- buffered = frame_len > 0 && frame_len <= buf_len;
-
- if (buffered) {
- conn->mg_conn.content_len = data_len;
- conn->mg_conn.content = (char *) buf + header_len;
- conn->mg_conn.wsbits = buf[0];
-
- // Apply mask if necessary
- if (mask_len > 0) {
- for (i = 0; i < data_len; i++) {
- buf[i + header_len] ^= (buf + header_len - mask_len)[i % 4];
- }
- }
-
- // Call the handler and remove frame from the iobuf
- if (call_user(conn, MG_REQUEST) == MG_FALSE) {
- conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
- }
- iobuf_remove(&conn->ns_conn->recv_iobuf, frame_len);
- }
-
- return buffered;
+ // Having buf unsigned char * is important, as it is used below in arithmetic
+ unsigned char *buf = (unsigned char *) conn->ns_conn->recv_iobuf.buf;
+ int i, len, buf_len = conn->ns_conn->recv_iobuf.len, frame_len = 0,
+ mask_len = 0, header_len = 0, data_len = 0, buffered = 0;
+
+ if (buf_len >= 2) {
+ len = buf[1] & 127;
+ mask_len = buf[1] & 128 ? 4 : 0;
+ if (len < 126 && buf_len >= mask_len) {
+ data_len = len;
+ header_len = 2 + mask_len;
+ } else if (len == 126 && buf_len >= 4 + mask_len) {
+ header_len = 4 + mask_len;
+ data_len = ((((int) buf[2]) << 8) + buf[3]);
+ } else if (buf_len >= 10 + mask_len) {
+ header_len = 10 + mask_len;
+ data_len = (int) (((uint64_t) htonl(* (uint32_t *) &buf[2])) << 32) +
+ htonl(* (uint32_t *) &buf[6]);
+ }
+ }
+
+ frame_len = header_len + data_len;
+ buffered = frame_len > 0 && frame_len <= buf_len;
+
+ if (buffered) {
+ conn->mg_conn.content_len = data_len;
+ conn->mg_conn.content = (char *) buf + header_len;
+ conn->mg_conn.wsbits = buf[0];
+
+ // Apply mask if necessary
+ if (mask_len > 0) {
+ for (i = 0; i < data_len; i++) {
+ buf[i + header_len] ^= (buf + header_len - mask_len)[i % 4];
+ }
+ }
+
+ // Call the handler and remove frame from the iobuf
+ if (call_user(conn, MG_REQUEST) == MG_FALSE) {
+ conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
+ }
+ iobuf_remove(&conn->ns_conn->recv_iobuf, frame_len);
+ }
+
+ return buffered;
}
size_t mg_websocket_write(struct mg_connection *conn, int opcode,
- const char *data, size_t data_len) {
- unsigned char mem[4192], *copy = mem;
- size_t copy_len = 0;
-
- if (data_len + 10 > sizeof(mem) &&
- (copy = (unsigned char *) malloc(data_len + 10)) == NULL) {
- return 0;
- }
-
- copy[0] = 0x80 + (opcode & 0x0f);
-
- // Frame format: http://tools.ietf.org/html/rfc6455#section-5.2
- if (data_len < 126) {
- // Inline 7-bit length field
- copy[1] = data_len;
- memcpy(copy + 2, data, data_len);
- copy_len = 2 + data_len;
- } else if (data_len <= 0xFFFF) {
- // 16-bit length field
- copy[1] = 126;
- * (uint16_t *) (copy + 2) = (uint16_t) htons((uint16_t) data_len);
- memcpy(copy + 4, data, data_len);
- copy_len = 4 + data_len;
- } else {
- // 64-bit length field
- copy[1] = 127;
- * (uint32_t *) (copy + 2) = (uint32_t)
- htonl((uint32_t) ((uint64_t) data_len >> 32));
- * (uint32_t *) (copy + 6) = (uint32_t) htonl(data_len & 0xffffffff);
- memcpy(copy + 10, data, data_len);
- copy_len = 10 + data_len;
- }
-
- if (copy_len > 0) {
- mg_write(conn, copy, copy_len);
- }
- if (copy != mem) {
- free(copy);
- }
-
- // If we send closing frame, schedule a connection to be closed after
- // data is drained to the client.
- if (opcode == WEBSOCKET_OPCODE_CONNECTION_CLOSE) {
- MG_CONN_2_CONN(conn)->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
- }
-
- return MG_CONN_2_CONN(conn)->ns_conn->send_iobuf.len;
+ const char *data, size_t data_len) {
+ unsigned char mem[4192], *copy = mem;
+ size_t copy_len = 0;
+
+ if (data_len + 10 > sizeof(mem) &&
+ (copy = (unsigned char *) malloc(data_len + 10)) == NULL) {
+ return 0;
+ }
+
+ copy[0] = 0x80 + (opcode & 0x0f);
+
+ // Frame format: http://tools.ietf.org/html/rfc6455#section-5.2
+ if (data_len < 126) {
+ // Inline 7-bit length field
+ copy[1] = data_len;
+ memcpy(copy + 2, data, data_len);
+ copy_len = 2 + data_len;
+ } else if (data_len <= 0xFFFF) {
+ // 16-bit length field
+ copy[1] = 126;
+ * (uint16_t *) (copy + 2) = (uint16_t) htons((uint16_t) data_len);
+ memcpy(copy + 4, data, data_len);
+ copy_len = 4 + data_len;
+ } else {
+ // 64-bit length field
+ copy[1] = 127;
+ * (uint32_t *) (copy + 2) = (uint32_t)
+ htonl((uint32_t) ((uint64_t) data_len >> 32));
+ * (uint32_t *) (copy + 6) = (uint32_t) htonl(data_len & 0xffffffff);
+ memcpy(copy + 10, data, data_len);
+ copy_len = 10 + data_len;
+ }
+
+ if (copy_len > 0) {
+ mg_write(conn, copy, copy_len);
+ }
+ if (copy != mem) {
+ free(copy);
+ }
+
+ // If we send closing frame, schedule a connection to be closed after
+ // data is drained to the client.
+ if (opcode == WEBSOCKET_OPCODE_CONNECTION_CLOSE) {
+ MG_CONN_2_CONN(conn)->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
+ }
+
+ return MG_CONN_2_CONN(conn)->ns_conn->send_iobuf.len;
}
size_t mg_websocket_printf(struct mg_connection *conn, int opcode,
- const char *fmt, ...) {
- char mem[4192], *buf = mem;
- va_list ap;
- int len;
+ const char *fmt, ...) {
+ char mem[4192], *buf = mem;
+ va_list ap;
+ int len;
- va_start(ap, fmt);
- if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) {
- mg_websocket_write(conn, opcode, buf, len);
- }
- va_end(ap);
+ va_start(ap, fmt);
+ if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) {
+ mg_websocket_write(conn, opcode, buf, len);
+ }
+ va_end(ap);
- if (buf != mem && buf != NULL) {
- free(buf);
- }
+ if (buf != mem && buf != NULL) {
+ free(buf);
+ }
- return MG_CONN_2_CONN(conn)->ns_conn->send_iobuf.len;
+ return MG_CONN_2_CONN(conn)->ns_conn->send_iobuf.len;
}
static void send_websocket_handshake_if_requested(struct mg_connection *conn) {
- const char *ver = mg_get_header(conn, "Sec-WebSocket-Version"),
- *key = mg_get_header(conn, "Sec-WebSocket-Key");
- if (ver != NULL && key != NULL) {
- conn->is_websocket = 1;
- if (call_user(MG_CONN_2_CONN(conn), MG_WS_HANDSHAKE) == MG_FALSE) {
- send_websocket_handshake(conn, key);
- }
- call_user(MG_CONN_2_CONN(conn), MG_WS_CONNECT);
- }
+ const char *ver = mg_get_header(conn, "Sec-WebSocket-Version"),
+ *key = mg_get_header(conn, "Sec-WebSocket-Key");
+ if (ver != NULL && key != NULL) {
+ conn->is_websocket = 1;
+ if (call_user(MG_CONN_2_CONN(conn), MG_WS_HANDSHAKE) == MG_FALSE) {
+ send_websocket_handshake(conn, key);
+ }
+ call_user(MG_CONN_2_CONN(conn), MG_WS_CONNECT);
+ }
}
static void ping_idle_websocket_connection(struct connection *conn, time_t t) {
- if (t - conn->ns_conn->last_io_time > MONGOOSE_USE_WEBSOCKET_PING_INTERVAL) {
- mg_websocket_write(&conn->mg_conn, WEBSOCKET_OPCODE_PING, "", 0);
- }
+ if (t - conn->ns_conn->last_io_time > MONGOOSE_USE_WEBSOCKET_PING_INTERVAL) {
+ mg_websocket_write(&conn->mg_conn, WEBSOCKET_OPCODE_PING, "", 0);
+ }
}
#else
#define ping_idle_websocket_connection(conn, t)
#endif // !MONGOOSE_NO_WEBSOCKET
static void write_terminating_chunk(struct connection *conn) {
- mg_write(&conn->mg_conn, "0\r\n\r\n", 5);
+ mg_write(&conn->mg_conn, "0\r\n\r\n", 5);
}
static int call_request_handler(struct connection *conn) {
- int result;
- conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf;
- if ((result = call_user(conn, MG_REQUEST)) == MG_TRUE) {
- if (conn->ns_conn->flags & MG_HEADERS_SENT) {
- write_terminating_chunk(conn);
- }
- close_local_endpoint(conn);
- }
- return result;
+ int result;
+ conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf;
+ if ((result = call_user(conn, MG_REQUEST)) == MG_TRUE) {
+ if (conn->ns_conn->flags & MG_HEADERS_SENT) {
+ write_terminating_chunk(conn);
+ }
+ close_local_endpoint(conn);
+ }
+ return result;
}
const char *mg_get_mime_type(const char *path, const char *default_mime_type) {
- const char *ext;
- size_t i, path_len;
+ const char *ext;
+ size_t i, path_len;
- path_len = strlen(path);
+ path_len = strlen(path);
- for (i = 0; static_builtin_mime_types[i].extension != NULL; i++) {
- ext = path + (path_len - static_builtin_mime_types[i].ext_len);
- if (path_len > static_builtin_mime_types[i].ext_len &&
- mg_strcasecmp(ext, static_builtin_mime_types[i].extension) == 0) {
- return static_builtin_mime_types[i].mime_type;
- }
- }
+ for (i = 0; static_builtin_mime_types[i].extension != NULL; i++) {
+ ext = path + (path_len - static_builtin_mime_types[i].ext_len);
+ if (path_len > static_builtin_mime_types[i].ext_len &&
+ mg_strcasecmp(ext, static_builtin_mime_types[i].extension) == 0) {
+ return static_builtin_mime_types[i].mime_type;
+ }
+ }
- return default_mime_type;
+ return default_mime_type;
}
#ifndef MONGOOSE_NO_FILESYSTEM
// Convert month to the month number. Return -1 on error, or month number
static int get_month_index(const char *s) {
- static const char *month_names[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
- };
- int i;
+ static const char *month_names[] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+ int i;
- for (i = 0; i < (int) ARRAY_SIZE(month_names); i++)
- if (!strcmp(s, month_names[i]))
- return i;
+ for (i = 0; i < (int) ARRAY_SIZE(month_names); i++)
+ if (!strcmp(s, month_names[i]))
+ return i;
- return -1;
+ return -1;
}
static int num_leap_years(int year) {
- return year / 4 - year / 100 + year / 400;
+ return year / 4 - year / 100 + year / 400;
}
// Parse UTC date-time string, and return the corresponding time_t value.
static time_t parse_date_string(const char *datetime) {
- static const unsigned short days_before_month[] = {
- 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
- };
- char month_str[32];
- int second, minute, hour, day, month, year, leap_days, days;
- time_t result = (time_t) 0;
-
- if (((sscanf(datetime, "%d/%3s/%d %d:%d:%d",
- &day, month_str, &year, &hour, &minute, &second) == 6) ||
- (sscanf(datetime, "%d %3s %d %d:%d:%d",
- &day, month_str, &year, &hour, &minute, &second) == 6) ||
- (sscanf(datetime, "%*3s, %d %3s %d %d:%d:%d",
- &day, month_str, &year, &hour, &minute, &second) == 6) ||
- (sscanf(datetime, "%d-%3s-%d %d:%d:%d",
- &day, month_str, &year, &hour, &minute, &second) == 6)) &&
- year > 1970 &&
- (month = get_month_index(month_str)) != -1) {
- leap_days = num_leap_years(year) - num_leap_years(1970);
- year -= 1970;
- days = year * 365 + days_before_month[month] + (day - 1) + leap_days;
- result = days * 24 * 3600 + hour * 3600 + minute * 60 + second;
- }
-
- return result;
+ static const unsigned short days_before_month[] = {
+ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
+ };
+ char month_str[32];
+ int second, minute, hour, day, month, year, leap_days, days;
+ time_t result = (time_t) 0;
+
+ if (((sscanf(datetime, "%d/%3s/%d %d:%d:%d",
+ &day, month_str, &year, &hour, &minute, &second) == 6) ||
+ (sscanf(datetime, "%d %3s %d %d:%d:%d",
+ &day, month_str, &year, &hour, &minute, &second) == 6) ||
+ (sscanf(datetime, "%*3s, %d %3s %d %d:%d:%d",
+ &day, month_str, &year, &hour, &minute, &second) == 6) ||
+ (sscanf(datetime, "%d-%3s-%d %d:%d:%d",
+ &day, month_str, &year, &hour, &minute, &second) == 6)) &&
+ year > 1970 &&
+ (month = get_month_index(month_str)) != -1) {
+ leap_days = num_leap_years(year) - num_leap_years(1970);
+ year -= 1970;
+ days = year * 365 + days_before_month[month] + (day - 1) + leap_days;
+ result = days * 24 * 3600 + hour * 3600 + minute * 60 + second;
+ }
+
+ return result;
}
// Look at the "path" extension and figure what mime type it has.
// Store mime type in the vector.
static void get_mime_type(const struct mg_server *server, const char *path,
- struct vec *vec) {
- struct vec ext_vec, mime_vec;
- const char *list, *ext;
- size_t path_len;
+ struct vec *vec) {
+ struct vec ext_vec, mime_vec;
+ const char *list, *ext;
+ size_t path_len;
- path_len = strlen(path);
+ path_len = strlen(path);
- // Scan user-defined mime types first, in case user wants to
- // override default mime types.
- list = server->config_options[EXTRA_MIME_TYPES];
- while ((list = next_option(list, &ext_vec, &mime_vec)) != NULL) {
- // ext now points to the path suffix
- ext = path + path_len - ext_vec.len;
- if (mg_strncasecmp(ext, ext_vec.ptr, ext_vec.len) == 0) {
- *vec = mime_vec;
- return;
- }
- }
+ // Scan user-defined mime types first, in case user wants to
+ // override default mime types.
+ list = server->config_options[EXTRA_MIME_TYPES];
+ while ((list = next_option(list, &ext_vec, &mime_vec)) != NULL) {
+ // ext now points to the path suffix
+ ext = path + path_len - ext_vec.len;
+ if (mg_strncasecmp(ext, ext_vec.ptr, ext_vec.len) == 0) {
+ *vec = mime_vec;
+ return;
+ }
+ }
- vec->ptr = mg_get_mime_type(path, "text/plain");
- vec->len = strlen(vec->ptr);
+ vec->ptr = mg_get_mime_type(path, "text/plain");
+ vec->len = strlen(vec->ptr);
}
static const char *suggest_connection_header(const struct mg_connection *conn) {
- return should_keep_alive(conn) ? "keep-alive" : "close";
+ return should_keep_alive(conn) ? "keep-alive" : "close";
}
static void construct_etag(char *buf, size_t buf_len, const file_stat_t *st) {
- mg_snprintf(buf, buf_len, "\"%lx.%" INT64_FMT "\"",
- (unsigned long) st->st_mtime, (int64_t) st->st_size);
+ mg_snprintf(buf, buf_len, "\"%lx.%" INT64_FMT "\"",
+ (unsigned long) st->st_mtime, (int64_t) st->st_size);
}
// Return True if we should reply 304 Not Modified.
static int is_not_modified(const struct connection *conn,
- const file_stat_t *stp) {
- char etag[64];
- const char *ims = mg_get_header(&conn->mg_conn, "If-Modified-Since");
- const char *inm = mg_get_header(&conn->mg_conn, "If-None-Match");
- construct_etag(etag, sizeof(etag), stp);
- return (inm != NULL && !mg_strcasecmp(etag, inm)) ||
- (ims != NULL && stp->st_mtime <= parse_date_string(ims));
+ const file_stat_t *stp) {
+ char etag[64];
+ const char *ims = mg_get_header(&conn->mg_conn, "If-Modified-Since");
+ const char *inm = mg_get_header(&conn->mg_conn, "If-None-Match");
+ construct_etag(etag, sizeof(etag), stp);
+ return (inm != NULL && !mg_strcasecmp(etag, inm)) ||
+ (ims != NULL && stp->st_mtime <= parse_date_string(ims));
}
// For given directory path, substitute it to valid index file.
// Return 0 if index file has been found, -1 if not found.
// If the file is found, it's stats is returned in stp.
static int find_index_file(struct connection *conn, char *path,
- size_t path_len, file_stat_t *stp) {
- const char *list = conn->server->config_options[INDEX_FILES];
- file_stat_t st;
- struct vec filename_vec;
- size_t n = strlen(path), found = 0;
-
- // The 'path' given to us points to the directory. Remove all trailing
- // directory separator characters from the end of the path, and
- // then append single directory separator character.
- while (n > 0 && path[n - 1] == '/') {
- n--;
- }
- path[n] = '/';
-
- // Traverse index files list. For each entry, append it to the given
- // path and see if the file exists. If it exists, break the loop
- while ((list = next_option(list, &filename_vec, NULL)) != NULL) {
-
- // Ignore too long entries that may overflow path buffer
- if (filename_vec.len > (int) (path_len - (n + 2)))
- continue;
-
- // Prepare full path to the index file
- strncpy(path + n + 1, filename_vec.ptr, filename_vec.len);
- path[n + 1 + filename_vec.len] = '\0';
-
- //DBG(("[%s]", path));
-
- // Does it exist?
- if (!stat(path, &st)) {
- // Yes it does, break the loop
- *stp = st;
- found = 1;
- break;
- }
- }
-
- // If no index file exists, restore directory path
- if (!found) {
- path[n] = '\0';
- }
-
- return found;
+ size_t path_len, file_stat_t *stp) {
+ const char *list = conn->server->config_options[INDEX_FILES];
+ file_stat_t st;
+ struct vec filename_vec;
+ size_t n = strlen(path), found = 0;
+
+ // The 'path' given to us points to the directory. Remove all trailing
+ // directory separator characters from the end of the path, and
+ // then append single directory separator character.
+ while (n > 0 && path[n - 1] == '/') {
+ n--;
+ }
+ path[n] = '/';
+
+ // Traverse index files list. For each entry, append it to the given
+ // path and see if the file exists. If it exists, break the loop
+ while ((list = next_option(list, &filename_vec, NULL)) != NULL) {
+ // Ignore too long entries that may overflow path buffer
+ if (filename_vec.len > (int) (path_len - (n + 2)))
+ continue;
+
+ // Prepare full path to the index file
+ strncpy(path + n + 1, filename_vec.ptr, filename_vec.len);
+ path[n + 1 + filename_vec.len] = '\0';
+
+ //DBG(("[%s]", path));
+
+ // Does it exist?
+ if (!stat(path, &st)) {
+ // Yes it does, break the loop
+ *stp = st;
+ found = 1;
+ break;
+ }
+ }
+
+ // If no index file exists, restore directory path
+ if (!found) {
+ path[n] = '\0';
+ }
+
+ return found;
}
static int parse_range_header(const char *header, int64_t *a, int64_t *b) {
- return sscanf(header, "bytes=%" INT64_FMT "-%" INT64_FMT, a, b);
+ return sscanf(header, "bytes=%" INT64_FMT "-%" INT64_FMT, a, b);
}
static void gmt_time_string(char *buf, size_t buf_len, time_t *t) {
- strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S GMT", gmtime(t));
+ strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S GMT", gmtime(t));
}
static void open_file_endpoint(struct connection *conn, const char *path,
- file_stat_t *st) {
- char date[64], lm[64], etag[64], range[64], headers[500];
- const char *msg = "OK", *hdr;
- time_t curtime = time(NULL);
- int64_t r1, r2;
- struct vec mime_vec;
- int n;
-
- conn->endpoint_type = EP_FILE;
- ns_set_close_on_exec(conn->endpoint.fd);
- conn->mg_conn.status_code = 200;
-
- get_mime_type(conn->server, path, &mime_vec);
- conn->cl = st->st_size;
- range[0] = '\0';
-
- // If Range: header specified, act accordingly
- r1 = r2 = 0;
- hdr = mg_get_header(&conn->mg_conn, "Range");
- if (hdr != NULL && (n = parse_range_header(hdr, &r1, &r2)) > 0 &&
- r1 >= 0 && r2 >= 0) {
- conn->mg_conn.status_code = 206;
- conn->cl = n == 2 ? (r2 > conn->cl ? conn->cl : r2) - r1 + 1: conn->cl - r1;
- mg_snprintf(range, sizeof(range), "Content-Range: bytes "
- "%" INT64_FMT "-%" INT64_FMT "/%" INT64_FMT "\r\n",
- r1, r1 + conn->cl - 1, (int64_t) st->st_size);
- msg = "Partial Content";
- lseek(conn->endpoint.fd, r1, SEEK_SET);
- }
-
- // Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to
- // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
- gmt_time_string(date, sizeof(date), &curtime);
- gmt_time_string(lm, sizeof(lm), &st->st_mtime);
- construct_etag(etag, sizeof(etag), st);
-
- n = mg_snprintf(headers, sizeof(headers),
- "HTTP/1.1 %d %s\r\n"
- "Date: %s\r\n"
- "Last-Modified: %s\r\n"
- "Etag: %s\r\n"
- "Content-Type: %.*s\r\n"
- "Content-Length: %" INT64_FMT "\r\n"
- "Connection: %s\r\n"
- "Accept-Ranges: bytes\r\n"
- "%s%s\r\n",
- conn->mg_conn.status_code, msg, date, lm, etag,
- (int) mime_vec.len, mime_vec.ptr, conn->cl,
- suggest_connection_header(&conn->mg_conn),
- range, MONGOOSE_USE_EXTRA_HTTP_HEADERS);
- ns_send(conn->ns_conn, headers, n);
-
- if (!strcmp(conn->mg_conn.request_method, "HEAD")) {
- conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
- close(conn->endpoint.fd);
- conn->endpoint_type = EP_NONE;
- }
+ file_stat_t *st) {
+ char date[64], lm[64], etag[64], range[64], headers[500];
+ const char *msg = "OK", *hdr;
+ time_t curtime = time(NULL);
+ int64_t r1, r2;
+ struct vec mime_vec;
+ int n;
+
+ conn->endpoint_type = EP_FILE;
+ ns_set_close_on_exec(conn->endpoint.fd);
+ conn->mg_conn.status_code = 200;
+
+ get_mime_type(conn->server, path, &mime_vec);
+ conn->cl = st->st_size;
+ range[0] = '\0';
+
+ // If Range: header specified, act accordingly
+ r1 = r2 = 0;
+ hdr = mg_get_header(&conn->mg_conn, "Range");
+ if (hdr != NULL && (n = parse_range_header(hdr, &r1, &r2)) > 0 &&
+ r1 >= 0 && r2 >= 0) {
+ conn->mg_conn.status_code = 206;
+ conn->cl = n == 2 ? (r2 > conn->cl ? conn->cl : r2) - r1 + 1: conn->cl - r1;
+ mg_snprintf(range, sizeof(range), "Content-Range: bytes "
+ "%" INT64_FMT "-%" INT64_FMT "/%" INT64_FMT "\r\n",
+ r1, r1 + conn->cl - 1, (int64_t) st->st_size);
+ msg = "Partial Content";
+ lseek(conn->endpoint.fd, r1, SEEK_SET);
+ }
+
+ // Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to
+ // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
+ gmt_time_string(date, sizeof(date), &curtime);
+ gmt_time_string(lm, sizeof(lm), &st->st_mtime);
+ construct_etag(etag, sizeof(etag), st);
+
+ n = mg_snprintf(headers, sizeof(headers),
+ "HTTP/1.1 %d %s\r\n"
+ "Date: %s\r\n"
+ "Last-Modified: %s\r\n"
+ "Etag: %s\r\n"
+ "Content-Type: %.*s\r\n"
+ "Content-Length: %" INT64_FMT "\r\n"
+ "Connection: %s\r\n"
+ "Accept-Ranges: bytes\r\n"
+ "%s%s\r\n",
+ conn->mg_conn.status_code, msg, date, lm, etag,
+ (int) mime_vec.len, mime_vec.ptr, conn->cl,
+ suggest_connection_header(&conn->mg_conn),
+ range, MONGOOSE_USE_EXTRA_HTTP_HEADERS);
+ ns_send(conn->ns_conn, headers, n);
+
+ if (!strcmp(conn->mg_conn.request_method, "HEAD")) {
+ conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
+ close(conn->endpoint.fd);
+ conn->endpoint_type = EP_NONE;
+ }
}
void mg_send_file_data(struct mg_connection *c, int fd) {
- struct connection *conn = MG_CONN_2_CONN(c);
- conn->endpoint_type = EP_FILE;
- conn->endpoint.fd = fd;
- ns_set_close_on_exec(conn->endpoint.fd);
+ struct connection *conn = MG_CONN_2_CONN(c);
+ conn->endpoint_type = EP_FILE;
+ conn->endpoint.fd = fd;
+ ns_set_close_on_exec(conn->endpoint.fd);
}
#endif // MONGOOSE_NO_FILESYSTEM
static void call_request_handler_if_data_is_buffered(struct connection *conn) {
#ifndef MONGOOSE_NO_WEBSOCKET
- if (conn->mg_conn.is_websocket) {
- do { } while (deliver_websocket_frame(conn));
- } else
+ if (conn->mg_conn.is_websocket) {
+ do { } while (deliver_websocket_frame(conn));
+ } else
#endif
- if (conn->num_bytes_recv >= (conn->cl + conn->request_len) &&
- call_request_handler(conn) == MG_FALSE) {
- open_local_endpoint(conn, 1);
- }
+ if (conn->num_bytes_recv >= (conn->cl + conn->request_len) &&
+ call_request_handler(conn) == MG_FALSE) {
+ open_local_endpoint(conn, 1);
+ }
}
#if !defined(MONGOOSE_NO_DIRECTORY_LISTING) || !defined(MONGOOSE_NO_DAV)
#ifdef _WIN32
struct dirent {
- char d_name[MAX_PATH_SIZE];
+ char d_name[MAX_PATH_SIZE];
};
typedef struct DIR {
- HANDLE handle;
- WIN32_FIND_DATAW info;
- struct dirent result;
+ HANDLE handle;
+ WIN32_FIND_DATAW info;
+ struct dirent result;
} DIR;
// Implementation of POSIX opendir/closedir/readdir for Windows.
static DIR *opendir(const char *name) {
- DIR *dir = NULL;
- wchar_t wpath[MAX_PATH_SIZE];
- DWORD attrs;
-
- if (name == NULL) {
- SetLastError(ERROR_BAD_ARGUMENTS);
- } else if ((dir = (DIR *) malloc(sizeof(*dir))) == NULL) {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- } else {
- to_wchar(name, wpath, ARRAY_SIZE(wpath));
- attrs = GetFileAttributesW(wpath);
- if (attrs != 0xFFFFFFFF &&
- ((attrs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)) {
- (void) wcscat(wpath, L"\\*");
- dir->handle = FindFirstFileW(wpath, &dir->info);
- dir->result.d_name[0] = '\0';
- } else {
- free(dir);
- dir = NULL;
- }
- }
-
- return dir;
+ DIR *dir = NULL;
+ wchar_t wpath[MAX_PATH_SIZE];
+ DWORD attrs;
+
+ if (name == NULL) {
+ SetLastError(ERROR_BAD_ARGUMENTS);
+ } else if ((dir = (DIR *) malloc(sizeof(*dir))) == NULL) {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ } else {
+ to_wchar(name, wpath, ARRAY_SIZE(wpath));
+ attrs = GetFileAttributesW(wpath);
+ if (attrs != 0xFFFFFFFF &&
+ ((attrs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)) {
+ (void) wcscat(wpath, L"\\*");
+ dir->handle = FindFirstFileW(wpath, &dir->info);
+ dir->result.d_name[0] = '\0';
+ } else {
+ free(dir);
+ dir = NULL;
+ }
+ }
+
+ return dir;
}
static int closedir(DIR *dir) {
- int result = 0;
+ int result = 0;
- if (dir != NULL) {
- if (dir->handle != INVALID_HANDLE_VALUE)
- result = FindClose(dir->handle) ? 0 : -1;
+ if (dir != NULL) {
+ if (dir->handle != INVALID_HANDLE_VALUE)
+ result = FindClose(dir->handle) ? 0 : -1;
- free(dir);
- } else {
- result = -1;
- SetLastError(ERROR_BAD_ARGUMENTS);
- }
+ free(dir);
+ } else {
+ result = -1;
+ SetLastError(ERROR_BAD_ARGUMENTS);
+ }
- return result;
+ return result;
}
static struct dirent *readdir(DIR *dir) {
- struct dirent *result = 0;
+ struct dirent *result = 0;
- if (dir) {
- if (dir->handle != INVALID_HANDLE_VALUE) {
- result = &dir->result;
- (void) WideCharToMultiByte(CP_UTF8, 0,
- dir->info.cFileName, -1, result->d_name,
- sizeof(result->d_name), NULL, NULL);
+ if (dir) {
+ if (dir->handle != INVALID_HANDLE_VALUE) {
+ result = &dir->result;
+ (void) WideCharToMultiByte(CP_UTF8, 0,
+ dir->info.cFileName, -1, result->d_name,
+ sizeof(result->d_name), NULL, NULL);
- if (!FindNextFileW(dir->handle, &dir->info)) {
- (void) FindClose(dir->handle);
- dir->handle = INVALID_HANDLE_VALUE;
- }
+ if (!FindNextFileW(dir->handle, &dir->info)) {
+ (void) FindClose(dir->handle);
+ dir->handle = INVALID_HANDLE_VALUE;
+ }
- } else {
- SetLastError(ERROR_FILE_NOT_FOUND);
- }
- } else {
- SetLastError(ERROR_BAD_ARGUMENTS);
- }
+ } else {
+ SetLastError(ERROR_FILE_NOT_FOUND);
+ }
+ } else {
+ SetLastError(ERROR_BAD_ARGUMENTS);
+ }
- return result;
+ return result;
}
#endif // _WIN32 POSIX opendir/closedir/readdir implementation
static int scan_directory(struct connection *conn, const char *dir,
- struct dir_entry **arr) {
- char path[MAX_PATH_SIZE];
- struct dir_entry *p;
- struct dirent *dp;
- int arr_size = 0, arr_ind = 0, inc = 100;
- DIR *dirp;
-
- *arr = NULL;
- if ((dirp = (opendir(dir))) == NULL) return 0;
-
- while ((dp = readdir(dirp)) != NULL) {
- // Do not show current dir and hidden files
- if (!strcmp(dp->d_name, ".") ||
- !strcmp(dp->d_name, "..") ||
- must_hide_file(conn, dp->d_name)) {
- continue;
- }
- mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name);
-
- // Resize the array if nesessary
- if (arr_ind >= arr_size) {
- if ((p = (struct dir_entry *)
- realloc(*arr, (inc + arr_size) * sizeof(**arr))) != NULL) {
- // Memset new chunk to zero, otherwize st_mtime will have garbage which
- // can make strftime() segfault, see
- // http://code.google.com/p/mongoose/issues/detail?id=79
- memset(p + arr_size, 0, sizeof(**arr) * inc);
-
- *arr = p;
- arr_size += inc;
- }
- }
-
- if (arr_ind < arr_size) {
- (*arr)[arr_ind].conn = conn;
- (*arr)[arr_ind].file_name = strdup(dp->d_name);
- stat(path, &(*arr)[arr_ind].st);
- arr_ind++;
- }
- }
- closedir(dirp);
-
- return arr_ind;
+ struct dir_entry **arr) {
+ char path[MAX_PATH_SIZE];
+ struct dir_entry *p;
+ struct dirent *dp;
+ int arr_size = 0, arr_ind = 0, inc = 100;
+ DIR *dirp;
+
+ *arr = NULL;
+ if ((dirp = (opendir(dir))) == NULL) return 0;
+
+ while ((dp = readdir(dirp)) != NULL) {
+ // Do not show current dir and hidden files
+ if (!strcmp(dp->d_name, ".") ||
+ !strcmp(dp->d_name, "..") ||
+ must_hide_file(conn, dp->d_name)) {
+ continue;
+ }
+ mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name);
+
+ // Resize the array if nesessary
+ if (arr_ind >= arr_size) {
+ if ((p = (struct dir_entry *)
+ realloc(*arr, (inc + arr_size) * sizeof(**arr))) != NULL) {
+ // Memset new chunk to zero, otherwize st_mtime will have garbage which
+ // can make strftime() segfault, see
+ // http://code.google.com/p/mongoose/issues/detail?id=79
+ memset(p + arr_size, 0, sizeof(**arr) * inc);
+
+ *arr = p;
+ arr_size += inc;
+ }
+ }
+
+ if (arr_ind < arr_size) {
+ (*arr)[arr_ind].conn = conn;
+ (*arr)[arr_ind].file_name = strdup(dp->d_name);
+ stat(path, &(*arr)[arr_ind].st);
+ arr_ind++;
+ }
+ }
+ closedir(dirp);
+
+ return arr_ind;
}
int mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len) {
- static const char *dont_escape = "._-$,;~()";
- static const char *hex = "0123456789abcdef";
- size_t i = 0, j = 0;
-
- for (i = j = 0; dst_len > 0 && i < s_len && j + 2 < dst_len - 1; i++, j++) {
- if (isalnum(* (const unsigned char *) (src + i)) ||
- strchr(dont_escape, * (const unsigned char *) (src + i)) != NULL) {
- dst[j] = src[i];
- } else if (j + 3 < dst_len) {
- dst[j] = '%';
- dst[j + 1] = hex[(* (const unsigned char *) (src + i)) >> 4];
- dst[j + 2] = hex[(* (const unsigned char *) (src + i)) & 0xf];
- j += 2;
- }
- }
-
- dst[j] = '\0';
- return j;
+ static const char *dont_escape = "._-$,;~()";
+ static const char *hex = "0123456789abcdef";
+ size_t i = 0, j = 0;
+
+ for (i = j = 0; dst_len > 0 && i < s_len && j + 2 < dst_len - 1; i++, j++) {
+ if (isalnum(* (const unsigned char *) (src + i)) ||
+ strchr(dont_escape, * (const unsigned char *) (src + i)) != NULL) {
+ dst[j] = src[i];
+ } else if (j + 3 < dst_len) {
+ dst[j] = '%';
+ dst[j + 1] = hex[(* (const unsigned char *) (src + i)) >> 4];
+ dst[j + 2] = hex[(* (const unsigned char *) (src + i)) & 0xf];
+ j += 2;
+ }
+ }
+
+ dst[j] = '\0';
+ return j;
}
#endif // !NO_DIRECTORY_LISTING || !MONGOOSE_NO_DAV
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
static void print_dir_entry(const struct dir_entry *de) {
- char size[64], mod[64], href[MAX_PATH_SIZE * 3];
- int64_t fsize = de->st.st_size;
- int is_dir = S_ISDIR(de->st.st_mode);
- const char *slash = is_dir ? "/" : "";
-
- if (is_dir) {
- mg_snprintf(size, sizeof(size), "%s", "[DIRECTORY]");
- } else {
- // We use (signed) cast below because MSVC 6 compiler cannot
- // convert unsigned __int64 to double.
- if (fsize < 1024) {
- mg_snprintf(size, sizeof(size), "%d", (int) fsize);
- } else if (fsize < 0x100000) {
- mg_snprintf(size, sizeof(size), "%.1fk", (double) fsize / 1024.0);
- } else if (fsize < 0x40000000) {
- mg_snprintf(size, sizeof(size), "%.1fM", (double) fsize / 1048576);
- } else {
- mg_snprintf(size, sizeof(size), "%.1fG", (double) fsize / 1073741824);
- }
- }
- strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&de->st.st_mtime));
- mg_url_encode(de->file_name, strlen(de->file_name), href, sizeof(href));
- mg_printf_data(&de->conn->mg_conn,
- "<tr><td><a href=\"%s%s\">%s%s</a></td>"
- "<td>&nbsp;%s</td><td>&nbsp;&nbsp;%s</td></tr>\n",
- href, slash, de->file_name, slash, mod, size);
+ char size[64], mod[64], href[MAX_PATH_SIZE * 3];
+ int64_t fsize = de->st.st_size;
+ int is_dir = S_ISDIR(de->st.st_mode);
+ const char *slash = is_dir ? "/" : "";
+
+ if (is_dir) {
+ mg_snprintf(size, sizeof(size), "%s", "[DIRECTORY]");
+ } else {
+ // We use (signed) cast below because MSVC 6 compiler cannot
+ // convert unsigned __int64 to double.
+ if (fsize < 1024) {
+ mg_snprintf(size, sizeof(size), "%d", (int) fsize);
+ } else if (fsize < 0x100000) {
+ mg_snprintf(size, sizeof(size), "%.1fk", (double) fsize / 1024.0);
+ } else if (fsize < 0x40000000) {
+ mg_snprintf(size, sizeof(size), "%.1fM", (double) fsize / 1048576);
+ } else {
+ mg_snprintf(size, sizeof(size), "%.1fG", (double) fsize / 1073741824);
+ }
+ }
+ strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&de->st.st_mtime));
+ mg_url_encode(de->file_name, strlen(de->file_name), href, sizeof(href));
+ mg_printf_data(&de->conn->mg_conn,
+ "<tr><td><a href=\"%s%s\">%s%s</a></td>"
+ "<td>&nbsp;%s</td><td>&nbsp;&nbsp;%s</td></tr>\n",
+ href, slash, de->file_name, slash, mod, size);
}
// Sort directory entries by size, or name, or modification time.
// On windows, __cdecl specification is needed in case if project is built
// with __stdcall convention. qsort always requires __cdels callback.
static int __cdecl compare_dir_entries(const void *p1, const void *p2) {
- const struct dir_entry *a = (const struct dir_entry *) p1,
- *b = (const struct dir_entry *) p2;
- const char *qs = a->conn->mg_conn.query_string ?
- a->conn->mg_conn.query_string : "na";
- int cmp_result = 0;
-
- if (S_ISDIR(a->st.st_mode) && !S_ISDIR(b->st.st_mode)) {
- return -1; // Always put directories on top
- } else if (!S_ISDIR(a->st.st_mode) && S_ISDIR(b->st.st_mode)) {
- return 1; // Always put directories on top
- } else if (*qs == 'n') {
- cmp_result = strcmp(a->file_name, b->file_name);
- } else if (*qs == 's') {
- cmp_result = a->st.st_size == b->st.st_size ? 0 :
- a->st.st_size > b->st.st_size ? 1 : -1;
- } else if (*qs == 'd') {
- cmp_result = a->st.st_mtime == b->st.st_mtime ? 0 :
- a->st.st_mtime > b->st.st_mtime ? 1 : -1;
- }
-
- return qs[1] == 'd' ? -cmp_result : cmp_result;
+ const struct dir_entry *a = (const struct dir_entry *) p1,
+ *b = (const struct dir_entry *) p2;
+ const char *qs = a->conn->mg_conn.query_string ?
+ a->conn->mg_conn.query_string : "na";
+ int cmp_result = 0;
+
+ if (S_ISDIR(a->st.st_mode) && !S_ISDIR(b->st.st_mode)) {
+ return -1; // Always put directories on top
+ } else if (!S_ISDIR(a->st.st_mode) && S_ISDIR(b->st.st_mode)) {
+ return 1; // Always put directories on top
+ } else if (*qs == 'n') {
+ cmp_result = strcmp(a->file_name, b->file_name);
+ } else if (*qs == 's') {
+ cmp_result = a->st.st_size == b->st.st_size ? 0 :
+ a->st.st_size > b->st.st_size ? 1 : -1;
+ } else if (*qs == 'd') {
+ cmp_result = a->st.st_mtime == b->st.st_mtime ? 0 :
+ a->st.st_mtime > b->st.st_mtime ? 1 : -1;
+ }
+
+ return qs[1] == 'd' ? -cmp_result : cmp_result;
}
static void send_directory_listing(struct connection *conn, const char *dir) {
- struct dir_entry *arr = NULL;
- int i, num_entries, sort_direction = conn->mg_conn.query_string != NULL &&
- conn->mg_conn.query_string[1] == 'd' ? 'a' : 'd';
-
- mg_send_header(&conn->mg_conn, "Transfer-Encoding", "chunked");
- mg_send_header(&conn->mg_conn, "Content-Type", "text/html; charset=utf-8");
-
- mg_printf_data(&conn->mg_conn,
- "<html><head><title>Index of %s</title>"
- "<style>th {text-align: left;}</style></head>"
- "<body><h1>Index of %s</h1><pre><table cellpadding=\"0\">"
- "<tr><th><a href=\"?n%c\">Name</a></th>"
- "<th><a href=\"?d%c\">Modified</a></th>"
- "<th><a href=\"?s%c\">Size</a></th></tr>"
- "<tr><td colspan=\"3\"><hr></td></tr>",
- conn->mg_conn.uri, conn->mg_conn.uri,
- sort_direction, sort_direction, sort_direction);
-
- num_entries = scan_directory(conn, dir, &arr);
- qsort(arr, num_entries, sizeof(arr[0]), compare_dir_entries);
- for (i = 0; i < num_entries; i++) {
- print_dir_entry(&arr[i]);
- free(arr[i].file_name);
- }
- free(arr);
-
- write_terminating_chunk(conn);
- close_local_endpoint(conn);
+ struct dir_entry *arr = NULL;
+ int i, num_entries, sort_direction = conn->mg_conn.query_string != NULL &&
+ conn->mg_conn.query_string[1] == 'd' ? 'a' : 'd';
+
+ mg_send_header(&conn->mg_conn, "Transfer-Encoding", "chunked");
+ mg_send_header(&conn->mg_conn, "Content-Type", "text/html; charset=utf-8");
+
+ mg_printf_data(&conn->mg_conn,
+ "<html><head><title>Index of %s</title>"
+ "<style>th {text-align: left;}</style></head>"
+ "<body><h1>Index of %s</h1><pre><table cellpadding=\"0\">"
+ "<tr><th><a href=\"?n%c\">Name</a></th>"
+ "<th><a href=\"?d%c\">Modified</a></th>"
+ "<th><a href=\"?s%c\">Size</a></th></tr>"
+ "<tr><td colspan=\"3\"><hr></td></tr>",
+ conn->mg_conn.uri, conn->mg_conn.uri,
+ sort_direction, sort_direction, sort_direction);
+
+ num_entries = scan_directory(conn, dir, &arr);
+ qsort(arr, num_entries, sizeof(arr[0]), compare_dir_entries);
+ for (i = 0; i < num_entries; i++) {
+ print_dir_entry(&arr[i]);
+ free(arr[i].file_name);
+ }
+ free(arr);
+
+ write_terminating_chunk(conn);
+ close_local_endpoint(conn);
}
#endif // MONGOOSE_NO_DIRECTORY_LISTING
#ifndef MONGOOSE_NO_DAV
static void print_props(struct connection *conn, const char *uri,
- file_stat_t *stp) {
- char mtime[64];
-
- gmt_time_string(mtime, sizeof(mtime), &stp->st_mtime);
- mg_printf(&conn->mg_conn,
- "<d:response>"
- "<d:href>%s</d:href>"
- "<d:propstat>"
- "<d:prop>"
- "<d:resourcetype>%s</d:resourcetype>"
- "<d:getcontentlength>%" INT64_FMT "</d:getcontentlength>"
- "<d:getlastmodified>%s</d:getlastmodified>"
- "</d:prop>"
- "<d:status>HTTP/1.1 200 OK</d:status>"
- "</d:propstat>"
- "</d:response>\n",
- uri, S_ISDIR(stp->st_mode) ? "<d:collection/>" : "",
- (int64_t) stp->st_size, mtime);
+ file_stat_t *stp) {
+ char mtime[64];
+
+ gmt_time_string(mtime, sizeof(mtime), &stp->st_mtime);
+ mg_printf(&conn->mg_conn,
+ "<d:response>"
+ "<d:href>%s</d:href>"
+ "<d:propstat>"
+ "<d:prop>"
+ "<d:resourcetype>%s</d:resourcetype>"
+ "<d:getcontentlength>%" INT64_FMT "</d:getcontentlength>"
+ "<d:getlastmodified>%s</d:getlastmodified>"
+ "</d:prop>"
+ "<d:status>HTTP/1.1 200 OK</d:status>"
+ "</d:propstat>"
+ "</d:response>\n",
+ uri, S_ISDIR(stp->st_mode) ? "<d:collection/>" : "",
+ (int64_t) stp->st_size, mtime);
}
static void handle_propfind(struct connection *conn, const char *path,
- file_stat_t *stp, int exists) {
- static const char header[] = "HTTP/1.1 207 Multi-Status\r\n"
- "Connection: close\r\n"
- "Content-Type: text/xml; charset=utf-8\r\n\r\n"
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
- "<d:multistatus xmlns:d='DAV:'>\n";
- static const char footer[] = "</d:multistatus>";
- const char *depth = mg_get_header(&conn->mg_conn, "Depth"),
- *list_dir = conn->server->config_options[ENABLE_DIRECTORY_LISTING];
-
- conn->mg_conn.status_code = 207;
-
- // Print properties for the requested resource itself
- if (!exists) {
- conn->mg_conn.status_code = 404;
- mg_printf(&conn->mg_conn, "%s", "HTTP/1.1 404 Not Found\r\n\r\n");
- } else if (S_ISDIR(stp->st_mode) && mg_strcasecmp(list_dir, "yes") != 0) {
- conn->mg_conn.status_code = 403;
- mg_printf(&conn->mg_conn, "%s",
- "HTTP/1.1 403 Directory Listing Denied\r\n\r\n");
- } else {
- ns_send(conn->ns_conn, header, sizeof(header) - 1);
- print_props(conn, conn->mg_conn.uri, stp);
-
- if (S_ISDIR(stp->st_mode) &&
- (depth == NULL || strcmp(depth, "0") != 0)) {
- struct dir_entry *arr = NULL;
- int i, num_entries = scan_directory(conn, path, &arr);
-
- for (i = 0; i < num_entries; i++) {
- char buf[MAX_PATH_SIZE * 3];
- struct dir_entry *de = &arr[i];
- mg_url_encode(de->file_name, strlen(de->file_name), buf, sizeof(buf));
- print_props(conn, buf, &de->st);
- free(de->file_name);
- }
- free(arr);
- }
- ns_send(conn->ns_conn, footer, sizeof(footer) - 1);
- }
-
- close_local_endpoint(conn);
+ file_stat_t *stp, int exists) {
+ static const char header[] = "HTTP/1.1 207 Multi-Status\r\n"
+ "Connection: close\r\n"
+ "Content-Type: text/xml; charset=utf-8\r\n\r\n"
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+ "<d:multistatus xmlns:d='DAV:'>\n";
+ static const char footer[] = "</d:multistatus>";
+ const char *depth = mg_get_header(&conn->mg_conn, "Depth"),
+ *list_dir = conn->server->config_options[ENABLE_DIRECTORY_LISTING];
+
+ conn->mg_conn.status_code = 207;
+
+ // Print properties for the requested resource itself
+ if (!exists) {
+ conn->mg_conn.status_code = 404;
+ mg_printf(&conn->mg_conn, "%s", "HTTP/1.1 404 Not Found\r\n\r\n");
+ } else if (S_ISDIR(stp->st_mode) && mg_strcasecmp(list_dir, "yes") != 0) {
+ conn->mg_conn.status_code = 403;
+ mg_printf(&conn->mg_conn, "%s",
+ "HTTP/1.1 403 Directory Listing Denied\r\n\r\n");
+ } else {
+ ns_send(conn->ns_conn, header, sizeof(header) - 1);
+ print_props(conn, conn->mg_conn.uri, stp);
+
+ if (S_ISDIR(stp->st_mode) &&
+ (depth == NULL || strcmp(depth, "0") != 0)) {
+ struct dir_entry *arr = NULL;
+ int i, num_entries = scan_directory(conn, path, &arr);
+
+ for (i = 0; i < num_entries; i++) {
+ char buf[MAX_PATH_SIZE * 3];
+ struct dir_entry *de = &arr[i];
+ mg_url_encode(de->file_name, strlen(de->file_name), buf, sizeof(buf));
+ print_props(conn, buf, &de->st);
+ free(de->file_name);
+ }
+ free(arr);
+ }
+ ns_send(conn->ns_conn, footer, sizeof(footer) - 1);
+ }
+
+ close_local_endpoint(conn);
}
static void handle_mkcol(struct connection *conn, const char *path) {
- int status_code = 500;
-
- if (conn->mg_conn.content_len > 0) {
- status_code = 415;
- } else if (!mkdir(path, 0755)) {
- status_code = 201;
- } else if (errno == EEXIST) {
- status_code = 405;
- } else if (errno == EACCES) {
- status_code = 403;
- } else if (errno == ENOENT) {
- status_code = 409;
- }
- send_http_error(conn, status_code, NULL);
+ int status_code = 500;
+
+ if (conn->mg_conn.content_len > 0) {
+ status_code = 415;
+ } else if (!mkdir(path, 0755)) {
+ status_code = 201;
+ } else if (errno == EEXIST) {
+ status_code = 405;
+ } else if (errno == EACCES) {
+ status_code = 403;
+ } else if (errno == ENOENT) {
+ status_code = 409;
+ }
+ send_http_error(conn, status_code, NULL);
}
static int remove_directory(const char *dir) {
- char path[MAX_PATH_SIZE];
- struct dirent *dp;
- file_stat_t st;
- DIR *dirp;
+ char path[MAX_PATH_SIZE];
+ struct dirent *dp;
+ file_stat_t st;
+ DIR *dirp;
- if ((dirp = opendir(dir)) == NULL) return 0;
+ if ((dirp = opendir(dir)) == NULL) return 0;
- while ((dp = readdir(dirp)) != NULL) {
- if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue;
- mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name);
- stat(path, &st);
- if (S_ISDIR(st.st_mode)) {
- remove_directory(path);
- } else {
- remove(path);
- }
- }
- closedir(dirp);
- rmdir(dir);
+ while ((dp = readdir(dirp)) != NULL) {
+ if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue;
+ mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name);
+ stat(path, &st);
+ if (S_ISDIR(st.st_mode)) {
+ remove_directory(path);
+ } else {
+ remove(path);
+ }
+ }
+ closedir(dirp);
+ rmdir(dir);
- return 1;
+ return 1;
}
static void handle_delete(struct connection *conn, const char *path) {
- file_stat_t st;
+ file_stat_t st;
- if (stat(path, &st) != 0) {
- send_http_error(conn, 404, NULL);
- } else if (S_ISDIR(st.st_mode)) {
- remove_directory(path);
- send_http_error(conn, 204, NULL);
- } else if (remove(path) == 0) {
- send_http_error(conn, 204, NULL);
- } else {
- send_http_error(conn, 423, NULL);
- }
+ if (stat(path, &st) != 0) {
+ send_http_error(conn, 404, NULL);
+ } else if (S_ISDIR(st.st_mode)) {
+ remove_directory(path);
+ send_http_error(conn, 204, NULL);
+ } else if (remove(path) == 0) {
+ send_http_error(conn, 204, NULL);
+ } else {
+ send_http_error(conn, 423, NULL);
+ }
}
// For a given PUT path, create all intermediate subdirectories
// for given path. Return 0 if the path itself is a directory,
// or -1 on error, 1 if OK.
static int put_dir(const char *path) {
- char buf[MAX_PATH_SIZE];
- const char *s, *p;
- file_stat_t st;
+ char buf[MAX_PATH_SIZE];
+ const char *s, *p;
+ file_stat_t st;
- // Create intermediate directories if they do not exist
- for (s = p = path + 1; (p = strchr(s, '/')) != NULL; s = ++p) {
- if (p - path >= (int) sizeof(buf)) return -1; // Buffer overflow
- memcpy(buf, path, p - path);
- buf[p - path] = '\0';
- if (stat(buf, &st) != 0 && mkdir(buf, 0755) != 0) return -1;
- if (p[1] == '\0') return 0; // Path is a directory itself
- }
+ // Create intermediate directories if they do not exist
+ for (s = p = path + 1; (p = strchr(s, '/')) != NULL; s = ++p) {
+ if (p - path >= (int) sizeof(buf)) return -1; // Buffer overflow
+ memcpy(buf, path, p - path);
+ buf[p - path] = '\0';
+ if (stat(buf, &st) != 0 && mkdir(buf, 0755) != 0) return -1;
+ if (p[1] == '\0') return 0; // Path is a directory itself
+ }
- return 1;
+ return 1;
}
static void handle_put(struct connection *conn, const char *path) {
- file_stat_t st;
- const char *range, *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length");
- int64_t r1, r2;
- int rc;
-
- conn->mg_conn.status_code = !stat(path, &st) ? 200 : 201;
- if ((rc = put_dir(path)) == 0) {
- mg_printf(&conn->mg_conn, "HTTP/1.1 %d OK\r\n\r\n",
- conn->mg_conn.status_code);
- close_local_endpoint(conn);
- } else if (rc == -1) {
- send_http_error(conn, 500, "put_dir: %s", strerror(errno));
- } else if (cl_hdr == NULL) {
- send_http_error(conn, 411, NULL);
+ file_stat_t st;
+ const char *range, *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length");
+ int64_t r1, r2;
+ int rc;
+
+ conn->mg_conn.status_code = !stat(path, &st) ? 200 : 201;
+ if ((rc = put_dir(path)) == 0) {
+ mg_printf(&conn->mg_conn, "HTTP/1.1 %d OK\r\n\r\n",
+ conn->mg_conn.status_code);
+ close_local_endpoint(conn);
+ } else if (rc == -1) {
+ send_http_error(conn, 500, "put_dir: %s", strerror(errno));
+ } else if (cl_hdr == NULL) {
+ send_http_error(conn, 411, NULL);
#ifdef _WIN32
- //On Windows, open() is a macro with 2 params
- } else if ((conn->endpoint.fd =
- open(path, O_RDWR | O_CREAT | O_TRUNC)) < 0) {
+ //On Windows, open() is a macro with 2 params
+ } else if ((conn->endpoint.fd =
+ open(path, O_RDWR | O_CREAT | O_TRUNC)) < 0) {
#else
- } else if ((conn->endpoint.fd =
- open(path, O_RDWR | O_CREAT | O_TRUNC, 0644)) < 0) {
+ } else if ((conn->endpoint.fd =
+ open(path, O_RDWR | O_CREAT | O_TRUNC, 0644)) < 0) {
#endif
- send_http_error(conn, 500, "open(%s): %s", path, strerror(errno));
- } else {
- DBG(("PUT [%s] %lu", path, (unsigned long) conn->ns_conn->recv_iobuf.len));
- conn->endpoint_type = EP_PUT;
- ns_set_close_on_exec(conn->endpoint.fd);
- range = mg_get_header(&conn->mg_conn, "Content-Range");
- conn->cl = to64(cl_hdr);
- r1 = r2 = 0;
- if (range != NULL && parse_range_header(range, &r1, &r2) > 0) {
- conn->mg_conn.status_code = 206;
- lseek(conn->endpoint.fd, r1, SEEK_SET);
- conn->cl = r2 > r1 ? r2 - r1 + 1: conn->cl - r1;
- }
- mg_printf(&conn->mg_conn, "HTTP/1.1 %d OK\r\nContent-Length: 0\r\n\r\n",
- conn->mg_conn.status_code);
- }
+ send_http_error(conn, 500, "open(%s): %s", path, strerror(errno));
+ } else {
+ DBG(("PUT [%s] %lu", path, (unsigned long) conn->ns_conn->recv_iobuf.len));
+ conn->endpoint_type = EP_PUT;
+ ns_set_close_on_exec(conn->endpoint.fd);
+ range = mg_get_header(&conn->mg_conn, "Content-Range");
+ conn->cl = to64(cl_hdr);
+ r1 = r2 = 0;
+ if (range != NULL && parse_range_header(range, &r1, &r2) > 0) {
+ conn->mg_conn.status_code = 206;
+ lseek(conn->endpoint.fd, r1, SEEK_SET);
+ conn->cl = r2 > r1 ? r2 - r1 + 1: conn->cl - r1;
+ }
+ mg_printf(&conn->mg_conn, "HTTP/1.1 %d OK\r\nContent-Length: 0\r\n\r\n",
+ conn->mg_conn.status_code);
+ }
}
static void forward_put_data(struct connection *conn) {
- struct iobuf *io = &conn->ns_conn->recv_iobuf;
- size_t k = conn->cl < (int64_t) io->len ? conn->cl : (int64_t) io->len; // To write
- int n = write(conn->endpoint.fd, io->buf, k); // Write them!
- if (n > 0) {
- iobuf_remove(io, n);
- conn->cl -= n;
- }
- if (conn->cl <= 0) {
- close_local_endpoint(conn);
- }
+ struct iobuf *io = &conn->ns_conn->recv_iobuf;
+ size_t k = conn->cl < (int64_t) io->len ? conn->cl : (int64_t) io->len; // To write
+ int n = write(conn->endpoint.fd, io->buf, k); // Write them!
+ if (n > 0) {
+ iobuf_remove(io, n);
+ conn->cl -= n;
+ }
+ if (conn->cl <= 0) {
+ close_local_endpoint(conn);
+ }
}
#endif // MONGOOSE_NO_DAV
static void send_options(struct connection *conn) {
- conn->mg_conn.status_code = 200;
- mg_printf(&conn->mg_conn, "%s",
- "HTTP/1.1 200 OK\r\nAllow: GET, POST, HEAD, CONNECT, PUT, "
- "DELETE, OPTIONS, PROPFIND, MKCOL\r\nDAV: 1\r\n\r\n");
- close_local_endpoint(conn);
+ conn->mg_conn.status_code = 200;
+ mg_printf(&conn->mg_conn, "%s",
+ "HTTP/1.1 200 OK\r\nAllow: GET, POST, HEAD, CONNECT, PUT, "
+ "DELETE, OPTIONS, PROPFIND, MKCOL\r\nDAV: 1\r\n\r\n");
+ close_local_endpoint(conn);
}
#ifndef MONGOOSE_NO_AUTH
void mg_send_digest_auth_request(struct mg_connection *c) {
- struct connection *conn = MG_CONN_2_CONN(c);
- c->status_code = 401;
- mg_printf(c,
- "HTTP/1.1 401 Unauthorized\r\n"
- "WWW-Authenticate: Digest qop=\"auth\", "
- "realm=\"%s\", nonce=\"%lu\"\r\n\r\n",
- conn->server->config_options[AUTH_DOMAIN],
- (unsigned long) time(NULL));
- close_local_endpoint(conn);
+ struct connection *conn = MG_CONN_2_CONN(c);
+ c->status_code = 401;
+ mg_printf(c,
+ "HTTP/1.1 401 Unauthorized\r\n"
+ "WWW-Authenticate: Digest qop=\"auth\", "
+ "realm=\"%s\", nonce=\"%lu\"\r\n\r\n",
+ conn->server->config_options[AUTH_DOMAIN],
+ (unsigned long) time(NULL));
+ close_local_endpoint(conn);
}
// Use the global passwords file, if specified by auth_gpass option,
// or search for .htpasswd in the requested directory.
static FILE *open_auth_file(struct connection *conn, const char *path,
- int is_directory) {
- char name[MAX_PATH_SIZE];
- const char *p, *gpass = conn->server->config_options[GLOBAL_AUTH_FILE];
- FILE *fp = NULL;
-
- if (gpass != NULL) {
- // Use global passwords file
- fp = fopen(gpass, "r");
- } else if (is_directory) {
- mg_snprintf(name, sizeof(name), "%s%c%s", path, '/', PASSWORDS_FILE_NAME);
- fp = fopen(name, "r");
- } else {
- // Try to find .htpasswd in requested directory.
- if ((p = strrchr(path, '/')) == NULL) p = path;
- mg_snprintf(name, sizeof(name), "%.*s%c%s",
- (int) (p - path), path, '/', PASSWORDS_FILE_NAME);
- fp = fopen(name, "r");
- }
-
- return fp;
+ int is_directory) {
+ char name[MAX_PATH_SIZE];
+ const char *p, *gpass = conn->server->config_options[GLOBAL_AUTH_FILE];
+ FILE *fp = NULL;
+
+ if (gpass != NULL) {
+ // Use global passwords file
+ fp = fopen(gpass, "r");
+ } else if (is_directory) {
+ mg_snprintf(name, sizeof(name), "%s%c%s", path, '/', PASSWORDS_FILE_NAME);
+ fp = fopen(name, "r");
+ } else {
+ // Try to find .htpasswd in requested directory.
+ if ((p = strrchr(path, '/')) == NULL) p = path;
+ mg_snprintf(name, sizeof(name), "%.*s%c%s",
+ (int) (p - path), path, '/', PASSWORDS_FILE_NAME);
+ fp = fopen(name, "r");
+ }
+
+ return fp;
}
#if !defined(HAVE_MD5) && !defined(MONGOOSE_NO_AUTH)
typedef struct MD5Context {
- uint32_t buf[4];
- uint32_t bits[2];
- unsigned char in[64];
+ uint32_t buf[4];
+ uint32_t bits[2];
+ unsigned char in[64];
} MD5_CTX;
static void byteReverse(unsigned char *buf, unsigned longs) {
- uint32_t t;
+ uint32_t t;
- // Forrest: MD5 expect LITTLE_ENDIAN, swap if BIG_ENDIAN
- if (is_big_endian()) {
- do {
- t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
- ((unsigned) buf[1] << 8 | buf[0]);
- * (uint32_t *) buf = t;
- buf += 4;
- } while (--longs);
- }
+ // Forrest: MD5 expect LITTLE_ENDIAN, swap if BIG_ENDIAN
+ if (is_big_endian()) {
+ do {
+ t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+ ((unsigned) buf[1] << 8 | buf[0]);
+ * (uint32_t *) buf = t;
+ buf += 4;
+ } while (--longs);
+ }
}
#define F1(x, y, z) (z ^ (x & (y ^ z)))
@@ -3648,166 +3646,166 @@ static void byteReverse(unsigned char *buf, unsigned longs) {
#define F4(x, y, z) (y ^ (x | ~z))
#define MD5STEP(f, w, x, y, z, data, s) \
- ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
+ ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
// Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
// initialization constants.
static void MD5Init(MD5_CTX *ctx) {
- ctx->buf[0] = 0x67452301;
- ctx->buf[1] = 0xefcdab89;
- ctx->buf[2] = 0x98badcfe;
- ctx->buf[3] = 0x10325476;
+ ctx->buf[0] = 0x67452301;
+ ctx->buf[1] = 0xefcdab89;
+ ctx->buf[2] = 0x98badcfe;
+ ctx->buf[3] = 0x10325476;
- ctx->bits[0] = 0;
- ctx->bits[1] = 0;
+ ctx->bits[0] = 0;
+ ctx->bits[1] = 0;
}
static void MD5Transform(uint32_t buf[4], uint32_t const in[16]) {
- register uint32_t a, b, c, d;
-
- a = buf[0];
- b = buf[1];
- c = buf[2];
- d = buf[3];
-
- MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
- MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
- MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
- MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
- MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
- MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
- MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
- MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
- MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
- MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
- MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
- MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
- MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
- MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
- MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
- MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
-
- MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
- MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
- MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
- MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
- MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
- MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
- MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
- MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
- MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
- MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
- MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
- MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
- MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
- MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
- MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
- MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
-
- MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
- MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
- MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
- MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
- MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
- MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
- MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
- MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
- MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
- MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
- MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
- MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
- MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
- MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
- MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
- MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
-
- MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
- MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
- MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
- MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
- MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
- MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
- MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
- MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
- MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
- MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
- MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
- MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
- MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
- MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
- MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
- MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
-
- buf[0] += a;
- buf[1] += b;
- buf[2] += c;
- buf[3] += d;
+ register uint32_t a, b, c, d;
+
+ a = buf[0];
+ b = buf[1];
+ c = buf[2];
+ d = buf[3];
+
+ MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+ MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+ MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
+ MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+ MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+ MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+ MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
+ MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
+ MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
+ MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+ MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+ MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+ MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
+ MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
+ MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
+ MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+ MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+ MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
+ MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+ MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+ MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+ MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
+ MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+ MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+ MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+ MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+ MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+ MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+ MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+ MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+ MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+ MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+ MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+ MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
+ MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+ MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+ MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+ MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+ MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+ MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+ MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+ MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+ MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+ MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
+ MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+ MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+ MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+ MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+ MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
+ MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
+ MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+ MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+ MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+ MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+ MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+ MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+ MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+ MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+ MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
+ MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+ MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+ MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+ MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+ MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+ buf[0] += a;
+ buf[1] += b;
+ buf[2] += c;
+ buf[3] += d;
}
static void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len) {
- uint32_t t;
+ uint32_t t;
- t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
- ctx->bits[1]++;
- ctx->bits[1] += len >> 29;
+ t = ctx->bits[0];
+ if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
+ ctx->bits[1]++;
+ ctx->bits[1] += len >> 29;
- t = (t >> 3) & 0x3f;
+ t = (t >> 3) & 0x3f;
- if (t) {
- unsigned char *p = (unsigned char *) ctx->in + t;
+ if (t) {
+ unsigned char *p = (unsigned char *) ctx->in + t;
- t = 64 - t;
- if (len < t) {
- memcpy(p, buf, len);
- return;
- }
- memcpy(p, buf, t);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32_t *) ctx->in);
- buf += t;
- len -= t;
- }
+ t = 64 - t;
+ if (len < t) {
+ memcpy(p, buf, len);
+ return;
+ }
+ memcpy(p, buf, t);
+ byteReverse(ctx->in, 16);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+ buf += t;
+ len -= t;
+ }
- while (len >= 64) {
- memcpy(ctx->in, buf, 64);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32_t *) ctx->in);
- buf += 64;
- len -= 64;
- }
+ while (len >= 64) {
+ memcpy(ctx->in, buf, 64);
+ byteReverse(ctx->in, 16);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+ buf += 64;
+ len -= 64;
+ }
- memcpy(ctx->in, buf, len);
+ memcpy(ctx->in, buf, len);
}
static void MD5Final(unsigned char digest[16], MD5_CTX *ctx) {
- unsigned count;
- unsigned char *p;
- uint32_t *a;
-
- count = (ctx->bits[0] >> 3) & 0x3F;
-
- p = ctx->in + count;
- *p++ = 0x80;
- count = 64 - 1 - count;
- if (count < 8) {
- memset(p, 0, count);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32_t *) ctx->in);
- memset(ctx->in, 0, 56);
- } else {
- memset(p, 0, count - 8);
- }
- byteReverse(ctx->in, 14);
-
- a = (uint32_t *)ctx->in;
- a[14] = ctx->bits[0];
- a[15] = ctx->bits[1];
-
- MD5Transform(ctx->buf, (uint32_t *) ctx->in);
- byteReverse((unsigned char *) ctx->buf, 4);
- memcpy(digest, ctx->buf, 16);
- memset((char *) ctx, 0, sizeof(*ctx));
+ unsigned count;
+ unsigned char *p;
+ uint32_t *a;
+
+ count = (ctx->bits[0] >> 3) & 0x3F;
+
+ p = ctx->in + count;
+ *p++ = 0x80;
+ count = 64 - 1 - count;
+ if (count < 8) {
+ memset(p, 0, count);
+ byteReverse(ctx->in, 16);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+ memset(ctx->in, 0, 56);
+ } else {
+ memset(p, 0, count - 8);
+ }
+ byteReverse(ctx->in, 14);
+
+ a = (uint32_t *)ctx->in;
+ a[14] = ctx->bits[0];
+ a[15] = ctx->bits[1];
+
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+ byteReverse((unsigned char *) ctx->buf, 4);
+ memcpy(digest, ctx->buf, 16);
+ memset((char *) ctx, 0, sizeof(*ctx));
}
#endif // !HAVE_MD5
@@ -3816,1340 +3814,1339 @@ static void MD5Final(unsigned char digest[16], MD5_CTX *ctx) {
// Stringify binary data. Output buffer must be twice as big as input,
// because each byte takes 2 bytes in string representation
static void bin2str(char *to, const unsigned char *p, size_t len) {
- static const char *hex = "0123456789abcdef";
+ static const char *hex = "0123456789abcdef";
- for (; len--; p++) {
- *to++ = hex[p[0] >> 4];
- *to++ = hex[p[0] & 0x0f];
- }
- *to = '\0';
+ for (; len--; p++) {
+ *to++ = hex[p[0] >> 4];
+ *to++ = hex[p[0] & 0x0f];
+ }
+ *to = '\0';
}
// Return stringified MD5 hash for list of strings. Buffer must be 33 bytes.
char *mg_md5(char buf[33], ...) {
- unsigned char hash[16];
- const char *p;
- va_list ap;
- MD5_CTX ctx;
+ unsigned char hash[16];
+ const char *p;
+ va_list ap;
+ MD5_CTX ctx;
- MD5Init(&ctx);
+ MD5Init(&ctx);
- va_start(ap, buf);
- while ((p = va_arg(ap, const char *)) != NULL) {
- MD5Update(&ctx, (const unsigned char *) p, (unsigned) strlen(p));
- }
- va_end(ap);
+ va_start(ap, buf);
+ while ((p = va_arg(ap, const char *)) != NULL) {
+ MD5Update(&ctx, (const unsigned char *) p, (unsigned) strlen(p));
+ }
+ va_end(ap);
- MD5Final(hash, &ctx);
- bin2str(buf, hash, sizeof(hash));
- return buf;
+ MD5Final(hash, &ctx);
+ bin2str(buf, hash, sizeof(hash));
+ return buf;
}
// Check the user's password, return 1 if OK
static int check_password(const char *method, const char *ha1, const char *uri,
- const char *nonce, const char *nc, const char *cnonce,
- const char *qop, const char *response) {
- char ha2[32 + 1], expected_response[32 + 1];
+ const char *nonce, const char *nc, const char *cnonce,
+ const char *qop, const char *response) {
+ char ha2[32 + 1], expected_response[32 + 1];
#if 0
- // Check for authentication timeout
- if ((unsigned long) time(NULL) - (unsigned long) to64(nonce) > 3600 * 2) {
- return 0;
- }
+ // Check for authentication timeout
+ if ((unsigned long) time(NULL) - (unsigned long) to64(nonce) > 3600 * 2) {
+ return 0;
+ }
#endif
- mg_md5(ha2, method, ":", uri, NULL);
- mg_md5(expected_response, ha1, ":", nonce, ":", nc,
- ":", cnonce, ":", qop, ":", ha2, NULL);
+ mg_md5(ha2, method, ":", uri, NULL);
+ mg_md5(expected_response, ha1, ":", nonce, ":", nc,
+ ":", cnonce, ":", qop, ":", ha2, NULL);
- return mg_strcasecmp(response, expected_response) == 0 ? MG_TRUE : MG_FALSE;
+ return mg_strcasecmp(response, expected_response) == 0 ? MG_TRUE : MG_FALSE;
}
// Authorize against the opened passwords file. Return 1 if authorized.
int mg_authorize_digest(struct mg_connection *c, FILE *fp) {
- struct connection *conn = MG_CONN_2_CONN(c);
- const char *hdr;
- char line[256], f_user[256], ha1[256], f_domain[256], user[100], nonce[100],
- uri[MAX_REQUEST_SIZE], cnonce[100], resp[100], qop[100], nc[100];
-
- if (c == NULL || fp == NULL) return 0;
- if ((hdr = mg_get_header(c, "Authorization")) == NULL ||
- mg_strncasecmp(hdr, "Digest ", 7) != 0) return 0;
- if (!mg_parse_header(hdr, "username", user, sizeof(user))) return 0;
- if (!mg_parse_header(hdr, "cnonce", cnonce, sizeof(cnonce))) return 0;
- if (!mg_parse_header(hdr, "response", resp, sizeof(resp))) return 0;
- if (!mg_parse_header(hdr, "uri", uri, sizeof(uri))) return 0;
- if (!mg_parse_header(hdr, "qop", qop, sizeof(qop))) return 0;
- if (!mg_parse_header(hdr, "nc", nc, sizeof(nc))) return 0;
- if (!mg_parse_header(hdr, "nonce", nonce, sizeof(nonce))) return 0;
-
- while (fgets(line, sizeof(line), fp) != NULL) {
- if (sscanf(line, "%[^:]:%[^:]:%s", f_user, f_domain, ha1) == 3 &&
- !strcmp(user, f_user) &&
- // NOTE(lsm): due to a bug in MSIE, we do not compare URIs
- !strcmp(conn->server->config_options[AUTH_DOMAIN], f_domain))
- return check_password(c->request_method, ha1, uri,
- nonce, nc, cnonce, qop, resp);
- }
- return MG_FALSE;
+ struct connection *conn = MG_CONN_2_CONN(c);
+ const char *hdr;
+ char line[256], f_user[256], ha1[256], f_domain[256], user[100], nonce[100],
+ uri[MAX_REQUEST_SIZE], cnonce[100], resp[100], qop[100], nc[100];
+
+ if (c == NULL || fp == NULL) return 0;
+ if ((hdr = mg_get_header(c, "Authorization")) == NULL ||
+ mg_strncasecmp(hdr, "Digest ", 7) != 0) return 0;
+ if (!mg_parse_header(hdr, "username", user, sizeof(user))) return 0;
+ if (!mg_parse_header(hdr, "cnonce", cnonce, sizeof(cnonce))) return 0;
+ if (!mg_parse_header(hdr, "response", resp, sizeof(resp))) return 0;
+ if (!mg_parse_header(hdr, "uri", uri, sizeof(uri))) return 0;
+ if (!mg_parse_header(hdr, "qop", qop, sizeof(qop))) return 0;
+ if (!mg_parse_header(hdr, "nc", nc, sizeof(nc))) return 0;
+ if (!mg_parse_header(hdr, "nonce", nonce, sizeof(nonce))) return 0;
+
+ while (fgets(line, sizeof(line), fp) != NULL) {
+ if (sscanf(line, "%[^:]:%[^:]:%s", f_user, f_domain, ha1) == 3 &&
+ !strcmp(user, f_user) &&
+ // NOTE(lsm): due to a bug in MSIE, we do not compare URIs
+ !strcmp(conn->server->config_options[AUTH_DOMAIN], f_domain))
+ return check_password(c->request_method, ha1, uri,
+ nonce, nc, cnonce, qop, resp);
+ }
+ return MG_FALSE;
}
// Return 1 if request is authorised, 0 otherwise.
static int is_authorized(struct connection *conn, const char *path,
- int is_directory) {
- FILE *fp;
- int authorized = MG_TRUE;
+ int is_directory) {
+ FILE *fp;
+ int authorized = MG_TRUE;
- if ((fp = open_auth_file(conn, path, is_directory)) != NULL) {
- authorized = mg_authorize_digest(&conn->mg_conn, fp);
- fclose(fp);
- }
+ if ((fp = open_auth_file(conn, path, is_directory)) != NULL) {
+ authorized = mg_authorize_digest(&conn->mg_conn, fp);
+ fclose(fp);
+ }
- return authorized;
+ return authorized;
}
static int is_authorized_for_dav(struct connection *conn) {
- const char *auth_file = conn->server->config_options[DAV_AUTH_FILE];
- const char *method = conn->mg_conn.request_method;
- FILE *fp;
- int authorized = MG_FALSE;
+ const char *auth_file = conn->server->config_options[DAV_AUTH_FILE];
+ const char *method = conn->mg_conn.request_method;
+ FILE *fp;
+ int authorized = MG_FALSE;
- // If dav_auth_file is not set, allow non-authorized PROPFIND
- if (method != NULL && !strcmp(method, "PROPFIND") && auth_file == NULL) {
- authorized = MG_TRUE;
- } else if (auth_file != NULL && (fp = fopen(auth_file, "r")) != NULL) {
- authorized = mg_authorize_digest(&conn->mg_conn, fp);
- fclose(fp);
- }
+ // If dav_auth_file is not set, allow non-authorized PROPFIND
+ if (method != NULL && !strcmp(method, "PROPFIND") && auth_file == NULL) {
+ authorized = MG_TRUE;
+ } else if (auth_file != NULL && (fp = fopen(auth_file, "r")) != NULL) {
+ authorized = mg_authorize_digest(&conn->mg_conn, fp);
+ fclose(fp);
+ }
- return authorized;
+ return authorized;
}
static int is_dav_request(const struct connection *conn) {
- const char *s = conn->mg_conn.request_method;
- return !strcmp(s, "PUT") || !strcmp(s, "DELETE") ||
- !strcmp(s, "MKCOL") || !strcmp(s, "PROPFIND");
+ const char *s = conn->mg_conn.request_method;
+ return !strcmp(s, "PUT") || !strcmp(s, "DELETE") ||
+ !strcmp(s, "MKCOL") || !strcmp(s, "PROPFIND");
}
#endif // MONGOOSE_NO_AUTH
static int parse_header(const char *str, int str_len, const char *var_name,
- char *buf, size_t buf_size) {
- int ch = ' ', len = 0, n = strlen(var_name);
- const char *p, *end = str + str_len, *s = NULL;
-
- if (buf != NULL && buf_size > 0) buf[0] = '\0';
-
- // Find where variable starts
- for (s = str; s != NULL && s + n < end; s++) {
- if ((s == str || s[-1] == ' ' || s[-1] == ',') && s[n] == '=' &&
- !memcmp(s, var_name, n)) break;
- }
-
- if (s != NULL && &s[n + 1] < end) {
- s += n + 1;
- if (*s == '"' || *s == '\'') ch = *s++;
- p = s;
- while (p < end && p[0] != ch && p[0] != ',' && len < (int) buf_size) {
- if (p[0] == '\\' && p[1] == ch) p++;
- buf[len++] = *p++;
- }
- if (len >= (int) buf_size || (ch != ' ' && *p != ch)) {
- len = 0;
- } else {
- if (len > 0 && s[len - 1] == ',') len--;
- if (len > 0 && s[len - 1] == ';') len--;
- buf[len] = '\0';
- }
- }
-
- return len;
+ char *buf, size_t buf_size) {
+ int ch = ' ', len = 0, n = strlen(var_name);
+ const char *p, *end = str + str_len, *s = NULL;
+
+ if (buf != NULL && buf_size > 0) buf[0] = '\0';
+
+ // Find where variable starts
+ for (s = str; s != NULL && s + n < end; s++) {
+ if ((s == str || s[-1] == ' ' || s[-1] == ',') && s[n] == '=' &&
+ !memcmp(s, var_name, n)) break;
+ }
+
+ if (s != NULL && &s[n + 1] < end) {
+ s += n + 1;
+ if (*s == '"' || *s == '\'') ch = *s++;
+ p = s;
+ while (p < end && p[0] != ch && p[0] != ',' && len < (int) buf_size) {
+ if (p[0] == '\\' && p[1] == ch) p++;
+ buf[len++] = *p++;
+ }
+ if (len >= (int) buf_size || (ch != ' ' && *p != ch)) {
+ len = 0;
+ } else {
+ if (len > 0 && s[len - 1] == ',') len--;
+ if (len > 0 && s[len - 1] == ';') len--;
+ buf[len] = '\0';
+ }
+ }
+
+ return len;
}
int mg_parse_header(const char *s, const char *var_name, char *buf,
- size_t buf_size) {
- return parse_header(s, s == NULL ? 0 : strlen(s), var_name, buf, buf_size);
+ size_t buf_size) {
+ return parse_header(s, s == NULL ? 0 : strlen(s), var_name, buf, buf_size);
}
#ifndef MONGOOSE_NO_SSI
static void send_ssi_file(struct mg_connection *, const char *, FILE *, int);
static void send_file_data(struct mg_connection *conn, FILE *fp) {
- char buf[IOBUF_SIZE];
- int n;
- while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) {
- mg_write(conn, buf, n);
- }
+ char buf[IOBUF_SIZE];
+ int n;
+ while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) {
+ mg_write(conn, buf, n);
+ }
}
static void do_ssi_include(struct mg_connection *conn, const char *ssi,
- char *tag, int include_level) {
- char file_name[IOBUF_SIZE], path[MAX_PATH_SIZE], *p;
- char **opts = (MG_CONN_2_CONN(conn))->server->config_options;
- FILE *fp;
-
- // sscanf() is safe here, since send_ssi_file() also uses buffer
- // of size MG_BUF_LEN to get the tag. So strlen(tag) is always < MG_BUF_LEN.
- if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) {
- // File name is relative to the webserver root
- mg_snprintf(path, sizeof(path), "%s%c%s",
- opts[DOCUMENT_ROOT], '/', file_name);
- } else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
- // File name is relative to the webserver working directory
- // or it is absolute system path
- mg_snprintf(path, sizeof(path), "%s", file_name);
- } else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
- sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
- // File name is relative to the currect document
- mg_snprintf(path, sizeof(path), "%s", ssi);
- if ((p = strrchr(path, '/')) != NULL) {
- p[1] = '\0';
- }
- mg_snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s",
- file_name);
- } else {
- mg_printf(conn, "Bad SSI #include: [%s]", tag);
- return;
- }
-
- if ((fp = fopen(path, "rb")) == NULL) {
- mg_printf(conn, "Cannot open SSI #include: [%s]: fopen(%s): %s",
- tag, path, strerror(errno));
- } else {
- ns_set_close_on_exec(fileno(fp));
- if (mg_match_prefix(opts[SSI_PATTERN], strlen(opts[SSI_PATTERN]),
- path) > 0) {
- send_ssi_file(conn, path, fp, include_level + 1);
- } else {
- send_file_data(conn, fp);
- }
- fclose(fp);
- }
+ char *tag, int include_level) {
+ char file_name[IOBUF_SIZE], path[MAX_PATH_SIZE], *p;
+ char **opts = (MG_CONN_2_CONN(conn))->server->config_options;
+ FILE *fp;
+
+ // sscanf() is safe here, since send_ssi_file() also uses buffer
+ // of size MG_BUF_LEN to get the tag. So strlen(tag) is always < MG_BUF_LEN.
+ if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) {
+ // File name is relative to the webserver root
+ mg_snprintf(path, sizeof(path), "%s%c%s",
+ opts[DOCUMENT_ROOT], '/', file_name);
+ } else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
+ // File name is relative to the webserver working directory
+ // or it is absolute system path
+ mg_snprintf(path, sizeof(path), "%s", file_name);
+ } else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
+ sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
+ // File name is relative to the currect document
+ mg_snprintf(path, sizeof(path), "%s", ssi);
+ if ((p = strrchr(path, '/')) != NULL) {
+ p[1] = '\0';
+ }
+ mg_snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s",
+ file_name);
+ } else {
+ mg_printf(conn, "Bad SSI #include: [%s]", tag);
+ return;
+ }
+
+ if ((fp = fopen(path, "rb")) == NULL) {
+ mg_printf(conn, "Cannot open SSI #include: [%s]: fopen(%s): %s",
+ tag, path, strerror(errno));
+ } else {
+ ns_set_close_on_exec(fileno(fp));
+ if (mg_match_prefix(opts[SSI_PATTERN], strlen(opts[SSI_PATTERN]),
+ path) > 0) {
+ send_ssi_file(conn, path, fp, include_level + 1);
+ } else {
+ send_file_data(conn, fp);
+ }
+ fclose(fp);
+ }
}
#ifndef MONGOOSE_NO_POPEN
static void do_ssi_exec(struct mg_connection *conn, char *tag) {
- char cmd[IOBUF_SIZE];
- FILE *fp;
-
- if (sscanf(tag, " \"%[^\"]\"", cmd) != 1) {
- mg_printf(conn, "Bad SSI #exec: [%s]", tag);
- } else if ((fp = popen(cmd, "r")) == NULL) {
- mg_printf(conn, "Cannot SSI #exec: [%s]: %s", cmd, strerror(errno));
- } else {
- send_file_data(conn, fp);
- pclose(fp);
- }
+ char cmd[IOBUF_SIZE];
+ FILE *fp;
+
+ if (sscanf(tag, " \"%[^\"]\"", cmd) != 1) {
+ mg_printf(conn, "Bad SSI #exec: [%s]", tag);
+ } else if ((fp = popen(cmd, "r")) == NULL) {
+ mg_printf(conn, "Cannot SSI #exec: [%s]: %s", cmd, strerror(errno));
+ } else {
+ send_file_data(conn, fp);
+ pclose(fp);
+ }
}
#endif // !MONGOOSE_NO_POPEN
static void send_ssi_file(struct mg_connection *conn, const char *path,
- FILE *fp, int include_level) {
- char buf[IOBUF_SIZE];
- int ch, offset, len, in_ssi_tag;
-
- if (include_level > 10) {
- mg_printf(conn, "SSI #include level is too deep (%s)", path);
- return;
- }
-
- in_ssi_tag = len = offset = 0;
- while ((ch = fgetc(fp)) != EOF) {
- if (in_ssi_tag && ch == '>') {
- in_ssi_tag = 0;
- buf[len++] = (char) ch;
- buf[len] = '\0';
- assert(len <= (int) sizeof(buf));
- if (len < 6 || memcmp(buf, "<!--#", 5) != 0) {
- // Not an SSI tag, pass it
- (void) mg_write(conn, buf, (size_t) len);
- } else {
- if (!memcmp(buf + 5, "include", 7)) {
- do_ssi_include(conn, path, buf + 12, include_level);
+ FILE *fp, int include_level) {
+ char buf[IOBUF_SIZE];
+ int ch, offset, len, in_ssi_tag;
+
+ if (include_level > 10) {
+ mg_printf(conn, "SSI #include level is too deep (%s)", path);
+ return;
+ }
+
+ in_ssi_tag = len = offset = 0;
+ while ((ch = fgetc(fp)) != EOF) {
+ if (in_ssi_tag && ch == '>') {
+ in_ssi_tag = 0;
+ buf[len++] = (char) ch;
+ buf[len] = '\0';
+ assert(len <= (int) sizeof(buf));
+ if (len < 6 || memcmp(buf, "<!--#", 5) != 0) {
+ // Not an SSI tag, pass it
+ (void) mg_write(conn, buf, (size_t) len);
+ } else {
+ if (!memcmp(buf + 5, "include", 7)) {
+ do_ssi_include(conn, path, buf + 12, include_level);
#if !defined(MONGOOSE_NO_POPEN)
- } else if (!memcmp(buf + 5, "exec", 4)) {
- do_ssi_exec(conn, buf + 9);
+ } else if (!memcmp(buf + 5, "exec", 4)) {
+ do_ssi_exec(conn, buf + 9);
#endif // !NO_POPEN
- } else {
- mg_printf(conn, "%s: unknown SSI " "command: \"%s\"", path, buf);
- }
- }
- len = 0;
- } else if (in_ssi_tag) {
- if (len == 5 && memcmp(buf, "<!--#", 5) != 0) {
- // Not an SSI tag
- in_ssi_tag = 0;
- } else if (len == (int) sizeof(buf) - 2) {
- mg_printf(conn, "%s: SSI tag is too large", path);
- len = 0;
- }
- buf[len++] = ch & 0xff;
- } else if (ch == '<') {
- in_ssi_tag = 1;
- if (len > 0) {
- mg_write(conn, buf, (size_t) len);
- }
- len = 0;
- buf[len++] = ch & 0xff;
- } else {
- buf[len++] = ch & 0xff;
- if (len == (int) sizeof(buf)) {
- mg_write(conn, buf, (size_t) len);
- len = 0;
- }
- }
- }
-
- // Send the rest of buffered data
- if (len > 0) {
- mg_write(conn, buf, (size_t) len);
- }
+ } else {
+ mg_printf(conn, "%s: unknown SSI " "command: \"%s\"", path, buf);
+ }
+ }
+ len = 0;
+ } else if (in_ssi_tag) {
+ if (len == 5 && memcmp(buf, "<!--#", 5) != 0) {
+ // Not an SSI tag
+ in_ssi_tag = 0;
+ } else if (len == (int) sizeof(buf) - 2) {
+ mg_printf(conn, "%s: SSI tag is too large", path);
+ len = 0;
+ }
+ buf[len++] = ch & 0xff;
+ } else if (ch == '<') {
+ in_ssi_tag = 1;
+ if (len > 0) {
+ mg_write(conn, buf, (size_t) len);
+ }
+ len = 0;
+ buf[len++] = ch & 0xff;
+ } else {
+ buf[len++] = ch & 0xff;
+ if (len == (int) sizeof(buf)) {
+ mg_write(conn, buf, (size_t) len);
+ len = 0;
+ }
+ }
+ }
+
+ // Send the rest of buffered data
+ if (len > 0) {
+ mg_write(conn, buf, (size_t) len);
+ }
}
static void handle_ssi_request(struct connection *conn, const char *path) {
- FILE *fp;
- struct vec mime_vec;
-
- if ((fp = fopen(path, "rb")) == NULL) {
- send_http_error(conn, 500, "fopen(%s): %s", path, strerror(errno));
- } else {
- ns_set_close_on_exec(fileno(fp));
- get_mime_type(conn->server, path, &mime_vec);
- conn->mg_conn.status_code = 200;
- mg_printf(&conn->mg_conn,
- "HTTP/1.1 %d OK\r\n"
- "Content-Type: %.*s\r\n"
- "Connection: close\r\n\r\n",
- conn->mg_conn.status_code, (int) mime_vec.len, mime_vec.ptr);
- send_ssi_file(&conn->mg_conn, path, fp, 0);
- fclose(fp);
- close_local_endpoint(conn);
- }
+ FILE *fp;
+ struct vec mime_vec;
+
+ if ((fp = fopen(path, "rb")) == NULL) {
+ send_http_error(conn, 500, "fopen(%s): %s", path, strerror(errno));
+ } else {
+ ns_set_close_on_exec(fileno(fp));
+ get_mime_type(conn->server, path, &mime_vec);
+ conn->mg_conn.status_code = 200;
+ mg_printf(&conn->mg_conn,
+ "HTTP/1.1 %d OK\r\n"
+ "Content-Type: %.*s\r\n"
+ "Connection: close\r\n\r\n",
+ conn->mg_conn.status_code, (int) mime_vec.len, mime_vec.ptr);
+ send_ssi_file(&conn->mg_conn, path, fp, 0);
+ fclose(fp);
+ close_local_endpoint(conn);
+ }
}
#endif
static void proxy_request(struct ns_connection *pc, struct mg_connection *c) {
- int i, sent_close_header = 0;
-
- ns_printf(pc, "%s %s HTTP/%s\r\n", c->request_method, c->uri,
- c->http_version);
- for (i = 0; i < c->num_headers; i++) {
- if (mg_strcasecmp(c->http_headers[i].name, "Connection") == 0) {
- // Force connection close, cause we don't parse proxy replies
- // therefore we don't know message boundaries
- ns_printf(pc, "%s: %s\r\n", "Connection", "close");
- sent_close_header = 1;
- } else {
- ns_printf(pc, "%s: %s\r\n", c->http_headers[i].name,
- c->http_headers[i].value);
- }
- }
- if (!sent_close_header) {
- ns_printf(pc, "%s: %s\r\n", "Connection", "close");
- }
- ns_printf(pc, "%s", "\r\n");
- ns_send(pc, c->content, c->content_len);
+ int i, sent_close_header = 0;
+
+ ns_printf(pc, "%s %s HTTP/%s\r\n", c->request_method, c->uri,
+ c->http_version);
+ for (i = 0; i < c->num_headers; i++) {
+ if (mg_strcasecmp(c->http_headers[i].name, "Connection") == 0) {
+ // Force connection close, cause we don't parse proxy replies
+ // therefore we don't know message boundaries
+ ns_printf(pc, "%s: %s\r\n", "Connection", "close");
+ sent_close_header = 1;
+ } else {
+ ns_printf(pc, "%s: %s\r\n", c->http_headers[i].name,
+ c->http_headers[i].value);
+ }
+ }
+ if (!sent_close_header) {
+ ns_printf(pc, "%s: %s\r\n", "Connection", "close");
+ }
+ ns_printf(pc, "%s", "\r\n");
+ ns_send(pc, c->content, c->content_len);
}
#ifdef NS_ENABLE_SSL
int mg_terminate_ssl(struct mg_connection *c, const char *cert) {
- static const char ok[] = "HTTP/1.0 200 OK\r\n\r\n";
- struct connection *conn = MG_CONN_2_CONN(c);
- SSL_CTX *ctx;
-
- DBG(("%p MITM", conn));
- SSL_library_init();
- if ((ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) return 0;
-
- SSL_CTX_use_certificate_file(ctx, cert, 1);
- SSL_CTX_use_PrivateKey_file(ctx, cert, 1);
- SSL_CTX_use_certificate_chain_file(ctx, cert);
-
- // When clear-text reply is pushed to client, switch to SSL mode.
- // TODO(lsm): check for send() failure
- send(conn->ns_conn->sock, ok, sizeof(ok) - 1, 0);
- DBG(("%p %lu %d SEND", c, (unsigned long)sizeof(ok) - 1, n));
- conn->ns_conn->send_iobuf.len = 0;
- conn->endpoint_type = EP_USER; // To keep-alive in close_local_endpoint()
- close_local_endpoint(conn); // Clean up current CONNECT request
- if ((conn->ns_conn->ssl = SSL_new(ctx)) != NULL) {
- SSL_set_fd(conn->ns_conn->ssl, conn->ns_conn->sock);
- }
- SSL_CTX_free(ctx);
- return 1;
+ static const char ok[] = "HTTP/1.0 200 OK\r\n\r\n";
+ struct connection *conn = MG_CONN_2_CONN(c);
+ SSL_CTX *ctx;
+
+ DBG(("%p MITM", conn));
+ SSL_library_init();
+ if ((ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) return 0;
+
+ SSL_CTX_use_certificate_file(ctx, cert, 1);
+ SSL_CTX_use_PrivateKey_file(ctx, cert, 1);
+ SSL_CTX_use_certificate_chain_file(ctx, cert);
+
+ // When clear-text reply is pushed to client, switch to SSL mode.
+ // TODO(lsm): check for send() failure
+ send(conn->ns_conn->sock, ok, sizeof(ok) - 1, 0);
+ DBG(("%p %lu %d SEND", c, (unsigned long)sizeof(ok) - 1, n));
+ conn->ns_conn->send_iobuf.len = 0;
+ conn->endpoint_type = EP_USER; // To keep-alive in close_local_endpoint()
+ close_local_endpoint(conn); // Clean up current CONNECT request
+ if ((conn->ns_conn->ssl = SSL_new(ctx)) != NULL) {
+ SSL_set_fd(conn->ns_conn->ssl, conn->ns_conn->sock);
+ }
+ SSL_CTX_free(ctx);
+ return 1;
}
#endif
int mg_forward(struct mg_connection *c, const char *host, int port, int ssl) {
- struct connection *conn = MG_CONN_2_CONN(c);
- struct ns_server *server = &conn->server->ns_server;
- struct ns_connection *pc;
-
- if ((pc = ns_connect(server, host, port, ssl, conn)) == NULL) {
- conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
- return 0;
- }
-
- // Interlink two connections
- pc->flags |= MG_PROXY_CONN;
- conn->endpoint_type = EP_PROXY;
- conn->endpoint.nc = pc;
- DBG(("%p [%s] [%s:%d] -> %p %p",
- conn, c->uri, host, port, pc, conn->ns_conn->ssl));
-
- if (strcmp(c->request_method, "CONNECT") == 0) {
- // For CONNECT request, reply with 200 OK. Tunnel is established.
- mg_printf(c, "%s", "HTTP/1.1 200 OK\r\n\r\n");
- } else {
- // Strip "http://host:port" part from the URI
- if (memcmp(c->uri, "http://", 7) == 0) c->uri += 7;
- while (*c->uri != '\0' && *c->uri != '/') c->uri++;
- proxy_request(pc, c);
- }
- return 1;
+ struct connection *conn = MG_CONN_2_CONN(c);
+ struct ns_server *server = &conn->server->ns_server;
+ struct ns_connection *pc;
+
+ if ((pc = ns_connect(server, host, port, ssl, conn)) == NULL) {
+ conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ return 0;
+ }
+
+ // Interlink two connections
+ pc->flags |= MG_PROXY_CONN;
+ conn->endpoint_type = EP_PROXY;
+ conn->endpoint.nc = pc;
+ DBG(("%p [%s] [%s:%d] -> %p %p",
+ conn, c->uri, host, port, pc, conn->ns_conn->ssl));
+
+ if (strcmp(c->request_method, "CONNECT") == 0) {
+ // For CONNECT request, reply with 200 OK. Tunnel is established.
+ mg_printf(c, "%s", "HTTP/1.1 200 OK\r\n\r\n");
+ } else {
+ // Strip "http://host:port" part from the URI
+ if (memcmp(c->uri, "http://", 7) == 0) c->uri += 7;
+ while (*c->uri != '\0' && *c->uri != '/') c->uri++;
+ proxy_request(pc, c);
+ }
+ return 1;
}
static void proxify_connection(struct connection *conn) {
- char proto[10], host[500], cert[500];
- unsigned short port = 80;
- struct mg_connection *c = &conn->mg_conn;
- int n = 0;
- const char *url = c->uri;
-
- proto[0] = host[0] = cert[0] = '\0';
- if (sscanf(url, "%499[^: ]:%hu%n", host, &port, &n) != 2 &&
- sscanf(url, "%9[a-z]://%499[^: ]:%hu%n", proto, host, &port, &n) != 3 &&
- sscanf(url, "%9[a-z]://%499[^/ ]%n", proto, host, &n) != 2) {
- n = 0;
- }
+ char proto[10], host[500], cert[500];
+ unsigned short port = 80;
+ struct mg_connection *c = &conn->mg_conn;
+ int n = 0;
+ const char *url = c->uri;
+
+ proto[0] = host[0] = cert[0] = '\0';
+ if (sscanf(url, "%499[^: ]:%hu%n", host, &port, &n) != 2 &&
+ sscanf(url, "%9[a-z]://%499[^: ]:%hu%n", proto, host, &port, &n) != 3 &&
+ sscanf(url, "%9[a-z]://%499[^/ ]%n", proto, host, &n) != 2) {
+ n = 0;
+ }
#ifdef NS_ENABLE_SSL
- // Find out whether we should be in the MITM mode
- {
- const char *certs = conn->server->config_options[SSL_MITM_CERTS];
- int host_len = strlen(host);
- struct vec a, b;
-
- while (conn->ns_conn->ssl == NULL && port != 80 &&
- (certs = next_option(certs, &a, &b)) != NULL) {
- if (a.len != host_len || mg_strncasecmp(a.ptr, host, a.len)) continue;
- snprintf(cert, sizeof(cert), "%.*s", b.len, b.ptr);
- mg_terminate_ssl(&conn->mg_conn, cert);
- return;
- }
- }
+ // Find out whether we should be in the MITM mode
+ {
+ const char *certs = conn->server->config_options[SSL_MITM_CERTS];
+ int host_len = strlen(host);
+ struct vec a, b;
+
+ while (conn->ns_conn->ssl == NULL && port != 80 &&
+ (certs = next_option(certs, &a, &b)) != NULL) {
+ if (a.len != host_len || mg_strncasecmp(a.ptr, host, a.len)) continue;
+ snprintf(cert, sizeof(cert), "%.*s", b.len, b.ptr);
+ mg_terminate_ssl(&conn->mg_conn, cert);
+ return;
+ }
+ }
#endif
- if (n > 0 && mg_forward(c, host, port, conn->ns_conn->ssl != NULL)) {
- } else {
- conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
- }
+ if (n > 0 && mg_forward(c, host, port, conn->ns_conn->ssl != NULL)) {
+ } else {
+ conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ }
}
#ifndef MONGOOSE_NO_FILESYSTEM
void mg_send_file_internal(struct mg_connection *c, const char *file_name,
- file_stat_t *st, int exists) {
- struct connection *conn = MG_CONN_2_CONN(c);
- char path[MAX_PATH_SIZE];
- const int is_directory = S_ISDIR(st->st_mode);
+ file_stat_t *st, int exists) {
+ struct connection *conn = MG_CONN_2_CONN(c);
+ char path[MAX_PATH_SIZE];
+ const int is_directory = S_ISDIR(st->st_mode);
#ifndef MONGOOSE_NO_CGI
- const char *cgi_pat = conn->server->config_options[CGI_PATTERN];
+ const char *cgi_pat = conn->server->config_options[CGI_PATTERN];
#else
- const char *cgi_pat = DEFAULT_CGI_PATTERN;
+ const char *cgi_pat = DEFAULT_CGI_PATTERN;
#endif
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
- const char *dir_lst = conn->server->config_options[ENABLE_DIRECTORY_LISTING];
+ const char *dir_lst = conn->server->config_options[ENABLE_DIRECTORY_LISTING];
#else
- const char *dir_lst = "yes";
+ const char *dir_lst = "yes";
#endif
- mg_snprintf(path, sizeof(path), "%s", file_name);
-
- if (!exists || must_hide_file(conn, path)) {
- send_http_error(conn, 404, NULL);
- } else if (is_directory &&
- conn->mg_conn.uri[strlen(conn->mg_conn.uri) - 1] != '/') {
- conn->mg_conn.status_code = 301;
- mg_printf(&conn->mg_conn, "HTTP/1.1 301 Moved Permanently\r\n"
- "Location: %s/\r\n\r\n", conn->mg_conn.uri);
- close_local_endpoint(conn);
- } else if (is_directory && !find_index_file(conn, path, sizeof(path), st)) {
- if (!mg_strcasecmp(dir_lst, "yes")) {
+ mg_snprintf(path, sizeof(path), "%s", file_name);
+
+ if (!exists || must_hide_file(conn, path)) {
+ send_http_error(conn, 404, NULL);
+ } else if (is_directory &&
+ conn->mg_conn.uri[strlen(conn->mg_conn.uri) - 1] != '/') {
+ conn->mg_conn.status_code = 301;
+ mg_printf(&conn->mg_conn, "HTTP/1.1 301 Moved Permanently\r\n"
+ "Location: %s/\r\n\r\n", conn->mg_conn.uri);
+ close_local_endpoint(conn);
+ } else if (is_directory && !find_index_file(conn, path, sizeof(path), st)) {
+ if (!mg_strcasecmp(dir_lst, "yes")) {
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
- send_directory_listing(conn, path);
+ send_directory_listing(conn, path);
#else
- send_http_error(conn, 501, NULL);
+ send_http_error(conn, 501, NULL);
#endif
- } else {
- send_http_error(conn, 403, NULL);
- }
- } else if (mg_match_prefix(cgi_pat, strlen(cgi_pat), path) > 0) {
+ } else {
+ send_http_error(conn, 403, NULL);
+ }
+ } else if (mg_match_prefix(cgi_pat, strlen(cgi_pat), path) > 0) {
#if !defined(MONGOOSE_NO_CGI)
- open_cgi_endpoint(conn, path);
+ open_cgi_endpoint(conn, path);
#else
- send_http_error(conn, 501, NULL);
+ send_http_error(conn, 501, NULL);
#endif // !MONGOOSE_NO_CGI
#ifndef MONGOOSE_NO_SSI
- } else if (mg_match_prefix(conn->server->config_options[SSI_PATTERN],
- strlen(conn->server->config_options[SSI_PATTERN]),
- path) > 0) {
- handle_ssi_request(conn, path);
+ } else if (mg_match_prefix(conn->server->config_options[SSI_PATTERN],
+ strlen(conn->server->config_options[SSI_PATTERN]),
+ path) > 0) {
+ handle_ssi_request(conn, path);
#endif
- } else if (is_not_modified(conn, st)) {
- send_http_error(conn, 304, NULL);
- } else if ((conn->endpoint.fd = open(path, O_RDONLY | O_BINARY)) != -1) {
- // O_BINARY is required for Windows, otherwise in default text mode
- // two bytes \r\n will be read as one.
- open_file_endpoint(conn, path, st);
- } else {
- send_http_error(conn, 404, NULL);
- }
+ } else if (is_not_modified(conn, st)) {
+ send_http_error(conn, 304, NULL);
+ } else if ((conn->endpoint.fd = open(path, O_RDONLY | O_BINARY)) != -1) {
+ // O_BINARY is required for Windows, otherwise in default text mode
+ // two bytes \r\n will be read as one.
+ open_file_endpoint(conn, path, st);
+ } else {
+ send_http_error(conn, 404, NULL);
+ }
}
void mg_send_file(struct mg_connection *c, const char *file_name) {
- file_stat_t st;
- const int exists = stat(file_name, &st) == 0;
- mg_send_file_internal(c, file_name, &st, exists);
+ file_stat_t st;
+ const int exists = stat(file_name, &st) == 0;
+ mg_send_file_internal(c, file_name, &st, exists);
}
#endif // !MONGOOSE_NO_FILESYSTEM
static void open_local_endpoint(struct connection *conn, int skip_user) {
#ifndef MONGOOSE_NO_FILESYSTEM
- char path[MAX_PATH_SIZE];
- file_stat_t st;
- int exists = 0;
+ char path[MAX_PATH_SIZE];
+ file_stat_t st;
+ int exists = 0;
#endif
- // If EP_USER was set in a prev call, reset it
- conn->endpoint_type = EP_NONE;
+ // If EP_USER was set in a prev call, reset it
+ conn->endpoint_type = EP_NONE;
#ifndef MONGOOSE_NO_AUTH
- if (conn->server->event_handler && call_user(conn, MG_AUTH) == MG_FALSE) {
- mg_send_digest_auth_request(&conn->mg_conn);
- return;
- }
+ if (conn->server->event_handler && call_user(conn, MG_AUTH) == MG_FALSE) {
+ mg_send_digest_auth_request(&conn->mg_conn);
+ return;
+ }
#endif
- // Call URI handler if one is registered for this URI
- if (skip_user == 0 && conn->server->event_handler != NULL) {
- conn->endpoint_type = EP_USER;
+ // Call URI handler if one is registered for this URI
+ if (skip_user == 0 && conn->server->event_handler != NULL) {
+ conn->endpoint_type = EP_USER;
#if MONGOOSE_POST_SIZE_LIMIT > 1
- {
- const char *cl = mg_get_header(&conn->mg_conn, "Content-Length");
- if ((strcmp(conn->mg_conn.request_method, "POST") == 0 ||
- strcmp(conn->mg_conn.request_method, "PUT") == 0) &&
- (cl == NULL || to64(cl) > MONGOOSE_POST_SIZE_LIMIT)) {
- send_http_error(conn, 500, "POST size > %lu",
- (unsigned long) MONGOOSE_POST_SIZE_LIMIT);
- }
- }
+ {
+ const char *cl = mg_get_header(&conn->mg_conn, "Content-Length");
+ if ((strcmp(conn->mg_conn.request_method, "POST") == 0 ||
+ strcmp(conn->mg_conn.request_method, "PUT") == 0) &&
+ (cl == NULL || to64(cl) > MONGOOSE_POST_SIZE_LIMIT)) {
+ send_http_error(conn, 500, "POST size > %lu",
+ (unsigned long) MONGOOSE_POST_SIZE_LIMIT);
+ }
+ }
#endif
- return;
- }
-
- if (strcmp(conn->mg_conn.request_method, "CONNECT") == 0 ||
- mg_strncasecmp(conn->mg_conn.uri, "http", 4) == 0) {
- const char *enp = conn->server->config_options[ENABLE_PROXY];
- if (enp == NULL || strcmp(enp, "yes") != 0) {
- send_http_error(conn, 405, NULL);
- } else {
- proxify_connection(conn);
- }
- return;
- }
-
- if (!strcmp(conn->mg_conn.request_method, "OPTIONS")) {
- send_options(conn);
- return;
- }
+ return;
+ }
+
+ if (strcmp(conn->mg_conn.request_method, "CONNECT") == 0 ||
+ mg_strncasecmp(conn->mg_conn.uri, "http", 4) == 0) {
+ const char *enp = conn->server->config_options[ENABLE_PROXY];
+ if (enp == NULL || strcmp(enp, "yes") != 0) {
+ send_http_error(conn, 405, NULL);
+ } else {
+ proxify_connection(conn);
+ }
+ return;
+ }
+
+ if (!strcmp(conn->mg_conn.request_method, "OPTIONS")) {
+ send_options(conn);
+ return;
+ }
#ifdef MONGOOSE_NO_FILESYSTEM
- send_http_error(conn, 404, NULL);
+ send_http_error(conn, 404, NULL);
#else
- exists = convert_uri_to_file_name(conn, path, sizeof(path), &st);
+ exists = convert_uri_to_file_name(conn, path, sizeof(path), &st);
- if (!strcmp(conn->mg_conn.request_method, "OPTIONS")) {
- send_options(conn);
- } else if (conn->server->config_options[DOCUMENT_ROOT] == NULL) {
- send_http_error(conn, 404, NULL);
+ if (!strcmp(conn->mg_conn.request_method, "OPTIONS")) {
+ send_options(conn);
+ } else if (conn->server->config_options[DOCUMENT_ROOT] == NULL) {
+ send_http_error(conn, 404, NULL);
#ifndef MONGOOSE_NO_AUTH
- } else if ((!is_dav_request(conn) && !is_authorized(conn, path,
- exists && S_ISDIR(st.st_mode))) ||
- (is_dav_request(conn) && !is_authorized_for_dav(conn))) {
- mg_send_digest_auth_request(&conn->mg_conn);
- close_local_endpoint(conn);
+ } else if ((!is_dav_request(conn) && !is_authorized(conn, path,
+ exists && S_ISDIR(st.st_mode))) ||
+ (is_dav_request(conn) && !is_authorized_for_dav(conn))) {
+ mg_send_digest_auth_request(&conn->mg_conn);
+ close_local_endpoint(conn);
#endif
#ifndef MONGOOSE_NO_DAV
- } else if (must_hide_file(conn, path)) {
- send_http_error(conn, 404, NULL);
- } else if (!strcmp(conn->mg_conn.request_method, "PROPFIND")) {
- handle_propfind(conn, path, &st, exists);
- } else if (!strcmp(conn->mg_conn.request_method, "MKCOL")) {
- handle_mkcol(conn, path);
- } else if (!strcmp(conn->mg_conn.request_method, "DELETE")) {
- handle_delete(conn, path);
- } else if (!strcmp(conn->mg_conn.request_method, "PUT")) {
- handle_put(conn, path);
+ } else if (must_hide_file(conn, path)) {
+ send_http_error(conn, 404, NULL);
+ } else if (!strcmp(conn->mg_conn.request_method, "PROPFIND")) {
+ handle_propfind(conn, path, &st, exists);
+ } else if (!strcmp(conn->mg_conn.request_method, "MKCOL")) {
+ handle_mkcol(conn, path);
+ } else if (!strcmp(conn->mg_conn.request_method, "DELETE")) {
+ handle_delete(conn, path);
+ } else if (!strcmp(conn->mg_conn.request_method, "PUT")) {
+ handle_put(conn, path);
#endif
- } else {
- mg_send_file_internal(&conn->mg_conn, path, &st, exists);
- }
+ } else {
+ mg_send_file_internal(&conn->mg_conn, path, &st, exists);
+ }
#endif // MONGOOSE_NO_FILESYSTEM
}
static void send_continue_if_expected(struct connection *conn) {
- static const char expect_response[] = "HTTP/1.1 100 Continue\r\n\r\n";
- const char *expect_hdr = mg_get_header(&conn->mg_conn, "Expect");
+ static const char expect_response[] = "HTTP/1.1 100 Continue\r\n\r\n";
+ const char *expect_hdr = mg_get_header(&conn->mg_conn, "Expect");
- if (expect_hdr != NULL && !mg_strcasecmp(expect_hdr, "100-continue")) {
- ns_send(conn->ns_conn, expect_response, sizeof(expect_response) - 1);
- }
+ if (expect_hdr != NULL && !mg_strcasecmp(expect_hdr, "100-continue")) {
+ ns_send(conn->ns_conn, expect_response, sizeof(expect_response) - 1);
+ }
}
// Conform to http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2
static int is_valid_uri(const char *uri) {
- unsigned short n;
- return uri[0] == '/' ||
- strcmp(uri, "*") == 0 || // OPTIONS method can use asterisk URI
- mg_strncasecmp(uri, "http", 4) == 0 || // Naive check for the absolute URI
- sscanf(uri, "%*[^ :]:%hu", &n) > 0; // CONNECT method can use host:port
+ unsigned short n;
+ return uri[0] == '/' ||
+ strcmp(uri, "*") == 0 || // OPTIONS method can use asterisk URI
+ mg_strncasecmp(uri, "http", 4) == 0 || // Naive check for the absolute URI
+ sscanf(uri, "%*[^ :]:%hu", &n) > 0; // CONNECT method can use host:port
}
static void try_parse(struct connection *conn) {
- struct iobuf *io = &conn->ns_conn->recv_iobuf;
-
- if (conn->request_len == 0 &&
- (conn->request_len = get_request_len(io->buf, io->len)) > 0) {
- // If request is buffered in, remove it from the iobuf. This is because
- // iobuf could be reallocated, and pointers in parsed request could
- // become invalid.
- conn->request = (char *) malloc(conn->request_len);
- memcpy(conn->request, io->buf, conn->request_len);
- //DBG(("%p [%.*s]", conn, conn->request_len, conn->request));
- iobuf_remove(io, conn->request_len);
- conn->request_len = parse_http_message(conn->request, conn->request_len,
- &conn->mg_conn);
- if (conn->request_len > 0) {
- const char *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length");
- conn->cl = cl_hdr == NULL ? 0 : to64(cl_hdr);
- conn->mg_conn.content_len = (size_t) conn->cl;
- }
- }
+ struct iobuf *io = &conn->ns_conn->recv_iobuf;
+
+ if (conn->request_len == 0 &&
+ (conn->request_len = get_request_len(io->buf, io->len)) > 0) {
+ // If request is buffered in, remove it from the iobuf. This is because
+ // iobuf could be reallocated, and pointers in parsed request could
+ // become invalid.
+ conn->request = (char *) malloc(conn->request_len);
+ memcpy(conn->request, io->buf, conn->request_len);
+ //DBG(("%p [%.*s]", conn, conn->request_len, conn->request));
+ iobuf_remove(io, conn->request_len);
+ conn->request_len = parse_http_message(conn->request, conn->request_len,
+ &conn->mg_conn);
+ if (conn->request_len > 0) {
+ const char *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length");
+ conn->cl = cl_hdr == NULL ? 0 : to64(cl_hdr);
+ conn->mg_conn.content_len = (size_t) conn->cl;
+ }
+ }
}
static void do_proxy(struct connection *conn) {
- if (0 && conn->request_len == 0) {
- try_parse(conn);
- DBG(("%p parsing -> %d", conn, conn->request_len));
- if (conn->request_len > 0 && call_user(conn, MG_REQUEST) == MG_FALSE) {
- proxy_request(conn->endpoint.nc, &conn->mg_conn);
- } else if (conn->request_len < 0) {
- ns_forward(conn->ns_conn, conn->endpoint.nc);
- }
- } else {
- DBG(("%p forwarding", conn));
- ns_forward(conn->ns_conn, conn->endpoint.nc);
- }
+ if (0 && conn->request_len == 0) {
+ try_parse(conn);
+ DBG(("%p parsing -> %d", conn, conn->request_len));
+ if (conn->request_len > 0 && call_user(conn, MG_REQUEST) == MG_FALSE) {
+ proxy_request(conn->endpoint.nc, &conn->mg_conn);
+ } else if (conn->request_len < 0) {
+ ns_forward(conn->ns_conn, conn->endpoint.nc);
+ }
+ } else {
+ DBG(("%p forwarding", conn));
+ ns_forward(conn->ns_conn, conn->endpoint.nc);
+ }
}
static void on_recv_data(struct connection *conn) {
- struct iobuf *io = &conn->ns_conn->recv_iobuf;
- int n;
-
- if (conn->endpoint_type == EP_PROXY) {
- if (conn->endpoint.nc != NULL) do_proxy(conn);
- return;
- }
-
- try_parse(conn);
- DBG(("%p %d %lu %d", conn, conn->request_len, (unsigned long)io->len,
- conn->ns_conn->flags));
- if (conn->request_len < 0 ||
- (conn->request_len > 0 && !is_valid_uri(conn->mg_conn.uri))) {
- send_http_error(conn, 400, NULL);
- } else if (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE) {
- send_http_error(conn, 413, NULL);
- } else if (conn->request_len > 0 &&
- strcmp(conn->mg_conn.http_version, "1.0") != 0 &&
- strcmp(conn->mg_conn.http_version, "1.1") != 0) {
- send_http_error(conn, 505, NULL);
- } else if (conn->request_len > 0 && conn->endpoint_type == EP_NONE) {
+ struct iobuf *io = &conn->ns_conn->recv_iobuf;
+ int n;
+
+ if (conn->endpoint_type == EP_PROXY) {
+ if (conn->endpoint.nc != NULL) do_proxy(conn);
+ return;
+ }
+
+ try_parse(conn);
+ DBG(("%p %d %lu %d", conn, conn->request_len, (unsigned long)io->len,
+ conn->ns_conn->flags));
+ if (conn->request_len < 0 ||
+ (conn->request_len > 0 && !is_valid_uri(conn->mg_conn.uri))) {
+ send_http_error(conn, 400, NULL);
+ } else if (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE) {
+ send_http_error(conn, 413, NULL);
+ } else if (conn->request_len > 0 &&
+ strcmp(conn->mg_conn.http_version, "1.0") != 0 &&
+ strcmp(conn->mg_conn.http_version, "1.1") != 0) {
+ send_http_error(conn, 505, NULL);
+ } else if (conn->request_len > 0 && conn->endpoint_type == EP_NONE) {
#ifndef MONGOOSE_NO_WEBSOCKET
- send_websocket_handshake_if_requested(&conn->mg_conn);
+ send_websocket_handshake_if_requested(&conn->mg_conn);
#endif
- send_continue_if_expected(conn);
- open_local_endpoint(conn, 0);
- }
+ send_continue_if_expected(conn);
+ open_local_endpoint(conn, 0);
+ }
#ifndef MONGOOSE_NO_CGI
- if (conn->endpoint_type == EP_CGI && conn->endpoint.nc != NULL) {
- ns_forward(conn->ns_conn, conn->endpoint.nc);
- }
+ if (conn->endpoint_type == EP_CGI && conn->endpoint.nc != NULL) {
+ ns_forward(conn->ns_conn, conn->endpoint.nc);
+ }
#endif
- if (conn->endpoint_type == EP_USER) {
- conn->mg_conn.content = io->buf;
- conn->mg_conn.content_len = io->len;
- n = call_user(conn, MG_RECV);
- if (n < 0) {
- conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
- } else if ((size_t) n <= io->len) {
- iobuf_remove(io, n);
- }
- call_request_handler_if_data_is_buffered(conn);
- }
+ if (conn->endpoint_type == EP_USER) {
+ conn->mg_conn.content = io->buf;
+ conn->mg_conn.content_len = io->len;
+ n = call_user(conn, MG_RECV);
+ if (n < 0) {
+ conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
+ } else if ((size_t) n <= io->len) {
+ iobuf_remove(io, n);
+ }
+ call_request_handler_if_data_is_buffered(conn);
+ }
#ifndef MONGOOSE_NO_DAV
- if (conn->endpoint_type == EP_PUT && io->len > 0) {
- forward_put_data(conn);
- }
+ if (conn->endpoint_type == EP_PUT && io->len > 0) {
+ forward_put_data(conn);
+ }
#endif
}
static void call_http_client_handler(struct connection *conn) {
- //conn->mg_conn.status_code = code;
- // For responses without Content-Lengh, use the whole buffer
- if (conn->cl == 0) {
- conn->mg_conn.content_len = conn->ns_conn->recv_iobuf.len;
- }
- conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf;
- if (call_user(conn, MG_REPLY) == MG_FALSE) {
- conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
- }
- iobuf_remove(&conn->ns_conn->recv_iobuf, conn->mg_conn.content_len);
- conn->mg_conn.status_code = 0;
- conn->cl = conn->num_bytes_recv = conn->request_len = 0;
- free(conn->request);
- conn->request = NULL;
+ //conn->mg_conn.status_code = code;
+ // For responses without Content-Lengh, use the whole buffer
+ if (conn->cl == 0) {
+ conn->mg_conn.content_len = conn->ns_conn->recv_iobuf.len;
+ }
+ conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf;
+ if (call_user(conn, MG_REPLY) == MG_FALSE) {
+ conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ }
+ iobuf_remove(&conn->ns_conn->recv_iobuf, conn->mg_conn.content_len);
+ conn->mg_conn.status_code = 0;
+ conn->cl = conn->num_bytes_recv = conn->request_len = 0;
+ free(conn->request);
+ conn->request = NULL;
}
static void process_response(struct connection *conn) {
- struct iobuf *io = &conn->ns_conn->recv_iobuf;
+ struct iobuf *io = &conn->ns_conn->recv_iobuf;
- try_parse(conn);
- DBG(("%p %d %lu", conn, conn->request_len, (unsigned long)io->len));
- if (conn->request_len < 0 ||
- (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE)) {
- call_http_client_handler(conn);
- } else if ((int64_t) io->len >= conn->cl) {
- call_http_client_handler(conn);
- }
+ try_parse(conn);
+ DBG(("%p %d %lu", conn, conn->request_len, (unsigned long)io->len));
+ if (conn->request_len < 0 ||
+ (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE)) {
+ call_http_client_handler(conn);
+ } else if ((int64_t) io->len >= conn->cl) {
+ call_http_client_handler(conn);
+ }
}
struct mg_connection *mg_connect(struct mg_server *server, const char *host,
- int port, int use_ssl) {
- struct ns_connection *nsconn;
- struct connection *conn;
+ int port, int use_ssl) {
+ struct ns_connection *nsconn;
+ struct connection *conn;
- nsconn = ns_connect(&server->ns_server, host, port, use_ssl, NULL);
- if (nsconn == NULL) return 0;
+ nsconn = ns_connect(&server->ns_server, host, port, use_ssl, NULL);
+ if (nsconn == NULL) return 0;
- if ((conn = (struct connection *) calloc(1, sizeof(*conn))) == NULL) {
- nsconn->flags |= NSF_CLOSE_IMMEDIATELY;
- return 0;
- }
+ if ((conn = (struct connection *) calloc(1, sizeof(*conn))) == NULL) {
+ nsconn->flags |= NSF_CLOSE_IMMEDIATELY;
+ return 0;
+ }
- // Interlink two structs
- conn->ns_conn = nsconn;
- nsconn->connection_data = conn;
+ // Interlink two structs
+ conn->ns_conn = nsconn;
+ nsconn->connection_data = conn;
- conn->server = server;
- conn->endpoint_type = EP_CLIENT;
- //conn->handler = handler;
- conn->mg_conn.server_param = server->ns_server.server_data;
- conn->ns_conn->flags = NSF_CONNECTING;
+ conn->server = server;
+ conn->endpoint_type = EP_CLIENT;
+ //conn->handler = handler;
+ conn->mg_conn.server_param = server->ns_server.server_data;
+ conn->ns_conn->flags = NSF_CONNECTING;
- return &conn->mg_conn;
+ return &conn->mg_conn;
}
#ifndef MONGOOSE_NO_LOGGING
static void log_header(const struct mg_connection *conn, const char *header,
- FILE *fp) {
- const char *header_value;
+ FILE *fp) {
+ const char *header_value;
- if ((header_value = mg_get_header(conn, header)) == NULL) {
- (void) fprintf(fp, "%s", " -");
- } else {
- (void) fprintf(fp, " \"%s\"", header_value);
- }
+ if ((header_value = mg_get_header(conn, header)) == NULL) {
+ (void) fprintf(fp, "%s", " -");
+ } else {
+ (void) fprintf(fp, " \"%s\"", header_value);
+ }
}
static void log_access(const struct connection *conn, const char *path) {
- const struct mg_connection *c = &conn->mg_conn;
- FILE *fp = (path == NULL) ? NULL : fopen(path, "a+");
- char date[64], user[100];
- time_t now;
-
- if (fp == NULL) return;
- now = time(NULL);
- strftime(date, sizeof(date), "%d/%b/%Y:%H:%M:%S %z", localtime(&now));
-
- flockfile(fp);
- mg_parse_header(mg_get_header(&conn->mg_conn, "Authorization"), "username",
- user, sizeof(user));
- fprintf(fp, "%s - %s [%s] \"%s %s%s%s HTTP/%s\" %d 0",
- c->remote_ip, user[0] == '\0' ? "-" : user, date,
- c->request_method ? c->request_method : "-",
- c->uri ? c->uri : "-", c->query_string ? "?" : "",
- c->query_string ? c->query_string : "",
- c->http_version, c->status_code);
- log_header(c, "Referer", fp);
- log_header(c, "User-Agent", fp);
- fputc('\n', fp);
- fflush(fp);
-
- funlockfile(fp);
- fclose(fp);
+ const struct mg_connection *c = &conn->mg_conn;
+ FILE *fp = (path == NULL) ? NULL : fopen(path, "a+");
+ char date[64], user[100];
+ time_t now;
+
+ if (fp == NULL) return;
+ now = time(NULL);
+ strftime(date, sizeof(date), "%d/%b/%Y:%H:%M:%S %z", localtime(&now));
+
+ flockfile(fp);
+ mg_parse_header(mg_get_header(&conn->mg_conn, "Authorization"), "username",
+ user, sizeof(user));
+ fprintf(fp, "%s - %s [%s] \"%s %s%s%s HTTP/%s\" %d 0",
+ c->remote_ip, user[0] == '\0' ? "-" : user, date,
+ c->request_method ? c->request_method : "-",
+ c->uri ? c->uri : "-", c->query_string ? "?" : "",
+ c->query_string ? c->query_string : "",
+ c->http_version, c->status_code);
+ log_header(c, "Referer", fp);
+ log_header(c, "User-Agent", fp);
+ fputc('\n', fp);
+ fflush(fp);
+
+ funlockfile(fp);
+ fclose(fp);
}
#endif
static void close_local_endpoint(struct connection *conn) {
- struct mg_connection *c = &conn->mg_conn;
- // Must be done before free()
- int keep_alive = should_keep_alive(&conn->mg_conn) &&
- (conn->endpoint_type == EP_FILE || conn->endpoint_type == EP_USER);
- DBG(("%p %d %d %d", conn, conn->endpoint_type, keep_alive,
- conn->ns_conn->flags));
-
- switch (conn->endpoint_type) {
- case EP_PUT:
- case EP_FILE:
- close(conn->endpoint.fd);
- break;
- case EP_CGI:
- case EP_PROXY:
- if (conn->endpoint.nc != NULL) {
- DBG(("%p %p %p :-)", conn, conn->ns_conn, conn->endpoint.nc));
- conn->endpoint.nc->flags |= NSF_CLOSE_IMMEDIATELY;
- conn->endpoint.nc->connection_data = NULL;
- }
- break;
- default: break;
- }
+ struct mg_connection *c = &conn->mg_conn;
+ // Must be done before free()
+ int keep_alive = should_keep_alive(&conn->mg_conn) &&
+ (conn->endpoint_type == EP_FILE || conn->endpoint_type == EP_USER);
+ DBG(("%p %d %d %d", conn, conn->endpoint_type, keep_alive,
+ conn->ns_conn->flags));
+
+ switch (conn->endpoint_type) {
+ case EP_PUT:
+ case EP_FILE:
+ close(conn->endpoint.fd);
+ break;
+ case EP_CGI:
+ case EP_PROXY:
+ if (conn->endpoint.nc != NULL) {
+ DBG(("%p %p %p :-)", conn, conn->ns_conn, conn->endpoint.nc));
+ conn->endpoint.nc->flags |= NSF_CLOSE_IMMEDIATELY;
+ conn->endpoint.nc->connection_data = NULL;
+ }
+ break;
+ default: break;
+ }
#ifndef MONGOOSE_NO_LOGGING
- if (c->status_code > 0 && conn->endpoint_type != EP_CLIENT &&
- c->status_code != 400) {
- log_access(conn, conn->server->config_options[ACCESS_LOG_FILE]);
- }
+ if (c->status_code > 0 && conn->endpoint_type != EP_CLIENT &&
+ c->status_code != 400) {
+ log_access(conn, conn->server->config_options[ACCESS_LOG_FILE]);
+ }
#endif
- // Gobble possible POST data sent to the URI handler
- iobuf_free(&conn->ns_conn->recv_iobuf);
- free(conn->request);
- free(conn->path_info);
- conn->endpoint.nc = NULL;
- conn->request = conn->path_info = NULL;
-
- conn->endpoint_type = EP_NONE;
- conn->cl = conn->num_bytes_recv = conn->request_len = 0;
- conn->ns_conn->flags &= ~(NSF_FINISHED_SENDING_DATA |
- NSF_BUFFER_BUT_DONT_SEND | NSF_CLOSE_IMMEDIATELY |
- MG_HEADERS_SENT | MG_LONG_RUNNING);
-
- // Do not memset() the whole structure, as some of the fields
- // (IP addresses & ports, server_param) must survive. Nullify the rest.
- c->request_method = c->uri = c->http_version = c->query_string = NULL;
- c->num_headers = c->status_code = c->is_websocket = c->content_len = 0;
- c->connection_param = c->callback_param = NULL;
-
- if (keep_alive) {
- on_recv_data(conn); // Can call us recursively if pipelining is used
- } else {
- conn->ns_conn->flags |= conn->ns_conn->send_iobuf.len == 0 ?
- NSF_CLOSE_IMMEDIATELY : NSF_FINISHED_SENDING_DATA;
- }
+ // Gobble possible POST data sent to the URI handler
+ iobuf_free(&conn->ns_conn->recv_iobuf);
+ free(conn->request);
+ free(conn->path_info);
+ conn->endpoint.nc = NULL;
+ conn->request = conn->path_info = NULL;
+
+ conn->endpoint_type = EP_NONE;
+ conn->cl = conn->num_bytes_recv = conn->request_len = 0;
+ conn->ns_conn->flags &= ~(NSF_FINISHED_SENDING_DATA |
+ NSF_BUFFER_BUT_DONT_SEND | NSF_CLOSE_IMMEDIATELY |
+ MG_HEADERS_SENT | MG_LONG_RUNNING);
+
+ // Do not memset() the whole structure, as some of the fields
+ // (IP addresses & ports, server_param) must survive. Nullify the rest.
+ c->request_method = c->uri = c->http_version = c->query_string = NULL;
+ c->num_headers = c->status_code = c->is_websocket = c->content_len = 0;
+ c->connection_param = c->callback_param = NULL;
+
+ if (keep_alive) {
+ on_recv_data(conn); // Can call us recursively if pipelining is used
+ } else {
+ conn->ns_conn->flags |= conn->ns_conn->send_iobuf.len == 0 ?
+ NSF_CLOSE_IMMEDIATELY : NSF_FINISHED_SENDING_DATA;
+ }
}
static void transfer_file_data(struct connection *conn) {
- char buf[IOBUF_SIZE];
- int n;
+ char buf[IOBUF_SIZE];
+ int n;
- // If output buffer is too big, don't send anything. Wait until
- // mongoose drains already buffered data to the client.
- if (conn->ns_conn->send_iobuf.len > sizeof(buf) * 2) return;
+ // If output buffer is too big, don't send anything. Wait until
+ // mongoose drains already buffered data to the client.
+ if (conn->ns_conn->send_iobuf.len > sizeof(buf) * 2) return;
- // Do not send anyt
- n = read(conn->endpoint.fd, buf, conn->cl < (int64_t) sizeof(buf) ?
- (int) conn->cl : (int) sizeof(buf));
+ // Do not send anyt
+ n = read(conn->endpoint.fd, buf, conn->cl < (int64_t) sizeof(buf) ?
+ (int) conn->cl : (int) sizeof(buf));
- if (n <= 0) {
- close_local_endpoint(conn);
- } else if (n > 0) {
- conn->cl -= n;
- ns_send(conn->ns_conn, buf, n);
- if (conn->cl <= 0) {
- close_local_endpoint(conn);
- }
- }
+ if (n <= 0) {
+ close_local_endpoint(conn);
+ } else if (n > 0) {
+ conn->cl -= n;
+ ns_send(conn->ns_conn, buf, n);
+ if (conn->cl <= 0) {
+ close_local_endpoint(conn);
+ }
+ }
}
int mg_poll_server(struct mg_server *server, int milliseconds) {
- return ns_server_poll(&server->ns_server, milliseconds);
+ return ns_server_poll(&server->ns_server, milliseconds);
}
void mg_destroy_server(struct mg_server **server) {
- if (server != NULL && *server != NULL) {
- struct mg_server *s = *server;
- int i;
+ if (server != NULL && *server != NULL) {
+ struct mg_server *s = *server;
+ int i;
- ns_server_free(&s->ns_server);
- for (i = 0; i < (int) ARRAY_SIZE(s->config_options); i++) {
- free(s->config_options[i]); // It is OK to free(NULL)
- }
- free(s);
- *server = NULL;
- }
+ ns_server_free(&s->ns_server);
+ for (i = 0; i < (int) ARRAY_SIZE(s->config_options); i++) {
+ free(s->config_options[i]); // It is OK to free(NULL)
+ }
+ free(s);
+ *server = NULL;
+ }
}
struct mg_iterator {
- mg_handler_t cb;
- void *param;
+ mg_handler_t cb;
+ void *param;
};
static void iter(struct ns_connection *nsconn, enum ns_event ev, void *param) {
- if (ev == NS_POLL) {
- struct mg_iterator *it = (struct mg_iterator *) param;
- struct connection *c = (struct connection *) nsconn->connection_data;
- if (c != NULL) c->mg_conn.callback_param = it->param;
- it->cb(&c->mg_conn, MG_POLL);
- }
+ if (ev == NS_POLL) {
+ struct mg_iterator *it = (struct mg_iterator *) param;
+ struct connection *c = (struct connection *) nsconn->connection_data;
+ if (c != NULL) c->mg_conn.callback_param = it->param;
+ it->cb(&c->mg_conn, MG_POLL);
+ }
}
struct mg_connection *mg_next(struct mg_server *s, struct mg_connection *c) {
- struct connection *conn = MG_CONN_2_CONN(c);
- struct ns_connection *nc = ns_next(&s->ns_server,
- c == NULL ? NULL : conn->ns_conn);
+ struct connection *conn = MG_CONN_2_CONN(c);
+ struct ns_connection *nc = ns_next(&s->ns_server,
+ c == NULL ? NULL : conn->ns_conn);
- return nc == NULL ? NULL :
- & ((struct connection *) nc->connection_data)->mg_conn;
+ return nc == NULL ? NULL :
+ & ((struct connection *) nc->connection_data)->mg_conn;
}
// Apply function to all active connections.
void mg_iterate_over_connections(struct mg_server *server, mg_handler_t cb,
- void *param) {
- struct mg_iterator it = { cb, param };
- ns_iterate(&server->ns_server, iter, &it);
+ void *param) {
+ struct mg_iterator it = { cb, param };
+ ns_iterate(&server->ns_server, iter, &it);
}
static int get_var(const char *data, size_t data_len, const char *name,
- char *dst, size_t dst_len) {
- const char *p, *e, *s;
- size_t name_len;
- int len;
-
- if (dst == NULL || dst_len == 0) {
- len = -2;
- } else if (data == NULL || name == NULL || data_len == 0) {
- len = -1;
- dst[0] = '\0';
- } else {
- name_len = strlen(name);
- e = data + data_len;
- len = -1;
- dst[0] = '\0';
-
- // data is "var1=val1&var2=val2...". Find variable first
- for (p = data; p + name_len < e; p++) {
- if ((p == data || p[-1] == '&') && p[name_len] == '=' &&
- !mg_strncasecmp(name, p, name_len)) {
-
- // Point p to variable value
- p += name_len + 1;
-
- // Point s to the end of the value
- s = (const char *) memchr(p, '&', (size_t)(e - p));
- if (s == NULL) {
- s = e;
- }
- assert(s >= p);
-
- // Decode variable into destination buffer
- len = mg_url_decode(p, (size_t)(s - p), dst, dst_len, 1);
-
- // Redirect error code from -1 to -2 (destination buffer too small).
- if (len == -1) {
- len = -2;
- }
- break;
- }
- }
- }
-
- return len;
+ char *dst, size_t dst_len) {
+ const char *p, *e, *s;
+ size_t name_len;
+ int len;
+
+ if (dst == NULL || dst_len == 0) {
+ len = -2;
+ } else if (data == NULL || name == NULL || data_len == 0) {
+ len = -1;
+ dst[0] = '\0';
+ } else {
+ name_len = strlen(name);
+ e = data + data_len;
+ len = -1;
+ dst[0] = '\0';
+
+ // data is "var1=val1&var2=val2...". Find variable first
+ for (p = data; p + name_len < e; p++) {
+ if ((p == data || p[-1] == '&') && p[name_len] == '=' &&
+ !mg_strncasecmp(name, p, name_len)) {
+ // Point p to variable value
+ p += name_len + 1;
+
+ // Point s to the end of the value
+ s = (const char *) memchr(p, '&', (size_t)(e - p));
+ if (s == NULL) {
+ s = e;
+ }
+ assert(s >= p);
+
+ // Decode variable into destination buffer
+ len = mg_url_decode(p, (size_t)(s - p), dst, dst_len, 1);
+
+ // Redirect error code from -1 to -2 (destination buffer too small).
+ if (len == -1) {
+ len = -2;
+ }
+ break;
+ }
+ }
+ }
+
+ return len;
}
int mg_get_var(const struct mg_connection *conn, const char *name,
- char *dst, size_t dst_len) {
- int len = get_var(conn->query_string, conn->query_string == NULL ? 0 :
- strlen(conn->query_string), name, dst, dst_len);
- if (len < 0) {
- len = get_var(conn->content, conn->content_len, name, dst, dst_len);
- }
- return len;
+ char *dst, size_t dst_len) {
+ int len = get_var(conn->query_string, conn->query_string == NULL ? 0 :
+ strlen(conn->query_string), name, dst, dst_len);
+ if (len < 0) {
+ len = get_var(conn->content, conn->content_len, name, dst, dst_len);
+ }
+ return len;
}
static int get_line_len(const char *buf, int buf_len) {
- int len = 0;
- while (len < buf_len && buf[len] != '\n') len++;
- return buf[len] == '\n' ? len + 1: -1;
+ int len = 0;
+ while (len < buf_len && buf[len] != '\n') len++;
+ return buf[len] == '\n' ? len + 1: -1;
}
int mg_parse_multipart(const char *buf, int buf_len,
- char *var_name, int var_name_len,
- char *file_name, int file_name_len,
- const char **data, int *data_len) {
- static const char cd[] = "Content-Disposition: ";
- //struct mg_connection c;
- int hl, bl, n, ll, pos, cdl = sizeof(cd) - 1;
- //char *p;
-
- if (buf == NULL || buf_len <= 0) return 0;
- if ((hl = get_request_len(buf, buf_len)) <= 0) return 0;
- if (buf[0] != '-' || buf[1] != '-' || buf[2] == '\n') return 0;
-
- // Get boundary length
- bl = get_line_len(buf, buf_len);
-
- // Loop through headers, fetch variable name and file name
- var_name[0] = file_name[0] = '\0';
- for (n = bl; (ll = get_line_len(buf + n, hl - n)) > 0; n += ll) {
- if (mg_strncasecmp(cd, buf + n, cdl) == 0) {
- parse_header(buf + n + cdl, ll - (cdl + 2), "name",
- var_name, var_name_len);
- parse_header(buf + n + cdl, ll - (cdl + 2), "filename",
- file_name, file_name_len);
- }
- }
-
- // Scan body, search for terminating boundary
- for (pos = hl; pos + (bl - 2) < buf_len; pos++) {
- if (buf[pos] == '-' && !memcmp(buf, &buf[pos], bl - 2)) {
- if (data_len != NULL) *data_len = (pos - 2) - hl;
- if (data != NULL) *data = buf + hl;
- return pos;
- }
- }
-
- return 0;
+ char *var_name, int var_name_len,
+ char *file_name, int file_name_len,
+ const char **data, int *data_len) {
+ static const char cd[] = "Content-Disposition: ";
+ //struct mg_connection c;
+ int hl, bl, n, ll, pos, cdl = sizeof(cd) - 1;
+ //char *p;
+
+ if (buf == NULL || buf_len <= 0) return 0;
+ if ((hl = get_request_len(buf, buf_len)) <= 0) return 0;
+ if (buf[0] != '-' || buf[1] != '-' || buf[2] == '\n') return 0;
+
+ // Get boundary length
+ bl = get_line_len(buf, buf_len);
+
+ // Loop through headers, fetch variable name and file name
+ var_name[0] = file_name[0] = '\0';
+ for (n = bl; (ll = get_line_len(buf + n, hl - n)) > 0; n += ll) {
+ if (mg_strncasecmp(cd, buf + n, cdl) == 0) {
+ parse_header(buf + n + cdl, ll - (cdl + 2), "name",
+ var_name, var_name_len);
+ parse_header(buf + n + cdl, ll - (cdl + 2), "filename",
+ file_name, file_name_len);
+ }
+ }
+
+ // Scan body, search for terminating boundary
+ for (pos = hl; pos + (bl - 2) < buf_len; pos++) {
+ if (buf[pos] == '-' && !memcmp(buf, &buf[pos], bl - 2)) {
+ if (data_len != NULL) *data_len = (pos - 2) - hl;
+ if (data != NULL) *data = buf + hl;
+ return pos;
+ }
+ }
+
+ return 0;
}
const char **mg_get_valid_option_names(void) {
- return static_config_options;
+ return static_config_options;
}
static int get_option_index(const char *name) {
- int i;
+ int i;
- for (i = 0; static_config_options[i * 2] != NULL; i++) {
- if (strcmp(static_config_options[i * 2], name) == 0) {
- return i;
- }
- }
- return -1;
+ for (i = 0; static_config_options[i * 2] != NULL; i++) {
+ if (strcmp(static_config_options[i * 2], name) == 0) {
+ return i;
+ }
+ }
+ return -1;
}
static void set_default_option_values(char **opts) {
- const char *value, **all_opts = mg_get_valid_option_names();
- int i;
+ const char *value, **all_opts = mg_get_valid_option_names();
+ int i;
- for (i = 0; all_opts[i * 2] != NULL; i++) {
- value = all_opts[i * 2 + 1];
- if (opts[i] == NULL && value != NULL) {
- opts[i] = mg_strdup(value);
- }
- }
+ for (i = 0; all_opts[i * 2] != NULL; i++) {
+ value = all_opts[i * 2 + 1];
+ if (opts[i] == NULL && value != NULL) {
+ opts[i] = mg_strdup(value);
+ }
+ }
}
const char *mg_set_option(struct mg_server *server, const char *name,
- const char *value) {
- int ind = get_option_index(name);
- const char *error_msg = NULL;
- char **v = NULL;
-
- if (ind < 0) return "No such option";
- v = &server->config_options[ind];
-
- // Return success immediately if setting to the same value
- if ((*v == NULL && value == NULL) ||
- (value != NULL && *v != NULL && !strcmp(value, *v))) {
- return NULL;
- }
-
- if (*v != NULL) {
- free(*v);
- *v = NULL;
- }
-
- if (value == NULL || value[0] == '\0') return NULL;
-
- *v = mg_strdup(value);
- DBG(("%s [%s]", name, *v));
-
- if (ind == LISTENING_PORT) {
- int port = ns_bind(&server->ns_server, value);
- if (port < 0) {
- error_msg = "Cannot bind to port";
- } else {
- char buf[100];
- ns_sock_to_str(server->ns_server.listening_sock, buf, sizeof(buf), 2);
- free(*v);
- *v = mg_strdup(buf);
- }
+ const char *value) {
+ int ind = get_option_index(name);
+ const char *error_msg = NULL;
+ char **v = NULL;
+
+ if (ind < 0) return "No such option";
+ v = &server->config_options[ind];
+
+ // Return success immediately if setting to the same value
+ if ((*v == NULL && value == NULL) ||
+ (value != NULL && *v != NULL && !strcmp(value, *v))) {
+ return NULL;
+ }
+
+ if (*v != NULL) {
+ free(*v);
+ *v = NULL;
+ }
+
+ if (value == NULL || value[0] == '\0') return NULL;
+
+ *v = mg_strdup(value);
+ DBG(("%s [%s]", name, *v));
+
+ if (ind == LISTENING_PORT) {
+ int port = ns_bind(&server->ns_server, value);
+ if (port < 0) {
+ error_msg = "Cannot bind to port";
+ } else {
+ char buf[100];
+ ns_sock_to_str(server->ns_server.listening_sock, buf, sizeof(buf), 2);
+ free(*v);
+ *v = mg_strdup(buf);
+ }
#ifndef MONGOOSE_NO_FILESYSTEM
- } else if (ind == HEXDUMP_FILE) {
- server->ns_server.hexdump_file = *v;
+ } else if (ind == HEXDUMP_FILE) {
+ server->ns_server.hexdump_file = *v;
#endif
#ifndef _WIN32
- } else if (ind == RUN_AS_USER) {
- struct passwd *pw;
- if ((pw = getpwnam(value)) == NULL) {
- error_msg = "Unknown user";
- } else if (setgid(pw->pw_gid) != 0) {
- error_msg = "setgid() failed";
- } else if (setuid(pw->pw_uid) != 0) {
- error_msg = "setuid() failed";
- }
+ } else if (ind == RUN_AS_USER) {
+ struct passwd *pw;
+ if ((pw = getpwnam(value)) == NULL) {
+ error_msg = "Unknown user";
+ } else if (setgid(pw->pw_gid) != 0) {
+ error_msg = "setgid() failed";
+ } else if (setuid(pw->pw_uid) != 0) {
+ error_msg = "setuid() failed";
+ }
#endif
#ifdef NS_ENABLE_SSL
- } else if (ind == SSL_CERTIFICATE) {
- int res = ns_set_ssl_cert(&server->ns_server, value);
- if (res == -2) {
- error_msg = "Cannot load PEM";
- } else if (res == -3) {
- error_msg = "SSL not enabled";
- } else if (res == -1) {
- error_msg = "SSL_CTX_new() failed";
- }
- } else if (ind == SSL_CA_CERTIFICATE) {
- if (ns_set_ssl_ca_cert(&server->ns_server, value) != 0) {
- error_msg = "Error setting CA cert";
- }
+ } else if (ind == SSL_CERTIFICATE) {
+ int res = ns_set_ssl_cert(&server->ns_server, value);
+ if (res == -2) {
+ error_msg = "Cannot load PEM";
+ } else if (res == -3) {
+ error_msg = "SSL not enabled";
+ } else if (res == -1) {
+ error_msg = "SSL_CTX_new() failed";
+ }
+ } else if (ind == SSL_CA_CERTIFICATE) {
+ if (ns_set_ssl_ca_cert(&server->ns_server, value) != 0) {
+ error_msg = "Error setting CA cert";
+ }
#endif
- }
+ }
- return error_msg;
+ return error_msg;
}
static void set_ips(struct ns_connection *nc, int is_rem) {
- struct connection *conn = (struct connection *) nc->connection_data;
- struct mg_connection *c = &conn->mg_conn;
- char buf[100];
+ struct connection *conn = (struct connection *) nc->connection_data;
+ struct mg_connection *c = &conn->mg_conn;
+ char buf[100];
- ns_sock_to_str(nc->sock, buf, sizeof(buf), is_rem ? 7 : 3);
- sscanf(buf, "%47[^:]:%hu",
- is_rem ? c->remote_ip : c->local_ip,
- is_rem ? &c->remote_port : &c->local_port);
- //DBG(("%p %s %s", conn, is_rem ? "rem" : "loc", buf));
+ ns_sock_to_str(nc->sock, buf, sizeof(buf), is_rem ? 7 : 3);
+ sscanf(buf, "%47[^:]:%hu",
+ is_rem ? c->remote_ip : c->local_ip,
+ is_rem ? &c->remote_port : &c->local_port);
+ //DBG(("%p %s %s", conn, is_rem ? "rem" : "loc", buf));
}
static void on_accept(struct ns_connection *nc, union socket_address *sa) {
- struct mg_server *server = (struct mg_server *) nc->server;
- struct connection *conn;
-
- if (!check_acl(server->config_options[ACCESS_CONTROL_LIST],
- ntohl(* (uint32_t *) &sa->sin.sin_addr)) ||
- (conn = (struct connection *) calloc(1, sizeof(*conn))) == NULL) {
- nc->flags |= NSF_CLOSE_IMMEDIATELY;
- } else {
- // Circularly link two connection structures
- nc->connection_data = conn;
- conn->ns_conn = nc;
-
- // Initialize the rest of connection attributes
- conn->server = server;
- conn->mg_conn.server_param = nc->server->server_data;
- set_ips(nc, 1);
- set_ips(nc, 0);
- }
+ struct mg_server *server = (struct mg_server *) nc->server;
+ struct connection *conn;
+
+ if (!check_acl(server->config_options[ACCESS_CONTROL_LIST],
+ ntohl(* (uint32_t *) &sa->sin.sin_addr)) ||
+ (conn = (struct connection *) calloc(1, sizeof(*conn))) == NULL) {
+ nc->flags |= NSF_CLOSE_IMMEDIATELY;
+ } else {
+ // Circularly link two connection structures
+ nc->connection_data = conn;
+ conn->ns_conn = nc;
+
+ // Initialize the rest of connection attributes
+ conn->server = server;
+ conn->mg_conn.server_param = nc->server->server_data;
+ set_ips(nc, 1);
+ set_ips(nc, 0);
+ }
}
static void mg_ev_handler(struct ns_connection *nc, enum ns_event ev, void *p) {
- struct connection *conn = (struct connection *) nc->connection_data;
+ struct connection *conn = (struct connection *) nc->connection_data;
- // Send NS event to the handler. Note that call_user won't send an event
- // if conn == NULL. Therefore, repeat this for NS_ACCEPT event as well.
+ // Send NS event to the handler. Note that call_user won't send an event
+ // if conn == NULL. Therefore, repeat this for NS_ACCEPT event as well.
#ifdef MONGOOSE_SEND_NS_EVENTS
- {
- struct connection *conn = (struct connection *) nc->connection_data;
- void *param[2] = { nc, p };
- if (conn != NULL) conn->mg_conn.callback_param = param;
- call_user(conn, (enum mg_event) ev);
- }
+ {
+ struct connection *conn = (struct connection *) nc->connection_data;
+ void *param[2] = { nc, p };
+ if (conn != NULL) conn->mg_conn.callback_param = param;
+ call_user(conn, (enum mg_event) ev);
+ }
#endif
- switch (ev) {
- case NS_ACCEPT:
- on_accept(nc, (union socket_address *) p);
+ switch (ev) {
+ case NS_ACCEPT:
+ on_accept(nc, (union socket_address *) p);
#ifdef MONGOOSE_SEND_NS_EVENTS
- {
- struct connection *conn = (struct connection *) nc->connection_data;
- void *param[2] = { nc, p };
- if (conn != NULL) conn->mg_conn.callback_param = param;
- call_user(conn, (enum mg_event) ev);
- }
+ {
+ struct connection *conn = (struct connection *) nc->connection_data;
+ void *param[2] = { nc, p };
+ if (conn != NULL) conn->mg_conn.callback_param = param;
+ call_user(conn, (enum mg_event) ev);
+ }
#endif
- break;
-
- case NS_CONNECT:
- if (nc->connection_data != NULL) {
- set_ips(nc, 1);
- set_ips(nc, 0);
- }
- conn->mg_conn.status_code = * (int *) p;
- if (conn->mg_conn.status_code != 0 ||
- (!(nc->flags & MG_PROXY_CONN) &&
- call_user(conn, MG_CONNECT) == MG_FALSE)) {
- nc->flags |= NSF_CLOSE_IMMEDIATELY;
- }
- break;
-
- case NS_RECV:
- if (conn != NULL) {
- conn->num_bytes_recv += * (int *) p;
- }
- if (nc->flags & NSF_ACCEPTED) {
- on_recv_data(conn);
+ break;
+
+ case NS_CONNECT:
+ if (nc->connection_data != NULL) {
+ set_ips(nc, 1);
+ set_ips(nc, 0);
+ }
+ conn->mg_conn.status_code = * (int *) p;
+ if (conn->mg_conn.status_code != 0 ||
+ (!(nc->flags & MG_PROXY_CONN) &&
+ call_user(conn, MG_CONNECT) == MG_FALSE)) {
+ nc->flags |= NSF_CLOSE_IMMEDIATELY;
+ }
+ break;
+
+ case NS_RECV:
+ if (conn != NULL) {
+ conn->num_bytes_recv += * (int *) p;
+ }
+ if (nc->flags & NSF_ACCEPTED) {
+ on_recv_data(conn);
#ifndef MONGOOSE_NO_CGI
- } else if (nc->flags & MG_CGI_CONN) {
- on_cgi_data(nc);
+ } else if (nc->flags & MG_CGI_CONN) {
+ on_cgi_data(nc);
#endif
- } else if (nc->flags & MG_PROXY_CONN) {
- if (conn != NULL) {
- ns_forward(nc, conn->ns_conn);
- }
- } else {
- process_response(conn);
- }
- break;
-
- case NS_SEND:
- break;
-
- case NS_CLOSE:
- nc->connection_data = NULL;
- if (nc->flags & (MG_CGI_CONN | MG_PROXY_CONN)) {
- DBG(("%p %p closing cgi/proxy conn", conn, nc));
- if (conn && conn->ns_conn) {
- conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND;
- conn->ns_conn->flags |= conn->ns_conn->send_iobuf.len > 0 ?
- NSF_FINISHED_SENDING_DATA : NSF_CLOSE_IMMEDIATELY;
- conn->endpoint.nc = NULL;
- }
- } else if (conn != NULL) {
- DBG(("%p %p %d closing", conn, nc, conn->endpoint_type));
-
- if (conn->endpoint_type == EP_CLIENT && nc->recv_iobuf.len > 0) {
- call_http_client_handler(conn);
- }
-
- call_user(conn, MG_CLOSE);
- close_local_endpoint(conn);
- conn->ns_conn = NULL;
- free(conn);
- }
- break;
-
- case NS_POLL:
- if (conn != NULL) {
- if (call_user(conn, MG_POLL) == MG_TRUE) {
- if (conn->ns_conn->flags & MG_HEADERS_SENT) {
- write_terminating_chunk(conn);
- }
- close_local_endpoint(conn);
- }
-
- if (conn->endpoint_type == EP_FILE) {
- transfer_file_data(conn);
- }
- }
-
- // Expire idle connections
- {
- time_t current_time = * (time_t *) p;
-
- if (conn != NULL && conn->mg_conn.is_websocket) {
- ping_idle_websocket_connection(conn, current_time);
- }
-
- if (nc->last_io_time + MONGOOSE_IDLE_TIMEOUT_SECONDS < current_time) {
- mg_ev_handler(nc, NS_CLOSE, NULL);
- nc->flags |= NSF_CLOSE_IMMEDIATELY;
- }
- }
- break;
-
- default:
- break;
- }
+ } else if (nc->flags & MG_PROXY_CONN) {
+ if (conn != NULL) {
+ ns_forward(nc, conn->ns_conn);
+ }
+ } else {
+ process_response(conn);
+ }
+ break;
+
+ case NS_SEND:
+ break;
+
+ case NS_CLOSE:
+ nc->connection_data = NULL;
+ if (nc->flags & (MG_CGI_CONN | MG_PROXY_CONN)) {
+ DBG(("%p %p closing cgi/proxy conn", conn, nc));
+ if (conn && conn->ns_conn) {
+ conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND;
+ conn->ns_conn->flags |= conn->ns_conn->send_iobuf.len > 0 ?
+ NSF_FINISHED_SENDING_DATA : NSF_CLOSE_IMMEDIATELY;
+ conn->endpoint.nc = NULL;
+ }
+ } else if (conn != NULL) {
+ DBG(("%p %p %d closing", conn, nc, conn->endpoint_type));
+
+ if (conn->endpoint_type == EP_CLIENT && nc->recv_iobuf.len > 0) {
+ call_http_client_handler(conn);
+ }
+
+ call_user(conn, MG_CLOSE);
+ close_local_endpoint(conn);
+ conn->ns_conn = NULL;
+ free(conn);
+ }
+ break;
+
+ case NS_POLL:
+ if (conn != NULL) {
+ if (call_user(conn, MG_POLL) == MG_TRUE) {
+ if (conn->ns_conn->flags & MG_HEADERS_SENT) {
+ write_terminating_chunk(conn);
+ }
+ close_local_endpoint(conn);
+ }
+
+ if (conn->endpoint_type == EP_FILE) {
+ transfer_file_data(conn);
+ }
+ }
+
+ // Expire idle connections
+ {
+ time_t current_time = * (time_t *) p;
+
+ if (conn != NULL && conn->mg_conn.is_websocket) {
+ ping_idle_websocket_connection(conn, current_time);
+ }
+
+ if (nc->last_io_time + MONGOOSE_IDLE_TIMEOUT_SECONDS < current_time) {
+ mg_ev_handler(nc, NS_CLOSE, NULL);
+ nc->flags |= NSF_CLOSE_IMMEDIATELY;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
}
static void iter2(struct ns_connection *nc, enum ns_event ev, void *param) {
- mg_handler_t func = NULL;
- struct connection *conn = (struct connection *) nc->connection_data;
- const char *msg = (const char *) param;
- int n;
- (void) ev;
+ mg_handler_t func = NULL;
+ struct connection *conn = (struct connection *) nc->connection_data;
+ const char *msg = (const char *) param;
+ int n;
+ (void) ev;
- //DBG(("%p [%s]", conn, msg));
- if (sscanf(msg, "%p %n", &func, &n) && func != NULL) {
- conn->mg_conn.callback_param = (void *) (msg + n);
- func(&conn->mg_conn, MG_POLL);
- }
+ //DBG(("%p [%s]", conn, msg));
+ if (sscanf(msg, "%p %n", &func, &n) && func != NULL) {
+ conn->mg_conn.callback_param = (void *) (msg + n);
+ func(&conn->mg_conn, MG_POLL);
+ }
}
void mg_wakeup_server_ex(struct mg_server *server, mg_handler_t cb,
- const char *fmt, ...) {
- va_list ap;
- char buf[8 * 1024];
- int len;
+ const char *fmt, ...) {
+ va_list ap;
+ char buf[8 * 1024];
+ int len;
- // Encode callback (cb) into a buffer
- len = snprintf(buf, sizeof(buf), "%p ", cb);
- va_start(ap, fmt);
- len += vsnprintf(buf + len, sizeof(buf) - len, fmt, ap);
- va_end(ap);
+ // Encode callback (cb) into a buffer
+ len = snprintf(buf, sizeof(buf), "%p ", cb);
+ va_start(ap, fmt);
+ len += vsnprintf(buf + len, sizeof(buf) - len, fmt, ap);
+ va_end(ap);
- // "len + 1" is to include terminating \0 in the message
- ns_server_wakeup_ex(&server->ns_server, iter2, buf, len + 1);
+ // "len + 1" is to include terminating \0 in the message
+ ns_server_wakeup_ex(&server->ns_server, iter2, buf, len + 1);
}
void mg_wakeup_server(struct mg_server *server) {
- ns_server_wakeup_ex(&server->ns_server, NULL, (void *) "", 0);
+ ns_server_wakeup_ex(&server->ns_server, NULL, (void *) "", 0);
}
void mg_set_listening_socket(struct mg_server *server, int sock) {
- if (server->ns_server.listening_sock != INVALID_SOCKET) {
- closesocket(server->ns_server.listening_sock);
- }
- server->ns_server.listening_sock = (sock_t) sock;
+ if (server->ns_server.listening_sock != INVALID_SOCKET) {
+ closesocket(server->ns_server.listening_sock);
+ }
+ server->ns_server.listening_sock = (sock_t) sock;
}
int mg_get_listening_socket(struct mg_server *server) {
- return server->ns_server.listening_sock;
+ return server->ns_server.listening_sock;
}
const char *mg_get_option(const struct mg_server *server, const char *name) {
- const char **opts = (const char **) server->config_options;
- int i = get_option_index(name);
- return i == -1 ? NULL : opts[i] == NULL ? "" : opts[i];
+ const char **opts = (const char **) server->config_options;
+ int i = get_option_index(name);
+ return i == -1 ? NULL : opts[i] == NULL ? "" : opts[i];
}
struct mg_server *mg_create_server(void *server_data, mg_handler_t handler) {
- struct mg_server *server = (struct mg_server *) calloc(1, sizeof(*server));
- ns_server_init(&server->ns_server, server_data, mg_ev_handler);
- set_default_option_values(server->config_options);
- server->event_handler = handler;
- return server;
+ struct mg_server *server = (struct mg_server *) calloc(1, sizeof(*server));
+ ns_server_init(&server->ns_server, server_data, mg_ev_handler);
+ set_default_option_values(server->config_options);
+ server->event_handler = handler;
+ return server;
}
#ifdef _WIN32
static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
- int offset) {
- HANDLE fh = (HANDLE) _get_osfhandle(fd);
- HANDLE mh = CreateFileMapping(fh, 0, PAGE_READONLY, 0, 0, 0);
- void *p = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, (size_t) len);
- CloseHandle(mh);
- return p;
+ int offset) {
+ HANDLE fh = (HANDLE) _get_osfhandle(fd);
+ HANDLE mh = CreateFileMapping(fh, 0, PAGE_READONLY, 0, 0, 0);
+ void *p = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, (size_t) len);
+ CloseHandle(mh);
+ return p;
}
#define munmap(x, y) UnmapViewOfFile(x)
#define MAP_FAILED NULL
@@ -5160,9 +5157,9 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
#endif
void *mg_mmap(FILE *fp, size_t size) {
- return mmap(NULL, size, PROT_READ, MAP_PRIVATE, fileno(fp), 0);
+ return mmap(NULL, size, PROT_READ, MAP_PRIVATE, fileno(fp), 0);
}
void mg_munmap(void *p, size_t size) {
- munmap(p, size);
+ munmap(p, size);
}
diff --git a/src/lib/web/mongoose.h b/src/lib/web/mongoose.h
index d39808ee1dd..de3e7b00742 100644
--- a/src/lib/web/mongoose.h
+++ b/src/lib/web/mongoose.h
@@ -31,59 +31,59 @@ extern "C" {
// This structure contains information about HTTP request.
struct mg_connection {
- const char *request_method; // "GET", "POST", etc
- const char *uri; // URL-decoded URI
- const char *http_version; // E.g. "1.0", "1.1"
- const char *query_string; // URL part after '?', not including '?', or NULL
-
- char remote_ip[48]; // Max IPv6 string length is 45 characters
- char local_ip[48]; // Local IP address
- unsigned short remote_port; // Client's port
- unsigned short local_port; // Local port number
-
- int num_headers; // Number of HTTP headers
- struct mg_header {
- const char *name; // HTTP header name
- const char *value; // HTTP header value
- } http_headers[30];
-
- char *content; // POST (or websocket message) data, or NULL
- size_t content_len; // Data length
-
- int is_websocket; // Connection is a websocket connection
- int status_code; // HTTP status code for HTTP error handler
- int wsbits; // First byte of the websocket frame
- void *server_param; // Parameter passed to mg_add_uri_handler()
- void *connection_param; // Placeholder for connection-specific data
- void *callback_param; // Needed by mg_iterate_over_connections()
+ const char *request_method; // "GET", "POST", etc
+ const char *uri; // URL-decoded URI
+ const char *http_version; // E.g. "1.0", "1.1"
+ const char *query_string; // URL part after '?', not including '?', or NULL
+
+ char remote_ip[48]; // Max IPv6 string length is 45 characters
+ char local_ip[48]; // Local IP address
+ unsigned short remote_port; // Client's port
+ unsigned short local_port; // Local port number
+
+ int num_headers; // Number of HTTP headers
+ struct mg_header {
+ const char *name; // HTTP header name
+ const char *value; // HTTP header value
+ } http_headers[30];
+
+ char *content; // POST (or websocket message) data, or NULL
+ size_t content_len; // Data length
+
+ int is_websocket; // Connection is a websocket connection
+ int status_code; // HTTP status code for HTTP error handler
+ int wsbits; // First byte of the websocket frame
+ void *server_param; // Parameter passed to mg_add_uri_handler()
+ void *connection_param; // Placeholder for connection-specific data
+ void *callback_param; // Needed by mg_iterate_over_connections()
};
struct mg_server; // Opaque structure describing server instance
enum mg_result { MG_FALSE, MG_TRUE, MG_MORE };
enum mg_event {
- MG_POLL = 100, // Callback return value is ignored
- MG_CONNECT, // If callback returns MG_FALSE, connect fails
- MG_AUTH, // If callback returns MG_FALSE, authentication fails
- MG_REQUEST, // If callback returns MG_FALSE, Mongoose continues with req
- MG_REPLY, // If callback returns MG_FALSE, Mongoose closes connection
- MG_RECV, // Mongoose has received POST data chunk.
- // Callback should return a number of bytes to discard from
- // the receive buffer, or -1 to close the connection.
- MG_CLOSE, // Connection is closed, callback return value is ignored
- MG_WS_HANDSHAKE, // New websocket connection, handshake request
- MG_WS_CONNECT, // New websocket connection established
- MG_HTTP_ERROR // If callback returns MG_FALSE, Mongoose continues with err
+ MG_POLL = 100, // Callback return value is ignored
+ MG_CONNECT, // If callback returns MG_FALSE, connect fails
+ MG_AUTH, // If callback returns MG_FALSE, authentication fails
+ MG_REQUEST, // If callback returns MG_FALSE, Mongoose continues with req
+ MG_REPLY, // If callback returns MG_FALSE, Mongoose closes connection
+ MG_RECV, // Mongoose has received POST data chunk.
+ // Callback should return a number of bytes to discard from
+ // the receive buffer, or -1 to close the connection.
+ MG_CLOSE, // Connection is closed, callback return value is ignored
+ MG_WS_HANDSHAKE, // New websocket connection, handshake request
+ MG_WS_CONNECT, // New websocket connection established
+ MG_HTTP_ERROR // If callback returns MG_FALSE, Mongoose continues with err
};
typedef int (*mg_handler_t)(struct mg_connection *, enum mg_event);
// Websocket opcodes, from http://tools.ietf.org/html/rfc6455
enum {
- WEBSOCKET_OPCODE_CONTINUATION = 0x0,
- WEBSOCKET_OPCODE_TEXT = 0x1,
- WEBSOCKET_OPCODE_BINARY = 0x2,
- WEBSOCKET_OPCODE_CONNECTION_CLOSE = 0x8,
- WEBSOCKET_OPCODE_PING = 0x9,
- WEBSOCKET_OPCODE_PONG = 0xa
+ WEBSOCKET_OPCODE_CONTINUATION = 0x0,
+ WEBSOCKET_OPCODE_TEXT = 0x1,
+ WEBSOCKET_OPCODE_BINARY = 0x2,
+ WEBSOCKET_OPCODE_CONNECTION_CLOSE = 0x8,
+ WEBSOCKET_OPCODE_PING = 0x9,
+ WEBSOCKET_OPCODE_PONG = 0xa
};
// Server management functions
@@ -110,9 +110,9 @@ size_t mg_write(struct mg_connection *, const void *buf, int len);
size_t mg_printf(struct mg_connection *conn, const char *fmt, ...);
size_t mg_websocket_write(struct mg_connection *, int opcode,
- const char *data, size_t data_len);
+ const char *data, size_t data_len);
size_t mg_websocket_printf(struct mg_connection* conn, int opcode,
- const char *fmt, ...);
+ const char *fmt, ...);
void mg_send_file(struct mg_connection *, const char *path);
void mg_send_file_data(struct mg_connection *, int fd);
@@ -120,12 +120,12 @@ void mg_send_file_data(struct mg_connection *, int fd);
const char *mg_get_header(const struct mg_connection *, const char *name);
const char *mg_get_mime_type(const char *name, const char *default_mime_type);
int mg_get_var(const struct mg_connection *conn, const char *var_name,
- char *buf, size_t buf_len);
+ char *buf, size_t buf_len);
int mg_parse_header(const char *hdr, const char *var_name, char *buf, size_t);
int mg_parse_multipart(const char *buf, int buf_len,
- char *var_name, int var_name_len,
- char *file_name, int file_name_len,
- const char **data, int *data_len);
+ char *var_name, int var_name_len,
+ char *file_name, int file_name_len,
+ const char **data, int *data_len);
// Utility functions
void *mg_start_thread(void *(*func)(void *), void *param);
@@ -141,11 +141,11 @@ void mg_munmap(void *p, size_t size);
// Templates support
struct mg_expansion {
- const char *keyword;
- void (*handler)(struct mg_connection *);
+ const char *keyword;
+ void (*handler)(struct mg_connection *);
};
void mg_template(struct mg_connection *, const char *text,
- struct mg_expansion *expansions);
+ struct mg_expansion *expansions);
#ifdef __cplusplus
diff --git a/src/mame/audio/cclimber.h b/src/mame/audio/cclimber.h
index 7ad4c45044d..4229ad1e85b 100644
--- a/src/mame/audio/cclimber.h
+++ b/src/mame/audio/cclimber.h
@@ -41,7 +41,7 @@ public:
DECLARE_WRITE8_MEMBER( sample_rate_w );
DECLARE_WRITE8_MEMBER( sample_volume_w );
DECLARE_WRITE8_MEMBER( sample_select_w );
-
+
SAMPLES_START_CB_MEMBER( sh_start );
protected:
@@ -50,7 +50,7 @@ protected:
virtual machine_config_constructor device_mconfig_additions() const;
void play_sample(int start,int freq,int volume);
-
+
private:
INT16 *m_sample_buf; /* buffer to decode samples at run time */
int m_sample_num;
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index 3820ddcd1d5..1e3ba863bce 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -257,7 +257,7 @@ void leland_80186_sound_device::device_start()
save_item(NAME(m_ext_active));
save_item(NAME(m_dac_sample));
save_item(NAME(m_dac_volume));
-
+
// zerofill
m_peripheral = 0;
m_last_control = 0;
@@ -566,7 +566,7 @@ WRITE16_MEMBER( leland_80186_sound_device::ataxx_dac_control )
if (ACCESSING_BITS_0_7)
dac_w(space, 1, data, mem_mask);
return;
-
+
default:
break;
}
@@ -599,7 +599,7 @@ WRITE16_MEMBER( leland_80186_sound_device::ataxx_dac_control )
m_ext_stop <<= 4;
if (LOG_EXTERN) logerror("External DAC stop = %05X\n", m_ext_stop);
return;
-
+
default:
break;
}
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index 5115446ccd9..2f6541cf436 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -414,7 +414,6 @@ static void set_ea(address_space &space, int ea)
void mario_state::sound_start()
{
-
device_t *audiocpu = machine().device("audiocpu");
if (!audiocpu) return;
diff --git a/src/mame/drivers/20pacgal.c b/src/mame/drivers/20pacgal.c
index 118033f2137..78c8f8aae32 100644
--- a/src/mame/drivers/20pacgal.c
+++ b/src/mame/drivers/20pacgal.c
@@ -363,7 +363,7 @@ void _20pacgal_state::common_save_state()
save_item(NAME(m_sprite_ram));
save_item(NAME(m_sprite_color_lookup));
}
-
+
void _20pacgal_state::machine_start()
{
common_save_state();
diff --git a/src/mame/drivers/4enraya.c b/src/mame/drivers/4enraya.c
index 1513e64cc90..58d0911683f 100644
--- a/src/mame/drivers/4enraya.c
+++ b/src/mame/drivers/4enraya.c
@@ -65,7 +65,7 @@
***************************************************************************
Unknown Pac-Man gambling game.
-
+
It's a basic Pac-Man front game, that has a gambling game hidden inside.
The purpose of this "stealth" game, is just to be a "camouflage" for the
real gambling game, for locations where the gambling games are forbidden.
@@ -89,7 +89,7 @@
discard and press START to eliminate the number and place the representative
ghost again in the original place outside the center.
- Once done, just press UP (deal) again, and pacman will re-eat the new placed
+ Once done, just press UP (deal) again, and pacman will re-eat the new placed
ghosts, revealing the new numbers (as a new deal).
If you have a winning hand, you can press DOWN (double-up) to get a Double-Up,
@@ -241,7 +241,7 @@ static ADDRESS_MAP_START( unkpacg_main_portmap, AS_IO, 8, _4enraya_state )
AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW1")
AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
-// AM_RANGE(0x03, 0x03) AM_WRITE("out_w") // to investigate...
+// AM_RANGE(0x03, 0x03) AM_WRITE("out_w") // to investigate...
AM_RANGE(0x17, 0x17) AM_DEVWRITE("aysnd", ay8910_device, data_w)
AM_RANGE(0x27, 0x27) AM_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0x37, 0x37) AM_DEVWRITE("aysnd", ay8910_device, address_w)
@@ -300,9 +300,9 @@ INPUT_PORTS_END
static INPUT_PORTS_START( unkpacg )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Front Game Coin A") // 1 credits / initiate minigame
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Gambling Game Coin In") // 5 credits / initiate gambling
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Front Game Coin B") // 10 credits
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Front Game Coin A") // 1 credits / initiate minigame
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Gambling Game Coin In") // 5 credits / initiate gambling
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Front Game Coin B") // 10 credits
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -459,7 +459,7 @@ static MACHINE_CONFIG_DERIVED( unkpacg, 4enraya )
MCFG_NVRAM_ADD_0FILL("nvram")
/* sound hardware */
-// MCFG_SPEAKER_STANDARD_MONO("mono")
+// MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_REPLACE("aysnd", AY8910, MAIN_CLOCK/4) /* guess */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index 88822829637..70ed8cf7a28 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -3193,7 +3193,7 @@ WRITE8_MEMBER(_8080bw_state::invmulti_eeprom_w)
WRITE8_MEMBER(_8080bw_state::invmulti_bank_w)
{
m_invmulti_bank = data; //needed to restore the bankswitch post load
-
+
// d0, d4, d6: bank
int bank = (data & 1) | (data >> 3 & 2) | (data >> 4 & 4);
membank("bank1")->set_base(memregion("maincpu")->base() + bank * 0x4000 + 0x0000);
@@ -3208,7 +3208,7 @@ void _8080bw_state::invmulti_bankswitch_restore()
MACHINE_RESET_MEMBER(_8080bw_state,invmulti)
{
m_invmulti_bank = 0;
-
+
invmulti_bank_w(m_maincpu->space(AS_PROGRAM), 0, 0);
MACHINE_RESET_CALL_MEMBER(mw8080bw);
@@ -3234,7 +3234,7 @@ DRIVER_INIT_MEMBER(_8080bw_state,invmulti)
// decrypt rom
for (int i = 0; i < len; i++)
dest[i] = BITSWAP8(src[(i & 0x100ff) | (BITSWAP8(i >> 8 & 0xff, 7,3,4,5,0,6,1,2) << 8)],0,6,5,7,4,3,1,2);
-
+
save_item(NAME(m_invmulti_bank));
machine().save().register_postload(save_prepost_delegate(FUNC(_8080bw_state::invmulti_bankswitch_restore), this));
}
diff --git a/src/mame/drivers/aces1.c b/src/mame/drivers/aces1.c
index f2a81bfb726..201b7bf3027 100644
--- a/src/mame/drivers/aces1.c
+++ b/src/mame/drivers/aces1.c
@@ -136,7 +136,7 @@ public:
{
//There needs to be some way of connecting these values to stepper coils, or doing the MCU properly
// We should be able to see an enable clock, a sense and a full/half step selector, we don't have the half step visible it seems.
-
+
//3 1 16 14
int phases[] = {0x05,0x01,0x09,0x08,0x0a,0x02,0x06,0x04,};
for (int reel=0; reel <4; reel++)
@@ -165,11 +165,11 @@ public:
logerror("Reel %x Enable %x \n",reel, clock );
}
}
-// logerror("Reel %x Enable %x Sense %i \n",reel, (data & (1<<reel)), (data & (4 + (1<<reel))) ? 1:-1 );
+// logerror("Reel %x Enable %x Sense %i \n",reel, (data & (1<<reel)), (data & (4 + (1<<reel))) ? 1:-1 );
}
-
-
-// printf("reels, extender strobe %02x\n", data);
+
+
+// printf("reels, extender strobe %02x\n", data);
}
DECLARE_READ8_MEMBER( ic37_read_a )
@@ -194,7 +194,7 @@ public:
if (stepper_optic_state(reel)) pattern |= 1<<reel;
if (m_reel_count[reel]) action |= 1<<reel;
}
-
+
return ((pattern << 4) | action);
}
@@ -313,7 +313,7 @@ static INPUT_PORTS_START( aces1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
-
+
PORT_START("IO4")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -353,7 +353,7 @@ static INPUT_PORTS_START( aces1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
-
+
PORT_START("IO8")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -363,7 +363,7 @@ static INPUT_PORTS_START( aces1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
-
+
PORT_START("DSWA")
PORT_DIPNAME( 0x01, 0x01, "DSWA" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 03b2f744325..3fce37ee70e 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -769,43 +769,43 @@ DRIVER_INIT_MEMBER(alg_state,aplatoon)
*************************************/
/* BIOS */
-GAME( 199?, alg_bios, 0, alg_r1, alg, alg_state, ntsc, ROT0, "American Laser Games", "American Laser Games BIOS", GAME_IS_BIOS_ROOT )
+GAME( 199?, alg_bios, 0, alg_r1, alg, alg_state, ntsc, ROT0, "American Laser Games", "American Laser Games BIOS", GAME_IS_BIOS_ROOT )
/* Rev. A board */
/* PAL R1 */
-GAME( 1990, maddoga, maddog, alg_r1, alg, alg_state, palr1, ROT0, "American Laser Games", "Mad Dog McCree v1C board rev.A", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1990, maddoga, maddog, alg_r1, alg, alg_state, palr1, ROT0, "American Laser Games", "Mad Dog McCree v1C board rev.A", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
/* PAL R3 */
-GAME( 1991, wsjr, alg_bios, alg_r1, alg, alg_state, palr3, ROT0, "American Laser Games", "Who Shot Johnny Rock? v1.6", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, wsjr_15, wsjr, alg_r1, alg, alg_state, palr3, ROT0, "American Laser Games", "Who Shot Johnny Rock? v1.5", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1991, wsjr, alg_bios, alg_r1, alg, alg_state, palr3, ROT0, "American Laser Games", "Who Shot Johnny Rock? v1.6", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1991, wsjr_15, wsjr, alg_r1, alg, alg_state, palr3, ROT0, "American Laser Games", "Who Shot Johnny Rock? v1.5", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
/* Rev. B board */
/* PAL R6 */
-GAME( 1990, maddog, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Mad Dog McCree v2.03 board rev.B", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1990, maddog, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Mad Dog McCree v2.03 board rev.B", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1990, maddog_202, maddog, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Mad Dog McCree v2.02 board rev.B", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
/* works ok but uses right player (2) controls only for trigger and holster */
-GAME( 1992, maddog2, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Mad Dog II: The Lost Gold v2.04", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, maddog2, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Mad Dog II: The Lost Gold v2.04", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1992, maddog2_202, maddog2, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Mad Dog II: The Lost Gold v2.02", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1992, maddog2_110, maddog2, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Mad Dog II: The Lost Gold v1.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1992, maddog2_100, maddog2, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Mad Dog II: The Lost Gold v1.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
/* works ok but uses right player (2) controls only for trigger and holster */
-GAME( 1992, spacepir, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Space Pirates v2.2", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, spacepir, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Space Pirates v2.2", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1992, spacepir_14, spacepir, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Space Pirates v1.4", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, gallgall, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Gallagher's Gallery v2.2", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, gallgall, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Gallagher's Gallery v2.2", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1992, gallgall_21, gallgall, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Gallagher's Gallery v2.1", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
/* all good, but no holster */
-GAME( 1993, crimepat, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Crime Patrol v1.51", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1993, crimepat, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Crime Patrol v1.51", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1993, crimepat_14, crimepat, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Crime Patrol v1.4", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1993, crimepat_12, crimepat, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Crime Patrol v1.2", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, crimep2, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Crime Patrol 2: Drug Wars v1.3", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1993, crimep2, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Crime Patrol 2: Drug Wars v1.3", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1993, crimep2_11, crimep2, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "Crime Patrol 2: Drug Wars v1.1", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, lastbh, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "The Last Bounty Hunter v1.01", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, lastbh, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "The Last Bounty Hunter v1.01", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1994, lastbh_006, lastbh, alg_r2, alg_2p, alg_state, palr6, ROT0, "American Laser Games", "The Last Bounty Hunter v0.06", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1995, fastdraw, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT90, "American Laser Games", "Fast Draw Showdown v1.31", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1995, fastdraw, alg_bios, alg_r2, alg_2p, alg_state, palr6, ROT90, "American Laser Games", "Fast Draw Showdown v1.31", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1995, fastdraw_130,fastdraw, alg_r2, alg_2p, alg_state, palr6, ROT90, "American Laser Games", "Fast Draw Showdown v1.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
/* works ok but uses right player (2) controls only for trigger and holster */
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 7fdfb1d7522..8b7a220989f 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -1703,7 +1703,7 @@ static MACHINE_CONFIG_START( aristmk4, aristmk4_state )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(5) /* one for each meter - can pulse simultaneously */
- MCFG_SAMPLES_NAMES(meter_sample_names)
+ MCFG_SAMPLES_NAMES(meter_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c
index 6ee57ba70fc..39ae0a50380 100644
--- a/src/mame/drivers/arkanoid.c
+++ b/src/mame/drivers/arkanoid.c
@@ -16,7 +16,7 @@
The 68705 code for this one was not available; I made it up from
the current A75-06.IC16 changing the level data pointer table.
arkanoidj Japanese version. Final revision, MCU code not dumped.
- arkanoidja Japanese version. A later revision with level selector.
+ arkanoidja Japanese version. A later revision with level selector.
The 68705 code for this one was not available; I made it up from
the current A75-06.IC16 changing the level data pointer table.
arkanoidjbl Bootleg of the early Japanese version. The only difference is
@@ -809,7 +809,7 @@ ADDRESS_MAP_END
READ8_MEMBER(arkanoid_state::hexaa_f000_r)
{
-// return hexaa_from_sub;
+// return hexaa_from_sub;
return rand();
}
@@ -844,7 +844,7 @@ WRITE8_MEMBER(arkanoid_state::hexaa_sub_80_w)
READ8_MEMBER(arkanoid_state::hexaa_sub_90_r)
{
return hexaa_from_main;
-// return rand();
+// return rand();
}
static ADDRESS_MAP_START( hexaa_sub_iomap, AS_IO, 8, arkanoid_state )
@@ -853,7 +853,7 @@ static ADDRESS_MAP_START( hexaa_sub_iomap, AS_IO, 8, arkanoid_state )
AM_RANGE(0x80, 0x80) AM_WRITE(hexaa_sub_80_w)
AM_RANGE(0x90, 0x90) AM_READ(hexaa_sub_90_r)
ADDRESS_MAP_END
-
+
static ADDRESS_MAP_START( brixian_map, AS_PROGRAM, 8, arkanoid_state )
@@ -1832,7 +1832,7 @@ ROM_START( hexaa )
ROM_LOAD( "sub1.bin", 0x00000, 0x8000, CRC(82c091fa) SHA1(e509ab4d9372f93d81df70772a4632100081ffd7) )
ROM_LOAD( "main4.bin", 0x10000, 0x8000, CRC(3d5d006c) SHA1(ad4eadab82024b122182eacb5a322cfd6e476a70) )
- ROM_REGION( 0x18000, "subcpu", 0 )
+ ROM_REGION( 0x18000, "subcpu", 0 )
ROM_LOAD( "sub2.bin", 0x00000, 0x2000, CRC(c3bb9661) SHA1(e4bccb822d6eba77bb9cba75125cddb740775a2c)) // 1ST AND 2ND HALF IDENTICAL (contains just 0x55 bytes of code)
diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c
index 06b27bc3d26..a4b06b45a74 100644
--- a/src/mame/drivers/atarisy4.c
+++ b/src/mame/drivers/atarisy4.c
@@ -33,10 +33,10 @@ class atarisy4_renderer : public poly_manager<float, atarisy4_polydata, 2, 8192>
public:
atarisy4_renderer(atarisy4_state &state, screen_device &screen);
~atarisy4_renderer() {}
-
+
void draw_scanline(INT32 scanline, const extent_t &extent, const atarisy4_polydata &extradata, int threadid);
void draw_polygon(UINT16 color);
-
+
atarisy4_state &m_state;
};
@@ -54,28 +54,28 @@ public:
m_screen_ram(*this, "screen_ram"),
m_dsp0_bank1(*this, "dsp0_bank1"),
m_dsp1_bank1(*this, "dsp1_bank1") { }
-
+
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_dsp0;
optional_device<cpu_device> m_dsp1;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
-
+
required_shared_ptr<UINT16> m_m68k_ram;
required_shared_ptr<UINT16> m_screen_ram;
-
+
required_memory_bank m_dsp0_bank1;
optional_memory_bank m_dsp1_bank1;
atarisy4_renderer *m_renderer;
-
+
UINT8 m_r_color_table[256];
UINT8 m_g_color_table[256];
UINT8 m_b_color_table[256];
UINT16 m_dsp_bank[2];
UINT8 m_csr[2];
UINT16 *m_shared_ram[2];
-
+
DECLARE_WRITE16_MEMBER(gpu_w);
DECLARE_READ16_MEMBER(gpu_r);
DECLARE_READ16_MEMBER(m68k_shared_0_r);
@@ -177,7 +177,7 @@ atarisy4_renderer::atarisy4_renderer(atarisy4_state &state, screen_device &scree
{
}
- void atarisy4_state::video_start()
+ void atarisy4_state::video_start()
{
m_renderer = auto_alloc(machine(), atarisy4_renderer(*this, *m_screen));
}
diff --git a/src/mame/drivers/bartop52.c b/src/mame/drivers/bartop52.c
index 68bf87f1a5e..6f4b2d2c429 100644
--- a/src/mame/drivers/bartop52.c
+++ b/src/mame/drivers/bartop52.c
@@ -33,7 +33,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER( bartop_interrupt );
virtual void machine_reset();
- //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state
+ //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state
};
diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c
index e17b7c79891..cd8baef3aa2 100644
--- a/src/mame/drivers/battlera.c
+++ b/src/mame/drivers/battlera.c
@@ -72,7 +72,7 @@ static ADDRESS_MAP_START( battlera_map, AS_PROGRAM, 8, battlera_state )
AM_RANGE( 0x1FE400, 0x1FE7FF) AM_DEVREADWRITE( "huc6260", huc6260_device, read, write )
AM_RANGE( 0x1FEC00, 0x1FEFFF) AM_DEVREADWRITE( "maincpu", h6280_device, timer_r, timer_w )
AM_RANGE( 0x1FF400, 0x1FF7FF) AM_DEVREADWRITE( "maincpu", h6280_device, irq_status_r, irq_status_w )
-
+
ADDRESS_MAP_END
static ADDRESS_MAP_START( battlera_portmap, AS_IO, 8, battlera_state )
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index fc9e8c0f17f..b2728b1c590 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -1054,7 +1054,7 @@ static MACHINE_CONFIG_START( scorpion1, bfm_sc1_state )
MCFG_CPU_PERIODIC_INT_DRIVER(bfm_sc1_state, timer_irq, 1000) // generate 1000 IRQ's per second
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
-
+
MCFG_BFMBD1_ADD("vfd0",0)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("aysnd",AY8912, MASTER_CLOCK/4)
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index fd6a15638cf..d98def773ac 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -185,7 +185,7 @@ public:
m_vfd0(*this, "vfd0"),
m_vfd1(*this, "vfd1"),
m_dm01(*this, "dm01") { }
-
+
required_device<cpu_device> m_maincpu;
required_device<upd7759_device> m_upd7759;
optional_device<bfm_bd1_t> m_vfd0;
@@ -1389,7 +1389,7 @@ READ8_MEMBER(bfm_sc2_state::direct_input_r)
void bfm_sc2_state::save_state()
{
/* TODO: Split between the different machine types */
-
+
save_item(NAME(m_key));
save_item(NAME(m_mmtr_latch));
save_item(NAME(m_irq_status));
@@ -2147,7 +2147,7 @@ MACHINE_START_MEMBER(bfm_sc2_state,bfm_sc2)
nvram_device *e2ram = subdevice<nvram_device>("e2ram");
if (e2ram != NULL)
e2ram->set_base(m_e2ram, sizeof(m_e2ram));
-
+
save_state();
}
diff --git a/src/mame/drivers/bmcpokr.c b/src/mame/drivers/bmcpokr.c
index 762b3d1b5b2..04574000f0d 100644
--- a/src/mame/drivers/bmcpokr.c
+++ b/src/mame/drivers/bmcpokr.c
@@ -232,9 +232,9 @@ void bmcpokr_state::draw_layer(screen_device &screen, bitmap_ind16 &bitmap, cons
switch (layer)
{
- case 1: tmap = m_tilemap_1; scroll = m_scrollram_1; ctrl = (m_layerctrl[0] >> 8) & 0xff; break;
- case 2: tmap = m_tilemap_2; scroll = m_scrollram_2; ctrl = (m_layerctrl[0] >> 0) & 0xff; break;
- default: tmap = 0; scroll = m_scrollram_3; ctrl = (m_layerctrl[1] >> 8) & 0xff; break;
+ case 1: tmap = m_tilemap_1; scroll = m_scrollram_1; ctrl = (m_layerctrl[0] >> 8) & 0xff; break;
+ case 2: tmap = m_tilemap_2; scroll = m_scrollram_2; ctrl = (m_layerctrl[0] >> 0) & 0xff; break;
+ default: tmap = 0; scroll = m_scrollram_3; ctrl = (m_layerctrl[1] >> 8) & 0xff; break;
}
if (ctrl == 0x00)
@@ -292,22 +292,22 @@ UINT32 bmcpokr_state::screen_update_bmcpokr(screen_device &screen, bitmap_ind16
bitmap.fill(m_palette->black_pen(), cliprect);
- if (layers_ctrl & 2) draw_layer(screen, bitmap, cliprect, 2);
+ if (layers_ctrl & 2) draw_layer(screen, bitmap, cliprect, 2);
/*
- title: 17, 13/17
- dogs: 1b, 13, 17
- service: 17
- game: 17
+ title: 17, 13/17
+ dogs: 1b, 13, 17
+ service: 17
+ game: 17
*/
if (*m_priority & 0x0008)
{
- if (layers_ctrl & 4) draw_layer(screen, bitmap, cliprect, 3);
- if (layers_ctrl & 1) draw_layer(screen, bitmap, cliprect, 1);
+ if (layers_ctrl & 4) draw_layer(screen, bitmap, cliprect, 3);
+ if (layers_ctrl & 1) draw_layer(screen, bitmap, cliprect, 1);
}
else
{
- if (layers_ctrl & 1) draw_layer(screen, bitmap, cliprect, 1);
- if (layers_ctrl & 4) draw_layer(screen, bitmap, cliprect, 3);
+ if (layers_ctrl & 1) draw_layer(screen, bitmap, cliprect, 1);
+ if (layers_ctrl & 4) draw_layer(screen, bitmap, cliprect, 3);
}
return 0;
}
@@ -326,15 +326,15 @@ READ16_MEMBER(bmcpokr_state::prot_r)
{
switch (m_prot_val >> 8)
{
- case 0x00: return 0x1d << 8;
- case 0x94: return 0x81 << 8;
+ case 0x00: return 0x1d << 8;
+ case 0x94: return 0x81 << 8;
}
return 0x00 << 8;
}
WRITE16_MEMBER(bmcpokr_state::prot_w)
{
COMBINE_DATA(&m_prot_val);
-// logerror("%s: prot val = %04x\n", machine().describe_context(), m_prot_val);
+// logerror("%s: prot val = %04x\n", machine().describe_context(), m_prot_val);
}
/***************************************************************************
@@ -346,14 +346,14 @@ WRITE16_MEMBER(bmcpokr_state::mux_w)
COMBINE_DATA(&m_mux);
if (ACCESSING_BITS_0_7)
{
- m_hopper->write(space, 0, (data & 0x0001) ? 0x80 : 0x00); // hopper motor
- coin_counter_w(machine(), 1, data & 0x0002); // coin-in / key-in
- coin_counter_w(machine(), 2, data & 0x0004); // pay-out
- // data & 0x0060 // DSW mux
- // data & 0x0080 // ? always on
+ m_hopper->write(space, 0, (data & 0x0001) ? 0x80 : 0x00); // hopper motor
+ coin_counter_w(machine(), 1, data & 0x0002); // coin-in / key-in
+ coin_counter_w(machine(), 2, data & 0x0004); // pay-out
+ // data & 0x0060 // DSW mux
+ // data & 0x0080 // ? always on
}
-// popmessage("mux %04x", m_mux);
+// popmessage("mux %04x", m_mux);
}
READ16_MEMBER(bmcpokr_state::dsw_r)
{
@@ -402,24 +402,24 @@ static ADDRESS_MAP_START( bmcpokr_mem, AS_PROGRAM, 16, bmcpokr_state )
AM_RANGE(0x2a0000, 0x2dffff) AM_RAM_WRITE(pixram_w) AM_SHARE("pixram")
- AM_RANGE(0x2ff800, 0x2ff9ff) AM_RAM AM_SHARE("scrollram_1")
- AM_RANGE(0x2ffa00, 0x2ffbff) AM_RAM AM_SHARE("scrollram_2")
- AM_RANGE(0x2ffc00, 0x2ffdff) AM_RAM AM_SHARE("scrollram_3")
+ AM_RANGE(0x2ff800, 0x2ff9ff) AM_RAM AM_SHARE("scrollram_1")
+ AM_RANGE(0x2ffa00, 0x2ffbff) AM_RAM AM_SHARE("scrollram_2")
+ AM_RANGE(0x2ffc00, 0x2ffdff) AM_RAM AM_SHARE("scrollram_3")
AM_RANGE(0x2ffe00, 0x2fffff) AM_RAM
AM_RANGE(0x320000, 0x320003) AM_RAM AM_SHARE("layerctrl")
AM_RANGE(0x330000, 0x330001) AM_READWRITE(prot_r, prot_w)
- AM_RANGE(0x340000, 0x340001) AM_RAM // 340001.b, rw
- AM_RANGE(0x340002, 0x340003) AM_RAM // 340003.b, w(9d)
+ AM_RANGE(0x340000, 0x340001) AM_RAM // 340001.b, rw
+ AM_RANGE(0x340002, 0x340003) AM_RAM // 340003.b, w(9d)
AM_RANGE(0x340006, 0x340007) AM_WRITE(irq_ack_w)
AM_RANGE(0x340008, 0x340009) AM_WRITE(irq_enable_w)
- AM_RANGE(0x34000e, 0x34000f) AM_RAM AM_SHARE("priority") // 34000f.b, w (priority?)
+ AM_RANGE(0x34000e, 0x34000f) AM_RAM AM_SHARE("priority") // 34000f.b, w (priority?)
AM_RANGE(0x340016, 0x340017) AM_WRITE(pixpal_w)
- AM_RANGE(0x340018, 0x340019) AM_RAM // 340019.b, w
- AM_RANGE(0x34001a, 0x34001b) AM_READ(unk_r) AM_WRITENOP
- AM_RANGE(0x34001c, 0x34001d) AM_RAM // 34001d.b, w(0)
+ AM_RANGE(0x340018, 0x340019) AM_RAM // 340019.b, w
+ AM_RANGE(0x34001a, 0x34001b) AM_READ(unk_r) AM_WRITENOP
+ AM_RANGE(0x34001c, 0x34001d) AM_RAM // 34001d.b, w(0)
AM_RANGE(0x350000, 0x350001) AM_DEVWRITE8("ramdac",ramdac_device, index_w, 0x00ff )
AM_RANGE(0x350002, 0x350003) AM_DEVWRITE8("ramdac",ramdac_device, pal_w, 0x00ff )
@@ -453,7 +453,7 @@ static INPUT_PORTS_START( bmcpokr )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // n.a. [START, ESC in service mode]
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // SCORE
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // BET [BET, credit -1]
- PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, NULL) // HP [HOPPER, credit -100]
+ PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, NULL) // HP [HOPPER, credit -100]
PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // ACCOUNT [SERVICE MODE]
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // KEY-OUT [KEY-OUT, no hopper]
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // DOUBLE-UP
@@ -471,7 +471,7 @@ static INPUT_PORTS_START( bmcpokr )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // n.a. [START, ESC in service mode]
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Left>2 (3rd)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Down>1 (2nd) [BET, credit -1]
-// PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, NULL) // HP [HOPPER, credit -100]
+// PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, NULL) // HP [HOPPER, credit -100]
PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // A2 [SERVICE MODE]
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // C2 [KEY-OUT, no hopper]
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // S1 [START, ESC in service mode]
@@ -480,7 +480,7 @@ static INPUT_PORTS_START( bmcpokr )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) PORT_IMPULSE(5) // <coin-in> (1st) [COIN-IN, credit +100, coin-jam]
PORT_START("INPUTS2")
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // <coin-out> (2nd) [COIN-OUT, hopper (otherwise pay-error)]
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // <coin-out> (2nd) [COIN-OUT, hopper (otherwise pay-error)]
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DIP1:1")
@@ -602,12 +602,12 @@ static ADDRESS_MAP_START( ramdac_map, AS_0, 8, bmcpokr_state )
ADDRESS_MAP_END
static MACHINE_CONFIG_START( bmcpokr, bmcpokr_state )
- MCFG_CPU_ADD("maincpu", M68000, XTAL_42MHz / 4) // 68000 @10.50MHz (42/4)
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_42MHz / 4) // 68000 @10.50MHz (42/4)
MCFG_CPU_PROGRAM_MAP(bmcpokr_mem)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bmcpokr_state, interrupt, "screen", 0, 1)
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(58.935) // HSync - 15.440kHz, VSync - 58.935Hz
+ MCFG_SCREEN_REFRESH_RATE(58.935) // HSync - 15.440kHz, VSync - 58.935Hz
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
MCFG_SCREEN_UPDATE_DRIVER(bmcpokr_state, screen_update_bmcpokr)
@@ -621,15 +621,15 @@ static MACHINE_CONFIG_START( bmcpokr, bmcpokr_state )
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(10), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) // hopper stuck low if too slow
+ MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(10), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) // hopper stuck low if too slow
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_42MHz / 12) // UM3567 @3.50MHz (42/12)
+ MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_42MHz / 12) // UM3567 @3.50MHz (42/12)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
- MCFG_OKIM6295_ADD("oki", XTAL_42MHz / 40, OKIM6295_PIN7_HIGH) // M6295 @1.05MHz (42/40), pin 7 not verified
+ MCFG_OKIM6295_ADD("oki", XTAL_42MHz / 40, OKIM6295_PIN7_HIGH) // M6295 @1.05MHz (42/40), pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/btoads.c b/src/mame/drivers/btoads.c
index 84fb67b0dbb..9a8ac17909f 100644
--- a/src/mame/drivers/btoads.c
+++ b/src/mame/drivers/btoads.c
@@ -304,7 +304,7 @@ static MACHINE_CONFIG_START( btoads, btoads_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_RGB32_CB(btoads_state, scanline_update) /* scanline updater (RGB32) */
MCFG_TMS340X0_TO_SHIFTREG_CB(btoads_state, to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(btoads_state, from_shiftreg) /* read from shiftreg function */
diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c
index 80331f246be..e31bc6ef33e 100644
--- a/src/mame/drivers/bublbobl.c
+++ b/src/mame/drivers/bublbobl.c
@@ -573,7 +573,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( sboblbobl )
PORT_INCLUDE( sboblboblb )
-
+
PORT_MODIFY( "IN0" )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index 7cef37fb272..3491026395e 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -4,7 +4,7 @@
California Chase (c) 1999 The Game Room
Host Invaders (c) 1998 The Game Room
-
+
driver by Angelo Salese & Grull Osgo
TODO:
@@ -50,7 +50,7 @@ SMC FD37C669QF (QFP100)
connectors for COM1, COM2, LPT1, IDE0, IDE1, floppy etc
uses standard AT PSU
-Video card is Trident TGUI9680 with 512k on-board VRAM
+Video card is Trident TGUI9680 with 512k on-board VRAM
Card is branded "Union UTD73" - these are all over eBay, for instance
RAM is AS4C256K16EO-50JC (x2)
Trident BIOS V5.5 (DIP28). Actual size unknown, dumped as 64k, 128k, 256k and 512k (can only be one of these sizes)
@@ -78,11 +78,11 @@ HDD is WD Caviar 2170. C/H/S = 1010/6/55. Capacity = 170.6MB
The HDD is DOS-readable and in fact the OS is just Windows 98 DOS and can
be easily copied. Tested with another HDD.... formatted with DOS, copied
all files across to new HDD, boots up fine.
-
-
-Host Invaders is the same motherboard and video card as above, but instead of an HDD,
-there is a CD-ROM drive.
-
+
+
+Host Invaders is the same motherboard and video card as above, but instead of an HDD,
+there is a CD-ROM drive.
+
************************************************************************************/
/*
Grull Osgo - Improvements
@@ -744,7 +744,7 @@ ROM_END
ROM_START( hostinv )
ROM_REGION( 0x40000, "bios", 0 )
- ROM_LOAD( "hostinv_bios.bin", 0x000000, 0x020000, CRC(5111e4b8) SHA1(20ab93150b61fd068f269368450734bba5dcb284) )
+ ROM_LOAD( "hostinv_bios.bin", 0x000000, 0x020000, CRC(5111e4b8) SHA1(20ab93150b61fd068f269368450734bba5dcb284) )
ROM_REGION( 0x8000, "video_bios", 0 )
ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) )
@@ -759,7 +759,7 @@ ROM_END
ROM_START( eggsplc )
ROM_REGION( 0x40000, "bios", 0 )
- ROM_LOAD( "hostinv_bios.bin", 0x000000, 0x020000, CRC(5111e4b8) SHA1(20ab93150b61fd068f269368450734bba5dcb284) )
+ ROM_LOAD( "hostinv_bios.bin", 0x000000, 0x020000, CRC(5111e4b8) SHA1(20ab93150b61fd068f269368450734bba5dcb284) )
ROM_REGION( 0x8000, "video_bios", 0 )
ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) )
@@ -775,4 +775,3 @@ ROM_END
GAME( 1998, hostinv, 0, hostinv, calchase, calchase_state, hostinv, ROT0, "The Game Room", "Host Invaders", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
GAME( 1999, calchase, 0, calchase, calchase, calchase_state, calchase, ROT0, "The Game Room", "California Chase", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
GAME( 2002, eggsplc, 0, calchase, calchase, calchase_state, hostinv, ROT0, "The Game Room", "Eggs Playing Chicken", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
-
diff --git a/src/mame/drivers/capr1.c b/src/mame/drivers/capr1.c
index 21fc5dd5db0..dcef968f74b 100644
--- a/src/mame/drivers/capr1.c
+++ b/src/mame/drivers/capr1.c
@@ -3,7 +3,7 @@
/***************************************************************************
Taito Capriccio Z80 crane hardware (let's call it 1st generation)
-
+
These are presumed to be on similar hardware:
- Capriccio 1991
- New Capriccio 1992
@@ -11,10 +11,10 @@
- New Capriccio 2 1993
- Capriccio Spin 1994
- Capriccio Spin 2 1996
-
+
The next released game of this series is Capriccio Cyclone, see caprcyc.c
More games were released after this.
-
+
TODO:
- get cspin2 working a bit:
* unknown reads and writes
@@ -56,12 +56,12 @@ public:
static ADDRESS_MAP_START( cspin2_map, AS_PROGRAM, 8, capr1_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x9fff) AM_RAM
-// AM_RANGE(0xa000, 0xa01f) AM_RAM // wrong
+// AM_RANGE(0xa000, 0xa01f) AM_RAM // wrong
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ym", ym2203_device, read, write)
-// AM_RANGE(0xc004, 0xc005) AM_WRITENOP
-// AM_RANGE(0xc008, 0xc009) AM_WRITENOP
-// AM_RANGE(0xc00c, 0xc00d) AM_WRITENOP
-// AM_RANGE(0xc00d, 0xc00d) AM_DEVREADWRITE("oki", okim6295_device, read, write)
+// AM_RANGE(0xc004, 0xc005) AM_WRITENOP
+// AM_RANGE(0xc008, 0xc009) AM_WRITENOP
+// AM_RANGE(0xc00c, 0xc00d) AM_WRITENOP
+// AM_RANGE(0xc00d, 0xc00d) AM_DEVREADWRITE("oki", okim6295_device, read, write)
ADDRESS_MAP_END
@@ -83,7 +83,7 @@ static INPUT_PORTS_START( cspin2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 )
-
+
PORT_START("IN1")
PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" )
PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" )
diff --git a/src/mame/drivers/caprcyc.c b/src/mame/drivers/caprcyc.c
index f99bbfe5f8a..91eedfd14f3 100644
--- a/src/mame/drivers/caprcyc.c
+++ b/src/mame/drivers/caprcyc.c
@@ -3,13 +3,13 @@
/***************************************************************************
Taito Capriccio Cyclone crane hardware
-
+
Main PCB: NEC uPD30200GD-100-MBB VR4300, Galileo GT-64111 (system controller?), ...
Sound PCB: Panasonic MN1020819 (has internal ROM), Zoom ZSG-2. No effects DSP!
-
+
Like most other Taito Capriccio cabinets, it has two cranes. There are
no 7seg leds on the cranes this time, some colour lamps instead.
-
+
TODO:
- everything
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 51e1be99bbd..0007ffa61cf 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -1876,14 +1876,14 @@ MACHINE_CONFIG_END
*************************************/
/*
- Alt. part numbers for mask ROMs:
-
- 136001-*03 = 136001-*07
- 136001-*04 = 136001-*08
- 136001-*05 = 136001-*09
- 136001-*06 = 136001-*10
- 136001-*01 = 136001-*11
- 136001-*02 = 136001-*12
+ Alt. part numbers for mask ROMs:
+
+ 136001-*03 = 136001-*07
+ 136001-*04 = 136001-*08
+ 136001-*05 = 136001-*09
+ 136001-*06 = 136001-*10
+ 136001-*01 = 136001-*11
+ 136001-*02 = 136001-*12
*/
ROM_START( centiped )
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index ea4c819c84e..827542de9c0 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -178,7 +178,7 @@ static ADDRESS_MAP_START( chqflag_sound_map, AS_PROGRAM, 8, chqflag_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
AM_RANGE(0x9000, 0x9000) AM_WRITE(k007232_bankswitch_w) /* 007232 bankswitch */
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE("k007232_1", k007232_device, read, write) /* 007232 (chip 1) */
- AM_RANGE(0xa01c, 0xa01c) AM_WRITE(k007232_extvolume_w) /* extra volume, goes to the 007232 w/ A4 */
+ AM_RANGE(0xa01c, 0xa01c) AM_WRITE(k007232_extvolume_w) /* extra volume, goes to the 007232 w/ A4 */
/* selecting a different latch for the external port */
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232_2", k007232_device, read, write) /* 007232 (chip 2) */
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
diff --git a/src/mame/drivers/coinmvga.c b/src/mame/drivers/coinmvga.c
index dd7129ca32b..214ddb97b98 100644
--- a/src/mame/drivers/coinmvga.c
+++ b/src/mame/drivers/coinmvga.c
@@ -187,7 +187,7 @@
- Added Colorama (P521 V13, Spanish).
- Changed the Colorama parent set description to Colorama (P521, English).
- - Added technical notes.
+ - Added technical notes.
[2009-08-18]
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 880e013ddd6..69addc678c0 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -833,7 +833,7 @@ static MACHINE_CONFIG_START( coolpool, coolpool_state )
MCFG_TMS340X0_SCANLINE_RGB32_CB(coolpool_state, coolpool_scanline) /* scanline callback (rgb32) */
MCFG_TMS340X0_TO_SHIFTREG_CB(coolpool_state, to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(coolpool_state, from_shiftreg) /* read from shiftreg function */
-
+
MCFG_CPU_ADD("dsp", TMS32026,XTAL_40MHz)
MCFG_CPU_PROGRAM_MAP(coolpool_dsp_pgm_map)
MCFG_CPU_IO_MAP(coolpool_dsp_io_map)
diff --git a/src/mame/drivers/cops.c b/src/mame/drivers/cops.c
index 579f9120124..93d73368711 100644
--- a/src/mame/drivers/cops.c
+++ b/src/mame/drivers/cops.c
@@ -4,19 +4,19 @@
(hardware developed by Nova Productions Limited)
Preliminary driver by Mariusz Wojcieszek, James Wallace
- Cops uses a Sony CD-ROM in addition to the regular setup, purely to play
- Bad Boys by Inner Circle, so there is muscial accompaniment to areas
- where the laserdisc audio is muted.
+ Cops uses a Sony CD-ROM in addition to the regular setup, purely to play
+ Bad Boys by Inner Circle, so there is muscial accompaniment to areas
+ where the laserdisc audio is muted.
- NOTES: To boot up Revelations, turn the refill key (R) and press button A.
+ NOTES: To boot up Revelations, turn the refill key (R) and press button A.
TODO: There are probably more ROMs for Revelations, the disc contains
- full data for a picture based memory game called 'Vision Quest'.
-
- LaserMax memory map needs sorting out, Cops uses a subset of what's
- actually available
+ full data for a picture based memory game called 'Vision Quest'.
+
+ LaserMax memory map needs sorting out, Cops uses a subset of what's
+ actually available
The UK version COPS appears to want to communicate with the LDP in a
- different way.
+ different way.
***************************************************************************/
@@ -355,7 +355,7 @@ void cops_state::laserdisc_w(UINT8 data)
*
*************************************/
- void cops_state::update_dacia_irq()
+ void cops_state::update_dacia_irq()
{
UINT8 isr = generate_isr();
//remove bits
@@ -390,11 +390,11 @@ void cops_state::dacia_receive(UINT8 data)
UINT8 cops_state::generate_isr()
{
UINT8 isr =0;
-
+
isr |= m_dacia_receiver_full;
isr |= (m_dacia_cmp1 << 1);
- isr |= (m_dacia_trans <<4);
-
+ isr |= (m_dacia_trans <<4);
+
if (isr)
{
isr |= 0x40;
@@ -413,17 +413,17 @@ READ8_MEMBER(cops_state::dacia_r)
m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
return isr;
}
-
+
case 1: /* CSR1: Control Status Register */
{
UINT8 csr =0;
csr |= m_dacia_rts1;
csr |= (m_dacia_dtr1 << 1);
- csr |= (m_dacia_cts <<4);
- csr |= (m_dacia_fe1 <<7);
+ csr |= (m_dacia_cts <<4);
+ csr |= (m_dacia_fe1 <<7);
if (LOG_DACIA) logerror("CSR1 %02x\n",csr);
return csr;
- }
+ }
case 3: /* RDR1: Receive data register */
m_dacia_receiver_full = 0;
@@ -463,8 +463,8 @@ WRITE8_MEMBER(cops_state::dacia_w)
{
m_dacia_rts1 = (data & 0x01);
m_dacia_dtr1 = (data & 0x02 ? 1:0);
- m_parity_1 = (data & 0x04);
- m_parity_mode_1 = ((data & 0x18) >> 3);
+ m_parity_1 = (data & 0x04);
+ m_parity_mode_1 = ((data & 0x18) >> 3);
m_bpc_1 = ((data & 0x60) >> 5) +5;
if (LOG_DACIA) logerror("DACIA Format Register: %02x\n", data);
}
@@ -479,29 +479,29 @@ WRITE8_MEMBER(cops_state::dacia_w)
}
else
{
- m_dacia_reg1 = CMP_REGISTER;
+ m_dacia_reg1 = CMP_REGISTER;
}
if (LOG_DACIA) logerror("DACIA TIME %02d\n", XTAL_3_6864MHz / m_dacia_ic_div_1);
-
+
m_ld_timer->adjust(attotime::from_hz(XTAL_3_6864MHz / m_dacia_ic_div_1), 0, attotime::from_hz(XTAL_3_6864MHz / m_dacia_ic_div_1));
if (LOG_DACIA) logerror("DACIA Ctrl Register: %02x\n", data);
-
+
}
break;
- }
+ }
case 2: /* Compare / Aux Ctrl Register 1 */
{
- if (m_dacia_reg1 == CMP_REGISTER)
+ if (m_dacia_reg1 == CMP_REGISTER)
{
m_dacia_cmp1 =1;
m_dacia_cmpval1=data;
- if (LOG_DACIA) logerror("DACIA Compare mode: %02x \n", data);
-// update_dacia_irq();
+ if (LOG_DACIA) logerror("DACIA Compare mode: %02x \n", data);
+// update_dacia_irq();
}
else
{
- if (LOG_DACIA) logerror("DACIA Aux ctrl: %02x \n", data);
+ if (LOG_DACIA) logerror("DACIA Aux ctrl: %02x \n", data);
}
}
case 3: /* Transmit Data Register 1 */
@@ -869,7 +869,7 @@ static MACHINE_CONFIG_START( cops, cops_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
-
+
/* TODO: Verify clock */
MCFG_SOUND_ADD("snsnd", SN76489, MAIN_CLOCK/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
@@ -908,6 +908,6 @@ ROM_START( revlatns )
ROM_END
-GAMEL( 1994, cops, 0, cops, cops, cops_state, cops, ROT0, "Atari Games", "Cops (USA)", GAME_NOT_WORKING | GAME_NO_SOUND, layout_cops )
-GAMEL( 1994, copsuk, cops,cops, cops, cops_state, cops, ROT0, "Nova Productions / Deith Leisure","Cops (UK)", GAME_NOT_WORKING | GAME_NO_SOUND, layout_cops )
-GAMEL( 1994, revlatns, 0, cops, revlatns, cops_state, cops, ROT0, "Nova Productions", "Revelations", GAME_NOT_WORKING | GAME_NO_SOUND, layout_cops )
+GAMEL( 1994, cops, 0, cops, cops, cops_state, cops, ROT0, "Atari Games", "Cops (USA)", GAME_NOT_WORKING | GAME_NO_SOUND, layout_cops )
+GAMEL( 1994, copsuk, cops,cops, cops, cops_state, cops, ROT0, "Nova Productions / Deith Leisure","Cops (UK)", GAME_NOT_WORKING | GAME_NO_SOUND, layout_cops )
+GAMEL( 1994, revlatns, 0, cops, revlatns, cops_state, cops, ROT0, "Nova Productions", "Revelations", GAME_NOT_WORKING | GAME_NO_SOUND, layout_cops )
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index d2e60225c82..f8af1c4c607 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -6834,13 +6834,13 @@ ROM_START( sf2ebbl2 )
ROM_CONTINUE( 0x000006, 0x80000)
ROMX_LOAD( "b-se194.bin", 0x200000, 0x80000, CRC(5726cab8) SHA1(0b2243a9a7184d53d42ddab7a8c51b63001c2f56) , ROM_GROUPWORD | ROM_SKIP(6) )
ROM_CONTINUE( 0x200004, 0x80000)
- ROMX_LOAD( "d-se064.bin", 0x200002, 0x80000, CRC(4dd24197) SHA1(548beaa0a6f1c3c88f4fc83169d1a3c86e0755d4) , ROM_GROUPWORD | ROM_SKIP(6) ) //sf2-8m.6c 99.999809%
+ ROMX_LOAD( "d-se064.bin", 0x200002, 0x80000, CRC(4dd24197) SHA1(548beaa0a6f1c3c88f4fc83169d1a3c86e0755d4) , ROM_GROUPWORD | ROM_SKIP(6) ) //sf2-8m.6c 99.999809%
ROM_CONTINUE( 0x200006, 0x80000)
ROMX_LOAD( "e-sf004.bin", 0x400000, 0x80000, CRC(187667cc) SHA1(fae65bf23f49a32903fda8080659ccf8d42b911f) , ROM_GROUPWORD | ROM_SKIP(6) )
ROM_CONTINUE( 0x400004, 0x80000)
ROMX_LOAD( "f-sf001.bin", 0x400002, 0x80000, CRC(5b585071) SHA1(ad3371b1ba0441c67d9fcbb23b09464710e4e28a) , ROM_GROUPWORD | ROM_SKIP(6) )
ROM_CONTINUE( 0x400006, 0x80000)
-
+
// These map over the MASK roms on this bootleg why? isn't it a waste of eprom?
ROMX_LOAD( "27c1024.10", 0x400000, 0x20000, CRC(84427d1b) SHA1(f988a2b53c8cc46eeb8032084f24966a539b3734) , ROM_GROUPWORD | ROM_SKIP(6) )//e-sf004.bin [1/8] IDENTICAL
ROMX_LOAD( "27c1024.12", 0x400002, 0x20000, CRC(55bc790c) SHA1(a1114b89f6fa4487210477676984c77ad94b5ef8) , ROM_GROUPWORD | ROM_SKIP(6) )//f-sf001.bin [1/8] IDENTICAL
@@ -6867,25 +6867,25 @@ ROM_START( sf2ebbl3 )
ROM_REGION( 0x600000, "gfx", 0 )
/* There are 8 mask and 8 otp eprom on this board, data match sf2 set in the end */
- ROMX_LOAD( "1-b-yf197.07", 0x000000, 0x80000, CRC(22c9cc8e) SHA1(b9194fb337b30502c1c9501cd6c64ae4035544d4) , ROM_GROUPWORD | ROM_SKIP(6) )
- ROMX_LOAD( "1-d-yf207.12", 0x000002, 0x80000, CRC(57213be8) SHA1(3759b851ac0904ec79cbb67a2264d384b6f2f9f9) , ROM_GROUPWORD | ROM_SKIP(6) )
- ROMX_LOAD( "27020.1", 0x000004, 0x40000, CRC(84afb959) SHA1(ff8f3fb39203d229552649b09046a509aa399b7d) , ROM_SKIP(7) )
- ROMX_LOAD( "27020.3", 0x000005, 0x40000, CRC(ab21635d) SHA1(c6294b06c482a43cc1736674b0c1bc790da8cc8c) , ROM_SKIP(7) )
- ROMX_LOAD( "27020.5", 0x000006, 0x40000, CRC(2ce56f9f) SHA1(5bd23823df52aeff8e84a6eb3199a5e75f38cd42) , ROM_SKIP(7) )
- ROMX_LOAD( "27020.7", 0x000007, 0x40000, CRC(0ad7fb2b) SHA1(51265b331cbbe9d133274bafdbf043151240a20d) , ROM_SKIP(7) )
-
- ROMX_LOAD( "27020.2", 0x200000, 0x40000, CRC(031525cc) SHA1(65e280607c058cf9c005a6fc809ed375d379c0bf) , ROM_SKIP(7) )
- ROMX_LOAD( "27020.4", 0x200001, 0x40000, CRC(c97046a5) SHA1(88c7becaa2713c85e22ddd3e2305770525a9132b) , ROM_SKIP(7) )
- ROMX_LOAD( "1-h-yg010.10", 0x200002, 0x80000, CRC(b5548f17) SHA1(baa92b91cf616bc9e2a8a66adc777ffbf962a51b) , ROM_GROUPWORD | ROM_SKIP(6) )
- ROMX_LOAD( "1-e-yg003.02", 0x200004, 0x80000, CRC(14b84312) SHA1(2eea16673e60ba7a10bd4d8f6c217bb2441a5b0e) , ROM_GROUPWORD | ROM_SKIP(6) )
- ROMX_LOAD( "27020.6", 0x200006, 0x40000, CRC(dbbfd400) SHA1(fc25928b6ed025fa2397d924bae93fd28a4e728f) , ROM_SKIP(7) )
- ROMX_LOAD( "27020.8", 0x200007, 0x40000, CRC(37635e97) SHA1(b4e5dd6e93174af76aaeeb47471ded0d0bc253e2) , ROM_SKIP(7) )
-
- ROMX_LOAD( "1-j-yf213.09", 0x400000, 0x80000, CRC(994bfa58) SHA1(5669b845f624b10e7be56bfc89b76592258ce48b) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "1-b-yf197.07", 0x000000, 0x80000, CRC(22c9cc8e) SHA1(b9194fb337b30502c1c9501cd6c64ae4035544d4) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "1-d-yf207.12", 0x000002, 0x80000, CRC(57213be8) SHA1(3759b851ac0904ec79cbb67a2264d384b6f2f9f9) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "27020.1", 0x000004, 0x40000, CRC(84afb959) SHA1(ff8f3fb39203d229552649b09046a509aa399b7d) , ROM_SKIP(7) )
+ ROMX_LOAD( "27020.3", 0x000005, 0x40000, CRC(ab21635d) SHA1(c6294b06c482a43cc1736674b0c1bc790da8cc8c) , ROM_SKIP(7) )
+ ROMX_LOAD( "27020.5", 0x000006, 0x40000, CRC(2ce56f9f) SHA1(5bd23823df52aeff8e84a6eb3199a5e75f38cd42) , ROM_SKIP(7) )
+ ROMX_LOAD( "27020.7", 0x000007, 0x40000, CRC(0ad7fb2b) SHA1(51265b331cbbe9d133274bafdbf043151240a20d) , ROM_SKIP(7) )
+
+ ROMX_LOAD( "27020.2", 0x200000, 0x40000, CRC(031525cc) SHA1(65e280607c058cf9c005a6fc809ed375d379c0bf) , ROM_SKIP(7) )
+ ROMX_LOAD( "27020.4", 0x200001, 0x40000, CRC(c97046a5) SHA1(88c7becaa2713c85e22ddd3e2305770525a9132b) , ROM_SKIP(7) )
+ ROMX_LOAD( "1-h-yg010.10", 0x200002, 0x80000, CRC(b5548f17) SHA1(baa92b91cf616bc9e2a8a66adc777ffbf962a51b) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "1-e-yg003.02", 0x200004, 0x80000, CRC(14b84312) SHA1(2eea16673e60ba7a10bd4d8f6c217bb2441a5b0e) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "27020.6", 0x200006, 0x40000, CRC(dbbfd400) SHA1(fc25928b6ed025fa2397d924bae93fd28a4e728f) , ROM_SKIP(7) )
+ ROMX_LOAD( "27020.8", 0x200007, 0x40000, CRC(37635e97) SHA1(b4e5dd6e93174af76aaeeb47471ded0d0bc253e2) , ROM_SKIP(7) )
+
+ ROMX_LOAD( "1-j-yf213.09", 0x400000, 0x80000, CRC(994bfa58) SHA1(5669b845f624b10e7be56bfc89b76592258ce48b) , ROM_GROUPWORD | ROM_SKIP(6) )
ROMX_LOAD( "wm91m-11-yd025.11", 0x400002, 0x80000, CRC(3e66ad9d) SHA1(9af9df0826988872662753e9717c48d46f2974b0) , ROM_GROUPWORD | ROM_SKIP(6) )
- ROMX_LOAD( "1-i-yf224.03", 0x400004, 0x80000, CRC(c1befaa8) SHA1(a6a7f4725e52678cbd8d557285c01cdccb2c2602) , ROM_GROUPWORD | ROM_SKIP(6) )
- ROMX_LOAD( "1-k-yf036.06", 0x400006, 0x80000, CRC(0627c831) SHA1(f9a92d614e8877d648449de2612fc8b43c85e4c2) , ROM_GROUPWORD | ROM_SKIP(6) )
-
+ ROMX_LOAD( "1-i-yf224.03", 0x400004, 0x80000, CRC(c1befaa8) SHA1(a6a7f4725e52678cbd8d557285c01cdccb2c2602) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "1-k-yf036.06", 0x400006, 0x80000, CRC(0627c831) SHA1(f9a92d614e8877d648449de2612fc8b43c85e4c2) , ROM_GROUPWORD | ROM_SKIP(6) )
+
/* These map over the MASK roms on this bootleg to get rid of the CAPCOM logo (wasteful, but correct) */
ROMX_LOAD( "27010.09hi", 0x400000, 0x10000, CRC(a505621e) SHA1(8ffa8cedad54948870bbd8f629d927332dc9fcf6) , ROM_SKIP(7) )
ROM_CONTINUE( 0x400004, 0x10000 )
@@ -11613,7 +11613,7 @@ GAME( 1991, sf2jh, sf2, cps1_10MHz, sf2j, cps_state, cps1,
GAME( 1991, sf2jl, sf2, cps1_10MHz, sf2j, cps_state, cps1, ROT0, "Capcom", "Street Fighter II: The World Warrior (Japan 920312)", GAME_SUPPORTS_SAVE )
GAME( 1992, sf2ebbl, sf2, cps1_10MHz, sf2hack, cps_state, sf2hack, ROT0, "bootleg", "Street Fighter II: The World Warrior (TAB Austria, bootleg, set 1)", GAME_SUPPORTS_SAVE ) // 910214 - based on World version
GAME( 1992, sf2ebbl2, sf2, cps1_10MHz, sf2hack, cps_state, sf2hack, ROT0, "bootleg", "Street Fighter II: The World Warrior (TAB Austria, bootleg, set 3)", GAME_SUPPORTS_SAVE ) // 910214 - based on World version
-GAME( 1992, sf2ebbl3, sf2, cps1_10MHz, sf2hack, cps_state, sf2hack, ROT0, "bootleg", "Street Fighter II: The World Warrior (TAB Austria, bootleg, set 4)", GAME_SUPPORTS_SAVE ) // 910214 - based on World version
+GAME( 1992, sf2ebbl3, sf2, cps1_10MHz, sf2hack, cps_state, sf2hack, ROT0, "bootleg", "Street Fighter II: The World Warrior (TAB Austria, bootleg, set 4)", GAME_SUPPORTS_SAVE ) // 910214 - based on World version
GAME( 1992, sf2stt, sf2, cps1_10MHz, sf2hack, cps_state, sf2hack, ROT0, "bootleg", "Street Fighter II: The World Warrior (TAB Austria, bootleg, set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // 910214 - based on World version
GAME( 1992, sf2rk, sf2, cps1_10MHz, sf2hack, cps_state, sf2hack, ROT0, "bootleg", "Street Fighter II: The World Warrior (RK, bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // 920211 (pcb)
GAME( 1991, sf2qp1, sf2, cps1_10MHz, sf2, cps_state, cps1, ROT0, "bootleg", "Street Fighter II: The World Warrior (Quicken Pt-I, bootleg)", GAME_SUPPORTS_SAVE ) // 910214 - based on World version
diff --git a/src/mame/drivers/cv1k.c b/src/mame/drivers/cv1k.c
index 119aad93fe4..5177b9ecf83 100644
--- a/src/mame/drivers/cv1k.c
+++ b/src/mame/drivers/cv1k.c
@@ -514,7 +514,7 @@ ROM_START( mushisama )
ROM_RELOAD(0x200000,0x200000)
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
-// ROM_LOAD("mushisama_u2", 0x000000, 0x8400000, CRC(f1e0cf65) SHA1(d00d950422309fdf08efe1e2d5f040beb45ee6fb) ) // bad rom, one corrupt asset vs. below
+// ROM_LOAD("mushisama_u2", 0x000000, 0x8400000, CRC(f1e0cf65) SHA1(d00d950422309fdf08efe1e2d5f040beb45ee6fb) ) // bad rom, one corrupt asset vs. below
ROM_LOAD("mushisam_u2", 0x000000, 0x8400000, CRC(4f0a842a) SHA1(33f3550ec676a7088b6348cd72c16cc6594afb84) ) /* (2004/10/12.MASTER VER.) */
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
@@ -528,7 +528,7 @@ ROM_START( mushisamb )
ROM_RELOAD(0x200000,0x200000)
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
-// ROM_LOAD("mushisamb_u2", 0x000000, 0x8400000, CRC(6cc9d1a9) SHA1(17907798dce1defadd10354cec6c8d364e045570) ) // bad rom, one corrupt asset vs. below
+// ROM_LOAD("mushisamb_u2", 0x000000, 0x8400000, CRC(6cc9d1a9) SHA1(17907798dce1defadd10354cec6c8d364e045570) ) // bad rom, one corrupt asset vs. below
ROM_LOAD("mushisam_u2", 0x000000, 0x8400000, CRC(4f0a842a) SHA1(33f3550ec676a7088b6348cd72c16cc6594afb84) ) /* (2004/10/12.MASTER VER.) */
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
@@ -568,7 +568,7 @@ ROM_START( mushitama )
ROM_RELOAD(0x200000,0x200000)
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
-// ROM_LOAD("mushitama_u2", 0x000000, 0x8400000, CRC(3f93ff82) SHA1(6f6c250aa7134016ffb288d056bc937ea311f538) ) // recycled ROM - only unused areas differ
+// ROM_LOAD("mushitama_u2", 0x000000, 0x8400000, CRC(3f93ff82) SHA1(6f6c250aa7134016ffb288d056bc937ea311f538) ) // recycled ROM - only unused areas differ
ROM_LOAD("mushitam_u2", 0x000000, 0x8400000, CRC(8ba498ab) SHA1(459c0b4ab831bbe019bdd5b0ac56955948b9e3a6) ) /* (2005/09/09.MASTER VER) */
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
@@ -595,7 +595,7 @@ ROM_START( futari15a )
ROM_RELOAD(0x200000,0x200000)
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
-// ROM_LOAD("futari15a_u2", 0x000000, 0x8400000, CRC(b9d815f9) SHA1(6b6f668b0bbb087ffac65e4f0d8bd9d5b28eeb28) ) // recycled ROM - only unused areas differ
+// ROM_LOAD("futari15a_u2", 0x000000, 0x8400000, CRC(b9d815f9) SHA1(6b6f668b0bbb087ffac65e4f0d8bd9d5b28eeb28) ) // recycled ROM - only unused areas differ
ROM_LOAD("futari15_u2", 0x000000, 0x8400000, CRC(b9eae1fc) SHA1(410f8e7cfcbfd271b41fb4f8d049a13a3191a1f9) ) /* (2006/12/8.MAST VER. 1.54.) */
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index e5f2c73e74e..62b3781e5f3 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -1000,8 +1000,8 @@ INPUT_PORTS_END
static INPUT_PORTS_START( dkongx )
/* Supposedly the physical DIPS are read as defaults for the NVRAM when it's initially created.
- The settings here match those from the default DSW0 settings. Beyond the initial NVRAM
- creation, DIPS (other than CABINET) can only be adjusted from the Service Mode */
+ The settings here match those from the default DSW0 settings. Beyond the initial NVRAM
+ creation, DIPS (other than CABINET) can only be adjusted from the Service Mode */
PORT_INCLUDE( dkong )
PORT_MODIFY("DSW0")
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index 8ae0f03cd28..8abbd89d224 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -769,7 +769,7 @@ ROM_START( dlair_1 ) /* Serial #001, courtesy Jason Finn */
DISK_IMAGE_READONLY( "dlair", 0, NO_DUMP )
ROM_END
-ROM_START( dlair_2 )
+ROM_START( dlair_2 )
ROM_REGION( 0xa000, "maincpu", 0 )
ROM_LOAD( "dlu1.bin", 0x0000, 0x2000, CRC(ea6d5498) SHA1(1d854c04e0074e693e791e22a4c9cc21d5175d95) )
ROM_LOAD( "dlu2.bin", 0x2000, 0x2000, CRC(ffe84a95) SHA1(675ce2e68e43beb1f389bc6ab1a55bee862a1440) )
diff --git a/src/mame/drivers/dlair2.c b/src/mame/drivers/dlair2.c
index 53596643f74..865068c6a22 100644
--- a/src/mame/drivers/dlair2.c
+++ b/src/mame/drivers/dlair2.c
@@ -268,7 +268,7 @@ ROM_START( dlair2_200 )
ROM_REGION( 0x2000, "bios", 0 ) /* BIOS for proto board */
ROM_LOAD( "dl2_amoa_proto_bios_mod_56ee.bin",0x00000, 0x2000, CRC(1fc21576) SHA1(dc5443f6a8d80ec8148314244f05ac0290e380ea) )
-
+
ROM_END
ROM_START( spacea91 )
diff --git a/src/mame/drivers/dragrace.c b/src/mame/drivers/dragrace.c
index 7b3272ffe8c..858663b4637 100644
--- a/src/mame/drivers/dragrace.c
+++ b/src/mame/drivers/dragrace.c
@@ -84,7 +84,7 @@ void dragrace_state::dragrace_update_misc_flags( address_space &space )
m_discrete->write(space, DRAGRACE_ATTRACT_EN, (m_misc_flags & 0x00001000) ? 1: 0); // Attract enable
m_discrete->write(space, DRAGRACE_LOTONE_EN, (m_misc_flags & 0x00002000) ? 1: 0); // LoTone enable
m_discrete->write(space, DRAGRACE_HITONE_EN, (m_misc_flags & 0x20000000) ? 1: 0); // HiTone enable
-
+
// the tachometers are driven from the same frequency generator that creates the engine sound
output_set_value("tachometer", ~m_misc_flags & 0x0000001f);
output_set_value("tachometer2", (~m_misc_flags & 0x001f0000) >> 0x10);
diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c
index 5a9bd8306c1..741f54f2854 100644
--- a/src/mame/drivers/fcrash.c
+++ b/src/mame/drivers/fcrash.c
@@ -2532,7 +2532,7 @@ DRIVER_INIT_MEMBER(cps_state, sf2m1)
mem16[0x64E/2] = 0x6046; // fix priorities
DRIVER_INIT_CALL(dinopic);
-
+
}
@@ -2664,7 +2664,7 @@ ROM_START( sf2m9 )
ROM_LOAD16_BYTE( "27040.5", 0x000001, 0x80000, CRC(137d5f2e) SHA1(835e9b767e6499f161c5c4fd9a31a9f54b3ee68f) )
ROM_LOAD16_BYTE( "27010.4", 0x100000, 0x20000, CRC(8226c11c) SHA1(9588bd64e338901394805aca8a234f880674dc60) )
ROM_LOAD16_BYTE( "27010.3", 0x100001, 0x20000, CRC(924c6ce2) SHA1(676a912652bd75da5087f0c7eae047b7681a993c) )
-
+
ROM_REGION( 0x600000, "gfx", 0 )
ROMX_LOAD( "tat-01.bin", 0x000000, 0x40000, CRC(a887f7d4) SHA1(d7e0c46b3ab1c6352f45033cb9e610d9c34d51fb), ROM_SKIP(7) )
@@ -2675,7 +2675,7 @@ ROM_START( sf2m9 )
ROM_CONTINUE( 0x000006, 0x40000)
ROMX_LOAD( "tat-06.bin", 0x000003, 0x40000, CRC(90f2053e) SHA1(a78710421e702b410650c45c3dec21bf16799fb4), ROM_SKIP(7) )
ROM_CONTINUE( 0x000007, 0x40000)
-
+
ROMX_LOAD( "tat-03.bin", 0x200000, 0x40000, CRC(79fa8bf0) SHA1(9f8f7b8dc54a75226beb017b9ca9fd62a9e42f6b), ROM_SKIP(7) )
ROM_CONTINUE( 0x200004, 0x40000)
ROMX_LOAD( "tat-07.bin", 0x200001, 0x40000, CRC(6a5f153c) SHA1(f3d82ad01e2e4bdb2039815747fa14399c69753a), ROM_SKIP(7) )
@@ -2693,17 +2693,17 @@ ROM_START( sf2m9 )
ROM_CONTINUE( 0x400006, 0x40000)
ROMX_LOAD( "tat-12.bin", 0x400003, 0x40000, CRC(6ee19b94) SHA1(c45119d04879b6ca23a3f7749175c56b381b43f2), ROM_SKIP(7) )
ROM_CONTINUE( 0x400007, 0x40000)
-
+
ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
ROM_LOAD( "27512.1", 0x00000, 0x08000, CRC(08f6b60e) SHA1(8258fcaca4ac419312531eec67079b97f471179c) )
ROM_CONTINUE( 0x10000, 0x08000 )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "27020.2", 0x00000, 0x40000, CRC(6cfffb11) SHA1(995526183ffd35f92e9096500a3fe6237faaa2dd) )
-
+
ROM_REGION( 0x00c8d, "pld", 0 ) /* pal/gal */
ROM_LOAD( "gal20v8.68kadd", 0x00000, 0x00c8d, CRC(27cdd376) SHA1(9fb5844b33002bec80fb92d3e5d1bbc779087300) )//68k address decoder
-
+
ROM_END
DRIVER_INIT_MEMBER(cps_state, sf2mdt)
diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c
index c6a25cfaa09..841cb7a2b89 100644
--- a/src/mame/drivers/foodf.c
+++ b/src/mame/drivers/foodf.c
@@ -411,7 +411,7 @@ ROM_START( foodf )
ROM_REGION( 0x100, "proms", 0 )
ROM_LOAD( "136020-112.2p", 0x000000, 0x000100, CRC(0aa962d6) SHA1(efb51e4c95efb1b85206c416c1d6d35c6f4ff35c) )
-
+
ROM_REGION( 0x100, "nvram", 0 ) // default initialized nvram
ROM_LOAD( "foodf.nv", 0x000000, 0x000100, CRC(a4186b13) SHA1(7633ceb6f61403a46e36cc2172839e6c3f31bac2) )
ROM_END
@@ -437,7 +437,7 @@ ROM_START( foodf2 )
ROM_REGION( 0x100, "proms", 0 )
ROM_LOAD( "136020-112.2p", 0x000000, 0x000100, CRC(0aa962d6) SHA1(efb51e4c95efb1b85206c416c1d6d35c6f4ff35c) )
-
+
ROM_REGION( 0x100, "nvram", 0 ) // default initialized nvram
ROM_LOAD( "foodf.nv", 0x000000, 0x000100, CRC(a4186b13) SHA1(7633ceb6f61403a46e36cc2172839e6c3f31bac2) )
ROM_END
@@ -463,7 +463,7 @@ ROM_START( foodf1 )
ROM_REGION( 0x100, "proms", 0 )
ROM_LOAD( "136020-112.2p", 0x000000, 0x000100, CRC(0aa962d6) SHA1(efb51e4c95efb1b85206c416c1d6d35c6f4ff35c) )
-
+
ROM_REGION( 0x100, "nvram", 0 ) // default initialized nvram
ROM_LOAD( "foodf.nv", 0x000000, 0x000100, CRC(a4186b13) SHA1(7633ceb6f61403a46e36cc2172839e6c3f31bac2) )
ROM_END
@@ -489,7 +489,7 @@ ROM_START( foodfc )
ROM_REGION( 0x100, "proms", 0 )
ROM_LOAD( "136020-112.2p", 0x000000, 0x000100, CRC(0aa962d6) SHA1(efb51e4c95efb1b85206c416c1d6d35c6f4ff35c) )
-
+
ROM_REGION( 0x100, "nvram", 0 ) // default initialized nvram, differs from the other sets
ROM_LOAD( "foodfc.nv", 0x000000, 0x000100, CRC(c1385dab) SHA1(52f4dc772e5da0f7c9bcef6c6ef3a655dcd3d59d) )
ROM_END
diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c
index be6b3a03c20..5ac172d99e8 100644
--- a/src/mame/drivers/fuukifg2.c
+++ b/src/mame/drivers/fuukifg2.c
@@ -238,7 +238,7 @@ static INPUT_PORTS_START( gogomile )
INPUT_PORTS_END
-static INPUT_PORTS_START( gogomileo ) /* The ealier version has different coinage settings. */
+static INPUT_PORTS_START( gogomileo ) /* The ealier version has different coinage settings. */
PORT_INCLUDE( gogomile )
PORT_MODIFY("DSW") // $880000.w
diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c
index 4e37fc38d8d..0ae049adba3 100644
--- a/src/mame/drivers/gaiden.c
+++ b/src/mame/drivers/gaiden.c
@@ -1160,7 +1160,7 @@ Dumped from an original Tecmo board. Board No. 6215-A. Serial A-59488.
ROM_START( ryukendna )
ROM_REGION( 0x40000, "maincpu", 0 ) /* 2*128k for 68000 code */
ROM_LOAD16_BYTE( "1.3s", 0x00000, 0x20000, CRC(5532e302) SHA1(8ce48963ba737890d1a46c42a113d9419a3c174c) ) // found on 2 pcbs
-// ROM_LOAD16_BYTE( "1.3s", 0x00000, 0x20000, CRC(0ed5464c) SHA1(2eab6650ad1c38cd560ec3d084f47156756c97a4) ) 2 bytes different ( 022a : 50 instead of 51, 12f9 : 6b instead of 6a) - possible bad rom
+// ROM_LOAD16_BYTE( "1.3s", 0x00000, 0x20000, CRC(0ed5464c) SHA1(2eab6650ad1c38cd560ec3d084f47156756c97a4) ) 2 bytes different ( 022a : 50 instead of 51, 12f9 : 6b instead of 6a) - possible bad rom
ROM_LOAD16_BYTE( "2.4s", 0x00001, 0x20000, CRC(a93a8256) SHA1(6bf6c189f82cb9341d3427a822de83cbaed27bc0) )
ROM_REGION( 0x10000, "audiocpu", 0 )
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index 9905578beb8..1076c031eeb 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -1697,8 +1697,8 @@ static ADDRESS_MAP_START( froggeram_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xb801, 0xb801) AM_WRITE(irq_enable_w)
AM_RANGE(0xb806, 0xb806) AM_WRITE(galaxian_flip_screen_x_w)
AM_RANGE(0xb807, 0xb807) AM_WRITE(galaxian_flip_screen_y_w)
-// AM_RANGE(0xb818, 0xb818) AM_WRITE(coin_count_0_w) /* IOPC7 */
-// AM_RANGE(0xb81c, 0xb81c) AM_WRITE(coin_count_1_w) /* POUT1 */
+// AM_RANGE(0xb818, 0xb818) AM_WRITE(coin_count_0_w) /* IOPC7 */
+// AM_RANGE(0xb81c, 0xb81c) AM_WRITE(coin_count_1_w) /* POUT1 */
// todo, map inputs properly for this version
ADDRESS_MAP_END
@@ -6578,7 +6578,7 @@ DRIVER_INIT_MEMBER(galaxian_state,scorpion)
// space.nop_write(0x6803, 0x6803);
m_audiocpu->space(AS_PROGRAM).install_read_handler(0x3000, 0x3000, read8_delegate(FUNC(galaxian_state::scorpion_digitalker_intr_r),this));
-
+
save_item(NAME(m_protection_state));
/*
{
@@ -6697,7 +6697,7 @@ ROM_START( spcwarp )
/* ROMCMP reports "BADADDR xxxxxx-xxxxx". Observed data sequence repeated every 32 bytes */
ROM_LOAD( "swarpt7m.bin", 0x2000, 0x1000, BAD_DUMP CRC(a2dff6c8) SHA1(d1c72848450dc5ff386dc94a26e4bf704ccc7121) )
/* Stripped "repaired" rom. Was original rom supposed to be 0x1000 or 0x800? */
-// ROM_LOAD( "swarpt7m-repair.bin", 0x2000, 0x0800, CRC(109f95cf) SHA1(d99171ffd6639fec28966edaf7cce3a4df5e948d) )
+// ROM_LOAD( "swarpt7m-repair.bin", 0x2000, 0x0800, CRC(109f95cf) SHA1(d99171ffd6639fec28966edaf7cce3a4df5e948d) )
ROM_REGION( 0x1000, "gfx1", 0 )
ROM_LOAD( "swarpb1h.bin", 0x0000, 0x0800, CRC(6ee3b5f7) SHA1(8150f2ecd59d3a165c0541b550664c56d049edd5) )
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index 24e71e8c71b..1b0d3d2627b 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -85,7 +85,7 @@ public:
m_priority_buffer(*this, "priority_buffer"),
m_sprregs(*this, "sprregs"),
m_sprite_bitmap_1(1024, 1024)
-
+
{ }
required_device<cpu_device> m_maincpu;
@@ -94,14 +94,14 @@ public:
required_device<kaneko_grap2_device> m_grap2_2;
required_device<palette_device> m_palette;
required_device<sknsspr_device> m_spritegen;
-
+
required_shared_ptr<UINT16> m_paletteram;
optional_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_priority_buffer;
required_shared_ptr<UINT16> m_sprregs;
bitmap_ind16 m_sprite_bitmap_1;
-
+
UINT16 m_priority_buffer_scrollx;
UINT16 m_priority_buffer_scrolly;
diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c
index ecbe6dfc6bf..34d28b3b368 100644
--- a/src/mame/drivers/galpanic.c
+++ b/src/mame/drivers/galpanic.c
@@ -1123,7 +1123,7 @@ GAME( 1990, galpanica,galpanic, galpanica,galpanica, driver_device, 0, ROT90, "K
GAME( 1994, supmodel, 0, supmodel, fantasia, driver_device, 0, ROT90, "Comad & New Japan System", "Super Model",GAME_NO_COCKTAIL )
-GAME( 1994, fantasian,fantasia, comad, fantasia, driver_device, 0, ROT90, "Comad & New Japan System", "Fantasia (940803 PCB)", GAME_NO_COCKTAIL )
+GAME( 1994, fantasian,fantasia, comad, fantasia, driver_device, 0, ROT90, "Comad & New Japan System", "Fantasia (940803 PCB)", GAME_NO_COCKTAIL )
GAME( 1995, newfant, 0, comad, fantasia, driver_device, 0, ROT90, "Comad & New Japan System", "New Fantasia (1995 copyright)", GAME_NO_COCKTAIL ) // the only difference between the two is the gfx rom containing the copyright
GAME( 1994, newfanta, newfant, comad, fantasia, driver_device, 0, ROT90, "Comad & New Japan System", "New Fantasia (1994 copyright)", GAME_NO_COCKTAIL )
diff --git a/src/mame/drivers/hikaru.c b/src/mame/drivers/hikaru.c
index e07fc2bf1d2..bff3ca91f92 100644
--- a/src/mame/drivers/hikaru.c
+++ b/src/mame/drivers/hikaru.c
@@ -622,38 +622,38 @@ ROM_START( podrace )
/* ROM board using 64M SOP44 MASKROM */
ROM_REGION( 0x10000000, "user2", 0)
- ROM_LOAD("mpr-23086.ic37" , 0x0000000, 0x0800000, CRC(ef6f20f1) SHA1(11fb66bf71223b4c6650d3adaea21e8709b8d67b))
- ROM_LOAD("mpr-23087.ic38" , 0x0800000, 0x0800000, CRC(54389822) SHA1(6357f0aa77ef0a5a08a751e085fa026d26ba47d1))
- ROM_LOAD("mpr-23088.ic39" , 0x1000000, 0x0800000, CRC(9f1a382e) SHA1(b846c3a091d04e49cc1e731237c9326ccac39a64))
- ROM_LOAD("mpr-23089.ic40" , 0x1800000, 0x0800000, CRC(6aae64fc) SHA1(392b6fba25d20bb41fd72be3a3a9ce95b2374065))
- ROM_LOAD("mpr-23090.ic41" , 0x2000000, 0x0800000, CRC(ba857872) SHA1(c07ff7955d3d07f2a60d9761b4bd692c0a9c9353))
- ROM_LOAD("mpr-23091.ic42" , 0x2800000, 0x0800000, CRC(66a73e27) SHA1(c4e7d190a80499225a78b7f788c2abc7ec4ebdca))
- ROM_LOAD("mpr-23092.ic43" , 0x3000000, 0x0800000, CRC(4f20a0f5) SHA1(0580feba6a6dd01a21d09ec2503ccf77030f8d2a))
- ROM_LOAD("mpr-23093.ic44" , 0x3800000, 0x0800000, CRC(e74d7d64) SHA1(c28e44319bf08aedd9aed625a12834ec76f1e5e0))
- ROM_LOAD("mpr-23094.ic45" , 0x4000000, 0x0800000, CRC(90f04c14) SHA1(b55846ea1edd920fd527e3257b13fea8df1f713f))
- ROM_LOAD("mpr-23095.ic46" , 0x4800000, 0x0800000, CRC(cc67cb5b) SHA1(85e99ec22d1c65139685a94f1ba0c52a0eb33a2e))
- ROM_LOAD("mpr-23096.ic47" , 0x5000000, 0x0800000, CRC(799ab79e) SHA1(c0ac85ad7f4cf46ff162f1ec2e85a3f22817de5e))
- ROM_LOAD("mpr-23097.ic48" , 0x5800000, 0x0800000, CRC(f68439de) SHA1(475d0f22e78e3c86431b742e37cbfd764ca8acee))
- ROM_LOAD("mpr-23098.ic49" , 0x6000000, 0x0800000, CRC(a1e2009c) SHA1(c6a600d47fd2a96d28c637631862150e6f303c3d))
- ROM_LOAD("mpr-23099.ic50" , 0x6800000, 0x0800000, CRC(ce36f642) SHA1(6cb2e69095efc7969255ebc637e2597c56442751))
- ROM_LOAD("mpr-23100.ic51" , 0x7000000, 0x0800000, CRC(0f966653) SHA1(1544af662188ea734e0a2e559e05e5f782fb292d))
- ROM_LOAD("mpr-23101.ic52" , 0x7800000, 0x0800000, CRC(2640fbaa) SHA1(59e9bd143734c71968beb9953122680d3350e69c))
- ROM_LOAD("mpr-23102.ic53" , 0x8000000, 0x0800000, CRC(080c5bcb) SHA1(0cf54348420ae9866edd64422cb82464990f1f2f))
- ROM_LOAD("mpr-23103.ic54" , 0x8800000, 0x0800000, CRC(19c7758f) SHA1(fed7f45dd91e1cb6bba7d8e80ed17dca27d92e43))
- ROM_LOAD("mpr-23104.ic55" , 0x9000000, 0x0800000, CRC(4ca74216) SHA1(0e65971359ba0e2b4fc032a26d1c10d8efadc205))
- ROM_LOAD("mpr-23105.ic56" , 0x9800000, 0x0800000, CRC(e2dd35ba) SHA1(2213e3195a49532a177086de8134ce8b753fc7ce))
- ROM_LOAD("mpr-23106.ic57" , 0xa000000, 0x0800000, CRC(dd325515) SHA1(8144e1a87f7d72a18791d1d452123a91cfb354dd))
- ROM_LOAD("mpr-23107.ic58" , 0xa800000, 0x0800000, CRC(a527a22a) SHA1(54c105b21797c9b0a2a6b2c7091de726c49a55e8))
- ROM_LOAD("mpr-23108.ic59" , 0xb000000, 0x0800000, CRC(47817d9a) SHA1(d2c6f1b2e800448eaf694d550733bba2280b6746))
- ROM_LOAD("mpr-23109.ic60" , 0xb800000, 0x0800000, CRC(8c61dec4) SHA1(25a1a5b236b3aed013fc94bd9695906ae5d7f305))
- ROM_LOAD("mpr-23110.ic61" , 0xc000000, 0x0800000, CRC(4ddae9f1) SHA1(d1c5e3f18932af806f166779cf14909ab17d052c))
- ROM_LOAD("mpr-23111.ic62" , 0xc800000, 0x0800000, CRC(c404cb1c) SHA1(e14855ec8a5a5ba243a2339c571928fdcc187157))
- ROM_LOAD("mpr-23112.ic63" , 0xd000000, 0x0800000, CRC(d001fe59) SHA1(ab395d2933b5d691259221168dfaa063cf9a4d1c))
- ROM_LOAD("mpr-23113.ic64" , 0xd800000, 0x0800000, CRC(f241cfd5) SHA1(5b85e8b50559becff7a76565c95487825bbd9351))
- ROM_LOAD("mpr-23114.ic65" , 0xe000000, 0x0800000, CRC(80049d7c) SHA1(56aab53e9317b1b5d10bd2af78fd83e7422d8939))
- ROM_LOAD("mpr-23115.ic66" , 0xe800000, 0x0800000, CRC(4fc540fe) SHA1(df580421d856566e067c2b319c8ac4671629682f))
- ROM_LOAD("mpr-23116.ic67" , 0xf000000, 0x0800000, CRC(9f567fce) SHA1(c35bcf968f139557e50ceafa9c6bad4deb87154f))
- ROM_LOAD("mpr-23117.ic68" , 0xf800000, 0x0800000, CRC(9d4d3529) SHA1(66008445629681ebf2f26b3f181d8524a8576d2f))
+ ROM_LOAD("mpr-23086.ic37" , 0x0000000, 0x0800000, CRC(ef6f20f1) SHA1(11fb66bf71223b4c6650d3adaea21e8709b8d67b))
+ ROM_LOAD("mpr-23087.ic38" , 0x0800000, 0x0800000, CRC(54389822) SHA1(6357f0aa77ef0a5a08a751e085fa026d26ba47d1))
+ ROM_LOAD("mpr-23088.ic39" , 0x1000000, 0x0800000, CRC(9f1a382e) SHA1(b846c3a091d04e49cc1e731237c9326ccac39a64))
+ ROM_LOAD("mpr-23089.ic40" , 0x1800000, 0x0800000, CRC(6aae64fc) SHA1(392b6fba25d20bb41fd72be3a3a9ce95b2374065))
+ ROM_LOAD("mpr-23090.ic41" , 0x2000000, 0x0800000, CRC(ba857872) SHA1(c07ff7955d3d07f2a60d9761b4bd692c0a9c9353))
+ ROM_LOAD("mpr-23091.ic42" , 0x2800000, 0x0800000, CRC(66a73e27) SHA1(c4e7d190a80499225a78b7f788c2abc7ec4ebdca))
+ ROM_LOAD("mpr-23092.ic43" , 0x3000000, 0x0800000, CRC(4f20a0f5) SHA1(0580feba6a6dd01a21d09ec2503ccf77030f8d2a))
+ ROM_LOAD("mpr-23093.ic44" , 0x3800000, 0x0800000, CRC(e74d7d64) SHA1(c28e44319bf08aedd9aed625a12834ec76f1e5e0))
+ ROM_LOAD("mpr-23094.ic45" , 0x4000000, 0x0800000, CRC(90f04c14) SHA1(b55846ea1edd920fd527e3257b13fea8df1f713f))
+ ROM_LOAD("mpr-23095.ic46" , 0x4800000, 0x0800000, CRC(cc67cb5b) SHA1(85e99ec22d1c65139685a94f1ba0c52a0eb33a2e))
+ ROM_LOAD("mpr-23096.ic47" , 0x5000000, 0x0800000, CRC(799ab79e) SHA1(c0ac85ad7f4cf46ff162f1ec2e85a3f22817de5e))
+ ROM_LOAD("mpr-23097.ic48" , 0x5800000, 0x0800000, CRC(f68439de) SHA1(475d0f22e78e3c86431b742e37cbfd764ca8acee))
+ ROM_LOAD("mpr-23098.ic49" , 0x6000000, 0x0800000, CRC(a1e2009c) SHA1(c6a600d47fd2a96d28c637631862150e6f303c3d))
+ ROM_LOAD("mpr-23099.ic50" , 0x6800000, 0x0800000, CRC(ce36f642) SHA1(6cb2e69095efc7969255ebc637e2597c56442751))
+ ROM_LOAD("mpr-23100.ic51" , 0x7000000, 0x0800000, CRC(0f966653) SHA1(1544af662188ea734e0a2e559e05e5f782fb292d))
+ ROM_LOAD("mpr-23101.ic52" , 0x7800000, 0x0800000, CRC(2640fbaa) SHA1(59e9bd143734c71968beb9953122680d3350e69c))
+ ROM_LOAD("mpr-23102.ic53" , 0x8000000, 0x0800000, CRC(080c5bcb) SHA1(0cf54348420ae9866edd64422cb82464990f1f2f))
+ ROM_LOAD("mpr-23103.ic54" , 0x8800000, 0x0800000, CRC(19c7758f) SHA1(fed7f45dd91e1cb6bba7d8e80ed17dca27d92e43))
+ ROM_LOAD("mpr-23104.ic55" , 0x9000000, 0x0800000, CRC(4ca74216) SHA1(0e65971359ba0e2b4fc032a26d1c10d8efadc205))
+ ROM_LOAD("mpr-23105.ic56" , 0x9800000, 0x0800000, CRC(e2dd35ba) SHA1(2213e3195a49532a177086de8134ce8b753fc7ce))
+ ROM_LOAD("mpr-23106.ic57" , 0xa000000, 0x0800000, CRC(dd325515) SHA1(8144e1a87f7d72a18791d1d452123a91cfb354dd))
+ ROM_LOAD("mpr-23107.ic58" , 0xa800000, 0x0800000, CRC(a527a22a) SHA1(54c105b21797c9b0a2a6b2c7091de726c49a55e8))
+ ROM_LOAD("mpr-23108.ic59" , 0xb000000, 0x0800000, CRC(47817d9a) SHA1(d2c6f1b2e800448eaf694d550733bba2280b6746))
+ ROM_LOAD("mpr-23109.ic60" , 0xb800000, 0x0800000, CRC(8c61dec4) SHA1(25a1a5b236b3aed013fc94bd9695906ae5d7f305))
+ ROM_LOAD("mpr-23110.ic61" , 0xc000000, 0x0800000, CRC(4ddae9f1) SHA1(d1c5e3f18932af806f166779cf14909ab17d052c))
+ ROM_LOAD("mpr-23111.ic62" , 0xc800000, 0x0800000, CRC(c404cb1c) SHA1(e14855ec8a5a5ba243a2339c571928fdcc187157))
+ ROM_LOAD("mpr-23112.ic63" , 0xd000000, 0x0800000, CRC(d001fe59) SHA1(ab395d2933b5d691259221168dfaa063cf9a4d1c))
+ ROM_LOAD("mpr-23113.ic64" , 0xd800000, 0x0800000, CRC(f241cfd5) SHA1(5b85e8b50559becff7a76565c95487825bbd9351))
+ ROM_LOAD("mpr-23114.ic65" , 0xe000000, 0x0800000, CRC(80049d7c) SHA1(56aab53e9317b1b5d10bd2af78fd83e7422d8939))
+ ROM_LOAD("mpr-23115.ic66" , 0xe800000, 0x0800000, CRC(4fc540fe) SHA1(df580421d856566e067c2b319c8ac4671629682f))
+ ROM_LOAD("mpr-23116.ic67" , 0xf000000, 0x0800000, CRC(9f567fce) SHA1(c35bcf968f139557e50ceafa9c6bad4deb87154f))
+ ROM_LOAD("mpr-23117.ic68" , 0xf800000, 0x0800000, CRC(9d4d3529) SHA1(66008445629681ebf2f26b3f181d8524a8576d2f))
ROM_END
ROM_START( braveff )
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index c022a4512c1..673ead7a7ff 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -96,12 +96,12 @@ public:
optional_device<okim6295_device> m_oki;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
-
+
/* memory pointers */
required_shared_ptr<UINT16> m_priority_ram;
optional_shared_ptr<UINT16> m_vbowl_trackball;
required_shared_ptr<UINT16> m_generic_paletteram_16;
-
+
UINT8 *m_layer[8];
UINT16 m_priority;
UINT8 m_lhb2_pen_hi;
@@ -277,7 +277,7 @@ void igs011_state::video_start()
}
m_lhb2_pen_hi = 0;
-
+
save_item(NAME(m_priority));
save_item(NAME(m_lhb2_pen_hi));
save_item(NAME(m_blitter.x));
diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c
index c2d3c3db950..d8e6375005a 100644
--- a/src/mame/drivers/igs017.c
+++ b/src/mame/drivers/igs017.c
@@ -720,14 +720,14 @@ void igs017_state::mgcs_flip_sprites()
void igs017_state::mgcs_patch_rom()
{
-// UINT16 *rom = (UINT16 *)memregion("maincpu")->base();
+// UINT16 *rom = (UINT16 *)memregion("maincpu")->base();
-// rom[0x20666/2] = 0x601e; // 020666: 671E beq $20686 (rom check)
+// rom[0x20666/2] = 0x601e; // 020666: 671E beq $20686 (rom check)
// IGS029 send command
-// rom[0x4dfce/2] = 0x6010; // 04DFCE: 6610 bne $4dfe0
-// rom[0x4e00e/2] = 0x4e75;
-// rom[0x4e036/2] = 0x6006; // 04E036: 6306 bls $4e03e
+// rom[0x4dfce/2] = 0x6010; // 04DFCE: 6610 bne $4dfe0
+// rom[0x4e00e/2] = 0x4e75;
+// rom[0x4e036/2] = 0x6006; // 04E036: 6306 bls $4e03e
}
DRIVER_INIT_MEMBER(igs017_state,mgcs)
@@ -1457,7 +1457,7 @@ void igs017_state::mgcs_igs029_run()
coin_counter_w(machine(), 0, (~data) & 0x20); // coin in
coin_counter_w(machine(), 1, (~data) & 0x40); // coin out
-// popmessage("PORT1 %02X", data);
+// popmessage("PORT1 %02X", data);
if ( data & ~0x70 )
logerror("%s: warning, unknown bits written in port %02x = %02x\n", machine().describe_context(), port, data);
@@ -1467,7 +1467,7 @@ void igs017_state::mgcs_igs029_run()
case 0x03:
m_dsw_select = data;
-// popmessage("PORT3 %02X", data);
+// popmessage("PORT3 %02X", data);
if ( data & ~0x03 )
logerror("%s: warning, unknown bits written in port %02x = %02x\n", machine().describe_context(), port, data);
@@ -1501,8 +1501,8 @@ void igs017_state::mgcs_igs029_run()
logerror("READ DSW\n");
UINT8 ret;
- if (~m_dsw_select & 0x01) ret = ioport("DSW1")->read();
- else if (~m_dsw_select & 0x02) ret = ioport("DSW2")->read();
+ if (~m_dsw_select & 0x01) ret = ioport("DSW1")->read();
+ else if (~m_dsw_select & 0x02) ret = ioport("DSW2")->read();
else
{
logerror("%s: warning, reading dsw with dsw_select = %02x\n", machine().describe_context(), m_dsw_select);
@@ -1515,7 +1515,7 @@ void igs017_state::mgcs_igs029_run()
}
else if (m_igs029_send_buf[0] == 0x07 && m_igs029_send_buf[1] == 0x2c)
{
- logerror("?? (2C)\n"); // ??
+ logerror("?? (2C)\n"); // ??
// 4 inputs. Returns 1 long
@@ -1525,7 +1525,7 @@ void igs017_state::mgcs_igs029_run()
m_igs029_recv_buf[m_igs029_recv_len++] = 0x00;
m_igs029_recv_buf[m_igs029_recv_len++] = 0x00;
m_igs029_recv_buf[m_igs029_recv_len++] = 0x00;
- m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; // ??
+ m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; // ??
m_igs029_recv_buf[m_igs029_recv_len++] = 0x05;
}
else if (m_igs029_send_buf[0] == 0x07 && m_igs029_send_buf[1] == 0x15)
@@ -1571,7 +1571,7 @@ WRITE16_MEMBER(igs017_state::mgcs_magic_w)
case 0x00:
if (ACCESSING_BITS_0_7)
{
- bool igs029_irq = !(m_input_select & 0x04) && (data & 0x04); // 0->1
+ bool igs029_irq = !(m_input_select & 0x04) && (data & 0x04); // 0->1
// 7654 3--- Keys
// ---- -2-- IRQ on IGS029
@@ -1623,7 +1623,7 @@ WRITE16_MEMBER(igs017_state::mgcs_magic_w)
if (ACCESSING_BITS_0_7)
{
m_scramble_data = data & 0xff;
-// logerror("%s: writing %02x to igs_magic = %02x\n", machine().describe_context(), data & 0xff, m_igs_magic[0]);
+// logerror("%s: writing %02x to igs_magic = %02x\n", machine().describe_context(), data & 0xff, m_igs_magic[0]);
}
break;
@@ -1633,7 +1633,7 @@ WRITE16_MEMBER(igs017_state::mgcs_magic_w)
if (ACCESSING_BITS_0_7)
{
m_igs029_send_data = data & 0xff;
-// logerror("%s: writing %02x to igs_magic = %02x\n", machine().describe_context(), data & 0xff, m_igs_magic[0]);
+// logerror("%s: writing %02x to igs_magic = %02x\n", machine().describe_context(), data & 0xff, m_igs_magic[0]);
}
break;
@@ -1666,7 +1666,7 @@ READ16_MEMBER(igs017_state::mgcs_magic_r)
return ret;
}
-// case 0x05: ???
+// case 0x05: ???
default:
logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic[0]);
@@ -2947,7 +2947,7 @@ static INPUT_PORTS_START( mgcs )
// DSWs are read through a protection device (IGS029). See code at 1CF16
- PORT_START("DSW1") // $3009e2
+ PORT_START("DSW1") // $3009e2
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
@@ -2971,7 +2971,7 @@ static INPUT_PORTS_START( mgcs )
PORT_DIPSETTING( 0x80, "1000" )
PORT_DIPSETTING( 0x00, "2000" )
- PORT_START("DSW2") // $3009e3
+ PORT_START("DSW2") // $3009e3
PORT_DIPNAME( 0x03, 0x03, "Min Bet" )
PORT_DIPSETTING( 0x03, "1" )
PORT_DIPSETTING( 0x02, "2" )
diff --git a/src/mame/drivers/iqblock.c b/src/mame/drivers/iqblock.c
index dd32ae0bf43..982b33225ac 100644
--- a/src/mame/drivers/iqblock.c
+++ b/src/mame/drivers/iqblock.c
@@ -214,7 +214,7 @@ static INPUT_PORTS_START( grndtour )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_START("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
@@ -227,8 +227,8 @@ static INPUT_PORTS_START( grndtour )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_START("EXTRA")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index 6ed900eba74..ea9ffd29025 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -4405,14 +4405,14 @@ DRIVER_INIT_MEMBER(itech32_state,gt2kp)
/* The protection code is:
- addq #1, 1132.w
- clr.l d0
- clr.l d1
- move.b 680002,d0 ; Read protection result
- move.b 112f.w,d1
- andi.b #$01,d0
+ addq #1, 1132.w
+ clr.l d0
+ clr.l d1
+ move.b 680002,d0 ; Read protection result
+ move.b 112f.w,d1
+ andi.b #$01,d0
Label1 bne.s Label1 ; Infinite loop if result isn't 0x01
- nop ; Otherwise just return to the game :-)
+ nop ; Otherwise just return to the game :-)
*/
}
@@ -4426,14 +4426,14 @@ DRIVER_INIT_MEMBER(itech32_state,gtclasscp)
/* The protection code is:
- addq #1, 1132.w
- clr.l d0
- clr.l d1
- move.b 680002,d0 ; Read protection result
- andi.b #$C0,d0
- cmpi.b #$80,d0
+ addq #1, 1132.w
+ clr.l d0
+ clr.l d1
+ move.b 680002,d0 ; Read protection result
+ andi.b #$C0,d0
+ cmpi.b #$80,d0
Label1 bne.s Label1 ; Infinite loop if result isn't 0x80
- rts ; Otherwise just return to the game :-)
+ rts ; Otherwise just return to the game :-)
*/
}
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index 284a28db841..af577710e0b 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -201,7 +201,7 @@ public:
required_device<sknsspr_device> m_spritegen1;
required_device<sknsspr_device> m_spritegen2;
required_device<kaneko_view2_tilemap_device> m_view2_0;
-
+
required_shared_ptr<UINT16> m_spriteram_1;
required_shared_ptr<UINT16> m_sprregs_1;
required_shared_ptr<UINT16> m_spriteram_2;
diff --git a/src/mame/drivers/jclub2.c b/src/mame/drivers/jclub2.c
index ba40c2b1359..6af6dbfb098 100644
--- a/src/mame/drivers/jclub2.c
+++ b/src/mame/drivers/jclub2.c
@@ -114,7 +114,7 @@ public:
m_gamecpu(*this, "gamecpu"),
m_eeprom(*this, "eeprom"),
m_palette(*this, "palette"),
- m_gfxdecode(*this, "gfxdecode")
+ m_gfxdecode(*this, "gfxdecode")
{ }
tilemap_t *m_tmap;
diff --git a/src/mame/drivers/jeutel.c b/src/mame/drivers/jeutel.c
index a9697fc4fe6..003594dac71 100644
--- a/src/mame/drivers/jeutel.c
+++ b/src/mame/drivers/jeutel.c
@@ -11,7 +11,7 @@
ToDo:
- Everything!
-- Each machine has 4 players, 7-digit, 12-segment florescent display
+- Each machine has 4 players, 7-digit, 12-segment florescent display
********************************************************************************/
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index 85f795aafb0..391489ac700 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -832,8 +832,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( chelnovjbl_mcu_io_map, AS_IO, 8, karnov_state )
//internal port
-// AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READWRITE(p1_r, p1_w)
-// AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READWRITE(p3_r, p3_w)
+// AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READWRITE(p1_r, p1_w)
+// AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READWRITE(p3_r, p3_w)
ADDRESS_MAP_END
@@ -1181,7 +1181,7 @@ ROM_START( chelnovjbl ) // code is the same as the regular chelnovj set
ROM_LOAD( "a-c5.bin", 0x00000, 0x08000, CRC(1abf2c6d) SHA1(86d625ae94cd9ea69e4e613895410640efb175b3) ) /* Characters */
ROM_REGION( 0x40000, "gfx2", 0 ) /* Backgrounds */ // same content split into more roms
- ROM_LOAD( "8.bin", 0x00000, 0x08000, CRC(a78b174a) SHA1(e0d82b600a154b81d7e1a787f0e20eb1a341894f) )
+ ROM_LOAD( "8.bin", 0x00000, 0x08000, CRC(a78b174a) SHA1(e0d82b600a154b81d7e1a787f0e20eb1a341894f) )
ROM_LOAD( "9.bin", 0x08000, 0x08000, CRC(97d2c146) SHA1(075bb9afc4f0623cd413883ec2bca574d7ff88d4) )
ROM_LOAD( "2.bin", 0x10000, 0x08000, CRC(8c45e7de) SHA1(d843b7dcc64ed3a5b8717af172a1f22c4c599480) )
ROM_LOAD( "3.bin", 0x18000, 0x08000, CRC(504cc95c) SHA1(97e5e9f8cd8ebf5e0c18f27f2988a45c4d3809b3) )
@@ -1233,7 +1233,7 @@ ROM_START( chelnovjbla )
ROM_LOAD( "a-c5.bin", 0x00000, 0x08000, CRC(1abf2c6d) SHA1(86d625ae94cd9ea69e4e613895410640efb175b3) ) /* Characters */
ROM_REGION( 0x40000, "gfx2", 0 ) /* Backgrounds */ // same content split into more roms
- ROM_LOAD( "8.bin", 0x00000, 0x08000, CRC(a78b174a) SHA1(e0d82b600a154b81d7e1a787f0e20eb1a341894f) )
+ ROM_LOAD( "8.bin", 0x00000, 0x08000, CRC(a78b174a) SHA1(e0d82b600a154b81d7e1a787f0e20eb1a341894f) )
ROM_LOAD( "9.bin", 0x08000, 0x08000, CRC(97d2c146) SHA1(075bb9afc4f0623cd413883ec2bca574d7ff88d4) )
ROM_LOAD( "2.bin", 0x10000, 0x08000, CRC(8c45e7de) SHA1(d843b7dcc64ed3a5b8717af172a1f22c4c599480) )
ROM_LOAD( "3.bin", 0x18000, 0x08000, CRC(504cc95c) SHA1(97e5e9f8cd8ebf5e0c18f27f2988a45c4d3809b3) )
diff --git a/src/mame/drivers/legionna.c b/src/mame/drivers/legionna.c
index a02b7a2ff40..9876a12f245 100644
--- a/src/mame/drivers/legionna.c
+++ b/src/mame/drivers/legionna.c
@@ -106,20 +106,20 @@ static ADDRESS_MAP_START( legionna_cop_mem, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x100428, 0x100429) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_dma_v1_w)
AM_RANGE(0x10042a, 0x10042b) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_dma_v2_w)
AM_RANGE(0x10042c, 0x10042d) AM_DEVREADWRITE("raiden2cop", raiden2cop_device, cop_prng_maxvalue_r, cop_prng_maxvalue_w)
-
+
AM_RANGE(0x100432, 0x100433) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_pgm_data_w)
AM_RANGE(0x100434, 0x100435) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_pgm_addr_w)
AM_RANGE(0x100436, 0x100437) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_hitbox_baseadr_w)
AM_RANGE(0x100438, 0x100439) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_pgm_value_w)
AM_RANGE(0x10043a, 0x10043b) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_pgm_mask_w)
AM_RANGE(0x10043c, 0x10043d) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_pgm_trigger_w)
- //AM_RANGE(0x10043e, 0x10043f) AM_DEVWRITE("raiden2cop", raiden2cop_device,) /* 0 in all 68k based games, 0xffff in raiden2 / raidendx, 0x2000 in zeroteam / xsedae , it's always set up just before the 0x474 register */
+ //AM_RANGE(0x10043e, 0x10043f) AM_DEVWRITE("raiden2cop", raiden2cop_device,) /* 0 in all 68k based games, 0xffff in raiden2 / raidendx, 0x2000 in zeroteam / xsedae , it's always set up just before the 0x474 register */
AM_RANGE(0x100444, 0x100445) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_scale_w)
AM_RANGE(0x100446, 0x100447) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_rom_addr_unk_w) // 68k
AM_RANGE(0x100448, 0x100449) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_rom_addr_lo_w) // 68k
AM_RANGE(0x10044a, 0x10044b) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_rom_addr_hi_w) // 68k
-
+
AM_RANGE(0x100450, 0x100451) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sort_ram_addr_hi_w)
AM_RANGE(0x100452, 0x100453) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sort_ram_addr_lo_w)
AM_RANGE(0x100454, 0x100455) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sort_lookup_hi_w)
@@ -128,8 +128,8 @@ static ADDRESS_MAP_START( legionna_cop_mem, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x10045a, 0x10045b) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_pal_brightness_val_w) //palette DMA brightness val, used by X Se Dae / Zero Team
AM_RANGE(0x10045c, 0x10045d) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_pal_brightness_mode_w) //palette DMA brightness mode, used by X Se Dae / Zero Team (sets to 5)
-// AM_RANGE(0x100470, 0x100471) AM_READWRITE(cop_tile_bank_2_r,cop_tile_bank_2_w)
-// AM_RANGE(0x100474, 0x100475) AM_DEVWRITE("raiden2cop", raiden2cop_device,) // this gets set to a pointer to spriteram (relative to start of ram) on all games excecpt raiden 2, where it isn't set
+// AM_RANGE(0x100470, 0x100471) AM_READWRITE(cop_tile_bank_2_r,cop_tile_bank_2_w)
+// AM_RANGE(0x100474, 0x100475) AM_DEVWRITE("raiden2cop", raiden2cop_device,) // this gets set to a pointer to spriteram (relative to start of ram) on all games excecpt raiden 2, where it isn't set
AM_RANGE(0x100476, 0x100477) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_dma_adr_rel_w)
AM_RANGE(0x100478, 0x100479) AM_DEVWRITE("raiden2cop", raiden2cop_device,cop_dma_src_w)
AM_RANGE(0x10047a, 0x10047b) AM_DEVWRITE("raiden2cop", raiden2cop_device,cop_dma_size_w)
@@ -142,7 +142,7 @@ static ADDRESS_MAP_START( legionna_cop_mem, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x1004a0, 0x1004ad) AM_DEVREADWRITE("raiden2cop", raiden2cop_device, cop_reg_high_r, cop_reg_high_w)
AM_RANGE(0x1004c0, 0x1004cd) AM_DEVREADWRITE("raiden2cop", raiden2cop_device, cop_reg_low_r, cop_reg_low_w)
-// AM_RANGE(0x100500, 0x100505) AM_WRITE(cop_cmd_w) // ADD ME
+// AM_RANGE(0x100500, 0x100505) AM_WRITE(cop_cmd_w) // ADD ME
AM_RANGE(0x100500, 0x100505) AM_DEVWRITE("raiden2cop", raiden2cop_device,LEGACY_cop_cmd_w) // REMOVE ME
AM_RANGE(0x100580, 0x100581) AM_DEVREAD("raiden2cop", raiden2cop_device, cop_collision_status_r)
@@ -222,7 +222,7 @@ static ADDRESS_MAP_START( godzilla_map, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x101800, 0x101fff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
AM_RANGE(0x102000, 0x1027ff) AM_RAM // _WRITE(legionna_midground_w) AM_SHARE("mid_data")
AM_RANGE(0x102800, 0x1037ff) AM_RAM // _WRITE(legionna_text_w) AM_SHARE("textram")
- AM_RANGE(0x103800, 0x103fff) AM_RAM // check?
+ AM_RANGE(0x103800, 0x103fff) AM_RAM // check?
AM_RANGE(0x104000, 0x104fff) AM_RAM // _DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x105000, 0x105fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x106000, 0x1067ff) AM_RAM
diff --git a/src/mame/drivers/ltd.c b/src/mame/drivers/ltd.c
index be806e274ed..122f6f13b02 100644
--- a/src/mame/drivers/ltd.c
+++ b/src/mame/drivers/ltd.c
@@ -387,7 +387,7 @@ DRIVER_INIT_MEMBER( ltd_state, zephy )
TIMER_DEVICE_CALLBACK_MEMBER( ltd_state::timer_r )
{
m_timer_r ^= 1;
- m_maincpu->set_input_line(M6800_IRQ_LINE, (m_timer_r) ? CLEAR_LINE : ASSERT_LINE);
+ m_maincpu->set_input_line(M6800_IRQ_LINE, (m_timer_r) ? CLEAR_LINE : ASSERT_LINE);
static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447
m_out_offs++;
if (m_out_offs > 0x7f) m_out_offs = 0x60;
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index 509df693dcb..b3016dc174a 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -82,7 +82,7 @@ public:
DECLARE_DRIVER_INIT(kisekaem);
DECLARE_DRIVER_INIT(macs2);
DECLARE_MACHINE_RESET(macs);
-
+
UINT32 screen_update_macs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
optional_device<st0016_cpu_device> m_maincpu;
@@ -149,7 +149,7 @@ WRITE8_MEMBER(macs_state::macs_rom_bank_w)
{
membank("bank1")->set_base(memregion("maincpu")->base() + (data* 0x4000) + macs_cart_slot*0x400000 );
-// m_st0016_rom_bank=data;
+// m_st0016_rom_bank=data;
}
WRITE8_MEMBER(macs_state::macs_output_w)
diff --git a/src/mame/drivers/mario.c b/src/mame/drivers/mario.c
index 62788121384..dd2258d7684 100644
--- a/src/mame/drivers/mario.c
+++ b/src/mame/drivers/mario.c
@@ -186,7 +186,7 @@ static ADDRESS_MAP_START( mariobl_map, AS_PROGRAM, 8, mario_state)
//AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN1")
AM_RANGE(0xa000, 0xa000) AM_READNOP /* watchdog? */
AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW") /* DSW */
- AM_RANGE(0xa206, 0xa206) AM_WRITE(mario_gfxbank_w)
+ AM_RANGE(0xa206, 0xa206) AM_WRITE(mario_gfxbank_w)
AM_RANGE(0x8000, 0x9fff) AM_ROM
AM_RANGE(0xb000, 0xbfff) AM_ROM
@@ -457,12 +457,12 @@ static const gfx_layout spritelayout_bl =
16,16, /* 16*16 sprites */
RGN_FRAC(1,3), /* 256 sprites */
3, /* 3 bits per pixel */
- { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) },
- { 0, 1, 2, 3, 4, 5, 6, 7,
+ { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) },
+ { 0, 1, 2, 3, 4, 5, 6, 7,
64,65,66,67,68,69,70,71 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
- 16*16
+ 16*16
};
static GFXDECODE_START( mariobl )
@@ -475,12 +475,12 @@ static const gfx_layout spritelayout_bl2 =
16,16, /* 16*16 sprites */
RGN_FRAC(1,2), /* 256 sprites */
2, /* 3 bits per pixel */
- { RGN_FRAC(1,2),RGN_FRAC(0,2) },
- { 0, 1, 2, 3, 4, 5, 6, 7,
+ { RGN_FRAC(1,2),RGN_FRAC(0,2) },
+ { 0, 1, 2, 3, 4, 5, 6, 7,
64,65,66,67,68,69,70,71 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
- 16*16
+ 16*16
};
static GFXDECODE_START( dkong3abl )
@@ -548,7 +548,7 @@ static MACHINE_CONFIG_DERIVED( masao, mario_base )
MACHINE_CONFIG_END
/*
-Mario Bros japan bootleg on Ambush hardware
+Mario Bros japan bootleg on Ambush hardware
This romset (japanese version) comes from a faulty bootleg pcb.Game differences are none.
Note:it runs on a modified (extended) Tecfri's Ambush hardware.
@@ -582,16 +582,16 @@ static MACHINE_CONFIG_START( mariobl, mario_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
-
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("SYSTEM"))
-// MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay1_outputb_w))
+// MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay1_outputb_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("INPUTS"))
-// MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay2_outputb_w))
+// MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay2_outputb_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c
index f96f9e56204..f160f55a977 100644
--- a/src/mame/drivers/maxaflex.c
+++ b/src/mame/drivers/maxaflex.c
@@ -73,7 +73,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(mcu_timer_proc);
int atari_input_disabled();
virtual void machine_reset();
- //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state
+ //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state
required_device<cpu_device> m_mcu;
required_device<speaker_sound_device> m_speaker;
required_memory_region m_region_maincpu;
@@ -408,7 +408,7 @@ void maxaflex_state::machine_reset()
m_portC_in = m_portC_out = m_ddrC = 0;
m_tdr = m_tcr = 0;
m_mcu_timer = machine().device<timer_device>("mcu_timer");
-
+
output_set_lamp_value(0, 0);
output_set_lamp_value(1, 0);
output_set_lamp_value(2, 0);
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index 9c3284e3508..d668ad00cc5 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -1411,7 +1411,7 @@ void mazerbla_state::machine_start()
save_item(NAME(m_vsb_ls273));
save_item(NAME(m_soundlatch));
-
+
machine().save().register_postload(save_prepost_delegate(FUNC(mazerbla_state::rom_bank_select), this));
}
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index 41a36d2b16e..d1080982bd8 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -131,7 +131,7 @@ public:
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( mt_cart6 ) { return load_cart(image, m_cart6, 5); }
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( mt_cart7 ) { return load_cart(image, m_cart7, 6); }
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( mt_cart8 ) { return load_cart(image, m_cart8, 7); }
-
+
UINT32 screen_update_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_menu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void screen_eof_main(screen_device &screen, bool state);
@@ -424,7 +424,7 @@ void mtech_state::switch_cart(int gameno)
if (m_cart_reg[gameno])
{
memcpy(memregion("maincpu")->base(), m_cart_reg[gameno]->base(), 0x400000);
-
+
if (!m_cart_is_genesis[gameno])
{
logerror("enabling SMS Z80\n");
@@ -442,7 +442,7 @@ void mtech_state::switch_cart(int gameno)
//m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
}
}
- else /* else, no cart.. */
+ else /* else, no cart.. */
{
memset(memregion("mtbios")->base() + 0x8000, 0x00, 0x8000);
memset(memregion("maincpu")->base(), 0x00, 0x400000);
@@ -594,7 +594,7 @@ DRIVER_INIT_MEMBER(mtech_state,mt_slot)
m_banked_ram = auto_alloc_array(machine(), UINT8, 0x1000*8);
DRIVER_INIT_CALL(megadriv);
-
+
// this gets set in DEVICE_IMAGE_LOAD
memset(m_cart_is_genesis, 0, sizeof(m_cart_is_genesis));
}
@@ -641,7 +641,7 @@ MACHINE_RESET_MEMBER(mtech_state, megatech)
{
m_mt_bank_addr = 0;
MACHINE_RESET_CALL_MEMBER(megadriv);
-
+
astring region_tag;
if (m_cart1)
m_cart_reg[0] = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG));
@@ -730,10 +730,10 @@ int mtech_state::load_cart(device_image_interface &image, generic_slot_device *s
UINT8 *ROM;
const char *pcb_name;
UINT32 size = slot->common_get_size("rom");
-
+
if (image.software_entry() == NULL)
return IMAGE_INIT_FAIL;
-
+
slot->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
ROM = slot->get_rom_base();
memcpy(ROM, image.get_software_region("rom"), size);
@@ -753,9 +753,9 @@ int mtech_state::load_cart(device_image_interface &image, generic_slot_device *s
m_cart_is_genesis[gameno] = 0;
}
else
- osd_printf_debug("cart%d is invalid\n", gameno + 1);
+ osd_printf_debug("cart%d is invalid\n", gameno + 1);
}
-
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index 1258704d67b..ea1cbfec40f 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -3465,7 +3465,7 @@ static INPUT_PORTS_START( vmetal )
PORT_START("DSW0")
// DSW1, stored at 0xff0085.b (cpl'ed)
- PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
+ PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0006, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) )
@@ -3475,10 +3475,10 @@ static INPUT_PORTS_START( vmetal )
PORT_DIPSETTING( 0x0001, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) )
PORT_DIPUNUSED_DIPLOC( 0x0008, IP_ACTIVE_LOW, "SW1:4" ) /* 0x01 (OFF) or 0x02 (ON) written to 0xff0112.b but NEVER read back - old credits for 2 players game ? */
- PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:5") /* 0x07c1 written to 0x1788ac.w (screen control ?) at first (code at 0x0001b8) */
+ PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:5") /* 0x07c1 written to 0x1788ac.w (screen control ?) at first (code at 0x0001b8) */
PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) /* 0x07c1 written to 0xff0114.w (then 0x1788ac.w) during initialisation (code at 0x000436) */
PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) /* 0x07c0 written to 0xff0114.w (then 0x1788ac.w) during initialisation (code at 0x000436) */
- PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
+ PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0020, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:7" )
@@ -3486,17 +3486,17 @@ static INPUT_PORTS_START( vmetal )
PORT_START("IN2")
// DSW2, stored at 0xff0084.b (cpl'ed)
- PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
+ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0002, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x0003, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x0001, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
- PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
+ PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
PORT_DIPSETTING( 0x0008, "1" )
PORT_DIPSETTING( 0x0004, "2" )
PORT_DIPSETTING( 0x000c, "3" )
PORT_DIPSETTING( 0x0000, "4" )
- PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5") /* code at 0x0004a4 */
+ PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5") /* code at 0x0004a4 */
PORT_DIPSETTING( 0x0010, "Every 30000" )
PORT_DIPSETTING( 0x0000, "Every 60000" )
PORT_DIPUNUSED_DIPLOC( 0x0020, IP_ACTIVE_LOW, "SW2:6" )
diff --git a/src/mame/drivers/mgavegas.c b/src/mame/drivers/mgavegas.c
index cb7fea91f96..e9b86d5f2bc 100644
--- a/src/mame/drivers/mgavegas.c
+++ b/src/mame/drivers/mgavegas.c
@@ -2,16 +2,16 @@
mgavegas.c
- Coin pusher
+ Coin pusher
TODO
-better analog audio out/mixer
- -some output (mostly not used)
+ -some output (mostly not used)
Ver. 1.33 have no speech and no change funcion implemented in software
Ver. 2.1 and 2.3 have change function working and speech
Ver. 2.2 should exist
-
+
************************************************************************************/
#include "emu.h"
@@ -28,16 +28,16 @@ Ver. 2.2 should exist
* LOG defines *
****************************/
-#define LOG_AY8910 0
+#define LOG_AY8910 0
#define LOG_MSM5205 0
-#define LOG_CSO1 0
-#define LOG_CSO2 0
+#define LOG_CSO1 0
+#define LOG_CSO2 0
/****************************
* Clock defines *
****************************/
-#define MAIN_XTAL XTAL_8MHz
+#define MAIN_XTAL XTAL_8MHz
#define CPU_CLK MAIN_XTAL/2
#define AY_CLK CPU_CLK/2
#define MSM_CLK 384000
@@ -54,11 +54,11 @@ public:
m_ticket(*this, "hopper"),
m_filter1(*this, "filter1"),
m_filter2(*this, "filter2")
-
-
+
+
{ }
UINT8 m_int;
-
+
//OUT1
UINT8 m_ckmod;
UINT8 m_dmod;
@@ -68,7 +68,7 @@ public:
UINT8 m_seg;
UINT8 m_printer;
UINT8 m_auxp;
-
+
//helper...
UINT8 m_old_ckmod;
UINT8 m_old_emod;
@@ -82,7 +82,7 @@ public:
UINT8 m_cont_ent;
UINT8 m_cont_sal;
UINT8 m_cont_caj;
-
+
//lamps out
UINT64 m_custom_data;
UINT8 m_auxs;
@@ -117,7 +117,7 @@ public:
UINT8 m_ml;
UINT8 m_mc;
UINT8 m_mr;
-
+
DECLARE_READ8_MEMBER(start_read);
DECLARE_WRITE8_MEMBER(w_a0);
@@ -125,18 +125,18 @@ public:
DECLARE_WRITE8_MEMBER(cso1_w);
DECLARE_WRITE8_MEMBER(cso2_w);
DECLARE_WRITE8_MEMBER(csoki_w);
- DECLARE_READ8_MEMBER(csoki_r);
-
+ DECLARE_READ8_MEMBER(csoki_r);
+
DECLARE_READ8_MEMBER(ay8910_a_r);
DECLARE_READ8_MEMBER(ay8910_b_r);
-
+
DECLARE_DRIVER_INIT(mgavegas);
DECLARE_DRIVER_INIT(mgavegas21);
DECLARE_DRIVER_INIT(mgavegas133);
-
+
TIMER_DEVICE_CALLBACK_MEMBER(int_0);
-
-
+
+
protected:
// devices
@@ -158,8 +158,7 @@ private:
void mgavegas_state::update_lamp(){
-
- //output_set_value("AUXS", m_auxs); //unused
+ //output_set_value("AUXS", m_auxs); //unused
output_set_value("MGA4", m_anal&0x01);
output_set_value("MGA3", m_anacl&0x01);
output_set_value("MGA2", m_anacr&0x01);
@@ -171,7 +170,7 @@ void mgavegas_state::update_lamp(){
output_set_value("1002", m_luz_100_rul&0x01);
output_set_value("50", m_luz_50_rlul&0x01);
output_set_value("252", m_luz_25_lrul&0x01);
- output_set_value("25", m_luz_25_rrul&0x01);
+ output_set_value("25", m_luz_25_rrul&0x01);
output_set_value("FL", m_fl&0x01);
output_set_value("FC", m_fc&0x01);
output_set_value("FR", m_fr&0x01);
@@ -179,7 +178,7 @@ void mgavegas_state::update_lamp(){
output_set_value("NOCAMBIO", m_no_cambio&0x01);
output_set_value("FUSE", m_fuse&0x01);
output_set_value("FALTA", m_falta&0x01);
- //output_set_value("ANAG", m_anag&0x01); //unused
+ //output_set_value("ANAG", m_anag&0x01); //unused
output_set_value("CL", m_cl&0x01);
output_set_value("CC", m_cc&0x01);
output_set_value("CR", m_cr&0x01);
@@ -192,18 +191,18 @@ void mgavegas_state::update_lamp(){
output_set_value("MC", m_mc&0x01);
output_set_value("MR", m_mr&0x01);
/*
- m_inh=BIT(data, 3);
- m_printer=BIT(data, 6); //not_used
- m_auxp=BIT(data, 7); //not_used
-
- m_bobina_ctrl=BIT(data, 0);
- m_timbre=BIT(data, 1);
- m_coil_1=BIT(data, 2);
- m_coil_2=BIT(data, 3);
- m_coil_3=BIT(data, 4);
- m_cont_ent=BIT(data, 5);
- m_cont_sal=BIT(data, 6);
- m_cont_caj=BIT(data, 7);
+ m_inh=BIT(data, 3);
+ m_printer=BIT(data, 6); //not_used
+ m_auxp=BIT(data, 7); //not_used
+
+ m_bobina_ctrl=BIT(data, 0);
+ m_timbre=BIT(data, 1);
+ m_coil_1=BIT(data, 2);
+ m_coil_2=BIT(data, 3);
+ m_coil_3=BIT(data, 4);
+ m_cont_ent=BIT(data, 5);
+ m_cont_sal=BIT(data, 6);
+ m_cont_caj=BIT(data, 7);
*/
}
@@ -217,50 +216,50 @@ UINT64 tmp;
}
if( (m_emod==0) & (m_old_emod==1) ){
- //valid emod, check for valid data and updatae custom status this is how the hw works
+ //valid emod, check for valid data and updatae custom status this is how the hw works
if( (BIT(m_custom_data, 32)==0) && (BIT(m_custom_data, 33)==0) && (BIT(m_custom_data, 34)==0) && (BIT(m_custom_data, 35)==0) ){
tmp=~m_custom_data;
- m_auxs= tmp&0x00000001;
-// m_anal= (tmp&0x00000002)>>1; //schematics error!!!
-// m_anacl= (tmp&0x00000004)>>2; //schematics error!!!
- m_luz_50_rlul= (tmp&0x00000002)>>1;
- m_luz_25_lrul= (tmp&0x00000004)>>2;
- m_anacr= (tmp&0x00000008)>>3;
- m_anar= (tmp&0x00000010)>>4;
- m_pl= (tmp&0x00000020)>>5;
- m_pc= (tmp&0x00000040)>>6;
- m_pr= (tmp&0x00000080)>>7;
- m_luz_250_rul= (tmp&0x00000100)>>8;
- m_luz_100_rul= (tmp&0x00000200)>>9;
-// m_luz_50_rlul= (tmp&0x00000400)>>10; //schematics error!!!
-// m_luz_25_lrul= (tmp&0x00000800)>>11; //schematics error!!!
- m_anacl= (tmp&0x00000400)>>10;
- m_anal= (tmp&0x00000800)>>11;
- m_luz_25_rrul= (tmp&0x00001000)>>12;
- m_fl= (tmp&0x00002000)>>13;
- m_fc= (tmp&0x00004000)>>14;
- m_fr= (tmp&0x00008000)>>15;
- m_insert_coin= (tmp&0x00010000)>>16;
- m_no_cambio= (tmp&0x00020000)>>17;
- m_fuse= (tmp&0x00040000)>>18;
- m_falta= (tmp&0x00080000)>>19;
- m_anag= (tmp&0x00100000)>>20;
- m_cl= (tmp&0x00200000)>>21;
- m_cc= (tmp&0x00400000)>>22;
- m_cr= (tmp&0x00800000)>>23;
- m_premio_s= (tmp&0x01000000)>>24;
- m_100= (tmp&0x02000000)>>25;
- m_200= (tmp&0x04000000)>>26;
- m_300= (tmp&0x08000000)>>27;
- m_500= (tmp&0x10000000)>>28;
- m_ml= (tmp&0x20000000)>>29;
- m_mc= (tmp&0x40000000)>>30;
- m_mr= (tmp&0x80000000)>>31;
+ m_auxs= tmp&0x00000001;
+// m_anal= (tmp&0x00000002)>>1; //schematics error!!!
+// m_anacl= (tmp&0x00000004)>>2; //schematics error!!!
+ m_luz_50_rlul= (tmp&0x00000002)>>1;
+ m_luz_25_lrul= (tmp&0x00000004)>>2;
+ m_anacr= (tmp&0x00000008)>>3;
+ m_anar= (tmp&0x00000010)>>4;
+ m_pl= (tmp&0x00000020)>>5;
+ m_pc= (tmp&0x00000040)>>6;
+ m_pr= (tmp&0x00000080)>>7;
+ m_luz_250_rul= (tmp&0x00000100)>>8;
+ m_luz_100_rul= (tmp&0x00000200)>>9;
+// m_luz_50_rlul= (tmp&0x00000400)>>10; //schematics error!!!
+// m_luz_25_lrul= (tmp&0x00000800)>>11; //schematics error!!!
+ m_anacl= (tmp&0x00000400)>>10;
+ m_anal= (tmp&0x00000800)>>11;
+ m_luz_25_rrul= (tmp&0x00001000)>>12;
+ m_fl= (tmp&0x00002000)>>13;
+ m_fc= (tmp&0x00004000)>>14;
+ m_fr= (tmp&0x00008000)>>15;
+ m_insert_coin= (tmp&0x00010000)>>16;
+ m_no_cambio= (tmp&0x00020000)>>17;
+ m_fuse= (tmp&0x00040000)>>18;
+ m_falta= (tmp&0x00080000)>>19;
+ m_anag= (tmp&0x00100000)>>20;
+ m_cl= (tmp&0x00200000)>>21;
+ m_cc= (tmp&0x00400000)>>22;
+ m_cr= (tmp&0x00800000)>>23;
+ m_premio_s= (tmp&0x01000000)>>24;
+ m_100= (tmp&0x02000000)>>25;
+ m_200= (tmp&0x04000000)>>26;
+ m_300= (tmp&0x08000000)>>27;
+ m_500= (tmp&0x10000000)>>28;
+ m_ml= (tmp&0x20000000)>>29;
+ m_mc= (tmp&0x40000000)>>30;
+ m_mr= (tmp&0x80000000)>>31;
update_lamp();
}
}
-
+
m_old_ckmod=m_ckmod;
m_old_emod=m_emod;
}
@@ -268,7 +267,7 @@ UINT64 tmp;
READ8_MEMBER( mgavegas_state::start_read )
{
-// in HW it look for /IOREQ going down to clear the IRQ line
+// in HW it look for /IOREQ going down to clear the IRQ line
if (m_int){
m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
m_int=0;
@@ -285,44 +284,43 @@ READ8_MEMBER(mgavegas_state::r_a0)
{
UINT8 ret=0;
-
+
switch (offset&0x03)
{
- case 1: //bdir=0 BC1=1
+ case 1: //bdir=0 BC1=1
ret=m_ay->data_r(space,0);
break;
- default:
+ default:
if (LOG_AY8910)
logerror("AY 3-8910 area unknow read!!!\n");
break;
}
-
+
if (LOG_AY8910)
- logerror("read from %04X return %02X\n",offset+0xa000,ret);
+ logerror("read from %04X return %02X\n",offset+0xa000,ret);
return ret;
}
WRITE8_MEMBER(mgavegas_state::w_a0)
{
-
if (LOG_AY8910)
logerror("write to %04X data = %02X \n",offset+0xa000,data);
switch (offset&0x03)
{
- case 0: //bdir=1 bc1=1
+ case 0: //bdir=1 bc1=1
m_ay->address_w(space,0,data );
break;
- case 2: //bdir=1 bc1=0
+ case 2: //bdir=1 bc1=0
m_ay->data_w(space,0,data );
break;
/*
- case 1: //bdir=0 bc1=1
- break;
- case 3: //bdir=0 bc1=0
- break;
+ case 1: //bdir=0 bc1=1
+ break;
+ case 3: //bdir=0 bc1=0
+ break;
*/
- default:
+ default:
if (LOG_AY8910)
logerror("AY 3-8910 area unknow write!!!\n");
break;
@@ -338,13 +336,12 @@ READ8_MEMBER(mgavegas_state::csoki_r)
UINT8 ret=0;
if (LOG_MSM5205)
- logerror("read from %04X return %02X\n",offset+0xc800,ret);
+ logerror("read from %04X return %02X\n",offset+0xc800,ret);
return ret;
}
WRITE8_MEMBER(mgavegas_state::csoki_w)
{
-
if (LOG_MSM5205)
logerror("MSM5205 write to %04X data = %02X \n",offset+0xc800,data);
m_msm->reset_w(data&0x10>>4);
@@ -357,15 +354,15 @@ WRITE8_MEMBER(mgavegas_state::cso1_w)
int hopper_data = 0x00;
if (LOG_CSO1)
logerror("write to CSO1 data = %02X\n",data);
-
+
m_ckmod=BIT(data, 0);
m_dmod=BIT(data, 1);
m_emod=BIT(data, 2);
m_inh=BIT(data, 3);
m_hop=BIT(data, 4);
m_seg=BIT(data, 5);
- m_printer=BIT(data, 6); //not_used
- m_auxp=BIT(data, 7); //not_used
+ m_printer=BIT(data, 6); //not_used
+ m_auxp=BIT(data, 7); //not_used
update_custom();
@@ -377,7 +374,7 @@ WRITE8_MEMBER(mgavegas_state::cso2_w)
{
if (LOG_CSO2)
logerror("write to CSO2 data = %02X\n",data);
-
+
m_bobina_ctrl=BIT(data, 0);
m_timbre=BIT(data, 1);
m_coil_1=BIT(data, 2);
@@ -411,7 +408,7 @@ READ8_MEMBER(mgavegas_state::ay8910_b_r)
if (LOG_AY8910)
logerror("read from port B return %02X\n",ret);
-
+
return ret;
}
@@ -422,12 +419,12 @@ READ8_MEMBER(mgavegas_state::ay8910_b_r)
static ADDRESS_MAP_START( mgavegas_map, AS_PROGRAM, 8, mgavegas_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x9fff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0xa000, 0xa003) AM_READWRITE(r_a0,w_a0) // AY-3-8910
- AM_RANGE(0xc000, 0xc001) AM_WRITE(cso1_w) // /CSout1
- AM_RANGE(0xc400, 0xc401) AM_WRITE(cso2_w) // /CSout2
- AM_RANGE(0xc800, 0xc801) AM_READWRITE(csoki_r,csoki_w) // /CSoki
- //AM_RANGE(0xcc00, 0xcc01) AM_READWRITE(cso3_r,cso3_w) // /CSout3 unused
- //AM_RANGE(0xe000, 0xe003) AM_READWRITE(r_e0,w_e0) // /CSaux unused
+ AM_RANGE(0xa000, 0xa003) AM_READWRITE(r_a0,w_a0) // AY-3-8910
+ AM_RANGE(0xc000, 0xc001) AM_WRITE(cso1_w) // /CSout1
+ AM_RANGE(0xc400, 0xc401) AM_WRITE(cso2_w) // /CSout2
+ AM_RANGE(0xc800, 0xc801) AM_READWRITE(csoki_r,csoki_w) // /CSoki
+ //AM_RANGE(0xcc00, 0xcc01) AM_READWRITE(cso3_r,cso3_w) // /CSout3 unused
+ //AM_RANGE(0xe000, 0xe003) AM_READWRITE(r_e0,w_e0) // /CSaux unused
ADDRESS_MAP_END
@@ -443,15 +440,15 @@ static INPUT_PORTS_START( mgavegas )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) //200ptas in for change with 8 25 ptas coins
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) //25 ptas in to play
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) //100ptas in for change with 4 25 ptas coins
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER )
PORT_BIT( 0x10, IP_ACTIVE_LOW,IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Y) PORT_NAME("25 ptas level") //"hack" hopper always full
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U) PORT_NAME("Door")
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Y) PORT_NAME("25 ptas level") //"hack" hopper always full
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U) PORT_NAME("Door")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I) PORT_NAME("Channel")
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x02, "Percentage" )
- PORT_DIPSETTING( 0x00, "70%" )
+ PORT_DIPSETTING( 0x00, "70%" )
PORT_DIPSETTING( 0x01, "70%" )
PORT_DIPSETTING( 0x02, "72%" )
PORT_DIPSETTING( 0x03, "74%" )
@@ -459,25 +456,25 @@ static INPUT_PORTS_START( mgavegas )
PORT_DIPSETTING( 0x05, "78%" )
PORT_DIPSETTING( 0x06, "80%" )
PORT_DIPSETTING( 0x07, "82%" )
-
+
PORT_DIPNAME( 0x08, 0x08, "Sound" )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
-
+
PORT_DIPNAME( 0x10, 0x10, "Speech" )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
-
+
PORT_DIPNAME( 0x60, 0x00, "Jackpot" )
PORT_DIPSETTING( 0x40, "Jackpot 1%" )
PORT_DIPSETTING( 0x60, "Jackpot 2,5%" )
PORT_DIPSETTING( 0x00, "Jackpot 5%" )
- //PORT_DIPSETTING( 0x20, DEF_STR( On ) ) //unlisted
-
+ //PORT_DIPSETTING( 0x20, DEF_STR( On ) ) //unlisted
+
PORT_DIPNAME( 0x80, 0x80, "Reset" )
PORT_DIPSETTING( 0x80, "Normal Gameplay" )
PORT_DIPSETTING( 0x00, "Reset" )
-
+
INPUT_PORTS_END
/******************************
@@ -486,10 +483,9 @@ INPUT_PORTS_END
void mgavegas_state::machine_reset()
{
-
m_int=1;
m_custom_data=U64(0xffffffffffffffff);
-
+
m_old_ckmod=1;
m_old_emod=0;
@@ -501,8 +497,8 @@ void mgavegas_state::machine_reset()
m_seg=0;
m_printer=0;
m_auxp=0;
-
-
+
+
m_bobina_ctrl=0;
m_timbre=0;
m_coil_1=0;
@@ -511,7 +507,7 @@ void mgavegas_state::machine_reset()
m_cont_ent=0;
m_cont_sal=0;
m_cont_caj=0;
-
+
m_auxs=0;
m_anal=0;
m_anacl=0;
@@ -543,10 +539,10 @@ void mgavegas_state::machine_reset()
m_500=0;
m_ml=0;
m_mc=0;
- m_mr=0;
+ m_mr=0;
- m_filter1->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 0, 0, CAP_N(1) ); /* RC out of MSM5205 R=1K C=1nF */
- m_filter2->filter_rc_set_RC(FLT_RC_HIGHPASS, 3846, 0, 0, CAP_N(100 )); /*ALP3B active-hybrid filter fc=2.6Khz 2poles???*/
+ m_filter1->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 0, 0, CAP_N(1) ); /* RC out of MSM5205 R=1K C=1nF */
+ m_filter2->filter_rc_set_RC(FLT_RC_HIGHPASS, 3846, 0, 0, CAP_N(100 )); /*ALP3B active-hybrid filter fc=2.6Khz 2poles???*/
}
@@ -578,7 +574,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( mgavegas_state::int_0 )
DRIVER_INIT_MEMBER(mgavegas_state,mgavegas133)
{
//hack to clear the irq on reti instruction
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x00dd, 0x00dd, read8_delegate(FUNC(mgavegas_state::start_read), this));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x00dd, 0x00dd, read8_delegate(FUNC(mgavegas_state::start_read), this));
}
/*************************
@@ -588,37 +584,37 @@ DRIVER_INIT_MEMBER(mgavegas_state,mgavegas133)
static MACHINE_CONFIG_START( mgavegas, mgavegas_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", Z80, CPU_CLK)
+ MCFG_CPU_ADD("maincpu", Z80, CPU_CLK)
MCFG_CPU_PROGRAM_MAP(mgavegas_map)
-
+
MCFG_TIMER_DRIVER_ADD_PERIODIC("int_0", mgavegas_state, int_0, attotime::from_hz(6000)) //6KHz from MSM5205 /VCK
-
+
MCFG_NVRAM_ADD_1FILL("nvram")
-
+
MCFG_TICKET_DISPENSER_ADD("hopper",attotime::from_msec(200),TICKET_MOTOR_ACTIVE_HIGH,TICKET_STATUS_ACTIVE_LOW);
/* sound hardware */
-
+
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("aysnd", AY8910, AY_CLK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.3)
MCFG_AY8910_PORT_A_READ_CB(READ8(mgavegas_state, ay8910_a_r))
MCFG_AY8910_PORT_B_READ_CB(READ8(mgavegas_state, ay8910_b_r))
-
- MCFG_SOUND_ADD("5205", MSM5205, MSM_CLK)
- MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S64_4B)
+
+ MCFG_SOUND_ADD("5205", MSM5205, MSM_CLK)
+ MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S64_4B)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter1", 2.0)
-
+
MCFG_FILTER_RC_ADD("filter1", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter2",2.0)
MCFG_FILTER_RC_ADD("filter2", 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
-
+
/* Video */
MCFG_DEFAULT_LAYOUT(layout_mgavegas)
-
+
MACHINE_CONFIG_END
@@ -630,24 +626,24 @@ MACHINE_CONFIG_END
ROM_START(mgavegas)
ROM_REGION(0x8000, "maincpu", 0)
ROM_LOAD("vegas1-k2.3.bin", 0x0000, 0x8000, CRC(418b1d04) SHA1(27669a85ed52d5dab25d6ebea6ef3d9b01a4795d) )
-
- ROM_REGION( 0x2000, "nvram", 0 )
+
+ ROM_REGION( 0x2000, "nvram", 0 )
ROM_LOAD( "mgavegas23.nv", 0x0000, 0x2000, CRC(d0a175b0) SHA1(7698135dbc020f459fdaa660bf488595b67b77d0) ) //default setting
ROM_END
ROM_START(mgavegas21)
ROM_REGION(0x8000, "maincpu", 0)
ROM_LOAD("vegas1-2.1.bin", 0x0000, 0x8000, CRC(a7e988a4) SHA1(32fa1684c79f4a132553fa41006f243d4b51cef6) )
-
- ROM_REGION( 0x2000, "nvram", 0 )
+
+ ROM_REGION( 0x2000, "nvram", 0 )
ROM_LOAD( "mgavegas21.nv", 0x0000, 0x2000, CRC(a4471550) SHA1(b8527e9158b5563460febd1009b44c8d74dbae4e) ) //default setting
ROM_END
ROM_START(mgavegas133)
ROM_REGION(0x8000, "maincpu", 0)
ROM_LOAD("vegas1-1.33.bin", 0x0000, 0x8000, CRC(1eea7f0f) SHA1(6fb54b8e2ab19e5378a95192e5007175ad76bc7a) )
-
- ROM_REGION( 0x2000, "nvram", 0 )
+
+ ROM_REGION( 0x2000, "nvram", 0 )
ROM_LOAD( "mgavegas133.nv", 0x0000, 0x2000, CRC(20fe4db7) SHA1(887b69468ac7e6490827a06cd1f0ff15228a9c73) ) //default setting
ROM_END
@@ -655,7 +651,7 @@ ROM_END
/*************************
* Game Drivers *
*************************/
-/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS*/
-GAME( 1985, mgavegas, 0, mgavegas, mgavegas, mgavegas_state, mgavegas, ROT0, "MGA", "Vegas 1 (Ver 2.3 dual coin pulse, shorter)", GAME_MECHANICAL )
-GAME( 1985, mgavegas21, mgavegas, mgavegas, mgavegas, mgavegas_state, mgavegas21, ROT0, "MGA", "Vegas 1 (Ver 2.1 dual coin pulse, longer)", GAME_MECHANICAL )
-GAME( 1985, mgavegas133, mgavegas, mgavegas, mgavegas, mgavegas_state, mgavegas133,ROT0, "MGA", "Vegas 1 (Ver 1.33 single coin pulse)", GAME_MECHANICAL )
+/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS*/
+GAME( 1985, mgavegas, 0, mgavegas, mgavegas, mgavegas_state, mgavegas, ROT0, "MGA", "Vegas 1 (Ver 2.3 dual coin pulse, shorter)", GAME_MECHANICAL )
+GAME( 1985, mgavegas21, mgavegas, mgavegas, mgavegas, mgavegas_state, mgavegas21, ROT0, "MGA", "Vegas 1 (Ver 2.1 dual coin pulse, longer)", GAME_MECHANICAL )
+GAME( 1985, mgavegas133, mgavegas, mgavegas, mgavegas, mgavegas_state, mgavegas133,ROT0, "MGA", "Vegas 1 (Ver 1.33 single coin pulse)", GAME_MECHANICAL )
diff --git a/src/mame/drivers/midtunit.c b/src/mame/drivers/midtunit.c
index 5c4387992a5..bba97d32365 100644
--- a/src/mame/drivers/midtunit.c
+++ b/src/mame/drivers/midtunit.c
@@ -587,7 +587,7 @@ static MACHINE_CONFIG_START( tunit_core, midtunit_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(PIXEL_CLOCK) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_IND16_CB(midtunit_state, scanline_update) /* scanline updater (indexed16) */
MCFG_TMS340X0_TO_SHIFTREG_CB(midtunit_state, to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(midtunit_state, from_shiftreg) /* read from shiftreg function */
diff --git a/src/mame/drivers/midwunit.c b/src/mame/drivers/midwunit.c
index 72a17838992..3039333413f 100644
--- a/src/mame/drivers/midwunit.c
+++ b/src/mame/drivers/midwunit.c
@@ -621,7 +621,7 @@ static MACHINE_CONFIG_START( wunit, midwunit_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(PIXEL_CLOCK) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_IND16_CB(midtunit_state, scanline_update) /* scanline updater (indexed16) */
MCFG_TMS340X0_TO_SHIFTREG_CB(midtunit_state, to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(midtunit_state, from_shiftreg) /* read from shiftreg function */
diff --git a/src/mame/drivers/midxunit.c b/src/mame/drivers/midxunit.c
index 1f71b61939d..9beb50d4ac3 100644
--- a/src/mame/drivers/midxunit.c
+++ b/src/mame/drivers/midxunit.c
@@ -245,7 +245,7 @@ static MACHINE_CONFIG_START( midxunit, midxunit_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(PIXEL_CLOCK) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_IND16_CB(midxunit_state, scanline_update) /* scanline updater (indexed16) */
MCFG_TMS340X0_TO_SHIFTREG_CB(midtunit_state, to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(midtunit_state, from_shiftreg) /* read from shiftreg function */
diff --git a/src/mame/drivers/midyunit.c b/src/mame/drivers/midyunit.c
index 03c1834ea7c..210faa153c3 100644
--- a/src/mame/drivers/midyunit.c
+++ b/src/mame/drivers/midyunit.c
@@ -1073,7 +1073,7 @@ static MACHINE_CONFIG_START( zunit, midyunit_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(MEDRES_PIXEL_CLOCK) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_IND16_CB(midyunit_state, scanline_update) /* scanline updater (indexed16) */
MCFG_TMS340X0_TO_SHIFTREG_CB(midyunit_state, to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(midyunit_state, from_shiftreg) /* read from shiftreg function */
@@ -1115,7 +1115,7 @@ static MACHINE_CONFIG_START( yunit_core, midyunit_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(STDRES_PIXEL_CLOCK) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_IND16_CB(midyunit_state, scanline_update) /* scanline updater (indexed16) */
MCFG_TMS340X0_TO_SHIFTREG_CB(midyunit_state, to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(midyunit_state, from_shiftreg) /* read from shiftreg function */
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index c12e2077413..1c98a8871e9 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -783,7 +783,7 @@ WRITE16_MEMBER(model1_state::md1_w)
COMBINE_DATA(m_display_list1+offset);
// never executed
//if(0 && offset)
- // return;
+ // return;
if(1 && m_dump)
logerror("TGP: md1_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, space.device().safe_pc());
}
@@ -793,7 +793,7 @@ WRITE16_MEMBER(model1_state::md0_w)
COMBINE_DATA(m_display_list0+offset);
// never executed
//if(0 && offset)
- // return;
+ // return;
if(1 && m_dump)
logerror("TGP: md0_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, space.device().safe_pc());
}
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index 6b09ee0b391..49708a3a1e4 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -32,16 +32,16 @@
von2/von254g - works
fvipers2 - waiting for decrementer (same code as eca)
vs298 - works, hangs with an onscreen error code
- vs299/vs2v991 - works
- oceanhun - same as daytona2
- lamachin - works
+ vs299/vs2v991 - works
+ oceanhun - same as daytona2
+ lamachin - works
dayto2pe - bug in DRC MMU page-fault handling, causes infinite loop at PC:0x2270 (or debug assert)
daytona2 - As above.
spikeout/spikeofe - As above.
dirtdvls/dirtdvla - works
- swtrilgy -
- swtrilga -
+ swtrilgy -
+ swtrilga -
magtruck - works, broken FPU values in matrices during 2nd part of attract mode (cpu core bug?)
eca/ecax - cabinet network error
@@ -1615,7 +1615,7 @@ READ8_MEMBER(model3_state::model3_sound_r)
{
UINT8 res = 0;
res |= 1;
- res |= 0x2; // magtruck country check
+ res |= 0x2; // magtruck country check
return res;
}
}
@@ -5401,8 +5401,8 @@ WRITE8_MEMBER(model3_state::scsp_irq)
0x02: Video (VBLANK start?)
0x01: Video (unused?)
- IRQ 0x08 and 0x04 directly affect the game speed in magtruck, once per scanline seems fast enough
- Un-syncing the interrupts breaks the progress bar in magtruck
+ IRQ 0x08 and 0x04 directly affect the game speed in magtruck, once per scanline seems fast enough
+ Un-syncing the interrupts breaks the progress bar in magtruck
*/
TIMER_DEVICE_CALLBACK_MEMBER(model3_state::model3_interrupt)
{
@@ -5694,8 +5694,8 @@ DRIVER_INIT_MEMBER(model3_state,lemans24)
DRIVER_INIT_CALL(model3_15);
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc1000000, 0xc10000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this));
-
-// rom[(0x73fe38^4)/4] = 0x38840004; /* This seems to be an actual bug in the original code */
+
+// rom[(0x73fe38^4)/4] = 0x38840004; /* This seems to be an actual bug in the original code */
}
DRIVER_INIT_MEMBER(model3_state,vf3)
@@ -5826,11 +5826,11 @@ DRIVER_INIT_MEMBER(model3_state,harleya)
DRIVER_INIT_MEMBER(model3_state,srally2)
-{
+{
DRIVER_INIT_CALL(model3_20);
- UINT32 *rom = (UINT32*)memregion("user1")->base();
+ UINT32 *rom = (UINT32*)memregion("user1")->base();
rom[(0x7c0c4^4)/4] = 0x60000000;
rom[(0x7c0c8^4)/4] = 0x60000000;
rom[(0x7c0cc^4)/4] = 0x60000000;
@@ -5850,7 +5850,7 @@ DRIVER_INIT_MEMBER(model3_state,swtrilgy)
rom[(0xf7770^4)/4] = 0x60000000;
rom[(0xf7774^4)/4] = 0x60000000;
- rom[(0x043dc^4)/4] = 0x48000090; // skip force feedback setup
+ rom[(0x043dc^4)/4] = 0x48000090; // skip force feedback setup
rom[(0xf6e44^4)/4] = 0x60000000;
}
@@ -5865,7 +5865,7 @@ DRIVER_INIT_MEMBER(model3_state,swtrilga)
DRIVER_INIT_MEMBER(model3_state,von2)
{
m_step20_with_old_real3d = true;
-
+
DRIVER_INIT_CALL(model3_20);
}
diff --git a/src/mame/drivers/mpu5hw.c b/src/mame/drivers/mpu5hw.c
index d872c920f73..cadb7988b6b 100644
--- a/src/mame/drivers/mpu5hw.c
+++ b/src/mame/drivers/mpu5hw.c
@@ -17,8 +17,8 @@
-- Much of the communication is done via a 68681 DUART.
- -- The ASIC acts as the main I/O control, including an interface to a Z89321 DSP and a 16bit DAC.
-
+ -- The ASIC acts as the main I/O control, including an interface to a Z89321 DSP and a 16bit DAC.
+
-- Help wanted, the MFME sources (which are based on MAME anyway) should be of some help here, if somebody
in the FM emu community wants to adopt this driver they're welcome to it.
@@ -68,7 +68,7 @@ public:
UINT8 m_pic_stored_input;
UINT8 m_pic_output_bit;
UINT8 m_input_strobe;
-
+
DECLARE_READ32_MEMBER(mpu5_mem_r);
DECLARE_WRITE32_MEMBER(mpu5_mem_w);
@@ -101,7 +101,7 @@ READ8_MEMBER(mpu5_state::asic_r8)
//send init and ready for now - need to work on full DSP
return 0x85;
}
-
+
case 0x0b:
{
return 0;
@@ -148,19 +148,19 @@ READ32_MEMBER(mpu5_state::mpu5_mem_r)
logerror("%08x DUART read\n", pc);
break;
}
-
+
case 0xf0:
{
return asic_r32(space, offset&3,mem_mask);
}
-
+
default:
logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs);
break;
}
}
break;
-
+
case 3:
case 4:
offset &=0x3fff;
@@ -188,7 +188,7 @@ WRITE8_MEMBER(mpu5_state::asic_w8)
if (m_led_strobe_temp != data)
{
m_led_strobe_temp = data;
-
+
switch (m_led_strobe_temp)
{
case 0x00:
@@ -222,7 +222,7 @@ WRITE8_MEMBER(mpu5_state::asic_w8)
}
break;
}
-
+
case 0x09:
{
//Assume SEC fitted for now
@@ -233,12 +233,12 @@ WRITE8_MEMBER(mpu5_state::asic_w8)
case 0x0b:
{
output_set_value("statuslamp1", ((data&0x10) != 0));
-
+
output_set_value("statuslamp2", ((data&0x20) != 0));
-
+
if (data & 0x40)
{
-// m_dsp_pin =1;
+// m_dsp_pin =1;
}
}
break;
@@ -280,7 +280,7 @@ WRITE32_MEMBER(mpu5_state::pic_w)
m_pic_bit1 = (data & 0x01);
break;
}
-
+
case 0x06:
case 0x07:
{
@@ -291,17 +291,17 @@ WRITE32_MEMBER(mpu5_state::pic_w)
m_pic_data |= m_pic_bit1;
m_pic_stored_input <<= 1;
m_pic_clocked_bits ++;
-
+
if (m_pic_clocked_bits >=8)
{
m_pic_data =0;
m_pic_clocked_bits =0;
-
+
if (m_input_strobe <4)
{
m_input_strobe +=1;
}
-
+
}
}
else
@@ -319,7 +319,7 @@ WRITE32_MEMBER(mpu5_state::pic_w)
break;
}
}
-
+
}
WRITE32_MEMBER(mpu5_state::mpu5_mem_w)
@@ -344,13 +344,13 @@ WRITE32_MEMBER(mpu5_state::mpu5_mem_w)
logerror("%08x DUART write\n", pc);
break;
}
-
+
case 0xf0:
{
asic_w32(space, offset&3,data,mem_mask);
break;
}
-
+
default:
logerror("%08x maincpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, offset*4, data, mem_mask, cs);
break;
diff --git a/src/mame/drivers/namcops2.c b/src/mame/drivers/namcops2.c
index 99090de02fe..53dde34a38a 100644
--- a/src/mame/drivers/namcops2.c
+++ b/src/mame/drivers/namcops2.c
@@ -208,8 +208,8 @@ ROM_START( kinniku2 )
SYSTEM256_BIOS
ROM_REGION(0x840000, "key", ROMREGION_ERASE00)
- ROM_LOAD( "kn2vera.ic002", 0x000000, 0x800000, CRC(fb2f71f7) SHA1(29a331cc171d395ad10b352b9b30a61a455a50fe) )
- ROM_LOAD( "kn2vera_spr.ic002", 0x800000, 0x040000, CRC(9c18fa50) SHA1(1f75052cf264c3f2e5b332a755d30544d6e5f45c) )
+ ROM_LOAD( "kn2vera.ic002", 0x000000, 0x800000, CRC(fb2f71f7) SHA1(29a331cc171d395ad10b352b9b30a61a455a50fe) )
+ ROM_LOAD( "kn2vera_spr.ic002", 0x800000, 0x040000, CRC(9c18fa50) SHA1(1f75052cf264c3f2e5b332a755d30544d6e5f45c) )
DISK_REGION("dvd")
DISK_IMAGE_READONLY( "kn2", 0, SHA1(3e1b773cc584911b673d46f9296a5b1a2cef9a45) )
@@ -526,7 +526,7 @@ ROM_START( fateulc )
ROM_LOAD( "fud1vera.ic002", 0x000000, 0x800000, CRC(892ffdd1) SHA1(4a444ed49e5c89dd0af4f026626a164b9eec61d1) )
ROM_LOAD( "fud1vera_spr.ic002", 0x800000, 0x040000, CRC(0fca4e99) SHA1(0bd74de26f10089ee848f03093229abfa8c84663) )
- DISK_REGION("dvd") // actually HDD for this game
+ DISK_REGION("dvd") // actually HDD for this game
DISK_IMAGE_READONLY( "fud-hdd0-a", 0, SHA1(1189863ae0e339e11708b9660521f86b3b97bc9e) )
ROM_END
@@ -558,10 +558,10 @@ ROM_START( gdvsgdnx )
SYSTEM256_BIOS
ROM_REGION(0x840000, "key", ROMREGION_ERASE00)
- ROM_LOAD( "gnx1001-na-a.ic002", 0x000000, 0x800000, CRC(1d6d2f54) SHA1(17f6e7278e61b5b81605175d3f2df7b747ca7246) )
- ROM_LOAD( "gnx1001-na-a_spr.ic002", 0x800000, 0x040000, CRC(a999ba5c) SHA1(009a56f7be50b57bf435fb8c8b41cf14086b1d1a) )
+ ROM_LOAD( "gnx1001-na-a.ic002", 0x000000, 0x800000, CRC(1d6d2f54) SHA1(17f6e7278e61b5b81605175d3f2df7b747ca7246) )
+ ROM_LOAD( "gnx1001-na-a_spr.ic002", 0x800000, 0x040000, CRC(a999ba5c) SHA1(009a56f7be50b57bf435fb8c8b41cf14086b1d1a) )
- DISK_REGION("dvd") // actually HDD for this game
+ DISK_REGION("dvd") // actually HDD for this game
DISK_IMAGE_READONLY( "gnx100-1na-a", 0, SHA1(a2344f533895793a2e13198c7de0c759f0dbf817) )
ROM_END
@@ -581,8 +581,8 @@ ROM_START( sbxc )
SYSTEM246_BIOS
ROM_REGION(0x840000, "key", ROMREGION_ERASE00)
- ROM_LOAD( "bax1vera.ic002", 0x000000, 0x800000, CRC(18a6f424) SHA1(027a8d371fb6782c906434b86db9779057eaa954) )
- ROM_LOAD( "bax1vera_spr.ic002", 0x800000, 0x040000, CRC(abfb749b) SHA1(b45f8c79dd0cc0359f27c33f55626d6cad82127c) )
+ ROM_LOAD( "bax1vera.ic002", 0x000000, 0x800000, CRC(18a6f424) SHA1(027a8d371fb6782c906434b86db9779057eaa954) )
+ ROM_LOAD( "bax1vera_spr.ic002", 0x800000, 0x040000, CRC(abfb749b) SHA1(b45f8c79dd0cc0359f27c33f55626d6cad82127c) )
DISK_REGION("dvd")
DISK_IMAGE_READONLY( "bax1_dvd0", 0, SHA1(56d58e66eeaa57ff07668000491360853b064936) )
diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c
index 04a602f6fc7..7117b7074f3 100644
--- a/src/mame/drivers/namcos21.c
+++ b/src/mame/drivers/namcos21.c
@@ -490,7 +490,7 @@ void namcos21_state::transfer_dsp_data()
void namcos21_kickstart(running_machine &machine, int internal)
{
namcos21_state *state = machine.driver_data<namcos21_state>();
-
+
/* patch dsp watchdog */
switch( state->m_gametype )
{
diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c
index e3d63280cf9..ad63aacc3d5 100644
--- a/src/mame/drivers/naomi.c
+++ b/src/mame/drivers/naomi.c
@@ -1783,7 +1783,7 @@ READ64_MEMBER(naomi_state::aw_modem_r )
} else
if (reg == 0x284/4)
return U64(0xffffffffffffff00) | aw_ctrl_type;
-
+
osd_printf_verbose("MODEM: Unmapped read %08x\n", 0x600000+reg*4);
return 0;
@@ -1800,12 +1800,12 @@ WRITE64_MEMBER(naomi_state::aw_modem_w )
if (reg == 0x284/4)
{
/*
- 0x00600284 rw ddccbbaa
+ 0x00600284 rw ddccbbaa
aa/bb/cc/dd - set type of Maple devices at ports 0/1/2/3
- 0 - regular DC controller, but with 4 analogue channels (default)
- 1 - DC lightgun
- 2 - DC mouse/trackball
- TODO: hook this then MAME have such devices emulated
+ 0 - regular DC controller, but with 4 analogue channels (default)
+ 1 - DC lightgun
+ 2 - DC mouse/trackball
+ TODO: hook this then MAME have such devices emulated
*/
aw_ctrl_type = dat & 0xFF;
}
@@ -4109,14 +4109,14 @@ ROM_START( mushi2k5 )
NAOMI_DEFAULT_EEPROM
ROM_REGION( 0x7800000, "rom_board", ROMREGION_ERASEFF)
- ROM_LOAD( "epr-24286.ic22", 0x0000000, 0x0400000, CRC(9d26e2fc) SHA1(74bcd7daf994a5c97c836b6f060c73d31a9c06d8) )
- ROM_LOAD( "mpr-24276.ic1", 0x0800000, 0x1000000, CRC(35ac9283) SHA1(74af0e3f294fc76d44c8c6b54042186dec8b9f8a) )
- ROM_LOAD( "mpr-24277.ic2", 0x1800000, 0x1000000, CRC(16111394) SHA1(7ca20de07cfa3fa248b472819bc893f00689e3a1) )
- ROM_LOAD( "mpr-24278.ic3", 0x2800000, 0x1000000, CRC(bf0ec0bc) SHA1(7de72decf97999e74b510e9655a57ad6d1def1c8) )
- ROM_LOAD( "mpr-24279.ic4", 0x3800000, 0x1000000, CRC(f7d0ab5b) SHA1(10188a22a1918b18008973135ef2e00dd26dd6cb) )
- ROM_LOAD( "mpr-24280.ic5", 0x4800000, 0x1000000, CRC(61d5c470) SHA1(c2b3dc71706a5c8a237efc2fe5c35061abb99173) )
- ROM_LOAD( "mpr-24281.ic6", 0x5800000, 0x1000000, CRC(39133c32) SHA1(09ea8c1a98ba0fac36e18ae14ed5302feaeb89ca) )
- ROM_LOAD( "mpr-24282.ic7", 0x6800000, 0x1000000, CRC(9aa4ad5a) SHA1(2d81f99a579477c5db725f71c51f18afc15abce7) )
+ ROM_LOAD( "epr-24286.ic22", 0x0000000, 0x0400000, CRC(9d26e2fc) SHA1(74bcd7daf994a5c97c836b6f060c73d31a9c06d8) )
+ ROM_LOAD( "mpr-24276.ic1", 0x0800000, 0x1000000, CRC(35ac9283) SHA1(74af0e3f294fc76d44c8c6b54042186dec8b9f8a) )
+ ROM_LOAD( "mpr-24277.ic2", 0x1800000, 0x1000000, CRC(16111394) SHA1(7ca20de07cfa3fa248b472819bc893f00689e3a1) )
+ ROM_LOAD( "mpr-24278.ic3", 0x2800000, 0x1000000, CRC(bf0ec0bc) SHA1(7de72decf97999e74b510e9655a57ad6d1def1c8) )
+ ROM_LOAD( "mpr-24279.ic4", 0x3800000, 0x1000000, CRC(f7d0ab5b) SHA1(10188a22a1918b18008973135ef2e00dd26dd6cb) )
+ ROM_LOAD( "mpr-24280.ic5", 0x4800000, 0x1000000, CRC(61d5c470) SHA1(c2b3dc71706a5c8a237efc2fe5c35061abb99173) )
+ ROM_LOAD( "mpr-24281.ic6", 0x5800000, 0x1000000, CRC(39133c32) SHA1(09ea8c1a98ba0fac36e18ae14ed5302feaeb89ca) )
+ ROM_LOAD( "mpr-24282.ic7", 0x6800000, 0x1000000, CRC(9aa4ad5a) SHA1(2d81f99a579477c5db725f71c51f18afc15abce7) )
ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 )
ROM_END
@@ -9014,7 +9014,7 @@ GAME( 2003, puyofevp, naomi, naomim1, naomi, naomi_state, naomi, ROT0, "Sega", "
/* 0018 */ GAME( 2001, lupinsho, naomigd, naomigd, hotd2, naomi_state, naomigd, ROT0, "Sega / Eighting", "Lupin The Third - The Shooting (GDS-0018)", GAME_FLAGS )
// 0018A Lupin The Third - The Shooting (Rev A)
/* 0019 */ GAME( 2002, vathlete, naomigd, naomigd, naomi, naomi_state, naomigd, ROT0, "Sega", "Virtua Athletics / Virtua Athlete (GDS-0019)", GAME_FLAGS )
-/* 0020 */ GAME( 2002, initdo, initd, naomi2gd, naomi, naomi_state, naomi2, ROT0, "Sega", "Initial D Arcade Stage (Japan) (GDS-0020)", GAME_FLAGS )
+/* 0020 */ GAME( 2002, initdo, initd, naomi2gd, naomi, naomi_state, naomi2, ROT0, "Sega", "Initial D Arcade Stage (Japan) (GDS-0020)", GAME_FLAGS )
// 0020A Initial D Arcade Stage (Rev A)
/* 0020B */ GAME( 2002, initd, naomi2, naomi2gd, naomi, naomi_state, naomi2, ROT0, "Sega", "Initial D Arcade Stage (Rev B) (Japan) (GDS-0020B)", GAME_FLAGS )
// 0021 Lupin The Third - The Typing
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index d162389e4a5..496ebc8b147 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -72,7 +72,7 @@ NOT BUGS:
- Vandyke: Many enemies make very strange sounds because they seem to have no
rate limit for making their sound effect. This is normal, it's like this on all
PCB recordings.
-
+
----
@@ -354,11 +354,11 @@ static ADDRESS_MAP_START( vandykeb_map, AS_PROGRAM, 16, nmk16_state )
AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1")
AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1")
AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2")
-// AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff)
+// AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff)
AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */
AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w)
AM_RANGE(0x080010, 0x08001d) AM_WRITE(vandykeb_scroll_w) /* 10, 12, 1a, 1c */
-// AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff)
+// AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff)
AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x08c000, 0x08c007) AM_WRITENOP /* just in case... */
AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0")
@@ -625,37 +625,37 @@ WRITE16_MEMBER(nmk16_state::hachamf_mainram_w)
case 0xe51e/2: PROT_INPUT(0xe51e/2,0x0f82,0xe008/2,0x00080008); break;
case 0xe6b4/2: PROT_INPUT(0xe6b4/2,0x79be,0xe00c/2,0x0008000a); break;
case 0xe10e/2: PROT_JSR(0xe10e,0x8007,0x870a);//870a not 9d66
- PROT_JSR(0xe10e,0x8000,0xd9c6); break;
+ PROT_JSR(0xe10e,0x8000,0xd9c6); break;
case 0xe11e/2: PROT_JSR(0xe11e,0x8038,DUMMYA);//972a - (unused)
- PROT_JSR(0xe11e,0x8031,0x7a54); break;
+ PROT_JSR(0xe11e,0x8031,0x7a54); break;
case 0xe12e/2: PROT_JSR(0xe12e,0x8019,0x9642);//OK-9642
- PROT_JSR(0xe12e,0x8022,0xda06); break;
+ PROT_JSR(0xe12e,0x8022,0xda06); break;
case 0xe13e/2: PROT_JSR(0xe13e,0x802a,0x9d66);//9d66 not 9400 - OK
- PROT_JSR(0xe13e,0x8013,0x81aa); break;
+ PROT_JSR(0xe13e,0x8013,0x81aa); break;
case 0xe14e/2: PROT_JSR(0xe14e,0x800b,0xb3f2);//b3f2 - OK
- PROT_JSR(0xe14e,0x8004,0x8994); break;
+ PROT_JSR(0xe14e,0x8004,0x8994); break;
case 0xe15e/2: PROT_JSR(0xe15e,0x803c,0xb59e);//b59e - OK
- PROT_JSR(0xe15e,0x8035,0x8c36); break;
+ PROT_JSR(0xe15e,0x8035,0x8c36); break;
case 0xe16e/2: PROT_JSR(0xe16e,0x801d,0x9ac2);//9ac2 - OK
- PROT_JSR(0xe16e,0x8026,0x8d0c); break;
+ PROT_JSR(0xe16e,0x8026,0x8d0c); break;
case 0xe17e/2: PROT_JSR(0xe17e,0x802e,0xc366);//c366 - OK
- PROT_JSR(0xe17e,0x8017,0x870a); break;
+ PROT_JSR(0xe17e,0x8017,0x870a); break;
case 0xe18e/2: PROT_JSR(0xe18e,0x8004,DUMMYA); //unused
- PROT_JSR(0xe18e,0x8008,DUMMYA); break; //unused
+ PROT_JSR(0xe18e,0x8008,DUMMYA); break; //unused
case 0xe19e/2: PROT_JSR(0xe19e,0x8030,0xd9c6);//OK-d9c6
- PROT_JSR(0xe19e,0x8039,0x9642); break;
+ PROT_JSR(0xe19e,0x8039,0x9642); break;
case 0xe1ae/2: PROT_JSR(0xe1ae,0x8011,0x7a54);//d1f8 not c67e
- PROT_JSR(0xe1ae,0x802a,0x9d66); break;
+ PROT_JSR(0xe1ae,0x802a,0x9d66); break;
case 0xe1be/2: PROT_JSR(0xe1be,0x8022,0xda06);//da06
- PROT_JSR(0xe1be,0x801b,0xb3f2); break;
+ PROT_JSR(0xe1be,0x801b,0xb3f2); break;
case 0xe1ce/2: PROT_JSR(0xe1ce,0x8003,0x81aa);//81aa
- PROT_JSR(0xe1ce,0x800c,0xb59e); break;
+ PROT_JSR(0xe1ce,0x800c,0xb59e); break;
case 0xe1de/2: PROT_JSR(0xe1de,0x8034,0x8994);//8994 - OK
- PROT_JSR(0xe1de,0x803d,0x9ac2); break;
+ PROT_JSR(0xe1de,0x803d,0x9ac2); break;
case 0xe1ee/2: PROT_JSR(0xe1ee,0x8015,0x8c36);//8d0c not 82f6
- PROT_JSR(0xe1ee,0x802e,0xc366); break;
+ PROT_JSR(0xe1ee,0x802e,0xc366); break;
case 0xe1fe/2: PROT_JSR(0xe1fe,0x8026,0x8d0c);//8c36
- PROT_JSR(0xe1fe,0x8016,DUMMYA); break; //unused
+ PROT_JSR(0xe1fe,0x8016,DUMMYA); break; //unused
case 0xef00/2:
if(m_mainram[0xef00/2] == 0x60fe)
{
@@ -667,7 +667,7 @@ WRITE16_MEMBER(nmk16_state::hachamf_mainram_w)
}
break;
}
-#undef DUMMYA
+#undef DUMMYA
}
@@ -3809,7 +3809,7 @@ LV4 LV2 LV1 LV1
| | DMA | |
CPU is stopped during DMA
-
+
*/
// todo:total scanlines is 263, adjust according to that!
@@ -3820,37 +3820,36 @@ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline)
const int IRQ1_SCANLINE = 25; // guess
const int VBIN_SCANLINE = 0;
const int VBOUT_sCANLINE = 240;
- const int SPRDMA_SCANLINE = 241; // 256 USEC after VBOUT
+ const int SPRDMA_SCANLINE = 241; // 256 USEC after VBOUT
int scanline = param;
- if(scanline == VBOUT_sCANLINE) // vblank-out irq
- m_maincpu->set_input_line(4, HOLD_LINE);
+ if(scanline == VBOUT_sCANLINE) // vblank-out irq
+ m_maincpu->set_input_line(4, HOLD_LINE);
- if (scanline == SPRDMA_SCANLINE)
- {
- // 2 buffers confirmed on PCB
- memcpy(m_spriteram_old2,m_spriteram_old, 0x1000);
- memcpy(m_spriteram_old, m_mainram + m_sprdma_base / 2, 0x1000);
- }
+ if (scanline == SPRDMA_SCANLINE)
+ {
+ // 2 buffers confirmed on PCB
+ memcpy(m_spriteram_old2,m_spriteram_old, 0x1000);
+ memcpy(m_spriteram_old, m_mainram + m_sprdma_base / 2, 0x1000);
+ }
- /* Vblank-in irq, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous
- cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */
- if(scanline == VBIN_SCANLINE)
- m_maincpu->set_input_line(2, HOLD_LINE);
+ /* Vblank-in irq, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous
+ cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */
+ if(scanline == VBIN_SCANLINE)
+ m_maincpu->set_input_line(2, HOLD_LINE);
- /* time from IRQ2 to first IRQ1 fire. is not stated, 25 is a guess */
- if(scanline == IRQ1_SCANLINE)
- m_maincpu->set_input_line(1, HOLD_LINE);
+ /* time from IRQ2 to first IRQ1 fire. is not stated, 25 is a guess */
+ if(scanline == IRQ1_SCANLINE)
+ m_maincpu->set_input_line(1, HOLD_LINE);
- /* 8.9ms from first IRQ1 to second IRQ1 fire. approx 128 lines (half frame time) */
- if(scanline == IRQ1_SCANLINE+(NUM_SCANLINES/2)) // if this happens too late bioship sprites will glitch on the left edge
- m_maincpu->set_input_line(1, HOLD_LINE);
+ /* 8.9ms from first IRQ1 to second IRQ1 fire. approx 128 lines (half frame time) */
+ if(scanline == IRQ1_SCANLINE+(NUM_SCANLINES/2)) // if this happens too late bioship sprites will glitch on the left edge
+ m_maincpu->set_input_line(1, HOLD_LINE);
}
#define NMK_HACKY_INTERRUPT_TIMING \
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) \
-
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
#define NMK_HACKY_SCREEN_LOWRES \
MCFG_SCREEN_ADD("screen", RASTER) \
MCFG_SCREEN_REFRESH_RATE(56.18) \
@@ -3884,7 +3883,7 @@ static MACHINE_CONFIG_START( tharrier, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_tharrier)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", tharrier)
MCFG_PALETTE_ADD("palette", 512)
@@ -3918,7 +3917,7 @@ static MACHINE_CONFIG_START( mustang, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -3957,7 +3956,7 @@ static MACHINE_CONFIG_START( mustangb, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -3983,7 +3982,7 @@ static MACHINE_CONFIG_START( bioship, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_bioship)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", bioship)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4020,7 +4019,7 @@ static MACHINE_CONFIG_START( vandyke, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4060,7 +4059,7 @@ static MACHINE_CONFIG_START( vandykeb, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4085,7 +4084,7 @@ static MACHINE_CONFIG_START( acrobatm, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4125,7 +4124,7 @@ static MACHINE_CONFIG_START( tdragonb, nmk16_state ) /* bootleg using Raiden
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4147,7 +4146,7 @@ static MACHINE_CONFIG_START( tdragon, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4190,7 +4189,7 @@ static MACHINE_CONFIG_START( ssmissin, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4216,7 +4215,7 @@ static MACHINE_CONFIG_START( strahl, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_strahl)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", strahl)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
@@ -4252,7 +4251,7 @@ static MACHINE_CONFIG_START( hachamf, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4293,7 +4292,7 @@ static MACHINE_CONFIG_START( macross, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4330,7 +4329,7 @@ static MACHINE_CONFIG_START( blkheart, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4367,7 +4366,7 @@ static MACHINE_CONFIG_START( gunnail, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_HIRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_gunnail)
-
+
@@ -4410,7 +4409,7 @@ static MACHINE_CONFIG_START( macross2, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_HIRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_gunnail)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross2)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4453,7 +4452,7 @@ static MACHINE_CONFIG_START( tdragon2, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_HIRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_tdragon2)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross2)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4495,7 +4494,7 @@ static MACHINE_CONFIG_START( raphero, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_HIRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_tdragon2)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross2)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4534,7 +4533,7 @@ static MACHINE_CONFIG_START( bjtwin, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_HIRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_bjtwin)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", bjtwin)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4568,7 +4567,7 @@ static MACHINE_CONFIG_START( atombjt, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_HIRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_bjtwin)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", atombjt)
MCFG_PALETTE_ADD("palette", 1024)
@@ -4624,7 +4623,7 @@ static MACHINE_CONFIG_START( manybloc, nmk16_state )
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_manybloc)
-
+
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", tharrier)
@@ -5095,7 +5094,7 @@ static MACHINE_CONFIG_START( stagger1, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_afega)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", stagger1)
MCFG_PALETTE_ADD("palette", 768)
@@ -5177,7 +5176,7 @@ static MACHINE_CONFIG_START( firehawk, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_firehawk)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", grdnstrm)
MCFG_PALETTE_ADD("palette", 768)
@@ -5208,7 +5207,7 @@ static MACHINE_CONFIG_START( twinactn, nmk16_state )
/* video hardware */
NMK_HACKY_SCREEN_LOWRES
MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross)
-
+
MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross)
MCFG_PALETTE_ADD("palette", 1024)
@@ -6001,14 +6000,14 @@ ROM_START( strahl )
ROM_REGION( 0xa0000, "oki1", 0 ) /* Oki sample data */
ROM_LOAD( "str8pmw1.540", 0x00000, 0x20000, CRC(01d6bb6a) SHA1(b157f6f921483ed8067a7e13e370f73fdb60d136) )
- /* this is a mess */
+ /* this is a mess */
ROM_CONTINUE( 0x80000, 0x20000 ) /* banked */
ROM_CONTINUE( 0x60000, 0x20000 ) /* banked */
ROM_CONTINUE( 0x40000, 0x20000 ) /* banked */
ROM_REGION( 0xa0000, "oki2", 0 ) /* Oki sample data */
ROM_LOAD( "str9pew1.639", 0x00000, 0x20000, CRC(6bb3eb9f) SHA1(9c1394df4f8a08f9098c85eb3d38fb862d6eabbb) )
- /* this is a mess */
+ /* this is a mess */
ROM_CONTINUE( 0x80000, 0x20000 ) /* banked */
ROM_CONTINUE( 0x60000, 0x20000 ) /* banked */
ROM_CONTINUE( 0x40000, 0x20000 ) /* banked */
@@ -6038,14 +6037,14 @@ ROM_START( strahla )
ROM_REGION( 0xa0000, "oki1", 0 ) /* Oki sample data */
ROM_LOAD( "str8pmw1.540", 0x00000, 0x20000, CRC(01d6bb6a) SHA1(b157f6f921483ed8067a7e13e370f73fdb60d136) )
- /* this is a mess */
+ /* this is a mess */
ROM_CONTINUE( 0x80000, 0x20000 ) /* banked */
ROM_CONTINUE( 0x60000, 0x20000 ) /* banked */
ROM_CONTINUE( 0x40000, 0x20000 ) /* banked */
ROM_REGION( 0xa0000, "oki2", 0 ) /* Oki sample data */
ROM_LOAD( "str9pew1.639", 0x00000, 0x20000, CRC(6bb3eb9f) SHA1(9c1394df4f8a08f9098c85eb3d38fb862d6eabbb) )
- /* this is a mess */
+ /* this is a mess */
ROM_CONTINUE( 0x80000, 0x20000 ) /* banked */
ROM_CONTINUE( 0x60000, 0x20000 ) /* banked */
ROM_CONTINUE( 0x40000, 0x20000 ) /* banked */
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index 079759aab63..1cb7ad587d0 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -1325,7 +1325,7 @@ static ADDRESS_MAP_START( pengojpm_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pacman_colorram_w) AM_SHARE("colorram")
AM_RANGE(0x8800, 0x8bff) AM_RAM
-// AM_RANGE(0x8800, 0x8bff) AM_READ(pacman_read_nop) AM_WRITENOP
+// AM_RANGE(0x8800, 0x8bff) AM_READ(pacman_read_nop) AM_WRITENOP
AM_RANGE(0x8c00, 0x8fef) AM_RAM
AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x9000, 0x9000) AM_WRITE(irq_mask_w)
@@ -2935,7 +2935,7 @@ static INPUT_PORTS_START( numcrash )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
- PORT_MODIFY("DSW1")
+ PORT_MODIFY("DSW1")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
@@ -3952,7 +3952,7 @@ ROM_START( mspacmanblt )
ROM_CONTINUE(0x1800,0x800)
ROM_REGION( 0x0120, "proms", 0 )
- ROM_LOAD( "82s123.h7", 0x0000, 0x0020, CRC(3545e7e9) SHA1(b866b02579438afb11296e5c53a32c6425bd044d) )
+ ROM_LOAD( "82s123.h7", 0x0000, 0x0020, CRC(3545e7e9) SHA1(b866b02579438afb11296e5c53a32c6425bd044d) )
ROM_LOAD( "82s129-3.d1", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) )
ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */
@@ -4234,7 +4234,7 @@ ROM_START( pengopac )
ROM_LOAD( "pengopac.4", 0x4000, 0x1000, CRC(1519d59b) SHA1(13b99780fcccac61b16201500e309c9b442406c8) )
ROM_LOAD( "pengopac.5", 0x5000, 0x1000, CRC(1b90c32c) SHA1(1761add93d71d29840b1462b9747a3d463b7148d) )
ROM_LOAD( "pengopac.6", 0x6000, 0x2000, CRC(8d2994ee) SHA1(1f16b32c4574107a4a15d40113b966581b374a81) )
-
+
ROM_REGION( 0x2000, "gfx1", 0 )
ROM_LOAD( "pengopac.5e", 0x0000, 0x0800, CRC(ad88978a) SHA1(a568baf751753660223958b722980f031310eba1) )
ROM_LOAD( "pengopac.5f", 0x0800, 0x0800, CRC(cb208b9f) SHA1(63b64b52c9c3e18b2d2823e79095160fb1a71f00) )
@@ -6544,7 +6544,7 @@ DRIVER_INIT_MEMBER(pacman_state,rocktrv2)
ROM[0x7ffe] = 0xa7;
ROM[0x7fee] = 0x6d;
-
+
save_item(NAME(m_rocktrv2_question_bank));
}
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 7a547148ceb..9eb88295355 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -1226,24 +1226,24 @@ static INPUT_PORTS_START( nonplus_poker )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Card Cage") PORT_CODE(KEYCODE_M) PORT_TOGGLE
PORT_MODIFY("SW1")
- PORT_DIPNAME( 0x02, 0x02, "Credit" ) PORT_DIPLOCATION("SW1:2")
+ PORT_DIPNAME( 0x02, 0x02, "Credit" ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x02, "Coin Play" )
PORT_DIPSETTING( 0x00, "Credit Play" )
- PORT_DIPNAME( 0x04, 0x00, "Coin Acceptor" ) PORT_DIPLOCATION("SW1:3")
+ PORT_DIPNAME( 0x04, 0x00, "Coin Acceptor" ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, "Mechanical" )
PORT_DIPSETTING( 0x00, "Optical" )
- PORT_DIPNAME( 0x08, 0x08, "Double Up" ) PORT_DIPLOCATION("SW1:4")
+ PORT_DIPNAME( 0x08, 0x08, "Double Up" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, "Progressive" ) PORT_DIPLOCATION("SW1:5")
+ PORT_DIPNAME( 0x10, 0x10, "Progressive" ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x60, 0x40, "Max Hopper Pay" ) PORT_DIPLOCATION("SW1:6,7")
+ PORT_DIPNAME( 0x60, 0x40, "Max Hopper Pay" ) PORT_DIPLOCATION("SW1:6,7")
PORT_DIPSETTING( 0x60, "300 Coins" )
PORT_DIPSETTING( 0x40, "400 Coins" )
PORT_DIPSETTING( 0x20, "600 Coins" )
PORT_DIPSETTING( 0x00, "1000 Coins" )
- PORT_DIPNAME( 0x80, 0x00, "Show Pay Table" ) PORT_DIPLOCATION("SW1:8")
+ PORT_DIPNAME( 0x80, 0x00, "Show Pay Table" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
diff --git a/src/mame/drivers/potgoldu.c b/src/mame/drivers/potgoldu.c
index 71913aabc36..dddbd26057e 100644
--- a/src/mame/drivers/potgoldu.c
+++ b/src/mame/drivers/potgoldu.c
@@ -27,12 +27,12 @@ public:
potgold_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu") { }
-
+
required_device<cpu_device> m_maincpu;
-
+
virtual void machine_reset();
virtual void video_start();
-
+
TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
};
diff --git a/src/mame/drivers/punchout.c b/src/mame/drivers/punchout.c
index 6ff5759847c..ac0ec2910e2 100644
--- a/src/mame/drivers/punchout.c
+++ b/src/mame/drivers/punchout.c
@@ -234,7 +234,7 @@ WRITE8_MEMBER(punchout_state::spunchout_exp_w)
{
// d0-d3: D0-D3 to RP5C01
m_rtc->write(space, offset >> 4 & 0xf, data & 0xf);
-
+
// d0: 74LS74 1D + 74LS74 2D
// 74LS74 1Q -> RP5H01 DATA CLOCK + TEST
// 74LS74 2Q -> RP5H01 RESET
@@ -516,7 +516,7 @@ bit 3210 5432 L R C
1110 1xxx 20 20 0*
1111 xxxx "Freeplay"
-
+
0*: Not a "Freeplay": you MUST insert a coin!
*/
@@ -682,7 +682,7 @@ static MACHINE_CONFIG_DERIVED( spnchout, punchout )
MCFG_DEVICE_ADD("rtc", RP5C01, 0) // OSCIN -> Vcc
MCFG_RP5C01_REMOVE_BATTERY()
MCFG_RP5H01_ADD("rp5h01")
-
+
MCFG_MACHINE_RESET_OVERRIDE(punchout_state, spnchout)
MACHINE_CONFIG_END
@@ -743,7 +743,7 @@ ROM_START( punchout )
ROM_CONTINUE( 0x03800, 0x0800 )
ROM_REGION( 0x30000, "gfx3", ROMREGION_ERASEFF )
- ROM_LOAD( "chp1-v.2r", 0x00000, 0x4000, CRC(bd1d4b2e) SHA1(492ae301a9890c2603d564c9048b1b67895052dd) ) /* chars #3 */ /* Labeled Rev B, but same as Rev A */
+ ROM_LOAD( "chp1-v.2r", 0x00000, 0x4000, CRC(bd1d4b2e) SHA1(492ae301a9890c2603d564c9048b1b67895052dd) ) /* chars #3 */ /* Labeled Rev B, but same as Rev A */
ROM_LOAD( "chp1-v.2t", 0x04000, 0x4000, CRC(dd9a688a) SHA1(fbb98eebfbaab445928da939846a2d07a8046afb) )
ROM_LOAD( "chp1-v.2u", 0x08000, 0x2000, CRC(da6a3c4b) SHA1(e03469fb6f552f41a9b7f4b3e51c15a52b61cf84) )
/* 0a000-0bfff empty (space for 16k ROM) */
@@ -762,20 +762,20 @@ ROM_START( punchout )
/* 2c000-2ffff empty (4v doesn't exist, it is seen as a 0xff fill) */
ROM_REGION( 0x10000, "gfx4", ROMREGION_ERASEFF )
- ROM_LOAD( "chp1-v.6p", 0x00000, 0x0800, CRC(75be7aae) SHA1(396bc1d301b99e064de4dad699882618b1b9c958) ) /* chars #4 */ /* Revision B */
+ ROM_LOAD( "chp1-v.6p", 0x00000, 0x0800, CRC(75be7aae) SHA1(396bc1d301b99e064de4dad699882618b1b9c958) ) /* chars #4 */ /* Revision B */
ROM_CONTINUE( 0x01000, 0x0800 )
ROM_CONTINUE( 0x00800, 0x0800 )
ROM_CONTINUE( 0x01800, 0x0800 )
- ROM_LOAD( "chp1-v.6n", 0x02000, 0x0800, CRC(daf74de0) SHA1(9373d4527b675b3128a5a830f42e1dc5dcb85307) ) /* Revision B */
+ ROM_LOAD( "chp1-v.6n", 0x02000, 0x0800, CRC(daf74de0) SHA1(9373d4527b675b3128a5a830f42e1dc5dcb85307) ) /* Revision B */
ROM_CONTINUE( 0x03000, 0x0800 )
ROM_CONTINUE( 0x02800, 0x0800 )
ROM_CONTINUE( 0x03800, 0x0800 )
/* 04000-07fff empty (space for 6l and 6k) */
- ROM_LOAD( "chp1-v.8p", 0x08000, 0x0800, CRC(4cb7ea82) SHA1(213b7c1431f4c92e5519a8771035bda28b3bab8a) ) /* Revision B */
+ ROM_LOAD( "chp1-v.8p", 0x08000, 0x0800, CRC(4cb7ea82) SHA1(213b7c1431f4c92e5519a8771035bda28b3bab8a) ) /* Revision B */
ROM_CONTINUE( 0x09000, 0x0800 )
ROM_CONTINUE( 0x08800, 0x0800 )
ROM_CONTINUE( 0x09800, 0x0800 )
- ROM_LOAD( "chp1-v.8n", 0x0a000, 0x0800, CRC(1c0d09aa) SHA1(3276bae7400453f3612f53d7b47fb199cbe53e6d) ) /* Revision B */
+ ROM_LOAD( "chp1-v.8n", 0x0a000, 0x0800, CRC(1c0d09aa) SHA1(3276bae7400453f3612f53d7b47fb199cbe53e6d) ) /* Revision B */
ROM_CONTINUE( 0x0b000, 0x0800 )
ROM_CONTINUE( 0x0a800, 0x0800 )
ROM_CONTINUE( 0x0b800, 0x0800 )
@@ -798,7 +798,7 @@ ROM_START( punchout )
ROM_LOAD( "chp1-b-8f_white.8f", 0x1a00, 0x0200, CRC(1ffd894a) SHA1(9e8c1c28b4c12acf42f814bc109d353729a25652) ) /* B */
ROM_LOAD( "chp1-v-2d.2d", 0x2000, 0x0100, CRC(71dc0d48) SHA1(dd6609f547d74887f520d7e71a1a00317ff181d0) ) /* timing - not used */
- ROM_REGION( 0x4000, "vlm", 0 ) /* 16k for the VLM5030 data */
+ ROM_REGION( 0x4000, "vlm", 0 ) /* 16k for the VLM5030 data */
ROM_LOAD( "chp1-c.6p", 0x0000, 0x4000, CRC(ea0bbb31) SHA1(b1da024cb688341d39791a78d1144fe09acb00cf) )
ROM_END
@@ -1184,7 +1184,7 @@ ROM_START( spnchouta )
ROM_LOAD( "chs1-b-8f_white.8f", 0x1a00, 0x0200, CRC(1663eed7) SHA1(90ff876a6b885f8a80c17531cde8b91864f1a6a5) ) /* B */
ROM_LOAD( "chs1-v.2d", 0x2000, 0x0100, CRC(71dc0d48) SHA1(dd6609f547d74887f520d7e71a1a00317ff181d0) ) /* timing - not used */
- ROM_REGION( 0x4000, "vlm", 0 ) /* 16k for the VLM5030 data */
+ ROM_REGION( 0x4000, "vlm", 0 ) /* 16k for the VLM5030 data */
ROM_LOAD( "chs1-c.6p", 0x0000, 0x4000, CRC(ad8b64b8) SHA1(0f1232a10faf71b782f9f6653cca8570243c17e0) )
ROM_END
diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c
index ade5535f993..81488c0e083 100644
--- a/src/mame/drivers/r2dx_v33.c
+++ b/src/mame/drivers/r2dx_v33.c
@@ -5,41 +5,41 @@ Raiden 2 / DX V33 Version
Raiden 2 / DX checks if there's the string "RAIDEN" at start-up inside the eeprom, otherwise it dies.
Then it puts settings at 0x9e08 and 0x9e0a (bp 91acb)
- the 333 ROM is a 0x10000 byte table (bytes values?)
- followed by a 0x400 bytes (word values)?
- the remaining space is 0xff
+ the 333 ROM is a 0x10000 byte table (bytes values?)
+ followed by a 0x400 bytes (word values)?
+ the remaining space is 0xff
- Notes:
+ Notes:
- Zero Team 2000
- - EEPROM contains high scores, but they don't get restored? (original bug?)
+ Zero Team 2000
+ - EEPROM contains high scores, but they don't get restored? (original bug?)
- New Zero Team
- - 2 Player only? Service mode only shows 2 Players and I don't see a switch
- - Stages 3 and 1 are swapped, this is correct.
+ New Zero Team
+ - 2 Player only? Service mode only shows 2 Players and I don't see a switch
+ - Stages 3 and 1 are swapped, this is correct.
- Raiden 2 New / Raiden DX
- - This is a 2-in-1 board. The current game to boot is stored in the EEPROM.
- If you wish to change game then on powerup you must hold down all 4 (P1) joystick
- directions simultaneously along with either button 1 or button 2.
- Obviously this is impossible with a real joystck!
+ Raiden 2 New / Raiden DX
+ - This is a 2-in-1 board. The current game to boot is stored in the EEPROM.
+ If you wish to change game then on powerup you must hold down all 4 (P1) joystick
+ directions simultaneously along with either button 1 or button 2.
+ Obviously this is impossible with a real joystck!
- It is also impossible in MAME unless you enable -joystick_contradictory
- to disable MAME from preventing opposing joystick directions being pressed
- and you'll most likely have to remap some keys too because 5 buttons at the
- same time is beyond the limits of most keyboards.
+ It is also impossible in MAME unless you enable -joystick_contradictory
+ to disable MAME from preventing opposing joystick directions being pressed
+ and you'll most likely have to remap some keys too because 5 buttons at the
+ same time is beyond the limits of most keyboards.
- We currently use a default EEPROM for each game as this is most likely how
- it shipped, the game changing is an undocumented secret.
+ We currently use a default EEPROM for each game as this is most likely how
+ it shipped, the game changing is an undocumented secret.
- - The sound is awful, this is just how it is.
-
- - In Raiden 2 New stages 5 and 1 are swapped, and the intro is missing, this is
- correct.
+ - The sound is awful, this is just how it is.
+
+ - In Raiden 2 New stages 5 and 1 are swapped, and the intro is missing, this is
+ correct.
*/
-/* Rom structure notes
+/* Rom structure notes
Raiden 2 New/DX (hardware can bank upper/lower half of rom to switch fixed areas)
@@ -192,7 +192,7 @@ WRITE16_MEMBER(r2dx_v33_state::rdx_v33_eeprom_w)
// 0x04 is active in Raiden DX mode, it could be part of the rom bank (which half of the rom to use) or the FG tile bank (or both?)
// the bit gets set if it reads RAIDENDX from the EEPROM
m_r2dxgameselect = (data & 0x04) >> 2;
-
+
tx_bank = m_r2dxgameselect;
text_layer->mark_all_dirty();
@@ -277,7 +277,7 @@ WRITE16_MEMBER(r2dx_v33_state::mcu_table_w)
WRITE16_MEMBER(r2dx_v33_state::mcu_table2_w)
{
-// printf("mcu_table2_w %04x %04x\n", data, mem_mask);
+// printf("mcu_table2_w %04x %04x\n", data, mem_mask);
mcu_data[offset+4] = data;
@@ -356,7 +356,7 @@ WRITE16_MEMBER(r2dx_v33_state::r2dx_paldma_w)
{
int src = 0x1f000;
- for (int i = 0; i < 0x1000 / 2; i++)
+ for (int i = 0; i < 0x1000 / 2; i++)
{
UINT16 palval = space.read_word(src);
src += 2;
@@ -392,7 +392,7 @@ static ADDRESS_MAP_START( rdx_v33_map, AS_PROGRAM, 16, r2dx_v33_state )
AM_RANGE(0x00436, 0x00437) AM_READ(r2dx_cos_r)
AM_RANGE(0x00600, 0x0064f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
-// AM_RANGE(0x00650, 0x0068f) AM_RAM //???
+// AM_RANGE(0x00650, 0x0068f) AM_RAM //???
AM_RANGE(0x0068e, 0x0068f) AM_WRITENOP // maybe a watchdog?
AM_RANGE(0x006b0, 0x006b1) AM_WRITE(mcu_prog_w) // could be encryption key uploads just like raiden2.c ?
@@ -400,7 +400,7 @@ static ADDRESS_MAP_START( rdx_v33_map, AS_PROGRAM, 16, r2dx_v33_state )
// AM_RANGE(0x006b4, 0x006b5) AM_WRITENOP
// AM_RANGE(0x006b6, 0x006b7) AM_WRITENOP
AM_RANGE(0x006bc, 0x006bd) AM_WRITE(mcu_prog_offs_w)
-// AM_RANGE(0x006be, 0x006bf) AM_WRITENOP
+// AM_RANGE(0x006be, 0x006bf) AM_WRITENOP
// sprite protection not 100% verified as the same
AM_RANGE(0x006c0, 0x006c1) AM_READWRITE(sprite_prot_off_r, sprite_prot_off_w)
@@ -411,7 +411,7 @@ static ADDRESS_MAP_START( rdx_v33_map, AS_PROGRAM, 16, r2dx_v33_state )
AM_RANGE(0x006da, 0x006db) AM_WRITE(sprite_prot_y_w)
AM_RANGE(0x006dc, 0x006dd) AM_READWRITE(sprite_prot_maxx_r, sprite_prot_maxx_w)
AM_RANGE(0x006de, 0x006df) AM_WRITE(sprite_prot_src_w)
-
+
AM_RANGE(0x00700, 0x00701) AM_WRITE(rdx_v33_eeprom_w)
AM_RANGE(0x00740, 0x00741) AM_READ(r2dx_debug_r)
@@ -502,7 +502,7 @@ ADDRESS_MAP_END
WRITE16_MEMBER(r2dx_v33_state::zerotm2k_eeprom_w)
{
-// printf("zerotm2k_eeprom_w %04x %04x\n", data, mem_mask);
+// printf("zerotm2k_eeprom_w %04x %04x\n", data, mem_mask);
m_eeprom->clk_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
m_eeprom->di_write((data & 0x04) >> 2);
@@ -962,7 +962,7 @@ ROM_START( r2dx_v33 )
ROM_LOAD("prg.223", 0x000000, 0x400000, CRC(b3dbcf98) SHA1(30d6ec2090531c8c579dff74c4898889902d7d87) )
ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) /* v33 main cpu */
-
+
ROM_REGION( 0x040000, "gfx1", 0 ) /* chars */
ROM_LOAD( "fix.613", 0x000000, 0x040000, CRC(3da27e39) SHA1(3d446990bf36dd0a3f8fadb68b15bed54904c8b5) )
@@ -1011,7 +1011,7 @@ ROM_START( r2dx_v33_r2 )
ROM_END
// uses dipswitches
-ROM_START( nzeroteam ) /* V33 SYSTEM TYPE_B hardware, uses SEI333 (AKA COPX-D3) for protection */
+ROM_START( nzeroteam ) /* V33 SYSTEM TYPE_B hardware, uses SEI333 (AKA COPX-D3) for protection */
ROM_REGION( 0x100000, "mainprg", 0 ) /* v30 main cpu */
ROM_LOAD16_BYTE("prg1", 0x000000, 0x80000, CRC(3c7d9410) SHA1(25f2121b6c2be73f11263934266901ed5d64d2ee) )
ROM_LOAD16_BYTE("prg2", 0x000001, 0x80000, CRC(6cba032d) SHA1(bf5d488cd578fff09e62e3650efdee7658033e3f) )
diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c
index e7a752ed283..158bbd8b95d 100644
--- a/src/mame/drivers/raiden2.c
+++ b/src/mame/drivers/raiden2.c
@@ -134,20 +134,20 @@ Current Problem(s) - in order of priority
High Priority
- Protection
+ Protection
- zeroteam has bogus collision detection;
- raiden2 has a weird movement after that the ship completes animation from the aircraft. Probably 42c2 should be floating point rounded ...
- (and probably more)
-
+
Unemulated 0-0x3ffff ROM banking for raidendx, but it's unknown if/where it's used (hopefully NOT on getting perfect on Alpha course).
zeroteam - sort-DMA doesn't seem to work too well, sprite-sprite priorities are broken as per now
-
+
xsedae - do an "8-liner"-style scroll during attract, doesn't work too well.
-
+
sprite chip is the same as seibuspi.c and feversoc.c, needs device-ification and merging.
-
- sprite chip also uses first entry for "something" that isn't sprite, some of them looks clipping
+
+ sprite chip also uses first entry for "something" that isn't sprite, some of them looks clipping
regions (150 - ff in zeroteam, 150 - 0 and 150 - 80 in raiden2). Latter probably do double buffering
on odd/even frames, by updating only top or bottom part of screen.
@@ -180,7 +180,7 @@ void raiden2_state::machine_start()
save_item(NAME(cop_spr_maxx));
save_item(NAME(cop_spr_off));
-
+
save_item(NAME(scrollvals));
save_item(NAME(sprite_prot_src_addr));
@@ -190,12 +190,12 @@ void raiden2_state::machine_start()
/*
UINT16 raiden2_state::rps()
{
- return m_maincpu->state_int(NEC_CS);
+ return m_maincpu->state_int(NEC_CS);
}
UINT16 raiden2_state::rpc()
{
- return m_maincpu->state_int(NEC_IP);
+ return m_maincpu->state_int(NEC_IP);
}
*/
@@ -843,7 +843,7 @@ WRITE16_MEMBER(raiden2_state::sprite_prot_src_w)
dst1 += 8;
}
//printf("[%08x] %08x %08x %04x %04x\n",src,dx,dy,dst1,dst2);
- // debugger_break(machine());
+ // debugger_break(machine());
}
READ16_MEMBER(raiden2_state::sprite_prot_dst1_r)
diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c
index 7adffb5ab59..7f1910b8da5 100644
--- a/src/mame/drivers/rainbow.c
+++ b/src/mame/drivers/rainbow.c
@@ -841,7 +841,7 @@ ROM_START( jumping )
ROM_REGION( 0x200, "pals", 0 )
ROM_LOAD( "jumping-pal16r6.bin", 0x000, 0x104, CRC(12e9a7b8) SHA1(a0ce8b6083c9adfcb4bdbca87f63a01f292525f3) )
- ROM_LOAD( "jumping-pal20l8.bin", 0x000, 0x144, CRC(76944f81) SHA1(ab78e4e157ffdc13aea5dc360268b2640e60d19c) )
+ ROM_LOAD( "jumping-pal20l8.bin", 0x000, 0x144, CRC(76944f81) SHA1(ab78e4e157ffdc13aea5dc360268b2640e60d19c) )
ROM_END
ROM_START( jumpinga )
@@ -887,7 +887,7 @@ ROM_START( jumpinga )
ROM_REGION( 0x200, "pals", 0 )
ROM_LOAD( "jumping-pal16r6.bin", 0x000, 0x104, CRC(12e9a7b8) SHA1(a0ce8b6083c9adfcb4bdbca87f63a01f292525f3) )
- ROM_LOAD( "jumping-pal20l8.bin", 0x000, 0x144, CRC(76944f81) SHA1(ab78e4e157ffdc13aea5dc360268b2640e60d19c) )
+ ROM_LOAD( "jumping-pal20l8.bin", 0x000, 0x144, CRC(76944f81) SHA1(ab78e4e157ffdc13aea5dc360268b2640e60d19c) )
ROM_END
diff --git a/src/mame/drivers/rastersp.c b/src/mame/drivers/rastersp.c
index 631cce1c89a..5186b0cafaa 100644
--- a/src/mame/drivers/rastersp.c
+++ b/src/mame/drivers/rastersp.c
@@ -855,7 +855,7 @@ static MACHINE_CONFIG_START( rastersp, rastersp_state )
MCFG_CPU_ADD("dsp", TMS32031, 33330000)
MCFG_CPU_PROGRAM_MAP(dsp_map)
- MCFG_TMS3203X_MCBL(true) // Boot-loader mode
+ MCFG_TMS3203X_MCBL(true) // Boot-loader mode
/* Devices */
MCFG_TIMER_DRIVER_ADD("tms_timer1", rastersp_state, tms_timer1)
diff --git a/src/mame/drivers/redclash.c b/src/mame/drivers/redclash.c
index b34d78a3754..934dea06ee6 100644
--- a/src/mame/drivers/redclash.c
+++ b/src/mame/drivers/redclash.c
@@ -470,7 +470,7 @@ ROM_START( zerohouri )
ROM_LOAD( "zhi.c7", 0x0800, 0x0800, CRC(dcfefb4c) SHA1(9d8f57f5f09368225bae06a64971b82a848b1a7e) )
ROM_LOAD( "zhi.c6", 0x1000, 0x0800, CRC(ddc66d36) SHA1(1cbf6e27e7b2ccd39199c1a26783d53d6d90d195) )
ROM_LOAD( "zhi.c5", 0x1800, 0x0800, CRC(25c5872d) SHA1(df008db607b72a92c4284d6a8127eafec2432ca4) ) // == ze4_4.c5
-// ROM_LOAD( "zhi.c4", 0x2000, 0x0800, CRC(9b70464b) SHA1(ccd173e12630ba044fe659915dfce21f2b5e0e39) ) // corrupt
+// ROM_LOAD( "zhi.c4", 0x2000, 0x0800, CRC(9b70464b) SHA1(ccd173e12630ba044fe659915dfce21f2b5e0e39) ) // corrupt
ROM_LOAD( "zhi.c4", 0x2000, 0x0800, CRC(d7ce3add) SHA1(d8dd7ad98e7a0a4f35de181549b2e88a9e0a73d6) ) // use rom from above sets instead
ROM_LOAD( "zhi.c3", 0x2800, 0x0800, CRC(29dee5e4) SHA1(13c1778d427a11f5c24ce8116fe55d60e98e3d83) )
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 9972b5046d5..bae7910d1d9 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -432,7 +432,7 @@ WRITE8_MEMBER(segac2_state::io_portd_w)
D0 : To CN1 pin 8. (Coin meter 1)
*/
//coin_lockout_w(space.machine(), 1, data & 0x08);
- //coin_lockout_w(space.machine(), 0, data & 0x04);
+ //coin_lockout_w(space.machine(), 0, data & 0x04);
coin_counter_w(space.machine(), 1, data & 0x02);
coin_counter_w(space.machine(), 0, data & 0x01);
}
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index b172d2db87e..f6f13b0b593 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -908,7 +908,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( ddcrew3p )
PORT_INCLUDE( ddcrew2p )
-
+
PORT_MODIFY("PORTC")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index a92d195e589..9e809fe6ff7 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -2503,26 +2503,26 @@ MACHINE_CONFIG_END
requires 2 linked system32 pcbs
requires additional math DSP to be emulated
- The link PCB attaches 2 System 32 mainboards together, then ROM boards for each mainboard attaches to the link PCB.
- This provides a direct connection between the PCBs (NOT a network link) so they effectively operate as a single boardset
- sharing RAM (we should emulate it as such)
-
- Link PCB is a single sparsely populated romless PCB but contains
-
- Left side
- 1x MB8431-12LP (IC2)
- 2x HD74LS74AP (IC6, IC7)
- 2x GAL16V8A-25LP (stamped 315-5545) (IC3)
-
- Right side
- 1x MB8421-12LP (IC1)
- 1x GAL16V8A-25LP (stamped xxx-xxxx) (IC5)
- 1x HD74LS74AP (IC8)
- 1x GAL16V8A-25LP (stamped 315-5545) (IC4)
-
- (todo, full layout)
-
- The left Rom PCB (master?) contains a sub-board on the ROM board with the math DSP, the right Rom PCB does not have this.
+ The link PCB attaches 2 System 32 mainboards together, then ROM boards for each mainboard attaches to the link PCB.
+ This provides a direct connection between the PCBs (NOT a network link) so they effectively operate as a single boardset
+ sharing RAM (we should emulate it as such)
+
+ Link PCB is a single sparsely populated romless PCB but contains
+
+ Left side
+ 1x MB8431-12LP (IC2)
+ 2x HD74LS74AP (IC6, IC7)
+ 2x GAL16V8A-25LP (stamped 315-5545) (IC3)
+
+ Right side
+ 1x MB8421-12LP (IC1)
+ 1x GAL16V8A-25LP (stamped xxx-xxxx) (IC5)
+ 1x HD74LS74AP (IC8)
+ 1x GAL16V8A-25LP (stamped 315-5545) (IC4)
+
+ (todo, full layout)
+
+ The left Rom PCB (master?) contains a sub-board on the ROM board with the math DSP, the right Rom PCB does not have this.
*/
ROM_START( arescue )
diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c
index 5fc82be88e7..79547125902 100644
--- a/src/mame/drivers/segaybd.c
+++ b/src/mame/drivers/segaybd.c
@@ -809,7 +809,7 @@ static ADDRESS_MAP_START( link_portmap, AS_IO, 8, segaybd_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
-// AM_RANGE(0x40, 0x40) AM_READ_PORT("LinkDSW")
+// AM_RANGE(0x40, 0x40) AM_READ_PORT("LinkDSW")
AM_RANGE(0xc0, 0xc0) AM_READ(link_portc0_r)
ADDRESS_MAP_END
@@ -1809,7 +1809,7 @@ ROM_START( pdrift )
ROM_LOAD16_BYTE( "epr-11791.14", 0x000001, 0x20000, CRC(36b2910a) SHA1(9948b91837f944a7a606542fa685525e74bbe398) )
ROM_LOAD16_BYTE( "epr-11790.17", 0x040000, 0x20000, CRC(2a564e66) SHA1(5f30fc15bfd017d75cfffe1e9e62ed0bcf32a98e) )
ROM_LOAD16_BYTE( "epr-11792.15", 0x040001, 0x20000, CRC(c85caf6e) SHA1(2411ea99ec7f6e2b0b4f219e86ff2172539ad2c4) )
-
+
ROM_REGION64_BE( 0x400000, "ysprites", 0)
ROMX_LOAD( "epr-11757.67", 0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7) )
ROMX_LOAD( "epr-11758.75", 0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7) )
diff --git a/src/mame/drivers/simple_st0016.c b/src/mame/drivers/simple_st0016.c
index bdc12948247..7ae9c417b8a 100644
--- a/src/mame/drivers/simple_st0016.c
+++ b/src/mame/drivers/simple_st0016.c
@@ -77,7 +77,7 @@ WRITE8_MEMBER(st0016_state::mux_select_w)
WRITE8_MEMBER(st0016_state::st0016_rom_bank_w)
{
membank("bank1")->set_base(memregion("maincpu")->base() + (data* 0x4000));
-// st0016_rom_bank=data;
+// st0016_rom_bank=data;
}
static ADDRESS_MAP_START( st0016_io, AS_IO, 8, st0016_state )
@@ -472,7 +472,7 @@ static MACHINE_CONFIG_START( st0016, st0016_state )
MCFG_SCREEN_PALETTE("maincpu:palette")
-// MCFG_VIDEO_START_OVERRIDE(st0016_state,st0016)
+// MCFG_VIDEO_START_OVERRIDE(st0016_state,st0016)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c
index 154da6d3a6d..e28ef09b8ce 100644
--- a/src/mame/drivers/skimaxx.c
+++ b/src/mame/drivers/skimaxx.c
@@ -55,11 +55,11 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
required_device<tms34010_device> m_tms;
-
+
required_shared_ptr<UINT32> m_blitter_regs;
required_shared_ptr<UINT32> m_fpga_ctrl;
required_shared_ptr<UINT16> m_fg_buffer;
-
+
UINT32 *m_bg_buffer;
UINT32 *m_bg_buffer_front;
UINT32 *m_bg_buffer_back;
@@ -69,7 +69,7 @@ public:
UINT32 m_blitter_src_dx;
UINT32 m_blitter_src_y;
UINT32 m_blitter_src_dy;
-
+
DECLARE_WRITE32_MEMBER(skimaxx_blitter_w);
DECLARE_READ32_MEMBER(skimaxx_blitter_r);
DECLARE_WRITE32_MEMBER(skimaxx_fpga_ctrl_w);
@@ -79,11 +79,11 @@ public:
DECLARE_WRITE32_MEMBER(skimaxx_sub_ctrl_w);
DECLARE_READ32_MEMBER(skimaxx_analog_r);
DECLARE_WRITE_LINE_MEMBER(tms_irq);
-
+
TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
-
+
virtual void machine_reset();
virtual void video_start();
};
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index 2c37eca9f87..9f1865d4928 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -638,40 +638,40 @@ INPUT_PORTS_END
static INPUT_PORTS_START( endless )
PORT_INCLUDE(snes_common)
- PORT_START("DSW1")
- PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
- PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) )
- PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
- PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
- PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
+ PORT_START("DSW1")
+ PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
+ PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
+ PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
// PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) /* duplicate setting */
- PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
- PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
- PORT_DIPNAME( 0x38, 0x38, DEF_STR( Difficulty ) ) /* "LEVEL" */
- PORT_DIPSETTING( 0x38, "0 (Easiest)" ) /* "EASY" */
- PORT_DIPSETTING( 0x30, "1" ) /* "NORMAL" */
- PORT_DIPSETTING( 0x28, "2" ) /* "HARD" */
- PORT_DIPSETTING( 0x20, "3" ) /* undefined */
- PORT_DIPSETTING( 0x18, "4" ) /* undefined */
- PORT_DIPSETTING( 0x10, "5" ) /* undefined */
- PORT_DIPSETTING( 0x08, "6" ) /* undefined */
- PORT_DIPSETTING( 0x00, "7 (Hardest)" ) /* undefined */
- PORT_DIPNAME( 0xc0, 0xc0, "Time" ) /* "TIME" */
- PORT_DIPSETTING( 0xc0, "99" ) /* "LIMIT" */
- PORT_DIPSETTING( 0x80, "60" ) /* undefined */
- PORT_DIPSETTING( 0x40, "30" ) /* undefined */
- PORT_DIPSETTING( 0x00, "Infinite" ) /* "NO LIMIT" */
-
- PORT_START("DSW2")
- PORT_DIPUNUSED( 0x01, IP_ACTIVE_LOW )
- PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW )
- PORT_DIPUNUSED( 0x04, IP_ACTIVE_LOW )
- PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
- PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
- PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )
- PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
- PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
+ PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
+ PORT_DIPNAME( 0x38, 0x38, DEF_STR( Difficulty ) ) /* "LEVEL" */
+ PORT_DIPSETTING( 0x38, "0 (Easiest)" ) /* "EASY" */
+ PORT_DIPSETTING( 0x30, "1" ) /* "NORMAL" */
+ PORT_DIPSETTING( 0x28, "2" ) /* "HARD" */
+ PORT_DIPSETTING( 0x20, "3" ) /* undefined */
+ PORT_DIPSETTING( 0x18, "4" ) /* undefined */
+ PORT_DIPSETTING( 0x10, "5" ) /* undefined */
+ PORT_DIPSETTING( 0x08, "6" ) /* undefined */
+ PORT_DIPSETTING( 0x00, "7 (Hardest)" ) /* undefined */
+ PORT_DIPNAME( 0xc0, 0xc0, "Time" ) /* "TIME" */
+ PORT_DIPSETTING( 0xc0, "99" ) /* "LIMIT" */
+ PORT_DIPSETTING( 0x80, "60" ) /* undefined */
+ PORT_DIPSETTING( 0x40, "30" ) /* undefined */
+ PORT_DIPSETTING( 0x00, "Infinite" ) /* "NO LIMIT" */
+
+ PORT_START("DSW2")
+ PORT_DIPUNUSED( 0x01, IP_ACTIVE_LOW )
+ PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW )
+ PORT_DIPUNUSED( 0x04, IP_ACTIVE_LOW )
+ PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
+ PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
+ PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )
+ PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
+ PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
diff --git a/src/mame/drivers/snk6502.c b/src/mame/drivers/snk6502.c
index 1554cd4835b..8b8f2690c34 100644
--- a/src/mame/drivers/snk6502.c
+++ b/src/mame/drivers/snk6502.c
@@ -827,7 +827,7 @@ static MACHINE_CONFIG_START( sasuke, snk6502_state )
MCFG_SOUND_ADD("snk6502", SNK6502, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
+
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(4)
MCFG_SAMPLES_NAMES(sasuke_sample_names)
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index b314bc1e4d3..e31fd431839 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -2368,7 +2368,7 @@ ROM_START( suhosong )
ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP ) /* can't be dumped */
ROM_REGION16_BE( 0x200, "user1", ROMREGION_ERASE00 ) /* Data from Shared RAM */
-// ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200 , CRC(1) SHA1(1) )
+// ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200 , CRC(1) SHA1(1) )
ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
ROM_LOAD( "su_ho_sung.uj15", 0x00000, 0x40000, CRC(266fcae8) SHA1(0f15f880bde0c12b5c663ed387f9353c13b731b6) )
diff --git a/src/mame/drivers/speedbal.c b/src/mame/drivers/speedbal.c
index 6c9917b7591..a9bcf3627ec 100644
--- a/src/mame/drivers/speedbal.c
+++ b/src/mame/drivers/speedbal.c
@@ -351,24 +351,24 @@ ROM_END
DRIVER_INIT_MEMBER(speedbal_state,musicbal)
{
UINT8* rom = memregion("maincpu")->base();
-
- const UINT8 xorTable[8] = {0x05, 0x06, 0x84, 0x84, 0x00, 0x87, 0x84, 0x84}; // XORs affecting bits #0, #1, #2 & #7
- const int swapTable[4][4] = { // 4 possible swaps affecting bits #0, #1, #2 & #7
- {1,0,7,2},
- {2,7,0,1},
- {7,2,1,0},
- {0,2,1,7}
- };
-
+
+ const UINT8 xorTable[8] = {0x05, 0x06, 0x84, 0x84, 0x00, 0x87, 0x84, 0x84}; // XORs affecting bits #0, #1, #2 & #7
+ const int swapTable[4][4] = { // 4 possible swaps affecting bits #0, #1, #2 & #7
+ {1,0,7,2},
+ {2,7,0,1},
+ {7,2,1,0},
+ {0,2,1,7}
+ };
+
for (int i=0;i<0x8000;i++)
{
- int addIdx = BIT(i,3)^(BIT(i,5)<<1)^(BIT(i,9)<<2); // 3 bits of address...
- int xorMask = xorTable[addIdx]; // ... control the xor...
- int bswIdx = xorMask & 3; // ... and the bitswap
+ int addIdx = BIT(i,3)^(BIT(i,5)<<1)^(BIT(i,9)<<2); // 3 bits of address...
+ int xorMask = xorTable[addIdx]; // ... control the xor...
+ int bswIdx = xorMask & 3; // ... and the bitswap
- // only bits #0, #1, #2 & #7 are affected
- rom[i] = BITSWAP8(rom[i], swapTable[bswIdx][3], 6,5,4,3, swapTable[bswIdx][2], swapTable[bswIdx][1], swapTable[bswIdx][0]) ^ xorTable[addIdx];
- }
+ // only bits #0, #1, #2 & #7 are affected
+ rom[i] = BITSWAP8(rom[i], swapTable[bswIdx][3], 6,5,4,3, swapTable[bswIdx][2], swapTable[bswIdx][1], swapTable[bswIdx][0]) ^ xorTable[addIdx];
+ }
DRIVER_INIT_CALL(speedbal);
}
diff --git a/src/mame/drivers/speglsht.c b/src/mame/drivers/speglsht.c
index 7c9ce6ffffc..9def961a959 100644
--- a/src/mame/drivers/speglsht.c
+++ b/src/mame/drivers/speglsht.c
@@ -344,7 +344,7 @@ MACHINE_RESET_MEMBER(speglsht_state,speglsht)
VIDEO_START_MEMBER(speglsht_state,speglsht)
{
m_bitmap = auto_bitmap_ind16_alloc(machine(), 512, 5122 );
-// VIDEO_START_CALL_MEMBER(st0016);
+// VIDEO_START_CALL_MEMBER(st0016);
}
#define PLOT_PIXEL_RGB(x,y,r,g,b) if(y>=0 && x>=0 && x<512 && y<512) \
diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c
index afae1095d13..335953d9572 100644
--- a/src/mame/drivers/splash.c
+++ b/src/mame/drivers/splash.c
@@ -1023,7 +1023,7 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
int ofst = offset+(0x100000/2);
-// logerror ("PROTR: %5.5x, pc: %5.5x\n", ofst*2, pc);
+// logerror ("PROTR: %5.5x, pc: %5.5x\n", ofst*2, pc);
// don't interfere with ram check.
if (pc == 0x04770) return 0x00;
@@ -1071,8 +1071,8 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
//-----------------------------------------------------------------
// sub $7F70, $8038, $116E2, no subtractions, straight compare!, original value from 68k
- // increase ff3cc8 value in sub $116e2
-
+ // increase ff3cc8 value in sub $116e2
+
case ((0x100001 / 2) + 0x0010): // $7F72
funystrp_val = funystrp_ff3cc8_val;
return 0;
@@ -1102,8 +1102,8 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
return (funystrp_val + 0x12) & 0xff;
// first case... weird?
- // case ((0x104801 / 2) + 0x013A): // $857E
- // return (funystrp_val + 0x00) & 0xff;
+ // case ((0x104801 / 2) + 0x013A): // $857E
+ // return (funystrp_val + 0x00) & 0xff;
case ((0x104801 / 2) + 0x0277): // $85A4
return (funystrp_val + 0x04) & 0xff;
@@ -1136,7 +1136,7 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
//-----------------------------------------------------------------
// sub $9DD2, subtractions, original value from protection device
-
+
case ((0x170001 / 2) + 0x006B): // $9DD4
funystrp_val = 0;
return 0;
@@ -1176,19 +1176,19 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
//-----------------------------------------------------------------
// sub $C5E4, subtractions, original value from 68k
- // these cases are already in sub $7ACC, last one is new!!
- // case ((0x107001 / 2) + 0x0030): // $7ACE
- // funystrp_val = funystrp_ff3cc7_val & 0x7f;
- // return 0;
+ // these cases are already in sub $7ACC, last one is new!!
+ // case ((0x107001 / 2) + 0x0030): // $7ACE
+ // funystrp_val = funystrp_ff3cc7_val & 0x7f;
+ // return 0;
- // case ((0x107001 / 2) + 0x013e): // $7AFC
- // return (funystrp_val + 0x13) & 0xff;
+ // case ((0x107001 / 2) + 0x013e): // $7AFC
+ // return (funystrp_val + 0x13) & 0xff;
- // case ((0x107001 / 2) + 0x0279): // $7B38
- // return (funystrp_val + 0x22) & 0xff;
+ // case ((0x107001 / 2) + 0x0279): // $7B38
+ // return (funystrp_val + 0x22) & 0xff;
- // case ((0x107001 / 2) + 0x0357): // $7B6E
- // return (funystrp_val + 0x44) & 0xff;
+ // case ((0x107001 / 2) + 0x0357): // $7B6E
+ // return (funystrp_val + 0x44) & 0xff;
case ((0x107001 / 2) + 0x0381): // $7BA4
return (funystrp_val + 0x6a) & 0xff;
@@ -1215,7 +1215,7 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
//-----------------------------------------------------------------
// sub $F72C, subtractions, original value from protection device,
// routine verified working!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
+
case ((0x100001 / 2) + 0x0017): // $F72E
funystrp_val = 0;
return 0;
@@ -1233,8 +1233,8 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
return (funystrp_val + 0x70) & 0xff;
//-----------------------------------------------------------------
- // sub $F82E, subtractions, original value from protection device,
-
+ // sub $F82E, subtractions, original value from protection device,
+
case ((0x100001 / 2) + 0x0013): // $F830
funystrp_val = 0;
return 0;
@@ -1242,21 +1242,21 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
case ((0x100001 / 2) + 0x0125): // $F84E
return (funystrp_val + 0x17) & 0xff;
- // used in sub $7E76
- // case ((0x110001 / 2) + 0x0261): // $F88A
- // return (funystrp_val + 0x0f) & 0xff;
+ // used in sub $7E76
+ // case ((0x110001 / 2) + 0x0261): // $F88A
+ // return (funystrp_val + 0x0f) & 0xff;
- // case ((0x110001 / 2) + 0x0322): // $F8C0
- // return (funystrp_val + 0x12) & 0xff;
+ // case ((0x110001 / 2) + 0x0322): // $F8C0
+ // return (funystrp_val + 0x12) & 0xff;
- // case ((0x110001 / 2) + 0x039B): // $F8F6
- // return (funystrp_val + 0x70) & 0xff;
+ // case ((0x110001 / 2) + 0x039B): // $F8F6
+ // return (funystrp_val + 0x70) & 0xff;
//-----------------------------------------------------------------
// sub $10FE2, subtractions, original value from protection device
// routine is different from rest, unoptimized or just poorly coded?
// examine later to verify this is right
-
+
case ((0x105001 / 2) + 0x0021): // $10FF6
funystrp_val = 0;
return 0;
@@ -1274,10 +1274,10 @@ READ16_MEMBER(splash_state::funystrp_protection_r)
return (funystrp_val + 0x03) & 0xff;
//-----------------------------------------------------------------
- // sub $11F2C, subtractions, original value from protection device,
+ // sub $11F2C, subtractions, original value from protection device,
// routine is different from rest, unoptimized or just poorly coded?
// examine later to verify this is right
-
+
case ((0x183001 / 2) + 0x0088): // $11F3C
funystrp_val = 0;
return 0;
@@ -1302,9 +1302,9 @@ WRITE16_MEMBER(splash_state::funystrp_protection_w)
{
int ofst = (0x100000/2)+offset;
-// logerror ("PROTW: %5.5x, %4.4x, PC: %5.5x m: %4.4x\n", ofst*2, data, space.device().safe_pc(), mem_mask);
+// logerror ("PROTW: %5.5x, %4.4x, PC: %5.5x m: %4.4x\n", ofst*2, data, space.device().safe_pc(), mem_mask);
-// if (ACCESSING_BITS_0_7) // ??
+// if (ACCESSING_BITS_0_7) // ??
{
switch (ofst)
{
@@ -1320,7 +1320,7 @@ WRITE16_MEMBER(splash_state::funystrp_protection_w)
case (0x1007e5/2):
funystrp_ff3cc8_val = data;
return;
-
+
case (0x1007e7/2):
funystrp_ff3cc7_val = data;
return;
diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c
index 1544844ae14..0f7aaee80cb 100644
--- a/src/mame/drivers/srmp5.c
+++ b/src/mame/drivers/srmp5.c
@@ -66,11 +66,11 @@ class srmp5_state : public driver_device
public:
srmp5_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
m_maincpu(*this,"maincpu"),
- m_subcpu(*this, "sub")
-
+ m_subcpu(*this, "sub")
+
{ }
UINT32 m_databank;
diff --git a/src/mame/drivers/st_mp100.c b/src/mame/drivers/st_mp100.c
index 9efd349844f..6afe6b79f8a 100644
--- a/src/mame/drivers/st_mp100.c
+++ b/src/mame/drivers/st_mp100.c
@@ -500,7 +500,7 @@ WRITE_LINE_MEMBER( st_mp100_state::u10_ca2_w )
if (!state)
m_counter = 0;
}
-
+
WRITE_LINE_MEMBER( st_mp100_state::u10_cb2_w )
{
}
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 21acc015915..a3dcc5c7f61 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -1251,18 +1251,18 @@ int stv_state::load_cart(device_image_interface &image, generic_slot_device *slo
{
UINT8 *ROM;
UINT32 size = slot->common_get_size("rom");
-
+
if (image.software_entry() == NULL)
return IMAGE_INIT_FAIL;
-
+
slot->rom_alloc(size, GENERIC_ROM32_WIDTH, ENDIANNESS_BIG);
ROM = slot->get_rom_base();
memcpy(ROM, image.get_software_region("rom"), size);
-
+
/* fix endianess */
{
UINT8 j[4];
-
+
for (int i = 0; i < size; i += 4)
{
j[0] = ROM[i + 0];
@@ -1275,7 +1275,7 @@ int stv_state::load_cart(device_image_interface &image, generic_slot_device *slo
ROM[i + 3] = j[0];
}
}
-
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index 1b45e2a8240..2be193390b4 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -1115,7 +1115,7 @@ static ADDRESS_MAP_START( shdancbla_map, AS_PROGRAM, 16, segas1x_bootleg_state )
AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
- // moved from C4xxxx to E4xxxx
+ // moved from C4xxxx to E4xxxx
AM_RANGE(0xe40000, 0xe40001) AM_READ_PORT("COINAGE")
AM_RANGE(0xe40002, 0xe40003) AM_READ_PORT("DSW1")
AM_RANGE(0xe40006, 0xe40007) AM_WRITE(sound_command_irq_w)
@@ -2521,7 +2521,7 @@ ROM_START( wb3bble ) /* Appears to be a pre-system 16 bootleg with encryption
ROM_LOAD16_BYTE( "epr12097.b8", 0x60000, 0x010000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) ) // 16- ic103
ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
- ROM_LOAD( "a-1 ic68", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) )
+ ROM_LOAD( "a-1 ic68", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) )
ROM_REGION( 0x1000, "mcu", 0 ) /* MCU code */
ROM_LOAD( "d8749h.mcu", 0x0000, 0x1000, NO_DUMP )
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index b76f5d46015..41d76921aba 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -3043,7 +3043,7 @@ static MACHINE_CONFIG_START( contcirc, taitoz_state )
MCFG_TC0100SCN_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
MCFG_TC0110PCR_ADD("tc0110pcr")
MCFG_TC0110PCR_PALETTE("palette")
@@ -3121,7 +3121,7 @@ static MACHINE_CONFIG_START( chasehq, taitoz_state )
MCFG_TC0100SCN_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
MCFG_TC0110PCR_ADD("tc0110pcr")
MCFG_TC0110PCR_PALETTE("palette")
@@ -3201,7 +3201,7 @@ static MACHINE_CONFIG_START( enforce, taitoz_state )
MCFG_TC0100SCN_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
MCFG_TC0110PCR_ADD("tc0110pcr")
MCFG_TC0110PCR_PALETTE("palette")
@@ -3277,7 +3277,7 @@ static MACHINE_CONFIG_START( bshark, taitoz_state )
MCFG_TC0100SCN_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -3358,7 +3358,7 @@ static MACHINE_CONFIG_START( sci, taitoz_state )
MCFG_TC0100SCN_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -3434,7 +3434,7 @@ static MACHINE_CONFIG_START( nightstr, taitoz_state )
MCFG_TC0100SCN_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
MCFG_TC0110PCR_ADD("tc0110pcr")
MCFG_TC0110PCR_PALETTE("palette")
@@ -3514,7 +3514,7 @@ static MACHINE_CONFIG_START( aquajack, taitoz_state )
MCFG_TC0100SCN_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
MCFG_TC0110PCR_ADD("tc0110pcr")
MCFG_TC0110PCR_PALETTE("palette")
@@ -3664,7 +3664,7 @@ static MACHINE_CONFIG_START( dblaxle, taitoz_state )
MCFG_TC0480SCP_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -3740,7 +3740,7 @@ static MACHINE_CONFIG_START( racingb, taitoz_state )
MCFG_TC0480SCP_PALETTE("palette")
MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
-
+
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c
index ce949dafd61..09627983132 100644
--- a/src/mame/drivers/tatsumi.c
+++ b/src/mame/drivers/tatsumi.c
@@ -1397,7 +1397,7 @@ DRIVER_INIT_MEMBER(tatsumi_state,cyclwarr)
int len1 = memregion("gfx2")->bytes();
UINT8 *src2 = memregion("gfx3")->base();
int len2 = memregion("gfx3")->bytes();
-
+
for (int i=0; i<len1; i+=32)
{
memcpy(dst,src1,32);
diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c
index 788a12afe0d..c34506ac1cb 100644
--- a/src/mame/drivers/tickee.c
+++ b/src/mame/drivers/tickee.c
@@ -53,17 +53,17 @@ public:
optional_device<okim6295_device> m_oki;
required_device<screen_device> m_screen;
required_device<tlc34076_device> m_tlc34076;
-
+
required_shared_ptr<UINT16> m_vram;
optional_shared_ptr<UINT16> m_control;
-
+
emu_timer *m_setup_gun_timer;
int m_beamxadd;
int m_beamyadd;
int m_palette_bank;
UINT8 m_gunx[2];
void get_crosshair_xy(int player, int &x, int &y);
-
+
DECLARE_WRITE16_MEMBER(rapidfir_transparent_w);
DECLARE_READ16_MEMBER(rapidfir_transparent_r);
DECLARE_WRITE16_MEMBER(tickee_control_w);
@@ -80,7 +80,7 @@ public:
TIMER_CALLBACK_MEMBER(trigger_gun_interrupt);
TIMER_CALLBACK_MEMBER(clear_gun_interrupt);
TIMER_CALLBACK_MEMBER(setup_gun_interrupts);
-
+
TMS340X0_TO_SHIFTREG_CB_MEMBER(rapidfir_to_shiftreg);
TMS340X0_FROM_SHIFTREG_CB_MEMBER(rapidfir_from_shiftreg);
TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
@@ -746,7 +746,7 @@ static MACHINE_CONFIG_START( tickee, tickee_state )
MCFG_CPU_PROGRAM_MAP(tickee_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_RGB32_CB(tickee_state, scanline_update) /* scanline callback (rgb32) */
MCFG_MACHINE_RESET_OVERRIDE(tickee_state,tickee)
@@ -791,10 +791,10 @@ static MACHINE_CONFIG_START( rapidfir, tickee_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", TMS34010, XTAL_50MHz)
- MCFG_CPU_PROGRAM_MAP(rapidfir_map)
+ MCFG_CPU_PROGRAM_MAP(rapidfir_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_RGB32_CB(tickee_state, rapidfir_scanline_update) /* scanline callback (rgb32) */
MCFG_TMS340X0_TO_SHIFTREG_CB(tickee_state, rapidfir_to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(tickee_state, rapidfir_from_shiftreg) /* read from shiftreg function */
@@ -826,7 +826,7 @@ static MACHINE_CONFIG_START( mouseatk, tickee_state )
MCFG_CPU_PROGRAM_MAP(mouseatk_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(VIDEO_CLOCK/2) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_RGB32_CB(tickee_state, scanline_update) /* scanline callback (rgb32) */
MCFG_MACHINE_RESET_OVERRIDE(tickee_state,tickee)
diff --git a/src/mame/drivers/travrusa.c b/src/mame/drivers/travrusa.c
index 2d2fb726cdf..2e31a567b9e 100644
--- a/src/mame/drivers/travrusa.c
+++ b/src/mame/drivers/travrusa.c
@@ -617,4 +617,3 @@ GAME( 1983, motorace, travrusa, travrusa, motorace, travrusa_state, motorace, RO
GAME( 1985, shtrider, 0, shtrider, shtrider, driver_device, 0, ROT270|ORIENTATION_FLIP_X, "Seibu Kaihatsu", "Shot Rider", GAME_SUPPORTS_SAVE ) // possible bootleg
GAME( 1984, shtridera,shtrider, shtrider, shtrider, travrusa_state, shtridra, ROT270|ORIENTATION_FLIP_X, "Seibu Kaihatsu (Sigma license)", "Shot Rider (Sigma license)", GAME_SUPPORTS_SAVE )
GAME( 1985, shtriderb,shtrider, shtriderb,shtrider, travrusa_state, shtridrb, ROT270|ORIENTATION_FLIP_X, "bootleg", "Shot Rider (bootleg)", GAME_SUPPORTS_SAVE ) // resets when you attempt to start a game?
-
diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c
index c08960d0e5c..a0f7baaad5c 100644
--- a/src/mame/drivers/twinkle.c
+++ b/src/mame/drivers/twinkle.c
@@ -6,7 +6,7 @@ driver by smf and R. Belmont
TODO:
-dvd check for bmiidx, bmiidxa, bmiidxc & bmiidxca
+dvd check for bmiidx, bmiidxa, bmiidxc & bmiidxca
finish sound board emulation and remove response hle
emulate dvd player and video mixing
16seg led font
@@ -1038,7 +1038,7 @@ static MACHINE_CONFIG_START( twinkle, twinkle_state )
MCFG_DEVICE_ADD("rs232", RS232_PORT, 0)
MCFG_SLOT_OPTION_ADD("xvd701", JVC_XVD701)
-// MCFG_SLOT_OPTION_ADD("xvs1100", JVC_XVS1100) // 8th mix only
+// MCFG_SLOT_OPTION_ADD("xvs1100", JVC_XVS1100) // 8th mix only
MCFG_SLOT_DEFAULT_OPTION("xvd701")
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("fdc37c665gt:uart2", ins8250_uart_device, rx_w))
MCFG_RS232_DCD_HANDLER(DEVWRITELINE("fdc37c665gt:uart2", ins8250_uart_device, dcd_w))
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index f252e2453b1..99b79a84e60 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -383,12 +383,12 @@ READ32_MEMBER(vamphalf_state::yorizori_10_r)
}
READ32_MEMBER(vamphalf_state::yorizori_1c_r)
{
-// printf("yorizori_1c_r %08x\n", space.device().safe_pc());
+// printf("yorizori_1c_r %08x\n", space.device().safe_pc());
return 0x00;// 0xaa;
}
WRITE32_MEMBER(vamphalf_state::yorizori_1c_w)
{
-// printf("yorizori_1c_w %08x %08x\n", space.device().safe_pc(), data);
+// printf("yorizori_1c_w %08x %08x\n", space.device().safe_pc(), data);
}
WRITE32_MEMBER( vamphalf_state::wyvernwg_snd_w )
@@ -2078,7 +2078,7 @@ ROMs:
ROM_START( yorizori )
ROM_REGION32_BE( 0x200000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
ROM_LOAD( "prg1", 0x000000, 0x200000, CRC(0e04eb40) SHA1(0cec9dc91aaf9cf7c459c7baac200cf0fcfddc18) )
-
+
ROM_REGION( 0x080000, "qs1000:cpu", 0 ) /* QDSP (8052) Code */
ROM_LOAD( "snd5", 0x00000, 0x20000, CRC(79067367) SHA1(a8f0c02dd616ff8c5fb49dea1a116fea2aced19c) )
ROM_RELOAD( 0x20000, 0x20000 )
diff --git a/src/mame/drivers/vectrex.c b/src/mame/drivers/vectrex.c
index 647cb9493d4..98accf09b4c 100644
--- a/src/mame/drivers/vectrex.c
+++ b/src/mame/drivers/vectrex.c
@@ -19,7 +19,7 @@ Bruce Tomlin (hardware info)
static ADDRESS_MAP_START(vectrex_map, AS_PROGRAM, 8, vectrex_state )
- AM_RANGE(0x0000, 0x7fff) AM_NOP // cart area, handled at machine_start
+ AM_RANGE(0x0000, 0x7fff) AM_NOP // cart area, handled at machine_start
AM_RANGE(0xc800, 0xcbff) AM_RAM AM_MIRROR(0x0400) AM_SHARE("gce_vectorram")
AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(vectrex_via_r, vectrex_via_w)
AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("maincpu", 0)
diff --git a/src/mame/drivers/warpsped.c b/src/mame/drivers/warpsped.c
index 920f01198b7..c6f0a65415a 100644
--- a/src/mame/drivers/warpsped.c
+++ b/src/mame/drivers/warpsped.c
@@ -98,10 +98,10 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
-
+
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_workram;
-
+
tilemap_t *m_text_tilemap;
tilemap_t *m_starfield_tilemap;
UINT8 m_regs[0x28];
diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c
index 4c414f03b17..2e45270dca1 100644
--- a/src/mame/drivers/xtheball.c
+++ b/src/mame/drivers/xtheball.c
@@ -327,7 +327,7 @@ static MACHINE_CONFIG_START( xtheball, xtheball_state )
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TMS340X0_HALT_ON_RESET(FALSE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(10000000) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(1) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_RGB32_CB(xtheball_state, scanline_update) /* scanline updater (rgb32) */
MCFG_TMS340X0_TO_SHIFTREG_CB(xtheball_state, to_shiftreg) /* write to shiftreg function */
MCFG_TMS340X0_FROM_SHIFTREG_CB(xtheball_state, from_shiftreg) /* read from shiftreg function */
diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h
index f9db7e9f5fb..265df8deda4 100644
--- a/src/mame/includes/8080bw.h
+++ b/src/mame/includes/8080bw.h
@@ -52,7 +52,7 @@ public:
UINT8 m_schaser_background_disable;
UINT8 m_schaser_background_select;
UINT16 m_claybust_gun_pos;
-
+
int m_invmulti_bank;
diff --git a/src/mame/includes/artmagic.h b/src/mame/includes/artmagic.h
index 095e7a9935a..55167eba105 100644
--- a/src/mame/includes/artmagic.h
+++ b/src/mame/includes/artmagic.h
@@ -30,11 +30,11 @@ public:
required_device<okim6295_device> m_oki;
required_device<tms34010_device> m_tms;
required_device<tlc34076_device> m_tlc34076;
-
+
required_shared_ptr<UINT16> m_control;
required_shared_ptr<UINT16> m_vram0;
required_shared_ptr<UINT16> m_vram1;
-
+
UINT8 m_tms_irq;
UINT8 m_hack_irq;
UINT8 m_prot_input[16];
@@ -49,7 +49,7 @@ public:
void ultennis_protection();
void cheesech_protection();
void stonebal_protection();
-
+
int m_xor[16];
int m_is_stoneball;
UINT16 *m_blitter_base;
@@ -80,7 +80,7 @@ public:
void execute_blit();
void update_irq_state();
inline UINT16 *address_to_vram(offs_t *address);
-
+
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
};
diff --git a/src/mame/includes/bfm_sc45.h b/src/mame/includes/bfm_sc45.h
index 8abf66a4e1c..c1b4020db6d 100644
--- a/src/mame/includes/bfm_sc45.h
+++ b/src/mame/includes/bfm_sc45.h
@@ -585,7 +585,7 @@ public:
void bfm_sc4_68307_portb_w(address_space &space, bool dedicated, UINT16 data, UINT16 line_mask);
UINT8 bfm_sc4_68307_porta_r(address_space &space, bool dedicated, UINT8 line_mask);
UINT16 bfm_sc4_68307_portb_r(address_space &space, bool dedicated, UINT16 line_mask);
-
+
void find_mbus(UINT16* rom);
diff --git a/src/mame/includes/cinemat.h b/src/mame/includes/cinemat.h
index 14a202bc6cf..57549e8703c 100644
--- a/src/mame/includes/cinemat.h
+++ b/src/mame/includes/cinemat.h
@@ -30,9 +30,9 @@ public:
optional_shared_ptr<UINT16> m_rambase;
typedef void (cinemat_state::*sound_func)(UINT8 sound_val, UINT8 bits_changed);
-
+
sound_func m_sound_handler;
- UINT8 m_sound_control;
+ UINT8 m_sound_control;
UINT32 m_current_shift;
UINT32 m_last_shift;
UINT32 m_last_shift2;
diff --git a/src/mame/includes/coolpool.h b/src/mame/includes/coolpool.h
index 804abfd6190..6730f624cba 100644
--- a/src/mame/includes/coolpool.h
+++ b/src/mame/includes/coolpool.h
@@ -19,7 +19,7 @@ public:
required_device<cpu_device> m_dsp;
required_device<dac_device> m_dac;
optional_device<tlc34076_device> m_tlc34076;
-
+
required_shared_ptr<UINT16> m_vram_base;
required_shared_ptr<UINT16> m_nvram;
@@ -37,7 +37,7 @@ public:
UINT16 m_result;
UINT16 m_lastresult;
-
+
UINT16 m_nvram_write_seq[NVRAM_UNLOCK_SEQ_LEN];
UINT8 m_nvram_write_enable;
UINT8 m_old_cmd;
diff --git a/src/mame/includes/cosmic.h b/src/mame/includes/cosmic.h
index b151e00490d..6a69d0f92f8 100644
--- a/src/mame/includes/cosmic.h
+++ b/src/mame/includes/cosmic.h
@@ -31,7 +31,7 @@ public:
/* video-related */
typedef pen_t (cosmic_state::*color_func)(UINT8 x, UINT8 y);
- color_func m_map_color;
+ color_func m_map_color;
int m_color_registers[3];
int m_background_enable;
int m_magspot_pen_mask;
@@ -54,7 +54,7 @@ public:
optional_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
-
+
DECLARE_WRITE8_MEMBER(panic_sound_output_w);
DECLARE_WRITE8_MEMBER(panic_sound_output2_w);
DECLARE_WRITE8_MEMBER(cosmicg_output_w);
diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h
index d65b25003ce..692d740e7fd 100644
--- a/src/mame/includes/exterm.h
+++ b/src/mame/includes/exterm.h
@@ -24,10 +24,10 @@ public:
required_device<cpu_device> m_audioslave;
required_device<tms34010_device> m_slave;
required_device<dac_device> m_dac;
-
+
required_shared_ptr<UINT16> m_master_videoram;
required_shared_ptr<UINT16> m_slave_videoram;
-
+
UINT8 m_aimpos[2];
UINT8 m_trackball_old[2];
UINT8 m_master_sound_latch;
diff --git a/src/mame/includes/fuukifg2.h b/src/mame/includes/fuukifg2.h
index c80dd4d5258..866e761dd32 100644
--- a/src/mame/includes/fuukifg2.h
+++ b/src/mame/includes/fuukifg2.h
@@ -23,7 +23,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_fuukivid(*this, "fuukivid")
+ m_fuukivid(*this, "fuukivid")
{ }
/* memory pointers */
diff --git a/src/mame/includes/fuukifg3.h b/src/mame/includes/fuukifg3.h
index 591ce2286a5..46dad3d0373 100644
--- a/src/mame/includes/fuukifg3.h
+++ b/src/mame/includes/fuukifg3.h
@@ -30,7 +30,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_fuukivid(*this, "fuukivid")
+ m_fuukivid(*this, "fuukivid")
{ }
/* memory pointers */
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index bbbd6d6aadf..7025820e41b 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -331,7 +331,7 @@ public:
DECLARE_WRITE16_MEMBER( hdgsp_io_w );
DECLARE_WRITE16_MEMBER( hdgsp_protection_w );
-
+
DECLARE_WRITE_LINE_MEMBER( hdgsp_irq_gen );
DECLARE_WRITE_LINE_MEMBER( hdmsp_irq_gen );
@@ -385,7 +385,7 @@ public:
void hdds3sdsp_reset_timer();
void hdds3xdsp_reset_timer();
-
+
TIMER_CALLBACK_MEMBER( xsdp_sport1_irq_off_callback );
/* DSK board */
@@ -441,9 +441,9 @@ public:
/*----------- defined in video/harddriv.c -----------*/
TMS340X0_TO_SHIFTREG_CB_MEMBER(hdgsp_write_to_shiftreg);
TMS340X0_FROM_SHIFTREG_CB_MEMBER(hdgsp_read_from_shiftreg);
-
+
void update_palette_bank(int newbank);
-
+
DECLARE_READ16_MEMBER( hdgsp_control_lo_r );
DECLARE_WRITE16_MEMBER( hdgsp_control_lo_w );
DECLARE_READ16_MEMBER( hdgsp_control_hi_r );
@@ -454,7 +454,7 @@ public:
DECLARE_WRITE16_MEMBER( hdgsp_vram_2bpp_w );
inline void gsp_palette_change(int offset);
-
+
DECLARE_READ16_MEMBER( hdgsp_paletteram_lo_r );
DECLARE_WRITE16_MEMBER( hdgsp_paletteram_lo_w );
DECLARE_READ16_MEMBER( hdgsp_paletteram_hi_r );
@@ -466,7 +466,7 @@ public:
/* DS III/IV board */
TIMER_DEVICE_CALLBACK_MEMBER( ds3sdsp_internal_timer_callback );
TIMER_DEVICE_CALLBACK_MEMBER( ds3xdsp_internal_timer_callback );
-
+
TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_driver);
TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_multisync);
};
diff --git a/src/mame/includes/jpmimpct.h b/src/mame/includes/jpmimpct.h
index f8e7a2e9431..bfa6eeabe19 100644
--- a/src/mame/includes/jpmimpct.h
+++ b/src/mame/includes/jpmimpct.h
@@ -106,12 +106,12 @@ public:
DECLARE_READ8_MEMBER(hopper_c_r);
DECLARE_WRITE8_MEMBER(payen_a_w);
DECLARE_WRITE8_MEMBER(display_c_w);
-
+
DECLARE_WRITE_LINE_MEMBER(tms_irq);
TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
-
+
DECLARE_MACHINE_START(jpmimpct);
DECLARE_MACHINE_RESET(jpmimpct);
DECLARE_VIDEO_START(jpmimpct);
diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h
index f4a2e6223ee..5921cabbb1f 100644
--- a/src/mame/includes/konamigx.h
+++ b/src/mame/includes/konamigx.h
@@ -155,7 +155,7 @@ public:
void konamigx_esc_alert(UINT32 *srcbase, int srcoffs, int count, int mode);
void konamigx_precache_registers(void);
-
+
void wipezbuf(int noshadow);
void dmastart_callback(int data);
diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h
index db38d2f3143..3a8a89f5760 100644
--- a/src/mame/includes/legionna.h
+++ b/src/mame/includes/legionna.h
@@ -21,7 +21,7 @@ public:
m_palette(*this, "palette"),
m_wordswapram(*this, "wordswapram"),
m_raiden2cop(*this, "raiden2cop")
- {
+ {
memset(scrollvals, 0, sizeof(UINT16)*6);
}
@@ -91,5 +91,3 @@ public:
optional_device<raiden2cop_device> m_raiden2cop;
};
-
-
diff --git a/src/mame/includes/meadows.h b/src/mame/includes/meadows.h
index 014c38574bf..a1e64a6e6ea 100644
--- a/src/mame/includes/meadows.h
+++ b/src/mame/includes/meadows.h
@@ -24,7 +24,7 @@ public:
m_videoram(*this, "videoram")
{
}
-
+
required_device<s2650_device> m_maincpu;
optional_device<s2650_device> m_audiocpu;
optional_device<dac_device> m_dac;
@@ -35,7 +35,7 @@ public:
optional_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_videoram;
-
+
UINT8 m_dac_data;
int m_dac_enable;
int m_channel;
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index 96a22cbf92e..3bd69ece6c1 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -52,7 +52,7 @@ public:
m_shared_ram(*this, "shared_ram"),
m_mac_sram(*this, "mac_sram"),
m_sprite_vram(*this, "sprite_vram") { }
-
+
required_device<cpu_device> m_maincpu;
required_device<i8051_device> m_audiocpu;
required_device<upd7759_device> m_upd7759;
@@ -172,7 +172,7 @@ public:
void rasterise_spans(UINT32 min_y, UINT32 max_y, UINT32 attr);
int clip_triangle(micro3d_vtx *v, micro3d_vtx *vout, int num_vertices, enum planes plane);
void draw_triangles(UINT32 attr);
-
+
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
diff --git a/src/mame/includes/midtunit.h b/src/mame/includes/midtunit.h
index 0e148ef2993..9ac5c806bcd 100644
--- a/src/mame/includes/midtunit.h
+++ b/src/mame/includes/midtunit.h
@@ -104,7 +104,7 @@ public:
const UINT8 *jdredd_prot_table;
UINT8 jdredd_prot_index;
UINT8 jdredd_prot_max;
-
+
UINT8 m_gfx_rom_large;
protected:
diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h
index 414909fba89..388d7e41ec2 100644
--- a/src/mame/includes/midyunit.h
+++ b/src/mame/includes/midyunit.h
@@ -57,7 +57,7 @@ public:
optional_device<williams_narc_sound_device> m_narc_sound;
optional_device<williams_cvsd_sound_device> m_cvsd_sound;
optional_device<williams_adpcm_sound_device> m_adpcm_sound;
-
+
required_shared_ptr<UINT16> m_generic_paletteram_16;
optional_shared_ptr<UINT8> m_gfx_rom;
@@ -130,7 +130,7 @@ public:
DECLARE_VIDEO_START(common);
TIMER_CALLBACK_MEMBER(dma_callback);
TIMER_CALLBACK_MEMBER(autoerase_line);
-
+
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
void dma_draw(UINT16 command);
diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h
index 7249adfc1a5..dc8b0f2f7fe 100644
--- a/src/mame/includes/model1.h
+++ b/src/mame/includes/model1.h
@@ -36,7 +36,7 @@ public:
required_shared_ptr<UINT16> m_display_list0;
required_shared_ptr<UINT16> m_display_list1;
required_shared_ptr<UINT16> m_color_xlat;
-
+
struct view *m_view;
struct point *m_pointdb;
struct point *m_pointpt;
@@ -274,7 +274,7 @@ public:
void sort_quads();
void unsort_quads();
void draw_quads(bitmap_rgb32 &bitmap, const rectangle &cliprect);
- void fclip_push_quad_next(int level, struct quad_m1 *q, struct point *p1, struct point *p2, struct point *p3, struct point *p4);
+ void fclip_push_quad_next(int level, struct quad_m1 *q, struct point *p1, struct point *p2, struct point *p3, struct point *p4);
void fclip_push_quad(int level, struct quad_m1 *q);
void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size);
UINT16 *push_direct(UINT16 *list);
diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h
index 0296d44ce41..895daefef9b 100644
--- a/src/mame/includes/model3.h
+++ b/src/mame/includes/model3.h
@@ -94,7 +94,7 @@ public:
required_shared_ptr<UINT64> m_work_ram;
required_shared_ptr<UINT64> m_paletteram64;
optional_device<dsbz80_device> m_dsbz80; // Z80-based MPEG Digital Sound Board
- required_shared_ptr<UINT16> m_soundram;
+ required_shared_ptr<UINT16> m_soundram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -261,7 +261,7 @@ public:
DECLARE_DRIVER_INIT(spikeout);
DECLARE_DRIVER_INIT(magtruck);
DECLARE_DRIVER_INIT(lamachin);
- DECLARE_DRIVER_INIT(model3_15);
+ DECLARE_DRIVER_INIT(model3_15);
DECLARE_MACHINE_START(model3_10);
DECLARE_MACHINE_RESET(model3_10);
DECLARE_MACHINE_START(model3_15);
diff --git a/src/mame/includes/namcos2.h b/src/mame/includes/namcos2.h
index 3672634a575..954a7355f2f 100644
--- a/src/mame/includes/namcos2.h
+++ b/src/mame/includes/namcos2.h
@@ -120,7 +120,7 @@ public:
// game type helpers
bool is_system21();
int m_gametype;
-
+
emu_timer *m_posirq_timer;
int m_mcu_analog_ctrl;
int m_mcu_analog_data;
diff --git a/src/mame/includes/polyplay.h b/src/mame/includes/polyplay.h
index 38b5c9c9cba..8bcff103aa2 100644
--- a/src/mame/includes/polyplay.h
+++ b/src/mame/includes/polyplay.h
@@ -16,12 +16,12 @@ public:
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_characterram;
-
+
required_device<cpu_device> m_maincpu;
required_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
-
+
int m_freq1;
int m_freq2;
int m_channel_playing1;
@@ -35,7 +35,7 @@ public:
int m_channel2_const;
timer_device* m_timer;
int m_last;
-
+
DECLARE_WRITE8_MEMBER(polyplay_sound_channel);
DECLARE_WRITE8_MEMBER(polyplay_start_timer2);
DECLARE_READ8_MEMBER(polyplay_random_read);
diff --git a/src/mame/includes/raiden2.h b/src/mame/includes/raiden2.h
index e5b0bf9bffd..d932d2c7d06 100644
--- a/src/mame/includes/raiden2.h
+++ b/src/mame/includes/raiden2.h
@@ -13,29 +13,29 @@ public:
mid_data(*this, "mid_data"),
text_data(*this, "text_data"),
*/
- sprites(*this, "sprites") ,
- m_maincpu(*this, "maincpu"),
- m_seibu_sound(*this, "seibu_sound"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"),
-
- bg_bank(0),
- fg_bank(0),
- mid_bank(0),
- tx_bank(0),
- raiden2_tilemap_enable(0),
- prg_bank(0),
- cop_bank(0),
-
- sprite_prot_x(0),
- sprite_prot_y(0),
- dst1(0),
- cop_spr_maxx(0),
- cop_spr_off(0),
-
- tile_buffer(320, 256),
- sprite_buffer(320, 256),
- m_raiden2cop(*this, "raiden2cop")
+ sprites(*this, "sprites") ,
+ m_maincpu(*this, "maincpu"),
+ m_seibu_sound(*this, "seibu_sound"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
+
+ bg_bank(0),
+ fg_bank(0),
+ mid_bank(0),
+ tx_bank(0),
+ raiden2_tilemap_enable(0),
+ prg_bank(0),
+ cop_bank(0),
+
+ sprite_prot_x(0),
+ sprite_prot_y(0),
+ dst1(0),
+ cop_spr_maxx(0),
+ cop_spr_off(0),
+
+ tile_buffer(320, 256),
+ sprite_buffer(320, 256),
+ m_raiden2cop(*this, "raiden2cop")
{
memset(scrollvals, 0, sizeof(UINT16)*6);
memset(sprite_prot_src_addr, 0, sizeof(UINT16)*2);
@@ -87,8 +87,8 @@ public:
bool blend_active[0x800]; // cfg
tilemap_t *background_layer,*midground_layer,*foreground_layer,*text_layer;
-
-
+
+
int bg_bank, fg_bank, mid_bank, tx_bank;
UINT16 raiden2_tilemap_enable;
UINT8 prg_bank;
diff --git a/src/mame/includes/simple_st0016.h b/src/mame/includes/simple_st0016.h
index 0d8a225546a..f1448bffb4d 100644
--- a/src/mame/includes/simple_st0016.h
+++ b/src/mame/includes/simple_st0016.h
@@ -12,7 +12,7 @@ public:
{ }
int mux_port;
-// UINT32 m_st0016_rom_bank;
+// UINT32 m_st0016_rom_bank;
optional_device<st0016_cpu_device> m_maincpu;
DECLARE_READ8_MEMBER(mux_r);
diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h
index 0f7f25159ad..c819aaed55d 100644
--- a/src/mame/includes/snk.h
+++ b/src/mame/includes/snk.h
@@ -26,7 +26,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
-
+
required_shared_ptr<UINT8> m_spriteram;
optional_shared_ptr<UINT8> m_fg_videoram;
required_shared_ptr<UINT8> m_bg_videoram;
@@ -39,7 +39,7 @@ public:
int m_marvins_sound_busy_flag;
// FIXME this should be initialised on machine reset
int m_sound_status;
-
+
tilemap_t *m_tx_tilemap;
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
@@ -181,14 +181,14 @@ public:
UINT32 screen_update_tnk3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback);
TIMER_CALLBACK_MEMBER(sndirq_update_callback);
DECLARE_WRITE_LINE_MEMBER(ymirq_callback_2);
void marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to);
void tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll);
void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum );
- void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to);
+ void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to);
int hardflags_check(int num);
int hardflags_check8(int num);
int turbofront_check(int small, int num);
diff --git a/src/mame/includes/splash.h b/src/mame/includes/splash.h
index f8d9b87fc73..94be4a7069c 100644
--- a/src/mame/includes/splash.h
+++ b/src/mame/includes/splash.h
@@ -18,7 +18,7 @@ public:
m_msm2(*this, "msm2"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
-
+
funystrp_val(0),
funystrp_ff3cc7_val(0),
funystrp_ff3cc8_val(0)
diff --git a/src/mame/includes/sslam.h b/src/mame/includes/sslam.h
index 1461dd20f5d..7464adc4551 100644
--- a/src/mame/includes/sslam.h
+++ b/src/mame/includes/sslam.h
@@ -16,7 +16,7 @@ public:
m_regs(*this, "regs"),
m_spriteram(*this, "spriteram") { }
-
+
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<okim6295_device> m_oki;
@@ -28,7 +28,7 @@ public:
optional_shared_ptr<UINT16> m_tx_tileram;
required_shared_ptr<UINT16> m_regs;
required_shared_ptr<UINT16> m_spriteram;
-
+
emu_timer *m_music_timer;
int m_sound;
diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h
index 65382136855..96d6fa09ab7 100644
--- a/src/mame/includes/stv.h
+++ b/src/mame/includes/stv.h
@@ -766,7 +766,7 @@ public:
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( stv_cart2 ) { return load_cart(image, m_cart2); }
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( stv_cart3 ) { return load_cart(image, m_cart3); }
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( stv_cart4 ) { return load_cart(image, m_cart4); }
-
+
void install_stvbios_speedups( void );
DECLARE_MACHINE_START(stv);
diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h
index 0892271012a..466471c0cb4 100644
--- a/src/mame/includes/suna8.h
+++ b/src/mame/includes/suna8.h
@@ -148,7 +148,7 @@ public:
DECLARE_WRITE8_MEMBER(suna8_samples_number_w);
void play_sample(int index);
SAMPLES_START_CB_MEMBER(sh_start);
-
+
void draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int which);
void draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
UINT8 *brickzn_decrypt();
diff --git a/src/mame/includes/suprnova.h b/src/mame/includes/suprnova.h
index 3b5a619be0a..881fb957fe9 100644
--- a/src/mame/includes/suprnova.h
+++ b/src/mame/includes/suprnova.h
@@ -43,7 +43,7 @@ public:
required_device<sknsspr_device> m_spritegen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
-
+
required_shared_ptr<UINT32> m_spriteram;
required_shared_ptr<UINT32> m_spc_regs;
required_shared_ptr<UINT32> m_v3_regs;
@@ -55,7 +55,7 @@ public:
required_shared_ptr<UINT32> m_v3t_ram;
required_shared_ptr<UINT32> m_main_ram;
required_shared_ptr<UINT32> m_cache_ram;
-
+
hit_t m_hit;
UINT32 m_timer_0_temp[4];
bitmap_ind16 m_sprite_bitmap;
diff --git a/src/mame/includes/taito_f3.h b/src/mame/includes/taito_f3.h
index 01a9ad18de2..67d1897adbd 100644
--- a/src/mame/includes/taito_f3.h
+++ b/src/mame/includes/taito_f3.h
@@ -67,10 +67,10 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
-
+
optional_shared_ptr<UINT32> m_f3_ram;
optional_shared_ptr<UINT32> m_paletteram32;
-
+
UINT16 *m_videoram;
UINT16 *m_spriteram;
UINT16 *m_f3_vram;
@@ -364,7 +364,7 @@ private:
inline void dpix_bg(UINT32 bgcolor);
void init_alpha_blend_func();
inline void draw_scanlines(bitmap_rgb32 &bitmap, int xsize, INT16 *draw_line_num, const struct f3_playfield_line_inf **line_t, const int *sprite, UINT32 orient, int skip_layer_num);
- void visible_tile_check(struct f3_playfield_line_inf *line_t, int line, UINT32 x_index_fx,UINT32 y_index, UINT16 *f3_pf_data_n);
+ void visible_tile_check(struct f3_playfield_line_inf *line_t, int line, UINT32 x_index_fx,UINT32 y_index, UINT16 *f3_pf_data_n);
void calculate_clip(int y, UINT16 pri, UINT32* clip0, UINT32* clip1, int* line_enable);
void get_spritealphaclip_info();
void get_line_ram_info(tilemap_t *tmap, int sx, int sy, int pos, UINT16 *f3_pf_data_n);
diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h
index 839efb1b839..5a4ea40599b 100644
--- a/src/mame/includes/tatsumi.h
+++ b/src/mame/includes/tatsumi.h
@@ -39,7 +39,7 @@ public:
required_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
-
+
optional_shared_ptr<UINT16> m_videoram;
optional_shared_ptr<UINT16> m_cyclwarr_cpua_ram;
optional_shared_ptr<UINT16> m_cyclwarr_cpub_ram;
@@ -58,7 +58,7 @@ public:
optional_shared_ptr<UINT16> m_roundup_p_ram;
optional_shared_ptr<UINT16> m_roundup_l_ram;
required_shared_ptr<UINT16> m_spriteram;
-
+
UINT16 m_bigfight_a20000[8];
UINT16 m_bigfight_a60000[2];
UINT16 m_bigfight_a40000[2];
diff --git a/src/mame/includes/thepit.h b/src/mame/includes/thepit.h
index 7e9d4b5a7b5..4e7cd0657d1 100644
--- a/src/mame/includes/thepit.h
+++ b/src/mame/includes/thepit.h
@@ -14,12 +14,12 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
-
+
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
required_shared_ptr<UINT8> m_attributesram;
required_shared_ptr<UINT8> m_spriteram;
-
+
int m_question_address;
int m_question_rom;
int m_remap_address[16];
diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h
index e021607a27c..e4a3327bc22 100644
--- a/src/mame/includes/tnzs.h
+++ b/src/mame/includes/tnzs.h
@@ -85,10 +85,10 @@ public:
DECLARE_WRITE8_MEMBER(kageki_csport_w);
DECLARE_WRITE8_MEMBER(kabukiz_sound_bank_w);
DECLARE_WRITE8_MEMBER(kabukiz_sample_w);
-
+
DECLARE_READ8_MEMBER(tnzs_ramrom_bank_r);
DECLARE_WRITE8_MEMBER(tnzs_ramrom_bank_w);
-
+
SAMPLES_START_CB_MEMBER(kageki_init_samples);
DECLARE_DRIVER_INIT(arknoid2);
diff --git a/src/mame/includes/vectrex.h b/src/mame/includes/vectrex.h
index aecf543e476..476af3b1543 100644
--- a/src/mame/includes/vectrex.h
+++ b/src/mame/includes/vectrex.h
@@ -57,7 +57,7 @@ public:
m_io_lpenx(*this, "LPENX"),
m_io_lpeny(*this, "LPENY"),
m_io_coin(*this, "COIN"),
- m_screen(*this, "screen")
+ m_screen(*this, "screen")
{ }
required_shared_ptr<UINT8> m_gce_vectorram;
diff --git a/src/mame/layout/mgavegas.lay b/src/mame/layout/mgavegas.lay
index 0d7493c9e58..997c39c9a2f 100644
--- a/src/mame/layout/mgavegas.lay
+++ b/src/mame/layout/mgavegas.lay
@@ -35,27 +35,27 @@
<element name="P12"><text string="500"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P13"><text string="300"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="P14"><text string="200"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="P14"><text string="200"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P15"><text string="100"><color red="1.0" green="1.0" blue="1.0" /></text></element>
-
+
<element name="P16"><text string="INSERT COIN"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="P17"><text string="NO CAMBIO"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="P17"><text string="NO CAMBIO"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P18"><text string="FUSE"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P19"><text string="FALTA"><color red="1.0" green="1.0" blue="1.0" /></text></element>
-
- <element name="P20"><text string="MGA"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+
+ <element name="P20"><text string="MGA"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P21"><text string="50"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P22"><text string="MGA"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P23"><text string="25"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="P24"><text string="250"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="P24"><text string="250"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P25"><text string="MGA"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P26"><text string="100"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P27"><text string="MGA"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P28"><text string="25"><color red="1.0" green="1.0" blue="1.0" /></text></element>
-
+
<element name="P29"><text string="Premio Sorpresa"><color red="1.0" green="1.0" blue="1.0" /></text></element>
-
+
<view name="Default Layout">
<!-- Background -->
@@ -74,7 +74,7 @@
<bezel name="MR" element="red_led">
<bounds x="360" y="50" width="5" height="5" />
</bezel>
-
+
<bezel name="CL" element="red_led">
<bounds x="280" y="100" width="5" height="5" />
</bezel>
@@ -103,8 +103,8 @@
</bezel>
<bezel name="PR" element="red_led">
<bounds x="360" y="200" width="5" height="5" />
- </bezel>
-
+ </bezel>
+
<bezel name="500" element="red_led">
<bounds x="410" y="50" width="5" height="5" />
</bezel>
@@ -113,11 +113,11 @@
</bezel>
<bezel name="200" element="red_led">
<bounds x="410" y="150" width="5" height="5" />
- </bezel>
+ </bezel>
<bezel name="100" element="red_led">
<bounds x="410" y="200" width="5" height="5" />
- </bezel>
-
+ </bezel>
+
<bezel name="INSERTCOIN" element="red_led">
<bounds x="270" y="250" width="5" height="5" />
</bezel>
@@ -126,7 +126,7 @@
</bezel>
<bezel name="FUSE" element="red_led">
<bounds x="350" y="250" width="5" height="5" />
- </bezel>
+ </bezel>
<bezel name="FALTA" element="red_led">
<bounds x="400" y="250" width="5" height="5" />
</bezel>
@@ -139,7 +139,7 @@
</bezel>
<bezel name="MGA3" element="red_led">
<bounds x="125" y="350" width="30" height="30" />
- </bezel>
+ </bezel>
<bezel name="252" element="red_led">
<bounds x="170" y="350" width="30" height="30" />
</bezel>
@@ -151,7 +151,7 @@
</bezel>
<bezel name="1002" element="red_led">
<bounds x="305" y="350" width="30" height="30" />
- </bezel>
+ </bezel>
<bezel name="MGA" element="red_led">
<bounds x="350" y="350" width="30" height="30" />
</bezel>
@@ -159,7 +159,7 @@
<bounds x="395" y="350" width="30" height="30" />
</bezel>
-
+
<bezel name="MGA4" element="red_led">
<bounds x="40" y="50" width="5" height="5" />
</bezel>
@@ -168,7 +168,7 @@
</bezel>
<bezel name="MGA3" element="red_led">
<bounds x="80" y="150" width="5" height="5" />
- </bezel>
+ </bezel>
<bezel name="252" element="red_led">
<bounds x="100" y="200" width="5" height="5" />
</bezel>
@@ -180,7 +180,7 @@
</bezel>
<bezel name="1002" element="red_led">
<bounds x="160" y="150" width="5" height="5" />
- </bezel>
+ </bezel>
<bezel name="MGA" element="red_led">
<bounds x="180" y="100" width="5" height="5" />
</bezel>
@@ -191,9 +191,9 @@
<bezel name="PREMIOS" element="red_led">
<bounds x="220" y="150" width="10" height="10" />
</bezel>
-
-
-
+
+
+
<bezel element="P0"><bounds left="350" right="370" top="20" bottom="40" /></bezel>
<bezel element="P1"><bounds left="310" right="330" top="20" bottom="40" /></bezel>
<bezel element="P2"><bounds left="270" right="290" top="20" bottom="40" /></bezel>
@@ -219,29 +219,29 @@
<bezel element="P17"><bounds left="310" right="330" top="220" bottom="240" /></bezel>
<bezel element="P18"><bounds left="350" right="370" top="220" bottom="240" /></bezel>
<bezel element="P19"><bounds left="400" right="420" top="220" bottom="240" /></bezel>
-
+
<bezel element="P20"><bounds left="35" right="55" top="320" bottom="340" /></bezel>
<bezel element="P21"><bounds left="80" right="100" top="320" bottom="340" /></bezel>
<bezel element="P22"><bounds left="125" right="145" top="320" bottom="340" /></bezel>
- <bezel element="P23"><bounds left="170" right="190" top="320" bottom="340" /></bezel>
+ <bezel element="P23"><bounds left="170" right="190" top="320" bottom="340" /></bezel>
<bezel element="P24"><bounds left="215" right="235" top="320" bottom="340" /></bezel>
<bezel element="P25"><bounds left="260" right="280" top="320" bottom="340" /></bezel>
<bezel element="P26"><bounds left="305" right="325" top="320" bottom="340" /></bezel>
- <bezel element="P27"><bounds left="350" right="370" top="320" bottom="340" /></bezel>
- <bezel element="P28"><bounds left="395" right="415" top="320" bottom="340" /></bezel>
+ <bezel element="P27"><bounds left="350" right="370" top="320" bottom="340" /></bezel>
+ <bezel element="P28"><bounds left="395" right="415" top="320" bottom="340" /></bezel>
<bezel element="P20"><bounds left="40" right="60" top="35" bottom="45" /></bezel>
<bezel element="P21"><bounds left="60" right="80" top="85" bottom="95" /></bezel>
<bezel element="P22"><bounds left="80" right="100" top="135" bottom="145" /></bezel>
- <bezel element="P23"><bounds left="100" right="120" top="185" bottom="195" /></bezel>
+ <bezel element="P23"><bounds left="100" right="120" top="185" bottom="195" /></bezel>
<bezel element="P24"><bounds left="120" right="140" top="235" bottom="245" /></bezel>
<bezel element="P25"><bounds left="140" right="160" top="185" bottom="195" /></bezel>
<bezel element="P26"><bounds left="160" right="180" top="135" bottom="145" /></bezel>
- <bezel element="P27"><bounds left="180" right="200" top="85" bottom="95" /></bezel>
- <bezel element="P28"><bounds left="200" right="220" top="35" bottom="45" /></bezel>
+ <bezel element="P27"><bounds left="180" right="200" top="85" bottom="95" /></bezel>
+ <bezel element="P28"><bounds left="200" right="220" top="35" bottom="45" /></bezel>
+
+ <bezel element="P29"><bounds left="190" right="260" top="130" bottom="150" /></bezel>
- <bezel element="P29"><bounds left="190" right="260" top="130" bottom="150" /></bezel>
-
</view>
</mamelayout>
diff --git a/src/mame/layout/s11a.lay b/src/mame/layout/s11a.lay
index d1a94daef50..b8179ca88de 100644
--- a/src/mame/layout/s11a.lay
+++ b/src/mame/layout/s11a.lay
@@ -1,7 +1,7 @@
<!-- s11a.lay -->
<!-- 2012-11-04: Initial version. [Robbbert]
- 2012-12-19: Rearranged layout, replaced diagnostic 7-digit LED with 3 single LEDs [Barry Rodewald]-->
+ 2012-12-19: Rearranged layout, replaced diagnostic 7-digit LED with 3 single LEDs [Barry Rodewald]-->
<mamelayout version="2">
diff --git a/src/mame/machine/315_5296.c b/src/mame/machine/315_5296.c
index 1b02a9c0f2f..638c270d7c7 100644
--- a/src/mame/machine/315_5296.c
+++ b/src/mame/machine/315_5296.c
@@ -1,7 +1,7 @@
/**********************************************************************
Sega 315-5296 I/O chip
-
+
Sega 100-pin QFP, with 8 bidirectional I/O ports, and 3 output pins.
It also has chip select(/FMCS) and clock(CKOT) for a peripheral device.
Commonly used from the late 80s up until Sega Model 2.
@@ -68,7 +68,7 @@ void sega_315_5296_device::device_start()
m_in_pf_cb.resolve_safe(0xff); m_in_port_cb[5] = &m_in_pf_cb;
m_in_pg_cb.resolve_safe(0xff); m_in_port_cb[6] = &m_in_pg_cb;
m_in_ph_cb.resolve_safe(0xff); m_in_port_cb[7] = &m_in_ph_cb;
-
+
m_out_pa_cb.resolve_safe(); m_out_port_cb[0] = &m_out_pa_cb;
m_out_pb_cb.resolve_safe(); m_out_port_cb[1] = &m_out_pb_cb;
m_out_pc_cb.resolve_safe(); m_out_port_cb[2] = &m_out_pc_cb;
@@ -77,11 +77,11 @@ void sega_315_5296_device::device_start()
m_out_pf_cb.resolve_safe(); m_out_port_cb[5] = &m_out_pf_cb;
m_out_pg_cb.resolve_safe(); m_out_port_cb[6] = &m_out_pg_cb;
m_out_ph_cb.resolve_safe(); m_out_port_cb[7] = &m_out_ph_cb;
-
+
m_out_cnt0_cb.resolve_safe(); m_out_cnt_cb[0] = &m_out_cnt0_cb;
m_out_cnt1_cb.resolve_safe(); m_out_cnt_cb[1] = &m_out_cnt1_cb;
m_out_cnt2_cb.resolve_safe(); m_out_cnt_cb[2] = &m_out_cnt2_cb;
-
+
// register for savestates
save_item(NAME(m_output_latch));
save_item(NAME(m_cnt));
@@ -96,7 +96,7 @@ void sega_315_5296_device::device_reset()
{
// all ports are set to input
m_dir = 0;
-
+
// clear output ports
memset(m_output_latch, 0, sizeof(m_output_latch));
m_cnt = 0;
@@ -113,7 +113,7 @@ void sega_315_5296_device::device_reset()
READ8_MEMBER( sega_315_5296_device::read )
{
offset &= 0x3f;
-
+
switch (offset)
{
// port A to H
@@ -121,10 +121,10 @@ READ8_MEMBER( sega_315_5296_device::read )
// if the port is configured as an output, return the last thing written
if (m_dir & 1 << offset)
return m_output_latch[offset];
-
+
// otherwise, return an input port
return (*m_in_port_cb[offset])(offset);
-
+
// 'SEGA' protection
case 0x8:
return 'S';
@@ -142,11 +142,11 @@ READ8_MEMBER( sega_315_5296_device::read )
// port direction register & mirror
case 0xd: case 0xf:
return m_dir;
-
+
default:
break;
}
-
+
return 0xff;
}
@@ -165,7 +165,7 @@ WRITE8_MEMBER( sega_315_5296_device::write )
m_output_latch[offset] = data;
break;
-
+
// CNT register
case 0xe:
// d0-2: CNT0-2 output pins
@@ -173,7 +173,7 @@ WRITE8_MEMBER( sega_315_5296_device::write )
// no effect on the output level of CNT2.
for (int i = 0; i < 3; i++)
(*m_out_cnt_cb[i])(data >> i & 1);
-
+
// d3: CNT2 output mode (1= Clock output, 0= Programmable output)
// d4,5: CNT2 clock divider (0= CLK/4, 1= CLK/8, 2= CLK/16, 3= CLK/2)
// d6,7: CKOT clock divider (0= CLK/4, 1= CLK/8, 2= CLK/16, 3= CLK/2)
@@ -189,10 +189,10 @@ WRITE8_MEMBER( sega_315_5296_device::write )
if ((m_dir ^ data) & (1 << i))
(*m_out_port_cb[i])((offs_t)i, (data & 1 << i) ? m_output_latch[i] : 0);
}
-
+
m_dir = data;
break;
-
+
default:
break;
}
diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c
index 42f365c7b1b..7bf026f9ca0 100644
--- a/src/mame/machine/amiga.c
+++ b/src/mame/machine/amiga.c
@@ -358,7 +358,7 @@ TIMER_CALLBACK_MEMBER( amiga_state::scanline_callback )
m_pot1y += !(m_potgo_port->read() & 0x4000);
}
}
-
+
// render up to this scanline
if (!m_screen->update_partial(scanline))
{
diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c
index 08954aca6d2..075e29ab356 100644
--- a/src/mame/machine/asic65.c
+++ b/src/mame/machine/asic65.c
@@ -251,7 +251,7 @@ READ16_MEMBER( asic65_device::read )
}
int command = (m_command < MAX_COMMANDS) ? command_map[m_asic65_type][m_command] : OP_UNKNOWN;
-
+
/* update results */
switch (command)
{
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index 2d4334fe846..7a0a29f692d 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -167,7 +167,7 @@ POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a5200_keypads)
case pokey_device::POK_KEY_SHIFT:
// button 2 from joypads
ipt = m_djoy_b->read() & (0x10 << ((k543210 >> 3) & 0x03));
- ret |= !ipt ? 0x02 : 0;
+ ret |= !ipt ? 0x02 : 0;
break;
}
diff --git a/src/mame/machine/awboard.h b/src/mame/machine/awboard.h
index daf9b002c91..6e11a11061d 100644
--- a/src/mame/machine/awboard.h
+++ b/src/mame/machine/awboard.h
@@ -22,8 +22,8 @@ public:
DECLARE_WRITE16_MEMBER(mpr_first_file_index_w); // 5f7010
DECLARE_WRITE16_MEMBER(mpr_file_offsetl_w); // 5f7014
DECLARE_WRITE16_MEMBER(mpr_file_offseth_w); // 5f7018
- DECLARE_READ16_MEMBER(adj_offset_r); // 5f7080
- DECLARE_WRITE16_MEMBER(adj_offset_w); // 5f7080
+ DECLARE_READ16_MEMBER(adj_offset_r); // 5f7080
+ DECLARE_WRITE16_MEMBER(adj_offset_w); // 5f7080
protected:
virtual void device_start();
diff --git a/src/mame/machine/inder_vid.c b/src/mame/machine/inder_vid.c
index 9dd4294bbb3..3862b4ab5f8 100644
--- a/src/mame/machine/inder_vid.c
+++ b/src/mame/machine/inder_vid.c
@@ -90,7 +90,7 @@ static MACHINE_CONFIG_FRAGMENT( inder_vid )
MCFG_CPU_PROGRAM_MAP(megaphx_tms_map)
MCFG_TMS340X0_HALT_ON_RESET(TRUE) /* halt on reset */
MCFG_TMS340X0_PIXEL_CLOCK(XTAL_40MHz/12) /* pixel clock */
- MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
+ MCFG_TMS340X0_PIXELS_PER_CLOCK(2) /* pixels per clock */
MCFG_TMS340X0_SCANLINE_RGB32_CB(inder_vid_device, scanline) /* scanline updater (RGB32) */
MCFG_TMS340X0_OUTPUT_INT_CB(WRITELINE(inder_vid_device, m68k_gen_int))
MCFG_TMS340X0_TO_SHIFTREG_CB(inder_vid_device, to_shiftreg) /* write to shiftreg function */
diff --git a/src/mame/machine/inder_vid.h b/src/mame/machine/inder_vid.h
index 7d4375a2855..4975e12e859 100644
--- a/src/mame/machine/inder_vid.h
+++ b/src/mame/machine/inder_vid.h
@@ -29,7 +29,7 @@ public:
required_shared_ptr<UINT16> m_vram;
required_device<palette_device> m_palette;
required_device<tms34010_device> m_tms;
-
+
DECLARE_WRITE_LINE_MEMBER(m68k_gen_int);
int m_shiftfull; // this might be a driver specific hack for a TMS bug.
@@ -41,7 +41,7 @@ protected:
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_start();
virtual void device_reset();
-
+
private:
};
diff --git a/src/mame/machine/kaneko_calc3.h b/src/mame/machine/kaneko_calc3.h
index bc5afffad6d..3ad16702c4a 100644
--- a/src/mame/machine/kaneko_calc3.h
+++ b/src/mame/machine/kaneko_calc3.h
@@ -16,7 +16,7 @@ public:
void reset_run_timer();
void mcu_run();
-
+
protected:
virtual void device_start();
virtual void device_reset();
@@ -43,12 +43,12 @@ private:
UINT16 m_poll_addr;
UINT16 m_checksumaddress;
emu_timer* m_runtimer;
-
+
enum
{
MCU_RUN_TIMER
};
-
+
void mcu_init();
void initial_scan_tables();
void mcu_com_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _n_);
diff --git a/src/mame/machine/kaneko_toybox.h b/src/mame/machine/kaneko_toybox.h
index 5f3b9bfce47..e3a72e4c99b 100644
--- a/src/mame/machine/kaneko_toybox.h
+++ b/src/mame/machine/kaneko_toybox.h
@@ -353,7 +353,7 @@ private:
UINT16 m_mcu_com[4];
int m_gametype;
int m_tabletype;
-
+
void mcu_com_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _n_);
void decrypt_rom();
void handle_04_subcommand(UINT8 mcu_subcmd, UINT16 *mcu_ram);
@@ -366,6 +366,6 @@ extern const device_type KANEKO_TOYBOX;
#define MCFG_TOYBOX_TABLE_TYPE(_type) \
kaneko_toybox_device::set_table(*device, _type);
-
+
#define MCFG_TOYBOX_GAME_TYPE(_type) \
kaneko_toybox_device::set_game_type(*device, _type);
diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c
index f470aab3d2d..dd631ad6401 100644
--- a/src/mame/machine/konppc.c
+++ b/src/mame/machine/konppc.c
@@ -18,7 +18,7 @@ konppc_device::konppc_device(const machine_config &mconfig, const char *tag, dev
: device_t(mconfig, KONPPC, "Konami PowerPC Common Functions", tag, owner, clock, "konppc", __FILE__),
cgboard_type(0),
num_cgboards(0)/*,
- cgboard_id(MAX_CG_BOARDS)*/
+ cgboard_id(MAX_CG_BOARDS)*/
{
}
diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c
index 1b26ea2584b..b3499d7116d 100644
--- a/src/mame/machine/model1.c
+++ b/src/mame/machine/model1.c
@@ -1584,15 +1584,15 @@ const struct model1_state::function model1_state::ftab_vf[] = {
{ &model1_state::fsub, 2 },
{ &model1_state::fmul, 2 },
{ &model1_state::fdiv, 2 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::matrix_push, 0 },
{ &model1_state::matrix_pop, 0 },
{ &model1_state::matrix_write, 12 },
{ &model1_state::clear_stack, 0 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::anglev, 2 },
- { NULL, 0 },
- { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::track_select, 1 },
{ &model1_state::f14, 4 },
{ &model1_state::anglep, 4 },
@@ -1604,9 +1604,9 @@ const struct model1_state::function model1_state::ftab_vf[] = {
{ &model1_state::matrix_rotx, 1 },
{ &model1_state::matrix_roty, 1 },
{ &model1_state::matrix_rotz, 1 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::track_read_quad, 1 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::transform_point, 3 },
{ &model1_state::fsin_m1, 1 },
{ &model1_state::fcos_m1, 1 },
@@ -1614,10 +1614,10 @@ const struct model1_state::function model1_state::ftab_vf[] = {
{ &model1_state::fcosm_m1, 2 },
{ &model1_state::distance3, 6 },
- { NULL, 0 }, /* 0x20 */
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
+ { NULL, 0 }, /* 0x20 */
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::acc_set, 1 },
{ &model1_state::acc_get, 0 },
{ &model1_state::acc_add, 1 },
@@ -1629,54 +1629,54 @@ const struct model1_state::function model1_state::ftab_vf[] = {
{ &model1_state::f44, 1 },
{ &model1_state::f45, 1 },
{ &model1_state::vlength, 3 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::track_read_info, 1 }, /* 0x30 */
{ &model1_state::colbox_set, 12 },
{ &model1_state::colbox_test, 3 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::track_lookup, 4 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::col_setcirc, 3 }, /* 0x40 */
{ &model1_state::col_testpt, 2 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::distance, 4 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::car_move, 4 },
{ &model1_state::cpa, 12 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::vmat_store, 1 },
{ &model1_state::vmat_restore, 1 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::vmat_mul, 2 },
{ &model1_state::vmat_read, 1 },
{ &model1_state::matrix_unrot, 0 },
{ &model1_state::f80, 0 }, /* 0x50 */
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::matrix_rtrans, 0 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::vmat_save, 1 },
{ &model1_state::vmat_load, 1 },
{ &model1_state::ram_setadr, 1 },
{ &model1_state::groundbox_test, 3 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::f89, 4 },
- { NULL, 0 },
- { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::f92, 4 },
{ &model1_state::f93, 1 },
{ &model1_state::f94, 1 },
@@ -1702,7 +1702,7 @@ const struct model1_state::function model1_state::ftab_swa[] = {
{ &model1_state::fsub, 2 },
{ &model1_state::fmul, 2 },
{ &model1_state::fdiv, 2 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::matrix_push, 0 },
{ &model1_state::matrix_pop, 0 },
{ &model1_state::matrix_write, 12 },
@@ -1722,9 +1722,9 @@ const struct model1_state::function model1_state::ftab_swa[] = {
{ &model1_state::matrix_rotx, 1 },
{ &model1_state::matrix_roty, 1 },
{ &model1_state::matrix_rotz, 1 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::f24_swa, 7 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::transform_point, 3 },
{ &model1_state::fsin_m1, 1 },
{ &model1_state::fcos_m1, 1 },
@@ -1732,8 +1732,8 @@ const struct model1_state::function model1_state::ftab_swa[] = {
{ &model1_state::fcosm_m1, 2 },
{ &model1_state::distance3, 6 },
- { NULL, 0 }, /* 0x20 */
- { NULL, 0 },
+ { NULL, 0 }, /* 0x20 */
+ { NULL, 0 },
{ &model1_state::ftoi, 1 },
{ &model1_state::itof, 1 },
{ &model1_state::acc_set, 1 },
@@ -1749,26 +1749,26 @@ const struct model1_state::function model1_state::ftab_swa[] = {
{ &model1_state::vlength, 3 },
{ &model1_state::f47, 3 },
- { NULL, 0 }, /* 0x30 */
+ { NULL, 0 }, /* 0x30 */
{ &model1_state::f49_swa, 6 },
{ &model1_state::f50_swa, 4 },
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::f52, 0 },
{ &model1_state::matrix_rdir, 3 },
- { NULL, 0 },
- { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::f56, 7 },
{ &model1_state::f57, 0 },
{ &model1_state::matrix_readt, 0 },
{ &model1_state::acc_geti, 0 },
{ &model1_state::f60, 0 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
- { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::push_and_ident, 0 }, /* 0x40 */
- { NULL, 0 },
+ { NULL, 0 },
{ &model1_state::catmull_rom, 13 }
};
diff --git a/src/mame/machine/nmk004.c b/src/mame/machine/nmk004.c
index 2b0523f53ef..297345f7382 100644
--- a/src/mame/machine/nmk004.c
+++ b/src/mame/machine/nmk004.c
@@ -25,7 +25,7 @@ WRITE8_MEMBER(nmk004_device::nmk004_port4_w)
{
// bit 0x08 toggles frequently but is connected to nothing?
- // bit 0x01 is set to reset the 68k
+ // bit 0x01 is set to reset the 68k
m_systemcpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/machine/raiden2cop.c b/src/mame/machine/raiden2cop.c
index 06b8410db62..c9eebf52f4e 100644
--- a/src/mame/machine/raiden2cop.c
+++ b/src/mame/machine/raiden2cop.c
@@ -27,7 +27,7 @@ raiden2cop_device::raiden2cop_device(const machine_config &mconfig, const char *
cop_latch_addr(0),
cop_latch_trigger(0),
cop_latch_value(0),
- cop_latch_mask(0),
+ cop_latch_mask(0),
cop_dma_v1(0),
cop_dma_v2(0),
cop_dma_mode(0),
@@ -78,7 +78,7 @@ raiden2cop_device::raiden2cop_device(const machine_config &mconfig, const char *
memset(cop_func_value, 0, sizeof(UINT16)*(0x100/8));
memset(cop_func_mask, 0, sizeof(UINT16)*(0x100/8));
memset(cop_program, 0, sizeof(UINT16)*(0x100));
-
+
memset(cop_dma_src, 0, sizeof(UINT16)*(0x200));
memset(cop_dma_dst, 0, sizeof(UINT16)*(0x200));
memset(cop_dma_size, 0, sizeof(UINT16)*(0x200));
@@ -362,7 +362,7 @@ int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask)
/* search the uploaded 'trigger' table for a matching trigger*/
/* note, I don't know what the 'mask' or 'value' tables are... probably important, might determine what actually gets executed! */
/* note: Zero Team triggers macro 0x904 instead of 0x905, Seibu Cup Soccer triggers 0xe30e instead of 0xe38e. I highly doubt that AT LEAST
- it isn't supposed to do anything, especially in the former case (it definitely NEEDS that sprites have an arc movement when they are knocked down). */
+ it isn't supposed to do anything, especially in the former case (it definitely NEEDS that sprites have an arc movement when they are knocked down). */
// we currently pass in mask 0xff00 to look at only match the top bits, but this is wrong, only specific bits are ignored (maybe depends on the 'mask' value uploaded with each trigger?)
int matched = 0;
int command = -1;
@@ -374,7 +374,7 @@ int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask)
if ((triggerval & mask) == (cop_func_trigger[i] & mask) && cop_func_trigger[i] != 0) /* cop_func_trigger[i] != 0 is just being used to prevent matching against empty / unused slots */
{
int otherlog = 1;
-
+
// just some per-game debug code so that we have a record of exactly which triggers each game is known to use
@@ -382,7 +382,7 @@ int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask)
{
// enemies often walk on the spot, bosses often walk above / below playable game area (the >>16 in the sqrt commands seems responsible)
// player doesn't walk off screen after end of level (walks on spot, different cause?)
- if (triggerval == 0x0205 || triggerval == 0x0905 ||
+ if (triggerval == 0x0205 || triggerval == 0x0905 ||
triggerval == 0x8100 || triggerval == 0x8900 || /* sin / cos */
triggerval == 0x138e || // atan?
triggerval == 0x3bb0 || // distance?
@@ -413,7 +413,7 @@ int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask)
if (triggerval == 0x0205 ||
triggerval == 0x8100 || triggerval == 0x8900 || /* sin / cos */
- triggerval == 0x138e ||
+ triggerval == 0x138e ||
triggerval == 0x3bb0 ||
triggerval == 0x42c2 ||
triggerval == 0xa100 || triggerval == 0xa900 || triggerval == 0xb080 || triggerval == 0xb880) /* collisions */
@@ -494,13 +494,13 @@ int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask)
{
if (triggerval == 0x0205 || triggerval == 0x0905 ||
triggerval == 0x8100 || triggerval == 0x8900 || /* sin / cos */
- triggerval == 0x130e || triggerval == 0x138e ||
+ triggerval == 0x130e || triggerval == 0x138e ||
triggerval == 0x2a05 ||
- triggerval == 0x2208 || triggerval == 0x2288 ||
+ triggerval == 0x2208 || triggerval == 0x2288 ||
triggerval == 0x338e ||
- triggerval == 0x39b0 || triggerval == 0x3bb0 ||
- triggerval == 0x4aa0 ||
- triggerval == 0x42c2 ||
+ triggerval == 0x39b0 || triggerval == 0x3bb0 ||
+ triggerval == 0x4aa0 ||
+ triggerval == 0x42c2 ||
triggerval == 0x5205 ||
triggerval == 0x5a05 ||
triggerval == 0x6200 ||
@@ -508,7 +508,7 @@ int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask)
triggerval == 0xa100 || triggerval == 0xa900 || triggerval == 0xb100 || triggerval == 0xb900 /* collisions */
)
otherlog = 0;
- }
+ }
else
{
otherlog = 0;
@@ -525,7 +525,6 @@ int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask)
if (matched == 1)
{
-
int j;
seibu_cop_log(" Sequence: ");
for (j=0;j<0x8;j++)
@@ -554,9 +553,9 @@ int raiden2cop_device::check_command_matches(int command, UINT16 seq0, UINT16 se
command *= 8;
if (cop_program[command+0] == seq0 && cop_program[command+1] == seq1 && cop_program[command+2] == seq2 && cop_program[command+3] == seq3 &&
- cop_program[command+4] == seq4 && cop_program[command+5] == seq5 && cop_program[command+6] == seq6 && cop_program[command+7] == seq7 &&
- cop_func_value[command/8] == _funcval_ &&
- cop_func_mask[command/8] == _funcmask_)
+ cop_program[command+4] == seq4 && cop_program[command+5] == seq5 && cop_program[command+6] == seq6 && cop_program[command+7] == seq7 &&
+ cop_func_value[command/8] == _funcval_ &&
+ cop_func_mask[command/8] == _funcmask_)
return 1;
else
return 0;
@@ -877,7 +876,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w)
/* Number Conversion */
-// according to score display in https://www.youtube.com/watch?v=T1M8sxYgt9A
+// according to score display in https://www.youtube.com/watch?v=T1M8sxYgt9A
// we should return 0x30 for unused digits? according to Raiden 2 and Zero
// Team the value should be 0x20, can this be configured?
// grainbow doesn't like this implementation at all (21 credits, 2 digit high scores etc.)
@@ -890,7 +889,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_itoa_low_w)
if(digits > 9)
digits = 9;
-
+
for (int i = 0; i < digits; i++)
{
if (!val && i)
@@ -903,7 +902,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_itoa_low_w)
val = val / 10;
}
}
-
+
cop_itoa_digits[9] = 0;
}
@@ -1106,7 +1105,7 @@ void raiden2cop_device::execute_338e(address_space &space, int offset, UINT16 da
/*
## - trig (up5) (low11) : (sq0, sq1, sq2, sq3, sq4, sq5, sq6, sq7) valu mask
-07 - 3bb0 ( 07) ( 3b0) : (f9c, b9c, b9c, b9c, b9c, b9c, b9c, 99c) 4 007f (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx,
+07 - 3bb0 ( 07) ( 3b0) : (f9c, b9c, b9c, b9c, b9c, b9c, b9c, 99c) 4 007f (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx,
07 - 3b30 ( 07) ( 330) : (f9c, b9c, b9c, b9c, b9c, b9c, b9c, 99c) 4 007f (zeroteam, xsedae)
*/
@@ -1262,7 +1261,7 @@ void raiden2cop_device::execute_6200(address_space &space, int offset, UINT16 da
else
angle -= cop_angle_step;
}
-
+
cop_write_word(space, cop_regs[primary_reg], flags);
if (!m_cpu_is_68k)
@@ -1304,7 +1303,7 @@ void raiden2cop_device::LEGACY_execute_6200(address_space &space, int offset, UI
else
angle -= cop_angle_step;
}
-
+
cop_write_word(space, cop_regs[primary_reg], flags);
if (!m_cpu_is_68k)
@@ -1716,7 +1715,7 @@ void raiden2cop_device::cop_collision_update_hitbox(address_space &space, UINT1
//printf("%02x %02x %02x %02x %02x %02x\n", (UINT8)size[i], (UINT8)dx[i], (UINT8)size[1], (UINT8)dx[1], (UINT8)size[2], (UINT8)dx[2]);
int j = slot;
-
+
UINT8 res;
if (num_axis==3) res = 7;
@@ -1791,7 +1790,7 @@ WRITE16_MEMBER( raiden2cop_device::cop_cmd_w)
case 0x39b0:
case 0x3b30:
case 0x3bb0: { // 3bb0 0004 007f 0038 - 0f9c 0b9c 0b9c 0b9c 0b9c 0b9c 0b9c 099c
- execute_3b30(space, offset, data);
+ execute_3b30(space, offset, data);
break;
}
@@ -1829,7 +1828,7 @@ WRITE16_MEMBER( raiden2cop_device::cop_cmd_w)
case 0x5a05: // 5a05 0006 fff7 0058 - 0180 02e0 03a0 00a0 03a0 0000 0000 0000
// fprintf(stderr, "sprcpt 5a05 %04x %04x %04x %08x %08x\n", cop_regs[0], cop_regs[1], cop_regs[3], space.read_dword(cop_regs[0]), space.read_dword(cop_regs[3]));
execute_5a05(space, offset, data);
-
+
break;
case 0xf205: // f205 0006 fff7 00f0 - 0182 02e0 03c0 00c0 03c0 0000 0000 0000
@@ -2064,7 +2063,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_sprite_dma_abs_x_w)
WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
{
int command;
-
+
seibu_cop_log("%06x: COPX execute table macro command %04x | regs %08x %08x %08x %08x %08x\n", space.device().safe_pc(), data, cop_regs[0], cop_regs[1], cop_regs[2], cop_regs[3], cop_regs[4]);
@@ -2117,16 +2116,16 @@ WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
/* SINE math - 0x8100 */
/*
- 00000-0ffff:
- amp = x/256
- ang = x & 255
- s = sin(ang*2*pi/256)
- val = trunc(s*amp)
- if(s<0)
- val--
- if(s == 192)
- val = -2*amp
- */
+ 00000-0ffff:
+ amp = x/256
+ ang = x & 255
+ s = sin(ang*2*pi/256)
+ val = trunc(s*amp)
+ if(s<0)
+ val--
+ if(s == 192)
+ val = -2*amp
+ */
if (check_command_matches(command, 0xb9a, 0xb88, 0x888, 0x000, 0x000, 0x000, 0x000, 0x000, 7, 0xfdfb))
{
executed = 1;
@@ -2136,16 +2135,16 @@ WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
/* COSINE math - 0x8900 */
/*
- 10000-1ffff:
- amp = x/256
- ang = x & 255
- s = cos(ang*2*pi/256)
- val = trunc(s*amp)
- if(s<0)
- val--
- if(s == 128)
- val = -2*amp
- */
+ 10000-1ffff:
+ amp = x/256
+ ang = x & 255
+ s = cos(ang*2*pi/256)
+ val = trunc(s*amp)
+ if(s<0)
+ val--
+ if(s == 128)
+ val = -2*amp
+ */
if (check_command_matches(command, 0xb9a, 0xb8a, 0x88a, 0x000, 0x000, 0x000, 0x000, 0x000, 7, 0xfdfb))
{
executed = 1;
@@ -2173,11 +2172,11 @@ WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
/* Pythagorean theorem, hypotenuse length - 0x3bb0 */
//(grainbow) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c
/*
- 40000-7ffff:
- v1 = (x / 32768)*64
- v2 = (x & 255)*32767/255
- val = sqrt(v1*v1+v2*v2) (unsigned)
- */
+ 40000-7ffff:
+ v1 = (x / 32768)*64
+ v2 = (x & 255)*32767/255
+ val = sqrt(v1*v1+v2*v2) (unsigned)
+ */
if (check_command_matches(command, 0xf9c, 0xb9c, 0xb9c, 0xb9c, 0xb9c, 0xb9c, 0xb9c, 0x99c, 4, 0x007f))
{
executed = 1;
@@ -2187,15 +2186,15 @@ WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
/* Division - 0x42c2 */
/*
- 20000-2ffff:
- v1 = x / 1024
- v2 = x & 1023
- val = !v1 ? 32767 : trunc(v2/v1+0.5)
- 30000-3ffff:
- v1 = x / 1024
- v2 = (x & 1023)*32
- val = !v1 ? 32767 : trunc(v2/v1+0.5)
- */
+ 20000-2ffff:
+ v1 = x / 1024
+ v2 = x & 1023
+ val = !v1 ? 32767 : trunc(v2/v1+0.5)
+ 30000-3ffff:
+ v1 = x / 1024
+ v2 = (x & 1023)*32
+ val = !v1 ? 32767 : trunc(v2/v1+0.5)
+ */
if (check_command_matches(command, 0xf9a, 0xb9a, 0xb9c, 0xb9c, 0xb9c, 0x29c, 0x000, 0x000, 5, 0xfcdd))
{
executed = 1;
@@ -2204,17 +2203,17 @@ WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
}
/*
- collision detection:
+ collision detection:
- int dy_0 = space.read_dword(cop_regs[0]+4);
- int dx_0 = space.read_dword(cop_regs[0]+8);
- int dy_1 = space.read_dword(cop_regs[1]+4);
- int dx_1 = space.read_dword(cop_regs[1]+8);
- int hitbox_param1 = space.read_dword(cop_regs[2]);
- int hitbox_param2 = space.read_dword(cop_regs[3]);
+ int dy_0 = space.read_dword(cop_regs[0]+4);
+ int dx_0 = space.read_dword(cop_regs[0]+8);
+ int dy_1 = space.read_dword(cop_regs[1]+4);
+ int dx_1 = space.read_dword(cop_regs[1]+8);
+ int hitbox_param1 = space.read_dword(cop_regs[2]);
+ int hitbox_param2 = space.read_dword(cop_regs[3]);
- TODO: we are ignoring the funcval / funcmask params for now
- */
+ TODO: we are ignoring the funcval / funcmask params for now
+ */
if (check_command_matches(command, 0xb80, 0xb82, 0xb84, 0xb86, 0x000, 0x000, 0x000, 0x000, funcval, funcmask))
{
@@ -2287,7 +2286,7 @@ WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
if (check_command_matches(command, 0x380, 0x39a, 0x380, 0xa80, 0x29a, 0x000, 0x000, 0x000, 8, 0xf3e7))
{
executed = 1;
- execute_6200(space, offset, data);
+ execute_6200(space, offset, data);
return;
}
@@ -2311,7 +2310,3 @@ WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w)
if (executed == 0)
printf("did not execute %04x\n", data); // cup soccer triggers this a lot (and others)
}
-
-
-
-
diff --git a/src/mame/machine/raiden2cop.h b/src/mame/machine/raiden2cop.h
index 91ff1e7b41e..63db2eab45c 100644
--- a/src/mame/machine/raiden2cop.h
+++ b/src/mame/machine/raiden2cop.h
@@ -87,7 +87,7 @@ public:
DECLARE_WRITE16_MEMBER( cop_itoa_high_w );
DECLARE_WRITE16_MEMBER( cop_itoa_digit_count_w );
DECLARE_READ16_MEMBER ( cop_itoa_digits_r );
-
+
UINT32 cop_itoa;
UINT16 cop_itoa_digit_count;
UINT8 cop_itoa_digits[10];
@@ -122,14 +122,13 @@ public:
UINT32 cop_regs[8];
UINT16 cop_status, cop_scale, cop_angle, cop_dist;
-
+
UINT16 cop_angle_target;
UINT16 cop_angle_step;
struct colinfo {
-
colinfo()
{
pos[0] = pos[1] = pos[2] = 0;
@@ -140,7 +139,7 @@ public:
spradr = 0;
min[0] = min[1] = min[2] = 0;
max[0] = max[1] = max[2] = 0;
-
+
}
diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c
index 664c8cca9d2..edcaf1e7387 100644
--- a/src/mame/machine/seicop.c
+++ b/src/mame/machine/seicop.c
@@ -3,7 +3,7 @@
OLD Seibu Cop simulation code.
this is currently only used by the Seibu Cup Soccer BOOTLEG
-
+
*/
/********************************************************************************************
@@ -25,8 +25,6 @@ seibu_cop_bootleg_device::seibu_cop_bootleg_device(const machine_config &mconfig
m_cop_mcu_ram(NULL),
m_raiden2cop(*this, ":raiden2cop")
{
-
-
}
#define seibu_cop_log logerror
@@ -101,7 +99,7 @@ WRITE16_MEMBER( seibu_cop_bootleg_device::copdxbl_0_w )
break;
}
-
+
case (0x500/2):
case (0x502/2):
case (0x504/2):
@@ -152,7 +150,7 @@ WRITE16_MEMBER( seibu_cop_bootleg_device::copdxbl_0_w )
space.write_dword(m_raiden2cop->cop_regs[0] + 4 + offs, npos);
space.write_word(m_raiden2cop->cop_regs[0] + 0x1c + offs, space.read_word(m_raiden2cop->cop_regs[0] + 0x1c + offs) + delta);
-
+
break;
}
case 0x130e:
@@ -199,7 +197,7 @@ WRITE16_MEMBER( seibu_cop_bootleg_device::copdxbl_0_w )
break;
}
break;
-
+
/*TODO: kludge on x-axis.*/
case (0x660/2): { state->m_scrollram16[0] = m_cop_mcu_ram[offset] - 0x1f0; break; }
case (0x662/2): { state->m_scrollram16[1] = m_cop_mcu_ram[offset]; break; }
@@ -218,5 +216,3 @@ WRITE16_MEMBER( seibu_cop_bootleg_device::copdxbl_0_w )
}
}
}
-
-
diff --git a/src/mame/machine/seicop.h b/src/mame/machine/seicop.h
index 90419a5b290..f19b96e3312 100644
--- a/src/mame/machine/seicop.h
+++ b/src/mame/machine/seicop.h
@@ -30,4 +30,3 @@ extern const device_type SEIBU_COP_BOOTLEG;
#define MCFG_SEIBU_COP_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SEIBU_COP_BOOTLEG, 0)
-
diff --git a/src/mame/machine/st0016.c b/src/mame/machine/st0016.c
index e3da9499158..cc7c871c385 100644
--- a/src/mame/machine/st0016.c
+++ b/src/mame/machine/st0016.c
@@ -9,7 +9,7 @@ UINT8 macs_cart_slot;
static ADDRESS_MAP_START(st0016_cpu_internal_map, AS_PROGRAM, 8, st0016_cpu_device)
AM_RANGE(0xc000, 0xcfff) AM_READ(st0016_sprite_ram_r) AM_WRITE(st0016_sprite_ram_w)
- AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w)
+ AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w)
AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w)
AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w)
AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) /* sound regs 8 x $20 bytes, see notes */
@@ -29,22 +29,22 @@ ADDRESS_MAP_END
st0016_cpu_device::st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: z80_device(mconfig, ST0016_CPU, "ST0016", tag, owner, clock, "st0016_cpu", __FILE__),
- st0016_game(-1),
- st0016_spr_bank(0),
- st0016_spr2_bank(0),
- st0016_pal_bank(0),
- st0016_char_bank(0),
- spr_dx(0),
- spr_dy(0),
- st0016_ramgfx(0),
-
- m_io_space_config("io", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_io_map)),
- m_space_config("regs", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_map)),
-
-
- m_screen(*this, ":screen"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ st0016_game(-1),
+ st0016_spr_bank(0),
+ st0016_spr2_bank(0),
+ st0016_pal_bank(0),
+ st0016_char_bank(0),
+ spr_dx(0),
+ spr_dy(0),
+ st0016_ramgfx(0),
+
+ m_io_space_config("io", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_io_map)),
+ m_space_config("regs", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_map)),
+
+
+ m_screen(*this, ":screen"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette")
{
for (int i = 0; i < 0xc0; i++)
@@ -302,7 +302,7 @@ WRITE8_MEMBER(st0016_cpu_device::st0016_vregs_w)
UINT32 srcadr=(st0016_vregs[0xa0]|(st0016_vregs[0xa1]<<8)|(st0016_vregs[0xa2]<<16))<<1;
UINT32 dstadr=(st0016_vregs[0xa3]|(st0016_vregs[0xa4]<<8)|(st0016_vregs[0xa5]<<16))<<1;
UINT32 length=((st0016_vregs[0xa6]|(st0016_vregs[0xa7]<<8)|((st0016_vregs[0xa8]&0x1f)<<16))+1)<<1;
-
+
// todo : dma callback so macs_cart_slot can be local to MACs driver?
UINT32 srclen = (memregion(":maincpu")->bytes());
@@ -354,7 +354,7 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
o - sublist offset (*8 to get real offset)
f - end of list flag
x,y - sprite coords
-
+
(complete guess)
g - use tile sizes specified in list (global / fixed ones if not set?) (gostop)
X = global X size?
@@ -455,7 +455,7 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
sx += x;
sy += y;
color = st0016_spriteram[offset + 2] & 0x3f;
-
+
if (use_sizes)
{
lx = (st0016_spriteram[offset + 5] >> 2) & 3;
@@ -469,12 +469,12 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
}
/*
- if(plx |ply) //parent
- {
- lx=plx;
- ly=ply;
- }
- */
+ if(plx |ply) //parent
+ {
+ lx=plx;
+ ly=ply;
+ }
+ */
flipx = st0016_spriteram[offset + 3] & 0x80;
flipy = st0016_spriteram[offset + 3] & 0x40;
@@ -737,4 +737,3 @@ UINT32 st0016_cpu_device::update(screen_device &screen, bitmap_ind16 &bitmap, co
st0016_draw_screen(screen, bitmap, cliprect);
return 0;
}
-
diff --git a/src/mame/machine/st0016.h b/src/mame/machine/st0016.h
index 3b01ee9a290..3e137bcee47 100644
--- a/src/mame/machine/st0016.h
+++ b/src/mame/machine/st0016.h
@@ -53,7 +53,7 @@ public:
DECLARE_WRITE8_MEMBER(st0016_vregs_w);
DECLARE_READ8_MEMBER(soundram_read);
-
+
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
void st0016_save_init();
void draw_bgmap(bitmap_ind16 &bitmap,const rectangle &cliprect, int priority);
diff --git a/src/mame/machine/vectrex.c b/src/mame/machine/vectrex.c
index 4a5bbc5fb08..4cfd14046e9 100644
--- a/src/mame/machine/vectrex.c
+++ b/src/mame/machine/vectrex.c
@@ -328,11 +328,11 @@ void vectrex_state::machine_start()
m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x7fff, read8_delegate(FUNC(vectrex_cart_slot_device::read_rom),(vectrex_cart_slot_device*)m_cart));
// setup 3d imager and refresh timer
-
+
// If VIA T2 starts, reset refresh timer. This is the best strategy for most games.
m_reset_refresh = 1;
m_imager_angles = narrow_escape_angles;
-
+
// let's do this 3D detection
switch (m_cart->get_vec3d())
{
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index d618ddba1a3..41fb7942cf1 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -48,7 +48,7 @@ pacman // (c) 1980 Midway
pacmanf // hack
puckmod // (c) 1981 Namco
pacmod // (c) 1981 Midway
-pacmanjpm // bootleg
+pacmanjpm // bootleg
newpuc2 // hack
newpuc2b // hack
pacuman // bootleg
@@ -103,7 +103,7 @@ msheartb // hack
mspacmanbg // bootleg
mspacmanbgd // bootleg
mspacmanbcc // bootleg
-mspacmanblt // bootleg
+mspacmanblt // bootleg
woodpeck // (c) 1981 Amenip (Palcom Queen River)
woodpeca // (c) 1981 Amenip Nova Games Ltd.
mspacmab // bootleg
@@ -136,8 +136,8 @@ mschamps // hack (hack of the Rayglo hack?)
cannonbp // hack
superabc // hack
superabco // hack
-pengojpm // bootleg
-pengopac // bootleg
+pengojpm // bootleg
+pengopac // bootleg
// S2650 Pacman Kits
drivfrcp // (c) 1984 Shinkai Inc. (Magic Eletronics Inc. license)
@@ -333,7 +333,7 @@ ckongs // bootleg
froggers // bootleg
frogf // bootleg
quaak // bootleg
-froggeram // bootleg
+froggeram // bootleg
amidars // GX337 (c) 1982 Konami
triplep // (c) 1982 KKI / made by Sanritsu?
triplepa // (c) 1982 KKI / made by Sanritsu?
@@ -471,7 +471,7 @@ kickboy // (c) 1983
itaten // (c) 1984 + Alice
friskyt // (c) 1981
friskyta // (c) 1981
-friskytb // (c) 1981
+friskytb // (c) 1981
radrad // (c) 1982 Nichibutsu USA
seicross // (c) 1984 + Alice
sectrzon // (c) 1984 + Alice
@@ -693,7 +693,7 @@ phoenixb // (c) 1980 Amstar + Centuri license
phoenixt // (c) 1980 Taito
phoenixj // (c) 1980 Taito
phoenix3 // bootleg
-phoenixdal // bootleg D&L (No copyright/title)
+phoenixdal // bootleg D&L (No copyright/title)
phoenixc // bootleg
phoenixc2 // bootleg
phoenixc3 // bootleg
@@ -810,7 +810,7 @@ grobda3 // (c) 1984
gaplus // (c) 1984
gaplusa // (c) 1984
gaplusd // (c) 1984
-gaplust // (c) 1984
+gaplust // (c) 1984
galaga3 // (c) 1984
galaga3a // (c) 1984
galaga3b // (c) 1984
@@ -876,7 +876,7 @@ blazer // (c) 1987 (Japan)
quester // (c) 1987 (Japan)
questers // (c) 1987 (Japan)
pacmania // (c) 1987
-pacmaniao // (c) 1987
+pacmaniao // (c) 1987
pacmaniaj // (c) 1987 (Japan)
galaga88 // (c) 1987
galaga88a // (c) 1987
@@ -1166,7 +1166,7 @@ devzone2 // 8022 (c) [1980]
cheekyms // 8004 (c) [1980?]
zerohour // 8011 (c) Universal
zerohoura // 8011 (c) Universal
-zerohouri //
+zerohouri //
redclash // (c) 1981 Tehkan
redclasha // (c) 1981 Tehkan
redclashk // (c) Kaneko (bootleg?)
@@ -1244,8 +1244,8 @@ marioe // (c) 1983 Nintendo of America
marioo // (c) 1983 Nintendo of America
marioj // (c) 1983 Nintendo
masao // bootleg
-mariobl // bootleg
-dkong3abl //
+mariobl // bootleg
+dkong3abl //
pestplce // bootleg on donkey kong hw
spclforc // (c) 1985 Senko Industries (Magic Eletronics Inc. license)
spcfrcii // (c) 1985 Senko Industries (Magic Eletronics Inc. license)
@@ -1765,7 +1765,7 @@ motorace // (c) 1983 Williams license
mototour // (c) 1983 Tecfri
shtrider // (c) 1984 Seibu Kaihatsu
shtridera // (c) 1984 Seibu Kaihatsu
-shtriderb // bootleg
+shtriderb // bootleg
wilytowr // M63 (c) 1984
atomboy // M63 (c) 1985 Irem + Memetron license
atomboya // M63 (c) 1985 Irem + Memetron license
@@ -2133,7 +2133,7 @@ arktayt2 // bootleg
arkatour // ??? (c) 1987 Taito America Corporation + Romstar license (US)
tetrsark // ??? (c) D.R.Korea
hexa // D. R. Korea
-hexaa //
+hexaa //
brixian // (c) 1993 Cheil Computer System
sqix // B03 1987
sqixr1 // B03 1987
@@ -2678,7 +2678,7 @@ pzlbreak // (c) 1997 SemiCom
3in1semi // (c) 1998 SemiCom
moremore // (c) 1999 SemiCom + Exit
moremorp // (c) 1999 SemiCom + Exit
-suhosong // (c) 199? SemiCom
+suhosong // (c) 199? SemiCom
4in1boot // (c) 2002 KISoft (includes hacks of Semicom games + Snowbros)
// More Toaplan Games
@@ -3039,7 +3039,7 @@ toramich // 11/1987 (c) 1987 (Japan
tigeroadb // bootleg
f1dream // 4/1988 (c) 1988 + Romstar
f1dreamb // bootleg
-f1dreamba // bootleg
+f1dreamba // bootleg
1943kai // 6/1988 (c) 1987 (Japan)
lastduel // 7/1988 (c) 1988 (US)
lastduelo // 7/1988 (c) 1988 (US)
@@ -3364,7 +3364,7 @@ sfzhr1 // 27/06/1995 (c) 1995 (Hispanic)
sfzb // 09/11/1995 (c) 1995 (Brazil)
sfzbr1 // 27/07/1995 (c) 1995 (Brazil)
mmancp2u // 06/10/1995 (c) 1995 (USA)
-mmancp2ur1 // 26/09/1995 (c) 1995 (USA)
+mmancp2ur1 // 26/09/1995 (c) 1995 (USA)
rmancp2j // 22/09/1995 (c) 1995 (Japan)
msh // 24/10/1995 (c) 1995 (Euro)
mshu // 24/10/1995 (c) 1995 (USA)
@@ -4687,7 +4687,7 @@ pontoon
astormbl // BOOTLEG
astormb2 // BOOTLEG
shdancbl // BOOTLEG
-shdancbla // BOOTLEG
+shdancbla // BOOTLEG
mwalkbl // BOOTLEG
@@ -4812,7 +4812,7 @@ spidman // 1991.?? Spiderman (World)
spidmanu // 1991.09 Spiderman (US)
spidmanj // 1991.09 Spiderman (Japan)
f1en // 1991.?? F-1 Exhaust Note (World)
-f1enu // 1992.01 F-1 Exhaust Note (US)
+f1enu // 1992.01 F-1 Exhaust Note (US)
// 1991.11 F-1 Exhaust Note (Japan)
arabfgt // 1992.?? Arabian Fight (World)
arabfgtu // 1992.03 Arabian Fight (US)
@@ -5423,7 +5423,7 @@ radirgya // 2005.12.04 Radirgy (Rev A)
mushik2e // 2005.?? Mushiking The King Of Beetles II ENG (Ver. 1.001)
mushi2ea // 2005.?? Mushiking The King Of Beetles II ENG (Ver. 2.001)
// 2005.?? MushiKing The King Of Beetle III
-mushi2k5 // 2005.?? MushiKing The King Of Beetle 2K5 1st
+mushi2k5 // 2005.?? MushiKing The King Of Beetle 2K5 1st
kurucham // 2006.03 Kurukuru Chameleon
trgheart // 2006.05 Trigger Heart Exelica (Rev A)
zunou // 2006.07 Touch de Zunou
@@ -5482,7 +5482,7 @@ vf4c // 2002.01.31 Virtua Fighter 4 (Rev C) (cartridge)
kingrt66 // 2002.02 The King of Route 66 (Rev A)
// 2002.02.14 Initial D Arcade Stage (Japan)
initd // 2002.03 Initial D Arcade Stage (Japan) (Rev B)
-initdo // 2002.03 Initial D Arcade Stage (Japan)
+initdo // 2002.03 Initial D Arcade Stage (Japan)
// 2002.06 World Club Champion Football Serie A 2001-2002
soulsurf // 2002.07 Soul Surfer
initdexp // 2002.07.18 Initial D Arcade Stage (Export) (Rev A)
@@ -5893,8 +5893,8 @@ wndrplnt // (c) 1987 Data East Corporation (Japan)
chelnov // (c) 1988 Data East USA (World)
chelnovu // (c) 1988 Data East USA (US)
chelnovj // (c) 1988 Data East Corporation (Japan)
-chelnovjbl // bootleg
-chelnovjbla // bootleg
+chelnovjbl // bootleg
+chelnovjbla // bootleg
// the following ones all run on similar hardware
hbarrel // (c) 1987 Data East USA (US)
hbarrelw // (c) 1987 Data East Corporation (World)
@@ -6356,7 +6356,7 @@ simpsons // GX072 (c) 1991
simpsons4pa // GX072 (c) 1991
simpsons2p // GX072 (c) 1991
simpsons2p2 // GX072 (c) 1991
-simpsons2p3 // GX072 (c) 1991
+simpsons2p3 // GX072 (c) 1991
simpsons2pa // GX072 (c) 1991 (Asia)
simpsons2pj // GX072 (c) 1991 (Japan)
esckids // GX975 (c) 1991 (Asia)
@@ -6364,7 +6364,7 @@ esckidsj // GX975 (c) 1991 (Japan)
vendetta // GX081 (c) 1991 (World)
vendettar // GX081 (c) 1991 (World)
vendetta2p // GX081 (c) 1991 (World)
-vendetta2peba // GX081 (c) 1991 (World)
+vendetta2peba // GX081 (c) 1991 (World)
vendetta2pu // GX081 (c) 1991 (Asia)
vendetta2pd // GX081 (c) 1991 (Asia)
vendettaj // GX081 (c) 1991 (Japan)
@@ -7936,7 +7936,7 @@ bigbang // UPL-93091 (c) 1993 NMK
tdragon // (c) 1991 NMK / Tecmo
tdragon1 // (c) 1991 NMK / Tecmo
hachamf // (c) 1991 NMK
-hachamfb // bootleg
+hachamfb // bootleg
macross // (c) 1992 Banpresto
riot // (c) 1992 NMK
gunnail // (c) 1993 NMK / Tecmo
@@ -8345,7 +8345,7 @@ goodejan // (c) 1991 Seibu/Tecmo
goodejana // (c) 1991 Seibu/Tecmo
raiden2 // (c) 1993 Seibu Kaihatsu + Fabtek license
-raiden2u // (c) 1993 Seibu Kaihatsu + Fabtek license
+raiden2u // (c) 1993 Seibu Kaihatsu + Fabtek license
raiden2hk // (c) 1993 Seibu Kaihatsu + Metrotainment license
raiden2j // (c) 1993 Seibu Kaihatsu
raiden2i // (c) 1993 Seibu Kaihatsu
@@ -8354,8 +8354,8 @@ raiden2ea // (c) 1993 Seibu Kaihatsu
raiden2eu // (c) 1993 Seibu Kaihatsu + Fabtek license
raiden2eua // (c) 1993 Seibu Kaihatsu + Fabtek license
raiden2nl // (c) 1993 Seibu Kaihatsu
-raiden2g // (c) 1993 Seibu Kaihatsu + Tuning license
-raiden2dx // (c) 1993 Seibu Kaihatsu
+raiden2g // (c) 1993 Seibu Kaihatsu + Tuning license
+raiden2dx // (c) 1993 Seibu Kaihatsu
raidendx // (c) 1994 Seibu Kaihatsu
raidendxk // (c) 1994 Seibu Kaihatsu
@@ -8377,7 +8377,7 @@ xsedae // (c) 1995 Dream Island
// Newer V33 PCB with COP3 protection
r2dx_v33 // (c) 1996 Seibu Kaihatsu
-r2dx_v33_r2 // (c) 1996 Seibu Kaihatsu
+r2dx_v33_r2 // (c) 1996 Seibu Kaihatsu
nzeroteam // (c) 1997 Seibu Kaihatsu
zerotm2k // (c) 2000 Seibu Kaihatsu
@@ -8687,7 +8687,7 @@ tengai // (c) 1996
tengaij // (c) 1996
// Semicom games on "Psikyo 68020"-like hardware
baryon // (c) 1997 SemiCom
-baryona // (c) 1997 SemiCom
+baryona // (c) 1997 SemiCom
dreamwld // (c) 2000 SemiCom
rolcrush // (c) 1999 Trust
@@ -9061,7 +9061,7 @@ koikois // (c) 1995 Seta
nratechu // (c) 1996 Seta
dcrown // 199? unknown
dcrowna // 199? unknown
-gostop // 2001 Visco
+gostop // 2001 Visco
// R3000 + ST-0016
srmp5 // (c) 199? Seta
speglsht // (c) 1994 Seta
@@ -9223,7 +9223,7 @@ fantasia // (c) 1994 Comad & New Japan System
fantasiaa // (c) 1994 Comad & New Japan System
fantasiab // (c) 1994 Comad & New Japan System
supmodel // (c) 1994 Comad & New Japan System
-fantasian //
+fantasian //
newfant // (c) 1994 Comad & New Japan System
newfanta // (c) 1995 Comad & New Japan System
fantsy95 // (c) 1995 Hi-max Technology Inc.
@@ -9708,7 +9708,7 @@ orlegende //
orlegendc //
orlegendca //
orlegend111c //
-orlegend111t //
+orlegend111t //
orlegend105k //
drgw2 // (c) 1997 Dragon World 2
dw2v100x //
@@ -10312,9 +10312,9 @@ eggventr7 // (c) 1997 The Game Room
eggventr2 // (c) 1997 The Game Room
eggventra // (c) 1997 The Game Room (Allied Leisure license)
eggventrd // (c) 1997 The Game Room
-hostinv // (c) 1998 The Game Room
+hostinv // (c) 1998 The Game Room
calchase // (c) 1999 The Game Room
-eggsplc // (c) 2002 The Game Room
+eggsplc // (c) 2002 The Game Room
ripribit // (c) 1997 LAI Games
cfarm // (c) 1999 LAI Games
cclownz // (c) 1999 LAI Games
diff --git a/src/mame/mame.mak b/src/mame/mame.mak
index 9682fa710cf..a316b3493d3 100644
--- a/src/mame/mame.mak
+++ b/src/mame/mame.mak
@@ -1210,7 +1210,7 @@ $(MAMEOBJ)/igs.a: \
$(DRIVERS)/igs_m036.o \
$(DRIVERS)/iqblock.o $(VIDEO)/iqblock.o \
$(DRIVERS)/lordgun.o $(VIDEO)/lordgun.o \
- $(DRIVERS)/pgm.o $(VIDEO)/pgm.o $(MACHINE)/pgmprot_igs027a_type1.o $(MACHINE)/pgmprot_igs027a_type2.o $(MACHINE)/pgmprot_igs027a_type3.o $(MACHINE)/pgmprot_igs025_igs012.o $(MACHINE)/pgmprot_igs025_igs022.o $(MACHINE)/pgmprot_igs025_igs028.o $(MACHINE)/pgmprot_orlegend.o \
+ $(DRIVERS)/pgm.o $(VIDEO)/pgm.o $(MACHINE)/pgmprot_igs027a_type1.o $(MACHINE)/pgmprot_igs027a_type2.o $(MACHINE)/pgmprot_igs027a_type3.o $(MACHINE)/pgmprot_igs025_igs012.o $(MACHINE)/pgmprot_igs025_igs022.o $(MACHINE)/pgmprot_igs025_igs028.o $(MACHINE)/pgmprot_orlegend.o \
$(DRIVERS)/pgm2.o \
$(DRIVERS)/spoker.o \
$(MACHINE)/igs036crypt.o \
diff --git a/src/mame/video/antic.c b/src/mame/video/antic.c
index ae247c135fe..f6db0390f6d 100644
--- a/src/mame/video/antic.c
+++ b/src/mame/video/antic.c
@@ -58,11 +58,11 @@ void antic_device::device_start()
{
m_gtia = machine().device<gtia_device>(m_gtia_tag);
assert(m_gtia);
-
+
m_bitmap = auto_bitmap_ind16_alloc(machine(), machine().first_screen()->width(), machine().first_screen()->height());
-
+
m_cclk_expand = auto_alloc_array_clear(machine(), UINT32, 21 * 256);
-
+
m_pf_21 = &m_cclk_expand[ 0 * 256];
m_pf_x10b = &m_cclk_expand[ 1 * 256];
m_pf_3210b2 = &m_cclk_expand[ 3 * 256];
@@ -72,11 +72,11 @@ void antic_device::device_start()
m_pf_gtia1 = &m_cclk_expand[18 * 256];
m_pf_gtia2 = &m_cclk_expand[19 * 256];
m_pf_gtia3 = &m_cclk_expand[20 * 256];
-
+
m_used_colors = auto_alloc_array(machine(), UINT8, 21 * 256);
-
+
memset(m_used_colors, 0, 21 * 256 * sizeof(UINT8));
-
+
m_uc_21 = &m_used_colors[ 0 * 256];
m_uc_x10b = &m_used_colors[ 1 * 256];
m_uc_3210b2 = &m_used_colors[ 3 * 256];
@@ -86,24 +86,24 @@ void antic_device::device_start()
m_uc_g1 = &m_used_colors[18 * 256];
m_uc_g2 = &m_used_colors[19 * 256];
m_uc_g3 = &m_used_colors[20 * 256];
-
+
LOG(("atari cclk_init\n"));
cclk_init();
-
+
for (int i = 0; i < 64; i++)
m_prio_table[i] = auto_alloc_array_clear(machine(), UINT8, 8*256);
-
+
LOG(("atari prio_init\n"));
prio_init();
-
+
for (int i = 0; i < machine().first_screen()->height(); i++)
m_video[i] = auto_alloc_clear(machine(), VIDEO);
-
+
/* save states */
save_pointer(NAME((UINT8 *) &m_r), sizeof(m_r));
save_pointer(NAME((UINT8 *) &m_w), sizeof(m_w));
// TODO: save VIDEO items
-
+
save_item(NAME(m_tv_artifacts));
save_item(NAME(m_render1));
save_item(NAME(m_render2));
@@ -556,7 +556,7 @@ void antic_device::prio_init()
{
int i, j, pm, p, c;
const UINT8 * prio;
-
+
/* 32 priority bit combinations */
for( i = 0; i < 32; i++ )
{
@@ -575,10 +575,10 @@ void antic_device::prio_init()
}
m_prio_table[i][(j << 8) + pm] = c;
if( (c==PL0 || c==P000 || c==P001 || c==P010 || c==P011) &&
- (pm & (P0+P1))==(P0+P1))
+ (pm & (P0+P1))==(P0+P1))
c = EOR;
if( (c==PL2 || c==P200 || c==P201 || c==P210 || c==P211) &&
- (pm & (P2+P3))==(P2+P3))
+ (pm & (P2+P3))==(P2+P3))
c = EOR;
m_prio_table[32 + i][(j << 8) + pm] = c;
}
@@ -598,7 +598,7 @@ void antic_device::cclk_init()
static const UINT8 _pf_310b[4] = {PBK,PF0,PF1,PF3};
int i;
UINT8 * dst;
-
+
/* setup color translation for the ANTIC modes */
for( i = 0; i < 256; i++ )
{
@@ -608,7 +608,7 @@ void antic_device::cclk_init()
*dst++ = _pf_21[(i>>4)&3];
*dst++ = _pf_21[(i>>2)&3];
*dst++ = _pf_21[(i>>0)&3];
-
+
/****** 4 color text (4,5) with pf2, D, E **********/
dst = (UINT8 *)&m_pf_x10b[0x000+i];
*dst++ = _pf_210b[(i>>6)&3];
@@ -620,7 +620,7 @@ void antic_device::cclk_init()
*dst++ = _pf_310b[(i>>4)&3];
*dst++ = _pf_310b[(i>>2)&3];
*dst++ = _pf_310b[(i>>0)&3];
-
+
/****** pf0 color text (6,7), 9, B, C **********/
dst = (UINT8 *)&m_pf_3210b2[0x000+i*2];
*dst++ = (i&0x80)?PF0:PBK;
@@ -631,7 +631,7 @@ void antic_device::cclk_init()
*dst++ = (i&0x04)?PF0:PBK;
*dst++ = (i&0x02)?PF0:PBK;
*dst++ = (i&0x01)?PF0:PBK;
-
+
/****** pf1 color text (6,7), 9, B, C **********/
dst = (UINT8 *)&m_pf_3210b2[0x200+i*2];
*dst++ = (i&0x80)?PF1:PBK;
@@ -642,7 +642,7 @@ void antic_device::cclk_init()
*dst++ = (i&0x04)?PF1:PBK;
*dst++ = (i&0x02)?PF1:PBK;
*dst++ = (i&0x01)?PF1:PBK;
-
+
/****** pf2 color text (6,7), 9, B, C **********/
dst = (UINT8 *)&m_pf_3210b2[0x400+i*2];
*dst++ = (i&0x80)?PF2:PBK;
@@ -653,7 +653,7 @@ void antic_device::cclk_init()
*dst++ = (i&0x04)?PF2:PBK;
*dst++ = (i&0x02)?PF2:PBK;
*dst++ = (i&0x01)?PF2:PBK;
-
+
/****** pf3 color text (6,7), 9, B, C **********/
dst = (UINT8 *)&m_pf_3210b2[0x600+i*2];
*dst++ = (i&0x80)?PF3:PBK;
@@ -664,7 +664,7 @@ void antic_device::cclk_init()
*dst++ = (i&0x04)?PF3:PBK;
*dst++ = (i&0x02)?PF3:PBK;
*dst++ = (i&0x01)?PF3:PBK;
-
+
/****** 4 color graphics 4 cclks (8) **********/
dst = (UINT8 *)&m_pf_210b4[i*4];
*dst++ = _pf_210b[(i>>6)&3];
@@ -683,7 +683,7 @@ void antic_device::cclk_init()
*dst++ = _pf_210b[(i>>0)&3];
*dst++ = _pf_210b[(i>>0)&3];
*dst++ = _pf_210b[(i>>0)&3];
-
+
/****** 4 color graphics 2 cclks (A) **********/
dst = (UINT8 *)&m_pf_210b2[i*2];
*dst++ = _pf_210b[(i>>6)&3];
@@ -694,43 +694,43 @@ void antic_device::cclk_init()
*dst++ = _pf_210b[(i>>2)&3];
*dst++ = _pf_210b[(i>>0)&3];
*dst++ = _pf_210b[(i>>0)&3];
-
+
/****** high resolution graphics (F) **********/
dst = (UINT8 *)&m_pf_1b[i];
*dst++ = _pf_1b[(i>>6)&3];
*dst++ = _pf_1b[(i>>4)&3];
*dst++ = _pf_1b[(i>>2)&3];
*dst++ = _pf_1b[(i>>0)&3];
-
+
/****** gtia mode 1 **********/
dst = (UINT8 *)&m_pf_gtia1[i];
*dst++ = GT1+((i>>4)&15);
*dst++ = GT1+((i>>4)&15);
*dst++ = GT1+(i&15);
*dst++ = GT1+(i&15);
-
+
/****** gtia mode 2 **********/
dst = (UINT8 *)&m_pf_gtia2[i];
*dst++ = GT2+((i>>4)&15);
*dst++ = GT2+((i>>4)&15);
*dst++ = GT2+(i&15);
*dst++ = GT2+(i&15);
-
+
/****** gtia mode 3 **********/
dst = (UINT8 *)&m_pf_gtia3[i];
*dst++ = GT3+((i>>4)&15);
*dst++ = GT3+((i>>4)&15);
*dst++ = GT3+(i&15);
*dst++ = GT3+(i&15);
-
+
}
-
+
/* setup used color tables */
for( i = 0; i < 256; i++ )
{
/* used colors in text modes 2,3 */
m_uc_21[i] = (i) ? PF2 | PF1 : PF2;
-
+
/* used colors in text modes 4,5 and graphics modes D,E */
switch( i & 0x03 )
{
@@ -756,7 +756,7 @@ void antic_device::cclk_init()
case 0x80: m_uc_x10b[0x000+i] |= PF1; m_uc_x10b[0x100+i] |= PF1; break;
case 0xc0: m_uc_x10b[0x000+i] |= PF2; m_uc_x10b[0x100+i] |= PF3; break;
}
-
+
/* used colors in text modes 6,7 and graphics modes 9,B,C */
if( i )
{
@@ -765,7 +765,7 @@ void antic_device::cclk_init()
m_uc_3210b2[0x400+i*2] |= PF2;
m_uc_3210b2[0x600+i*2] |= PF3;
}
-
+
/* used colors in graphics mode 8 */
switch( i & 0x03 )
{
@@ -791,7 +791,7 @@ void antic_device::cclk_init()
case 0x80: m_uc_210b4[i*4] |= PF1; break;
case 0xc0: m_uc_210b4[i*4] |= PF2; break;
}
-
+
/* used colors in graphics mode A */
switch( i & 0x03 )
{
@@ -817,11 +817,11 @@ void antic_device::cclk_init()
case 0x80: m_uc_210b2[i*2] |= PF1; break;
case 0xc0: m_uc_210b2[i*2] |= PF2; break;
}
-
+
/* used colors in graphics mode F */
if( i )
m_uc_1b[i] |= PF1;
-
+
/* used colors in GTIA graphics modes */
/* GTIA 1 is 16 different luminances with hue of colbk */
m_uc_g1[i] = 0x00;
@@ -838,7 +838,7 @@ void antic_device::cclk_init()
case 0x07: m_uc_g2[i] = 0x08; break;
default: m_uc_g2[i] = 0x00;
}
-
+
/* GTIA 3 is 16 different hues with luminance of colbk */
m_uc_g3[i] = 0x00;
}
@@ -1293,16 +1293,16 @@ void antic_device::render(address_space &space, int param1, int param2, int para
{
VIDEO *video = m_video[m_scanline];
int add_bytes = 0, erase = 0;
-
+
if (param3 == 0 || param2 <= 1)
{
mode_0(space, video);
return;
}
-
+
if ((param3 == 1 || param3 == 2) && param1)
param3++;
-
+
switch (param3)
{
case 1:
@@ -1318,7 +1318,7 @@ void antic_device::render(address_space &space, int param1, int param2, int para
erase = 0;
break;
}
-
+
switch (param2)
{
case 0x02:
@@ -1387,10 +1387,10 @@ UINT32 antic_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
UINT32 new_tv_artifacts = screen.ioport("artifacts")->read_safe(0);
copybitmap(bitmap, *m_bitmap, 0, 0, 0, 0, cliprect);
-
+
if (m_tv_artifacts != new_tv_artifacts)
m_tv_artifacts = new_tv_artifacts;
-
+
return 0;
}
@@ -1404,7 +1404,7 @@ void antic_device::artifacts_gfx(UINT8 *src, UINT8 *dst, int width)
UINT8 atari_C = b + c;
UINT8 atari_D = m_gtia->get_w_colbk();
UINT16 *color_lookup = m_gtia->get_color_lookup();
-
+
for (int x = 0; x < width * 4; x++)
{
n = *src++;
@@ -1478,7 +1478,7 @@ void antic_device::artifacts_txt(UINT8 * src, UINT8 * dst, int width)
UINT8 atari_C = b+c;
UINT8 atari_D = m_gtia->get_w_colpf2();
UINT16 *color_lookup = m_gtia->get_color_lookup();
-
+
for (int x = 0; x < width * 4; x++)
{
n = *src++;
@@ -1550,7 +1550,7 @@ void antic_device::linerefresh()
UINT32 *dst;
UINT32 scanline[4 + (HCHARS * 2) + 4];
UINT16 *color_lookup = m_gtia->get_color_lookup();
-
+
/* increment the scanline */
if( ++m_scanline == machine().first_screen()->height() )
{
@@ -1560,14 +1560,14 @@ void antic_device::linerefresh()
/* count frames gone since last write to hitclr */
m_gtia->count_hitclr_frames();
}
-
+
if( m_scanline < MIN_Y || m_scanline > MAX_Y )
return;
-
+
y = m_scanline - MIN_Y;
src = &m_cclock[PMOFFSET - m_hscrol_old + 12];
dst = scanline;
-
+
if( m_tv_artifacts )
{
if( (m_cmd & 0x0f) == 2 || (m_cmd & 0x0f) == 3 )
@@ -1648,12 +1648,12 @@ void antic_device::linerefresh()
dst[1] = color_lookup[PBK] | color_lookup[PBK] << 16;
dst[2] = color_lookup[PBK] | color_lookup[PBK] << 16;
dst[3] = color_lookup[PBK] | color_lookup[PBK] << 16;
-
+
draw_scanline8(*m_bitmap, 12, y, MIN(m_bitmap->width() - 12, sizeof(scanline)), (const UINT8 *) scanline, NULL);
}
-#define ANTIC_TIME_FROM_CYCLES(cycles) \
+#define ANTIC_TIME_FROM_CYCLES(cycles) \
(attotime)(machine().first_screen()->scan_period() * (cycles) / CYCLES_PER_LINE)
void antic_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
@@ -1714,7 +1714,7 @@ TIMER_CALLBACK_MEMBER( antic_device::line_done )
LOG((" @cycle #%3d release CPU\n", cycle()));
/* release the CPU (held for emulating cycles stolen by ANTIC DMA) */
machine().scheduler().trigger(TRIGGER_STEAL);
-
+
/* refresh the display (translate color clocks to pixels) */
linerefresh();
}
@@ -1748,11 +1748,11 @@ TIMER_CALLBACK_MEMBER( antic_device::steal_cycles )
TIMER_CALLBACK_MEMBER( antic_device::scanline_render )
{
address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
-
+
LOG((" @cycle #%3d render mode $%X lines to go #%d\n", cycle(), (m_cmd & 0x0f), m_modelines));
-
+
render(space, m_render1, m_render2, m_render3);
-
+
/* if player/missile graphics is enabled */
if( m_scanline < 256 && (m_w.dmactl & (DMA_PLAYER|DMA_MISSILE)) )
{
@@ -1796,10 +1796,10 @@ TIMER_CALLBACK_MEMBER( antic_device::scanline_render )
}
}
}
-
+
if (m_scanline >= VBL_END && m_scanline < 256)
m_gtia->render((UINT8 *)m_pmbits + PMOFFSET, (UINT8 *)m_cclock + PMOFFSET - m_hscrol_old, (UINT8 *)m_prio_table[m_gtia->get_w_prior() & 0x3f], (UINT8 *)&m_pmbits);
-
+
m_steal_cycles += CYCLES_REFRESH;
LOG((" run CPU for %d cycles\n", CYCLES_HSYNC - CYCLES_HSTART - m_steal_cycles));
timer_set(ANTIC_TIME_FROM_CYCLES(CYCLES_HSYNC - CYCLES_HSTART - m_steal_cycles), TIMER_CYCLE_STEAL);
@@ -1856,7 +1856,7 @@ void antic_device::scanline_dma(int param)
m_render3 = m_w.dmactl & 3;
UINT8 vscrol_subtract = 0;
UINT8 new_cmd;
-
+
new_cmd = RDANTIC(space);
m_doffs = (m_doffs + 1) & DOFFS;
/* steal at one clock cycle from the CPU for fetching the command */
@@ -1894,7 +1894,7 @@ void antic_device::scanline_dma(int param)
}
/* Set the ANTIC mode renderer function */
m_render2 = new_cmd & ANTIC_MODE;
-
+
switch( new_cmd & ANTIC_MODE )
{
case 0x00:
@@ -2048,11 +2048,11 @@ void antic_device::scanline_dma(int param)
m_render2 = 0;
m_render3 = 0;
}
-
+
m_r.nmist &= ~DLI_NMI;
if (m_modelines == 1 && (m_cmd & m_w.nmien & DLI_NMI))
timer_set(ANTIC_TIME_FROM_CYCLES(CYCLES_DLI_NMI), TIMER_ISSUE_DLI);
-
+
timer_set(ANTIC_TIME_FROM_CYCLES(CYCLES_HSTART), TIMER_LINE_REND);
}
@@ -2068,24 +2068,24 @@ void antic_device::scanline_dma(int param)
void antic_device::generic_interrupt(int button_count)
{
LOG(("ANTIC #%3d @cycle #%d scanline interrupt\n", m_scanline, cycle()));
-
+
if( m_scanline < VBL_START )
{
scanline_dma(0);
return;
}
-
+
if( m_scanline == VBL_START )
{
/* specify buttons relevant to this Atari variant */
m_gtia->button_interrupt(button_count, machine().root_device().ioport("djoy_b")->read_safe(0));
-
+
/* do nothing new for the rest of the frame */
m_modelines = machine().first_screen()->height() - VBL_START;
m_render1 = 0;
m_render2 = 0;
m_render3 = 0;
-
+
/* if the CPU want's to be interrupted at vertical blank... */
if( m_w.nmien & VBL_NMI )
{
@@ -2095,8 +2095,7 @@ void antic_device::generic_interrupt(int button_count)
machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
-
+
/* refresh the display (translate color clocks to pixels) */
linerefresh();
}
-
diff --git a/src/mame/video/antic.h b/src/mame/video/antic.h
index 2c9bc380720..bc042ea6238 100644
--- a/src/mame/video/antic.h
+++ b/src/mame/video/antic.h
@@ -3,7 +3,7 @@
Atari 400/800
ANTIC video controller
-
+
Juergen Buchmueller, June 1998
***************************************************************************/
@@ -293,12 +293,11 @@
m_w.chbasl++
/* erase a number of color clocks to background color PBK */
-#define ERASE(size) \
- for (int i = 0; i < size; i++) \
- { \
+#define ERASE(size) \
+ for (int i = 0; i < size; i++) \
+ { \
*dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK; \
- } \
-
+ }
#define ZAP48() \
dst = (UINT32 *)&antic.cclock[PMOFFSET]; \
dst[ 0] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK; \
@@ -309,11 +308,10 @@
dst[47] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK
#define REP(FUNC, size) \
- for (int i = 0; i < size; i++) \
- { \
- FUNC(i); \
- } \
-
+ for (int i = 0; i < size; i++) \
+ { \
+ FUNC(i); \
+ }
struct ANTIC_R {
@@ -379,7 +377,7 @@ public:
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void generic_interrupt(int button_count);
-
+
private:
static const device_timer_id TIMER_CYCLE_STEAL = 0;
static const device_timer_id TIMER_ISSUE_DLI = 1;
@@ -454,7 +452,7 @@ private:
UINT8 *m_uc_g2; /* used colors for gfx GTIA 2 */
UINT8 *m_uc_g3; /* used colors for gfx GTIA 3 */
bitmap_ind16 *m_bitmap;
-
+
void prio_init();
void cclk_init();
diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c
index c1a0e45c95f..1187f6fbc2e 100644
--- a/src/mame/video/battlera.c
+++ b/src/mame/video/battlera.c
@@ -1,2 +1 @@
// delete me
-
diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h
index 54405fb3683..e7d5013b03f 100644
--- a/src/mame/video/decmxc06.h
+++ b/src/mame/video/decmxc06.h
@@ -16,7 +16,7 @@ public:
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask );
void draw_sprites_bootleg( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask );
void set_pri_type( int type ) { m_priority_type = type; }
-
+
protected:
virtual void device_start();
virtual void device_reset();
diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c
index e211fc004bf..96c913041dd 100644
--- a/src/mame/video/dooyong.c
+++ b/src/mame/video/dooyong.c
@@ -224,8 +224,7 @@ inline void dooyong_state::lastday_get_tile_info(tile_data &tileinfo, int tile_i
flags = ((attr & 0x02) ? TILE_FLIPX : 0) | ((attr & 0x04) ? TILE_FLIPY : 0);
}
else
- {
-
+ {
/* primella */
/* Tiles take two bytes in ROM:
MSB LSB
@@ -237,7 +236,7 @@ inline void dooyong_state::lastday_get_tile_info(tile_data &tileinfo, int tile_i
Y = y flip */
int codemask = 0x03;
int palmask = 0x3c;
-
+
if (m_gfxdecode->gfx(1)->depth() == 256) // pop bingo has an 8bpp layer and uses what would be the low palette bit to address more tiles (girls 4,5,6 in bonus game)
{
codemask = 0x07;
diff --git a/src/mame/video/fuukifg.c b/src/mame/video/fuukifg.c
index 017dc061065..eeb0ee29454 100644
--- a/src/mame/video/fuukifg.c
+++ b/src/mame/video/fuukifg.c
@@ -1,4 +1,4 @@
-/*
+/*
*/
#include "emu.h"
@@ -65,7 +65,7 @@ void fuukivid_device::device_reset()
6.w Tile Code
- for FG3 hardware
+ for FG3 hardware
6.w fe-- ---- ---- ---- Tile Bank
--dc ba98 7654 3210 Tile Code
@@ -180,4 +180,4 @@ void fuukivid_device::buffer_sprites(void)
{
memcpy(m_sprram_old2, m_sprram_old, 0x2000);
memcpy(m_sprram_old, m_sprram, 0x2000);
-} \ No newline at end of file
+}
diff --git a/src/mame/video/fuukifg.h b/src/mame/video/fuukifg.h
index fd7a86714df..8db1c87353c 100644
--- a/src/mame/video/fuukifg.h
+++ b/src/mame/video/fuukifg.h
@@ -9,10 +9,10 @@ public:
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
-
+
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flip_screen, UINT32* tilebank);
UINT16* m_sprram;
- UINT16* m_sprram_old;
+ UINT16* m_sprram_old;
UINT16* m_sprram_old2;
@@ -25,7 +25,7 @@ public:
{
return m_sprram[offset];
}
-
+
void buffer_sprites(void);
protected:
@@ -40,4 +40,3 @@ extern const device_type FUUKI_VIDEO;
#define MCFG_FUUKI_VIDEO_GFXDECODE(_gfxtag) \
fuukivid_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
-
diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c
index 1337c149d2a..1cc275caa40 100644
--- a/src/mame/video/fuukifg3.c
+++ b/src/mame/video/fuukifg3.c
@@ -90,8 +90,8 @@ WRITE32_MEMBER(fuuki32_state::fuuki32_vram_3_w){ fuuki32_vram_w(offset, data, me
void fuuki32_state::video_start()
{
-// m_buf_spriteram = auto_alloc_array(machine(), UINT32, m_spriteram.bytes() / 4);
-// m_buf_spriteram2 = auto_alloc_array(machine(), UINT32, m_spriteram.bytes() / 4);
+// m_buf_spriteram = auto_alloc_array(machine(), UINT32, m_spriteram.bytes() / 4);
+// m_buf_spriteram2 = auto_alloc_array(machine(), UINT32, m_spriteram.bytes() / 4);
diff --git a/src/mame/video/gtia.c b/src/mame/video/gtia.c
index ec73fb16f15..d4cfab69181 100644
--- a/src/mame/video/gtia.c
+++ b/src/mame/video/gtia.c
@@ -131,7 +131,7 @@ void gtia_device::device_start()
{
m_read_cb.resolve();
m_write_cb.resolve();
-
+
save_item(NAME(m_r.m0pf));
save_item(NAME(m_r.m1pf));
save_item(NAME(m_r.m2pf));
@@ -218,7 +218,7 @@ void gtia_device::device_start()
save_item(NAME(m_h.vdelay_p1));
save_item(NAME(m_h.vdelay_p2));
save_item(NAME(m_h.vdelay_p3));
-
+
save_item(NAME(m_lumpf1));
save_item(NAME(m_huepm0));
save_item(NAME(m_huepm1));
@@ -226,9 +226,9 @@ void gtia_device::device_start()
save_item(NAME(m_huepm3));
save_item(NAME(m_huepm4));
save_item(NAME(m_huepf2));
- save_item(NAME(m_huebk));
+ save_item(NAME(m_huebk));
- save_item(NAME(m_color_lookup));
+ save_item(NAME(m_color_lookup));
machine().save().register_postload(save_prepost_delegate(FUNC(gtia_device::gtia_postload), this));
}
@@ -291,14 +291,14 @@ void gtia_device::button_interrupt(int button_count, UINT8 button_port)
m_r.but[i] = 1;
m_r.but[i] &= BIT(button_port, i);
}
-
+
/* button registers for xl/xe */
if (button_count == 2)
{
m_r.but[2] = 1; /* not used on xl/xe */
m_r.but[3] = 0; /* 1 if external cartridge is inserted */
}
-
+
}
@@ -967,7 +967,7 @@ void gtia_device::render(UINT8 *src, UINT8 *dst, UINT8 *prio, UINT8 *pmbits)
player_render(m_h.grafp2, m_w.sizep2 + 1, GTIA_P2, &pmbits[m_w.hposp2]);
if (m_h.grafp3)
player_render(m_h.grafp3, m_w.sizep3 + 1, GTIA_P3, &pmbits[m_w.hposp3]);
-
+
if (m_h.grafm0)
missile_render(m_h.grafm0, m_w.sizem + 1, GTIA_M0, &pmbits[m_w.hposm0]);
if (m_h.grafm1)
diff --git a/src/mame/video/gtia.h b/src/mame/video/gtia.h
index 7787e1a6588..26455895028 100644
--- a/src/mame/video/gtia.h
+++ b/src/mame/video/gtia.h
@@ -127,10 +127,10 @@ class gtia_device : public device_t
public:
// construction/destruction
gtia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
template<class _Object> static devcb_base &set_read_callback(device_t &device, _Object object) { return downcast<gtia_device &>(device).m_read_cb.set_callback(object); }
template<class _Object> static devcb_base &set_write_callback(device_t &device, _Object object) { return downcast<gtia_device &>(device).m_write_cb.set_callback(object); }
-
+
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -143,16 +143,16 @@ public:
UINT8 get_w_prior() { return m_w.prior; }
void count_hitclr_frames() { m_h.hitclr_frames++; }
void button_interrupt(int button_count, UINT8 button_port);
-
+
void render(UINT8 *src, UINT8 *dst, UINT8 *pmbits, UINT8 *prio);
-
+
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
void gtia_postload();
-
+
int is_ntsc();
void recalc_p0();
void recalc_p1();
@@ -162,21 +162,21 @@ protected:
void recalc_m1();
void recalc_m2();
void recalc_m3();
-
+
inline void player_render(UINT8 gfx, int size, UINT8 color, UINT8 *dst);
inline void missile_render(UINT8 gfx, int size, UINT8 color, UINT8 *dst);
-
+
private:
gtia_readregs m_r; /* read registers */
gtia_writeregs m_w; /* write registers */
gtia_helpervars m_h; /* helper variables */
-
+
UINT8 m_lumpf1;
UINT8 m_huepm0, m_huepm1, m_huepm2, m_huepm3, m_huepm4;
UINT8 m_huepf2, m_huebk;
-
- UINT16 m_color_lookup[256]; /* color lookup table */ // probably better fit to ANTIC, but it remains here for the moment...
-
+
+ UINT16 m_color_lookup[256]; /* color lookup table */ // probably better fit to ANTIC, but it remains here for the moment...
+
devcb_read8 m_read_cb;
devcb_write8 m_write_cb;
};
diff --git a/src/mame/video/k054156_k054157_k056832.c b/src/mame/video/k054156_k054157_k056832.c
index 7e3aa03de1e..1fc1f05ce21 100644
--- a/src/mame/video/k054156_k054157_k056832.c
+++ b/src/mame/video/k054156_k054157_k056832.c
@@ -1269,7 +1269,7 @@ int k056832_device::update_linemap( screen_device &screen, _BitmapClass &bitmap,
*/
{
bitmap_ind16 *pixmap;
-
+
UINT8 code_transparent, code_opaque;
const pen_t *pal_ptr;
const UINT8 *src_ptr;
diff --git a/src/mame/video/legionna.c b/src/mame/video/legionna.c
index 00bc607b293..60bdc8c2fee 100644
--- a/src/mame/video/legionna.c
+++ b/src/mame/video/legionna.c
@@ -63,10 +63,10 @@ WRITE16_MEMBER(legionna_state::denjinmk_setgfxbank)
WRITE16_MEMBER(legionna_state::videowrite_cb_w)
{
- // AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
- // AM_RANGE(0x101800, 0x101fff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
- // AM_RANGE(0x102000, 0x1027ff) AM_RAM // _WRITE(legionna_midground_w) AM_SHARE("mid_data")
- // AM_RANGE(0x102800, 0x1037ff) AM_RAM // _WRITE(legionna_text_w) AM_SHARE("textram")
+ // AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
+ // AM_RANGE(0x101800, 0x101fff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
+ // AM_RANGE(0x102000, 0x1027ff) AM_RAM // _WRITE(legionna_midground_w) AM_SHARE("mid_data")
+ // AM_RANGE(0x102800, 0x1037ff) AM_RAM // _WRITE(legionna_text_w) AM_SHARE("textram")
if (offset < 0x800 / 2)
{
@@ -194,7 +194,6 @@ TILE_GET_INFO_MEMBER(legionna_state::get_text_tile_info)
VIDEO_START_MEMBER(legionna_state,legionna)
{
-
m_back_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
m_fore_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
m_mid_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
@@ -220,7 +219,6 @@ VIDEO_START_MEMBER(legionna_state,legionna)
VIDEO_START_MEMBER(legionna_state,denjinmk)
{
-
m_back_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
m_fore_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
m_mid_data = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
@@ -499,9 +497,6 @@ UINT32 legionna_state::screen_update_legionna(screen_device &screen, bitmap_ind1
UINT32 legionna_state::screen_update_godzilla(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
-
-
-
bitmap.fill(0x0200, cliprect);
screen.priority().fill(0, cliprect);
@@ -521,8 +516,6 @@ UINT32 legionna_state::screen_update_godzilla(screen_device &screen, bitmap_ind1
UINT32 legionna_state::screen_update_grainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
-
-
bitmap.fill(m_palette->black_pen(), cliprect);
screen.priority().fill(0, cliprect);
diff --git a/src/mame/video/mario.c b/src/mame/video/mario.c
index e8fce38b271..d5970aaef1f 100644
--- a/src/mame/video/mario.c
+++ b/src/mame/video/mario.c
@@ -193,7 +193,7 @@ void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
y = y ^ (m_flip ? 0xFF : 0x00); /* physical screen location */
x = x ^ (m_flip ? 0xFF : 0x00); /* physical screen location */
-
+
code = m_spriteram[offs + 2];
color = (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank + 32 * m_monitor;
flipx = (m_spriteram[offs + 1] & 0x80);
@@ -216,8 +216,8 @@ void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
x = m_spriteram[offs + 0];
y = 240 - y; /* logical screen position */
- // y = y ^ (m_flip ? 0xFF : 0x00); /* physical screen location */
- // x = x ^ (m_flip ? 0xFF : 0x00); /* physical screen location */
+ // y = y ^ (m_flip ? 0xFF : 0x00); /* physical screen location */
+ // x = x ^ (m_flip ? 0xFF : 0x00); /* physical screen location */
code = (m_spriteram[offs + 2] & 0x7f) | ((m_spriteram[offs + 1] & 0x40) << 1); // upper tile bit is where the flipy bit goes on mario
color = (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank + 32 * m_monitor;
@@ -237,7 +237,6 @@ void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
}
else
{
-
m_gfxdecode->gfx(1)->transpen(bitmap, cliprect,
code,
color,
diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c
index b8207e25eb3..b8a86feecf0 100644
--- a/src/mame/video/model3.c
+++ b/src/mame/video/model3.c
@@ -3,7 +3,7 @@
#include "video/rgbutil.h"
#include "includes/model3.h"
-#define ENABLE_BILINEAR 1
+#define ENABLE_BILINEAR 1
#define TRI_PARAM_TEXTURE_PAGE 0x1
#define TRI_PARAM_TEXTURE_MIRROR_U 0x2
@@ -27,7 +27,7 @@ public:
: poly_manager<float, model3_polydata, 6, 50000>(state.machine())//, m_state(state)
{
m_fb = auto_bitmap_rgb32_alloc(state.machine(), width, height);
- m_zb = auto_bitmap_ind32_alloc(state.machine(), width, height);
+ m_zb = auto_bitmap_ind32_alloc(state.machine(), width, height);
}
void draw(bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -67,61 +67,61 @@ void model3_state::model3_exit()
FILE* file;
int i;
file = fopen("m3_texture_ram.bin","wb");
- for (i=0; i < 0x200000; i++)
- {
- fputc((UINT8)(m_texture_ram[0][i] >> 8), file);
- fputc((UINT8)(m_texture_ram[0][i] >> 0), file);
- }
for (i=0; i < 0x200000; i++)
- {
- fputc((UINT8)(m_texture_ram[1][i] >> 8), file);
- fputc((UINT8)(m_texture_ram[1][i] >> 0), file);
- }
- fclose(file);
-
- file = fopen("m3_displist.bin","wb");
- for (i=0; i < 0x40000; i++)
- {
- fputc((UINT8)(m_display_list_ram[i] >> 24), file);
- fputc((UINT8)(m_display_list_ram[i] >> 16), file);
- fputc((UINT8)(m_display_list_ram[i] >> 8), file);
- fputc((UINT8)(m_display_list_ram[i] >> 0), file);
- }
- fclose(file);
+ {
+ fputc((UINT8)(m_texture_ram[0][i] >> 8), file);
+ fputc((UINT8)(m_texture_ram[0][i] >> 0), file);
+ }
+ for (i=0; i < 0x200000; i++)
+ {
+ fputc((UINT8)(m_texture_ram[1][i] >> 8), file);
+ fputc((UINT8)(m_texture_ram[1][i] >> 0), file);
+ }
+ fclose(file);
+
+ file = fopen("m3_displist.bin","wb");
+ for (i=0; i < 0x40000; i++)
+ {
+ fputc((UINT8)(m_display_list_ram[i] >> 24), file);
+ fputc((UINT8)(m_display_list_ram[i] >> 16), file);
+ fputc((UINT8)(m_display_list_ram[i] >> 8), file);
+ fputc((UINT8)(m_display_list_ram[i] >> 0), file);
+ }
+ fclose(file);
file = fopen("m3_culling_ram.bin","wb");
- for (i=0; i < 0x100000; i++)
- {
- fputc((UINT8)(m_culling_ram[i] >> 24), file);
- fputc((UINT8)(m_culling_ram[i] >> 16), file);
- fputc((UINT8)(m_culling_ram[i] >> 8), file);
- fputc((UINT8)(m_culling_ram[i] >> 0), file);
- }
- fclose(file);
+ for (i=0; i < 0x100000; i++)
+ {
+ fputc((UINT8)(m_culling_ram[i] >> 24), file);
+ fputc((UINT8)(m_culling_ram[i] >> 16), file);
+ fputc((UINT8)(m_culling_ram[i] >> 8), file);
+ fputc((UINT8)(m_culling_ram[i] >> 0), file);
+ }
+ fclose(file);
file = fopen("m3_polygon_ram.bin","wb");
- for (i=0; i < 0x100000; i++)
- {
- fputc((UINT8)(m_polygon_ram[i] >> 24), file);
- fputc((UINT8)(m_polygon_ram[i] >> 16), file);
- fputc((UINT8)(m_polygon_ram[i] >> 8), file);
- fputc((UINT8)(m_polygon_ram[i] >> 0), file);
- }
- fclose(file);
+ for (i=0; i < 0x100000; i++)
+ {
+ fputc((UINT8)(m_polygon_ram[i] >> 24), file);
+ fputc((UINT8)(m_polygon_ram[i] >> 16), file);
+ fputc((UINT8)(m_polygon_ram[i] >> 8), file);
+ fputc((UINT8)(m_polygon_ram[i] >> 0), file);
+ }
+ fclose(file);
file = fopen("m3_vrom.bin","wb");
- for (i=0; i < 0x1000000; i++)
- {
- fputc((UINT8)(m_vrom[i] >> 24), file);
- fputc((UINT8)(m_vrom[i] >> 16), file);
- fputc((UINT8)(m_vrom[i] >> 8), file);
- fputc((UINT8)(m_vrom[i] >> 0), file);
- }
- fclose(file);
+ for (i=0; i < 0x1000000; i++)
+ {
+ fputc((UINT8)(m_vrom[i] >> 24), file);
+ fputc((UINT8)(m_vrom[i] >> 16), file);
+ fputc((UINT8)(m_vrom[i] >> 8), file);
+ fputc((UINT8)(m_vrom[i] >> 0), file);
+ }
+ fclose(file);
#endif
-// invalidate_texture(0, 0, 0, 6, 5);
-// invalidate_texture(1, 0, 0, 6, 5);
+// invalidate_texture(0, 0, 0, 6, 5);
+// invalidate_texture(1, 0, 0, 6, 5);
}
void model3_state::video_start()
@@ -197,18 +197,18 @@ void model3_state::video_start()
init_matrix_stack();
}
-#define MODEL3_TILE_INFO4(address) \
+#define MODEL3_TILE_INFO4(address) \
do { \
- UINT16 *tiles = (UINT16*)&m_m3_tile_ram[address + (tile_index / 4)]; \
+ UINT16 *tiles = (UINT16*)&m_m3_tile_ram[address + (tile_index / 4)]; \
UINT16 t = BYTE_REVERSE16(tiles[(tile_index & 3) ^ NATIVE_ENDIAN_VALUE_LE_BE(2,0)]); \
int tile = ((t << 1) & 0x7ffe) | ((t >> 15) & 0x1); \
int color = (t & 0x7ff0) >> 4; \
SET_TILE_INFO_MEMBER(0, tile, color, 0); \
} while (0)
-#define MODEL3_TILE_INFO8(address) \
+#define MODEL3_TILE_INFO8(address) \
do { \
- UINT16 *tiles = (UINT16*)&m_m3_tile_ram[address + (tile_index / 4)]; \
+ UINT16 *tiles = (UINT16*)&m_m3_tile_ram[address + (tile_index / 4)]; \
UINT16 t = BYTE_REVERSE16(tiles[(tile_index & 3) ^ NATIVE_ENDIAN_VALUE_LE_BE(2,0)]); \
int tile = ((t << 1) & 0x7ffe) | ((t >> 15) & 0x1); \
int color = (t & 0x7f00) >> 8; \
@@ -400,48 +400,48 @@ WRITE64_MEMBER(model3_state::model3_tile_w)
}
/*
- Video registers:
-
- 0xF1180000: ?
- 0xF1180004: ?
- 0xF1180008: ?
-
- 0xF1180010: VBL IRQ acknowledge
-
- 0xF1180020: -------- x------- -------- -------- Layer 3 bitdepth (0 = 8-bit, 1 = 4-bit)
- -------- -x------ -------- -------- Layer 2 bitdepth (0 = 8-bit, 1 = 4-bit)
- -------- --x----- -------- -------- Layer 1 bitdepth (0 = 8-bit, 1 = 4-bit)
- -------- ---x---- -------- -------- Layer 0 bitdepth (0 = 8-bit, 1 = 4-bit)
- -------- ----x--- -------- -------- Layer 3 priority (0 = below 3D, 1 = above 3D)
- -------- -----x-- -------- -------- Layer 2 priority (0 = below 3D, 1 = above 3D)
- -------- ------x- -------- -------- Layer 1 priority (0 = below 3D, 1 = above 3D)
- -------- -------x -------- -------- Layer 0 priority (0 = below 3D, 1 = above 3D)
-
- 0xF1180040: Foreground layer color modulation?
- -------- xxxxxxxx -------- -------- Red component
- -------- -------- xxxxxxxx -------- Green component
- -------- -------- -------- xxxxxxxx Blue component
-
- 0xF1180044: Background layer color modulation?
- -------- xxxxxxxx -------- -------- Red component
- -------- -------- xxxxxxxx -------- Green component
- -------- -------- -------- xxxxxxxx Blue component
-
- 0xF1180060: x------- -------- -------- -------- Layer 0 enable
- -------x xxxxxxxx -------- -------- Layer 0 Y scroll position
- -------- -------- -------x xxxxxxxx Layer 0 X scroll position
-
- 0xF1180064: x------- -------- -------- -------- Layer 1 enable
- -------x xxxxxxxx -------- -------- Layer 1 Y scroll position
- -------- -------- -------x xxxxxxxx Layer 1 X scroll position
-
- 0xF1180068: x------- -------- -------- -------- Layer 2 enable
- -------x xxxxxxxx -------- -------- Layer 2 Y scroll position
- -------- -------- -------x xxxxxxxx Layer 2 X scroll position
-
- 0xF118006C: x------- -------- -------- -------- Layer 3 enable
- -------x xxxxxxxx -------- -------- Layer 3 Y scroll position
- -------- -------- -------x xxxxxxxx Layer 3 X scroll position
+ Video registers:
+
+ 0xF1180000: ?
+ 0xF1180004: ?
+ 0xF1180008: ?
+
+ 0xF1180010: VBL IRQ acknowledge
+
+ 0xF1180020: -------- x------- -------- -------- Layer 3 bitdepth (0 = 8-bit, 1 = 4-bit)
+ -------- -x------ -------- -------- Layer 2 bitdepth (0 = 8-bit, 1 = 4-bit)
+ -------- --x----- -------- -------- Layer 1 bitdepth (0 = 8-bit, 1 = 4-bit)
+ -------- ---x---- -------- -------- Layer 0 bitdepth (0 = 8-bit, 1 = 4-bit)
+ -------- ----x--- -------- -------- Layer 3 priority (0 = below 3D, 1 = above 3D)
+ -------- -----x-- -------- -------- Layer 2 priority (0 = below 3D, 1 = above 3D)
+ -------- ------x- -------- -------- Layer 1 priority (0 = below 3D, 1 = above 3D)
+ -------- -------x -------- -------- Layer 0 priority (0 = below 3D, 1 = above 3D)
+
+ 0xF1180040: Foreground layer color modulation?
+ -------- xxxxxxxx -------- -------- Red component
+ -------- -------- xxxxxxxx -------- Green component
+ -------- -------- -------- xxxxxxxx Blue component
+
+ 0xF1180044: Background layer color modulation?
+ -------- xxxxxxxx -------- -------- Red component
+ -------- -------- xxxxxxxx -------- Green component
+ -------- -------- -------- xxxxxxxx Blue component
+
+ 0xF1180060: x------- -------- -------- -------- Layer 0 enable
+ -------x xxxxxxxx -------- -------- Layer 0 Y scroll position
+ -------- -------- -------x xxxxxxxx Layer 0 X scroll position
+
+ 0xF1180064: x------- -------- -------- -------- Layer 1 enable
+ -------x xxxxxxxx -------- -------- Layer 1 Y scroll position
+ -------- -------- -------x xxxxxxxx Layer 1 X scroll position
+
+ 0xF1180068: x------- -------- -------- -------- Layer 2 enable
+ -------x xxxxxxxx -------- -------- Layer 2 Y scroll position
+ -------- -------- -------x xxxxxxxx Layer 2 X scroll position
+
+ 0xF118006C: x------- -------- -------- -------- Layer 3 enable
+ -------x xxxxxxxx -------- -------- Layer 3 Y scroll position
+ -------- -------- -------x xxxxxxxx Layer 3 X scroll position
*/
@@ -634,233 +634,233 @@ cached_texture *model3_state::get_texture(int page, int texx, int texy, int texw
/* Real3D Graphics stuff */
/*
- Real3D Pro-1000 capabilities:
+ Real3D Pro-1000 capabilities:
- Coordinate sets
- - 4096 matrices (matrix base pointer in viewport node)
+ Coordinate sets
+ - 4096 matrices (matrix base pointer in viewport node)
- Polygons
- - 32MB max polygon memory. VROM in Model 3, the low 4MB of VROM is overlaid by Polygon RAM for runtime generated content.
+ Polygons
+ - 32MB max polygon memory. VROM in Model 3, the low 4MB of VROM is overlaid by Polygon RAM for runtime generated content.
- Texture
- - 2 texture sheets of 2048x1024
- - Mipmaps located in the bottom right corner
- - Texture size 32x32 to 1024x1024
- - Microtextures (is this featured in Model 3?)
+ Texture
+ - 2 texture sheets of 2048x1024
+ - Mipmaps located in the bottom right corner
+ - Texture size 32x32 to 1024x1024
+ - Microtextures (is this featured in Model 3?)
- LODs
- - 127 blend types per viewport with 4 sets of min/max angle or range (where is this in the viewport node?)
+ LODs
+ - 127 blend types per viewport with 4 sets of min/max angle or range (where is this in the viewport node?)
- Lighting
- - Self-luminous lighting (enable and luminosity parameter in polygon structure)
- - Fixed polygon shading, fixed shading weight per vertex (not found in Model 3, yet)
- - Flat sun shading (lighting parameters in viewport node) needs a separate enable?
- - Smooth polygon shading (lighting parameters in viewport, use vertex normals)
+ Lighting
+ - Self-luminous lighting (enable and luminosity parameter in polygon structure)
+ - Fixed polygon shading, fixed shading weight per vertex (not found in Model 3, yet)
+ - Flat sun shading (lighting parameters in viewport node) needs a separate enable?
+ - Smooth polygon shading (lighting parameters in viewport, use vertex normals)
- Gamma table
- - 256 entry 8-bit table, possibly in Polygon RAM
+ Gamma table
+ - 256 entry 8-bit table, possibly in Polygon RAM
*/
/*
- Real3D Memory Structures:
-
- Culling Nodes:
- - Located in Culling RAM (0x8E000000)
- - Limit of 15 child nodes (nesting), not including polygon nodes
- - Color table (is this featured in Model 3?)
-
- 0x00: -------- -------- ------xx -------- Viewport number 0-3
- -------- -------- -------- ---xx--- Viewport priority
-
- 0x01: Child node pointer (inherits parameters from this node)
- 0x02: Sibling node pointer
- 0x03: Unknown (float)
- 0x04: Sun light vector Z-component (float)
- 0x05: Sun light vector X-component (float)
- 0x06: Sun light vector Y-component (float)
- 0x07: Sun light intensity (float)
- 0x08: Far Clip plane Z
- 0x09: Far Clip plane Distance
- 0x0a: Near Clip plane Z
- 0x0b: Near Clip plane Distance
- 0x0c: Left Clip plane Z
- 0x0d: Left Clip plane X
- 0x0e: Top Clip plane Z
- 0x0f: Top Clip plane Y
- 0x10: Right Clip plane Z
- 0x11: Right Clip plane X
- 0x12: Bottom Clip plane Z
- 0x13: Bottom Clip plane Y
-
- 0x14: xxxxxxxx xxxxxxxx -------- -------- Viewport height (14.2 fixed-point)
- -------- -------- xxxxxxxx xxxxxxxx Viewport width (14.2 fixed-point)
-
- 0x15: ?
- 0x16: Matrix base pointer
- 0x17: LOD blend type table pointer? (seems to be 8x float per entry)
- 0x18: ?
- 0x19: ?
-
- 0x1a: xxxxxxxx xxxxxxxx -------- -------- Viewport Y coordinate (12.4 fixed-point)
- -------- -------- xxxxxxxx xxxxxxxx Viewport X coordinate (12.4 fixed-point)
-
- 0x1b: Copy of word 0x00
- 0x1c: ?
-
- 0x1d: xxxxxxxx xxxxxxxx -------- -------- Spotlight Y size
- -------- -------- xxxxxxxx xxxxxxxx Spotlight Y position (13.3 fixed-point?)
-
- 0x1e: xxxxxxxx xxxxxxxx -------- -------- Spotlight X size
- -------- -------- xxxxxxxx xxxxxxxx Spotlight X position (13.3 fixed-point?)
-
- 0x1f: Light extent (float)
-
- 0x20: xxxxxxxx -------- -------- -------- ?
- -------- xxxxxxxx -------- -------- ?
- -------- -------- --xxx--- -------- Light RGB (RGB111?)
- -------- -------- -----xxx -------- Light RGB Fog (RGB111?)
- -------- -------- -------- xxxxxxxx Scroll Fog (0.8 fixed-point?) What is this???
-
- 0x21: ?
- 0x22: Fog Color (RGB888)
- 0x23: Fog Density (float)
-
- 0x24: xxxxxxxx xxxxxxxx -------- -------- ?
- -------- -------- xxxxxxxx -------- Sun light ambient (0.8 fixed-point)
- -------- -------- -------- xxxxxxxx Scroll attenuation (0.8 fixed-point) What is this???
-
- 0x25: Fog offset
- 0x26: ?
- 0x27: ?
- 0x28: ?
- 0x29: ?
- 0x2a: ?
- 0x2b: ?
- 0x2c: ?
- 0x2d: ?
- 0x2e: ?
- 0x2f: ?
-
-
- Sub types:
- LOD Culling Node. Up to 4 LODs.
-
- Articulated Part Culling Node (is this used by Model 3?)
- - An Articulated Part culling node, or six degree–of–freedom node, is used to define
+ Real3D Memory Structures:
+
+ Culling Nodes:
+ - Located in Culling RAM (0x8E000000)
+ - Limit of 15 child nodes (nesting), not including polygon nodes
+ - Color table (is this featured in Model 3?)
+
+ 0x00: -------- -------- ------xx -------- Viewport number 0-3
+ -------- -------- -------- ---xx--- Viewport priority
+
+ 0x01: Child node pointer (inherits parameters from this node)
+ 0x02: Sibling node pointer
+ 0x03: Unknown (float)
+ 0x04: Sun light vector Z-component (float)
+ 0x05: Sun light vector X-component (float)
+ 0x06: Sun light vector Y-component (float)
+ 0x07: Sun light intensity (float)
+ 0x08: Far Clip plane Z
+ 0x09: Far Clip plane Distance
+ 0x0a: Near Clip plane Z
+ 0x0b: Near Clip plane Distance
+ 0x0c: Left Clip plane Z
+ 0x0d: Left Clip plane X
+ 0x0e: Top Clip plane Z
+ 0x0f: Top Clip plane Y
+ 0x10: Right Clip plane Z
+ 0x11: Right Clip plane X
+ 0x12: Bottom Clip plane Z
+ 0x13: Bottom Clip plane Y
+
+ 0x14: xxxxxxxx xxxxxxxx -------- -------- Viewport height (14.2 fixed-point)
+ -------- -------- xxxxxxxx xxxxxxxx Viewport width (14.2 fixed-point)
+
+ 0x15: ?
+ 0x16: Matrix base pointer
+ 0x17: LOD blend type table pointer? (seems to be 8x float per entry)
+ 0x18: ?
+ 0x19: ?
+
+ 0x1a: xxxxxxxx xxxxxxxx -------- -------- Viewport Y coordinate (12.4 fixed-point)
+ -------- -------- xxxxxxxx xxxxxxxx Viewport X coordinate (12.4 fixed-point)
+
+ 0x1b: Copy of word 0x00
+ 0x1c: ?
+
+ 0x1d: xxxxxxxx xxxxxxxx -------- -------- Spotlight Y size
+ -------- -------- xxxxxxxx xxxxxxxx Spotlight Y position (13.3 fixed-point?)
+
+ 0x1e: xxxxxxxx xxxxxxxx -------- -------- Spotlight X size
+ -------- -------- xxxxxxxx xxxxxxxx Spotlight X position (13.3 fixed-point?)
+
+ 0x1f: Light extent (float)
+
+ 0x20: xxxxxxxx -------- -------- -------- ?
+ -------- xxxxxxxx -------- -------- ?
+ -------- -------- --xxx--- -------- Light RGB (RGB111?)
+ -------- -------- -----xxx -------- Light RGB Fog (RGB111?)
+ -------- -------- -------- xxxxxxxx Scroll Fog (0.8 fixed-point?) What is this???
+
+ 0x21: ?
+ 0x22: Fog Color (RGB888)
+ 0x23: Fog Density (float)
+
+ 0x24: xxxxxxxx xxxxxxxx -------- -------- ?
+ -------- -------- xxxxxxxx -------- Sun light ambient (0.8 fixed-point)
+ -------- -------- -------- xxxxxxxx Scroll attenuation (0.8 fixed-point) What is this???
+
+ 0x25: Fog offset
+ 0x26: ?
+ 0x27: ?
+ 0x28: ?
+ 0x29: ?
+ 0x2a: ?
+ 0x2b: ?
+ 0x2c: ?
+ 0x2d: ?
+ 0x2e: ?
+ 0x2f: ?
+
+
+ Sub types:
+ LOD Culling Node. Up to 4 LODs.
+
+ Articulated Part Culling Node (is this used by Model 3?)
+ - An Articulated Part culling node, or six degree?of?freedom node, is used to define
geometry that can move relative to the parent coordinate set to which it is attached.
Fifteen levels of coordinate set nesting (levels of articulation) are supported.
-
- Animation Culling Node
- - Animation culling nodes are used to build a culling hierarchy for an object with different
+
+ Animation Culling Node
+ - Animation culling nodes are used to build a culling hierarchy for an object with different
representations, or animation frames. which can be turned on and off by the
application. Each child (culling node or polygon) added to an Animation culling node
specifies the frame for which the child is valid.
-
- Instance Culling Node
- - Instance culling nodes define the top of a shared display list segment that can be
- referenced from other parts of the scene display list.
-
- Instance Reference Culling Node
- - An Instance Reference node is considered a leaf node; its
- "child" is the shared geometry segment. An Instance Reference may be attached to
- a parent node and may not have any other children, but may have siblings.
-
- Point Light
- - A Point Light is used to create an instance of a point luminous feature. The size,
+
+ Instance Culling Node
+ - Instance culling nodes define the top of a shared display list segment that can be
+ referenced from other parts of the scene display list.
+
+ Instance Reference Culling Node
+ - An Instance Reference node is considered a leaf node; its
+ "child" is the shared geometry segment. An Instance Reference may be attached to
+ a parent node and may not have any other children, but may have siblings.
+
+ Point Light
+ - A Point Light is used to create an instance of a point luminous feature. The size,
feature type, and number of sides of the point light model may be customized.
- Instance Set
- - An Instance Set is a culling node which defines a set of point features. Each feature
+ Instance Set
+ - An Instance Set is a culling node which defines a set of point features. Each feature
is positioned individually. This type of culling node can be used to simulate particles.
- Instance Node?
+ Instance Node?
+
+ 0x00: xxxxxxxx xxxxxxxx xxxxxx-- -------- Node number/ID?, num of bits unknown
+ -------- -------- -------- ---x---- This node applies translation, else matrix
+ -------- -------- -------- ----x--- LOD enable?
+ -------- -------- -------- -----x-- ?
+ -------- -------- -------- ------x- ?
+ -------- -------- -------- -------x ?
- 0x00: xxxxxxxx xxxxxxxx xxxxxx-- -------- Node number/ID?, num of bits unknown
- -------- -------- -------- ---x---- This node applies translation, else matrix
- -------- -------- -------- ----x--- LOD enable?
- -------- -------- -------- -----x-- ?
- -------- -------- -------- ------x- ?
- -------- -------- -------- -------x ?
-
- 0x01: ? (not present on Step 1.0)
- 0x02: ? (not present on Step 1.0) Scud Race has 0x00000101
+ 0x01: ? (not present on Step 1.0)
+ 0x02: ? (not present on Step 1.0) Scud Race has 0x00000101
- 0x03: --x----- -------- -------- -------- ?
- -------- -xxxxxxx xxxx---- -------- LOD?
- -------- -------- ----xxxx xxxxxxxx Node matrix
-
- 0x04: Translation X coordinate
- 0x05: Translation Y coordinate
- 0x06: Translation Z coordinate
- 0x07: Child node pointer
- 0x08: Sibling node pointer
+ 0x03: --x----- -------- -------- -------- ?
+ -------- -xxxxxxx xxxx---- -------- LOD?
+ -------- -------- ----xxxx xxxxxxxx Node matrix
- 0x09: xxxxxxxx xxxxxxxx -------- -------- Culling or sorting related?
- -------- -------- xxxxxxxx xxxxxxxx Culling or sorting related?
+ 0x04: Translation X coordinate
+ 0x05: Translation Y coordinate
+ 0x06: Translation Z coordinate
+ 0x07: Child node pointer
+ 0x08: Sibling node pointer
+ 0x09: xxxxxxxx xxxxxxxx -------- -------- Culling or sorting related?
+ -------- -------- xxxxxxxx xxxxxxxx Culling or sorting related?
- Polygon Data
- 0x00: -------- xxxxxxxx xxxxxx-- -------- Polygon ID
- -------- -------- -------- -x------ 0 = Triangle, 1 = Quad
- -------- -------- -------- ----x--- Vertex 3 shared from previous polygon
- -------- -------- -------- -----x-- Vertex 2 shared from previous polygon
- -------- -------- -------- ------x- Vertex 1 shared from previous polygon
- -------- -------- -------- -------x Vertex 0 shared from previous polygon
- xxxxxxxx -------- -------- x-xx---- ?
- -------- -------- ------xx -------- Broken polygons in srally2 set these (a way to mark them for HW to not render?)
+ Polygon Data
- 0x01: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal X coordinate (2.22 fixed point)
- -------- -------- -------- -x------ UV format (0 = 13.3, 1 = 16.0)
- -------- -------- -------- -----x-- If set, this is the last polygon
- -------- -------- -------- x-xxx-xx ?
+ 0x00: -------- xxxxxxxx xxxxxx-- -------- Polygon ID
+ -------- -------- -------- -x------ 0 = Triangle, 1 = Quad
+ -------- -------- -------- ----x--- Vertex 3 shared from previous polygon
+ -------- -------- -------- -----x-- Vertex 2 shared from previous polygon
+ -------- -------- -------- ------x- Vertex 1 shared from previous polygon
+ -------- -------- -------- -------x Vertex 0 shared from previous polygon
+ xxxxxxxx -------- -------- x-xx---- ?
+ -------- -------- ------xx -------- Broken polygons in srally2 set these (a way to mark them for HW to not render?)
- 0x02: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal Y coordinate (2.22 fixed point)
- -------- -------- -------- ------x- Texture U mirror enable
- -------- -------- -------- -------x Texture V mirror enable
- -------- -------- -------- xxxxxx-- ?
+ 0x01: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal X coordinate (2.22 fixed point)
+ -------- -------- -------- -x------ UV format (0 = 13.3, 1 = 16.0)
+ -------- -------- -------- -----x-- If set, this is the last polygon
+ -------- -------- -------- x-xxx-xx ?
- 0x03: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal Z coordinate (2.22 fixed point)
- -------- -------- -------- --xxx--- Texture width (in 8-pixel tiles)
- -------- -------- -------- -----xxx Texture height (in 8-pixel tiles)
+ 0x02: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal Y coordinate (2.22 fixed point)
+ -------- -------- -------- ------x- Texture U mirror enable
+ -------- -------- -------- -------x Texture V mirror enable
+ -------- -------- -------- xxxxxx-- ?
- 0x04: xxxxxxxx xxxxxxxx xxxxxxxx -------- Color (RGB888)
- -------- -------- -------- -x------ Texture page
- -------- -------- -------- ---xxxxx Upper 5 bits of texture U coordinate
- -------- -------- -------- x-x----- ?
+ 0x03: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal Z coordinate (2.22 fixed point)
+ -------- -------- -------- --xxx--- Texture width (in 8-pixel tiles)
+ -------- -------- -------- -----xxx Texture height (in 8-pixel tiles)
- 0x05: xxxxxxxx xxxxxxxx xxxxxxxx -------- Specular color?
- -------- -------- -------- x------- Low bit of texture U coordinate
- -------- -------- -------- ---xxxxx Low 5 bits of texture V coordinate
- -------- -------- -------- -xx----- ?
+ 0x04: xxxxxxxx xxxxxxxx xxxxxxxx -------- Color (RGB888)
+ -------- -------- -------- -x------ Texture page
+ -------- -------- -------- ---xxxxx Upper 5 bits of texture U coordinate
+ -------- -------- -------- x-x----- ?
- 0x06: x------- -------- -------- -------- Texture contour enable
- -----x-- -------- -------- -------- Texture enable
- -------- x------- -------- -------- 1 = disable transparency?
- -------- -xxxxx-- -------- -------- Polygon transparency (0 = fully transparent)
- -------- -------x -------- -------- 1 = disable lighting
- -------- -------- xxxxx--- -------- Polygon luminosity
- -------- -------- ------xx x------- Texture format
- -------- -------- -------- -------x Alpha enable?
- -xxxx-xx ------x- -----x-- -xxxxxx- ?
+ 0x05: xxxxxxxx xxxxxxxx xxxxxxxx -------- Specular color?
+ -------- -------- -------- x------- Low bit of texture U coordinate
+ -------- -------- -------- ---xxxxx Low 5 bits of texture V coordinate
+ -------- -------- -------- -xx----- ?
+ 0x06: x------- -------- -------- -------- Texture contour enable
+ -----x-- -------- -------- -------- Texture enable
+ -------- x------- -------- -------- 1 = disable transparency?
+ -------- -xxxxx-- -------- -------- Polygon transparency (0 = fully transparent)
+ -------- -------x -------- -------- 1 = disable lighting
+ -------- -------- xxxxx--- -------- Polygon luminosity
+ -------- -------- ------xx x------- Texture format
+ -------- -------- -------- -------x Alpha enable?
+ -xxxx-xx ------x- -----x-- -xxxxxx- ?
- Vertex entry
- 0x00: xxxxxxxx xxxxxxxx xxxxxxxx -------- Vertex X coordinate (17.7 fixed-point in Step 1.0, 13.11 otherwise)
- -------- -------- -------- xxxxxxxx Vertex normal X (offset from polygon normal)
+ Vertex entry
- 0x01: xxxxxxxx xxxxxxxx xxxxxxxx -------- Vertex Y coordinate
- -------- -------- -------- xxxxxxxx Vertex normal Y
+ 0x00: xxxxxxxx xxxxxxxx xxxxxxxx -------- Vertex X coordinate (17.7 fixed-point in Step 1.0, 13.11 otherwise)
+ -------- -------- -------- xxxxxxxx Vertex normal X (offset from polygon normal)
- 0x02: xxxxxxxx xxxxxxxx xxxxxxxx -------- Vertex Z coordinate
- -------- -------- -------- xxxxxxxx Vertex normal Z
+ 0x01: xxxxxxxx xxxxxxxx xxxxxxxx -------- Vertex Y coordinate
+ -------- -------- -------- xxxxxxxx Vertex normal Y
- 0x03: xxxxxxxx xxxxxxxx -------- -------- Vertex U coordinate
- -------- -------- xxxxxxxx xxxxxxxx Vertex V coordinate
+ 0x02: xxxxxxxx xxxxxxxx xxxxxxxx -------- Vertex Z coordinate
+ -------- -------- -------- xxxxxxxx Vertex normal Z
+
+ 0x03: xxxxxxxx xxxxxxxx -------- -------- Vertex U coordinate
+ -------- -------- xxxxxxxx xxxxxxxx Vertex V coordinate
*/
@@ -891,8 +891,8 @@ WRITE64_MEMBER(model3_state::real3d_polygon_ram_w)
static const UINT8 texture_decode[64] =
{
- 0, 1, 4, 5, 8, 9, 12, 13,
- 2, 3, 6, 7, 10, 11, 14, 15,
+ 0, 1, 4, 5, 8, 9, 12, 13,
+ 2, 3, 6, 7, 10, 11, 14, 15,
16, 17, 20, 21, 24, 25, 28, 29,
18, 19, 22, 23, 26, 27, 30, 31,
32, 33, 36, 37, 40, 41, 44, 45,
@@ -1003,8 +1003,8 @@ void model3_state::real3d_display_list_end()
m_texture_fifo_pos = 0;
m_renderer->clear_buffers();
-
- real3d_traverse_display_list();
+
+ real3d_traverse_display_list();
}
void model3_state::real3d_display_list1_dma(UINT32 src, UINT32 dst, int length, int byteswap)
@@ -1041,7 +1041,7 @@ void model3_state::real3d_display_list2_dma(UINT32 src, UINT32 dst, int length,
void model3_state::real3d_vrom_texture_dma(UINT32 src, UINT32 dst, int length, int byteswap)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = m_maincpu->space(AS_PROGRAM);
if ((dst & 0xff) == 0)
{
for (int i=0; i < length; i+=12)
@@ -1286,11 +1286,11 @@ void model3_state::draw_model(UINT32 addr)
MATRIX transform_matrix;
float center_x, center_y;
- if (m_step < 0x15) // position coordinates are 17.7 fixed-point in Step 1.0
+ if (m_step < 0x15) // position coordinates are 17.7 fixed-point in Step 1.0
fixed_point_fraction = 1.0f / 128.0f;
- else // 13.11 fixed-point in other Steps
+ else // 13.11 fixed-point in other Steps
fixed_point_fraction = 1.0f / 2048.0f;
-
+
get_top_matrix(&transform_matrix);
/* current viewport center coordinates on screen */
@@ -1323,7 +1323,7 @@ void model3_state::draw_model(UINT32 addr)
if (header[1] & 0x4)
last_polygon = TRUE;
- if ((header[0] & 0x300) == 0x300) // TODO: broken polygons in srally2 have these bits set
+ if ((header[0] & 0x300) == 0x300) // TODO: broken polygons in srally2 have these bits set
return;
num_vertices = (header[0] & 0x40) ? 4 : 3;
@@ -1354,9 +1354,9 @@ void model3_state::draw_model(UINT32 addr)
vertex[vi].z = (float)((INT32)(zw) >> 8) * fixed_point_fraction;
vertex[vi].u = (UINT16)(model[index] >> 16);
vertex[vi].v = (UINT16)(model[index++]);
-// vertex[vi].nx = normal[0] + ((float)((INT8)(xw)) / 127.0f);
-// vertex[vi].ny = normal[1] + ((float)((INT8)(yw)) / 127.0f);
-// vertex[vi].nz = normal[2] + ((float)((INT8)(zw)) / 127.0f);
+// vertex[vi].nx = normal[0] + ((float)((INT8)(xw)) / 127.0f);
+// vertex[vi].ny = normal[1] + ((float)((INT8)(yw)) / 127.0f);
+// vertex[vi].nz = normal[2] + ((float)((INT8)(zw)) / 127.0f);
vertex[vi].nx = ((float)((INT8)(xw)) / 127.0f);
vertex[vi].ny = ((float)((INT8)(yw)) / 127.0f);
@@ -1408,16 +1408,16 @@ void model3_state::draw_model(UINT32 addr)
// transform vertex normal
VECTOR3 n;
n[0] = (vertex[i].nx * transform_matrix[0][0]) +
- (vertex[i].ny * transform_matrix[1][0]) +
- (vertex[i].nz * transform_matrix[2][0]);
+ (vertex[i].ny * transform_matrix[1][0]) +
+ (vertex[i].nz * transform_matrix[2][0]);
n[0] *= m_coordinate_system[0][1];
n[1] = (vertex[i].nx * transform_matrix[0][1]) +
- (vertex[i].ny * transform_matrix[1][1]) +
- (vertex[i].nz * transform_matrix[2][1]);
+ (vertex[i].ny * transform_matrix[1][1]) +
+ (vertex[i].nz * transform_matrix[2][1]);
n[1] *= m_coordinate_system[1][2];
n[2] = (vertex[i].nx * transform_matrix[0][2]) +
- (vertex[i].ny * transform_matrix[1][2]) +
- (vertex[i].nz * transform_matrix[2][2]);
+ (vertex[i].ny * transform_matrix[1][2]) +
+ (vertex[i].nz * transform_matrix[2][2]);
n[2] *= m_coordinate_system[2][0];
// lighting
@@ -1484,7 +1484,7 @@ void model3_state::draw_model(UINT32 addr)
int tex_height = (header[3] & 0x7);
int tex_format = (header[6] >> 7) & 0x7;
- if (tex_width >= 6 || tex_height >= 6) // srally2 poly ram has degenerate polys with 2k tex size (cpu bug or intended?)
+ if (tex_width >= 6 || tex_height >= 6) // srally2 poly ram has degenerate polys with 2k tex size (cpu bug or intended?)
return;
texture = get_texture((header[4] & 0x40) ? 1 : 0, tex_x, tex_y, tex_width, tex_height, tex_format);
@@ -1761,7 +1761,7 @@ void model3_renderer::clear_buffers()
cliprect.max_y = 383;
m_fb->fill(0x00000000, cliprect);
-
+
float zvalue = 10000000000.0f;
m_zb->fill(*(int*)&zvalue, cliprect);
}
@@ -1779,14 +1779,14 @@ void model3_renderer::draw_triangle(const m3_triangle *tri)
if (tri->param & TRI_PARAM_TEXTURE_ENABLE)
{
for (int i=0; i < 3; i++)
- {
+ {
v[i].x = tri->v[i].x;
v[i].y = tri->v[i].y;
v[i].p[0] = tri->v[i].z;
v[i].p[1] = 1.0f / tri->v[i].z;
- v[i].p[2] = tri->v[i].u * 256.0f; // 8 bits of subtexel precision for bilinear filtering
+ v[i].p[2] = tri->v[i].u * 256.0f; // 8 bits of subtexel precision for bilinear filtering
v[i].p[3] = tri->v[i].v * 256.0f;
- v[i].p[4] = tri->v[i].i;
+ v[i].p[4] = tri->v[i].i;
}
model3_polydata &extra = object_data_alloc();
@@ -1821,7 +1821,7 @@ void model3_renderer::draw_triangle(const m3_triangle *tri)
v[i].x = tri->v[i].x;
v[i].y = tri->v[i].y;
v[i].p[0] = tri->v[i].z;
- v[i].p[1] = tri->v[i].i;
+ v[i].p[1] = tri->v[i].i;
}
model3_polydata &extra = object_data_alloc();
@@ -1881,30 +1881,30 @@ void model3_renderer::draw_scanline_solid(INT32 scanline, const extent_t &extent
}
}
-#define TEX_FETCH_NOFILTER() \
-do { \
- float intz = 1.0f / ooz; \
- UINT32 u = uoz * intz; \
- UINT32 v = voz * intz; \
- UINT32 u1 = (u >> 8) & umask; \
- UINT32 v1 = (v >> 8) & vmask; \
- texel = texture->data[(v1 << width) + u1]; \
+#define TEX_FETCH_NOFILTER() \
+do { \
+ float intz = 1.0f / ooz; \
+ UINT32 u = uoz * intz; \
+ UINT32 v = voz * intz; \
+ UINT32 u1 = (u >> 8) & umask; \
+ UINT32 v1 = (v >> 8) & vmask; \
+ texel = texture->data[(v1 << width) + u1]; \
} while(0);
-#define TEX_FETCH_BILINEAR() \
-do { \
- float intz = 1.0f / ooz; \
- UINT32 u = uoz * intz; \
- UINT32 v = voz * intz; \
- UINT32 u1 = (u >> 8) & umask; \
- UINT32 v1 = (v >> 8) & vmask; \
- UINT32 u2 = (u1 + 1) & umask; \
- UINT32 v2 = (v1 + 1) & vmask; \
- UINT32 pix00 = texture->data[(v1 << width) + u1]; \
- UINT32 pix01 = texture->data[(v1 << width) + u2]; \
- UINT32 pix10 = texture->data[(v2 << width) + u1]; \
- UINT32 pix11 = texture->data[(v2 << width) + u2]; \
- texel = rgba_bilinear_filter(pix00, pix01, pix10, pix11, u, v); \
+#define TEX_FETCH_BILINEAR() \
+do { \
+ float intz = 1.0f / ooz; \
+ UINT32 u = uoz * intz; \
+ UINT32 v = voz * intz; \
+ UINT32 u1 = (u >> 8) & umask; \
+ UINT32 v1 = (v >> 8) & vmask; \
+ UINT32 u2 = (u1 + 1) & umask; \
+ UINT32 v2 = (v1 + 1) & vmask; \
+ UINT32 pix00 = texture->data[(v1 << width) + u1]; \
+ UINT32 pix01 = texture->data[(v1 << width) + u2]; \
+ UINT32 pix10 = texture->data[(v2 << width) + u1]; \
+ UINT32 pix11 = texture->data[(v2 << width) + u2]; \
+ texel = rgba_bilinear_filter(pix00, pix01, pix10, pix11, u, v); \
} while(0);
#if ENABLE_BILINEAR
@@ -1989,19 +1989,19 @@ void model3_renderer::draw_scanline_contour(INT32 scanline, const extent_t &exte
UINT32 fa = texel >> 24;
if (fa >= 0xf8)
- {
+ {
UINT32 r = ((texel & 0x00ff0000) * fa) >> 8;
UINT32 g = ((texel & 0x0000ff00) * fa) >> 8;
UINT32 b = ((texel & 0x000000ff) * fa) >> 8;
-
+
UINT32 orig = fb[x];
-
+
int minalpha = 255 - fa;
-
+
r += ((orig & 0x00ff0000) * minalpha) >> 8;
g += ((orig & 0x0000ff00) * minalpha) >> 8;
b += ((orig & 0x000000ff) * minalpha) >> 8;
-
+
fb[x] = 0xff000000 | (r & 0xff0000) | (g & 0xff00) | (b & 0xff);
zb[x] = z;
}
@@ -2055,9 +2055,9 @@ void model3_renderer::draw_scanline_tex_trans(INT32 scanline, const extent_t &ex
r = (r * srctrans) >> 5;
g = (g * srctrans) >> 5;
b = (b * srctrans) >> 5;
-
+
UINT32 orig = fb[x];
-
+
r += ((orig & 0x00ff0000) * desttrans) >> 5;
g += ((orig & 0x0000ff00) * desttrans) >> 5;
b += ((orig & 0x000000ff) * desttrans) >> 5;
@@ -2091,8 +2091,8 @@ void model3_renderer::draw_scanline_tex_alpha(INT32 scanline, const extent_t &ex
float in = extent.param[4].start;
float inz = extent.param[4].dpdx;
-// int srctrans = polydata.transparency;
-// int desttrans = 32 - polydata.transparency;
+// int srctrans = polydata.transparency;
+// int desttrans = 32 - polydata.transparency;
UINT32 umask = (((polydata.texture_param & TRI_PARAM_TEXTURE_MIRROR_U) ? 64 : 32) << texture->width) - 1;
UINT32 vmask = (((polydata.texture_param & TRI_PARAM_TEXTURE_MIRROR_V) ? 64 : 32) << texture->height) - 1;
@@ -2136,4 +2136,4 @@ void model3_renderer::draw_scanline_tex_alpha(INT32 scanline, const extent_t &ex
in += inz;
z += dz;
}
-} \ No newline at end of file
+}
diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c
index 3d0186e56f0..4495c479532 100644
--- a/src/mame/video/seibuspi.c
+++ b/src/mame/video/seibuspi.c
@@ -26,7 +26,7 @@ void seibuspi_state::set_layer_offsets()
m_midl_layer_offset = 0x2000 / 4 / 2;
m_text_layer_offset = 0x3000 / 4 / 2;
}
-
+
m_fore_layer_d13 = m_layer_bank >> 14 & 0x2000;
m_back_layer_d14 = m_rf2_layer_bank << 14 & 0x4000;
m_midl_layer_d14 = m_rf2_layer_bank << 13 & 0x4000;
@@ -657,7 +657,7 @@ VIDEO_START_MEMBER(seibuspi_state,sys386f)
m_rf2_layer_bank = 0;
m_rowscroll_enable = 0;
set_layer_offsets();
-
+
m_tilemap_ram_size = 0;
m_palette_ram_size = 0x4000;
m_sprite_ram_size = 0x2000;
diff --git a/src/mame/video/sknsspr.h b/src/mame/video/sknsspr.h
index 4701e865093..3145755c487 100644
--- a/src/mame/video/sknsspr.h
+++ b/src/mame/video/sknsspr.h
@@ -4,7 +4,7 @@ class sknsspr_device : public device_t,
{
public:
sknsspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
void skns_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs);
void skns_sprite_kludge(int x, int y);
diff --git a/src/mame/video/skyfox.c b/src/mame/video/skyfox.c
index bf3da646609..bb42d541163 100644
--- a/src/mame/video/skyfox.c
+++ b/src/mame/video/skyfox.c
@@ -173,7 +173,7 @@ void skyfox_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect
for (dx = xstart; dx != xend; dx += xinc, code++)
{
gfx->transpen(bitmap, cliprect, code, 0, flipx, flipy, dx*8 + x, dy*8 + y, 0xff);
-
+
// wraparound y - BTANB: large sprites exiting the screen sometimes reappear on the other edge
gfx->transpen(bitmap, cliprect, code, 0, flipx, flipy, dx*8 + x, dy*8 + y - 256, 0xff);
}
diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c
index a9dcd0b3b38..1ed8b441bad 100644
--- a/src/mame/video/snk.c
+++ b/src/mame/video/snk.c
@@ -835,7 +835,7 @@ byte3: attributes
-xx-x--- (bank number)
x------- (x offset bit8)
*/
-void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum,
+void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum,
const int hw_xflip, const int from, const int to)
{
gfx_element *gfx = m_gfxdecode->gfx(gfxnum);
diff --git a/src/mame/video/taito_f3.c b/src/mame/video/taito_f3.c
index 05efc3bd1a1..a79ba38f94e 100644
--- a/src/mame/video/taito_f3.c
+++ b/src/mame/video/taito_f3.c
@@ -1398,7 +1398,7 @@ void taito_f3_state::init_alpha_blend_func()
/*============================================================================*/
-inline void taito_f3_state::draw_scanlines(
+inline void taito_f3_state::draw_scanlines(
bitmap_rgb32 &bitmap,int xsize,INT16 *draw_line_num,
const struct f3_playfield_line_inf **line_t,
const int *sprite,
diff --git a/src/mame/video/tc0480scp.c b/src/mame/video/tc0480scp.c
index 2399025a049..4418ad3c4db 100644
--- a/src/mame/video/tc0480scp.c
+++ b/src/mame/video/tc0480scp.c
@@ -156,7 +156,7 @@ tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *ta
m_palette(*this)
{
memset(m_ctrl, 0, sizeof(m_ctrl));
-
+
for (int i = 0; i < 4; i++)
{
m_bg_ram[i] = NULL;
diff --git a/src/mess/audio/vc4000snd.h b/src/mess/audio/vc4000snd.h
index 531556084f0..097c247538a 100644
--- a/src/mess/audio/vc4000snd.h
+++ b/src/mess/audio/vc4000snd.h
@@ -21,17 +21,17 @@ class vc4000_sound_device : public device_t,
public:
vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~vc4000_sound_device() { }
-
+
protected:
// device-level overrides
virtual void device_start();
-
+
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
-
+
public:
void soundport_w(int mode, int data);
-
+
private:
sound_stream *m_channel;
UINT8 m_reg[1];
diff --git a/src/mess/audio/wswan_snd.h b/src/mess/audio/wswan_snd.h
index a586a002cd3..253308b0520 100644
--- a/src/mess/audio/wswan_snd.h
+++ b/src/mess/audio/wswan_snd.h
@@ -25,7 +25,7 @@ struct CHAN
vol_right(0),
on(0),
signal(0) { }
-
+
UINT16 freq; /* frequency */
UINT32 period; /* period */
UINT32 pos; /* position */
@@ -44,21 +44,21 @@ class wswan_sound_device : public device_t,
public:
wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~wswan_sound_device() { }
-
+
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
-
+
public:
DECLARE_WRITE8_MEMBER( port_w );
-
+
private:
void wswan_ch_set_freq( CHAN *ch, UINT16 freq );
-
+
private:
sound_stream *m_channel;
CHAN m_audio1; /* Audio channel 1 */
diff --git a/src/mess/drivers/a2600.c b/src/mess/drivers/a2600.c
index 3b1b52beb5b..1d0d6a47d5d 100644
--- a/src/mess/drivers/a2600.c
+++ b/src/mess/drivers/a2600.c
@@ -244,14 +244,14 @@ WRITE8_MEMBER(a2600_state::cart_over_riot_w)
{
m_cart->write_bank(space, offset, 0);
m_riot_ram[0x20 + offset] = data;
-
+
}
WRITE8_MEMBER(a2600_state::cart_over_tia_w)
{
// Both Cart & TIA see these addresses
m_cart->write_bank(space, offset, data);
- m_tia->write(space, offset, data);
+ m_tia->write(space, offset, data);
}
MACHINE_START_MEMBER(a2600_state,a2600)
@@ -313,7 +313,7 @@ MACHINE_START_MEMBER(a2600_state,a2600)
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart));
break;
}
-
+
/* Banks may have changed, reset the cpu so it uses the correct reset vector */
m_maincpu->reset();
}
diff --git a/src/mess/drivers/a7800.c b/src/mess/drivers/a7800.c
index 6c5ba9c3b19..8352d1ab71f 100644
--- a/src/mess/drivers/a7800.c
+++ b/src/mess/drivers/a7800.c
@@ -9,7 +9,7 @@
2002/05/13 kubecj added more banks for bankswitching
added PAL machine description
changed clock to be precise
- improved cart emulation (in machine/)
+ improved cart emulation (in machine/)
2012/10/25 Robert Tuccitto NTSC Color Generator utilized for
color palette with hue shift/start
@@ -88,10 +88,10 @@
2014/05/06 Mike Saarna/Robert Tuccitto Brought initial Maria cycle counts
inline from measurements taken with logic analyzer and tests.
-
+
2014/08/25 Fabio Priuli Converted carts to be slot devices and cleaned
up the driver (removed the pokey, cleaned up rom regions, etc.)
-
+
***************************************************************************/
#include "emu.h"
@@ -121,19 +121,19 @@ public:
m_io_console_buttons(*this, "console_buttons"),
m_cart(*this, "cartslot"),
m_screen(*this, "screen") { }
-
+
int m_lines;
int m_ispal;
-
+
int m_ctrl_lock;
int m_ctrl_reg;
int m_maria_flag;
int m_p1_one_button;
int m_p2_one_button;
int m_bios_enabled;
-
+
UINT8 *m_bios;
-
+
DECLARE_READ8_MEMBER(bios_or_cart_r);
DECLARE_WRITE8_MEMBER(ram0_w);
DECLARE_READ8_MEMBER(tia_r);
@@ -151,7 +151,7 @@ public:
DECLARE_READ8_MEMBER(riot_joystick_r);
DECLARE_READ8_MEMBER(riot_console_button_r);
DECLARE_WRITE8_MEMBER(riot_button_pullup_w);
-
+
protected:
required_device<cpu_device> m_maincpu;
required_device<tia_device> m_tia;
@@ -223,7 +223,7 @@ READ8_MEMBER(a7800_state::tia_r)
return 0x80;
default:
logerror("undefined TIA read %x\n",offset);
-
+
}
return 0xff;
}
@@ -231,7 +231,7 @@ READ8_MEMBER(a7800_state::tia_r)
// TIA
WRITE8_MEMBER(a7800_state::tia_w)
{
- if (offset < 0x20)
+ if (offset < 0x20)
{ //INPTCTRL covers TIA registers 0x00-0x1F until locked
if (data & 0x01)
{
@@ -291,12 +291,12 @@ static ADDRESS_MAP_START( a7800_mem, AS_PROGRAM, 8, a7800_state )
AM_RANGE(0x2040, 0x20ff) AM_RAMBANK("ram0") // mirror (6116 block 0)
AM_RANGE(0x2140, 0x21ff) AM_RAMBANK("ram1") // mirror (6116 block 1)
- AM_RANGE(0x2800, 0x2fff) AM_RAMBANK("mirror") // these should mirror "main_ram" (according to docs)
+ AM_RANGE(0x2800, 0x2fff) AM_RAMBANK("mirror") // these should mirror "main_ram" (according to docs)
AM_RANGE(0x3000, 0x37ff) AM_RAMBANK("mirror") // but system have issues in such case...
AM_RANGE(0x3800, 0x3fff) AM_RAMBANK("mirror")
AM_RANGE(0x4000, 0xffff) AM_DEVWRITE("cartslot", a78_cart_slot_device, write_40xx)
AM_RANGE(0x4000, 0xbfff) AM_DEVREAD("cartslot", a78_cart_slot_device, read_40xx)
- AM_RANGE(0xc000, 0xffff) AM_READ(bios_or_cart_r) // here also the BIOS can be accessed
+ AM_RANGE(0xc000, 0xffff) AM_READ(bios_or_cart_r) // here also the BIOS can be accessed
ADDRESS_MAP_END
@@ -1313,7 +1313,7 @@ void a7800_state::machine_start()
save_item(NAME(m_ctrl_lock));
save_item(NAME(m_ctrl_reg));
save_item(NAME(m_maria_flag));
-
+
// install additional handlers, if needed
if (m_cart->exists())
{
diff --git a/src/mess/drivers/aim65.c b/src/mess/drivers/aim65.c
index 305b61a8ca5..6f48b026494 100644
--- a/src/mess/drivers/aim65.c
+++ b/src/mess/drivers/aim65.c
@@ -158,7 +158,7 @@ int aim65_state::load_cart(device_image_interface &image, generic_slot_device *s
{
astring errmsg;
errmsg.printf("Attempted to load file with wrong extension\nSocket '%s' only accepts files with '.%s' extension",
- slot_tag, slot_tag);
+ slot_tag, slot_tag);
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr());
return IMAGE_INIT_FAIL;
}
diff --git a/src/mess/drivers/apf.c b/src/mess/drivers/apf.c
index a5d21ac78e9..1ad3d9c15eb 100644
--- a/src/mess/drivers/apf.c
+++ b/src/mess/drivers/apf.c
@@ -246,7 +246,7 @@ void apf_state::machine_start()
m_has_cart_ram = true;
break;
}
-
+
m_cart->save_ram();
}
}
@@ -310,7 +310,7 @@ static ADDRESS_MAP_START( apfm1000_map, AS_PROGRAM, 8, apf_state )
AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM AM_SHARE("videoram")
AM_RANGE(0x2000, 0x3fff) AM_MIRROR(0x1ffc) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
AM_RANGE(0x4000, 0x4fff) AM_MIRROR(0x1000) AM_ROM AM_REGION("roms", 0)
- AM_RANGE(0x6800, 0x7fff) AM_NOP // BASIC accesses ROM here too, but this is installed at machine_start
+ AM_RANGE(0x6800, 0x7fff) AM_NOP // BASIC accesses ROM here too, but this is installed at machine_start
AM_RANGE(0x8000, 0x9fff) AM_DEVREAD("cartslot", apf_cart_slot_device, read_rom)
AM_RANGE(0xe000, 0xefff) AM_MIRROR(0x1000) AM_ROM AM_REGION("roms", 0)
ADDRESS_MAP_END
diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c
index 5da2149d2f8..e69ecef172c 100644
--- a/src/mess/drivers/apple2.c
+++ b/src/mess/drivers/apple2.c
@@ -177,14 +177,14 @@ UniDisk 3.5 drive!)
The external drive port supports not only 5.25 drives but also UniDisk and
Apple 3.5 drives, allowing via daisy-chaining any combination of UniDisk,
Apple 3.5 and Apple 5.25 drives - up to three devices
-
-----------------------------------
-
-TK3000 keyboard matrix
-
-Data bus D0-D7 is X0-X7
-Address bus A0-A11 is Y0-Y11
-
+
+----------------------------------
+
+TK3000 keyboard matrix
+
+Data bus D0-D7 is X0-X7
+Address bus A0-A11 is Y0-Y11
+
***************************************************************************/
@@ -267,16 +267,16 @@ static ADDRESS_MAP_START( apple2_map, AS_PROGRAM, 8, apple2_state )
ADDRESS_MAP_END
/*
-
+
LS259 at H12
-
+
A8 = D
A9 = A
A10 = B
A11 = C
-
- 374/259 outputs to 65C02 c000/c010 selected by Z80 WR OR Z80 IORQ? (schematic is not super legible)
-
+
+ 374/259 outputs to 65C02 c000/c010 selected by Z80 WR OR Z80 IORQ? (schematic is not super legible)
+
*/
// RAM and ROM alternate in 8K blocks: ROM at 0/4/8/c, RAM at 2/6/a/e (RAM is only 1k and further mirrors inside those locations)
@@ -1028,9 +1028,9 @@ static SLOT_INTERFACE_START(apple2_cards)
SLOT_INTERFACE("mcms1", A2BUS_MCMS1) /* Mountain Computer Music System, card 1 of 2 */
SLOT_INTERFACE("mcms2", A2BUS_MCMS2) /* Mountain Computer Music System, card 2 of 2. must be in card 1's slot + 1! */
SLOT_INTERFACE("dx1", A2BUS_DX1) /* Decillonix DX-1 sampler card */
- SLOT_INTERFACE("tm2ho", A2BUS_TIMEMASTERHO) /* Applied Engineering TimeMaster II H.O. */
- SLOT_INTERFACE("mouse", A2BUS_MOUSE) /* Apple II Mouse Card */
-// SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN) /* Magic Musician Card */
+ SLOT_INTERFACE("tm2ho", A2BUS_TIMEMASTERHO) /* Applied Engineering TimeMaster II H.O. */
+ SLOT_INTERFACE("mouse", A2BUS_MOUSE) /* Apple II Mouse Card */
+// SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN) /* Magic Musician Card */
SLOT_INTERFACE_END
static SLOT_INTERFACE_START(apple2eaux_cards)
@@ -1197,7 +1197,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( tk3000, apple2e )
MCFG_CPU_REPLACE("maincpu", M65C02, 1021800) /* close to actual CPU frequency of 1.020484 MHz */
- MCFG_CPU_ADD("subcpu", Z80, 1021800) // schematics are illegible on where the clock comes from, but it *seems* to be the same as the 65C02 clock
+ MCFG_CPU_ADD("subcpu", Z80, 1021800) // schematics are illegible on where the clock comes from, but it *seems* to be the same as the 65C02 clock
MCFG_CPU_PROGRAM_MAP(tk3000_kbd_map)
MACHINE_CONFIG_END
@@ -1330,7 +1330,7 @@ static MACHINE_CONFIG_DERIVED( laser128ex2, apple2c )
MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl4", A2BUS_LASER128, NULL)
MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl5", A2BUS_LASER128, NULL)
MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_LASER128, NULL)
- MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl7", A2BUS_LASER128, NULL)
+ MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl7", A2BUS_LASER128, NULL)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( space84, apple2p )
@@ -1672,7 +1672,7 @@ ROM_START(las128e2)
ROM_LOAD ( "341-0265-a.chr", 0x1000, 0x1000, BAD_DUMP CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) // need to dump real laser rom
ROM_REGION(0x8000,"maincpu",0)
- ROM_LOAD( "laser 128ex2 rom version 6.1.bin", 0x000000, 0x008000, CRC(7f911c90) SHA1(125754c1bd777d4c510f5239b96178c6f2e3236b) )
+ ROM_LOAD( "laser 128ex2 rom version 6.1.bin", 0x000000, 0x008000, CRC(7f911c90) SHA1(125754c1bd777d4c510f5239b96178c6f2e3236b) )
ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, BAD_DUMP CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // need to dump real laser rom
diff --git a/src/mess/drivers/apple2gs.c b/src/mess/drivers/apple2gs.c
index b4bc5f463ce..485dce64382 100644
--- a/src/mess/drivers/apple2gs.c
+++ b/src/mess/drivers/apple2gs.c
@@ -576,7 +576,7 @@ ROM_START(apple2gsr0p2) // 3/10/1986 Cortland prototype, boots as "Apple //'ing
ROM_LOAD ( "apple2gs.chr", 0x0000, 0x1000, CRC(91e53cd8) SHA1(34e2443e2ef960a36c047a09ed5a93f471797f89))
ROM_REGION(0x20000,"maincpu",0)
- ROM_LOAD( "apple iigs alpha rom 2.0 19860310.bin", 0x000000, 0x020000, CRC(a47d275f) SHA1(c5836adcfc8be69c7351b84afa94c814e8d92b81) )
+ ROM_LOAD( "apple iigs alpha rom 2.0 19860310.bin", 0x000000, 0x020000, CRC(a47d275f) SHA1(c5836adcfc8be69c7351b84afa94c814e8d92b81) )
ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
diff --git a/src/mess/drivers/apple3.c b/src/mess/drivers/apple3.c
index 2edb7caafa7..9035551bd09 100644
--- a/src/mess/drivers/apple3.c
+++ b/src/mess/drivers/apple3.c
@@ -33,7 +33,7 @@ static SLOT_INTERFACE_START(apple3_cards)
SLOT_INTERFACE("cffa2", A2BUS_CFFA2_6502) /* CFFA2000 Compact Flash for Apple II (www.dreher.net), 6502 firmware */
SLOT_INTERFACE("applicard", A2BUS_APPLICARD) /* PCPI Applicard */
SLOT_INTERFACE("thclock", A2BUS_THUNDERCLOCK) /* ThunderWare ThunderClock Plus - driver assumes slot 2 by default */
- SLOT_INTERFACE("mouse", A2BUS_MOUSE) /* Apple II Mouse Card */
+ SLOT_INTERFACE("mouse", A2BUS_MOUSE) /* Apple II Mouse Card */
SLOT_INTERFACE_END
static SLOT_INTERFACE_START( a3_floppies )
diff --git a/src/mess/drivers/atari400.c b/src/mess/drivers/atari400.c
index 78c9667e54d..5cd907f2368 100644
--- a/src/mess/drivers/atari400.c
+++ b/src/mess/drivers/atari400.c
@@ -252,7 +252,7 @@ public:
m_8000(*this, "8000"),
m_a000(*this, "a000"),
m_cart(*this, "cartleft"),
- m_cart2(*this, "cartright") { }
+ m_cart2(*this, "cartright") { }
DECLARE_MACHINE_START(a400);
DECLARE_MACHINE_START(a800);
@@ -267,7 +267,7 @@ public:
DECLARE_WRITE8_MEMBER(a600xl_pia_pb_w);
DECLARE_WRITE8_MEMBER(a800xl_pia_pb_w);
- DECLARE_READ8_MEMBER(read_d5xx); // at least one cart type can enable/disable roms when reading
+ DECLARE_READ8_MEMBER(read_d5xx); // at least one cart type can enable/disable roms when reading
DECLARE_WRITE8_MEMBER(disable_cart);
// these are needed to handle carts which can disable ROM without
@@ -290,13 +290,13 @@ public:
DECLARE_WRITE8_MEMBER(xegs_low_w);
DECLARE_READ8_MEMBER(xegs_high_r);
DECLARE_WRITE8_MEMBER(xegs_high_w);
-
+
TIMER_DEVICE_CALLBACK_MEMBER(a400_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(a800xl_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(a5200_interrupt);
-
+
protected:
- //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state
+ //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state
required_device<ram_device> m_ram;
required_device<pia6821_device> m_pia;
optional_device<dac_device> m_dac;
@@ -310,7 +310,7 @@ protected:
int m_cart_disabled, m_cart_helper;
int m_last_offs;
UINT8 m_mmu, m_ext_bank;
-
+
void setup_ram(int bank,UINT32 size);
void setup_cart(a800_cart_slot_device *slot);
};
@@ -334,18 +334,18 @@ READ8_MEMBER(a400_state::a600xl_low_r)
READ8_MEMBER(a400_state::a1200xl_low_r)
{
- if (offset < 0x5000) // 0x0000-0x4fff
+ if (offset < 0x5000) // 0x0000-0x4fff
return m_ram->pointer()[offset];
- else if (offset < 0x5800) // 0x5000-0x57ff
+ else if (offset < 0x5800) // 0x5000-0x57ff
{
if (m_mmu & 0x80)
return m_ram->pointer()[offset];
else
return m_region_maincpu->base()[0xd000 + (offset & 0x7ff)];
}
- else if (offset < 0xc000) // 0x5800-0xbfff
+ else if (offset < 0xc000) // 0x5800-0xbfff
return m_ram->pointer()[offset];
- else // 0xc000-0xcfff
+ else // 0xc000-0xcfff
{
if (!(m_mmu & 0x01))
return m_ram->pointer()[offset];
@@ -356,25 +356,25 @@ READ8_MEMBER(a400_state::a1200xl_low_r)
READ8_MEMBER(a400_state::a800xl_low_r)
{
- if (offset < 0x5000) // 0x0000-0x4fff
+ if (offset < 0x5000) // 0x0000-0x4fff
return m_ram->pointer()[offset];
- else if (offset < 0x5800) // 0x5000-0x57ff
+ else if (offset < 0x5800) // 0x5000-0x57ff
{
if (m_mmu & 0x80)
return m_ram->pointer()[offset];
else
return m_region_maincpu->base()[0xd000 + (offset & 0x7ff)];
}
- else if (offset < 0xa000) // 0x5800-0x9fff
+ else if (offset < 0xa000) // 0x5800-0x9fff
return m_ram->pointer()[offset];
- else if (offset < 0xc000) // 0xa000-0xbfff
+ else if (offset < 0xc000) // 0xa000-0xbfff
{
if (m_mmu & 0x02)
return m_ram->pointer()[offset];
else
return m_region_maincpu->base()[(offset & 0x1fff) + 0xa000];
}
- else // 0xc000-0xcfff
+ else // 0xc000-0xcfff
{
if (!(m_mmu & 0x01))
return m_ram->pointer()[offset];
@@ -385,21 +385,21 @@ READ8_MEMBER(a400_state::a800xl_low_r)
WRITE8_MEMBER(a400_state::a800xl_low_w)
{
- if (offset < 0x5000) // 0x0000-0x4fff
+ if (offset < 0x5000) // 0x0000-0x4fff
m_ram->pointer()[offset] = data;
- else if (offset < 0x5800) // 0x5000-0x57ff
+ else if (offset < 0x5800) // 0x5000-0x57ff
{
if (m_mmu & 0x80)
m_ram->pointer()[offset] = data;
}
- else if (offset < 0xa000) // 0x5800-0x7fff
+ else if (offset < 0xa000) // 0x5800-0x7fff
m_ram->pointer()[offset] = data;
- else if (offset < 0xc000) // 0xa000-0xbfff
+ else if (offset < 0xc000) // 0xa000-0xbfff
{
if (m_mmu & 0x02)
m_ram->pointer()[offset] = data;
}
- else // 0xc000-0xcfff
+ else // 0xc000-0xcfff
{
if (!(m_mmu & 0x01))
m_ram->pointer()[offset] = data;
@@ -422,9 +422,9 @@ WRITE8_MEMBER(a400_state::a800xl_high_w)
READ8_MEMBER(a400_state::a130xe_low_r)
{
- if (offset < 0x4000) // 0x0000-0x3fff
+ if (offset < 0x4000) // 0x0000-0x3fff
return m_ram->pointer()[offset];
- else if (offset < 0x8000) // 0x4000-0x7fff
+ else if (offset < 0x8000) // 0x4000-0x7fff
{
// NOTE: ANTIC accesses to extra RAM are not supported yet!
if (!(m_mmu & 0x80) && offset >= 0x5000 && offset < 0x5800)
@@ -434,16 +434,16 @@ READ8_MEMBER(a400_state::a130xe_low_r)
else
return m_ram->pointer()[offset];
}
- else if (offset < 0xa000) // 0x8000-0x9fff
+ else if (offset < 0xa000) // 0x8000-0x9fff
return m_ram->pointer()[offset];
- else if (offset < 0xc000) // 0xa000-0xbfff
+ else if (offset < 0xc000) // 0xa000-0xbfff
{
if (m_mmu & 0x02)
return m_ram->pointer()[offset];
else
return m_region_maincpu->base()[(offset & 0x1fff) + 0xa000];
}
- else // 0xc000-0xcfff
+ else // 0xc000-0xcfff
{
if (!(m_mmu & 0x01))
return m_ram->pointer()[offset];
@@ -454,9 +454,9 @@ READ8_MEMBER(a400_state::a130xe_low_r)
WRITE8_MEMBER(a400_state::a130xe_low_w)
{
- if (offset < 0x4000) // 0x0000-0x3fff
+ if (offset < 0x4000) // 0x0000-0x3fff
m_ram->pointer()[offset] = data;
- else if (offset < 0x8000) // 0x4000-0x7fff
+ else if (offset < 0x8000) // 0x4000-0x7fff
{
// NOTE: ANTIC accesses to extra RAM are not supported yet!
if (!(m_mmu & 0x80) && offset >= 0x5000 && offset < 0x5800)
@@ -466,14 +466,14 @@ WRITE8_MEMBER(a400_state::a130xe_low_w)
else
m_ram->pointer()[offset] = data;
}
- else if (offset < 0xa000) // 0x5800-0x7fff
+ else if (offset < 0xa000) // 0x5800-0x7fff
m_ram->pointer()[offset] = data;
- else if (offset < 0xc000) // 0xa000-0xbfff
+ else if (offset < 0xc000) // 0xa000-0xbfff
{
if (m_mmu & 0x02)
m_ram->pointer()[offset] = data;
}
- else // 0xc000-0xcfff
+ else // 0xc000-0xcfff
{
if (!(m_mmu & 0x01))
m_ram->pointer()[offset] = data;
@@ -482,22 +482,22 @@ WRITE8_MEMBER(a400_state::a130xe_low_w)
READ8_MEMBER(a400_state::xegs_low_r)
{
- if (offset < 0x5000) // 0x0000-0x4fff
+ if (offset < 0x5000) // 0x0000-0x4fff
return m_ram->pointer()[offset];
- else if (offset < 0x5800) // 0x5000-0x57ff
+ else if (offset < 0x5800) // 0x5000-0x57ff
{
if (m_mmu & 0x80)
return m_ram->pointer()[offset];
else
return m_region_maincpu->base()[0xd000 + (offset & 0x7ff)];
}
- else if (offset < 0x8000) // 0x5800-0x7fff
+ else if (offset < 0x8000) // 0x5800-0x7fff
return m_ram->pointer()[offset];
- else if (offset < 0xa000) // 0x8000-0x9fff
+ else if (offset < 0xa000) // 0x8000-0x9fff
return m_region_maincpu->base()[0x8000 + (offset & 0x1fff)];
- else if (offset < 0xc000) // 0xa000-0xbfff
+ else if (offset < 0xc000) // 0xa000-0xbfff
return m_region_maincpu->base()[0x8000 + (offset & 0x1fff)];
- else // 0xc000-0xcfff
+ else // 0xc000-0xcfff
{
if (!(m_mmu & 0x01))
return m_ram->pointer()[offset];
@@ -508,18 +508,18 @@ READ8_MEMBER(a400_state::xegs_low_r)
WRITE8_MEMBER(a400_state::xegs_low_w)
{
- if (offset < 0x5000) // 0x0000-0x4fff
+ if (offset < 0x5000) // 0x0000-0x4fff
m_ram->pointer()[offset] = data;
- else if (offset < 0x5800) // 0x5000-0x57ff
+ else if (offset < 0x5800) // 0x5000-0x57ff
{
if (m_mmu & 0x80)
m_ram->pointer()[offset] = data;
}
- else if (offset < 0x8000) // 0x5800-0x7fff
+ else if (offset < 0x8000) // 0x5800-0x7fff
m_ram->pointer()[offset] = data;
- else if (offset < 0xc000) // 0xa000-0xbfff
+ else if (offset < 0xc000) // 0xa000-0xbfff
return;
- else // 0xc000-0xcfff
+ else // 0xc000-0xcfff
{
if (!(m_mmu & 0x01))
m_ram->pointer()[offset] = data;
@@ -1705,14 +1705,14 @@ void a400_state::setup_ram(int bank, UINT32 size)
switch (bank)
{
- case 0: // 0x0000-0x7fff
+ case 0: // 0x0000-0x7fff
ram_top = MIN(size, 0x8000) - 1;
m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, ram_top, "0000");
if (m_0000 == NULL)
m_0000.findit();
m_0000->set_base(m_ram->pointer());
break;
- case 1: // 0x8000-0x9fff
+ case 1: // 0x8000-0x9fff
ram_top = MIN(size, 0xa000) - 1;
if (ram_top > 0x8000)
{
@@ -1720,9 +1720,9 @@ void a400_state::setup_ram(int bank, UINT32 size)
if (m_8000 == NULL)
m_8000.findit();
m_8000->set_base(m_ram->pointer() + 0x8000);
- }
+ }
break;
- case 2: // 0xa000-0xbfff
+ case 2: // 0xa000-0xbfff
ram_top = MIN(size, 0xc000) - 1;
if (ram_top > 0xa000)
{
@@ -1730,7 +1730,7 @@ void a400_state::setup_ram(int bank, UINT32 size)
if (m_a000 == NULL)
m_a000.findit();
m_a000->set_base(m_ram->pointer() + 0xa000);
- }
+ }
break;
}
}
@@ -1745,7 +1745,7 @@ READ8_MEMBER(a400_state::special_read_8000)
{
offset += 0x8000;
if (m_ram->size() < offset)
- return 0;
+ return 0;
else
return m_ram->pointer()[offset];
}
@@ -1769,7 +1769,7 @@ READ8_MEMBER(a400_state::special_read_a000)
{
offset += 0xa000;
if (m_ram->size() < offset)
- return 0;
+ return 0;
else
return m_ram->pointer()[offset];
}
@@ -1808,7 +1808,7 @@ WRITE8_MEMBER(a400_state::disable_cart)
case A800_EXPRESS:
case A800_DIAMOND:
case A800_WILLIAMS:
- // use m_cart_disabled & m_last_offs to avoid continuous remapping of
+ // use m_cart_disabled & m_last_offs to avoid continuous remapping of
// the memory space in some games (e.g. dropzone)
if (offset & 0x8 && !m_cart_disabled)
m_cart_disabled = 1;
@@ -1816,7 +1816,7 @@ WRITE8_MEMBER(a400_state::disable_cart)
{
if (m_cart_disabled)
m_cart_disabled = 0;
-
+
if ((offset & 0x7) != m_last_offs)
{
// we enter here only if we are writing to a different offset than last time
@@ -1833,7 +1833,7 @@ WRITE8_MEMBER(a400_state::disable_cart)
{
if (m_cart_disabled)
m_cart_disabled = 0;
-
+
if ((offset & 0x0f) != m_last_offs)
{
// we enter here only if we are writing to a different offset than last time
@@ -1845,7 +1845,7 @@ WRITE8_MEMBER(a400_state::disable_cart)
case A800_SPARTADOS:
// writes with offset & 8 are also used to enable/disable the subcart, so they go through!
m_cart->write_d5xx(space, offset, data);
- break;
+ break;
case A800_OSSM091:
case A800_OSS8K:
if ((offset & 0x9) == 0x08)
@@ -1868,7 +1868,7 @@ WRITE8_MEMBER(a400_state::disable_cart)
break;
default:
break;
- }
+ }
}
}
@@ -1958,7 +1958,7 @@ void a400_state::setup_cart(a800_cart_slot_device *slot)
m_maincpu->space(AS_PROGRAM).install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(a800_cart_slot_device::write_80xx),(a800_cart_slot_device*)slot));
m_maincpu->space(AS_PROGRAM).unmap_write(0x6000, 0xbfff);
break;
- }
+ }
}
}
@@ -2014,7 +2014,7 @@ MACHINE_START_MEMBER( a400_state, a800 )
MACHINE_START_MEMBER( a400_state, a800xl )
{
m_mmu = 0xfd;
- m_ext_bank = 0x03; // only used by a130xe
+ m_ext_bank = 0x03; // only used by a130xe
setup_cart(m_cart);
save_item(NAME(m_cart_disabled));
@@ -2056,8 +2056,8 @@ WRITE8_MEMBER(a400_state::gtia_cb)
**************************************************************/
WRITE8_MEMBER(a400_state::a600xl_pia_pb_w)
-{
- m_mmu = data;
+{
+ m_mmu = data;
}
WRITE8_MEMBER(a400_state::a800xl_pia_pb_w)
diff --git a/src/mess/drivers/atarist.c b/src/mess/drivers/atarist.c
index 329213a6ed1..86ac1af97da 100644
--- a/src/mess/drivers/atarist.c
+++ b/src/mess/drivers/atarist.c
@@ -1228,7 +1228,7 @@ static ADDRESS_MAP_START( st_map, AS_PROGRAM, 16, st_state )
AM_RANGE(0x000008, 0x1fffff) AM_RAM
AM_RANGE(0x200000, 0x3fffff) AM_RAM
AM_RANGE(0x400000, 0xf9ffff) AM_READWRITE(berr_r, berr_w)
- //AM_RANGE(0xfa0000, 0xfbffff) // mapped by the cartslot
+ //AM_RANGE(0xfa0000, 0xfbffff) // mapped by the cartslot
AM_RANGE(0xfc0000, 0xfeffff) AM_ROM AM_REGION(M68000_TAG, 0) AM_WRITE(berr_w)
AM_RANGE(0xff8000, 0xff8001) AM_READWRITE8(mmu_r, mmu_w, 0x00ff)
AM_RANGE(0xff8200, 0xff8203) AM_READWRITE8(shifter_base_r, shifter_base_w, 0x00ff)
@@ -1272,7 +1272,7 @@ static ADDRESS_MAP_START( megast_map, AS_PROGRAM, 16, megast_state )
AM_RANGE(0x000000, 0x000007) AM_ROM AM_REGION(M68000_TAG, 0)
AM_RANGE(0x000008, 0x1fffff) AM_RAM
AM_RANGE(0x200000, 0x3fffff) AM_RAM
- //AM_RANGE(0xfa0000, 0xfbffff) // mapped by the cartslot
+ //AM_RANGE(0xfa0000, 0xfbffff) // mapped by the cartslot
AM_RANGE(0xfc0000, 0xfeffff) AM_ROM AM_REGION(M68000_TAG, 0)
// AM_RANGE(0xff7f30, 0xff7f31) AM_READWRITE(blitter_dst_inc_y_r, blitter_dst_inc_y_w) // for TOS 1.02
AM_RANGE(0xff8000, 0xff8001) AM_READWRITE8(mmu_r, mmu_w, 0x00ff)
diff --git a/src/mess/drivers/atom.c b/src/mess/drivers/atom.c
index 33da05e91d1..c3d6e1cc723 100644
--- a/src/mess/drivers/atom.c
+++ b/src/mess/drivers/atom.c
@@ -250,7 +250,7 @@ static ADDRESS_MAP_START( atom_mem, AS_PROGRAM, 8, atom_state )
AM_RANGE(0x0a05, 0x7fff) AM_RAM
AM_RANGE(0x8000, 0x97ff) AM_RAM AM_SHARE("video_ram")
AM_RANGE(0x9800, 0x9fff) AM_RAM
-// AM_RANGE(0xa000, 0xafff) // mapped by the cartslot
+// AM_RANGE(0xa000, 0xafff) // mapped by the cartslot
AM_RANGE(0xb000, 0xb003) AM_MIRROR(0x3fc) AM_DEVREADWRITE(INS8255_TAG, i8255_device, read, write)
// AM_RANGE(0xb400, 0xb403) AM_DEVREADWRITE(MC6854_TAG, mc6854_device, read, write)
// AM_RANGE(0xb404, 0xb404) AM_READ_PORT("ECONET")
@@ -680,7 +680,7 @@ int atom_state::load_cart(device_image_interface &image, generic_slot_device *sl
}
slot->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- slot->common_load_rom(slot->get_rom_base(), size, "rom");
+ slot->common_load_rom(slot->get_rom_base(), size, "rom");
return IMAGE_INIT_PASS;
}
@@ -882,12 +882,12 @@ ROM_END
DRIVER_INIT_MEMBER(atomeb_state, atomeb)
{
// these have to be set here, so that we can pass m_ext[*] to device_image_load!
- char str[8];
+ char str[8];
for (int i = 0; i < 16; i++)
{
sprintf(str,"rom_a%x", i);
m_ext[i] = machine().device<generic_slot_device>(str);
- }
+ }
}
diff --git a/src/mess/drivers/bbcbc.c b/src/mess/drivers/bbcbc.c
index af1a7a703c7..a67db079108 100644
--- a/src/mess/drivers/bbcbc.c
+++ b/src/mess/drivers/bbcbc.c
@@ -42,7 +42,7 @@ public:
static ADDRESS_MAP_START( bbcbc_prg, AS_PROGRAM, 8, bbcbc_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
- //AM_RANGE(0x4000, 0xbfff) // mapped by the cartslot
+ //AM_RANGE(0x4000, 0xbfff) // mapped by the cartslot
AM_RANGE(0xe000, 0xe02f) AM_RAM
AM_RANGE(0xe030, 0xe030) AM_READ_PORT("LINE01")
AM_RANGE(0xe031, 0xe031) AM_READ_PORT("LINE02")
diff --git a/src/mess/drivers/beta.c b/src/mess/drivers/beta.c
index daec10b2c1c..14799269d79 100644
--- a/src/mess/drivers/beta.c
+++ b/src/mess/drivers/beta.c
@@ -60,7 +60,7 @@ public:
m_q8(*this, "Q8"),
m_q9(*this, "Q9")
{ }
-
+
required_device<cpu_device> m_maincpu;
required_device<speaker_sound_device> m_speaker;
required_device<generic_slot_device> m_eprom;
@@ -68,18 +68,18 @@ public:
required_ioport m_q7;
required_ioport m_q8;
required_ioport m_q9;
-
+
virtual void machine_start();
-
+
DECLARE_READ8_MEMBER( riot_pa_r );
DECLARE_WRITE8_MEMBER( riot_pa_w );
DECLARE_READ8_MEMBER( riot_pb_r );
DECLARE_WRITE8_MEMBER( riot_pb_w );
DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
-
+
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( beta_eprom );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( beta_eprom );
-
+
/* EPROM state */
int m_eprom_oe;
int m_eprom_ce;
@@ -87,11 +87,11 @@ public:
UINT8 m_eprom_data;
UINT8 m_old_data;
dynamic_buffer m_eprom_rom;
-
+
/* display state */
UINT8 m_ls145_p;
UINT8 m_segment;
-
+
emu_timer *m_led_refresh_timer;
TIMER_CALLBACK_MEMBER(led_refresh);
};
@@ -285,16 +285,16 @@ WRITE8_MEMBER( beta_state::riot_pb_w )
DEVICE_IMAGE_LOAD_MEMBER( beta_state, beta_eprom )
{
UINT32 size = m_eprom->common_get_size("rom");
-
+
if (size != 0x800)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_eprom->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_eprom->common_load_rom(m_eprom->get_rom_base(), size, "rom");
-
+ m_eprom->common_load_rom(m_eprom->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/casloopy.c b/src/mess/drivers/casloopy.c
index 5490c6f131c..51e7eb991d7 100644
--- a/src/mess/drivers/casloopy.c
+++ b/src/mess/drivers/casloopy.c
@@ -478,13 +478,13 @@ DEVICE_IMAGE_LOAD_MEMBER( casloopy_state, loopy_cart )
UINT8 *SRC, *DST;
dynamic_buffer temp;
temp.resize(0x200000);
-
+
m_cart->rom_alloc(size, GENERIC_ROM32_WIDTH, ENDIANNESS_LITTLE);
SRC = temp;
DST = m_cart->get_rom_base();
- m_cart->common_load_rom(temp, size, "rom");
-
+ m_cart->common_load_rom(temp, size, "rom");
+
// fix endianness
for (int i = 0; i < 0x200000; i += 4)
{
@@ -495,7 +495,7 @@ DEVICE_IMAGE_LOAD_MEMBER( casloopy_state, loopy_cart )
DST[i + 2] = tempa;
DST[i + 3] = tempb;
}
-
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/cc40.c b/src/mess/drivers/cc40.c
index 2211b16efb1..185fcb60b5b 100644
--- a/src/mess/drivers/cc40.c
+++ b/src/mess/drivers/cc40.c
@@ -51,7 +51,7 @@
provided that the machine is turned off properly. If a program is running,
you may have to press [BREAK] before turning the CC-40 off. If RAM contents
ends up dodgy somehow, just delete the nvram files.
-
+
Officially, minimum total RAM size is 6KB. The system will still boot with less,
but don't expect all software to work properly.
@@ -114,7 +114,7 @@ public:
UINT8 m_clock_control;
UINT8 m_clock_divider;
UINT8 m_key_select;
-
+
UINT8 *m_sysram[2];
UINT16 m_sysram_size[2];
UINT16 m_sysram_end[2];
@@ -165,8 +165,8 @@ DEVICE_IMAGE_LOAD_MEMBER(cc40_state, cc40_cartridge)
return IMAGE_INIT_FAIL;
}
- m_cart->rom_alloc(0x20000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // allocate a larger ROM region to have 4x32K banks
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+ m_cart->rom_alloc(0x20000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // allocate a larger ROM region to have 4x32K banks
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
return IMAGE_INIT_PASS;
}
@@ -265,7 +265,7 @@ WRITE8_MEMBER(cc40_state::bus_control_w)
m_sysram_mask[0] = d3 - 1;
m_sysram_end[1] = d3 + d2;
m_sysram_mask[1] = d2 - 1;
-
+
// d4,d5: cartridge memory addressing
// 00: 2K @ $5000-$57ff & $5800-$5fff
// 01: 8K @ $5000-$6fff & $7000-$8fff
@@ -524,12 +524,12 @@ void cc40_state::init_sysram(int chip, UINT16 size)
// init to largest possible
m_sysram[chip] = auto_alloc_array(machine(), UINT8, 0x2000);
save_pointer(NAME(m_sysram[chip]), 0x2000, chip);
-
+
save_item(NAME(m_sysram_size[chip]), chip);
save_item(NAME(m_sysram_end[chip]), chip);
save_item(NAME(m_sysram_mask[chip]), chip);
}
-
+
m_nvram[chip]->set_base(m_sysram[chip], size);
m_sysram_size[chip] = size;
}
diff --git a/src/mess/drivers/cgenie.c b/src/mess/drivers/cgenie.c
index 7e2422f466f..990e8fe3fec 100644
--- a/src/mess/drivers/cgenie.c
+++ b/src/mess/drivers/cgenie.c
@@ -492,16 +492,16 @@ static const floppy_interface cgenie_floppy_interface =
DEVICE_IMAGE_LOAD_MEMBER( cgenie_state, cgenie_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size > 0x1000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(0x1000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/channelf.c b/src/mess/drivers/channelf.c
index e555fafdb34..360026065b6 100644
--- a/src/mess/drivers/channelf.c
+++ b/src/mess/drivers/channelf.c
@@ -178,7 +178,7 @@ void channelf_state::machine_start()
m_maincpu->space(AS_PROGRAM).install_write_handler(0x3000, 0x3fff, write8_delegate(FUNC(channelf_cart_slot_device::write_bank),(channelf_cart_slot_device*)m_cart));
break;
}
-
+
m_cart->save_ram();
}
}
diff --git a/src/mess/drivers/concept.c b/src/mess/drivers/concept.c
index 2de213bad24..ade1949db95 100644
--- a/src/mess/drivers/concept.c
+++ b/src/mess/drivers/concept.c
@@ -196,8 +196,8 @@ INPUT_PORTS_END
SLOT_INTERFACE_START( concept_a2_cards )
SLOT_INTERFACE("fchdd", A2BUS_CORVUS) /* Corvus flat-cable HDD interface (see notes in a2corvus.c) */
- SLOT_INTERFACE("fdc01", A2BUS_CORVFDC01) /* Corvus WD1793 floppy controller */
- SLOT_INTERFACE("fdc02", A2BUS_CORVFDC02) /* Corvus NEC765 buffered floppy controller */
+ SLOT_INTERFACE("fdc01", A2BUS_CORVFDC01) /* Corvus WD1793 floppy controller */
+ SLOT_INTERFACE("fdc02", A2BUS_CORVFDC02) /* Corvus NEC765 buffered floppy controller */
SLOT_INTERFACE_END
diff --git a/src/mess/drivers/crvision.c b/src/mess/drivers/crvision.c
index 269d832135f..c984a021d63 100644
--- a/src/mess/drivers/crvision.c
+++ b/src/mess/drivers/crvision.c
@@ -712,7 +712,7 @@ void crvision_pal_state::machine_start()
// state saving
save_item(NAME(m_keylatch));
save_item(NAME(m_joylatch));
-
+
if (m_cart->exists())
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom40),(crvision_cart_slot_device*)m_cart));
@@ -729,7 +729,7 @@ void laser2001_state::machine_start()
// state saving
save_item(NAME(m_keylatch));
save_item(NAME(m_joylatch));
-
+
if (m_cart->exists())
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom40),(crvision_cart_slot_device*)m_cart));
diff --git a/src/mess/drivers/electron.c b/src/mess/drivers/electron.c
index c8bebb637b3..b42f5a94270 100644
--- a/src/mess/drivers/electron.c
+++ b/src/mess/drivers/electron.c
@@ -194,7 +194,7 @@ ROM_START(electron)
/* 24000 9 keyboard mirror */
/* 28000 10 Basic rom */
ROM_LOAD( "basic.rom", 0x28000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281) )
- /* 2c000 11 Basic rom mirror */
+ /* 2c000 11 Basic rom mirror */
ROM_COPY( "user1", 0x28000, 0x2c000, 0x4000 )
/* 30000 12 available for cartridges with a language ROM */
/* 34000 13 available for cartridges with a language ROM */
diff --git a/src/mess/drivers/ep64.c b/src/mess/drivers/ep64.c
index 0471c5b17b5..4ef1f30fb7c 100644
--- a/src/mess/drivers/ep64.c
+++ b/src/mess/drivers/ep64.c
@@ -320,7 +320,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( dave_64k_mem, AS_PROGRAM, 8, ep64_state )
AM_RANGE(0x000000, 0x007fff) AM_ROM AM_REGION(Z80_TAG, 0)
- //AM_RANGE(0x010000, 0x01ffff) // mapped by the cartslot
+ //AM_RANGE(0x010000, 0x01ffff) // mapped by the cartslot
AM_RANGE(0x3f0000, 0x3fffff) AM_DEVICE(NICK_TAG, nick_device, vram_map)
ADDRESS_MAP_END
diff --git a/src/mess/drivers/exelv.c b/src/mess/drivers/exelv.c
index 6dc28b4d4c9..f59fda313a6 100644
--- a/src/mess/drivers/exelv.c
+++ b/src/mess/drivers/exelv.c
@@ -361,7 +361,7 @@ WRITE8_MEMBER(exelv_state::tms7041_portd_w)
/*
- CARTRIDGE ACCESS
+ CARTRIDGE ACCESS
*/
READ8_MEMBER(exelv_state::rom_r)
{
@@ -466,7 +466,7 @@ PALETTE_INIT_MEMBER(exelv_state, exelv)
/* Machine Initialization */
MACHINE_START_MEMBER( exelv_state, exl100)
-{
+{
/* register for state saving */
save_item(NAME(m_tms7020_portb));
save_item(NAME(m_tms7041_portb));
@@ -481,7 +481,7 @@ MACHINE_START_MEMBER( exelv_state, exeltel)
UINT8 *rom = memregion("user1")->base() + 0x0200;
membank("bank1")->configure_entry(0, rom);
membank("bank1")->set_entry(0);
-
+
/* register for state saving */
save_item(NAME(m_tms7020_portb));
save_item(NAME(m_tms7041_portb));
diff --git a/src/mess/drivers/fc100.c b/src/mess/drivers/fc100.c
index 1b3a6e18335..b3c600750c0 100644
--- a/src/mess/drivers/fc100.c
+++ b/src/mess/drivers/fc100.c
@@ -114,7 +114,7 @@ private:
static ADDRESS_MAP_START( fc100_mem, AS_PROGRAM, 8, fc100_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE( 0x0000, 0x5fff ) AM_ROM AM_REGION("roms", 0)
- //AM_RANGE(0x6000, 0x6fff) // mapped by the cartslot
+ //AM_RANGE(0x6000, 0x6fff) // mapped by the cartslot
AM_RANGE( 0x7800, 0x7fff ) AM_READ_BANK("bankr") AM_WRITE_BANK("bankw") // Banked RAM/ROM
AM_RANGE( 0x8000, 0xbfff ) AM_RAM // expansion ram pack - if omitted you get a 'Pages?' prompt at boot
AM_RANGE( 0xc000, 0xffff ) AM_RAM AM_SHARE("videoram")
diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c
index 591058ab112..4d0aa7f1ab3 100644
--- a/src/mess/drivers/fm7.c
+++ b/src/mess/drivers/fm7.c
@@ -1001,105 +1001,105 @@ void fm7_state::fm7_update_bank(address_space & space, int bank, UINT8 physical)
, m_avbank8, m_avbank9, m_avbank10, m_avbank11, m_avbank12, m_avbank13, m_avbank14, m_avbank15, m_avbank16 };
avbank[bank]->set_bank(physical);
-/* UINT8* RAM = memregion("maincpu")->base();
- UINT16 size = 0xfff;
- char bank_name[10];
-
- if(bank == 15)
- size = 0xbff;
-
- sprintf(bank_name,"bank%d",bank+1);
-
- if(physical >= 0x10 && physical <= 0x1b)
- {
- switch(physical)
- {
- case 0x10:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram0_r),this),write8_delegate(FUNC(fm7_state::fm7_vram0_w),this));
- break;
- case 0x11:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram1_r),this),write8_delegate(FUNC(fm7_state::fm7_vram1_w),this));
- break;
- case 0x12:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram2_r),this),write8_delegate(FUNC(fm7_state::fm7_vram2_w),this));
- break;
- case 0x13:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram3_r),this),write8_delegate(FUNC(fm7_state::fm7_vram3_w),this));
- break;
- case 0x14:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram4_r),this),write8_delegate(FUNC(fm7_state::fm7_vram4_w),this));
- break;
- case 0x15:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram5_r),this),write8_delegate(FUNC(fm7_state::fm7_vram5_w),this));
- break;
- case 0x16:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram6_r),this),write8_delegate(FUNC(fm7_state::fm7_vram6_w),this));
- break;
- case 0x17:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram7_r),this),write8_delegate(FUNC(fm7_state::fm7_vram7_w),this));
- break;
- case 0x18:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram8_r),this),write8_delegate(FUNC(fm7_state::fm7_vram8_w),this));
- break;
- case 0x19:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram9_r),this),write8_delegate(FUNC(fm7_state::fm7_vram9_w),this));
- break;
- case 0x1a:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramA_r),this),write8_delegate(FUNC(fm7_state::fm7_vramA_w),this));
- break;
- case 0x1b:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramB_r),this),write8_delegate(FUNC(fm7_state::fm7_vramB_w),this));
- break;
- }
+/* UINT8* RAM = memregion("maincpu")->base();
+ UINT16 size = 0xfff;
+ char bank_name[10];
+
+ if(bank == 15)
+ size = 0xbff;
+
+ sprintf(bank_name,"bank%d",bank+1);
+
+ if(physical >= 0x10 && physical <= 0x1b)
+ {
+ switch(physical)
+ {
+ case 0x10:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram0_r),this),write8_delegate(FUNC(fm7_state::fm7_vram0_w),this));
+ break;
+ case 0x11:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram1_r),this),write8_delegate(FUNC(fm7_state::fm7_vram1_w),this));
+ break;
+ case 0x12:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram2_r),this),write8_delegate(FUNC(fm7_state::fm7_vram2_w),this));
+ break;
+ case 0x13:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram3_r),this),write8_delegate(FUNC(fm7_state::fm7_vram3_w),this));
+ break;
+ case 0x14:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram4_r),this),write8_delegate(FUNC(fm7_state::fm7_vram4_w),this));
+ break;
+ case 0x15:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram5_r),this),write8_delegate(FUNC(fm7_state::fm7_vram5_w),this));
+ break;
+ case 0x16:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram6_r),this),write8_delegate(FUNC(fm7_state::fm7_vram6_w),this));
+ break;
+ case 0x17:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram7_r),this),write8_delegate(FUNC(fm7_state::fm7_vram7_w),this));
+ break;
+ case 0x18:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram8_r),this),write8_delegate(FUNC(fm7_state::fm7_vram8_w),this));
+ break;
+ case 0x19:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram9_r),this),write8_delegate(FUNC(fm7_state::fm7_vram9_w),this));
+ break;
+ case 0x1a:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramA_r),this),write8_delegate(FUNC(fm7_state::fm7_vramA_w),this));
+ break;
+ case 0x1b:
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramB_r),this),write8_delegate(FUNC(fm7_state::fm7_vramB_w),this));
+ break;
+ }
// membank(bank+1)->set_base(RAM+(physical<<12)-0x10000);
- return;
- }
- if(physical == 0x1c)
- {
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_console_ram_banked_r),this),write8_delegate(FUNC(fm7_state::fm7_console_ram_banked_w),this));
- return;
- }
- if(physical == 0x1d)
- {
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_r),this),write8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_w),this));
- return;
- }
- if(physical == 0x35)
- {
- if(m_init_rom_en && (m_type == SYS_FM11 || m_type == SYS_FM16))
- {
- RAM = memregion("init")->base();
- space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space.nop_write(bank*0x1000,(bank*0x1000)+size);
- membank(bank_name)->set_base(RAM+(physical<<12)-0x35000);
- return;
- }
- }
- if(physical == 0x36 || physical == 0x37)
- {
- if(m_init_rom_en && (m_type != SYS_FM11 && m_type != SYS_FM16))
- {
- RAM = memregion("init")->base();
- space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space.nop_write(bank*0x1000,(bank*0x1000)+size);
- membank(bank_name)->set_base(RAM+(physical<<12)-0x36000);
- return;
- }
- }
- if(physical > 0x37 && physical <= 0x3f)
- {
- if(m_basic_rom_en && (m_type != SYS_FM11 && m_type != SYS_FM16))
- {
- RAM = memregion("fbasic")->base();
- space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space.nop_write(bank*0x1000,(bank*0x1000)+size);
- membank(bank_name)->set_base(RAM+(physical<<12)-0x38000);
- return;
- }
- }
- space.install_readwrite_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- membank(bank_name)->set_base(RAM+(physical<<12));
- */
+ return;
+ }
+ if(physical == 0x1c)
+ {
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_console_ram_banked_r),this),write8_delegate(FUNC(fm7_state::fm7_console_ram_banked_w),this));
+ return;
+ }
+ if(physical == 0x1d)
+ {
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_r),this),write8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_w),this));
+ return;
+ }
+ if(physical == 0x35)
+ {
+ if(m_init_rom_en && (m_type == SYS_FM11 || m_type == SYS_FM16))
+ {
+ RAM = memregion("init")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
+ membank(bank_name)->set_base(RAM+(physical<<12)-0x35000);
+ return;
+ }
+ }
+ if(physical == 0x36 || physical == 0x37)
+ {
+ if(m_init_rom_en && (m_type != SYS_FM11 && m_type != SYS_FM16))
+ {
+ RAM = memregion("init")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
+ membank(bank_name)->set_base(RAM+(physical<<12)-0x36000);
+ return;
+ }
+ }
+ if(physical > 0x37 && physical <= 0x3f)
+ {
+ if(m_basic_rom_en && (m_type != SYS_FM11 && m_type != SYS_FM16))
+ {
+ RAM = memregion("fbasic")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
+ membank(bank_name)->set_base(RAM+(physical<<12)-0x38000);
+ return;
+ }
+ }
+ space.install_readwrite_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ membank(bank_name)->set_base(RAM+(physical<<12));
+ */
}
void fm7_state::fm7_mmr_refresh(address_space& space)
diff --git a/src/mess/drivers/gameking.c b/src/mess/drivers/gameking.c
index 6cc3cef8bb7..60b6960f3c8 100644
--- a/src/mess/drivers/gameking.c
+++ b/src/mess/drivers/gameking.c
@@ -103,16 +103,16 @@ DRIVER_INIT_MEMBER(gameking_state, gameking)
DEVICE_IMAGE_LOAD_MEMBER( gameking_state, gameking_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size > 0x20000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/gamepock.c b/src/mess/drivers/gamepock.c
index b65aee1d8f1..cb9816771dc 100644
--- a/src/mess/drivers/gamepock.c
+++ b/src/mess/drivers/gamepock.c
@@ -12,7 +12,7 @@ static ADDRESS_MAP_START(gamepock_mem, AS_PROGRAM, 8, gamepock_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000,0x0fff) AM_ROM
AM_RANGE(0x1000,0x3fff) AM_NOP
- //AM_RANGE(0x4000,0xbfff) AM_ROM // mapped by the cartslot
+ //AM_RANGE(0x4000,0xbfff) AM_ROM // mapped by the cartslot
AM_RANGE(0xc000,0xc7ff) AM_MIRROR(0x0800) AM_RAM
AM_RANGE(0xff80,0xffff) AM_RAM /* 128 bytes microcontroller RAM */
ADDRESS_MAP_END
diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c
index 6a1190ce14d..c66e8987a14 100644
--- a/src/mess/drivers/gba.c
+++ b/src/mess/drivers/gba.c
@@ -1896,7 +1896,7 @@ READ32_MEMBER(gba_state::gba_bios_r)
if (m_bios_protected != 0)
offset = (m_bios_last_address + 8) / 4;
-
+
return rom[offset & 0x3fff];
}
diff --git a/src/mess/drivers/geniusiq.c b/src/mess/drivers/geniusiq.c
index 63f5d3dcb01..b86ab54fa9f 100644
--- a/src/mess/drivers/geniusiq.c
+++ b/src/mess/drivers/geniusiq.c
@@ -759,10 +759,10 @@ void geniusiq_state::machine_reset()
DEVICE_IMAGE_LOAD_MEMBER(geniusiq_state,iq128_cart)
{
UINT32 size = m_cart->common_get_size("rom");
-
+
// we always a 0x100000 region, for easier mapping in the memory map
m_cart->rom_alloc(0x100000, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
m_cart_state = IQ128_ROM_CART;
diff --git a/src/mess/drivers/gmaster.c b/src/mess/drivers/gmaster.c
index d9ea92780a5..9c7cf293929 100644
--- a/src/mess/drivers/gmaster.c
+++ b/src/mess/drivers/gmaster.c
@@ -182,7 +182,7 @@ WRITE8_MEMBER(gmaster_state::gmaster_port_w)
static ADDRESS_MAP_START( gmaster_mem, AS_PROGRAM, 8, gmaster_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x7fff) AM_READWRITE(gmaster_io_r, gmaster_io_w)
- //AM_RANGE(0x8000, 0xfeff) // mapped by the cartslot
+ //AM_RANGE(0x8000, 0xfeff) // mapped by the cartslot
AM_RANGE(0xff00, 0xffff) AM_RAM
ADDRESS_MAP_END
diff --git a/src/mess/drivers/ibmpcjr.c b/src/mess/drivers/ibmpcjr.c
index e7ce6c289d9..7de1bf95ddf 100644
--- a/src/mess/drivers/ibmpcjr.c
+++ b/src/mess/drivers/ibmpcjr.c
@@ -464,7 +464,7 @@ int pcjr_state::load_cart(device_image_interface &image, generic_slot_device *sl
size -= header_size;
image.fseek(header_size, SEEK_SET);
}
-
+
slot->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
slot->common_load_rom(slot->get_rom_base(), size, "rom");
diff --git a/src/mess/drivers/intv.c b/src/mess/drivers/intv.c
index 905f99787a1..9beeae578ce 100644
--- a/src/mess/drivers/intv.c
+++ b/src/mess/drivers/intv.c
@@ -380,11 +380,11 @@ static ADDRESS_MAP_START( intv_mem, AS_PROGRAM, 16, intv_state )
AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8("ay8914", ay8914_device, read, write, 0x00ff)
AM_RANGE(0x0200, 0x035f) AM_READWRITE(intv_ram16_r, intv_ram16_w)
AM_RANGE(0x0400, 0x04ff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom04)
- AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000 << 1) // Exec ROM, 10-bits wide
+ AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000 << 1) // Exec ROM, 10-bits wide
AM_RANGE(0x2000, 0x2fff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom20)
AM_RANGE(0x3000, 0x37ff) AM_DEVREAD("stic", stic_device, grom_read) // GROM, 8-bits wide
- AM_RANGE(0x3800, 0x39ff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM, 8-bits wide
- AM_RANGE(0x3a00, 0x3bff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM Alias, 8-bits wide
+ AM_RANGE(0x3800, 0x39ff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM, 8-bits wide
+ AM_RANGE(0x3a00, 0x3bff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM Alias, 8-bits wide
AM_RANGE(0x4000, 0x47ff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom40)
AM_RANGE(0x4800, 0x4fff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom48)
AM_RANGE(0x5000, 0x5fff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom50)
@@ -407,11 +407,11 @@ static ADDRESS_MAP_START( intvoice_mem, AS_PROGRAM, 16, intv_state )
AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8("ay8914", ay8914_device, read, write, 0x00ff)
AM_RANGE(0x0200, 0x035f) AM_READWRITE(intv_ram16_r, intv_ram16_w)
AM_RANGE(0x0400, 0x04ff) AM_DEVREAD("voice", intv_voice_device, read_rom04)
- AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000 << 1) // Exec ROM, 10-bits wide
+ AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000 << 1) // Exec ROM, 10-bits wide
AM_RANGE(0x2000, 0x2fff) AM_DEVREAD("voice", intv_voice_device, read_rom20)
AM_RANGE(0x3000, 0x37ff) AM_DEVREAD("stic", stic_device, grom_read) // GROM, 8-bits wide
- AM_RANGE(0x3800, 0x39ff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM, 8-bits wide
- AM_RANGE(0x3a00, 0x3bff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM Alias, 8-bits wide
+ AM_RANGE(0x3800, 0x39ff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM, 8-bits wide
+ AM_RANGE(0x3a00, 0x3bff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM Alias, 8-bits wide
AM_RANGE(0x4000, 0x47ff) AM_DEVREAD("voice", intv_voice_device, read_rom40)
AM_RANGE(0x4800, 0x4fff) AM_DEVREAD("voice", intv_voice_device, read_rom48)
AM_RANGE(0x5000, 0x5fff) AM_DEVREAD("voice", intv_voice_device, read_rom50)
@@ -432,12 +432,12 @@ static ADDRESS_MAP_START( intv2_mem , AS_PROGRAM, 16, intv_state )
AM_RANGE(0x0100, 0x01ef) AM_READWRITE(intv_ram8_r, intv_ram8_w)
AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8("ay8914", ay8914_device, read, write, 0x00ff)
AM_RANGE(0x0200, 0x035f) AM_READWRITE(intv_ram16_r, intv_ram16_w)
- AM_RANGE(0x0400, 0x04ff) AM_ROM AM_REGION("maincpu", 0x400 << 1) // Exec ROM, 10-bits wide
- AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000 << 1) // Exec ROM, 10-bits wide
+ AM_RANGE(0x0400, 0x04ff) AM_ROM AM_REGION("maincpu", 0x400 << 1) // Exec ROM, 10-bits wide
+ AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000 << 1) // Exec ROM, 10-bits wide
AM_RANGE(0x2000, 0x2fff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom20)
- AM_RANGE(0x3000, 0x37ff) AM_DEVREAD("stic", stic_device, grom_read) // GROM, 8-bits wide
- AM_RANGE(0x3800, 0x39ff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM, 8-bits wide
- AM_RANGE(0x3a00, 0x3bff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM Alias, 8-bits wide
+ AM_RANGE(0x3000, 0x37ff) AM_DEVREAD("stic", stic_device, grom_read) // GROM, 8-bits wide
+ AM_RANGE(0x3800, 0x39ff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM, 8-bits wide
+ AM_RANGE(0x3a00, 0x3bff) AM_READWRITE(intv_gram_r, intv_gram_w) // GRAM Alias, 8-bits wide
AM_RANGE(0x4000, 0x47ff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom40)
AM_RANGE(0x4800, 0x4fff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom48)
AM_RANGE(0x5000, 0x5fff) AM_DEVREAD("cartslot", intv_cart_slot_device, read_rom50)
diff --git a/src/mess/drivers/itt3030.c b/src/mess/drivers/itt3030.c
index e6a748c3332..5d9aa417b6c 100644
--- a/src/mess/drivers/itt3030.c
+++ b/src/mess/drivers/itt3030.c
@@ -324,18 +324,18 @@ READ8_MEMBER(itt3030_state::i8078_r)
{
if (offset)
{
-// printf("Read 8078 status\n");
+// printf("Read 8078 status\n");
if (!m_keyskip)
{
- return 0x10;
+ return 0x10;
}
}
else
{
-// printf("Read 8078 data\n");
+// printf("Read 8078 data\n");
if (!m_keyskip)
{
- m_keyskip = true; // don't keep reporting the 'b' key, just the once to trick the boot ROM
+ m_keyskip = true; // don't keep reporting the 'b' key, just the once to trick the boot ROM
return 0x0c;
}
}
@@ -433,21 +433,21 @@ WRITE_LINE_MEMBER(itt3030_state::fdchld_w)
}
/*
- 7 Data Request (DRQ - inverted 1791-Signal)
- 6 Interrupt Request (INTRQ - 1791-Signal)
- 5 Head Load (HLD - inverted 1791-Signal)
- 4 Ready 3 (Drive 3 ready)
- 3 Ready 2 (Drive 2 ready)
- 2 Ready l (Drive 1 ready)
- 1 Write protect (the disk in the selected drive is write protected)
- 0 HLT (Halt signal during head load and track change)
+ 7 Data Request (DRQ - inverted 1791-Signal)
+ 6 Interrupt Request (INTRQ - 1791-Signal)
+ 5 Head Load (HLD - inverted 1791-Signal)
+ 4 Ready 3 (Drive 3 ready)
+ 3 Ready 2 (Drive 2 ready)
+ 2 Ready l (Drive 1 ready)
+ 1 Write protect (the disk in the selected drive is write protected)
+ 0 HLT (Halt signal during head load and track change)
*/
READ8_MEMBER(itt3030_state::fdc_stat_r)
{
UINT8 res = 0;
- floppy_image_device *floppy1 = m_con1 ? m_con1->get_device() : 0;
- floppy_image_device *floppy2 = m_con2 ? m_con2->get_device() : 0;
- floppy_image_device *floppy3 = m_con3 ? m_con3->get_device() : 0;
+ floppy_image_device *floppy1 = m_con1 ? m_con1->get_device() : 0;
+ floppy_image_device *floppy2 = m_con2 ? m_con2->get_device() : 0;
+ floppy_image_device *floppy3 = m_con3 ? m_con3->get_device() : 0;
res = m_fdc_drq ? 0x80 : 0x00;
res |= m_fdc_irq ? 0x40 : 0x00;
@@ -472,14 +472,14 @@ WRITE8_MEMBER(itt3030_state::fdc_w)
}
/*
- 7 SEL1 - Select drive 1
- 6 SEL2 - Select drive 2
- 5 SEL3 - Select drive 3
- 4 MOTOR - Motor on
- 3 DOOR - Drive door lock drives 1 + 2 (not possible with all drives)
- 2 SIDESEL - Select disk side
- 1 KOMP - write comp on/off
- 0 RG J - Change separator stage to read
+ 7 SEL1 - Select drive 1
+ 6 SEL2 - Select drive 2
+ 5 SEL3 - Select drive 3
+ 4 MOTOR - Motor on
+ 3 DOOR - Drive door lock drives 1 + 2 (not possible with all drives)
+ 2 SIDESEL - Select disk side
+ 1 KOMP - write comp on/off
+ 0 RG J - Change separator stage to read
*/
WRITE8_MEMBER(itt3030_state::fdc_cmd_w)
{
diff --git a/src/mess/drivers/kyocera.c b/src/mess/drivers/kyocera.c
index b83fee74748..3adb9ba6ac7 100644
--- a/src/mess/drivers/kyocera.c
+++ b/src/mess/drivers/kyocera.c
@@ -1167,10 +1167,10 @@ WRITE_LINE_MEMBER( tandy200_state::i8155_to_w )
void kc85_state::machine_start()
{
address_space &program = m_maincpu->space(AS_PROGRAM);
-
+
astring region_tag;
m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
-
+
/* initialize RTC */
m_rtc->cs_w(1);
m_rtc->oe_w(1);
@@ -1210,10 +1210,10 @@ void kc85_state::machine_start()
void pc8201_state::machine_start()
{
UINT8 *ram = m_ram->pointer();
-
+
astring region_tag;
m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
-
+
/* initialize RTC */
m_rtc->cs_w(1);
m_rtc->oe_w(1);
@@ -1244,10 +1244,10 @@ void pc8201_state::machine_start()
void trsm100_state::machine_start()
{
address_space &program = m_maincpu->space(AS_PROGRAM);
-
+
astring region_tag;
m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
-
+
/* initialize RTC */
m_rtc->cs_w(1);
m_rtc->oe_w(1);
diff --git a/src/mess/drivers/laser3k.c b/src/mess/drivers/laser3k.c
index 3b0d6632ca3..b07f74daef9 100644
--- a/src/mess/drivers/laser3k.c
+++ b/src/mess/drivers/laser3k.c
@@ -1,31 +1,31 @@
/***************************************************************************
-
+
laser3k.c
Driver for VTech Laser 3000 / Dick Smith Electronics "The Cat"
-
+
This machine is somewhat similar to a 48K Apple II if you blur your eyes
a lot, but it generally fits in poorly with 100% compatible machines
(no chance of a compatible language card or auxmem) so it gets its own driver.
-
+
An "emulation cartridge" is required to run Apple II software; it's unclear
what that consists of.
-
+
Banking theory:
- 6502 has 4 banking windows, 0000-3FFF, 4000-7FFF, 8000-BFFF, C000-FFFF
- Physical address space is 0x00000-0x3FFFF. ROM and I/O at the top, RAM
up to 0x2FFFF (192k max).
- Each window has a bank number register at physical 3C07C/D/E/F
-
+
Technical manual at:
http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Computers/LASER/LASER%203000/Manuals/The%20Cat%20Technical%20Reference%20Manual.pdf
-
+
TODO:
- Finish keyboard
- RGB graphics mode
- FDC C800 page appears to be inside the FDC cartridge, need a dump :( (can hack to use IWM in the meantime)
- Centronics printer port (data at 3c090, read ack at 3c1c0, read busy at 3c1c2)
- cassette
-
+
***************************************************************************/
#include "emu.h"
@@ -248,78 +248,78 @@ void laser3k_state::do_io(int offset)
{
switch (offset)
{
- case 0x08: // set border color to black
+ case 0x08: // set border color to black
m_border_color = 0;
break;
- case 0x09: // set border color to red
+ case 0x09: // set border color to red
m_border_color = 1;
break;
- case 0x0a: // set border color to green
+ case 0x0a: // set border color to green
m_border_color = 12;
break;
- case 0x0b: // set border color to yellow
+ case 0x0b: // set border color to yellow
m_border_color = 13;
break;
- case 0x0c: // set border color to blue
+ case 0x0c: // set border color to blue
m_border_color = 6;
break;
- case 0x0d: // set border color to magenta
+ case 0x0d: // set border color to magenta
m_border_color = 3;
break;
- case 0x0e: // set border color to cyan
+ case 0x0e: // set border color to cyan
m_border_color = 14;
break;
- case 0x0f: // set border color to white
+ case 0x0f: // set border color to white
m_border_color = 15;
break;
- case 0x18: // set bg color to black
+ case 0x18: // set bg color to black
m_bg_color = 0;
break;
- case 0x19: // set bg color to red
+ case 0x19: // set bg color to red
m_bg_color = 1;
break;
- case 0x1a: // set bg color to green
+ case 0x1a: // set bg color to green
m_bg_color = 12;
break;
- case 0x1b: // set bg color to yellow
+ case 0x1b: // set bg color to yellow
m_bg_color = 13;
break;
- case 0x1c: // set bg color to blue
+ case 0x1c: // set bg color to blue
m_bg_color = 6;
break;
- case 0x1d: // set bg color to magenta
+ case 0x1d: // set bg color to magenta
m_bg_color = 3;
break;
- case 0x1e: // set bg color to cyan
+ case 0x1e: // set bg color to cyan
m_bg_color = 14;
break;
- case 0x1f: // set bg color to white
+ case 0x1f: // set bg color to white
m_bg_color = 15;
break;
- case 0x28: // set fg color to normal
+ case 0x28: // set fg color to normal
m_fg_color = 15;
break;
- case 0x29: // set fg color to red
+ case 0x29: // set fg color to red
m_fg_color = 1;
break;
- case 0x2a: // set fg color to green
+ case 0x2a: // set fg color to green
m_fg_color = 12;
break;
- case 0x2b: // set fg color to yellow
+ case 0x2b: // set fg color to yellow
m_fg_color = 13;
break;
- case 0x2c: // set fg color to blue
+ case 0x2c: // set fg color to blue
m_fg_color = 6;
break;
- case 0x2d: // set fg color to magenta
+ case 0x2d: // set fg color to magenta
m_fg_color = 3;
break;
- case 0x2e: // set fg color to cyan
+ case 0x2e: // set fg color to cyan
m_fg_color = 14;
break;
- case 0x2f: // set fg color to white
+ case 0x2f: // set fg color to white
m_fg_color = 15;
break;
@@ -328,51 +328,51 @@ void laser3k_state::do_io(int offset)
m_speaker->level_w(m_speaker_state);
break;
- case 0x4c: // low resolution (40 column)
+ case 0x4c: // low resolution (40 column)
m_80col = false;
m_maincpu->set_unscaled_clock(1021800);
break;
- case 0x4d: // RGB mode
+ case 0x4d: // RGB mode
m_gfxmode = RGB;
break;
- case 0x4e: // double hi-res
+ case 0x4e: // double hi-res
m_80col = true;
m_gfxmode = DHIRES;
m_maincpu->set_unscaled_clock(1021800*2);
break;
-
- case 0x4f: // high resolution (80 column). Yes, the CPU clock also doubles when the pixel clock does (!)
+
+ case 0x4f: // high resolution (80 column). Yes, the CPU clock also doubles when the pixel clock does (!)
m_80col = true;
m_maincpu->set_unscaled_clock(1021800*2);
break;
- case 0x50: // graphics mode
+ case 0x50: // graphics mode
m_gfxmode = HIRES;
break;
- case 0x51: // text mode
+ case 0x51: // text mode
m_gfxmode = TEXT;
break;
- case 0x52: // no mix
+ case 0x52: // no mix
m_mix = false;
break;
- case 0x53: // mixed mode
+ case 0x53: // mixed mode
m_mix = true;
break;
- case 0x54: // set page 1
+ case 0x54: // set page 1
m_disp_page = 0;
break;
- case 0x55: // set page 2
+ case 0x55: // set page 2
m_disp_page = 1;
break;
- case 0x56: // disable emulation (?)
+ case 0x56: // disable emulation (?)
break;
default:
@@ -385,10 +385,10 @@ READ8_MEMBER( laser3k_state::io_r )
{
switch (offset)
{
- case 0x00: // keyboard latch
+ case 0x00: // keyboard latch
return m_transchar | m_strobe;
- case 0x10: // keyboard strobe
+ case 0x10: // keyboard strobe
{
UINT8 rv = m_transchar | m_strobe;
m_strobe = 0;
@@ -397,16 +397,16 @@ READ8_MEMBER( laser3k_state::io_r )
case 0x7c:
return m_bank0val;
-
+
case 0x7d:
return m_bank1val;
-
+
case 0x7e:
return m_bank2val;
-
+
case 0x7f:
return m_bank3val;
-
+
default:
do_io(offset);
break;
@@ -419,18 +419,18 @@ WRITE8_MEMBER( laser3k_state::io_w )
{
switch (offset)
{
- case 0x10: // clear keyboard latch
+ case 0x10: // clear keyboard latch
m_strobe = 0;
break;
- case 0x68: // SN76489 sound
+ case 0x68: // SN76489 sound
m_sn->write(space, 0, data);
break;
- case 0x78: // called "SYSTEM" in the boot ROM listing, but unsure what it does
+ case 0x78: // called "SYSTEM" in the boot ROM listing, but unsure what it does
break;
- case 0x7c: // bank 0
+ case 0x7c: // bank 0
m_bank0val = data & 0xf;
m_bank0->set_bank(m_bank0val);
break;
@@ -440,12 +440,12 @@ WRITE8_MEMBER( laser3k_state::io_w )
m_bank1->set_bank(m_bank1val);
break;
- case 0x7e: // bank 2
+ case 0x7e: // bank 2
m_bank2val = data & 0xf;
m_bank2->set_bank(m_bank2val);
break;
- case 0x7f: // bank 3
+ case 0x7f: // bank 3
m_bank3val = data & 0xf;
m_bank3->set_bank(m_bank3val);
break;
@@ -460,15 +460,15 @@ READ8_MEMBER( laser3k_state::io2_r )
{
switch (offset)
{
- case 0xc2: // h-blank status
+ case 0xc2: // h-blank status
return space.machine().first_screen()->hblank() ? 0x80 : 0x00;
- case 0xc3: // v-blank status
+ case 0xc3: // v-blank status
return space.machine().first_screen()->vblank() ? 0x80 : 0x00;
- case 0xc5: // CPU 1/2 MHz status?
+ case 0xc5: // CPU 1/2 MHz status?
return 0x00;
-
+
default:
printf("io2_r @ unknown %x\n", offset);
break;
@@ -505,7 +505,7 @@ void laser3k_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos
for (i = 0; i < xscale; i++)
{
- bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
+ bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
}
}
}
@@ -520,11 +520,11 @@ void laser3k_state::text_update(screen_device &screen, bitmap_ind16 &bitmap, con
if (m_80col)
{
- start_address = (m_disp_page == 0) ? 0x1000 : 0x1800;
+ start_address = (m_disp_page == 0) ? 0x1000 : 0x1800;
}
else
{
- start_address = (m_disp_page == 0) ? 0x400 : 0x800;
+ start_address = (m_disp_page == 0) ? 0x400 : 0x800;
}
m_flash = ((machine().time() * 4).seconds & 1) ? 1 : 0;
@@ -541,9 +541,9 @@ void laser3k_state::text_update(screen_device &screen, bitmap_ind16 &bitmap, con
/* calculate address */
address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
- plot_text_character(bitmap, col * 7, row, 1, m_a2_videoram[address],
+ plot_text_character(bitmap, col * 7, row, 1, m_a2_videoram[address],
memregion("gfx1")->base(), memregion("gfx1")->bytes());
- plot_text_character(bitmap, (col + 40) * 7, row, 1, m_a2_videoram[address+0x400],
+ plot_text_character(bitmap, (col + 40) * 7, row, 1, m_a2_videoram[address+0x400],
memregion("gfx1")->base(), memregion("gfx1")->bytes());
}
}
@@ -553,7 +553,7 @@ void laser3k_state::text_update(screen_device &screen, bitmap_ind16 &bitmap, con
{
/* calculate address */
address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
- plot_text_character(bitmap, col * 14, row, 2, m_a2_videoram[address],
+ plot_text_character(bitmap, col * 14, row, 2, m_a2_videoram[address],
memregion("gfx1")->base(), memregion("gfx1")->bytes());
}
}
@@ -565,7 +565,7 @@ void laser3k_state::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, cons
const UINT8 *vram;
int row, col, b;
int offset;
- UINT8 vram_row[42] ;
+ UINT8 vram_row[42] ;
UINT16 v;
UINT16 *p;
UINT32 w;
@@ -601,7 +601,7 @@ void laser3k_state::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, cons
| (((UINT32) vram_row[col+2] & 0x7f) << 14);
artifact_map_ptr = &m_hires_artifact_map[((vram_row[col+1] & 0x80) >> 7) * 16];
- for (b = 0; b < 7; b++)
+ for (b = 0; b < 7; b++)
{
v = artifact_map_ptr[((w >> (b + 7-1)) & 0x07) | (((b ^ col) & 0x01) << 3)];
*(p++) = v;
@@ -629,7 +629,7 @@ void laser3k_state::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, con
if (endrow < beginrow)
return;
- vram = m_ram->pointer() + (m_disp_page ? 0x8000 : 0x4000);
+ vram = m_ram->pointer() + (m_disp_page ? 0x8000 : 0x4000);
vram_row[0] = 0;
vram_row[81] = 0;
@@ -641,12 +641,12 @@ void laser3k_state::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, con
offset = ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col)) | ((row & 7) << 10);
if (col < 40)
{
- vram_row[1+(col*2)+0] = vram[offset];
+ vram_row[1+(col*2)+0] = vram[offset];
vram_row[1+(col*2)+1] = vram[offset+1];
}
else
{
- vram_row[1+(col*2)+0] = vram[offset+0x2000];
+ vram_row[1+(col*2)+0] = vram[offset+0x2000];
vram_row[1+(col*2)+1] = vram[offset+0x2001];
}
}
@@ -659,7 +659,7 @@ void laser3k_state::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, con
| (((UINT32) vram_row[col+1] & 0x7f) << 7)
| (((UINT32) vram_row[col+2] & 0x7f) << 14);
- for (b = 0; b < 7; b++)
+ for (b = 0; b < 7; b++)
{
v = m_dhires_artifact_map[((((w >> (b + 7-1)) & 0x0F) * 0x11) >> (((2-(col*7+b))) & 0x03)) & 0x0F];
*(p++) = v;
@@ -673,18 +673,18 @@ UINT32 laser3k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
switch (m_gfxmode)
{
case TEXT:
- text_update(screen, bitmap, cliprect, 0, 191);
+ text_update(screen, bitmap, cliprect, 0, 191);
break;
case HIRES:
if (m_mix)
{
- hgr_update(screen, bitmap, cliprect, 0, 159);
- text_update(screen, bitmap, cliprect, 160, 191);
+ hgr_update(screen, bitmap, cliprect, 0, 159);
+ text_update(screen, bitmap, cliprect, 160, 191);
}
else
{
- hgr_update(screen, bitmap, cliprect, 0, 191);
+ hgr_update(screen, bitmap, cliprect, 0, 191);
}
break;
@@ -694,12 +694,12 @@ UINT32 laser3k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
case DHIRES:
if (m_mix)
{
- dhgr_update(screen, bitmap, cliprect, 0, 159);
- text_update(screen, bitmap, cliprect, 160, 191);
+ dhgr_update(screen, bitmap, cliprect, 0, 159);
+ text_update(screen, bitmap, cliprect, 160, 191);
}
else
{
- dhgr_update(screen, bitmap, cliprect, 0, 191);
+ dhgr_update(screen, bitmap, cliprect, 0, 191);
}
break;
}
@@ -793,14 +793,14 @@ WRITE_LINE_MEMBER(laser3k_state::ay3600_data_ready_w)
mod = (m_kbspecial->read() & 0x06) ? 0x01 : 0x00;
mod |= (m_kbspecial->read() & 0x08) ? 0x02 : 0x00;
-// printf("lastchar = %02x\n", m_lastchar & 0x3f);
+// printf("lastchar = %02x\n", m_lastchar & 0x3f);
m_transchar = key_remap[m_lastchar&0x3f][mod];
if (m_transchar != 0)
{
m_strobe = 0x80;
-// printf("new char = %04x (%02x)\n", m_lastchar&0x3f, m_transchar);
+// printf("new char = %04x (%02x)\n", m_lastchar&0x3f, m_transchar);
}
}
}
@@ -865,7 +865,7 @@ static INPUT_PORTS_START( laser3k )
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a')
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
- PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"')
+ PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"')
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
diff --git a/src/mess/drivers/m5.c b/src/mess/drivers/m5.c
index c9797394764..c1e86d3d633 100644
--- a/src/mess/drivers/m5.c
+++ b/src/mess/drivers/m5.c
@@ -243,7 +243,7 @@ WRITE8_MEMBER( m5_state::fd5_tc_w )
static ADDRESS_MAP_START( m5_mem, AS_PROGRAM, 8, m5_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x1fff) AM_ROM
- //AM_RANGE(0x2000, 0x6fff) // mapped by the cartslot
+ //AM_RANGE(0x2000, 0x6fff) // mapped by the cartslot
AM_RANGE(0x7000, 0x7fff) AM_RAM
AM_RANGE(0x8000, 0xffff) AM_RAM
ADDRESS_MAP_END
diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c
index b1cc5bacb21..8d75eb30f8b 100644
--- a/src/mess/drivers/msx.c
+++ b/src/mess/drivers/msx.c
@@ -1926,8 +1926,8 @@ static MACHINE_CONFIG_DERIVED( cpc50b, msx_ntsc )
// 1? Cartridge slot
// No keyboard?
// No cassette port?
- // No printer port?
-
+ // No printer port?
+
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
MCFG_MSX_LAYOUT_RAM("ram", 2, 0, 3, 1) /* 16KB RAM */
@@ -2142,7 +2142,7 @@ static MACHINE_CONFIG_DERIVED( gfc1080a, msx_ntsc )
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
MCFG_MSX_LAYOUT_RAM("ram", 2, 0, 0, 4) // 64KB RAM
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 3, 0)
-
+
MCFG_FRAGMENT_ADD( msx1_cartlist )
MACHINE_CONFIG_END
@@ -4009,7 +4009,7 @@ static MACHINE_CONFIG_DERIVED( hc6, msx_ntsc )
// AY8910/YM2149?
// FDC: None, 0 drives,
// 2 Cartridge slots?
-
+
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
MCFG_MSX_LAYOUT_RAM("ram", 2, 0, 2, 2) // 32KB RAM
@@ -4029,7 +4029,7 @@ static MACHINE_CONFIG_DERIVED( hc7, msx_ntsc )
// AY8910/YM2149?
// FDC: None, 0 drives,
// 2 Cartridge slots?
-
+
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
MCFG_MSX_LAYOUT_RAM("ram", 2, 0, 0, 4) // 64KB RAM
@@ -4062,7 +4062,7 @@ MACHINE_CONFIG_END
/* MSX - Yamaha CX5F (with SFG05) */
-ROM_START (cx5f)
+ROM_START (cx5f)
ROM_REGION (0x8000, "maincpu", 0)
ROM_LOAD ("cx5fbios.rom", 0x0000, 0x8000, CRC(dc662057) SHA1(36d77d357a5fd15af2ab266ee66e5091ba4770a3))
ROM_END
@@ -6036,30 +6036,30 @@ MACHINE_CONFIG_END
/* MSX2 - Sanyo MPC-2500FD */
ROM_START (mpc2500f)
- ROM_REGION (0x10000, "maincpu", 0)
- ROM_LOAD ("mpc2500fdbios.rom", 0x0000, 0x8000, CRC(e7d08e29) SHA1(0f851ee7a1cf79819f61cc89e9948ee72a413802))
- ROM_LOAD ("mpc2500fdext.rom", 0x8000, 0x4000, CRC(3d7dc718) SHA1(e1f834b28c3ee7c9f79fe6fbf2b23c8a0617892b))
+ ROM_REGION (0x10000, "maincpu", 0)
+ ROM_LOAD ("mpc2500fdbios.rom", 0x0000, 0x8000, CRC(e7d08e29) SHA1(0f851ee7a1cf79819f61cc89e9948ee72a413802))
+ ROM_LOAD ("mpc2500fdext.rom", 0x8000, 0x4000, CRC(3d7dc718) SHA1(e1f834b28c3ee7c9f79fe6fbf2b23c8a0617892b))
ROM_LOAD ("mpc2500fddisk.rom", 0xc000, 0x4000, CRC(38454059) SHA1(58ac78bba29a06645ca8d6a94ef2ac68b743ad32))
ROM_END
static MACHINE_CONFIG_DERIVED( mpc2500f, msx2 )
- // YM2149
- // FDC: wd2793?, 1? 3.5" DSDD drive?
- // 2 Cartridge slots?
+ // YM2149
+ // FDC: wd2793?, 1? 3.5" DSDD drive?
+ // 2 Cartridge slots?
// S-3527 MSX Eninge
- MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
- MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
- MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 2, 0)
+ MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
+ MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
+ MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 2, 0)
MCFG_MSX_LAYOUT_ROM("ext", 2, 3, 0, 1, "maincpu", 0x8000)
MCFG_MSX_LAYOUT_DISK1("disk", 3, 1, 1, 1, "maincpu", 0xC000)
- MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x10000) /* 64KB?? Mapper RAM */
+ MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x10000) /* 64KB?? Mapper RAM */
MCFG_FRAGMENT_ADD( msx_wd2793_force_ready )
MCFG_FRAGMENT_ADD( msx_1_35_dd_drive )
MCFG_FRAGMENT_ADD( msx2_floplist )
- MCFG_FRAGMENT_ADD( msx2_cartlist )
+ MCFG_FRAGMENT_ADD( msx2_cartlist )
MACHINE_CONFIG_END
/* MSX2 - Sanyo Wavy MPC-25FD */
@@ -7202,7 +7202,7 @@ ROM_START (victhc95a)
ROM_LOAD ("hc95aext.rom", 0x8000, 0x4000, CRC(4a48779c) SHA1(b8e30d604d319d511cbfbc61e5d8c38fbb9c5a33))
ROM_LOAD ("hc95adisk.rom", 0xc000, 0x4000, CRC(11bca2ed) SHA1(a7a34671bddb48fa6c74182e2977f9129558ec32))
ROM_LOAD ("hc95afirm.rom", 0x10000, 0x4000, CRC(53791d91) SHA1(caeffdd654394726c8c0824b21af7ff51c0b1031))
-
+
ROM_REGION (0x20000, "kanji", 0)
ROM_LOAD ("hc95akfn.rom", 0x0000, 0x20000, CRC(d23d4d2d) SHA1(db03211b7db46899df41db2b1dfbec972109a967))
ROM_END
@@ -7215,7 +7215,7 @@ static MACHINE_CONFIG_DERIVED( victhc95a, msx2 )
// 1 Cartridge slot (slot 1 or 2?)
// S-1985 MSX Engine
// V9958 VDP
-
+
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_ROM("ext", 0, 1, 0, 1, "maincpu", 0x8000)
MCFG_MSX_LAYOUT_ROM("firm", 0, 1, 1, 1, "maincpu", 0x10000)
@@ -7387,7 +7387,7 @@ ROM_END
static MACHINE_CONFIG_DERIVED( yis604, msx2 )
// YM2149 (in S-3527)
- // FDC: None, 0 drives
+ // FDC: None, 0 drives
// 2 Cartridge slots
// S-3527 MSX Engine
@@ -7398,7 +7398,7 @@ static MACHINE_CONFIG_DERIVED( yis604, msx2 )
MCFG_MSX_LAYOUT_ROM("yrm502", 3, 1, 1, 1, "maincpu", 0xc000)
MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x10000) // 64KB Mapper RAM
MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 3, "sfg05")
-
+
MCFG_FRAGMENT_ADD( msx2_cartlist )
MACHINE_CONFIG_END
@@ -8433,4 +8433,3 @@ COMP(19??, hbf9sp, 0, 0, hbf9sp, msx2jp, driver_device, 0, "Son
/* Temporary placeholders, Turbo-R hardware is not supported yet */
COMP(19??, fsa1gt, 0, 0, fsa1gt, msx2jp, driver_device, 0, "Panasonic", "FS-A1GT (MSX Turbo-R)", GAME_NOT_WORKING)
COMP(19??, fsa1st, 0, 0, fsa1st, msx2jp, driver_device, 0, "Panasonic", "FS-A1ST (MSX Turbo-R)", GAME_NOT_WORKING)
-
diff --git a/src/mess/drivers/myvision.c b/src/mess/drivers/myvision.c
index 7c4254fbba2..0bbc56f2c78 100644
--- a/src/mess/drivers/myvision.c
+++ b/src/mess/drivers/myvision.c
@@ -66,7 +66,7 @@ private:
static ADDRESS_MAP_START(myvision_mem, AS_PROGRAM, 8, myvision_state)
ADDRESS_MAP_UNMAP_HIGH
- //AM_RANGE(0x0000, 0x5fff) // mapped by the cartslot
+ //AM_RANGE(0x0000, 0x5fff) // mapped by the cartslot
AM_RANGE(0xa000, 0xa7ff) AM_RAM
AM_RANGE(0xe000, 0xe000) AM_DEVREADWRITE("tms9918", tms9918a_device, vram_read, vram_write)
AM_RANGE(0xe002, 0xe002) AM_DEVREADWRITE("tms9918", tms9918a_device, register_read, register_write)
@@ -144,15 +144,15 @@ void myvision_state::machine_reset()
DEVICE_IMAGE_LOAD_MEMBER( myvision_state, cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size != 0x4000 && size != 0x6000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c
index 85295fb2f45..a900f7fc83c 100644
--- a/src/mess/drivers/nc.c
+++ b/src/mess/drivers/nc.c
@@ -801,7 +801,7 @@ void nc_state::machine_start()
m_card_size = m_card_ram->bytes();
else
m_card_size = 0;
-
+
/* keyboard timer */
m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nc_state::nc_keyboard_timer_callback),this));
m_keyboard_timer->adjust(attotime::from_msec(10));
@@ -1138,14 +1138,14 @@ MACHINE_RESET_MEMBER(nc_state, nc200)
MACHINE_START_MEMBER(nc_state, nc200)
{
m_type = NC_TYPE_200;
-
+
astring region_tag;
m_card_ram = memregion(region_tag.cpy(m_card->tag()).cat(GENERIC_ROM_REGION_TAG));
if (m_card_ram)
m_card_size = m_card_ram->bytes();
else
m_card_size = 0;
-
+
/* keyboard timer */
m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nc_state::nc_keyboard_timer_callback),this));
m_keyboard_timer->adjust(attotime::from_msec(10));
diff --git a/src/mess/drivers/nes.c b/src/mess/drivers/nes.c
index 447d6cedc3e..f9823fa387d 100644
--- a/src/mess/drivers/nes.c
+++ b/src/mess/drivers/nes.c
@@ -752,10 +752,10 @@ void nes_state::setup_disk(nes_disksys_device *slot)
space.install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(nes_disksys_device::write_m), (nes_disksys_device *)slot));
space.install_read_handler(0x8000, 0xffff, read8_delegate(FUNC(nes_disksys_device::read_h), (nes_disksys_device *)slot));
space.install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(nes_disksys_device::write_h), (nes_disksys_device *)slot));
-
+
slot->vram_alloc(0x2000);
slot->prgram_alloc(0x8000);
-
+
slot->pcb_start(machine(), m_ciram, FALSE);
slot->pcb_reg_postload(machine());
m_ppu->space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(device_nes_cart_interface::chr_r),(device_nes_cart_interface *)slot), write8_delegate(FUNC(device_nes_cart_interface::chr_w),(device_nes_cart_interface *)slot));
@@ -768,7 +768,7 @@ void nes_state::setup_disk(nes_disksys_device *slot)
MACHINE_START_MEMBER( nes_state, fds )
-{
+{
m_ciram = auto_alloc_array(machine(), UINT8, 0x800);
setup_ioports();
setup_disk(m_disk);
@@ -778,14 +778,14 @@ MACHINE_RESET_MEMBER( nes_state, fds )
{
// Reset the mapper variables
m_disk->pcb_reset();
-
+
// the rest is the same as for nes/famicom/dendy
m_maincpu->reset();
-
+
memset(m_pad_latch, 0, sizeof(m_pad_latch));
memset(m_zapper_latch, 0, sizeof(m_zapper_latch));
m_paddle_latch = 0;
- m_paddle_btn_latch = 0;
+ m_paddle_btn_latch = 0;
}
static MACHINE_CONFIG_DERIVED( fds, famicom )
@@ -810,7 +810,7 @@ MACHINE_START_MEMBER( nes_state, famitwin )
if (!m_cartslot->exists())
{
setup_disk(m_disk);
-
+
// replace the famicom disk ROM with the famicom twin one (until we modernize the floppy drive)
m_maincpu->space(AS_PROGRAM).install_read_bank(0xe000, 0xffff, "ftbios");
membank("ftbios")->set_base(machine().root_device().memregion("maincpu")->base() + 0xe000);
@@ -824,14 +824,14 @@ MACHINE_RESET_MEMBER( nes_state, famitwin )
// if there is no cart inserted, initialize the disk expansion instead
if (!m_cartslot->exists())
m_disk->pcb_reset();
-
+
// the rest is the same as for nes/famicom/dendy
m_maincpu->reset();
-
+
memset(m_pad_latch, 0, sizeof(m_pad_latch));
memset(m_zapper_latch, 0, sizeof(m_zapper_latch));
m_paddle_latch = 0;
- m_paddle_btn_latch = 0;
+ m_paddle_btn_latch = 0;
}
static MACHINE_CONFIG_DERIVED( famitwin, famicom )
diff --git a/src/mess/drivers/ngp.c b/src/mess/drivers/ngp.c
index 00dafbee343..d98dfb9c3e7 100644
--- a/src/mess/drivers/ngp.c
+++ b/src/mess/drivers/ngp.c
@@ -136,7 +136,7 @@ public:
m_k1ge(*this, "k1ge"),
m_io_controls(*this, "Controls"),
m_io_power(*this, "Power") ,
- m_maincpu(*this, "maincpu")
+ m_maincpu(*this, "maincpu")
{
m_flash_chip[0].present = 0;
m_flash_chip[0].state = F_READ;
@@ -651,7 +651,7 @@ void ngp_state::machine_start()
m_maincpu->space(AS_PROGRAM).install_read_bank(0x800000, 0x9fffff, "flash1");
membank("flash0")->set_base(cart);
membank("flash1")->set_base(cart + 0x200000);
-
+
m_flash_chip[0].data = cart;
m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0];
m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1];
@@ -669,7 +669,7 @@ void ngp_state::machine_start()
m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001];
m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002];
m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003];
-
+
m_flash_chip[1].data = cart + 0x200000;
m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0];
m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1];
@@ -739,17 +739,17 @@ UINT32 ngp_state::screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap,
DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size != 0x8000 && size != 0x80000 && size != 0x100000 && size != 0x200000 && size != 0x400000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
// alloc 0x400000 ROM to simplify mapping in the address map
m_cart->rom_alloc(0x400000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
//printf("%2x%2x - %x - %x\n", (unsigned int) memregion("cart")->u8(0x20), (unsigned int) memregion("cart")->u8(0x21),
// (unsigned int) memregion("cart")->u8(0x22), (unsigned int) memregion("cart")->u8(0x23));
m_flash_chip[0].manufacturer_id = 0x98;
diff --git a/src/mess/drivers/pc2000.c b/src/mess/drivers/pc2000.c
index 5b846a537b3..c6b4f23c81a 100644
--- a/src/mess/drivers/pc2000.c
+++ b/src/mess/drivers/pc2000.c
@@ -759,7 +759,7 @@ void gl4004_state::machine_start()
UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base();
if (!cart)
cart = memregion("bios")->base();
-
+
m_bank0->configure_entries(0, 0x20, bios, 0x4000);
m_bank1->configure_entries(0, 0x20, bios, 0x4000);
m_bank2->configure_entries(0, 0x20, bios, 0x4000);
@@ -814,8 +814,8 @@ DEVICE_IMAGE_LOAD_MEMBER( pc2000_state, pc2000_cart )
// we always allocate a 0x40000 region, even if most carts span only 0x20000,
// because the bankswitch code accesses up to 16 x 16K banks...
m_cart->rom_alloc(0x40000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c
index 399cb47ee4e..f86f592bd36 100644
--- a/src/mess/drivers/pc6001.c
+++ b/src/mess/drivers/pc6001.c
@@ -922,7 +922,7 @@ WRITE8_MEMBER(pc6001_state::nec_ppi8255_w)
static ADDRESS_MAP_START(pc6001_map, AS_PROGRAM, 8, pc6001_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x3fff) AM_ROM AM_WRITENOP
- //AM_RANGE(0x4000, 0x5fff) // mapped by the cartslot
+ //AM_RANGE(0x4000, 0x5fff) // mapped by the cartslot
AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0x8000, 0xffff) AM_RAM AM_SHARE("ram")
ADDRESS_MAP_END
@@ -1639,7 +1639,7 @@ WRITE8_MEMBER(pc6001_state::necsr_ppi8255_w)
if(0)
{
//printf("%02x\n",data);
-
+
if ((data & 0x0f) == 0x05 && m_cart_rom)
m_bank1->set_base(m_cart_rom->base() + 0x2000);
if ((data & 0x0f) == 0x04)
@@ -2074,13 +2074,13 @@ void pc6001_state::machine_start()
void pc6001_state::machine_reset()
{
m_video_ram = m_region_maincpu->base() + 0xc000;
-
+
if (m_cart->exists())
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
astring region_tag;
m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
-
+
m_port_c_8255=0;
m_cas_switch = 0;
@@ -2095,13 +2095,13 @@ void pc6001_state::machine_reset()
MACHINE_RESET_MEMBER(pc6001_state,pc6001m2)
{
m_video_ram = m_region_maincpu->base() + 0xc000 + 0x28000;
-
+
astring region_tag;
m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
// hackish way to simplify bankswitch handling
if (m_cart_rom)
memcpy(m_region_maincpu->base() + 0x48000, m_cart_rom->base(), 0x4000);
-
+
m_port_c_8255=0;
m_cas_switch = 0;
@@ -2134,11 +2134,11 @@ MACHINE_RESET_MEMBER(pc6001_state,pc6001m2)
MACHINE_RESET_MEMBER(pc6001_state,pc6001sr)
{
m_video_ram = m_region_maincpu->base() + 0x70000;
-
+
astring region_tag;
m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
// should this be mirrored into the EXROM regions? hard to tell without an actual cart dump...
-
+
m_port_c_8255=0;
m_cas_switch = 0;
diff --git a/src/mess/drivers/pc8401a.c b/src/mess/drivers/pc8401a.c
index a4f07f39e5c..b5c1ef4cd4b 100644
--- a/src/mess/drivers/pc8401a.c
+++ b/src/mess/drivers/pc8401a.c
@@ -521,7 +521,7 @@ void pc8401a_state::machine_start()
/* bank switch */
bankswitch(0);
-
+
/* register for state saving */
save_item(NAME(m_mmr));
save_item(NAME(m_io_addr));
diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c
index 7f3c206f1c1..c40661dee40 100644
--- a/src/mess/drivers/pc9801.c
+++ b/src/mess/drivers/pc9801.c
@@ -38,9 +38,9 @@
- Dies on ARTIC check;
- Presumably one ROM is undumped?
- TODO: (PC-9821AP)
- - No way to exit the initial loop. Code looks broken/bad dump?
-
+ TODO: (PC-9821AP)
+ - No way to exit the initial loop. Code looks broken/bad dump?
+
floppy issues TODO (certain fail)
- Unsupported disk types: *.nfd, *.fdd, *.nhd
- 46 Okunen Monogatari - The Shinkaron
@@ -553,7 +553,7 @@ public:
UINT8 m_joy_sel;
UINT8 m_ext2_ff;
UINT8 m_sys_type;
-
+
DECLARE_WRITE_LINE_MEMBER( keyboard_irq );
DECLARE_WRITE_LINE_MEMBER( write_uart_clock );
DECLARE_READ8_MEMBER(pc9801_xx_r);
@@ -702,7 +702,7 @@ public:
DECLARE_MACHINE_START(pc9801bx2);
DECLARE_MACHINE_START(pc9821);
DECLARE_MACHINE_START(pc9821ap2);
-
+
DECLARE_MACHINE_RESET(pc9801_common);
DECLARE_MACHINE_RESET(pc9801f);
DECLARE_MACHINE_RESET(pc9801rs);
@@ -1938,7 +1938,7 @@ WRITE8_MEMBER(pc9801_state::pc9801rs_knjram_w)
WRITE8_MEMBER(pc9801_state::pc9801rs_bank_w)
{
if(offset == 1)
- {
+ {
if((data & 0xf0) == 0x00 || (data & 0xf0) == 0x10)
{
if((data & 0xed) == 0x00)
@@ -3375,7 +3375,7 @@ MACHINE_START_MEMBER(pc9801_state,pc9821)
MACHINE_START_MEMBER(pc9801_state,pc9821ap2)
{
MACHINE_START_CALL_MEMBER(pc9821);
-
+
// ...
}
@@ -3891,7 +3891,7 @@ static MACHINE_CONFIG_DERIVED( pc9821ap2, pc9821)
MCFG_CPU_IO_MAP(pc9821_io)
MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_master", pic8259_device, inta_cb)
-
+
MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9821ap2)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/pegasus.c b/src/mess/drivers/pegasus.c
index 068ca37ea14..37ec17917b8 100644
--- a/src/mess/drivers/pegasus.c
+++ b/src/mess/drivers/pegasus.c
@@ -95,7 +95,7 @@ public:
DECLARE_DRIVER_INIT(pegasus);
TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq);
void pegasus_decrypt_rom(UINT8 *ROM, bool force_decrypt);
-
+
int load_cart(device_image_interface &image, generic_slot_device *slot, const char *reg_tag);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp00_load) { return load_cart(image, m_exp_00, "0000"); }
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp01_load) { return load_cart(image, m_exp_01, "1000"); }
@@ -183,10 +183,10 @@ READ8_MEMBER( pegasus_state::pegasus_protection_r )
static ADDRESS_MAP_START(pegasus_mem, AS_PROGRAM, 8, pegasus_state)
ADDRESS_MAP_UNMAP_HIGH
- //AM_RANGE(0x0000, 0x2fff) // mapped by the cartslots 1-3
+ //AM_RANGE(0x0000, 0x2fff) // mapped by the cartslots 1-3
AM_RANGE(0xb000, 0xbdff) AM_RAM
AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_SHARE("p_videoram")
- //AM_RANGE(0xc000, 0xdfff) // mapped by the cartslots 4-5
+ //AM_RANGE(0xc000, 0xdfff) // mapped by the cartslots 4-5
AM_RANGE(0xe000, 0xe1ff) AM_READ(pegasus_protection_r)
AM_RANGE(0xe200, 0xe3ff) AM_READWRITE(pegasus_pcg_r,pegasus_pcg_w)
AM_RANGE(0xe400, 0xe403) AM_MIRROR(0x1fc) AM_DEVREADWRITE("pia_u", pia6821_device, read, write)
@@ -413,13 +413,13 @@ int pegasus_state::load_cart(device_image_interface &image, generic_slot_device
{
UINT32 size = slot->common_get_size(reg_tag);
bool any_socket = false;
-
+
if (size > 0x1000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
if (image.software_entry() != NULL && size == 0)
{
// we might be loading a cart compatible with all sockets!
@@ -436,12 +436,12 @@ int pegasus_state::load_cart(device_image_interface &image, generic_slot_device
}
}
- slot->rom_alloc(0x1000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // we alloc 0x1000 also for smaller roms!
+ slot->rom_alloc(0x1000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // we alloc 0x1000 also for smaller roms!
slot->common_load_rom(slot->get_rom_base(), size, any_socket ? "rom" : reg_tag);
-
+
// raw images have to be decrypted (in particular the ones from softlist)
pegasus_decrypt_rom(slot->get_rom_base(), image.software_entry() != NULL);
-
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/pencil2.c b/src/mess/drivers/pencil2.c
index bbb45718380..bcffa59c4f8 100644
--- a/src/mess/drivers/pencil2.c
+++ b/src/mess/drivers/pencil2.c
@@ -107,7 +107,7 @@ static ADDRESS_MAP_START(pencil2_mem, AS_PROGRAM, 8, pencil2_state)
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x2000, 0x5fff) AM_WRITENOP // stop error log filling up
AM_RANGE(0x6000, 0x67ff) AM_MIRROR(0x1800) AM_RAM
- //AM_RANGE(0x8000, 0xffff) // mapped by the cartslot
+ //AM_RANGE(0x8000, 0xffff) // mapped by the cartslot
ADDRESS_MAP_END
static ADDRESS_MAP_START(pencil2_io, AS_IO, 8, pencil2_state)
diff --git a/src/mess/drivers/pet.c b/src/mess/drivers/pet.c
index 0f982885a23..09f4dca6c9b 100644
--- a/src/mess/drivers/pet.c
+++ b/src/mess/drivers/pet.c
@@ -248,7 +248,7 @@ READ8_MEMBER( pet_state::read )
data = m_rom->base()[offset - 0x9000];
}
break;
-
+
case SELB:
if (norom)
{
@@ -258,7 +258,7 @@ READ8_MEMBER( pet_state::read )
data = m_rom->base()[offset - 0x9000];
}
break;
-
+
case SELC: case SELD: case SELF:
if (norom)
{
diff --git a/src/mess/drivers/pockstat.c b/src/mess/drivers/pockstat.c
index 64bdc7dae4e..cb599de0751 100644
--- a/src/mess/drivers/pockstat.c
+++ b/src/mess/drivers/pockstat.c
@@ -961,7 +961,7 @@ DEVICE_IMAGE_LOAD_MEMBER( pockstat_state, pockstat_flash )
if (size != 0x20f40)
return IMAGE_INIT_FAIL;
-
+
image.fread(cart_id, 0xf40);
for (int i = 0; i < strlen(gme_id); i++)
diff --git a/src/mess/drivers/pokemini.c b/src/mess/drivers/pokemini.c
index 14a3a87de59..a12452db818 100644
--- a/src/mess/drivers/pokemini.c
+++ b/src/mess/drivers/pokemini.c
@@ -56,7 +56,7 @@ public:
m_speaker(*this, "speaker"),
m_i2cmem(*this, "i2cmem"),
m_cart(*this, "cartslot"),
- m_inputs(*this, "INPUTS")
+ m_inputs(*this, "INPUTS")
{ }
UINT8 m_pm_reg[0x100];
@@ -1506,7 +1506,7 @@ DEVICE_IMAGE_LOAD_MEMBER( pokemini_state, pokemini_cart )
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid ROM image: ROM image is too small");
return IMAGE_INIT_FAIL;
}
-
+
/* Verify that the image is not too big */
if (size > 0x1fffff)
{
@@ -1515,7 +1515,7 @@ DEVICE_IMAGE_LOAD_MEMBER( pokemini_state, pokemini_cart )
}
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/pt68k4.c b/src/mess/drivers/pt68k4.c
index 3f5c0a6b6f8..e163f1539df 100644
--- a/src/mess/drivers/pt68k4.c
+++ b/src/mess/drivers/pt68k4.c
@@ -9,21 +9,21 @@
2014-01-03 Connect real DUARTs, FDC, and TimeKeeper. Settings now save properly, floppies can be read.
2014-01-19 ISA bus and compatible cards, PC keyboard support, speaker support
2014-09-20 Add PT68K2, add save states, we have a working SK*DOS disk!
-
+
This has the appearance of a PC, including pc power supply, slots, etc
on a conventional pc-like motherboard and case.
Some pics: http://www.wormfood.net/old_computers/
-
-Source code and manuals for the HUMBUG BIOS and SK*DOS are at:
-http://www.users.cloud9.net/~stark/sources.html
-
-Usage:
+
+Source code and manuals for the HUMBUG BIOS and SK*DOS are at:
+http://www.users.cloud9.net/~stark/sources.html
+
+Usage:
Start up and press Enter as prompted. Type he to see a command list, or fd to boot from the
first floppy drive.
-
+
The stock NVRAM configures PT68k2 for 2 DSDD 5.25" drives, and PT68k4 for 2 DSHD 5.25" drives.
-
+
Chips:
68230 Parallel Interface/Timer @ FE0081
68681 DUART/Timer (x2) @ FE0001 and FE0041
@@ -48,9 +48,9 @@ IRQs:
5: DUART1
6: PC FDC IRQ
-TODO: 68230 device
- This system and SK*DOS don't like our ISA WDXT-GEN emulation so HDD installs are not currently possible.
-
+TODO: 68230 device
+ This system and SK*DOS don't like our ISA WDXT-GEN emulation so HDD installs are not currently possible.
+
****************************************************************************/
#include "emu.h"
@@ -73,7 +73,7 @@ TODO: 68230 device
#define ISABUS_TAG "isa"
#define KBDC_TAG "pc_kbdc"
#define SPEAKER_TAG "speaker"
-#define WDFDC_TAG "wdfdc"
+#define WDFDC_TAG "wdfdc"
class pt68k4_state : public driver_device
{
@@ -219,11 +219,11 @@ WRITE8_MEMBER(pt68k4_state::fdc_select_w)
switch (drive)
{
case 0:
- floppy->ss_w((data & 0x40) ? 1 : 0);
+ floppy->ss_w((data & 0x40) ? 1 : 0);
break;
case 1:
- floppy2->ss_w((data & 0x40) ? 1 : 0);
+ floppy2->ss_w((data & 0x40) ? 1 : 0);
break;
default:
@@ -381,7 +381,7 @@ SLOT_INTERFACE_END
static MACHINE_CONFIG_START( pt68k2, pt68k4_state )
/* basic machine hardware */
- MCFG_CPU_ADD(M68K_TAG, M68000, XTAL_16MHz/2) // 68k2 came in 8, 10, and 12 MHz versions
+ MCFG_CPU_ADD(M68K_TAG, M68000, XTAL_16MHz/2) // 68k2 came in 8, 10, and 12 MHz versions
MCFG_CPU_PROGRAM_MAP(pt68k2_mem)
MCFG_MC68681_ADD("duart1", XTAL_3_6864MHz)
@@ -459,8 +459,8 @@ MACHINE_CONFIG_END
/* ROM definition */
ROM_START( pt68k2 )
ROM_REGION16_BE( 0x10000, "roms", 0 )
- ROM_LOAD16_BYTE( "hum_u20.bin", 0x000000, 0x008000, CRC(69db483a) SHA1(9dfea73e4d7deef7c66a27cca92eb7c9ff767215) )
- ROM_LOAD16_BYTE( "hum_u27.bin", 0x000001, 0x008000, CRC(54441b06) SHA1(0e2d63b1cd01f88f37fc4859c11c252c4fea220b) )
+ ROM_LOAD16_BYTE( "hum_u20.bin", 0x000000, 0x008000, CRC(69db483a) SHA1(9dfea73e4d7deef7c66a27cca92eb7c9ff767215) )
+ ROM_LOAD16_BYTE( "hum_u27.bin", 0x000001, 0x008000, CRC(54441b06) SHA1(0e2d63b1cd01f88f37fc4859c11c252c4fea220b) )
ROM_REGION(0x800, TIMEKEEPER_TAG, 0)
ROM_LOAD( "u21_ds1220.bin", 0x000000, 0x000800, CRC(7a6b75ce) SHA1(07663860aa6cc21aed04a568ff9c05bc75d62e4f) )
diff --git a/src/mess/drivers/pv1000.c b/src/mess/drivers/pv1000.c
index bf3118263f5..5dff81ea8e1 100644
--- a/src/mess/drivers/pv1000.c
+++ b/src/mess/drivers/pv1000.c
@@ -185,7 +185,7 @@ public:
static ADDRESS_MAP_START( pv1000, AS_PROGRAM, 8, pv1000_state )
- //AM_RANGE(0x0000, 0x7fff) // mapped by the cartslot
+ //AM_RANGE(0x0000, 0x7fff) // mapped by the cartslot
AM_RANGE(0xb800, 0xbbff) AM_RAM AM_SHARE("p_videoram")
AM_RANGE(0xbc00, 0xbfff) AM_RAM_WRITE(gfxram_w) AM_REGION("gfxram", 0)
ADDRESS_MAP_END
@@ -312,16 +312,16 @@ PALETTE_INIT_MEMBER(pv1000_state, pv1000)
DEVICE_IMAGE_LOAD_MEMBER( pv1000_state, pv1000_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size != 0x2000 && size != 0x4000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
@@ -407,7 +407,7 @@ void pv1000_state::machine_start()
// FIXME: this is needed for gfx decoding, but there is probably a cleaner solution!
astring region_tag;
memcpy(memregion("gfxrom")->base(), memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base(), m_cart->get_rom_size());
- }
+ }
save_item(NAME(m_io_regs));
save_item(NAME(m_fd_data));
diff --git a/src/mess/drivers/pv2000.c b/src/mess/drivers/pv2000.c
index 8f4bf1e76fd..11719fdb074 100644
--- a/src/mess/drivers/pv2000.c
+++ b/src/mess/drivers/pv2000.c
@@ -179,7 +179,7 @@ static ADDRESS_MAP_START( pv2000_map, AS_PROGRAM, 8, pv2000_state )
AM_RANGE(0x7000, 0x7fff) AM_RAM
//AM_RANGE(0x8000, 0xbfff) ext ram?
- //AM_RANGE(0xc000, 0xffff) // mapped by the cartslot
+ //AM_RANGE(0xc000, 0xffff) // mapped by the cartslot
ADDRESS_MAP_END
@@ -361,16 +361,16 @@ void pv2000_state::machine_reset()
DEVICE_IMAGE_LOAD_MEMBER( pv2000_state, pv2000_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size != 0x2000 && size != 0x4000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/rx78.c b/src/mess/drivers/rx78.c
index 3a334a72268..c12443405d6 100644
--- a/src/mess/drivers/rx78.c
+++ b/src/mess/drivers/rx78.c
@@ -259,7 +259,7 @@ WRITE8_MEMBER( rx78_state::vdp_pri_mask_w )
static ADDRESS_MAP_START(rx78_mem, AS_PROGRAM, 8, rx78_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x1fff) AM_ROM
- //AM_RANGE(0x2000, 0x5fff) // mapped by the cartslot
+ //AM_RANGE(0x2000, 0x5fff) // mapped by the cartslot
AM_RANGE(0x6000, 0xafff) AM_RAM //ext RAM
AM_RANGE(0xb000, 0xebff) AM_RAM
AM_RANGE(0xec00, 0xffff) AM_READWRITE(rx78_vram_r, rx78_vram_w)
@@ -409,7 +409,7 @@ INPUT_PORTS_END
void rx78_state::machine_reset()
{
- address_space &prg = m_maincpu->space(AS_PROGRAM);
+ address_space &prg = m_maincpu->space(AS_PROGRAM);
if (m_cart->exists())
prg.install_read_handler(0x2000, 0x5fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
}
@@ -417,16 +417,16 @@ void rx78_state::machine_reset()
DEVICE_IMAGE_LOAD_MEMBER( rx78_state, rx78_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size != 0x2000 && size != 0x4000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/scv.c b/src/mess/drivers/scv.c
index 9ee007a2550..f14e795a0cc 100644
--- a/src/mess/drivers/scv.c
+++ b/src/mess/drivers/scv.c
@@ -64,13 +64,13 @@ protected:
static ADDRESS_MAP_START( scv_mem, AS_PROGRAM, 8, scv_state )
- AM_RANGE( 0x0000, 0x0fff ) AM_ROM // BIOS
+ AM_RANGE( 0x0000, 0x0fff ) AM_ROM // BIOS
AM_RANGE( 0x2000, 0x3403 ) AM_RAM AM_SHARE("videoram") // VRAM + 4 registers
AM_RANGE( 0x3600, 0x3600 ) AM_DEVWRITE("upd1771c", upd1771c_device, write)
- AM_RANGE( 0x8000, 0xff7f ) AM_DEVREADWRITE("cartslot", scv_cart_slot_device, read_cart, write_cart) // cartridge
- AM_RANGE( 0xff80, 0xffff ) AM_RAM // upd7801 internal RAM
+ AM_RANGE( 0x8000, 0xff7f ) AM_DEVREADWRITE("cartslot", scv_cart_slot_device, read_cart, write_cart) // cartridge
+ AM_RANGE( 0xff80, 0xffff ) AM_RAM // upd7801 internal RAM
ADDRESS_MAP_END
diff --git a/src/mess/drivers/socrates.c b/src/mess/drivers/socrates.c
index f7e90cc6c3d..9d9bad38b88 100644
--- a/src/mess/drivers/socrates.c
+++ b/src/mess/drivers/socrates.c
@@ -319,7 +319,7 @@ void socrates_state::machine_reset()
{
astring region_tag;
m_cart_reg = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
-
+
m_rom_bank = 0xF3; // actually set semi-randomly on real console but we need to initialize it somewhere...
socrates_set_rom_bank();
m_ram_bank = 0; // the actual console sets it semi randomly on power up, and the bios cleans it up.
@@ -898,7 +898,7 @@ void iqunlim_state::machine_start()
{
astring region_tag;
m_cart_reg = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
-
+
UINT8 *bios = m_bios_reg->base();
UINT8 *cart = m_cart_reg ? m_cart_reg->base() : m_bios_reg->base();
UINT8 *ram = m_vram_reg->base();
diff --git a/src/mess/drivers/sorcerer.c b/src/mess/drivers/sorcerer.c
index 804be385a10..05c320acf7b 100644
--- a/src/mess/drivers/sorcerer.c
+++ b/src/mess/drivers/sorcerer.c
@@ -163,7 +163,7 @@ static ADDRESS_MAP_START( sorcerer_mem, AS_PROGRAM, 8, sorcerer_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x07ff) AM_RAMBANK("boot")
AM_RANGE(0x0800, 0xbfff) AM_RAM
- //AM_RANGE(0xc000, 0xdfff) // mapped by the cartslot
+ //AM_RANGE(0xc000, 0xdfff) // mapped by the cartslot
AM_RANGE(0xe000, 0xefff) AM_ROM /* rom pac and bios */
AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_REGION("maincpu", 0xf000) /* screen ram */
AM_RANGE(0xf800, 0xfbff) AM_ROM /* char rom */
@@ -176,7 +176,7 @@ static ADDRESS_MAP_START( sorcererd_mem, AS_PROGRAM, 8, sorcerer_state)
AM_RANGE(0x0800, 0xbbff) AM_RAM
AM_RANGE(0xbc00, 0xbcff) AM_ROM
AM_RANGE(0xbe00, 0xbe03) AM_DEVREADWRITE("fdc", micropolis_device, read, write)
- //AM_RANGE(0xc000, 0xdfff) // mapped by the cartslot
+ //AM_RANGE(0xc000, 0xdfff) // mapped by the cartslot
AM_RANGE(0xe000, 0xefff) AM_ROM /* rom pac and bios */
AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_REGION("maincpu", 0xf000) /* screen ram */
AM_RANGE(0xf800, 0xfbff) AM_ROM /* char rom */
diff --git a/src/mess/drivers/spc1000.c b/src/mess/drivers/spc1000.c
index 31aa390010a..dcfb79dca44 100644
--- a/src/mess/drivers/spc1000.c
+++ b/src/mess/drivers/spc1000.c
@@ -70,7 +70,7 @@ public:
DECLARE_READ8_MEMBER(fdc_8255_c_r);
DECLARE_WRITE8_MEMBER(fdc_8255_c_w);
DECLARE_READ8_MEMBER( upd765_tc_r );
- DECLARE_WRITE8_MEMBER( fdc_control_w );
+ DECLARE_WRITE8_MEMBER( fdc_control_w );
MC6847_GET_CHARROM_MEMBER(get_char_rom)
{
return m_p_videoram[0x1000 + (ch & 0x7f) * 16 + line];
@@ -85,27 +85,27 @@ private:
virtual void machine_reset();
required_device<mc6847_base_device> m_vdg;
required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_fdccpu;
- required_device<upd765a_device> m_fdc;
+ required_device<cpu_device> m_fdccpu;
+ required_device<upd765a_device> m_fdc;
required_device<i8255_device> m_pio;
required_device<ram_device> m_ram;
required_device<cassette_image_device> m_cass;
floppy_image_device *m_fd0;
floppy_image_device *m_fd1;
-
- emu_timer *m_timer_tc;
-
+
+ emu_timer *m_timer_tc;
+
UINT8 m_i8255_0_pc;
UINT8 m_i8255_1_pc;
UINT8 m_i8255_portb;
-
+
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
};
void spc1000_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- m_fdc->tc_w(false);
+ m_fdc->tc_w(false);
}
static ADDRESS_MAP_START(spc1000_mem, AS_PROGRAM, 8, spc1000_state )
@@ -255,7 +255,7 @@ static ADDRESS_MAP_START( spc1000_io , AS_IO, 8, spc1000_state )
AM_RANGE(0x8009, 0x8009) AM_READ_PORT("LINE9")
AM_RANGE(0xA000, 0xA000) AM_READWRITE(spc1000_iplk_r, spc1000_iplk_w)
AM_RANGE(0xC000, 0xC002) AM_READWRITE(spc1000_sd725_r, spc1000_sd725_w)
-// AM_RANGE(0xC000, 0xC003) AM_DEVREADWRITE("d8255_master", i8255_device, read, write)
+// AM_RANGE(0xC000, 0xC003) AM_DEVREADWRITE("d8255_master", i8255_device, read, write)
ADDRESS_MAP_END
/* Input ports */
@@ -342,7 +342,7 @@ static INPUT_PORTS_START( spc1000 )
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') PORT_CHAR(0x09)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 (") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
PORT_START("LINE9")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_START) PORT_NAME("IPL") PORT_CODE(KEYCODE_END)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_START) PORT_NAME("IPL") PORT_CODE(KEYCODE_END)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("- =") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0')
@@ -369,20 +369,20 @@ void spc1000_state::machine_reset()
membank("bank2")->set_base(ram);
membank("bank3")->set_base(mem);
membank("bank4")->set_base(ram + 0x8000);
-
+
m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
m_fdccpu->set_input_line_vector(0, 0);
-
+
m_fd0 = machine().device<floppy_connector>("upd765:0")->get_device();
m_fd1 = machine().device<floppy_connector>("upd765:1")->get_device();
- m_timer_tc = timer_alloc(1, NULL);
+ m_timer_tc = timer_alloc(1, NULL);
m_timer_tc->adjust(attotime::never);
// enable rom
- m_fdccpu->space(AS_PROGRAM).install_rom(0x0000, 0xfff, 0, 0x2000, memregion("rom")->base());
-
- m_IPLK = 1;
+ m_fdccpu->space(AS_PROGRAM).install_rom(0x0000, 0xfff, 0, 0x2000, memregion("rom")->base());
+
+ m_IPLK = 1;
}
READ8_MEMBER(spc1000_state::mc6847_videoram_r)
@@ -452,23 +452,23 @@ static MACHINE_CONFIG_START( spc1000, spc1000_state )
MCFG_CPU_ADD("fdccpu", Z80, XTAL_4MHz) /* 4 MHz */
MCFG_CPU_PROGRAM_MAP(sd725_mem)
MCFG_CPU_IO_MAP(sd725_io)
-
+
MCFG_DEVICE_ADD("d8255_master", I8255, 0)
MCFG_I8255_IN_PORTA_CB(DEVREAD8("d8255_master", i8255_device, pb_r))
MCFG_I8255_IN_PORTB_CB(DEVREAD8("d8255_master", i8255_device, pa_r))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(spc1000_state, fdc_8255_b_w))
+ MCFG_I8255_OUT_PORTB_CB(WRITE8(spc1000_state, fdc_8255_b_w))
MCFG_I8255_IN_PORTC_CB(READ8(spc1000_state, fdc_8255_c_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(spc1000_state, fdc_8255_c_w))
+ MCFG_I8255_OUT_PORTC_CB(WRITE8(spc1000_state, fdc_8255_c_w))
// floppy disk controller
MCFG_UPD765A_ADD("upd765", true, true)
- MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("fdccpu", INPUT_LINE_IRQ0))
+ MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("fdccpu", INPUT_LINE_IRQ0))
// floppy drives
MCFG_FLOPPY_DRIVE_ADD("upd765:0", sd725_floppies, "sd320", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("upd765:1", sd725_floppies, "sd320", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("upd765:1", sd725_floppies, "sd320", floppy_image_device::default_floppy_formats)
//CFG_SOFTWARE_LIST_ADD("disk_list","spc1000_flop")
-
+
/* video hardware */
MCFG_SCREEN_MC6847_NTSC_ADD("screen", "mc6847")
@@ -501,8 +501,8 @@ ROM_START( spc1000 )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "spcall.rom", 0x0000, 0x8000, CRC(19638fc9) SHA1(489f1baa7aebf3c8c660325fb1fd790d84203284))
- ROM_REGION( 0x10000, "fdccpu", 0)
- ROM_LOAD("sd725a.bin", 0x0000, 0x1000, CRC(96ac2eb8) SHA1(8e9d8f63a7fb87af417e95603e71cf537a6e83f1))
+ ROM_REGION( 0x10000, "fdccpu", 0)
+ ROM_LOAD("sd725a.bin", 0x0000, 0x1000, CRC(96ac2eb8) SHA1(8e9d8f63a7fb87af417e95603e71cf537a6e83f1))
ROM_END
#if 0
diff --git a/src/mess/drivers/specpls3.c b/src/mess/drivers/specpls3.c
index 3e4502bd780..cc761d7a5c6 100644
--- a/src/mess/drivers/specpls3.c
+++ b/src/mess/drivers/specpls3.c
@@ -217,13 +217,13 @@ void spectrum_state::spectrum_plus3_update_memory()
int ram_page = m_port_7ffd_data & 0x07;
unsigned char *ram_data = messram + (ram_page<<14);
membank("bank4")->set_base(ram_data);
-
+
logerror("RAM at 0xc000: %02x\n", ram_page);
-
+
/* Reset memory between 0x4000 - 0xbfff in case extended paging was being used */
/* Bank 5 in 0x4000 - 0x7fff */
membank("bank2")->set_base(messram + (5 << 14));
-
+
/* Bank 2 in 0x8000 - 0xbfff */
membank("bank3")->set_base(messram + (2 << 14));
@@ -231,13 +231,13 @@ void spectrum_state::spectrum_plus3_update_memory()
{
/* ROM switching */
int ROMSelection = BIT(m_port_7ffd_data, 4) | ((m_port_1ffd_data >> 1) & 0x02);
-
+
/* rom 0 is editor, rom 1 is syntax, rom 2 is DOS, rom 3 is 48 BASIC */
unsigned char *ChosenROM = memregion("maincpu")->base() + 0x010000 + (ROMSelection << 14);
-
+
membank("bank1")->set_base(ChosenROM);
space.unmap_write(0x0000, 0x3fff);
-
+
logerror("rom switch: %02x\n", ROMSelection);
}
}
@@ -247,20 +247,20 @@ void spectrum_state::spectrum_plus3_update_memory()
int MemorySelection = (m_port_1ffd_data >> 1) & 0x03;
const int *memory_selection = &spectrum_plus3_memory_selections[(MemorySelection << 2)];
unsigned char *ram_data = messram + (memory_selection[0] << 14);
-
+
membank("bank1")->set_base(ram_data);
/* allow writes to 0x0000-0x03fff */
space.install_write_bank(0x0000, 0x3fff, "bank1");
-
+
ram_data = messram + (memory_selection[1] << 14);
membank("bank2")->set_base(ram_data);
-
+
ram_data = messram + (memory_selection[2] << 14);
membank("bank3")->set_base(ram_data);
-
+
ram_data = messram + (memory_selection[3] << 14);
membank("bank4")->set_base(ram_data);
-
+
logerror("extended memory paging: %02x\n", MemorySelection);
}
}
diff --git a/src/mess/drivers/spectrum.c b/src/mess/drivers/spectrum.c
index 545bb649ec7..5ecfdbb1ad6 100644
--- a/src/mess/drivers/spectrum.c
+++ b/src/mess/drivers/spectrum.c
@@ -654,16 +654,16 @@ INTERRUPT_GEN_MEMBER(spectrum_state::spec_interrupt)
DEVICE_IMAGE_LOAD_MEMBER(spectrum_state, spectrum_cart)
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size != 0x4000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/studio2.c b/src/mess/drivers/studio2.c
index 822808ed027..6c731019253 100644
--- a/src/mess/drivers/studio2.c
+++ b/src/mess/drivers/studio2.c
@@ -201,7 +201,7 @@ Notes:
class studio2_state : public driver_device
{
public:
-
+
studio2_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, CDP1802_TAG),
@@ -213,7 +213,7 @@ public:
m_b(*this, "B"),
m_screen(*this, "screen")
{ }
-
+
required_device<cosmac_device> m_maincpu;
required_device<beep_device> m_beeper;
optional_device<cdp1861_device> m_vdc;
@@ -222,10 +222,10 @@ public:
required_ioport m_a;
required_ioport m_b;
required_device<screen_device> m_screen;
-
+
virtual void machine_start();
virtual void machine_reset();
-
+
DECLARE_READ8_MEMBER( cart_400 );
DECLARE_READ8_MEMBER( cart_a00 );
DECLARE_READ8_MEMBER( cart_e00 );
@@ -238,7 +238,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( q_w );
DECLARE_INPUT_CHANGED_MEMBER( reset_w );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( studio2_cart_load );
-
+
/* keyboard state */
UINT8 m_keylatch;
DECLARE_DRIVER_INIT(studio2);
@@ -252,12 +252,12 @@ public:
m_color0_ram(*this, "color0_ram"),
m_color1_ram(*this, "color1_ram")
{ }
-
+
virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
-
+
required_shared_ptr<UINT8> m_color0_ram;
required_shared_ptr<UINT8> m_color1_ram;
-
+
DECLARE_WRITE8_MEMBER( dma_w );
};
@@ -269,18 +269,18 @@ public:
m_cti(*this, CDP1864_TAG),
m_color_ram(*this, "color_ram")
{ }
-
+
required_device<cdp1864_device> m_cti;
-
+
virtual void machine_start();
virtual void machine_reset();
-
+
DECLARE_READ8_MEMBER( cart_c00 );
DECLARE_WRITE8_MEMBER( dma_w );
DECLARE_READ_LINE_MEMBER( rdata_r );
DECLARE_READ_LINE_MEMBER( bdata_r );
DECLARE_READ_LINE_MEMBER( gdata_r );
-
+
/* video state */
required_shared_ptr<UINT8> m_color_ram;
UINT8 m_color;
@@ -511,7 +511,7 @@ void mpt02_state::machine_start()
m_maincpu->space(AS_PROGRAM).install_read_handler(0x0400, 0x07ff, read8_delegate(FUNC(studio2_state::cart_400), this));
m_maincpu->space(AS_PROGRAM).install_read_handler(0x0c00, 0x0fff, read8_delegate(FUNC(mpt02_state::cart_c00), this));
}
-
+
// register for state saving
save_item(NAME(m_keylatch));
}
@@ -529,10 +529,10 @@ void mpt02_state::machine_reset()
DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load )
{
UINT32 size;
-
+
// always alloc 3K, even if range $400-$600 is not read by the system (RAM is present there)
m_cart->rom_alloc(0xc00, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
-
+
if (image.software_entry() == NULL)
{
if (!strcmp(image.filetype(), "st2"))
@@ -540,8 +540,8 @@ DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load )
UINT8 header[0x100];
UINT8 catalogue[10], title[32], pages[64];
UINT8 blocks;
-
- if (image.length() <= 0x100)
+
+ if (image.length() <= 0x100)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid ROM file");
return IMAGE_INIT_FAIL;
@@ -560,7 +560,7 @@ DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load )
memcpy(&catalogue, &header[16], 10);
memcpy(&title, &header[32], 32);
memcpy(&pages, &header[64], 64);
-
+
/* read ST2 cartridge into memory */
for (int block = 0; block < (blocks - 1); block++)
{
diff --git a/src/mess/drivers/supracan.c b/src/mess/drivers/supracan.c
index b025f1570f6..3a1e60accef 100644
--- a/src/mess/drivers/supracan.c
+++ b/src/mess/drivers/supracan.c
@@ -1125,7 +1125,7 @@ WRITE16_MEMBER( supracan_state::vram_w )
}
static ADDRESS_MAP_START( supracan_mem, AS_PROGRAM, 16, supracan_state )
- //AM_RANGE( 0x000000, 0x3fffff ) // mapped by the cartslot
+ //AM_RANGE( 0x000000, 0x3fffff ) // mapped by the cartslot
AM_RANGE( 0xe80200, 0xe80201 ) AM_READ_PORT("P1")
AM_RANGE( 0xe80202, 0xe80203 ) AM_READ_PORT("P2")
AM_RANGE( 0xe80208, 0xe80209 ) AM_READ_PORT("P3")
@@ -1754,7 +1754,7 @@ WRITE16_MEMBER( supracan_state::video_w )
DEVICE_IMAGE_LOAD_MEMBER( supracan_state, supracan_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size > 0x400000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
@@ -1762,8 +1762,8 @@ DEVICE_IMAGE_LOAD_MEMBER( supracan_state, supracan_cart )
}
m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_BIG);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/sv8000.c b/src/mess/drivers/sv8000.c
index 597156c5030..1f9925c7a91 100644
--- a/src/mess/drivers/sv8000.c
+++ b/src/mess/drivers/sv8000.c
@@ -94,7 +94,7 @@ private:
static ADDRESS_MAP_START(sv8000_mem, AS_PROGRAM, 8, sv8000_state)
ADDRESS_MAP_UNMAP_HIGH
- //AM_RANGE(0x0000, 0x0fff) // mapped by the cartslot
+ //AM_RANGE(0x0000, 0x0fff) // mapped by the cartslot
AM_RANGE( 0x8000, 0x83ff ) AM_RAM // Work RAM??
AM_RANGE( 0xc000, 0xcbff ) AM_RAM AM_SHARE("videoram")
ADDRESS_MAP_END
@@ -197,16 +197,16 @@ void sv8000_state::machine_reset()
DEVICE_IMAGE_LOAD_MEMBER( sv8000_state, cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size != 0x1000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Incorrect or not support cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/svision.c b/src/mess/drivers/svision.c
index 88e657ec2c8..f92f5b7cc0b 100644
--- a/src/mess/drivers/svision.c
+++ b/src/mess/drivers/svision.c
@@ -452,16 +452,16 @@ DRIVER_INIT_MEMBER(svision_state, svisions)
DEVICE_IMAGE_LOAD_MEMBER( svision_state, svision_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
if (size > 0x20000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/thomson.c b/src/mess/drivers/thomson.c
index 1ad8eacabce..3db601fcccf 100644
--- a/src/mess/drivers/thomson.c
+++ b/src/mess/drivers/thomson.c
@@ -1093,7 +1093,7 @@ static MACHINE_CONFIG_DERIVED( mo5, to7 )
MCFG_DEVICE_REMOVE( "mc6846" )
- MCFG_PALETTE_MODIFY( "palette" )
+ MCFG_PALETTE_MODIFY( "palette" )
MCFG_PALETTE_INIT_OWNER(thomson_state, mo5)
MCFG_DEVICE_MODIFY(THOM_PIA_SYS)
diff --git a/src/mess/drivers/ti74.c b/src/mess/drivers/ti74.c
index d7cbfb08c8b..d06a75a2b76 100644
--- a/src/mess/drivers/ti74.c
+++ b/src/mess/drivers/ti74.c
@@ -5,11 +5,11 @@
Texas Instruments TI-74 BASICALC
Texas Instruments TI-95 PROCALC
hardware family: CC-40 -> TI-74 BASICALC -> TI-95 PROCALC
-
+
TI-74 PCB layout:
note: TI-95 PCB is nearly the same, just with a different size LCD screen,
its CPU is labeled C70011, and the system ROM is labeled HN61256PC95.
-
+
DOCK-BUS
--||||||||---
C == |
@@ -49,16 +49,16 @@
* - indicates that it's on the other side of the PCB
-
+
Overall, the hardware is very similar to TI CC-40. A lot has been shuffled around
to cut down on complexity (and probably for protection too). To reduce power usage
even more, the OS often idles while waiting for any keypress that triggers an interrupt
and wakes the processor up.
-
+
The machine is powered by 4 AAA batteries. These will also save internal RAM,
provided that the machine is turned off properly.
-
-
+
+
TODO:
- it runs too fast due to missing clock divider emulation in TMS70C46
- external ram cartridge
@@ -131,10 +131,10 @@ DEVICE_IMAGE_LOAD_MEMBER(ti74_state, ti74_cartridge)
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid file size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
@@ -165,7 +165,7 @@ void ti74_state::update_lcd_indicator(UINT8 y, UINT8 x, int state)
// TI-95 ref._________________...
// output# | 40 43 41 44 42 12 11 10/13/14 0 1 2
// above | _LOW _ERROR 2nd INV ALPHA LC INS DEGRAD HEX OCT I/O
- // screen- | _P{70} <{71} RUN{3}
+ // screen- | _P{70} <{71} RUN{3}
// area . SYS{4}
output_set_lamp_value(y * 10 + x, state);
}
@@ -175,7 +175,7 @@ static HD44780_PIXEL_UPDATE(ti74_pixel_update)
// char size is 5x7 + cursor
if (x > 4 || y > 7)
return;
-
+
if (line == 1 && pos == 15)
{
// the last char is used to control the 14 lcd indicators
@@ -236,7 +236,7 @@ READ8_MEMBER(ti74_state::keyboard_r)
if (m_key_select >> i & 1)
ret |= m_key_matrix[i]->read();
}
-
+
return ret;
}
@@ -250,14 +250,14 @@ WRITE8_MEMBER(ti74_state::bankswitch_w)
{
// d0-d1: system rom bankswitch
membank("sysbank")->set_entry(data & 3);
-
+
// d2: power-on latch
if (~data & 4 && m_power)
{
m_power = 0;
m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // stop running
}
-
+
// d3: N/C
}
@@ -265,7 +265,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, ti74_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("hd44780", hd44780_device, read, write)
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("sysram.ic3")
- //AM_RANGE(0x4000, 0xbfff) // mapped by the cartslot
+ //AM_RANGE(0x4000, 0xbfff) // mapped by the cartslot
AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("sysbank")
ADDRESS_MAP_END
@@ -486,7 +486,7 @@ void ti74_state::update_battery_status(int state)
void ti74_state::machine_reset()
{
m_power = 1;
-
+
update_battery_status(m_battery_inp->read());
}
diff --git a/src/mess/drivers/timex.c b/src/mess/drivers/timex.c
index 2221048011e..ade345aeb1c 100644
--- a/src/mess/drivers/timex.c
+++ b/src/mess/drivers/timex.c
@@ -598,7 +598,7 @@ DEVICE_IMAGE_LOAD_MEMBER( spectrum_state, timex_cart )
int chunks_in_file = 0;
dynamic_buffer header;
header.resize(9);
-
+
if (size % 0x2000 != 9)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "File corrupted");
@@ -609,22 +609,22 @@ DEVICE_IMAGE_LOAD_MEMBER( spectrum_state, timex_cart )
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Loading from softlist is not supported yet");
return IMAGE_INIT_FAIL;
}
-
+
m_dock->rom_alloc(0x10000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
DOCK = m_dock->get_rom_base();
-
+
// check header
image.fread(header, 9);
-
+
for (int i = 0; i < 8; i++)
if (header[i + 1] & 0x02) chunks_in_file++;
-
+
if (chunks_in_file * 0x2000 + 0x09 != size)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "File corrupted");
return IMAGE_INIT_FAIL;
}
-
+
switch (header[0])
{
case 0x00: logerror ("DOCK cart\n");
@@ -643,7 +643,7 @@ DEVICE_IMAGE_LOAD_MEMBER( spectrum_state, timex_cart )
}
}
break;
-
+
default:
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Cart type not supported");
return IMAGE_INIT_FAIL;
diff --git a/src/mess/drivers/tsispch.c b/src/mess/drivers/tsispch.c
index 642a0fa9080..42096121f51 100644
--- a/src/mess/drivers/tsispch.c
+++ b/src/mess/drivers/tsispch.c
@@ -482,7 +482,7 @@ ROM_START( prose2k )
// 0 - to /CE of ROMs 12(U27) and 13(U50)
//
// Note U81 is optional; it can be replaced by a 74s138 instead of a prom,
- // with A19, A18, A17 as inputs, for decoding the roms as:
+ // with A19, A18, A17 as inputs, for decoding the roms as:
// 7 - to /CE of ROMs 0(U21) and 1(U44) (0xE0000-0xE3FFF)
// 6 - to /CE of ROMs 2(U22) and 3(U45) (0xE4000-0xE7FFF)
// 5 - to /CE of ROMs 4(U23) and 5(U46) (0xE8000-0xEBFFF)
@@ -490,8 +490,8 @@ ROM_START( prose2k )
// 3 - to /CE of ROMs 8(U25) and 9(U48) (0xF0000-0xF3FFF)
// 2 - to /CE of ROMs 10(U26) and 11(U49) (0xF4000-0xF7FFF)
// 1 - to /CE of ROMs 12(U27) and 13(U50) (0xF8000-0xFBFFF)
- // 0 - to /CE of ROMs 14(U28) and 15(U51) (0xFC000-0xFFFFF)
-
+ // 0 - to /CE of ROMs 14(U28) and 15(U51) (0xFC000-0xFFFFF)
+
ROM_REGION(0x1000, "proms", 0)
ROM_LOAD( "am27s19.u77", 0x0000, 0x0020, CRC(A88757FC) SHA1(9066D6DBC009D7A126D75B8461CA464DDF134412))
ROM_LOAD( "am27s19.u79", 0x0020, 0x0020, CRC(A165B090) SHA1(BFC413C79915C68906033741318C070AD5DD0F6B))
diff --git a/src/mess/drivers/tutor.c b/src/mess/drivers/tutor.c
index 7596e537774..4a437c9f950 100644
--- a/src/mess/drivers/tutor.c
+++ b/src/mess/drivers/tutor.c
@@ -196,7 +196,7 @@ public:
optional_device<cassette_image_device> m_cass;
optional_device<centronics_device> m_centronics;
optional_device<output_latch_device> m_cent_data_out;
- required_memory_bank m_bank1;
+ required_memory_bank m_bank1;
memory_region *m_cart_rom;
DECLARE_READ8_MEMBER(key_r);
@@ -223,9 +223,9 @@ void tutor_state::machine_start()
{
astring region_tag;
m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
-
+
m_tape_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tutor_state::tape_interrupt_handler),this));
-
+
m_bank1->configure_entry(0, memregion("maincpu")->base() + 0x8000);
m_bank1->set_entry(0);
diff --git a/src/mess/drivers/tvc.c b/src/mess/drivers/tvc.c
index 28ec8948a2e..c588d8b084e 100644
--- a/src/mess/drivers/tvc.c
+++ b/src/mess/drivers/tvc.c
@@ -47,7 +47,7 @@ public:
m_palette(*this, "palette"),
m_keyboard(*this, "LINE")
{ }
-
+
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
required_device<tvc_sound_device> m_sound;
@@ -65,7 +65,7 @@ public:
void machine_start();
void machine_reset();
-
+
void set_mem_page(UINT8 data);
DECLARE_WRITE8_MEMBER(bank_w);
DECLARE_WRITE8_MEMBER(vram_bank_w);
@@ -80,17 +80,17 @@ public:
DECLARE_READ8_MEMBER(_5b_r);
DECLARE_WRITE_LINE_MEMBER(int_ff_set);
DECLARE_WRITE_LINE_MEMBER(centronics_ack);
-
+
// expansions
DECLARE_WRITE8_MEMBER(expansion_w);
DECLARE_READ8_MEMBER(expansion_r);
DECLARE_READ8_MEMBER(exp_id_r);
DECLARE_WRITE8_MEMBER(expint_ack_w);
-
+
DECLARE_QUICKLOAD_LOAD_MEMBER( tvc64);
-
+
MC6845_UPDATE_ROW(crtc_update_row);
-
+
UINT8 m_video_mode;
UINT8 m_keyline;
UINT8 m_active_slot;
diff --git a/src/mess/drivers/uzebox.c b/src/mess/drivers/uzebox.c
index 2ab52e6944f..a5aea162589 100644
--- a/src/mess/drivers/uzebox.c
+++ b/src/mess/drivers/uzebox.c
@@ -273,7 +273,7 @@ UINT32 uzebox_state::screen_update_uzebox(screen_device &screen, bitmap_rgb32 &b
DEVICE_IMAGE_LOAD_MEMBER(uzebox_state, uzebox_cart)
{
UINT32 size = m_cart->common_get_size("rom");
-
+
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
if (image.software_entry() == NULL)
diff --git a/src/mess/drivers/vboy.c b/src/mess/drivers/vboy.c
index 7dcfefd1f23..00db7737ac3 100644
--- a/src/mess/drivers/vboy.c
+++ b/src/mess/drivers/vboy.c
@@ -1112,7 +1112,7 @@ static ADDRESS_MAP_START( vboy_mem, AS_PROGRAM, 32, vboy_state )
//AM_RANGE( 0x04000000, 0x04ffffff ) // Expansion area
AM_RANGE( 0x05000000, 0x0500ffff ) AM_MIRROR(0x0ff0000) AM_RAM AM_SHARE("wram")// Main RAM - 64K mask 0xffff
AM_RANGE( 0x06000000, 0x06003fff ) AM_DEVREADWRITE("cartslot", vboy_cart_slot_device, read_eeprom, write_eeprom) // Cart RAM - 8K NVRAM
-// AM_RANGE( 0x07000000, 0x071fffff ) AM_MIRROR(0x0e00000) AM_DEVREAD("cartslot", vboy_cart_slot_device, read_cart) /* ROM */
+// AM_RANGE( 0x07000000, 0x071fffff ) AM_MIRROR(0x0e00000) AM_DEVREAD("cartslot", vboy_cart_slot_device, read_cart) /* ROM */
ADDRESS_MAP_END
static ADDRESS_MAP_START( vboy_io, AS_IO, 32, vboy_state )
@@ -1141,7 +1141,7 @@ static ADDRESS_MAP_START( vboy_io, AS_IO, 32, vboy_state )
// AM_RANGE( 0x04000000, 0x04ffffff ) // Expansion area
AM_RANGE( 0x05000000, 0x0500ffff ) AM_MIRROR(0x0ff0000) AM_RAM AM_SHARE("wram") // Main RAM - 64K mask 0xffff
AM_RANGE( 0x06000000, 0x06003fff ) AM_NOP // Cart RAM - 8K NVRAM ?
-// AM_RANGE( 0x07000000, 0x071fffff ) AM_MIRROR(0x0e00000) AM_DEVREAD("cartslot", vboy_cart_slot_device, read_cart) /* ROM */
+// AM_RANGE( 0x07000000, 0x071fffff ) AM_MIRROR(0x0e00000) AM_DEVREAD("cartslot", vboy_cart_slot_device, read_cart) /* ROM */
ADDRESS_MAP_END
/* Input ports */
diff --git a/src/mess/drivers/vc4000.c b/src/mess/drivers/vc4000.c
index 085fb44ec62..727350c0456 100644
--- a/src/mess/drivers/vc4000.c
+++ b/src/mess/drivers/vc4000.c
@@ -378,12 +378,12 @@ void vc4000_state::machine_start()
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1800, 0x1bff, read8_delegate(FUNC(vc4000_cart_slot_device::read_ram),(vc4000_cart_slot_device*)m_cart), write8_delegate(FUNC(vc4000_cart_slot_device::write_ram),(vc4000_cart_slot_device*)m_cart));
break;
// undumped Radofin Hobby Module
-// case VC4000_HOBBY:
-// m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x07ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart));
-// m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0800, 0x0fff, read8_delegate(FUNC(vc4000_cart_slot_device::read_ram),(vc4000_cart_slot_device*)m_cart), write8_delegate(FUNC(vc4000_cart_slot_device::write_ram),(vc4000_cart_slot_device*)m_cart));
-// break;
+// case VC4000_HOBBY:
+// m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x07ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart));
+// m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0800, 0x0fff, read8_delegate(FUNC(vc4000_cart_slot_device::read_ram),(vc4000_cart_slot_device*)m_cart), write8_delegate(FUNC(vc4000_cart_slot_device::write_ram),(vc4000_cart_slot_device*)m_cart));
+// break;
}
-
+
m_cart->save_ram();
}
}
@@ -398,7 +398,7 @@ QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000)
dynamic_buffer quick_data;
int read_;
int result = IMAGE_INIT_FAIL;
-
+
quick_length = image.length();
quick_data.resize(quick_length);
read_ = image.fread( quick_data, quick_length);
@@ -420,7 +420,7 @@ QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000)
{
int quick_addr = quick_data[1] * 256 + quick_data[2];
exec_addr = quick_data[3] * 256 + quick_data[4];
-
+
if (quick_length < 0x5)
{
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too short");
@@ -436,13 +436,13 @@ QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000)
{
space.write_byte(0x08be, quick_data[3]);
space.write_byte(0x08bf, quick_data[4]);
-
+
for (i = 5; i < quick_length; i++)
space.write_byte(i - 5 + quick_addr, quick_data[i]);
-
+
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X",quick_length-5,quick_addr,quick_addr+quick_length-5,exec_addr);
-
+
// Start the quickload
m_maincpu->set_state_int(S2650_PC, exec_addr);
result = IMAGE_INIT_PASS;
@@ -460,7 +460,7 @@ QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000)
else
{
exec_addr = quick_data[1] * 256 + quick_data[2];
-
+
if (exec_addr >= quick_length)
{
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Exec address beyond end of file");
@@ -482,14 +482,14 @@ QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000)
{
space.write_byte(0x08be, quick_data[1]);
space.write_byte(0x08bf, quick_data[2]);
-
+
// load to 08C0-15FF (standard ram + extra)
int read_ = 0x1600;
if (quick_length < 0x1600)
read_ = quick_length;
for (i = 0x8c0; i < read_; i++)
space.write_byte(i, quick_data[i]);
-
+
// load to 1F50-1FAF (PVI regs)
read_ = 0x1FB0;
if (quick_length < 0x1FB0)
@@ -497,10 +497,10 @@ QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000)
if (quick_length > 0x1FC0)
for (i = 0x1F50; i < read_; i++)
vc4000_video_w(space, i-0x1f00, quick_data[i]);
-
+
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : exec=%04X",quick_length,exec_addr);
-
+
// Start the quickload
m_maincpu->set_state_int(S2650_PC, exec_addr);
result = IMAGE_INIT_PASS;
diff --git a/src/mess/drivers/vii.c b/src/mess/drivers/vii.c
index 572a94ab113..de9a14b866c 100644
--- a/src/mess/drivers/vii.c
+++ b/src/mess/drivers/vii.c
@@ -961,13 +961,13 @@ INPUT_PORTS_END
void vii_state::test_centered(UINT8 *ROM)
{
if (ROM[0x3cd808] == 0x99 &&
- ROM[0x3cd809] == 0x99 &&
- ROM[0x3cd80a] == 0x83 &&
- ROM[0x3cd80b] == 0x5e &&
- ROM[0x3cd80c] == 0x52 &&
- ROM[0x3cd80d] == 0x6b &&
- ROM[0x3cd80e] == 0x78 &&
- ROM[0x3cd80f] == 0x7f)
+ ROM[0x3cd809] == 0x99 &&
+ ROM[0x3cd80a] == 0x83 &&
+ ROM[0x3cd80b] == 0x5e &&
+ ROM[0x3cd80c] == 0x52 &&
+ ROM[0x3cd80d] == 0x6b &&
+ ROM[0x3cd80e] == 0x78 &&
+ ROM[0x3cd80f] == 0x7f)
{
m_centered_coordinates = 0;
}
@@ -982,10 +982,10 @@ DEVICE_IMAGE_LOAD_MEMBER( vii_state, vii_cart )
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
test_centered(m_cart->get_rom_base());
return IMAGE_INIT_PASS;
@@ -994,10 +994,10 @@ DEVICE_IMAGE_LOAD_MEMBER( vii_state, vii_cart )
DEVICE_IMAGE_LOAD_MEMBER( vii_state, vsmile_cart )
{
UINT32 size = m_cart->common_get_size("rom");
-
+
m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
-
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return IMAGE_INIT_PASS;
}
@@ -1031,11 +1031,11 @@ void vii_state::machine_start()
m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
memcpy(m_p_cart, m_cart_rom->base(), 0x400000 * 2);
}
- else if (m_spg243_mode == SPG243_VII) // Vii bios is banked
+ else if (m_spg243_mode == SPG243_VII) // Vii bios is banked
memcpy(m_p_cart, m_bios_rom->base(), 0x400000 * 2);
else
memcpy(m_p_cart, memregion("maincpu")->base(), 0x400000 * 2);
-
+
m_video_regs[0x36] = 0xffff;
m_video_regs[0x37] = 0xffff;
diff --git a/src/mess/drivers/x07.c b/src/mess/drivers/x07.c
index 76e8fd57c4e..5ebc3ffd8ff 100644
--- a/src/mess/drivers/x07.c
+++ b/src/mess/drivers/x07.c
@@ -1038,12 +1038,12 @@ inline void x07_state::draw_udk()
DEVICE_IMAGE_LOAD_MEMBER( x07_state, x07_card )
{
UINT32 size = m_card->common_get_size("rom");
-
+
// check card type
if (image.software_entry() != NULL)
{
const char *card_type = image.get_feature("card_type");
-
+
if (strcmp(card_type, "xp140"))
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported card type");
@@ -1052,7 +1052,7 @@ DEVICE_IMAGE_LOAD_MEMBER( x07_state, x07_card )
}
m_card->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_BIG);
- m_card->common_load_rom(m_card->get_rom_base(), size, "rom");
+ m_card->common_load_rom(m_card->get_rom_base(), size, "rom");
m_card->ram_alloc(0x1000);
diff --git a/src/mess/includes/apple2.h b/src/mess/includes/apple2.h
index d294025ed9f..02dd0b9296b 100644
--- a/src/mess/includes/apple2.h
+++ b/src/mess/includes/apple2.h
@@ -26,7 +26,7 @@
#define IIC_ACIA1_TAG "acia1"
#define IIC_ACIA2_TAG "acia2"
-#define IICP_IWM_TAG "iwm"
+#define IICP_IWM_TAG "iwm"
#define LASER128_UDC_TAG "l128udc"
@@ -83,7 +83,7 @@ enum machine_type_t
APPLE_IIC, // Apple IIc
APPLE_IICPLUS, // Apple IIc+
TK2000, // Microdigital TK2000
- TK3000, // Microdigital TK3000
+ TK3000, // Microdigital TK3000
LASER128, // Laser 128/128EX/128EX2
SPACE84, // "Space 84" with flipped text mode
LABA2P // lab equipment (?) II Plus with flipped text mode
diff --git a/src/mess/includes/atom.h b/src/mess/includes/atom.h
index e80a9353336..93bc57485b9 100644
--- a/src/mess/includes/atom.h
+++ b/src/mess/includes/atom.h
@@ -108,9 +108,9 @@ public:
/* devices */
int m_previous_i8271_int_state;
TIMER_DEVICE_CALLBACK_MEMBER(cassette_output_tick);
-
+
int load_cart(device_image_interface &image, generic_slot_device *slot);
- DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load) { return load_cart(image, m_cart); }
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load) { return load_cart(image, m_cart); }
DECLARE_QUICKLOAD_LOAD_MEMBER(atom_atm);
};
@@ -121,7 +121,7 @@ public:
: atom_state(mconfig, type, tag),
m_e0(*this, "rom_e0"),
m_e1(*this, "rom_e1")
- {
+ {
}
virtual void machine_start();
@@ -132,10 +132,10 @@ public:
DECLARE_READ8_MEMBER(dos_r);
DECLARE_DRIVER_INIT(atomeb);
-
+
/* eprom state */
int m_eprom;
-
+
generic_slot_device *m_ext[16];
required_device<generic_slot_device> m_e0;
required_device<generic_slot_device> m_e1;
diff --git a/src/mess/includes/concept.h b/src/mess/includes/concept.h
index c1e280ea015..f5deecc63f8 100644
--- a/src/mess/includes/concept.h
+++ b/src/mess/includes/concept.h
@@ -21,7 +21,7 @@
#define ACIA_0_TAG "acia0"
#define ACIA_1_TAG "acia1"
#define KBD_ACIA_TAG "kbacia"
-#define SPEAKER_TAG "spkr"
+#define SPEAKER_TAG "spkr"
#define A2BUS_TAG "a2bus"
class concept_state : public driver_device
diff --git a/src/mess/includes/electron.h b/src/mess/includes/electron.h
index c98c85d2bcb..2de2f6da6a1 100644
--- a/src/mess/includes/electron.h
+++ b/src/mess/includes/electron.h
@@ -70,9 +70,9 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_cassette(*this, "cassette"),
- m_beeper(*this, "beeper"),
+ m_beeper(*this, "beeper"),
m_cart(*this, "cartslot"),
- m_keybd(*this, "LINE")
+ m_keybd(*this, "LINE")
{ }
ULA m_ula;
diff --git a/src/mess/includes/intv.h b/src/mess/includes/intv.h
index 949df7fb86d..f6161894f7f 100644
--- a/src/mess/includes/intv.h
+++ b/src/mess/includes/intv.h
@@ -44,7 +44,7 @@ public:
m_io_options(*this, "OPTIONS"),
m_io_test(*this, "TEST"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette")
{ }
required_device<cpu_device> m_maincpu;
@@ -66,7 +66,7 @@ public:
DECLARE_READ8_MEMBER(intv_right_control_r);
DECLARE_READ8_MEMBER(intv_left_control_r);
-
+
UINT8 m_bus_copy_mode;
UINT8 m_backtab_row;
UINT16 m_ram16[0x160];
diff --git a/src/mess/includes/radio86.h b/src/mess/includes/radio86.h
index d2f5dd00e1e..584d69bc965 100644
--- a/src/mess/includes/radio86.h
+++ b/src/mess/includes/radio86.h
@@ -88,7 +88,7 @@ public:
protected:
required_device<cassette_image_device> m_cassette;
- optional_device<generic_slot_device> m_cart; // for ROMDisk - only Radio86K & Orion?
+ optional_device<generic_slot_device> m_cart; // for ROMDisk - only Radio86K & Orion?
optional_device<i8257_device> m_dma8257;
required_device<i8255_device> m_ppi8255_1;
optional_device<i8255_device> m_ppi8255_2;
diff --git a/src/mess/includes/svi318.h b/src/mess/includes/svi318.h
index f13d31e7360..682fc400ed1 100644
--- a/src/mess/includes/svi318.h
+++ b/src/mess/includes/svi318.h
@@ -52,7 +52,7 @@ public:
m_bank3(*this, "bank3"),
m_bank4(*this, "bank4")
{ }
-
+
// FDC
UINT8 m_driveselect;
int m_drq;
@@ -91,7 +91,7 @@ public:
MC6845_UPDATE_ROW(crtc_update_row);
memory_region *m_cart_rom;
memory_region *m_bios_rom;
-
+
protected:
required_device<z80_device> m_maincpu;
required_device<cassette_image_device> m_cassette;
@@ -111,30 +111,30 @@ protected:
optional_device<palette_device> m_palette;
private:
-
+
void set_banks();
void postload();
-
+
// memory banking
UINT8 m_bank_switch;
UINT8 m_bank_low;
UINT8 m_bank_high;
-
+
UINT8 m_bank_low_read_only;
UINT8 m_bank_high1_read_only;
UINT8 m_bank_high2_read_only;
-
+
UINT8 *m_empty_bank;
UINT8 *m_bank_low_ptr;
UINT8 *m_bank_high1_ptr;
UINT8 *m_bank_high2_ptr;
-
+
// keyboard
UINT8 m_keyboard_row;
-
+
// centronics
int m_centronics_busy;
-
+
// SVI-806 80 column card
UINT8 m_svi806_present;
UINT8 m_svi806_ram_enabled;
diff --git a/src/mess/machine/aim65.c b/src/mess/machine/aim65.c
index 92a30998ff7..a4b4d53d1ce 100644
--- a/src/mess/machine/aim65.c
+++ b/src/mess/machine/aim65.c
@@ -149,7 +149,7 @@ void aim65_state::machine_start()
space.install_read_handler(0xc000, 0xcfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_z25));
if (m_z26->exists())
space.install_read_handler(0xb000, 0xbfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_z26));
-
+
// Init RAM
space.install_ram(0x0000, ram->size() - 1, ram->pointer());
diff --git a/src/mess/machine/amigakbd.c b/src/mess/machine/amigakbd.c
index ec88371482b..55f57cdcdfb 100644
--- a/src/mess/machine/amigakbd.c
+++ b/src/mess/machine/amigakbd.c
@@ -8,20 +8,20 @@
We currently emulate the Amiga 500 keyboard controller, which was
also used in later Amiga 2000 keyboards.
- TODO: - Natural keyboard mode doesn't work with shifted characters,
- they get sent in the wrong order (core bug?)
- - Move 6500/1 to its own CPU core so that it can be shared with
- other systems
- - Add support for more keyboard controllers (pending on them
- getting dumped)
+ TODO: - Natural keyboard mode doesn't work with shifted characters,
+ they get sent in the wrong order (core bug?)
+ - Move 6500/1 to its own CPU core so that it can be shared with
+ other systems
+ - Add support for more keyboard controllers (pending on them
+ getting dumped)
- Amiga 1000 keyboard part numbers (manufactured by Mitsumi):
+ Amiga 1000 keyboard part numbers (manufactured by Mitsumi):
- - 327063-01 R56-2144 English
- - 327063-02 British
- - 327063-03 R56-2153 German
- - 327063-04 R56-2152 French
- - 327063-05 R56-2154 Italian
+ - 327063-01 R56-2144 English
+ - 327063-02 British
+ - 327063-03 R56-2153 German
+ - 327063-04 R56-2152 French
+ - 327063-05 R56-2154 Italian
***************************************************************************/
@@ -335,8 +335,8 @@ void amigakbd_device::device_reset()
m_kclk = 1;
m_port_c = 0xff;
m_port_d = 0xff;
- m_latch = 0xffff; // not initialized by hardware
- m_counter = 0xffff; // not initialized by hardware
+ m_latch = 0xffff; // not initialized by hardware
+ m_counter = 0xffff; // not initialized by hardware
m_control = 0x00;
m_timer->adjust(attotime::zero, 0, attotime::from_hz(XTAL_3MHz / 2));
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c
index 0d9747a829c..5954bb90682 100644
--- a/src/mess/machine/amstrad.c
+++ b/src/mess/machine/amstrad.c
@@ -3031,7 +3031,7 @@ MACHINE_START_MEMBER(amstrad_state,plus)
m_asic.ram = m_region_user1->base(); // 16kB RAM for ASIC, memory-mapped registers.
m_system_type = SYSTEM_PLUS;
m_centronics->write_data7(0);
-
+
astring region_tag;
m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
}
@@ -3073,7 +3073,7 @@ MACHINE_START_MEMBER(amstrad_state,gx4000)
{
m_asic.ram = m_region_user1->base(); // 16kB RAM for ASIC, memory-mapped registers.
m_system_type = SYSTEM_GX4000;
-
+
astring region_tag;
m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
}
@@ -3187,7 +3187,7 @@ DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge)
// check for .CPR header
if (image.software_entry() == NULL)
{
- image.fread(header, 12);
+ image.fread(header, 12);
if (strncmp((char *)header, "RIFF", 4) != 0)
{
// not a CPR file, so rewind the image at start
@@ -3219,7 +3219,7 @@ DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge)
return IMAGE_INIT_FAIL;
}
else
- image.fread(m_cart->get_rom_base(), size);
+ image.fread(m_cart->get_rom_base(), size);
}
else
{
@@ -3229,7 +3229,7 @@ DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge)
// Chunks labeled 'cb00' represent Cartridge block 0, and is loaded to &0000-&3fff
// 'cb01' represent Cartridge block 1, and is loaded to &4000-&7fff
// ... and so on.
-
+
UINT32 offset = 0;
UINT8 *crt = m_cart->get_rom_base();
dynamic_buffer temp_copy;
@@ -3241,7 +3241,7 @@ DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge)
char chunklen[4]; // chunk length (always little-endian)
int chunksize; // chunk length, calcaulated from the above
int ramblock; // 16k RAM block chunk is to be loaded into
- unsigned int bytes_to_read; // total bytes to read, as mame_feof doesn't react to EOF without trying to go past it.
+ unsigned int bytes_to_read; // total bytes to read, as mame_feof doesn't react to EOF without trying to go past it.
// Is RIFF format (*.cpr)
if (strncmp((char*)(header + 8), "AMS!", 4) != 0)
diff --git a/src/mess/machine/apple2.c b/src/mess/machine/apple2.c
index 09f59120dab..927e678ec7a 100644
--- a/src/mess/machine/apple2.c
+++ b/src/mess/machine/apple2.c
@@ -366,7 +366,7 @@ READ8_MEMBER(apple2_state::apple2_c080_r)
}
}
}
-
+
if ((m_machinetype == APPLE_IICPLUS) && (slot == 6))
{
offset &= 0xf;
@@ -377,7 +377,7 @@ READ8_MEMBER(apple2_state::apple2_c080_r)
{
offset &= 0xf;
UINT8 retval = m_exp_regs[offset];
-
+
if (offset == 3)
{
retval = m_exp_ram[m_exp_liveptr&m_exp_addrmask];
@@ -2287,7 +2287,7 @@ MACHINE_START_MEMBER(apple2_state,apple2c)
MACHINE_START_MEMBER(apple2_state,tk3000)
{
- m_machinetype = TK3000; // enhanced IIe clone with Z80 keyboard scanner subcpu
+ m_machinetype = TK3000; // enhanced IIe clone with Z80 keyboard scanner subcpu
apple2eplus_init_common((void *)NULL);
}
@@ -2335,7 +2335,7 @@ MACHINE_START_MEMBER(apple2_state,laser128)
apple2_init_common();
// 1 MB of expansion RAM in slot 5
- m_exp_ram = auto_alloc_array(machine(), UINT8, 1024*1024);
+ m_exp_ram = auto_alloc_array(machine(), UINT8, 1024*1024);
memset(m_exp_ram, 0xff, 1024*1024);
m_exp_bankhior = 0xf0;
diff --git a/src/mess/machine/apple3.c b/src/mess/machine/apple3.c
index 7ca8da875f9..e90f67b36df 100644
--- a/src/mess/machine/apple3.c
+++ b/src/mess/machine/apple3.c
@@ -1275,4 +1275,3 @@ WRITE_LINE_MEMBER(apple3_state::a2bus_nmi_w)
m_maincpu->set_input_line(INPUT_LINE_NMI, state);
}
}
-
diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c
index dcda1285da7..d1dfb92e980 100644
--- a/src/mess/machine/bbc.c
+++ b/src/mess/machine/bbc.c
@@ -1941,16 +1941,16 @@ WRITE8_MEMBER(bbc_state::bbc_disc_w)
int bbc_state::bbc_load_cart(device_image_interface &image, generic_slot_device *slot)
{
UINT32 size = slot->common_get_size("rom");
-
+
if (size != 0x2000 && size != 0x4000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
slot->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
slot->common_load_rom(slot->get_rom_base(), size, "rom");
-
+
return IMAGE_INIT_PASS;
}
@@ -1969,7 +1969,7 @@ int bbc_state::bbcm_load_cart(device_image_interface &image, generic_slot_device
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
slot->rom_alloc(filesize, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
image.fread(slot->get_rom_base(), filesize);
return IMAGE_INIT_PASS;
@@ -1978,18 +1978,18 @@ int bbc_state::bbcm_load_cart(device_image_interface &image, generic_slot_device
{
UINT32 size_lo = image.get_software_region_length("lorom");
UINT32 size_hi = image.get_software_region_length("uprom");
-
+
if (size_lo + size_hi != 0x8000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
slot->rom_alloc(size_lo + size_hi, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
memcpy(slot->get_rom_base() + 0, image.get_software_region("uprom"), size_hi);
memcpy(slot->get_rom_base() + size_hi, image.get_software_region("lorom"), size_lo);
}
-
+
return IMAGE_INIT_PASS;
}
@@ -2052,7 +2052,7 @@ void bbc_state::bbc_setup_banks(memory_bank *membank, int banks, UINT32 shift, U
eprom[3] = tmp_reg->base() + shift;
else
eprom[3] = m_region_opt->base() + 0xc000 + shift;
-
+
membank->configure_entries(0, 1, eprom[0], size);
membank->configure_entries(1, 1, eprom[1], size);
membank->configure_entries(2, 1, eprom[2], size);
@@ -2078,12 +2078,12 @@ void bbc_state::bbcm_setup_banks(memory_bank *membank, int banks, UINT32 shift,
eprom[1] = tmp_reg->base() + shift;
else
eprom[1] = m_region_opt->base() + 0x8000 + shift;
-
+
membank->configure_entries(0, 1, eprom[0], size);
membank->configure_entries(1, 1, eprom[0] + 0x4000, size);
membank->configure_entries(2, 1, eprom[1], size);
membank->configure_entries(3, 1, eprom[1] + 0x4000, size);
-
+
if (banks > 4)
{
for (int i = 0; i < banks - 4; i++)
@@ -2127,7 +2127,7 @@ MACHINE_START_MEMBER(bbc_state, bbcb)
m_previous_wd177x_int_state=1;
bbc_setup_banks(m_bank4, 16, 0, 0x4000);
if (m_region_dfs)
- m_bank4->configure_entries(16, 8, m_region_dfs->base(), 0x4000); // additional bank for paged ram
+ m_bank4->configure_entries(16, 8, m_region_dfs->base(), 0x4000); // additional bank for paged ram
}
MACHINE_RESET_MEMBER(bbc_state, bbcb)
@@ -2155,7 +2155,7 @@ MACHINE_START_MEMBER(bbc_state, bbcbp)
m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(bbc_state::bbcbp_direct_handler), this));
bbc_setup_banks(m_bank4, 16, 0, 0x3000);
- m_bank4->configure_entries(16, 1, m_region_maincpu->base() + 0x8000, 0x3000); // additional bank for paged ram
+ m_bank4->configure_entries(16, 1, m_region_maincpu->base() + 0x8000, 0x3000); // additional bank for paged ram
bbc_setup_banks(m_bank6, 16, 0x3000, 0x1000);
}
@@ -2180,7 +2180,7 @@ MACHINE_START_MEMBER(bbc_state, bbcm)
m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(bbc_state::bbcm_direct_handler), this));
bbcm_setup_banks(m_bank4, 16, 0, 0x1000);
- m_bank4->configure_entries(16, 1, m_region_maincpu->base() + 0x8000, 0x1000); // additional bank for paged ram
+ m_bank4->configure_entries(16, 1, m_region_maincpu->base() + 0x8000, 0x1000); // additional bank for paged ram
bbcm_setup_banks(m_bank5, 16, 0x1000, 0x3000);
/* Set ROM/IO bank to point to rom */
diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c
index 46575f9256f..e071d92452c 100644
--- a/src/mess/machine/concept.c
+++ b/src/mess/machine/concept.c
@@ -154,7 +154,7 @@ WRITE8_MEMBER(concept_state::via_out_b)
WRITE_LINE_MEMBER(concept_state::via_out_cb2)
{
-// LOG(("via_out_cb2: Sound control written: data=0x%2.2x\n", state));
+// LOG(("via_out_cb2: Sound control written: data=0x%2.2x\n", state));
m_speaker->level_w(state);
}
@@ -210,7 +210,7 @@ READ16_MEMBER(concept_state::concept_io_r)
if (card)
{
- return card->read_cnxx(space, offset & 0xff);
+ return card->read_cnxx(space, offset & 0xff);
}
}
break;
@@ -245,7 +245,7 @@ READ16_MEMBER(concept_state::concept_io_r)
case 3:
/* NVIA versatile system interface */
-// LOG(("concept_io_r: VIA read at address 0x03%4.4x\n", offset << 1));
+// LOG(("concept_io_r: VIA read at address 0x03%4.4x\n", offset << 1));
{
via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
return via_0->read(space, offset & 0xf);
@@ -301,7 +301,7 @@ WRITE16_MEMBER(concept_state::concept_io_w)
if (card)
{
- return card->write_c0nx(space, offset & 0x0f, data);
+ return card->write_c0nx(space, offset & 0x0f, data);
}
}
break;
diff --git a/src/mess/machine/electron.c b/src/mess/machine/electron.c
index bce85d595e2..ca6efe3b4d6 100644
--- a/src/mess/machine/electron.c
+++ b/src/mess/machine/electron.c
@@ -344,7 +344,7 @@ void electron_state::machine_reset()
}
void electron_state::machine_start()
-{
+{
UINT8 *lo_rom, *up_rom;
astring region_tag;
memory_region *cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
@@ -357,7 +357,7 @@ void electron_state::machine_start()
lo_rom = cart_rom->base() + 0x4000;
else
lo_rom = memregion("user1")->base();
-
+
membank("bank2")->configure_entries(0, 1, lo_rom, 0x4000);
membank("bank2")->configure_entries(1, 11, memregion("user1")->base() + 0x04000, 0x4000);
membank("bank2")->configure_entries(12, 1, up_rom, 0x4000);
@@ -389,13 +389,13 @@ DEVICE_IMAGE_LOAD_MEMBER( electron_state, electron_cart )
{
int upsize = image.get_software_region_length("uprom");
int losize = image.get_software_region_length("lorom");
-
+
if (upsize != 16384 && upsize != 0)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size for uprom");
return IMAGE_INIT_FAIL;
}
-
+
if (losize != 16384 && losize != 0)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size for lorom");
@@ -406,7 +406,7 @@ DEVICE_IMAGE_LOAD_MEMBER( electron_state, electron_cart )
if (upsize)
memcpy(m_cart->get_rom_base(), image.get_software_region("uprom"), upsize);
-
+
if (losize)
memcpy(m_cart->get_rom_base() + upsize, image.get_software_region("lorom"), losize);
diff --git a/src/mess/machine/gamecom.c b/src/mess/machine/gamecom.c
index 75d69b049f6..c95e15fc0f2 100644
--- a/src/mess/machine/gamecom.c
+++ b/src/mess/machine/gamecom.c
@@ -640,15 +640,15 @@ int gamecom_state::common_load(device_image_interface &image, generic_slot_devic
UINT32 load_offset = 0;
if (size != 0x008000 && size != 0x040000 && size != 0x080000
- && size != 0x100000 && size != 0x1c0000 && size != 0x200000)
+ && size != 0x100000 && size != 0x1c0000 && size != 0x200000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
if (size == 0x1c0000)
load_offset = 0x40000;
-
+
// in order to simplify banked access from the driver, we always allocate 0x200000,
slot->rom_alloc(0x200000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
// we load what we have
@@ -661,7 +661,7 @@ int gamecom_state::common_load(device_image_interface &image, generic_slot_devic
if (size < 0x080000) { memcpy(crt + 0x040000, crt, 0x040000); } /* ->512KB */
if (size < 0x100000) { memcpy(crt + 0x080000, crt, 0x080000); } /* ->1MB */
if (size < 0x1c0000) { memcpy(crt + 0x100000, crt, 0x100000); } /* -> >=1.8MB */
-
+
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/machine/gamepock.c b/src/mess/machine/gamepock.c
index e2ed49920a9..8c43df24314 100644
--- a/src/mess/machine/gamepock.c
+++ b/src/mess/machine/gamepock.c
@@ -139,7 +139,7 @@ void gamepock_state::machine_reset()
if (m_cart->exists())
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000,0xbfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
-
+
}
UINT32 gamepock_state::screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mess/machine/intv.c b/src/mess/machine/intv.c
index f3c0bbc6d9d..52c250d030f 100644
--- a/src/mess/machine/intv.c
+++ b/src/mess/machine/intv.c
@@ -351,7 +351,7 @@ void intv_state::machine_start()
save_item(NAME(m_ram16));
save_item(NAME(m_sr1_int_pending));
save_item(NAME(m_ram8));
-
+
// intvkbd
if (m_is_keybd)
{
@@ -388,7 +388,7 @@ void intv_state::machine_start()
case INTV_VOICE:
m_cart->late_subslot_setup();
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0080, 0x0081, read16_delegate(FUNC(intv_cart_slot_device::read_speech),(intv_cart_slot_device*)m_cart), write16_delegate(FUNC(intv_cart_slot_device::write_speech),(intv_cart_slot_device*)m_cart));
-
+
// passthru for RAM-equipped carts
m_maincpu->space(AS_PROGRAM).install_write_handler(0x8800, 0x8fff, write16_delegate(FUNC(intv_cart_slot_device::write_88),(intv_cart_slot_device*)m_cart));
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd000, 0xd7ff, write16_delegate(FUNC(intv_cart_slot_device::write_d0),(intv_cart_slot_device*)m_cart));
@@ -402,10 +402,10 @@ void intv_state::machine_start()
m_maincpu->space(AS_PROGRAM).install_write_handler(0x7000, 0x7fff, write16_delegate(FUNC(intv_cart_slot_device::write_rom70),(intv_cart_slot_device*)m_cart));
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000, 0xefff, write16_delegate(FUNC(intv_cart_slot_device::write_rome0),(intv_cart_slot_device*)m_cart));
m_maincpu->space(AS_PROGRAM).install_write_handler(0xf000, 0xffff, write16_delegate(FUNC(intv_cart_slot_device::write_romf0),(intv_cart_slot_device*)m_cart));
-
+
// passthru for Intellivoice expansion
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0080, 0x0081, read16_delegate(FUNC(intv_cart_slot_device::read_speech),(intv_cart_slot_device*)m_cart), write16_delegate(FUNC(intv_cart_slot_device::write_speech),(intv_cart_slot_device*)m_cart));
-
+
// passthru for RAM-equipped carts
m_maincpu->space(AS_PROGRAM).install_write_handler(0x8800, 0x8fff, write16_delegate(FUNC(intv_cart_slot_device::write_88),(intv_cart_slot_device*)m_cart));
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd000, 0xd7ff, write16_delegate(FUNC(intv_cart_slot_device::write_d0),(intv_cart_slot_device*)m_cart));
diff --git a/src/mess/machine/lynx.c b/src/mess/machine/lynx.c
index 061cf441ed3..f2864ef3ed6 100644
--- a/src/mess/machine/lynx.c
+++ b/src/mess/machine/lynx.c
@@ -1019,7 +1019,7 @@ READ8_MEMBER(lynx_state::suzy_read)
case RCART:
if (m_cart->exists())
value = m_cart->read_rom(space, (m_suzy.high * m_granularity) + m_suzy.low);
- else
+ else
value = 0;
m_suzy.low = (m_suzy.low + 1) & (m_granularity - 1);
break;
@@ -2078,29 +2078,29 @@ DEVICE_IMAGE_LOAD_MEMBER( lynx_state, lynx_cart )
// 22 chars manufacturer
UINT8 header[0x40];
image.fread(header, 0x40);
-
+
// Check the image
if (lynx_verify_cart((char*)header, LYNX_CART) == IMAGE_VERIFY_FAIL)
return IMAGE_INIT_FAIL;
-
+
/* 2008-10 FP: According to Handy source these should be page_size_bank0. Are we using
it correctly in MESS? Moreover, the next two values should be page_size_bank1. We should
implement this as well */
gran = header[4] | (header[5] << 8);
-
+
logerror ("%s %dkb cartridge with %dbyte granularity from %s\n", header + 10, size / 1024, gran, header + 42);
size -= 0x40;
}
- }
+ }
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
// set-up granularity
if (image.software_entry() == NULL)
{
const char *filetype = image.filetype();
- if (!core_stricmp(filetype, "lnx")) // from header
+ if (!core_stricmp(filetype, "lnx")) // from header
m_granularity = gran;
else if (!core_stricmp(filetype, "lyx"))
{
@@ -2122,7 +2122,7 @@ DEVICE_IMAGE_LOAD_MEMBER( lynx_state, lynx_cart )
else
m_granularity = 0x400; // Homebrew roms not using all 256 banks (T-Tris) (none currently in softlist)
}
-
+
// set-up rotation from softlist
if (image.software_entry() != NULL)
{
@@ -2140,4 +2140,3 @@ DEVICE_IMAGE_LOAD_MEMBER( lynx_state, lynx_cart )
return IMAGE_INIT_PASS;
}
-
diff --git a/src/mess/machine/nc.c b/src/mess/machine/nc.c
index 3cbbb5b7835..25246fbac18 100644
--- a/src/mess/machine/nc.c
+++ b/src/mess/machine/nc.c
@@ -49,7 +49,7 @@ DEVICE_IMAGE_LOAD_MEMBER( nc_state, nc_pcmcia_card )
UINT32 size = m_card->common_get_size("rom");
m_card->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_card->common_load_rom(m_card->get_rom_base(), size, "rom");
+ m_card->common_load_rom(m_card->get_rom_base(), size, "rom");
set_card_present_state(1);
m_membank_card_ram_mask = card_calculate_mask(size);
@@ -64,14 +64,14 @@ DEVICE_IMAGE_UNLOAD_MEMBER( nc_state, nc_pcmcia_card )
// if there is no data to write, quit
if (!m_card_size)
return;
-
+
logerror("attempting card save\n");
-
+
// write data
image.fwrite(m_card_ram, m_card_size);
-
+
logerror("write succeeded!\r\n");
-
+
// set card not present state
set_card_present_state(0);
m_card_size = 0;
@@ -83,4 +83,3 @@ DRIVER_INIT_MEMBER( nc_state, nc )
set_card_present_state(0);
m_card_size = 0;
}
-
diff --git a/src/mess/machine/nes.c b/src/mess/machine/nes.c
index fbe2bea6bdd..14ca4c6aabe 100644
--- a/src/mess/machine/nes.c
+++ b/src/mess/machine/nes.c
@@ -97,7 +97,7 @@ void nes_state::setup_ioports()
sprintf(str, "FT_COL%i", i);
m_io_ftrainer[i] = ioport(str);
}
-
+
m_io_ctrlsel = ioport("CTRLSEL");
m_io_exp = ioport("EXP");
m_io_paddle = ioport("PADDLE");
diff --git a/src/mess/machine/primo.c b/src/mess/machine/primo.c
index 1a6035dc4f5..51d41e42fdb 100644
--- a/src/mess/machine/primo.c
+++ b/src/mess/machine/primo.c
@@ -244,7 +244,7 @@ void primo_state::machine_start()
{
astring region_tag;
m_cart1_rom = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG));
- m_cart2_rom = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG));
+ m_cart2_rom = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG));
}
void primo_state::machine_reset()
diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c
index fb284345665..3a16ff819a1 100644
--- a/src/mess/machine/svi318.c
+++ b/src/mess/machine/svi318.c
@@ -60,7 +60,7 @@ DEVICE_IMAGE_LOAD_MEMBER( svi318_state, svi318_cart )
}
m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
if (image.software_entry() == NULL && !cart_verify(m_cart->get_rom_base()))
return IMAGE_INIT_FAIL;
@@ -407,10 +407,10 @@ DRIVER_INIT_MEMBER(svi318_state, svi318)
/* memory */
m_empty_bank = auto_alloc_array(machine(), UINT8, 0x8000);
memset(m_empty_bank, 0xff, 0x8000);
-
+
m_bank_low_ptr = m_empty_bank;
m_bank_high1_ptr = m_empty_bank;
- m_bank_high2_ptr = m_empty_bank;
+ m_bank_high2_ptr = m_empty_bank;
}
DRIVER_INIT_MEMBER(svi318_state, svi328_806)
@@ -434,9 +434,9 @@ void svi318_state::machine_start()
save_item(NAME(m_svi806_ram));
memset(m_svi806_ram, 0x00, 0x800);
memset(m_svi806_ram + 0x800, 0xff, 0x800);
-
+
m_svi806_gfx = memregion("gfx1")->base();
-
+
// Set SVI-806 80 column card palette
m_palette->set_pen_color(TMS9928A_PALETTE_SIZE, 0, 0, 0); /* Monochrome black */
m_palette->set_pen_color(TMS9928A_PALETTE_SIZE+1, 0, 224, 0); /* Monochrome green */
@@ -459,7 +459,7 @@ void svi318_state::machine_start()
save_item(NAME(m_svi806_present));
save_item(NAME(m_svi806_ram_enabled));
-
+
machine().save().register_postload(save_prepost_delegate(FUNC(svi318_state::postload), this));
}
@@ -485,7 +485,7 @@ static void svi318_load_proc(device_image_interface &image)
}
void svi318_state::machine_reset()
-{
+{
m_keyboard_row = 0;
m_centronics_busy = 0;
m_svi806_present = 0;
@@ -587,7 +587,7 @@ void svi318_state::set_banks()
}
m_bank_high1_ptr = m_empty_bank;
- m_bank_high1_read_only = 1;
+ m_bank_high1_read_only = 1;
m_bank_high2_ptr = m_empty_bank;
m_bank_high2_read_only = 1;
diff --git a/src/mess/machine/thomson.c b/src/mess/machine/thomson.c
index 72a81bb30f1..7b28e642a8e 100644
--- a/src/mess/machine/thomson.c
+++ b/src/mess/machine/thomson.c
@@ -1841,14 +1841,14 @@ void thomson_state::to9_set_video_mode( UINT8 data, int style )
thom_set_video_mode( THOM_VMODE_TO9 );
break;
- // undocumented, but tested on a real TO8D
- case 0x20: thom_set_video_mode( THOM_VMODE_MO5_ALT ); break;
+ // undocumented, but tested on a real TO8D
+ case 0x20: thom_set_video_mode( THOM_VMODE_MO5_ALT ); break;
case 0x21: thom_set_video_mode( THOM_VMODE_BITMAP4 ); break;
case 0x41: thom_set_video_mode( THOM_VMODE_BITMAP4_ALT ); break;
- // also undocumented but tested
+ // also undocumented but tested
case 0x59: thom_set_video_mode( THOM_VMODE_BITMAP4_ALT_HALF ); break;
case 0x2a:
@@ -1866,7 +1866,7 @@ void thomson_state::to9_set_video_mode( UINT8 data, int style )
case 0x26: thom_set_video_mode( THOM_VMODE_OVERLAY ); break;
- // undocumented 160x200 variant of overlay
+ // undocumented 160x200 variant of overlay
case 0x3e: thom_set_video_mode( THOM_VMODE_OVERLAY_HALF ); break;
case 0x3f: thom_set_video_mode( THOM_VMODE_OVERLAY3 ); break;
diff --git a/src/mess/machine/vtech2.c b/src/mess/machine/vtech2.c
index 9be4b6aac21..e13f23c43da 100644
--- a/src/mess/machine/vtech2.c
+++ b/src/mess/machine/vtech2.c
@@ -71,11 +71,11 @@ DRIVER_INIT_MEMBER(vtech2_state,laser)
m_laser_latch = -1;
m_mem = memregion("maincpu")->base();
-
+
// check ROM expansion
astring region_tag;
m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
-
+
for (i = 0; i < ARRAY_LENGTH(m_laser_bank); i++)
m_laser_bank[i] = -1;
}
@@ -88,7 +88,7 @@ void vtech2_state::laser_machine_init(int bank_mask, int video_mask)
m_laser_video_bank = video_mask;
m_videoram = m_mem + m_laser_video_bank * 0x04000;
logerror("laser_machine_init(): bank mask $%04X, video %d [$%05X]\n", m_laser_bank_mask, m_laser_video_bank, m_laser_video_bank * 0x04000);
-
+
for (int i = 0; i < ARRAY_LENGTH(m_laser_bank); i++)
laser_bank_select_w(m_maincpu->space(AS_PROGRAM), i, 0);
}
@@ -153,13 +153,13 @@ WRITE8_MEMBER(vtech2_state::laser_bank_select_w)
else
{
sprintf(bank, "bank%d", offset + 1);
- if (data >= 12 && m_cart_rom && (m_cart_rom->bytes() > (data % 12) * 0x4000)) // Expansion ROM banks
+ if (data >= 12 && m_cart_rom && (m_cart_rom->bytes() > (data % 12) * 0x4000)) // Expansion ROM banks
{
membank(bank)->set_base(m_cart_rom->base()+ (data % 12) * 0x4000);
m_maincpu->space(AS_PROGRAM).install_read_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mra_bank_hard[offset]);
m_maincpu->space(AS_PROGRAM).install_write_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mwa_bank_hard[offset]);
}
- else if (data < 12 && (m_laser_bank_mask & (1 << data))) // ROM/RAM banks
+ else if (data < 12 && (m_laser_bank_mask & (1 << data))) // ROM/RAM banks
{
// video RAM bank selected?
if (data == m_laser_video_bank)
@@ -175,7 +175,7 @@ WRITE8_MEMBER(vtech2_state::laser_bank_select_w)
m_maincpu->space(AS_PROGRAM).nop_readwrite(offset * 0x4000, offset * 0x4000 + 0x3fff);
}
}
-
+
}
}
diff --git a/src/mess/machine/wswan.c b/src/mess/machine/wswan.c
index d8a219e37d1..46d213e6eba 100644
--- a/src/mess/machine/wswan.c
+++ b/src/mess/machine/wswan.c
@@ -201,21 +201,21 @@ void wswan_state::common_start()
{
m_ws_bios_bank = auto_alloc_array(machine(), UINT8, 0x10000);
memcpy(m_ws_bios_bank + 0xffc0, ws_fake_bios_code, 0x40);
-
+
m_vdp.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wswan_state::wswan_scanline_interrupt),this), &m_vdp);
m_vdp.timer->adjust(attotime::from_ticks(256, 3072000), 0, attotime::from_ticks(256, 3072000));
-
+
wswan_register_save();
-
+
machine().device<nvram_device>("nvram")->set_base(m_internal_eeprom, INTERNAL_EEPROM_SIZE);
-
+
if (m_cart->exists())
- {
+ {
// ROM
m_maincpu->space(AS_PROGRAM).install_read_handler(0x20000, 0x2ffff, read8_delegate(FUNC(ws_cart_slot_device::read_rom20),(ws_cart_slot_device*)m_cart));
m_maincpu->space(AS_PROGRAM).install_read_handler(0x30000, 0x3ffff, read8_delegate(FUNC(ws_cart_slot_device::read_rom30),(ws_cart_slot_device*)m_cart));
m_maincpu->space(AS_PROGRAM).install_read_handler(0x40000, 0xeffff, read8_delegate(FUNC(ws_cart_slot_device::read_rom40),(ws_cart_slot_device*)m_cart));
-
+
// SRAM
if (m_cart->get_type() == WS_SRAM)
{
@@ -249,7 +249,7 @@ void wswan_state::machine_reset()
if (m_cart->exists())
m_rotate = m_cart->get_is_rotated();
else
- m_rotate = 0;
+ m_rotate = 0;
/* Intialize ports */
memcpy(m_ws_portram, ws_portram_init, 256);
@@ -332,14 +332,14 @@ READ8_MEMBER( wswan_state::port_r )
case 0xc1:
case 0xc2:
case 0xc3:
- case 0xc4: // EEPROM data
- case 0xc5: // EEPROM data
+ case 0xc4: // EEPROM data
+ case 0xc5: // EEPROM data
case 0xc6:
case 0xc7:
case 0xc8:
case 0xc9:
case 0xca:
- case 0xcb: // RTC data
+ case 0xcb: // RTC data
case 0xcc:
case 0xcd:
case 0xce:
@@ -1034,18 +1034,18 @@ WRITE8_MEMBER( wswan_state::port_w )
logerror( "Unsupported internal EEPROM command: %X\n", data );
}
break;
- case 0xc0: // ROM bank $40000-$fffff
- case 0xc1: // SRAM bank
- case 0xc2: // ROM bank $20000-$2ffff
- case 0xc3: // ROM bank $30000-$3ffff
+ case 0xc0: // ROM bank $40000-$fffff
+ case 0xc1: // SRAM bank
+ case 0xc2: // ROM bank $20000-$2ffff
+ case 0xc3: // ROM bank $30000-$3ffff
case 0xc4:
case 0xc5:
- case 0xc6: // EEPROM address / command
- case 0xc7: // EEPROM address / command
- case 0xc8: // EEPROM command
+ case 0xc6: // EEPROM address / command
+ case 0xc7: // EEPROM address / command
+ case 0xc8: // EEPROM command
case 0xc9:
- case 0xca: // RTC command
- case 0xcb: // RTC data
+ case 0xca: // RTC command
+ case 0xcb: // RTC data
case 0xcc:
case 0xcd:
case 0xce:
diff --git a/src/mess/mess.mak b/src/mess/mess.mak
index ebb3638d234..e37665920aa 100644
--- a/src/mess/mess.mak
+++ b/src/mess/mess.mak
@@ -963,7 +963,7 @@ $(MESSOBJ)/adc.a: \
$(MESS_DRIVERS)/superslave.o\
$(MESSOBJ)/alesis.a: \
- $(MESS_DRIVERS)/alesis.o $(MESS_AUDIO)/alesis.o $(MESS_VIDEO)/alesis.o \
+ $(MESS_DRIVERS)/alesis.o $(MESS_AUDIO)/alesis.o $(MESS_VIDEO)/alesis.o \
$(MESSOBJ)/altos.a: \
$(MESS_DRIVERS)/altos5.o \
@@ -989,7 +989,7 @@ $(MESSOBJ)/apollo.a: \
$(MESSOBJ)/apple.a: \
$(MESS_DRIVERS)/apple1.o $(MESS_MACHINE)/apple1.o $(MESS_VIDEO)/apple1.o \
$(MESS_DRIVERS)/apple2.o $(MESS_MACHINE)/apple2.o $(MESS_VIDEO)/apple2.o \
- $(MESS_DRIVERS)/apple2gs.o $(MESS_MACHINE)/apple2gs.o $(MESS_VIDEO)/apple2gs.o \
+ $(MESS_DRIVERS)/apple2gs.o $(MESS_MACHINE)/apple2gs.o $(MESS_VIDEO)/apple2gs.o \
$(MESS_DRIVERS)/apple3.o $(MESS_MACHINE)/apple3.o $(MESS_VIDEO)/apple3.o \
$(MESS_DRIVERS)/lisa.o $(MESS_MACHINE)/lisa.o \
$(MESS_DRIVERS)/mac.o $(MESS_AUDIO)/mac.o $(MESS_MACHINE)/egret.o $(MESS_MACHINE)/mac.o $(MESS_MACHINE)/macadb.o $(MESS_MACHINE)/macrtc.o $(MESS_MACHINE)/mackbd.o $(MESS_MACHINE)/swim.o $(MESS_VIDEO)/mac.o \
@@ -1029,7 +1029,7 @@ $(MESSOBJ)/bandai.a: \
$(MESS_DRIVERS)/wswan.o $(MESS_AUDIO)/wswan_snd.o $(MESS_MACHINE)/wswan.o $(MESS_VIDEO)/wswan.o \
$(MESSOBJ)/be.a: \
- $(MESS_DRIVERS)/bebox.o $(MESS_MACHINE)/bebox.o \
+ $(MESS_DRIVERS)/bebox.o $(MESS_MACHINE)/bebox.o \
$(MESSOBJ)/bnpo.a: \
$(MESS_DRIVERS)/b2m.o $(MESS_MACHINE)/b2m.o $(MESS_VIDEO)/b2m.o \
@@ -1359,7 +1359,7 @@ $(MESSOBJ)/mgu.a: \
$(MESS_DRIVERS)/irisha.o \
$(MESSOBJ)/microkey.a: \
- $(MESS_DRIVERS)/primo.o $(MESS_MACHINE)/primo.o $(MESS_VIDEO)/primo.o \
+ $(MESS_DRIVERS)/primo.o $(MESS_MACHINE)/primo.o $(MESS_VIDEO)/primo.o \
$(MESSOBJ)/mit.a: \
$(MESS_DRIVERS)/tx0.o $(MESS_VIDEO)/crt.o $(MESS_VIDEO)/tx0.o \
@@ -1469,7 +1469,7 @@ $(MESSOBJ)/pitronic.a: \
$(MESSOBJ)/pc.a: \
$(MESS_DRIVERS)/asst128.o \
$(MESS_DRIVERS)/europc.o \
- $(MESS_DRIVERS)/genpc.o $(MESS_MACHINE)/genpc.o \
+ $(MESS_DRIVERS)/genpc.o $(MESS_MACHINE)/genpc.o \
$(MESS_DRIVERS)/ibmpc.o \
$(MESS_DRIVERS)/ibmpcjr.o \
$(MESS_DRIVERS)/pc.o \
@@ -1480,7 +1480,7 @@ $(MESSOBJ)/pdp1.a: \
$(MESSOBJ)/pel.a: \
$(MESS_DRIVERS)/galeb.o $(MESS_VIDEO)/galeb.o \
- $(MESS_DRIVERS)/orao.o $(MESS_MACHINE)/orao.o $(MESS_VIDEO)/orao.o \
+ $(MESS_DRIVERS)/orao.o $(MESS_MACHINE)/orao.o $(MESS_VIDEO)/orao.o \
$(MESSOBJ)/philips.a: \
$(MESS_DRIVERS)/p2000t.o $(MESS_MACHINE)/p2000t.o $(MESS_VIDEO)/p2000m.o \
@@ -1686,7 +1686,7 @@ $(MESSOBJ)/tem.a: \
$(MESS_DRIVERS)/tec1.o \
$(MESSOBJ)/tesla.a: \
- $(MESS_DRIVERS)/ondra.o $(MESS_MACHINE)/ondra.o $(MESS_VIDEO)/ondra.o \
+ $(MESS_DRIVERS)/ondra.o $(MESS_MACHINE)/ondra.o $(MESS_VIDEO)/ondra.o \
$(MESS_DRIVERS)/pmd85.o $(MESS_MACHINE)/pmd85.o $(MESS_VIDEO)/pmd85.o \
$(MESS_DRIVERS)/pmi80.o \
$(MESS_DRIVERS)/sapi1.o \
@@ -1699,7 +1699,7 @@ $(MESSOBJ)/thomson.a: \
$(MESS_DRIVERS)/thomson.o $(MESS_MACHINE)/thomson.o $(MESS_MACHINE)/thomflop.o $(MESS_VIDEO)/thomson.o \
$(MESSOBJ)/ti.a: \
- $(MESS_DRIVERS)/avigo.o $(MESS_VIDEO)/avigo.o \
+ $(MESS_DRIVERS)/avigo.o $(MESS_VIDEO)/avigo.o \
$(MESS_DRIVERS)/cc40.o \
$(MESS_DRIVERS)/evmbug.o \
$(MESS_DRIVERS)/exelv.o \
diff --git a/src/mess/tiny.lst b/src/mess/tiny.lst
index f9c576d54cc..000c69f4ee3 100644
--- a/src/mess/tiny.lst
+++ b/src/mess/tiny.lst
@@ -39,4 +39,4 @@
******************************************************************************/
coleco // NTSC ColecoVision
-colecop // PAL Colecovision
+colecop // PAL Colecovision
diff --git a/src/mess/tools/imgtool/modules/amiga.c b/src/mess/tools/imgtool/modules/amiga.c
index 0f7c02a5624..dc8a6750690 100644
--- a/src/mess/tools/imgtool/modules/amiga.c
+++ b/src/mess/tools/imgtool/modules/amiga.c
@@ -1776,9 +1776,9 @@ static void amiga_image_info(imgtool_image *img, char *string, size_t len)
t_v = amiga_crack_time(&root.v);
t_r = amiga_crack_time(&root.r);
- strftime(c, sizeof(c), "%d-%b-%y %H:%M:%S", localtime(&t_c));
- strftime(v, sizeof(v), "%d-%b-%y %H:%M:%S", localtime(&t_v));
- strftime(r, sizeof(r), "%d-%b-%y %H:%M:%S", localtime(&t_r));
+ strftime(c, sizeof(c), "%d-%b-%y %H:%M:%S", localtime(&t_c));
+ strftime(v, sizeof(v), "%d-%b-%y %H:%M:%S", localtime(&t_v));
+ strftime(r, sizeof(r), "%d-%b-%y %H:%M:%S", localtime(&t_r));
strcpy(info, "Volume name: ");
strncat(info, (char *)root.diskname, root.name_len);
diff --git a/src/mess/video/advision.c b/src/mess/video/advision.c
index cd4d11ee377..d55fb7ed137 100644
--- a/src/mess/video/advision.c
+++ b/src/mess/video/advision.c
@@ -65,7 +65,7 @@ void advision_state::vh_update(int x)
for (int i = 0; i < 8; i++)
{
- if (!BIT(data, 7 - i))
+ if (!BIT(data, 7 - i))
dst[i * 256] = 8;
}
diff --git a/src/mess/video/apple2.c b/src/mess/video/apple2.c
index f12e9828f5e..67c94abdfda 100644
--- a/src/mess/video/apple2.c
+++ b/src/mess/video/apple2.c
@@ -102,7 +102,7 @@ inline void apple2_state::apple2_plot_text_character(bitmap_ind16 &bitmap, int x
switch (m_sysconfig->read() & 0x03)
{
case 0:
- break; // leave alone
+ break; // leave alone
case 1:
if ((m_machinetype == APPLE_II) || (m_machinetype == LABA2P) || (m_machinetype == SPACE84))
@@ -182,7 +182,7 @@ inline void apple2_state::apple2_plot_text_character(bitmap_ind16 &bitmap, int x
for (i = 0; i < xscale; i++)
{
- bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
+ bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
}
}
}
@@ -352,7 +352,7 @@ void apple2_state::apple2_hires_draw(bitmap_ind16 &bitmap, const rectangle &clip
{
case 0:
artifact_map_ptr = &m_hires_artifact_map[((vram_row[col+1] & 0x80) >> 7) * 16];
- for (b = 0; b < 7; b++)
+ for (b = 0; b < 7; b++)
{
v = artifact_map_ptr[((w >> (b + 7-1)) & 0x07) | (((b ^ col) & 0x01) << 3)];
*(p++) = v;
@@ -362,7 +362,7 @@ void apple2_state::apple2_hires_draw(bitmap_ind16 &bitmap, const rectangle &clip
case 1:
w >>= 7;
- for (b = 0; b < 7; b++)
+ for (b = 0; b < 7; b++)
{
v = (w & 1);
w >>= 1;
@@ -373,7 +373,7 @@ void apple2_state::apple2_hires_draw(bitmap_ind16 &bitmap, const rectangle &clip
case 2:
w >>= 7;
- for (b = 0; b < 7; b++)
+ for (b = 0; b < 7; b++)
{
v = (w & 1);
w >>= 1;
@@ -384,7 +384,7 @@ void apple2_state::apple2_hires_draw(bitmap_ind16 &bitmap, const rectangle &clip
case 3:
w >>= 7;
- for (b = 0; b < 7; b++)
+ for (b = 0; b < 7; b++)
{
v = (w & 1);
w >>= 1;
@@ -411,7 +411,7 @@ void apple2_state::apple2_hires_draw(bitmap_ind16 &bitmap, const rectangle &clip
switch (mon_type)
{
case 0:
- for (b = 0; b < 7; b++)
+ for (b = 0; b < 7; b++)
{
v = m_dhires_artifact_map[((((w >> (b + 7-1)) & 0x0F) * 0x11) >> (((2-(col*7+b))) & 0x03)) & 0x0F];
*(p++) = v;
diff --git a/src/mess/video/apple3.c b/src/mess/video/apple3.c
index 57bd636d98a..17ff125ccd4 100644
--- a/src/mess/video/apple3.c
+++ b/src/mess/video/apple3.c
@@ -412,7 +412,7 @@ void apple3_state::apple3_video_graphics_chires(bitmap_ind16 &bitmap)
UINT32 apple3_state::screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
-// printf("gfx mode %x\n", m_flags & (VAR_VM3|VAR_VM1|VAR_VM0));
+// printf("gfx mode %x\n", m_flags & (VAR_VM3|VAR_VM1|VAR_VM0));
switch(m_flags & (VAR_VM3|VAR_VM1|VAR_VM0))
{
diff --git a/src/mess/video/maria.c b/src/mess/video/maria.c
index 5f285e4b2bf..62af22ba947 100644
--- a/src/mess/video/maria.c
+++ b/src/mess/video/maria.c
@@ -2,22 +2,22 @@
Atari MARIA video emulation
-
+
- some history:
- 2014-10-05 Mike Saarna, Robert Tuccitto Last Line DMA value corrected
- to 6. GCC and Atari docs both show a difference between
- Other Line and Last Line as +6 at the lowest part of the
+ 2014-10-05 Mike Saarna, Robert Tuccitto Last Line DMA value corrected
+ to 6. GCC and Atari docs both show a difference between
+ Other Line and Last Line as +6 at the lowest part of the
range.
- Blank scanlines are drawn when DMA is off, like real
+ Blank scanlines are drawn when DMA is off, like real
hardware.
- If MARIA hits the DMA limit, the CPU doesn't run until
+ If MARIA hits the DMA limit, the CPU doesn't run until
the next scanline.
- 2014-09-03 Mike Saarna, Robert Tuccitto reorganized DMA penalties to
+ 2014-09-03 Mike Saarna, Robert Tuccitto reorganized DMA penalties to
support new rendering timeout code.
2014-08-29 Mike Saarna Timeout rendering added.
-
+
2014-08-26 Fabio Priuli Converted to device
2014-05-06 Mike Saarna Added interrupts to DMA cycle eating. Updates to
@@ -61,7 +61,7 @@ atari_maria_device::atari_maria_device(const machine_config &mconfig, const char
void atari_maria_device::device_start()
-{
+{
m_cpu = machine().device<cpu_device>(m_cpu_tag);
m_screen = machine().first_screen();
m_screen->register_screen_bitmap(m_bitmap);
@@ -181,7 +181,7 @@ void atari_maria_device::draw_scanline()
// All lines in a zone have the same initial DMA startup time. We'll adjust
// cycles for the special last zone line later, as those penalties happen after
// MARIA is done rendering, or after its hit the maximum rendering time.
- maria_cycles = 16;
+ maria_cycles = 16;
/* Process this DLL entry */
@@ -232,7 +232,7 @@ void atari_maria_device::draw_scanline()
data_addr = (m_charbase | c) + (m_offset << 8);
if (is_holey(data_addr))
continue;
-
+
maria_cycles += 3;
if (m_cwidth) // two data bytes per map byte
{
@@ -260,9 +260,9 @@ void atari_maria_device::draw_scanline()
}
}
}
-
+
// Last Line post-render DMA cycle penalties...
- if (m_offset == 0)
+ if (m_offset == 0)
{
maria_cycles += 6; // extra shutdown time
if (READ_MEM(m_dll + 3) & 0x80)
@@ -443,7 +443,7 @@ WRITE8_MEMBER(atari_maria_device::write)
m_color_kill = data & 0x80;
switch ((data >> 5) & 3)
{
- case 0x00:
+ case 0x00:
case 01:
logerror("dma test mode, do not use.\n");
break;
diff --git a/src/mess/video/maria.h b/src/mess/video/maria.h
index e1b70baf4a8..b776ee5ae26 100644
--- a/src/mess/video/maria.h
+++ b/src/mess/video/maria.h
@@ -12,22 +12,22 @@ public:
atari_maria_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
static void set_cpu_tag(device_t &device, const char *tag) { downcast<atari_maria_device &>(device).m_cpu_tag = tag; }
-
+
void interrupt(int lines);
void startdma(int lines);
-
+
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-
+
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
private:
-
+
int m_maria_palette[32];
int m_line_ram[2][160];
int m_active_buffer;
@@ -54,7 +54,7 @@ private:
int write_line_ram(int addr, UINT8 offset, int pal);
const char *m_cpu_tag;
- cpu_device *m_cpu; // CPU whose space(AS_PROGRAM) serves as DMA source
+ cpu_device *m_cpu; // CPU whose space(AS_PROGRAM) serves as DMA source
screen_device *m_screen;
};
diff --git a/src/mess/video/nes.c b/src/mess/video/nes.c
index 91ec1f2d18a..64cb116df1e 100644
--- a/src/mess/video/nes.c
+++ b/src/mess/video/nes.c
@@ -37,8 +37,8 @@ UINT32 nes_state::screen_update_nes(screen_device &screen, bitmap_ind16 &bitmap,
m_ppu->render(bitmap, 0, 0, 0, 0);
// if this is a disk system game, check for the flip-disk key
- if ((m_cartslot && m_cartslot->exists() && (m_cartslot->get_pcb_id() == STD_DISKSYS)) // first scenario = disksys in m_cartslot (= famicom)
- || m_disk) // second scenario = disk via fixed internal disk option (fds & famitwin)
+ if ((m_cartslot && m_cartslot->exists() && (m_cartslot->get_pcb_id() == STD_DISKSYS)) // first scenario = disksys in m_cartslot (= famicom)
+ || m_disk) // second scenario = disk via fixed internal disk option (fds & famitwin)
{
// latch this input so it doesn't go at warp speed
if ((m_io_disksel->read_safe(0) & 0x01) && (!m_last_frame_flip))
diff --git a/src/mess/video/thomson.c b/src/mess/video/thomson.c
index 3687bb2dc7f..6b7bb72e221 100644
--- a/src/mess/video/thomson.c
+++ b/src/mess/video/thomson.c
@@ -412,7 +412,7 @@ UPDATE_HI( mo5alt )
int i;
pen_t c[2];
c[0] = pal[ (ramb & 15) ^ 8 ];
- c[1] = pal[ (ramb >> 4) ^ 8 ];
+ c[1] = pal[ (ramb >> 4) ^ 8 ];
for ( i = 0; i < 16; i += 2, rama >>= 1 )
dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ];
}
@@ -715,11 +715,11 @@ UPDATE_HI( overlayhalf )
c[0][0] = pal[ 0 ];
c[0][1] = c[1][1] = pal[ 1 ];
c[1][0] = pal[ 2 ];
- rama >>= 4;
- ramb >>= 4;
+ rama >>= 4;
+ ramb >>= 4;
for ( i = 0; i < 16; i += 4, rama >>= 1, ramb >>= 1 )
- dst[ 15 - i ] = dst[ 14 - i ] = dst[ 13 - i ] = dst[ 12 - i ] =
- c[ ramb & 1 ] [ rama & 1 ];
+ dst[ 15 - i ] = dst[ 14 - i ] = dst[ 13 - i ] = dst[ 12 - i ] =
+ c[ ramb & 1 ] [ rama & 1 ];
}
END_UPDATE
@@ -730,8 +730,8 @@ UPDATE_LOW( overlayhalf )
c[0][0] = pal[ 0 ];
c[0][1] = c[1][1] = pal[ 1 ];
c[1][0] = pal[ 2 ];
- rama >>= 4;
- ramb >>= 4;
+ rama >>= 4;
+ ramb >>= 4;
for ( i = 0; i < 8; i += 2, rama >>= 1, ramb >>= 1 )
dst[ 7 - i ] = dst[ 6 - i ] = c[ ramb & 1 ] [ rama & 1 ];
}
@@ -782,7 +782,7 @@ static const thom_scandraw thom_scandraw_funcs[THOM_VMODE_NB][2] =
FUN(to770), FUN(mo5), FUN(bitmap4), FUN(bitmap4alt), FUN(mode80),
FUN(bitmap16), FUN(page1), FUN(page2), FUN(overlay), FUN(overlay3),
FUN(to9), FUN(mode80_to9),
- FUN(bitmap4althalf), FUN(mo5alt), FUN(overlayhalf),
+ FUN(bitmap4althalf), FUN(mo5alt), FUN(overlayhalf),
};
@@ -1199,27 +1199,27 @@ PALETTE_INIT_MEMBER(thomson_state, thom)
{
LOG (( "thom: palette init called\n" ));
- /* TO8 and later use an EF9369 color palette chip
- The spec shows a built-in gamma correction for gamma=2.8
- i.e., output is out = in ^ (1/2.8)
+ /* TO8 and later use an EF9369 color palette chip
+ The spec shows a built-in gamma correction for gamma=2.8
+ i.e., output is out = in ^ (1/2.8)
- For the TO7, the gamma correction is irrelevant.
-
- For the TO7/70, we use the same palette and gamma has the TO8,
- which gives good results (but is not verified).
- */
- thom_configure_palette(1.0 / 2.8, thom_pal_init, palette);
+ For the TO7, the gamma correction is irrelevant.
+
+ For the TO7/70, we use the same palette and gamma has the TO8,
+ which gives good results (but is not verified).
+ */
+ thom_configure_palette(1.0 / 2.8, thom_pal_init, palette);
}
PALETTE_INIT_MEMBER(thomson_state, mo5)
{
LOG (( "thom: MO5 palette init called\n" ));
- /* The MO5 has a different fixed palette than the TO7/70.
- We use a smaller gamma correction which gives intutively better
- results (but is not verified).
- */
- thom_configure_palette(1.0, mo5_pal_init, palette);
+ /* The MO5 has a different fixed palette than the TO7/70.
+ We use a smaller gamma correction which gives intutively better
+ results (but is not verified).
+ */
+ thom_configure_palette(1.0, mo5_pal_init, palette);
}
diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h
index 7b146fc058b..5e039285369 100644
--- a/src/osd/sdl/osdsdl.h
+++ b/src/osd/sdl/osdsdl.h
@@ -83,7 +83,7 @@
#define SDLOPTVAL_OPENGL "opengl"
#define SDLOPTVAL_SOFT "soft"
-#define SDLOPTVAL_SDL2ACCEL "accel"
+#define SDLOPTVAL_SDL2ACCEL "accel"
#define SDLMAME_LED(x) "led" #x
diff --git a/src/osd/sdl/sdlfile.c b/src/osd/sdl/sdlfile.c
index a31ace78619..c2526d0021b 100644
--- a/src/osd/sdl/sdlfile.c
+++ b/src/osd/sdl/sdlfile.c
@@ -499,4 +499,4 @@ int osd_is_absolute_path(const char *path)
return result;
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/osd/sdl/sdlptty_win32.c b/src/osd/sdl/sdlptty_win32.c
index 190ca354055..42b10131c61 100644
--- a/src/osd/sdl/sdlptty_win32.c
+++ b/src/osd/sdl/sdlptty_win32.c
@@ -11,4 +11,3 @@
//============================================================
#include "../windows/winptty.c"
-
diff --git a/src/osd/sdl/sdlsocket.c b/src/osd/sdl/sdlsocket.c
index 7d7370128b9..cc6682abcd1 100644
--- a/src/osd/sdl/sdlsocket.c
+++ b/src/osd/sdl/sdlsocket.c
@@ -192,4 +192,4 @@ file_error sdl_close_socket(osd_file *file)
osd_free(file);
return FILERR_NONE;
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/osd/sdl/sdlsync_win32.c b/src/osd/sdl/sdlsync_win32.c
index 7c6464ec69e..72f729d6937 100644
--- a/src/osd/sdl/sdlsync_win32.c
+++ b/src/osd/sdl/sdlsync_win32.c
@@ -9,4 +9,4 @@
//
//============================================================
-#include "../windows/winsync.c" \ No newline at end of file
+#include "../windows/winsync.c"
diff --git a/src/osd/sdl/video.c b/src/osd/sdl/video.c
index ccbe5013190..a5b130cd87f 100644
--- a/src/osd/sdl/video.c
+++ b/src/osd/sdl/video.c
@@ -134,7 +134,7 @@ bool sdl_osd_interface::video_init()
void sdl_osd_interface::video_exit()
{
window_exit();
-
+
// free all of our monitor information
while (sdl_monitor_list != NULL)
{
diff --git a/src/osd/windows/vconv.c b/src/osd/windows/vconv.c
index 3defa283a79..841895bcda4 100644
--- a/src/osd/windows/vconv.c
+++ b/src/osd/windows/vconv.c
@@ -99,7 +99,7 @@ static const translation_info gcc_translate[] =
{ 0, "c++", "" },
{ 0, "-flto", "/GL" },
{ 0, "-fno-optimize-sibling-calls", "" },
- { VS2005, "-fopenmp", "/openmp" },
+ { VS2005, "-fopenmp", "/openmp" },
{ 0 }
};
diff --git a/src/osd/windows/video.c b/src/osd/windows/video.c
index 65a82976cc6..1841ad30100 100644
--- a/src/osd/windows/video.c
+++ b/src/osd/windows/video.c
@@ -97,7 +97,7 @@ bool windows_osd_interface::video_init()
void windows_osd_interface::video_exit()
{
window_exit();
-
+
// free all of our monitor information
while (win_monitor_list != NULL)
{
@@ -111,10 +111,10 @@ void windows_osd_interface::video_exit()
win_monitor_info::win_monitor_info()
: next(NULL),
- handle(NULL),
- aspect(0.0f),
- reqwidth(0),
- reqheight(0)
+ handle(NULL),
+ aspect(0.0f),
+ reqwidth(0),
+ reqheight(0)
{
}
diff --git a/src/osd/windows/video.h b/src/osd/windows/video.h
index 46eb17978bf..23a8f62bde9 100644
--- a/src/osd/windows/video.h
+++ b/src/osd/windows/video.h
@@ -38,11 +38,11 @@ public:
void refresh();
float get_aspect();
void set_aspect(float a) { aspect = a; }
-
+
win_monitor_info * next; // pointer to next monitor in list
HMONITOR handle; // handle to the monitor
- MONITORINFOEX info; // most recently retrieved info
-private:
+ MONITORINFOEX info; // most recently retrieved info
+private:
float aspect; // computed/configured aspect ratio of the physical device
int reqwidth; // requested width for this monitor
int reqheight; // requested height for this monitor
diff --git a/src/osd/windows/window.c b/src/osd/windows/window.c
index 44ec17cb70b..28794405c62 100644
--- a/src/osd/windows/window.c
+++ b/src/osd/windows/window.c
@@ -245,7 +245,7 @@ bool windows_osd_interface::window_init()
// set up the window list
last_window_ptr = &win_window_list;
-
+
return true;
}
@@ -313,7 +313,7 @@ win_window_info::win_window_info(running_machine &machine)
m_target(NULL),
m_targetview(0),
m_targetorient(0),
- m_primlist(NULL),
+ m_primlist(NULL),
m_lastclicktime(0),
m_lastclickx(0),
m_lastclicky(0),
@@ -321,9 +321,9 @@ win_window_info::win_window_info(running_machine &machine)
m_machine(machine)
{
memset(m_title,0,sizeof(m_title));
- m_non_fullscreen_bounds.left = 0;
- m_non_fullscreen_bounds.top = 0;
- m_non_fullscreen_bounds.right = 0;
+ m_non_fullscreen_bounds.left = 0;
+ m_non_fullscreen_bounds.top = 0;
+ m_non_fullscreen_bounds.right = 0;
m_non_fullscreen_bounds.bottom = 0;
}
@@ -331,7 +331,7 @@ win_window_info::~win_window_info()
{
}
-
+
//============================================================
// winwindow_process_events_periodic
// (main thread)
diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h
index 3af43f6bf1f..b2c6ea2e994 100644
--- a/src/osd/windows/window.h
+++ b/src/osd/windows/window.h
@@ -36,12 +36,12 @@ class win_window_info
{
public:
win_window_info(running_machine &machine);
- virtual ~win_window_info();
+ virtual ~win_window_info();
running_machine &machine() const { return m_machine; }
void update();
-
+
win_window_info * m_next;
volatile int m_init_state;
diff --git a/src/osd/windows/winos.c b/src/osd/windows/winos.c
index 8d32c5ec62b..a5afa35a824 100644
--- a/src/osd/windows/winos.c
+++ b/src/osd/windows/winos.c
@@ -32,4 +32,4 @@ int osd_get_num_processors(void)
char *osd_getenv(const char *name)
{
return getenv(name);
-} \ No newline at end of file
+}
diff --git a/src/osd/windows/winos.h b/src/osd/windows/winos.h
index bef3d799760..55284d8ac14 100644
--- a/src/osd/windows/winos.h
+++ b/src/osd/windows/winos.h
@@ -29,4 +29,4 @@ int osd_get_num_processors(void);
pointer to value
-----------------------------------------------------------------------------*/
-char *osd_getenv(const char *name); \ No newline at end of file
+char *osd_getenv(const char *name);
diff --git a/src/osd/windows/winsync.c b/src/osd/windows/winsync.c
index 4ef161dd001..ce69cea1651 100644
--- a/src/osd/windows/winsync.c
+++ b/src/osd/windows/winsync.c
@@ -373,4 +373,4 @@ void osd_scalable_lock_free(osd_scalable_lock *lock)
DeleteCriticalSection(&lock->section);
#endif
free(lock);
-} \ No newline at end of file
+}
diff --git a/src/osd/windows/winsync.h b/src/osd/windows/winsync.h
index c574a9ba75c..725d459366d 100644
--- a/src/osd/windows/winsync.h
+++ b/src/osd/windows/winsync.h
@@ -197,4 +197,4 @@ void osd_scalable_lock_release(osd_scalable_lock *lock, INT32 myslot);
void osd_scalable_lock_free(osd_scalable_lock *lock);
-#endif /* __WINSYNC__ */ \ No newline at end of file
+#endif /* __WINSYNC__ */
diff --git a/src/version.c b/src/version.c
index a2c76de86a3..89d24016165 100644
--- a/src/version.c
+++ b/src/version.c
@@ -9,4 +9,4 @@
***************************************************************************/
extern const char build_version[];
-const char build_version[] = "0.154 (" __DATE__")";
+const char build_version[] = "0.155 (" __DATE__")";