From ddb290d5f615019c33c42b8d94e5a5254cabcf33 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 22 Oct 2016 13:13:17 +0200 Subject: NOTICE (TYPE NAME CONSOLIDATION) Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8 --- src/mame/machine/315-5838_317-0229_comp.cpp | 20 +- src/mame/machine/315-5838_317-0229_comp.h | 28 +-- src/mame/machine/315-5881_crypt.cpp | 48 ++--- src/mame/machine/315-5881_crypt.h | 40 ++-- src/mame/machine/315_5296.cpp | 2 +- src/mame/machine/315_5296.h | 10 +- src/mame/machine/3do.cpp | 58 +++--- src/mame/machine/6883sam.cpp | 26 +-- src/mame/machine/6883sam.h | 78 ++++---- src/mame/machine/abc1600mac.cpp | 48 ++--- src/mame/machine/abc1600mac.h | 32 +-- src/mame/machine/abc80kb.cpp | 4 +- src/mame/machine/abc80kb.h | 4 +- src/mame/machine/ac1.cpp | 50 ++--- src/mame/machine/acitya.cpp | 10 +- src/mame/machine/advision.cpp | 6 +- src/mame/machine/aim65.cpp | 14 +- src/mame/machine/ajax.cpp | 4 +- src/mame/machine/alpha8201.cpp | 6 +- src/mame/machine/alpha8201.h | 10 +- src/mame/machine/amiga.cpp | 98 ++++----- src/mame/machine/amigakbd.cpp | 6 +- src/mame/machine/amigakbd.h | 12 +- src/mame/machine/amstrad.cpp | 114 +++++------ src/mame/machine/apollo.cpp | 78 ++++---- src/mame/machine/apollo_dbg.cpp | 42 ++-- src/mame/machine/apollo_kbd.cpp | 36 ++-- src/mame/machine/apollo_kbd.h | 32 +-- src/mame/machine/apple2.cpp | 60 +++--- src/mame/machine/apple2gs.cpp | 98 ++++----- src/mame/machine/apple3.cpp | 34 ++-- src/mame/machine/apricotkb.cpp | 8 +- src/mame/machine/apricotkb.h | 6 +- src/mame/machine/archimds.cpp | 52 ++--- src/mame/machine/arkanoid.cpp | 14 +- src/mame/machine/asic65.cpp | 82 ++++---- src/mame/machine/asic65.h | 28 +-- src/mame/machine/asteroid.cpp | 4 +- src/mame/machine/at.cpp | 20 +- src/mame/machine/at.h | 22 +-- src/mame/machine/atari400.cpp | 4 +- src/mame/machine/atari_vg.cpp | 2 +- src/mame/machine/atari_vg.h | 2 +- src/mame/machine/atarifdc.cpp | 42 ++-- src/mame/machine/atarifdc.h | 14 +- src/mame/machine/atarigen.cpp | 38 ++-- src/mame/machine/atarigen.h | 64 +++--- src/mame/machine/atarixga.cpp | 58 +++--- src/mame/machine/atarixga.h | 22 +-- src/mame/machine/awboard.cpp | 30 +-- src/mame/machine/awboard.h | 30 +-- src/mame/machine/b2m.cpp | 20 +- src/mame/machine/bagman.cpp | 8 +- src/mame/machine/balsente.cpp | 30 +-- src/mame/machine/bbc.cpp | 26 +-- src/mame/machine/bebox.cpp | 92 ++++----- src/mame/machine/beezer.cpp | 2 +- src/mame/machine/beta.cpp | 4 +- src/mame/machine/beta.h | 4 +- src/mame/machine/bfm_bd1.cpp | 6 +- src/mame/machine/bfm_bd1.h | 26 +-- src/mame/machine/bfm_bda.cpp | 6 +- src/mame/machine/bfm_bda.h | 26 +-- src/mame/machine/bfm_comn.cpp | 18 +- src/mame/machine/bfm_comn.h | 2 +- src/mame/machine/bfm_sc45_helper.cpp | 46 ++--- src/mame/machine/bk.cpp | 4 +- src/mame/machine/bonzeadv.cpp | 20 +- src/mame/machine/btime.cpp | 4 +- src/mame/machine/bublbobl.cpp | 2 +- src/mame/machine/buggychl.cpp | 2 +- src/mame/machine/buggychl.h | 24 +-- src/mame/machine/c117.cpp | 8 +- src/mame/machine/c117.h | 10 +- src/mame/machine/carpolo.cpp | 8 +- src/mame/machine/cat702.cpp | 18 +- src/mame/machine/cat702.h | 12 +- src/mame/machine/cbm_snqk.cpp | 10 +- src/mame/machine/cbm_snqk.h | 4 +- src/mame/machine/cchip.cpp | 2 +- src/mame/machine/cclimber.cpp | 20 +- src/mame/machine/cdi070.cpp | 60 +++--- src/mame/machine/cdi070.h | 138 ++++++------- src/mame/machine/cdicdic.cpp | 296 ++++++++++++++-------------- src/mame/machine/cdicdic.h | 52 ++--- src/mame/machine/cdislave.cpp | 18 +- src/mame/machine/cdislave.h | 34 ++-- src/mame/machine/chaknpop.cpp | 6 +- src/mame/machine/coco.cpp | 46 ++--- src/mame/machine/coco12.cpp | 14 +- src/mame/machine/coco3.cpp | 8 +- src/mame/machine/coco_vhd.cpp | 24 +-- src/mame/machine/coco_vhd.h | 14 +- src/mame/machine/compiskb.cpp | 6 +- src/mame/machine/compiskb.h | 6 +- src/mame/machine/concept.cpp | 8 +- src/mame/machine/cps2crypt.cpp | 46 ++--- src/mame/machine/cuda.cpp | 8 +- src/mame/machine/cuda.h | 34 ++-- src/mame/machine/cx4data.hxx | 10 +- src/mame/machine/cx4fn.hxx | 104 +++++----- src/mame/machine/cx4oam.hxx | 80 ++++---- src/mame/machine/cx4ops.hxx | 34 ++-- src/mame/machine/cybiko.cpp | 20 +- src/mame/machine/dai.cpp | 4 +- src/mame/machine/dc-ctrl.cpp | 16 +- src/mame/machine/dc-ctrl.h | 10 +- src/mame/machine/dc.cpp | 54 ++--- src/mame/machine/dccons.cpp | 2 +- src/mame/machine/dec0.cpp | 6 +- src/mame/machine/dec_lk201.cpp | 26 +-- src/mame/machine/dec_lk201.h | 44 ++--- src/mame/machine/deco102.cpp | 12 +- src/mame/machine/deco102.h | 2 +- src/mame/machine/deco104.cpp | 2 +- src/mame/machine/deco104.h | 2 +- src/mame/machine/deco146.cpp | 40 ++-- src/mame/machine/deco146.h | 66 +++---- src/mame/machine/deco156.cpp | 6 +- src/mame/machine/deco222.cpp | 8 +- src/mame/machine/deco222.h | 8 +- src/mame/machine/decocass.cpp | 74 +++---- src/mame/machine/decocass_tape.cpp | 26 +-- src/mame/machine/decocass_tape.h | 20 +- src/mame/machine/decocpu6.cpp | 4 +- src/mame/machine/decocpu6.h | 4 +- src/mame/machine/decocpu7.cpp | 8 +- src/mame/machine/decocpu7.h | 6 +- src/mame/machine/decocrpt.cpp | 22 +-- src/mame/machine/decopincpu.cpp | 18 +- src/mame/machine/decopincpu.h | 14 +- src/mame/machine/dgn_beta.cpp | 22 +-- src/mame/machine/dgnalpha.cpp | 8 +- src/mame/machine/dmv_keyb.cpp | 2 +- src/mame/machine/dmv_keyb.h | 4 +- src/mame/machine/docastle.cpp | 8 +- src/mame/machine/docg3.cpp | 124 ++++++------ src/mame/machine/docg3.h | 100 +++++----- src/mame/machine/dragon.cpp | 10 +- src/mame/machine/egret.cpp | 8 +- src/mame/machine/egret.h | 34 ++-- src/mame/machine/einstein.cpp | 6 +- src/mame/machine/electron.cpp | 14 +- src/mame/machine/esqlcd.cpp | 4 +- src/mame/machine/esqlcd.h | 10 +- src/mame/machine/esqpanel.cpp | 14 +- src/mame/machine/esqpanel.h | 26 +-- src/mame/machine/esqvfd.cpp | 16 +- src/mame/machine/esqvfd.h | 30 +-- src/mame/machine/fd1089.cpp | 38 ++-- src/mame/machine/fd1089.h | 32 +-- src/mame/machine/fd1094.cpp | 80 ++++---- src/mame/machine/fd1094.h | 44 ++--- src/mame/machine/fddebug.cpp | 212 ++++++++++---------- src/mame/machine/flstory.cpp | 6 +- src/mame/machine/fm_scsi.cpp | 20 +- src/mame/machine/fm_scsi.h | 42 ++-- src/mame/machine/gaelco2.cpp | 20 +- src/mame/machine/gaelco3d.cpp | 12 +- src/mame/machine/gaelco3d.h | 10 +- src/mame/machine/gaelcrpt.cpp | 2 +- src/mame/machine/galaxold.cpp | 4 +- src/mame/machine/galaxy.cpp | 12 +- src/mame/machine/gamecom.cpp | 32 +-- src/mame/machine/gamepock.cpp | 12 +- src/mame/machine/gb.cpp | 20 +- src/mame/machine/gdrom.cpp | 16 +- src/mame/machine/gdrom.h | 14 +- src/mame/machine/harddriv.cpp | 94 ++++----- src/mame/machine/hec2hrp.cpp | 12 +- src/mame/machine/hng64_net.cpp | 4 +- src/mame/machine/hp48.cpp | 36 ++-- src/mame/machine/ie15_kbd.cpp | 22 +-- src/mame/machine/ie15_kbd.h | 18 +- src/mame/machine/igs022.cpp | 56 +++--- src/mame/machine/igs022.h | 8 +- src/mame/machine/igs025.cpp | 4 +- src/mame/machine/igs025.h | 20 +- src/mame/machine/igs028.cpp | 46 ++--- src/mame/machine/igs028.h | 12 +- src/mame/machine/igs036crypt.cpp | 30 +-- src/mame/machine/igs036crypt.h | 26 +-- src/mame/machine/inder_sb.cpp | 2 +- src/mame/machine/inder_sb.h | 8 +- src/mame/machine/inder_vid.cpp | 8 +- src/mame/machine/inder_vid.h | 4 +- src/mame/machine/intv.cpp | 8 +- src/mame/machine/irem_cpu.cpp | 30 +-- src/mame/machine/irem_cpu.h | 30 +-- src/mame/machine/irobot.cpp | 52 ++--- src/mame/machine/isbc_215g.cpp | 16 +- src/mame/machine/isbc_215g.h | 18 +- src/mame/machine/iteagle_fpga.cpp | 34 ++-- src/mame/machine/iteagle_fpga.h | 52 ++--- src/mame/machine/itech8.cpp | 114 +++++------ src/mame/machine/jalcrpt.cpp | 24 +-- src/mame/machine/jumpshot.cpp | 10 +- src/mame/machine/jvs13551.cpp | 26 +-- src/mame/machine/jvs13551.h | 24 +-- src/mame/machine/k573cass.cpp | 16 +- src/mame/machine/k573cass.h | 16 +- src/mame/machine/k573dio.cpp | 8 +- src/mame/machine/k573dio.h | 10 +- src/mame/machine/k573mcr.cpp | 2 +- src/mame/machine/k573mcr.h | 2 +- src/mame/machine/k573msu.cpp | 2 +- src/mame/machine/k573msu.h | 2 +- src/mame/machine/k573npu.cpp | 2 +- src/mame/machine/k573npu.h | 2 +- src/mame/machine/k7659kb.cpp | 32 +-- src/mame/machine/k7659kb.h | 10 +- src/mame/machine/kabuki.cpp | 36 ++-- src/mame/machine/kabuki.h | 30 +-- src/mame/machine/kaneko_calc3.cpp | 56 +++--- src/mame/machine/kaneko_calc3.h | 40 ++-- src/mame/machine/kaneko_hit.cpp | 20 +- src/mame/machine/kaneko_hit.h | 20 +- src/mame/machine/kaneko_toybox.cpp | 46 ++--- src/mame/machine/kaneko_toybox.h | 26 +-- src/mame/machine/kay_kbd.cpp | 32 +-- src/mame/machine/kaypro.cpp | 10 +- src/mame/machine/kc.cpp | 46 ++--- src/mame/machine/kc_keyb.cpp | 8 +- src/mame/machine/kc_keyb.h | 6 +- src/mame/machine/km035.cpp | 2 +- src/mame/machine/km035.h | 8 +- src/mame/machine/konami1.cpp | 10 +- src/mame/machine/konami1.h | 12 +- src/mame/machine/konamigx.cpp | 42 ++-- src/mame/machine/konppc.cpp | 28 +-- src/mame/machine/konppc.h | 44 ++--- src/mame/machine/leland.cpp | 60 +++--- src/mame/machine/lisa.cpp | 46 ++--- src/mame/machine/llc.cpp | 8 +- src/mame/machine/lviv.cpp | 14 +- src/mame/machine/lynx.cpp | 74 +++---- src/mame/machine/m1comm.cpp | 10 +- src/mame/machine/m1comm.h | 28 +-- src/mame/machine/m20_8086.cpp | 4 +- src/mame/machine/m20_8086.h | 2 +- src/mame/machine/m20_kbd.cpp | 12 +- src/mame/machine/m20_kbd.h | 6 +- src/mame/machine/m24_kbd.cpp | 4 +- src/mame/machine/m24_kbd.h | 4 +- src/mame/machine/m24_z8000.cpp | 20 +- src/mame/machine/m24_z8000.h | 8 +- src/mame/machine/m2comm.cpp | 6 +- src/mame/machine/m2comm.h | 26 +-- src/mame/machine/m3comm.cpp | 24 +-- src/mame/machine/m3comm.h | 24 +-- src/mame/machine/mac.cpp | 56 +++--- src/mame/machine/macadb.cpp | 12 +- src/mame/machine/mackbd.cpp | 6 +- src/mame/machine/mackbd.h | 4 +- src/mame/machine/macpci.cpp | 6 +- src/mame/machine/macrtc.cpp | 4 +- src/mame/machine/macrtc.h | 28 +-- src/mame/machine/maple-dc.cpp | 18 +- src/mame/machine/maple-dc.h | 8 +- src/mame/machine/mapledev.cpp | 8 +- src/mame/machine/mapledev.h | 16 +- src/mame/machine/mathbox.cpp | 18 +- src/mame/machine/mathbox.h | 6 +- src/mame/machine/mbc55x.cpp | 42 ++-- src/mame/machine/mbee.cpp | 52 ++--- src/mame/machine/mc80.cpp | 4 +- src/mame/machine/mc8123.cpp | 10 +- src/mame/machine/mc8123.h | 2 +- src/mame/machine/mcr.cpp | 6 +- src/mame/machine/mcr68.cpp | 8 +- src/mame/machine/mega32x.cpp | 58 +++--- src/mame/machine/mega32x.h | 66 +++---- src/mame/machine/megacd.cpp | 68 +++---- src/mame/machine/megacd.h | 68 +++---- src/mame/machine/megacdcd.cpp | 74 +++---- src/mame/machine/megacdcd.h | 80 ++++---- src/mame/machine/megadriv.cpp | 44 ++--- src/mame/machine/meters.cpp | 12 +- src/mame/machine/meters.h | 12 +- src/mame/machine/mexico86.cpp | 20 +- src/mame/machine/micro3d.cpp | 54 ++--- src/mame/machine/microdrv.cpp | 6 +- src/mame/machine/microdrv.h | 6 +- src/mame/machine/micropolis.cpp | 8 +- src/mame/machine/micropolis.h | 26 +-- src/mame/machine/microtan.cpp | 24 +-- src/mame/machine/midikbd.cpp | 4 +- src/mame/machine/midikbd.h | 10 +- src/mame/machine/midtunit.cpp | 22 +-- src/mame/machine/midwayic.cpp | 58 +++--- src/mame/machine/midwayic.h | 92 ++++----- src/mame/machine/midyunit.cpp | 4 +- src/mame/machine/mie.cpp | 18 +- src/mame/machine/mie.h | 18 +- src/mame/machine/mikro80.cpp | 4 +- src/mame/machine/mm1kb.cpp | 8 +- src/mame/machine/mm1kb.h | 4 +- src/mame/machine/model1.cpp | 148 +++++++------- src/mame/machine/model3.cpp | 24 +-- src/mame/machine/ms7004.cpp | 2 +- src/mame/machine/ms7004.h | 6 +- src/mame/machine/msx.cpp | 28 +-- src/mame/machine/msx_matsushita.cpp | 6 +- src/mame/machine/msx_matsushita.h | 14 +- src/mame/machine/msx_s1985.cpp | 6 +- src/mame/machine/msx_s1985.h | 10 +- src/mame/machine/msx_switched.cpp | 6 +- src/mame/machine/msx_switched.h | 4 +- src/mame/machine/msx_systemflags.cpp | 2 +- src/mame/machine/msx_systemflags.h | 8 +- src/mame/machine/mtx.cpp | 22 +-- src/mame/machine/mw8080bw.cpp | 12 +- src/mame/machine/mz700.cpp | 44 ++--- src/mame/machine/mz80.cpp | 4 +- src/mame/machine/n64.cpp | 140 ++++++------- src/mame/machine/namco06.cpp | 4 +- src/mame/machine/namco06.h | 4 +- src/mame/machine/namco50.cpp | 6 +- src/mame/machine/namco50.h | 8 +- src/mame/machine/namco51.cpp | 2 +- src/mame/machine/namco51.h | 22 +-- src/mame/machine/namco53.cpp | 6 +- src/mame/machine/namco53.h | 4 +- src/mame/machine/namco62.cpp | 2 +- src/mame/machine/namco62.h | 2 +- src/mame/machine/namco_settings.cpp | 2 +- src/mame/machine/namco_settings.h | 4 +- src/mame/machine/namcoic.cpp | 130 ++++++------ src/mame/machine/namcoio.cpp | 8 +- src/mame/machine/namcoio.h | 22 +-- src/mame/machine/namcomcu.cpp | 10 +- src/mame/machine/namcomcu.h | 10 +- src/mame/machine/namcond1.cpp | 4 +- src/mame/machine/namcos1.cpp | 2 +- src/mame/machine/namcos2.cpp | 24 +-- src/mame/machine/naomi.cpp | 24 +-- src/mame/machine/naomibd.cpp | 16 +- src/mame/machine/naomibd.h | 20 +- src/mame/machine/naomig1.cpp | 18 +- src/mame/machine/naomig1.h | 12 +- src/mame/machine/naomigd.cpp | 118 +++++------ src/mame/machine/naomigd.h | 60 +++--- src/mame/machine/naomim1.cpp | 32 +-- src/mame/machine/naomim1.h | 28 +-- src/mame/machine/naomim2.cpp | 18 +- src/mame/machine/naomim2.h | 16 +- src/mame/machine/naomim4.cpp | 38 ++-- src/mame/machine/naomim4.h | 32 +-- src/mame/machine/naomirom.cpp | 8 +- src/mame/machine/naomirom.h | 10 +- src/mame/machine/nb1413m3.cpp | 4 +- src/mame/machine/nb1414m4.cpp | 38 ++-- src/mame/machine/nc.cpp | 2 +- src/mame/machine/nes.cpp | 14 +- src/mame/machine/nextkbd.cpp | 36 ++-- src/mame/machine/nextkbd.h | 18 +- src/mame/machine/nextmo.cpp | 8 +- src/mame/machine/nextmo.h | 10 +- src/mame/machine/ng_memcard.cpp | 2 +- src/mame/machine/ng_memcard.h | 4 +- src/mame/machine/ngen_kb.cpp | 16 +- src/mame/machine/ngen_kb.h | 12 +- src/mame/machine/nmk004.cpp | 2 +- src/mame/machine/nmk004.h | 6 +- src/mame/machine/nmk112.cpp | 4 +- src/mame/machine/nmk112.h | 10 +- src/mame/machine/ns10crypt.cpp | 4 +- src/mame/machine/ns10crypt.h | 6 +- src/mame/machine/ns11prot.cpp | 30 +-- src/mame/machine/ns11prot.h | 26 +-- src/mame/machine/octo_kbd.cpp | 10 +- src/mame/machine/octo_kbd.h | 12 +- src/mame/machine/ondra.cpp | 4 +- src/mame/machine/opwolf.cpp | 30 +-- src/mame/machine/orion.cpp | 8 +- src/mame/machine/osborne1.cpp | 36 ++-- src/mame/machine/pacplus.cpp | 10 +- src/mame/machine/partner.cpp | 14 +- src/mame/machine/pc1251.cpp | 10 +- src/mame/machine/pc1350.cpp | 4 +- src/mame/machine/pc1401.cpp | 6 +- src/mame/machine/pc1403.cpp | 10 +- src/mame/machine/pc1512kb.cpp | 6 +- src/mame/machine/pc1512kb.h | 2 +- src/mame/machine/pc9801_118.cpp | 4 +- src/mame/machine/pc9801_118.h | 6 +- src/mame/machine/pc9801_26.cpp | 4 +- src/mame/machine/pc9801_26.h | 4 +- src/mame/machine/pc9801_86.cpp | 10 +- src/mame/machine/pc9801_86.h | 10 +- src/mame/machine/pc9801_cbus.cpp | 2 +- src/mame/machine/pc9801_cbus.h | 2 +- src/mame/machine/pc9801_cd.cpp | 2 +- src/mame/machine/pc9801_cd.h | 2 +- src/mame/machine/pc9801_kbd.cpp | 6 +- src/mame/machine/pc9801_kbd.h | 8 +- src/mame/machine/pcd_kbd.cpp | 2 +- src/mame/machine/pcd_kbd.h | 4 +- src/mame/machine/pce.cpp | 6 +- src/mame/machine/pce220_ser.cpp | 8 +- src/mame/machine/pce220_ser.h | 40 ++-- src/mame/machine/pce_cd.cpp | 60 +++--- src/mame/machine/pce_cd.h | 70 +++---- src/mame/machine/pcecommn.cpp | 6 +- src/mame/machine/pcecommn.h | 6 +- src/mame/machine/pcshare.cpp | 2 +- src/mame/machine/pcshare.h | 4 +- src/mame/machine/pecom.cpp | 8 +- src/mame/machine/pgmcrypt.cpp | 198 +++++++++---------- src/mame/machine/pgmprot_igs025_igs012.cpp | 16 +- src/mame/machine/pgmprot_igs025_igs022.cpp | 12 +- src/mame/machine/pgmprot_igs025_igs022.h | 2 +- src/mame/machine/pgmprot_igs025_igs028.cpp | 2 +- src/mame/machine/pgmprot_igs025_igs028.h | 2 +- src/mame/machine/pgmprot_igs027a_type1.cpp | 84 ++++---- src/mame/machine/pgmprot_igs027a_type1.h | 50 ++--- src/mame/machine/pgmprot_igs027a_type2.cpp | 10 +- src/mame/machine/pgmprot_igs027a_type2.h | 8 +- src/mame/machine/pgmprot_igs027a_type3.cpp | 56 +++--- src/mame/machine/pgmprot_igs027a_type3.h | 16 +- src/mame/machine/pgmprot_orlegend.h | 10 +- src/mame/machine/pk8020.cpp | 44 ++--- src/mame/machine/playch10.cpp | 54 ++--- src/mame/machine/pmd85.cpp | 26 +-- src/mame/machine/poly88.cpp | 22 +-- src/mame/machine/pp01.cpp | 16 +- src/mame/machine/primo.cpp | 16 +- src/mame/machine/prof80mmu.cpp | 2 +- src/mame/machine/prof80mmu.h | 4 +- src/mame/machine/psion_pack.cpp | 16 +- src/mame/machine/psion_pack.h | 24 +-- src/mame/machine/psxcd.cpp | 54 ++--- src/mame/machine/psxcd.h | 50 ++--- src/mame/machine/pxa255.h | 164 +++++++-------- src/mame/machine/qimi.cpp | 4 +- src/mame/machine/qimi.h | 6 +- src/mame/machine/qix.cpp | 18 +- src/mame/machine/qx10kbd.cpp | 6 +- src/mame/machine/qx10kbd.h | 6 +- src/mame/machine/r2crypt.cpp | 32 +-- src/mame/machine/radio86.cpp | 18 +- src/mame/machine/rbisland.cpp | 84 ++++---- src/mame/machine/rm380z.cpp | 6 +- src/mame/machine/rmnimbus.cpp | 172 ++++++++-------- src/mame/machine/rmnkbd.cpp | 8 +- src/mame/machine/rmnkbd.h | 8 +- src/mame/machine/rx01.cpp | 10 +- src/mame/machine/rx01.h | 22 +-- src/mame/machine/s32comm.cpp | 8 +- src/mame/machine/s32comm.h | 26 +-- src/mame/machine/samcoupe.cpp | 12 +- src/mame/machine/saturn.cpp | 32 +-- src/mame/machine/scramble.cpp | 72 +++---- src/mame/machine/sec.cpp | 26 +-- src/mame/machine/sec.h | 40 ++-- src/mame/machine/segabb.cpp | 2 +- src/mame/machine/segabb.h | 2 +- src/mame/machine/segacrp2_device.cpp | 58 +++--- src/mame/machine/segacrp2_device.h | 20 +- src/mame/machine/segacrpt_device.cpp | 116 +++++------ src/mame/machine/segacrpt_device.h | 62 +++--- src/mame/machine/segag80.cpp | 38 ++-- src/mame/machine/segag80.h | 2 +- src/mame/machine/segaic16.cpp | 68 +++---- src/mame/machine/segaic16.h | 58 +++--- src/mame/machine/segas32.cpp | 16 +- src/mame/machine/seibucop/seibucop.cpp | 64 +++--- src/mame/machine/seibucop/seibucop.h | 166 ++++++++-------- src/mame/machine/seibucop/seibucop_cmd.hxx | 90 ++++----- src/mame/machine/seibucop/seibucop_dma.hxx | 22 +-- src/mame/machine/seibuspi.cpp | 36 ++-- src/mame/machine/seibuspi.h | 12 +- src/mame/machine/seicop.cpp | 14 +- src/mame/machine/seicop.h | 12 +- src/mame/machine/sgi.cpp | 2 +- src/mame/machine/sgi.h | 84 ++++---- src/mame/machine/simpsons.cpp | 2 +- src/mame/machine/slapfght.cpp | 14 +- src/mame/machine/slapstic.cpp | 6 +- src/mame/machine/sms.cpp | 76 +++---- src/mame/machine/snes.cpp | 72 +++---- src/mame/machine/snescx4.cpp | 54 ++--- src/mame/machine/snescx4.h | 14 +- src/mame/machine/sorcerer.cpp | 24 +-- src/mame/machine/spec_snqk.cpp | 114 +++++------ src/mame/machine/spec_snqk.h | 30 +-- src/mame/machine/special.cpp | 22 +-- src/mame/machine/st0016.cpp | 36 ++-- src/mame/machine/st0016.h | 24 +-- src/mame/machine/starwars.cpp | 12 +- src/mame/machine/stfight.cpp | 14 +- src/mame/machine/stvprot.cpp | 12 +- src/mame/machine/subsino.cpp | 24 +-- src/mame/machine/subsino.h | 18 +- src/mame/machine/super80.cpp | 16 +- src/mame/machine/swim.cpp | 12 +- src/mame/machine/swim.h | 18 +- src/mame/machine/swtpc09.cpp | 18 +- src/mame/machine/tait8741.cpp | 12 +- src/mame/machine/tait8741.h | 50 ++--- src/mame/machine/taitoio.cpp | 6 +- src/mame/machine/taitoio.h | 14 +- src/mame/machine/tandy2kb.cpp | 4 +- src/mame/machine/tandy2kb.h | 4 +- src/mame/machine/tatsumi.cpp | 6 +- src/mame/machine/tecmosys.cpp | 20 +- src/mame/machine/teleprinter.cpp | 12 +- src/mame/machine/teleprinter.h | 8 +- src/mame/machine/theglobp.cpp | 10 +- src/mame/machine/thomflop.cpp | 132 ++++++------- src/mame/machine/thomflop.h | 4 +- src/mame/machine/thomson.cpp | 148 +++++++------- src/mame/machine/ti85.cpp | 18 +- src/mame/machine/ticket.cpp | 4 +- src/mame/machine/ticket.h | 28 +-- src/mame/machine/tnzs.cpp | 6 +- src/mame/machine/toaplan1.cpp | 8 +- src/mame/machine/trs80.cpp | 26 +-- src/mame/machine/trs80m2kb.cpp | 4 +- src/mame/machine/trs80m2kb.h | 4 +- src/mame/machine/twincobr.cpp | 4 +- src/mame/machine/tx1.cpp | 72 +++---- src/mame/machine/upd65031.cpp | 10 +- src/mame/machine/upd65031.h | 32 +-- src/mame/machine/ut88.cpp | 12 +- src/mame/machine/v1050kb.cpp | 4 +- src/mame/machine/v1050kb.h | 4 +- src/mame/machine/vector06.cpp | 16 +- src/mame/machine/vectrex.cpp | 2 +- src/mame/machine/victor9k_fdc.cpp | 16 +- src/mame/machine/victor9k_fdc.h | 32 +-- src/mame/machine/victor9kb.cpp | 4 +- src/mame/machine/victor9kb.h | 6 +- src/mame/machine/volfied.cpp | 40 ++-- src/mame/machine/vsnes.cpp | 58 +++--- src/mame/machine/vtech2.cpp | 8 +- src/mame/machine/wangpckb.cpp | 2 +- src/mame/machine/wangpckb.h | 4 +- src/mame/machine/williams.cpp | 6 +- src/mame/machine/wpc.cpp | 4 +- src/mame/machine/wpc.h | 34 ++-- src/mame/machine/wpc_lamp.cpp | 4 +- src/mame/machine/wpc_lamp.h | 6 +- src/mame/machine/wpc_out.cpp | 6 +- src/mame/machine/wpc_out.h | 6 +- src/mame/machine/wpc_pic.cpp | 12 +- src/mame/machine/wpc_pic.h | 4 +- src/mame/machine/wpc_shift.cpp | 2 +- src/mame/machine/wpc_shift.h | 6 +- src/mame/machine/wswan.cpp | 18 +- src/mame/machine/x1.cpp | 2 +- src/mame/machine/x68k_hdc.cpp | 2 +- src/mame/machine/x68k_hdc.h | 2 +- src/mame/machine/x68k_kbd.cpp | 10 +- src/mame/machine/x68k_kbd.h | 12 +- src/mame/machine/x820kb.cpp | 4 +- src/mame/machine/x820kb.h | 8 +- src/mame/machine/xbox.cpp | 86 ++++---- src/mame/machine/xbox_usb.cpp | 94 ++++----- src/mame/machine/z80bin.cpp | 8 +- src/mame/machine/z80bin.h | 2 +- src/mame/machine/z80ne.cpp | 32 +-- src/mame/machine/zndip.cpp | 2 +- src/mame/machine/zndip.h | 4 +- src/mame/machine/zs01.cpp | 58 +++--- src/mame/machine/zs01.h | 24 +-- src/mame/machine/zx.cpp | 20 +- src/mame/machine/zx8302.cpp | 10 +- src/mame/machine/zx8302.h | 18 +- 569 files changed, 7100 insertions(+), 7100 deletions(-) (limited to 'src/mame/machine') diff --git a/src/mame/machine/315-5838_317-0229_comp.cpp b/src/mame/machine/315-5838_317-0229_comp.cpp index 9c340e7cc38..a203d873499 100644 --- a/src/mame/machine/315-5838_317-0229_comp.cpp +++ b/src/mame/machine/315-5838_317-0229_comp.cpp @@ -52,7 +52,7 @@ extern const device_type SEGA315_5838_COMP = &device_creatorbase(); -// UINT32 retvalue = 0xffff; +// uint32_t *fake0 = (uint32_t*)memregion( ":fake0" )->base(); +// uint32_t retvalue = 0xffff; switch (m_srcoffset) { @@ -115,7 +115,7 @@ UINT32 sega_315_5838_comp_device::genericdecathlt_prot_r(UINT32 mem_mask, int ch m_decathlt_lastcount++; - UINT32 tempdata = 0; + uint32_t tempdata = 0; tempdata |= m_channel[channel].m_read_ch(m_srcoffset) << 0; m_srcoffset++; tempdata |= m_channel[channel].m_read_ch(m_srcoffset) << 16; @@ -186,7 +186,7 @@ UINT32 sega_315_5838_comp_device::genericdecathlt_prot_r(UINT32 mem_mask, int ch return 0xffffffff; } -void sega_315_5838_comp_device::set_prot_addr(UINT32 data, UINT32 mem_mask, int channel) +void sega_315_5838_comp_device::set_prot_addr(uint32_t data, uint32_t mem_mask, int channel) { // printf("set_prot_addr\n"); COMBINE_DATA(&m_srcoffset); @@ -232,7 +232,7 @@ void sega_315_5838_comp_device::set_prot_addr(UINT32 data, UINT32 mem_mask, int } -void sega_315_5838_comp_device::set_upload_mode(UINT16 data, int channel) +void sega_315_5838_comp_device::set_upload_mode(uint16_t data, int channel) { if ((data == 0x8000) || (data == 0x0000)) { @@ -251,7 +251,7 @@ void sega_315_5838_comp_device::set_upload_mode(UINT16 data, int channel) } } -void sega_315_5838_comp_device::upload_table_data(UINT16 data, int channel) +void sega_315_5838_comp_device::upload_table_data(uint16_t data, int channel) { if (m_decathlt_prot_uploadmode == 1) { @@ -281,7 +281,7 @@ void sega_315_5838_comp_device::upload_table_data(UINT16 data, int channel) } } -void sega_315_5838_comp_device::write_prot_data(UINT32 data, UINT32 mem_mask, int channel, int rev_words) +void sega_315_5838_comp_device::write_prot_data(uint32_t data, uint32_t mem_mask, int channel, int rev_words) { if (mem_mask==0xffff0000) { @@ -327,7 +327,7 @@ void sega_315_5838_comp_device::install_decathlt_protection() READ32_MEMBER(sega_315_5838_comp_device::doa_prot_r) { - UINT32 retval = 0; + uint32_t retval = 0; if (offset == 0x7ff8/4) { diff --git a/src/mame/machine/315-5838_317-0229_comp.h b/src/mame/machine/315-5838_317-0229_comp.h index cc66fe1c137..1d741c73ac3 100644 --- a/src/mame/machine/315-5838_317-0229_comp.h +++ b/src/mame/machine/315-5838_317-0229_comp.h @@ -8,7 +8,7 @@ #define CHANNELS 2 -typedef device_delegate sega_dec_read_delegate; +typedef device_delegate sega_dec_read_delegate; extern const device_type SEGA315_5838_COMP; @@ -22,7 +22,7 @@ class sega_315_5838_comp_device : public device_t { public: // construction/destruction - sega_315_5838_comp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5838_comp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); sega_dec_read_delegate m_read_ch2; @@ -40,13 +40,13 @@ public: DECLARE_READ32_MEMBER(decathlt_prot1_r); DECLARE_READ32_MEMBER(decathlt_prot2_r); - UINT32 genericdecathlt_prot_r(UINT32 mem_mask, int channel); + uint32_t genericdecathlt_prot_r(uint32_t mem_mask, int channel); - void write_prot_data(UINT32 data, UINT32 mem_mask, int channel, int rev_words); + void write_prot_data(uint32_t data, uint32_t mem_mask, int channel, int rev_words); - void upload_table_data(UINT16 data, int channel); - void set_upload_mode(UINT16 data, int channel); - void set_prot_addr(UINT32 data, UINT32 mem_mask, int channel); + void upload_table_data(uint16_t data, int channel); + void set_upload_mode(uint16_t data, int channel); + void set_prot_addr(uint32_t data, uint32_t mem_mask, int channel); DECLARE_WRITE32_MEMBER(decathlt_prot1_w_doa); DECLARE_WRITE32_MEMBER(decathlt_prot1_w); @@ -65,14 +65,14 @@ protected: virtual void device_reset() override; private: - UINT16 m_decathlt_prottable1[24]; - UINT16 m_decathlt_dictionaryy[128]; + uint16_t m_decathlt_prottable1[24]; + uint16_t m_decathlt_dictionaryy[128]; - UINT32 m_srcoffset; + uint32_t m_srcoffset; - UINT32 m_decathlt_lastcount; - UINT32 m_decathlt_prot_uploadmode; - UINT32 m_decathlt_prot_uploadoffset; + uint32_t m_decathlt_lastcount; + uint32_t m_decathlt_prot_uploadmode; + uint32_t m_decathlt_prot_uploadoffset; // Decathlete specific variables and functions (see machine/decathlt.c) @@ -89,7 +89,7 @@ private: // Doa int m_protstate; int m_prot_a; - UINT8 m_protram[256]; + uint8_t m_protram[256]; }; #endif diff --git a/src/mame/machine/315-5881_crypt.cpp b/src/mame/machine/315-5881_crypt.cpp index 9d7545b57ee..a3da4752d76 100644 --- a/src/mame/machine/315-5881_crypt.cpp +++ b/src/mame/machine/315-5881_crypt.cpp @@ -20,7 +20,7 @@ extern const device_type SEGA315_5881_CRYPT = &device_creator; -sega_315_5881_crypt_device::sega_315_5881_crypt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_315_5881_crypt_device::sega_315_5881_crypt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA315_5881_CRYPT, "Sega 315-5881 Encryption", tag, owner, clock, "sega315_5881", __FILE__) { } @@ -29,9 +29,9 @@ sega_315_5881_crypt_device::sega_315_5881_crypt_device(const machine_config &mco void sega_315_5881_crypt_device::device_start() { - buffer = std::make_unique(BUFFER_SIZE); - line_buffer = std::make_unique(LINE_SIZE); - line_buffer_prev = std::make_unique(LINE_SIZE); + buffer = std::make_unique(BUFFER_SIZE); + line_buffer = std::make_unique(LINE_SIZE); + line_buffer_prev = std::make_unique(LINE_SIZE); m_read.bind_relative_to(*owner()); @@ -75,7 +75,7 @@ void sega_315_5881_crypt_device::device_reset() buffer_bit = 0; } -UINT16 sega_315_5881_crypt_device::do_decrypt(UINT8 *&base) +uint16_t sega_315_5881_crypt_device::do_decrypt(uint8_t *&base) { if(!enc_ready) enc_start(); @@ -101,13 +101,13 @@ UINT16 sega_315_5881_crypt_device::do_decrypt(UINT8 *&base) return (base[0] << 8) | base[1]; } -void sega_315_5881_crypt_device::set_addr_low(UINT16 data) +void sega_315_5881_crypt_device::set_addr_low(uint16_t data) { prot_cur_address = (prot_cur_address & 0xffff0000) | data; enc_ready = false; } -void sega_315_5881_crypt_device::set_addr_high(UINT16 data) +void sega_315_5881_crypt_device::set_addr_high(uint16_t data) { prot_cur_address = (prot_cur_address & 0x0000ffff) | (data << 16); enc_ready = false; @@ -116,7 +116,7 @@ void sega_315_5881_crypt_device::set_addr_high(UINT16 data) buffer_bit2 = 15; } -void sega_315_5881_crypt_device::set_subkey(UINT16 data) +void sega_315_5881_crypt_device::set_subkey(uint16_t data) { subkey = data; enc_ready = false; @@ -536,7 +536,7 @@ const int sega_315_5881_crypt_device::fn2_sequence_key_scheduling[16] = {77,34,8 const int sega_315_5881_crypt_device::fn2_middle_result_scheduling[16] = {1,10,44,68,74,78,81,95,2,4,30,40,41,51,53,58}; -int sega_315_5881_crypt_device::feistel_function(int input, const struct sbox *sboxes, UINT32 subkeys) +int sega_315_5881_crypt_device::feistel_function(int input, const struct sbox *sboxes, uint32_t subkeys) { int k,m; int aux; @@ -566,18 +566,18 @@ noticing that the weak key-scheduling would allow to create some pregenerated lo of the function. Even so, it would still be pretty slow, so caching techniques could be a wiser option here. **************************/ -UINT16 sega_315_5881_crypt_device::block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data) +uint16_t sega_315_5881_crypt_device::block_decrypt(uint32_t game_key, uint16_t sequence_key, uint16_t counter, uint16_t data) { int j; int aux, aux2; int A, B; int middle_result; - UINT32 fn1_subkeys[4]; - UINT32 fn2_subkeys[4]; + uint32_t fn1_subkeys[4]; + uint32_t fn2_subkeys[4]; /* Game-key scheduling; this could be done just once per game at initialization time */ - memset(fn1_subkeys, 0, sizeof(UINT32) * 4); - memset(fn2_subkeys, 0, sizeof(UINT32) * 4); + memset(fn1_subkeys, 0, sizeof(uint32_t) * 4); + memset(fn2_subkeys, 0, sizeof(uint32_t) * 4); for (j = 0; j < FN1GK; ++j) { if (BIT(game_key, fn1_game_key_scheduling[j][0]) != 0) { @@ -670,14 +670,14 @@ UINT16 sega_315_5881_crypt_device::block_decrypt(UINT32 game_key, UINT16 sequenc } -UINT16 sega_315_5881_crypt_device::get_decrypted_16() +uint16_t sega_315_5881_crypt_device::get_decrypted_16() { - UINT16 enc; + uint16_t enc; enc = m_read(prot_cur_address); - UINT16 dec = block_decrypt(key, subkey, prot_cur_address, enc); - UINT16 res = (dec & 3) | (dec_hist & 0xfffc); + uint16_t dec = block_decrypt(key, subkey, prot_cur_address, enc); + uint16_t res = (dec & 3) | (dec_hist & 0xfffc); dec_hist = dec; prot_cur_address ++; @@ -733,7 +733,7 @@ void sega_315_5881_crypt_device::enc_fill() { assert(buffer_pos == BUFFER_SIZE); for(int i = 0; i != BUFFER_SIZE; i+=2) { - UINT16 val = get_decrypted_16(); + uint16_t val = get_decrypted_16(); buffer[i] = val; buffer[i+1] = val >> 8; block_pos+=2; @@ -767,7 +767,7 @@ void sega_315_5881_crypt_device::enc_fill() count = ccc + 1 11111111 - empty node */ -const UINT8 sega_315_5881_crypt_device::trees[9][2][32] = { +const uint8_t sega_315_5881_crypt_device::trees[9][2][32] = { { {0x01,0x10,0x0f,0x05,0xc4,0x13,0x87,0x0a,0xcc,0x81,0xce,0x0c,0x86,0x0e,0x84,0xc2, 0x11,0xc1,0xc3,0xcf,0x15,0xc8,0xcd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, @@ -857,8 +857,8 @@ int sega_315_5881_crypt_device::get_compressed_bit() void sega_315_5881_crypt_device::line_fill() { assert(line_buffer_pos == line_buffer_size); - UINT8 *lp = line_buffer.get(); - UINT8 *lc = line_buffer_prev.get(); + uint8_t *lp = line_buffer.get(); + uint8_t *lc = line_buffer_prev.get(); line_buffer.swap(line_buffer_prev); @@ -871,7 +871,7 @@ void sega_315_5881_crypt_device::line_fill() int slot = i ? i < line_buffer_size - 7 ? 1 : (i & 7) + 1 : 0; - UINT32 tmp = 0; + uint32_t tmp = 0; while (!(tmp&0x80)) if(get_compressed_bit()) tmp = trees[slot][1][tmp]; @@ -892,7 +892,7 @@ void sega_315_5881_crypt_device::line_fill() } else { // Get a byte in the stream and write n times - UINT8 byte; + uint8_t byte; byte = get_compressed_bit() << 1; byte = (byte | get_compressed_bit()) << 1; byte = (byte | get_compressed_bit()) << 1; diff --git a/src/mame/machine/315-5881_crypt.h b/src/mame/machine/315-5881_crypt.h index feacc5ce3e9..109ec4c23b9 100644 --- a/src/mame/machine/315-5881_crypt.h +++ b/src/mame/machine/315-5881_crypt.h @@ -6,7 +6,7 @@ #ifndef __SEGA315_5881_CRYPT__ #define __SEGA315_5881_CRYPT__ -typedef device_delegate sega_m2_read_delegate; +typedef device_delegate sega_m2_read_delegate; extern const device_type SEGA315_5881_CRYPT; @@ -18,13 +18,13 @@ class sega_315_5881_crypt_device : public device_t { public: // construction/destruction - sega_315_5881_crypt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5881_crypt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT16 do_decrypt(UINT8 *&base); - void set_addr_low(UINT16 data); - void set_addr_high(UINT16 data); - void set_subkey(UINT16 data); + uint16_t do_decrypt(uint8_t *&base); + void set_addr_low(uint16_t data); + void set_addr_high(uint16_t data); + void set_subkey(uint16_t data); sega_m2_read_delegate m_read; @@ -46,20 +46,20 @@ private: FLAG_COMPRESSED = 0x20000 }; - UINT32 key; + uint32_t key; - std::unique_ptr buffer; - std::unique_ptr line_buffer; - std::unique_ptr line_buffer_prev; - UINT32 prot_cur_address; - UINT16 subkey, dec_hist; - UINT32 dec_header; + std::unique_ptr buffer; + std::unique_ptr line_buffer; + std::unique_ptr line_buffer_prev; + uint32_t prot_cur_address; + uint16_t subkey, dec_hist; + uint32_t dec_header; bool enc_ready; int buffer_pos, line_buffer_pos, line_buffer_size, buffer_bit, buffer_bit2; - UINT8 buffer2[2]; - UINT16 buffer2a; + uint8_t buffer2[2]; + uint16_t buffer2a; int block_size; int block_pos; @@ -67,7 +67,7 @@ private: int done_compression; struct sbox { - UINT8 table[64]; + uint8_t table[64]; int inputs[6]; // positions of the inputs bits, -1 means no input except from key int outputs[2]; // positions of the output bits }; @@ -83,12 +83,12 @@ private: static const int fn2_sequence_key_scheduling[16]; static const int fn2_middle_result_scheduling[16]; - static const UINT8 trees[9][2][32]; + static const uint8_t trees[9][2][32]; - int feistel_function(int input, const struct sbox *sboxes, UINT32 subkeys); - UINT16 block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data); + int feistel_function(int input, const struct sbox *sboxes, uint32_t subkeys); + uint16_t block_decrypt(uint32_t game_key, uint16_t sequence_key, uint16_t counter, uint16_t data); - UINT16 get_decrypted_16(); + uint16_t get_decrypted_16(); int get_compressed_bit(); void enc_start(); diff --git a/src/mame/machine/315_5296.cpp b/src/mame/machine/315_5296.cpp index 34aa0da1d22..310a0bbd820 100644 --- a/src/mame/machine/315_5296.cpp +++ b/src/mame/machine/315_5296.cpp @@ -31,7 +31,7 @@ const device_type SEGA_315_5296 = &device_creator; // sega_315_5296_device - constructor //------------------------------------------------- -sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_315_5296, "Sega 315-5296 I/O", tag, owner, clock, "315_5296", __FILE__), m_in_pa_cb(*this), m_in_pb_cb(*this), diff --git a/src/mame/machine/315_5296.h b/src/mame/machine/315_5296.h index b28b465b573..0e2c2229611 100644 --- a/src/mame/machine/315_5296.h +++ b/src/mame/machine/315_5296.h @@ -72,7 +72,7 @@ class sega_315_5296_device : public device_t { public: - sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } @@ -100,7 +100,7 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - UINT8 debug_peek_output(offs_t offset) { return m_output_latch[offset & 7]; } + uint8_t debug_peek_output(offs_t offset) { return m_output_latch[offset & 7]; } protected: // device-level overrides @@ -134,9 +134,9 @@ private: devcb_write8 *m_out_port_cb[8]; devcb_write_line *m_out_cnt_cb[3]; - UINT8 m_output_latch[8]; - UINT8 m_cnt; - UINT8 m_dir; + uint8_t m_output_latch[8]; + uint8_t m_cnt; + uint8_t m_dir; }; // device type definition diff --git a/src/mame/machine/3do.cpp b/src/mame/machine/3do.cpp index 6a9d5e23b7a..9f1ef4208da 100644 --- a/src/mame/machine/3do.cpp +++ b/src/mame/machine/3do.cpp @@ -102,7 +102,7 @@ IRQ1 0x00000001 DMA Player bus */ -void _3do_state::m_3do_request_fiq(UINT32 irq_req, UINT8 type) +void _3do_state::m_3do_request_fiq(uint32_t irq_req, uint8_t type) { if(type) m_clio.irq1 |= irq_req; @@ -130,8 +130,8 @@ TIMER_DEVICE_CALLBACK_MEMBER( _3do_state::timer_x16_cb ) --x- reload flag ---x decrement flag (enable) */ - UINT8 timer_flag; - UINT8 carry_val; + uint8_t timer_flag; + uint8_t carry_val; carry_val = 1; @@ -197,7 +197,7 @@ WRITE8_MEMBER(_3do_state::_3do_nvarea_w) { m_nvmem[offset] = data; } */ READ32_MEMBER(_3do_state::_3do_slow2_r){ - UINT32 data = 0; + uint32_t data = 0; logerror( "%08X: UNK_318 read offset = %08X\n", m_maincpu->pc(), offset ); @@ -235,8 +235,8 @@ WRITE32_MEMBER(_3do_state::_3do_slow2_w) READ32_MEMBER(_3do_state::_3do_svf_r) { - UINT32 addr = ( offset & ( 0x07fc / 4 ) ) << 9; - UINT32 *p = m_vram + addr; + uint32_t addr = ( offset & ( 0x07fc / 4 ) ) << 9; + uint32_t *p = m_vram + addr; logerror( "%08X: SVF read offset = %08X\n", m_maincpu->pc(), offset*4 ); @@ -260,8 +260,8 @@ READ32_MEMBER(_3do_state::_3do_svf_r) WRITE32_MEMBER(_3do_state::_3do_svf_w) { - UINT32 addr = ( offset & ( 0x07fc / 4 ) ) << 9; - UINT32 *p = m_vram + addr; + uint32_t addr = ( offset & ( 0x07fc / 4 ) ) << 9; + uint32_t *p = m_vram + addr; logerror( "%08X: SVF write offset = %08X, data = %08X, mask = %08X\n", m_maincpu->pc(), offset*4, data, mem_mask ); @@ -269,7 +269,7 @@ WRITE32_MEMBER(_3do_state::_3do_svf_w) { case 0x0000/4: /* SPORT transfer */ { - UINT32 keep_bits = data ^ 0xffffffff; + uint32_t keep_bits = data ^ 0xffffffff; for ( int i = 0; i < 512; i++ ) { @@ -282,8 +282,8 @@ WRITE32_MEMBER(_3do_state::_3do_svf_w) break; case 0x4000/4: /* Flash write */ { - UINT32 keep_bits = data ^ 0xffffffff; - UINT32 new_bits = m_svf.color & data; + uint32_t keep_bits = data ^ 0xffffffff; + uint32_t new_bits = m_svf.color & data; for ( int i = 0; i < 512; i++ ) { @@ -663,7 +663,7 @@ READ32_MEMBER(_3do_state::_3do_clio_r) /* TODO: for debug, to be removed once that we write the CPU core */ if(offset >= 0x3800/4 && offset <= 0x39ff/4) { - UINT32 res = 0; + uint32_t res = 0; offset &= (0x1ff/4); res = (m_dspp.EO[(offset<<1)+0] << 16); res |= (m_dspp.EO[(offset<<1)+1] & 0xffff); @@ -672,7 +672,7 @@ READ32_MEMBER(_3do_state::_3do_clio_r) if(offset >= 0x3c00/4 && offset <= 0x3fff/4) { - UINT16 res; + uint16_t res; offset &= (0x3ff/4); res = m_dspp.EO[offset] & 0xffff; return res; @@ -926,16 +926,16 @@ WRITE32_MEMBER(_3do_state::_3do_clio_w) break; case 0x0200/4: - m_clio.timer_ctrl |= (UINT64)data; + m_clio.timer_ctrl |= (uint64_t)data; break; case 0x0204/4: - m_clio.timer_ctrl &= ~(UINT64)data; + m_clio.timer_ctrl &= ~(uint64_t)data; break; case 0x0208/4: - m_clio.timer_ctrl |= ((UINT64)data << 32); + m_clio.timer_ctrl |= ((uint64_t)data << 32); break; case 0x020c/4: - m_clio.timer_ctrl &= ~((UINT64)data << 32); + m_clio.timer_ctrl &= ~((uint64_t)data << 32); break; case 0x0220/4: @@ -1036,20 +1036,20 @@ VIDEO_START_MEMBER(_3do_state,_3do) } -UINT32 _3do_state::screen_update__3do(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _3do_state::screen_update__3do(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *source_p = m_vram + 0x1c0000 / 4; + uint32_t *source_p = m_vram + 0x1c0000 / 4; for ( int y = 0; y < 120; y++ ) { - UINT32 *dest_p0 = &bitmap.pix32(22 + y * 2, 254 ); - UINT32 *dest_p1 = &bitmap.pix32(22 + y * 2 + 1, 254 ); + uint32_t *dest_p0 = &bitmap.pix32(22 + y * 2, 254 ); + uint32_t *dest_p1 = &bitmap.pix32(22 + y * 2 + 1, 254 ); for ( int x = 0; x < 320; x++ ) { /* Every dword contains two pixels, upper word is top pixel, lower is bottom. */ - UINT32 lower = *source_p & 0xffff; - UINT32 upper = ( *source_p >> 16 ) & 0xffff; + uint32_t lower = *source_p & 0xffff; + uint32_t upper = ( *source_p >> 16 ) & 0xffff; int r, g, b; /* Format is RGB555 */ @@ -1112,13 +1112,13 @@ void _3do_state::m_3do_clio_init( screen_device *screen ) m_clio.revision = 0x02022000 /* 0x04000000 */; m_clio.unclerev = 0x03800000; m_clio.expctl = 0x80; /* ARM has the expansion bus */ - m_dspp.N = std::make_unique(0x800 ); - m_dspp.EI = std::make_unique(0x400 ); - m_dspp.EO = std::make_unique(0x400 ); + m_dspp.N = std::make_unique(0x800 ); + m_dspp.EI = std::make_unique(0x400 ); + m_dspp.EO = std::make_unique(0x400 ); - memset(m_dspp.N.get(), 0, sizeof(UINT16) * 0x400); - memset(m_dspp.EI.get(), 0, sizeof(UINT16) * 0x400); - memset(m_dspp.EO.get(), 0, sizeof(UINT16) * 0x400); + memset(m_dspp.N.get(), 0, sizeof(uint16_t) * 0x400); + memset(m_dspp.EI.get(), 0, sizeof(uint16_t) * 0x400); + memset(m_dspp.EO.get(), 0, sizeof(uint16_t) * 0x400); save_pointer(NAME(m_dspp.N.get()), 0x800); save_pointer(NAME(m_dspp.EI.get()), 0x400); diff --git a/src/mame/machine/6883sam.cpp b/src/mame/machine/6883sam.cpp index dca01ed0a31..ce07281231f 100644 --- a/src/mame/machine/6883sam.cpp +++ b/src/mame/machine/6883sam.cpp @@ -70,7 +70,7 @@ const device_type SAM6883 = &device_creator; // ctor //------------------------------------------------- -sam6883_device::sam6883_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sam6883_device::sam6883_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SAM6883, "SAM6883", tag, owner, clock, "sam6883", __FILE__), m_cpu_tag(nullptr), m_cpu_space_ref(AS_PROGRAM), @@ -119,7 +119,7 @@ void sam6883_device::device_start() // configure_bank - bank configuration //------------------------------------------------- -void sam6883_device::configure_bank(int bank, UINT8 *memory, UINT32 memory_size, bool is_read_only) +void sam6883_device::configure_bank(int bank, uint8_t *memory, uint32_t memory_size, bool is_read_only) { configure_bank(bank, memory, memory_size, is_read_only, read8_delegate(), write8_delegate()); } @@ -141,7 +141,7 @@ void sam6883_device::configure_bank(int bank, read8_delegate rhandler, write8_de // configure_bank - bank configuration //------------------------------------------------- -void sam6883_device::configure_bank(int bank, UINT8 *memory, UINT32 memory_size, bool is_read_only, read8_delegate rhandler, write8_delegate whandler) +void sam6883_device::configure_bank(int bank, uint8_t *memory, uint32_t memory_size, bool is_read_only, read8_delegate rhandler, write8_delegate whandler) { assert((bank >= 0) && (bank < ARRAY_LENGTH(m_banks))); m_banks[bank].m_memory = memory; @@ -276,7 +276,7 @@ void sam6883_device::update_memory(void) else { // ROM/RAM - UINT16 ram_base = (m_sam_state & SAM_STATE_P1) ? 0x8000 : 0x0000; + uint16_t ram_base = (m_sam_state & SAM_STATE_P1) ? 0x8000 : 0x0000; m_space_0000.point(&m_banks[0], ram_base, m_banks[0].m_memory_size); m_counter_mask = 0x7FFF; m_counter_or = ram_base; @@ -367,7 +367,7 @@ READ8_MEMBER( sam6883_device::read ) WRITE8_MEMBER( sam6883_device::write ) { /* alter the SAM state */ - UINT16 xorval = alter_sam_state(offset); + uint16_t xorval = alter_sam_state(offset); /* based on the mask, apply effects */ if (xorval & (SAM_STATE_TY|SAM_STATE_M1|SAM_STATE_M0|SAM_STATE_P1)) @@ -445,7 +445,7 @@ WRITE_LINE_MEMBER( sam6883_device::hs_w ) // sam_space::ctor //------------------------------------------------- -template +template sam6883_device::sam_space<_addrstart, _addrend>::sam_space(sam6883_device &owner) : m_owner(owner) { @@ -460,7 +460,7 @@ sam6883_device::sam_space<_addrstart, _addrend>::sam_space(sam6883_device &owner // sam_space::cpu_space //------------------------------------------------- -template +template address_space &sam6883_device::sam_space<_addrstart, _addrend>::cpu_space() const { assert(m_owner.m_cpu_space != nullptr); @@ -473,8 +473,8 @@ address_space &sam6883_device::sam_space<_addrstart, _addrend>::cpu_space() cons // sam_space::point //------------------------------------------------- -template -void sam6883_device::sam_space<_addrstart, _addrend>::point(const sam_bank *bank, UINT16 offset, UINT32 length) +template +void sam6883_device::sam_space<_addrstart, _addrend>::point(const sam_bank *bank, uint16_t offset, uint32_t length) { if (LOG_SAM) { @@ -496,8 +496,8 @@ void sam6883_device::sam_space<_addrstart, _addrend>::point(const sam_bank *bank //------------------------------------------------- // sam_space::point_specific_bank //------------------------------------------------- -template -void sam6883_device::sam_space<_addrstart, _addrend>::point_specific_bank(const sam_bank *bank, UINT32 offset, UINT32 length, memory_bank *&memory_bank, UINT32 addrstart, UINT32 addrend, bool is_write) +template +void sam6883_device::sam_space<_addrstart, _addrend>::point_specific_bank(const sam_bank *bank, uint32_t offset, uint32_t length, memory_bank *&memory_bank, uint32_t addrstart, uint32_t addrend, bool is_write) { if (bank->m_memory != nullptr) { @@ -513,7 +513,7 @@ void sam6883_device::sam_space<_addrstart, _addrend>::point_specific_bank(const auto tag = string_format("bank%04X_%c", addrstart, is_write ? 'w' : 'r'); // determine "nop_addrstart" - where the bank ends, and above which is AM_NOP - UINT32 nop_addrstart = (length != ~0) + uint32_t nop_addrstart = (length != ~0) ? std::min(addrend + 1, addrstart + length) : addrend + 1; @@ -552,7 +552,7 @@ void sam6883_device::sam_space<_addrstart, _addrend>::point_specific_bank(const { // this bank uses handlers - first thing's first, assert that we are not doing // any weird stuff with offfsets and lengths - that isn't supported in this path - assert((offset == 0) && (length == (UINT32)~0)); + assert((offset == 0) && (length == (uint32_t)~0)); if (is_write) { diff --git a/src/mame/machine/6883sam.h b/src/mame/machine/6883sam.h index f3a42f1f528..fc0258df3f9 100644 --- a/src/mame/machine/6883sam.h +++ b/src/mame/machine/6883sam.h @@ -35,48 +35,48 @@ public: protected: // SAM state constants - static const UINT16 SAM_STATE_TY = 0x8000; - static const UINT16 SAM_STATE_M1 = 0x4000; - static const UINT16 SAM_STATE_M0 = 0x2000; - static const UINT16 SAM_STATE_R1 = 0x1000; - static const UINT16 SAM_STATE_R0 = 0x0800; - static const UINT16 SAM_STATE_P1 = 0x0400; - static const UINT16 SAM_STATE_F6 = 0x0200; - static const UINT16 SAM_STATE_F5 = 0x0100; - static const UINT16 SAM_STATE_F4 = 0x0080; - static const UINT16 SAM_STATE_F3 = 0x0040; - static const UINT16 SAM_STATE_F2 = 0x0020; - static const UINT16 SAM_STATE_F1 = 0x0010; - static const UINT16 SAM_STATE_F0 = 0x0008; - static const UINT16 SAM_STATE_V2 = 0x0004; - static const UINT16 SAM_STATE_V1 = 0x0002; - static const UINT16 SAM_STATE_V0 = 0x0001; + static const uint16_t SAM_STATE_TY = 0x8000; + static const uint16_t SAM_STATE_M1 = 0x4000; + static const uint16_t SAM_STATE_M0 = 0x2000; + static const uint16_t SAM_STATE_R1 = 0x1000; + static const uint16_t SAM_STATE_R0 = 0x0800; + static const uint16_t SAM_STATE_P1 = 0x0400; + static const uint16_t SAM_STATE_F6 = 0x0200; + static const uint16_t SAM_STATE_F5 = 0x0100; + static const uint16_t SAM_STATE_F4 = 0x0080; + static const uint16_t SAM_STATE_F3 = 0x0040; + static const uint16_t SAM_STATE_F2 = 0x0020; + static const uint16_t SAM_STATE_F1 = 0x0010; + static const uint16_t SAM_STATE_F0 = 0x0008; + static const uint16_t SAM_STATE_V2 = 0x0004; + static const uint16_t SAM_STATE_V1 = 0x0002; + static const uint16_t SAM_STATE_V0 = 0x0001; // incidentals cpu_device * m_cpu; // device state - UINT16 m_sam_state; + uint16_t m_sam_state; - ATTR_FORCE_INLINE UINT16 display_offset(void) + ATTR_FORCE_INLINE uint16_t display_offset(void) { return ((m_sam_state & (SAM_STATE_F0|SAM_STATE_F1|SAM_STATE_F2|SAM_STATE_F3|SAM_STATE_F4|SAM_STATE_F5|SAM_STATE_F6)) / SAM_STATE_F0) << 9; } - ATTR_FORCE_INLINE UINT16 alter_sam_state(offs_t offset) + ATTR_FORCE_INLINE uint16_t alter_sam_state(offs_t offset) { /* determine the mask */ - UINT16 mask = 1 << (offset >> 1); + uint16_t mask = 1 << (offset >> 1); /* determine the new state */ - UINT16 new_state; + uint16_t new_state; if (offset & 0x0001) new_state = m_sam_state | mask; else new_state = m_sam_state & ~mask; /* specify the new state */ - UINT16 xorval = m_sam_state ^ new_state; + uint16_t xorval = m_sam_state ^ new_state; m_sam_state = new_state; return xorval; } @@ -87,7 +87,7 @@ protected: class sam6883_device : public device_t, public sam6883_friend_device { public: - sam6883_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sam6883_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_res_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_res.set_callback(object); } @@ -99,7 +99,7 @@ public: } // called to configure banks - void configure_bank(int bank, UINT8 *memory, UINT32 memory_size, bool is_read_only); + void configure_bank(int bank, uint8_t *memory, uint32_t memory_size, bool is_read_only); void configure_bank(int bank, read8_delegate rhandler, write8_delegate whandler); // typically called by VDG @@ -142,8 +142,8 @@ private: // points to with the S2/S1/S0 output struct sam_bank { - UINT8 * m_memory; - UINT32 m_memory_size; + uint8_t * m_memory; + uint32_t m_memory_size; offs_t m_memory_offset; bool m_memory_read_only; read8_delegate m_rhandler; @@ -152,21 +152,21 @@ private: // represents one of the memory "spaces" (e.g. - $8000-$9FFF) that // can ultimately point to a bank - template + template class sam_space { public: sam_space(sam6883_device &owner); - void point(const sam_bank *bank, UINT16 offset, UINT32 length = ~0); + void point(const sam_bank *bank, uint16_t offset, uint32_t length = ~0); private: sam6883_device & m_owner; memory_bank * m_read_bank; memory_bank * m_write_bank; - UINT32 m_length; + uint32_t m_length; address_space &cpu_space() const; - void point_specific_bank(const sam_bank *bank, UINT32 offset, UINT32 mask, memory_bank *&memory_bank, UINT32 addrstart, UINT32 addrend, bool is_write); + void point_specific_bank(const sam_bank *bank, uint32_t offset, uint32_t mask, memory_bank *&memory_bank, uint32_t addrstart, uint32_t addrend, bool is_write); }; const char * m_cpu_tag; @@ -185,16 +185,16 @@ private: sam_space<0xFF40, 0xFF5F> m_space_FF40; sam_space<0xFF60, 0xFFBF> m_space_FF60; sam_space<0xFFE0, 0xFFFF> m_space_FFE0; - UINT16 m_counter_mask; - UINT16 m_counter_or; + uint16_t m_counter_mask; + uint16_t m_counter_or; // SAM state - UINT16 m_counter; - UINT8 m_counter_xdiv; - UINT8 m_counter_ydiv; + uint16_t m_counter; + uint8_t m_counter_xdiv; + uint8_t m_counter_ydiv; // dummy scratch memory - UINT8 m_dummy[0x8000]; + uint8_t m_dummy[0x8000]; // typically called by CPU DECLARE_READ8_MEMBER( read ); @@ -203,7 +203,7 @@ private: // called when there is a carry out of bit 3 on the counter ATTR_FORCE_INLINE void counter_carry_bit3(void) { - UINT8 x_division; + uint8_t x_division; switch((m_sam_state & (SAM_STATE_V2|SAM_STATE_V1|SAM_STATE_V0)) / SAM_STATE_V0) { case 0x00: x_division = 1; break; @@ -231,7 +231,7 @@ private: // called when there is a carry out of bit 4 on the counter ATTR_FORCE_INLINE void counter_carry_bit4(void) { - UINT8 y_division; + uint8_t y_division; switch((m_sam_state & (SAM_STATE_V2|SAM_STATE_V1|SAM_STATE_V0)) / SAM_STATE_V0) { case 0x00: y_division = 12; break; @@ -255,7 +255,7 @@ private: } // other members - void configure_bank(int bank, UINT8 *memory, UINT32 memory_size, bool is_read_only, read8_delegate rhandler, write8_delegate whandler); + void configure_bank(int bank, uint8_t *memory, uint32_t memory_size, bool is_read_only, read8_delegate rhandler, write8_delegate whandler); void horizontal_sync(void); void update_state(void); void update_memory(void); diff --git a/src/mame/machine/abc1600mac.cpp b/src/mame/machine/abc1600mac.cpp index 0c1642597a6..8a797394157 100644 --- a/src/mame/machine/abc1600mac.cpp +++ b/src/mame/machine/abc1600mac.cpp @@ -108,7 +108,7 @@ const tiny_rom_entry *abc1600_mac_device::device_rom_region() const // abc1600_mac_device - constructor //------------------------------------------------- -abc1600_mac_device::abc1600_mac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc1600_mac_device::abc1600_mac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC1600_MAC, "ABC 1600 MAC", tag, owner, clock, "abc1600mac", __FILE__), device_memory_interface(mconfig, *this), m_space_config("program", ENDIANNESS_LITTLE, 8, 22, 0, *ADDRESS_MAP_NAME(program_map)), @@ -202,7 +202,7 @@ offs_t abc1600_mac_device::get_segment_address(offs_t offset) // get_page_address - //------------------------------------------------- -offs_t abc1600_mac_device::get_page_address(offs_t offset, UINT8 segd) +offs_t abc1600_mac_device::get_page_address(offs_t offset, uint8_t segd) { return ((segd & 0x3f) << 4) | ((offset >> 11) & 0x0f); } @@ -216,11 +216,11 @@ offs_t abc1600_mac_device::translate_address(offs_t offset, int *nonx, int *wp) { // segment offs_t sega = get_segment_address(offset); - UINT8 segd = m_segment_ram[sega]; + uint8_t segd = m_segment_ram[sega]; // page offs_t pga = get_page_address(offset, segd); - UINT16 page_data = m_page_ram[pga]; + uint16_t page_data = m_page_ram[pga]; offs_t virtual_offset = ((page_data & 0x3ff) << 11) | (offset & 0x7ff); @@ -244,7 +244,7 @@ offs_t abc1600_mac_device::translate_address(offs_t offset, int *nonx, int *wp) // read_user_memory - //------------------------------------------------- -UINT8 abc1600_mac_device::read_user_memory(offs_t offset) +uint8_t abc1600_mac_device::read_user_memory(offs_t offset) { int nonx = 0, wp = 0; offs_t virtual_offset = translate_address(offset, &nonx, &wp); @@ -257,7 +257,7 @@ UINT8 abc1600_mac_device::read_user_memory(offs_t offset) // write_user_memory - //------------------------------------------------- -void abc1600_mac_device::write_user_memory(offs_t offset, UINT8 data) +void abc1600_mac_device::write_user_memory(offs_t offset, uint8_t data) { int nonx = 0, wp = 0; offs_t virtual_offset = translate_address(offset, &nonx, &wp); @@ -272,9 +272,9 @@ void abc1600_mac_device::write_user_memory(offs_t offset, UINT8 data) // read_supervisor_memory - //------------------------------------------------- -UINT8 abc1600_mac_device::read_supervisor_memory(address_space &space, offs_t offset) +uint8_t abc1600_mac_device::read_supervisor_memory(address_space &space, offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; if (!A2 && !A1) { @@ -300,7 +300,7 @@ UINT8 abc1600_mac_device::read_supervisor_memory(address_space &space, offs_t of // write_supervisor_memory - //------------------------------------------------- -void abc1600_mac_device::write_supervisor_memory(address_space &space, offs_t offset, UINT8 data) +void abc1600_mac_device::write_supervisor_memory(address_space &space, offs_t offset, uint8_t data) { if (!A2 && !A1) { @@ -326,7 +326,7 @@ void abc1600_mac_device::write_supervisor_memory(address_space &space, offs_t of int abc1600_mac_device::get_fc() { - UINT16 fc = m_cpu->get_fc(); + uint16_t fc = m_cpu->get_fc(); m_ifc2 = !(!(MAGIC || FC0) || FC2); @@ -342,7 +342,7 @@ READ8_MEMBER( abc1600_mac_device::read ) { int fc = get_fc(); - UINT8 data = 0; + uint8_t data = 0; if (!BOOTE && !A19 && !A18 && !A17) { @@ -402,7 +402,7 @@ READ8_MEMBER( abc1600_mac_device::cause_r ) */ - UINT8 data = 0x02; + uint8_t data = 0x02; // DMA status data |= m_cause; @@ -462,7 +462,7 @@ READ8_MEMBER( abc1600_mac_device::segment_r ) */ offs_t sega = get_segment_address(offset); - UINT8 segd = m_segment_ram[sega]; + uint8_t segd = m_segment_ram[sega]; return (READ_MAGIC << 7) | (segd & 0x7f); } @@ -529,13 +529,13 @@ READ8_MEMBER( abc1600_mac_device::page_r ) // segment offs_t sega = get_segment_address(offset); - UINT8 segd = m_segment_ram[sega]; + uint8_t segd = m_segment_ram[sega]; // page offs_t pga = get_page_address(offset, segd); - UINT16 pgd = m_page_ram[pga]; + uint16_t pgd = m_page_ram[pga]; - UINT8 data = 0; + uint8_t data = 0; if (A0) { @@ -584,7 +584,7 @@ WRITE8_MEMBER( abc1600_mac_device::page_w ) // segment offs_t sega = get_segment_address(offset); - UINT8 segd = m_segment_ram[sega]; + uint8_t segd = m_segment_ram[sega]; // page offs_t pga = get_page_address(offset, segd); @@ -606,11 +606,11 @@ WRITE8_MEMBER( abc1600_mac_device::page_w ) // get_dma_address - //------------------------------------------------- -offs_t abc1600_mac_device::get_dma_address(int index, UINT16 offset) +offs_t abc1600_mac_device::get_dma_address(int index, uint16_t offset) { // A0 = DMA15, A1 = BA1, A2 = BA2 - UINT8 dmamap_addr = index | BIT(offset, 15); - UINT8 dmamap = m_dmamap[dmamap_addr]; + uint8_t dmamap_addr = index | BIT(offset, 15); + uint8_t dmamap = m_dmamap[dmamap_addr]; m_cause = (dmamap & 0x1f) << 3; @@ -622,7 +622,7 @@ offs_t abc1600_mac_device::get_dma_address(int index, UINT16 offset) // dma_mreq_r - DMA memory read //------------------------------------------------- -UINT8 abc1600_mac_device::dma_mreq_r(int index, UINT16 offset) +uint8_t abc1600_mac_device::dma_mreq_r(int index, uint16_t offset) { offs_t virtual_offset = get_dma_address(index, offset); @@ -636,7 +636,7 @@ UINT8 abc1600_mac_device::dma_mreq_r(int index, UINT16 offset) // dma_mreq_w - DMA memory write //------------------------------------------------- -void abc1600_mac_device::dma_mreq_w(int index, UINT16 offset, UINT8 data) +void abc1600_mac_device::dma_mreq_w(int index, uint16_t offset, uint8_t data) { offs_t virtual_offset = get_dma_address(index, offset); @@ -650,7 +650,7 @@ void abc1600_mac_device::dma_mreq_w(int index, UINT16 offset, UINT8 data) // dma_iorq_r - DMA I/O read //------------------------------------------------- -UINT8 abc1600_mac_device::dma_iorq_r(int index, UINT16 offset) +uint8_t abc1600_mac_device::dma_iorq_r(int index, uint16_t offset) { offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset); @@ -664,7 +664,7 @@ UINT8 abc1600_mac_device::dma_iorq_r(int index, UINT16 offset) // dma_iorq_w - DMA I/O write //------------------------------------------------- -void abc1600_mac_device::dma_iorq_w(int index, UINT16 offset, UINT8 data) +void abc1600_mac_device::dma_iorq_w(int index, uint16_t offset, uint8_t data) { offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset); diff --git a/src/mame/machine/abc1600mac.h b/src/mame/machine/abc1600mac.h index 207e3d9e5f2..0cd3adfbdfe 100644 --- a/src/mame/machine/abc1600mac.h +++ b/src/mame/machine/abc1600mac.h @@ -46,7 +46,7 @@ class abc1600_mac_device : public device_t, public device_memory_interface { public: - abc1600_mac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc1600_mac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -101,24 +101,24 @@ private: int get_current_task(offs_t offset); offs_t get_segment_address(offs_t offset); - offs_t get_page_address(offs_t offset, UINT8 segd); + offs_t get_page_address(offs_t offset, uint8_t segd); offs_t translate_address(offs_t offset, int *nonx, int *wp); - UINT8 read_user_memory(offs_t offset); - void write_user_memory(offs_t offset, UINT8 data); + uint8_t read_user_memory(offs_t offset); + void write_user_memory(offs_t offset, uint8_t data); int get_fc(); - UINT8 read_supervisor_memory(address_space &space, offs_t offset); - void write_supervisor_memory(address_space &space, offs_t offset, UINT8 data); - offs_t get_dma_address(int index, UINT16 offset); - UINT8 dma_mreq_r(int index, UINT16 offset); - void dma_mreq_w(int index, UINT16 offset, UINT8 data); - UINT8 dma_iorq_r(int index, UINT16 offset); - void dma_iorq_w(int index, UINT16 offset, UINT8 data); + uint8_t read_supervisor_memory(address_space &space, offs_t offset); + void write_supervisor_memory(address_space &space, offs_t offset, uint8_t data); + offs_t get_dma_address(int index, uint16_t offset); + uint8_t dma_mreq_r(int index, uint16_t offset); + void dma_mreq_w(int index, uint16_t offset, uint8_t data); + uint8_t dma_iorq_r(int index, uint16_t offset); + void dma_iorq_w(int index, uint16_t offset, uint8_t data); const address_space_config m_space_config; required_memory_region m_rom; - optional_shared_ptr m_segment_ram; - optional_shared_ptr m_page_ram; + optional_shared_ptr m_segment_ram; + optional_shared_ptr m_page_ram; required_device m_watchdog; @@ -126,9 +126,9 @@ private: m68000_base_device *m_cpu; int m_ifc2; - UINT8 m_task; - UINT8 m_dmamap[8]; - UINT8 m_cause; + uint8_t m_task; + uint8_t m_dmamap[8]; + uint8_t m_cause; }; diff --git a/src/mame/machine/abc80kb.cpp b/src/mame/machine/abc80kb.cpp index c5d7e4dfeb0..6c6c8509697 100644 --- a/src/mame/machine/abc80kb.cpp +++ b/src/mame/machine/abc80kb.cpp @@ -167,7 +167,7 @@ ioport_constructor abc80_keyboard_device::device_input_ports() const // abc80_keyboard_device - constructor //------------------------------------------------- -abc80_keyboard_device::abc80_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc80_keyboard_device::abc80_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC80_KEYBOARD, "ABC-80 Keyboard", tag, owner, clock, "abc80kb", __FILE__), m_write_keydown(*this), m_maincpu(*this, I8048_TAG) @@ -199,7 +199,7 @@ void abc80_keyboard_device::device_reset() // data_r - keyboard data read //------------------------------------------------- -UINT8 abc80_keyboard_device::data_r() +uint8_t abc80_keyboard_device::data_r() { return 0; } diff --git a/src/mame/machine/abc80kb.h b/src/mame/machine/abc80kb.h index 134d3f59e91..6a2b17101ed 100644 --- a/src/mame/machine/abc80kb.h +++ b/src/mame/machine/abc80kb.h @@ -43,7 +43,7 @@ class abc80_keyboard_device : public device_t { public: // construction/destruction - abc80_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc80_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_keydown_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_keydown.set_callback(object); } @@ -52,7 +52,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const override; virtual ioport_constructor device_input_ports() const override; - UINT8 data_r(); + uint8_t data_r(); protected: // device-level overrides diff --git a/src/mame/machine/ac1.cpp b/src/mame/machine/ac1.cpp index e504807ef96..cfb7387f211 100644 --- a/src/mame/machine/ac1.cpp +++ b/src/mame/machine/ac1.cpp @@ -15,7 +15,7 @@ READ8_MEMBER(ac1_state::ac1_port_b_r) { - UINT8 data = 0x7f; + uint8_t data = 0x7f; if (m_cassette->input() > 0.03) data |= 0x80; @@ -27,30 +27,30 @@ READ8_MEMBER(ac1_state::ac1_port_b_r) READ8_MEMBER(ac1_state::ac1_port_a_r) { - UINT8 line0 = m_io_line[0]->read(); - UINT8 line1 = m_io_line[1]->read(); - UINT8 line2 = m_io_line[2]->read(); - UINT8 line3 = m_io_line[3]->read(); - UINT8 line4 = m_io_line[4]->read(); - UINT8 line5 = m_io_line[5]->read(); - UINT8 line6 = m_io_line[6]->read(); - - UINT8 SH = BNOT(BIT(line6,0)); - UINT8 CTRL = BNOT(BIT(line6,1)); - UINT8 SPACE = BIT(line6,2); - UINT8 ENTER = BIT(line6,3); - UINT8 BACK = BIT(line6,4); - - UINT8 all = line0 | line1 | line2 | line3 | line4 | line5; - UINT8 s1 = BNOT(BIT(all,0));UINT8 z1 = (line0 !=0) ? 0 : 1; - UINT8 s2 = BNOT(BIT(all,1));UINT8 z2 = (line1 !=0) ? 0 : 1; - UINT8 s3 = BNOT(BIT(all,2));UINT8 z3 = (line2 !=0) ? 0 : 1; - UINT8 s4 = BNOT(BIT(all,3));UINT8 z4 = (line3 !=0) ? 0 : 1; - UINT8 s5 = BNOT(BIT(all,4));UINT8 z5 = (line4 !=0) ? 0 : 1; - UINT8 s6 = BNOT(BIT(all,5));UINT8 z6 = (line5 !=0) ? 0 : 1; - UINT8 s7 = BNOT(BIT(all,6)); - UINT8 s8 = BNOT(BIT(all,7)); - UINT8 tast,td0,td1,td2,td3,td4,td5,td6,dg5; + uint8_t line0 = m_io_line[0]->read(); + uint8_t line1 = m_io_line[1]->read(); + uint8_t line2 = m_io_line[2]->read(); + uint8_t line3 = m_io_line[3]->read(); + uint8_t line4 = m_io_line[4]->read(); + uint8_t line5 = m_io_line[5]->read(); + uint8_t line6 = m_io_line[6]->read(); + + uint8_t SH = BNOT(BIT(line6,0)); + uint8_t CTRL = BNOT(BIT(line6,1)); + uint8_t SPACE = BIT(line6,2); + uint8_t ENTER = BIT(line6,3); + uint8_t BACK = BIT(line6,4); + + uint8_t all = line0 | line1 | line2 | line3 | line4 | line5; + uint8_t s1 = BNOT(BIT(all,0));uint8_t z1 = (line0 !=0) ? 0 : 1; + uint8_t s2 = BNOT(BIT(all,1));uint8_t z2 = (line1 !=0) ? 0 : 1; + uint8_t s3 = BNOT(BIT(all,2));uint8_t z3 = (line2 !=0) ? 0 : 1; + uint8_t s4 = BNOT(BIT(all,3));uint8_t z4 = (line3 !=0) ? 0 : 1; + uint8_t s5 = BNOT(BIT(all,4));uint8_t z5 = (line4 !=0) ? 0 : 1; + uint8_t s6 = BNOT(BIT(all,5));uint8_t z6 = (line5 !=0) ? 0 : 1; + uint8_t s7 = BNOT(BIT(all,6)); + uint8_t s8 = BNOT(BIT(all,7)); + uint8_t tast,td0,td1,td2,td3,td4,td5,td6,dg5; /* Additional double keys */ if (SPACE) { diff --git a/src/mame/machine/acitya.cpp b/src/mame/machine/acitya.cpp index f986e9fa00d..68b7aec03e8 100644 --- a/src/mame/machine/acitya.cpp +++ b/src/mame/machine/acitya.cpp @@ -22,7 +22,7 @@ void pacman_state::acitya_decrypt_rom_8() { int oldbyte,inverted_oldbyte,newbyte; int mem; - UINT8 *RAM; + uint8_t *RAM; RAM = memregion("maincpu")->base(); @@ -57,7 +57,7 @@ void pacman_state::acitya_decrypt_rom_9() { int oldbyte,inverted_oldbyte,newbyte; int mem; - UINT8 *RAM; + uint8_t *RAM; RAM = memregion("maincpu")->base(); @@ -89,7 +89,7 @@ void pacman_state::acitya_decrypt_rom_A() { int oldbyte,inverted_oldbyte,newbyte; int mem; - UINT8 *RAM; + uint8_t *RAM; RAM = memregion("maincpu")->base(); @@ -121,7 +121,7 @@ void pacman_state::acitya_decrypt_rom_B() { int oldbyte,inverted_oldbyte,newbyte; int mem; - UINT8 *RAM; + uint8_t *RAM; RAM = memregion("maincpu")->base(); @@ -180,7 +180,7 @@ READ8_MEMBER(pacman_state::acitya_decrypt_rom ) MACHINE_START_MEMBER(pacman_state,acitya) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); /* While the PAL supports up to 16 decryption methods, only four are actually used in the PAL. Therefore, we'll take a little diff --git a/src/mame/machine/advision.cpp b/src/mame/machine/advision.cpp index 792cf6b0719..d75589a9f0c 100644 --- a/src/mame/machine/advision.cpp +++ b/src/mame/machine/advision.cpp @@ -86,7 +86,7 @@ WRITE8_MEMBER( advision_state::bankswitch_w ) READ8_MEMBER( advision_state::ext_ram_r ) { - UINT8 data = m_ext_ram[m_rambank + offset]; + uint8_t data = m_ext_ram[m_rambank + offset]; if (!m_video_enable) { @@ -176,8 +176,8 @@ READ8_MEMBER( advision_state::vsync_r ) READ8_MEMBER( advision_state::controller_r ) { // Get joystick switches - UINT8 in = m_joy->read(); - UINT8 data = in | 0x0f; + uint8_t in = m_joy->read(); + uint8_t data = in | 0x0f; // Get buttons if (in & 0x02) data = data & 0xf7; /* Button 3 */ diff --git a/src/mame/machine/aim65.cpp b/src/mame/machine/aim65.cpp index 98ca49c57e9..c66eee06764 100644 --- a/src/mame/machine/aim65.cpp +++ b/src/mame/machine/aim65.cpp @@ -115,7 +115,7 @@ READ8_MEMBER( aim65_state::aim65_riot_b_r ) "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" }; - UINT8 row, data = 0xff; + uint8_t row, data = 0xff; /* scan keyboard rows */ for (row = 0; row < 8; row++) @@ -185,7 +185,7 @@ WRITE8_MEMBER( aim65_state::aim65_pb_w ) d0/1 = printer data (not emulated) */ - UINT8 bits = data ^ m_pb_save; + uint8_t bits = data ^ m_pb_save; m_pb_save = data; if (BIT(bits, 7)) @@ -220,7 +220,7 @@ READ8_MEMBER( aim65_state::aim65_pb_r ) d3 = kb/tty switch */ - UINT8 data = ioport("switches")->read(); + uint8_t data = ioport("switches")->read(); data |= (m_cassette1->input() > +0.03) ? 0x80 : 0; data |= 0x40; // TTY must be H if not used. data |= m_pb_save & 0x37; @@ -287,7 +287,7 @@ device - the output will be gibberish. bool m_flag_a; bool m_flag_b; bool m_printer_level; - UINT16 *m_printerRAM; + uint16_t *m_printerRAM; */ @@ -378,7 +378,7 @@ WRITE8_MEMBER( aim65_state::aim65_pa_w ) VIDEO_START_MEMBER(aim65_state,aim65) { m_print_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aim65_state::aim65_printer_timer),this)); - m_printerRAM = std::make_unique((600 * 10 * 2) / 2); + m_printerRAM = std::make_unique((600 * 10 * 2) / 2); memset(m_printerRAM, 0, videoram_size); VIDEO_START_CALL_MEMBER(generic); m_printer_x = 0; @@ -394,8 +394,8 @@ SCREEN_UPDATE( aim65 ) aim65_state *state = screen.machine().driver_data(); /* Display printer output */ bool dir = 1; - UINT8 b,x,pen; - UINT16 y; + uint8_t b,x,pen; + uint16_t y; for (y = 0; y<500; y++) { diff --git a/src/mame/machine/ajax.cpp b/src/mame/machine/ajax.cpp index 5f38deb1281..4093229d307 100644 --- a/src/mame/machine/ajax.cpp +++ b/src/mame/machine/ajax.cpp @@ -196,8 +196,8 @@ WRITE8_MEMBER(ajax_state::bankswitch_2_w) void ajax_state::machine_start() { - UINT8 *MAIN = memregion("maincpu")->base(); - UINT8 *SUB = memregion("sub")->base(); + uint8_t *MAIN = memregion("maincpu")->base(); + uint8_t *SUB = memregion("sub")->base(); membank("mainbank")->configure_entries(0, 4, &MAIN[0x00000], 0x2000); membank("mainbank")->configure_entries(4, 8, &MAIN[0x10000], 0x2000); diff --git a/src/mame/machine/alpha8201.cpp b/src/mame/machine/alpha8201.cpp index 88813b1be9f..87c06da6370 100644 --- a/src/mame/machine/alpha8201.cpp +++ b/src/mame/machine/alpha8201.cpp @@ -282,7 +282,7 @@ const device_type ALPHA_8201 = &device_creator; // alpha_8201_device - constructor //------------------------------------------------- -alpha_8201_device::alpha_8201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +alpha_8201_device::alpha_8201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ALPHA_8201, "ALPHA-8201", tag, owner, clock, "alpha8201", __FILE__), m_mcu(*this, "mcu") { @@ -295,7 +295,7 @@ alpha_8201_device::alpha_8201_device(const machine_config &mconfig, const char * void alpha_8201_device::device_start() { - m_shared_ram = make_unique_clear(0x400); + m_shared_ram = make_unique_clear(0x400); // zerofill m_bus = 0; @@ -364,7 +364,7 @@ void alpha_8201_device::mcu_update_address() READ8_MEMBER(alpha_8201_device::mcu_data_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (m_bus && ~m_mcu_d & 4) ret = m_shared_ram[m_mcu_address]; diff --git a/src/mame/machine/alpha8201.h b/src/mame/machine/alpha8201.h index 1db8eb64a3a..fb24349333c 100644 --- a/src/mame/machine/alpha8201.h +++ b/src/mame/machine/alpha8201.h @@ -14,7 +14,7 @@ class alpha_8201_device : public device_t { public: - alpha_8201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + alpha_8201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~alpha_8201_device() {} DECLARE_READ8_MEMBER(mcu_data_r); @@ -39,10 +39,10 @@ private: // internal state int m_bus; // shared RAM bus direction - UINT16 m_mcu_address; // MCU side RAM address - UINT16 m_mcu_d; // MCU D output data - UINT8 m_mcu_r[4]; // MCU R0-R3 output data - std::unique_ptr m_shared_ram; // 1KB RAM + uint16_t m_mcu_address; // MCU side RAM address + uint16_t m_mcu_d; // MCU D output data + uint8_t m_mcu_r[4]; // MCU R0-R3 output data + std::unique_ptr m_shared_ram; // 1KB RAM void mcu_update_address(); void mcu_writeram(); diff --git a/src/mame/machine/amiga.cpp b/src/mame/machine/amiga.cpp index 8a8b111de72..032b14b2026 100644 --- a/src/mame/machine/amiga.cpp +++ b/src/mame/machine/amiga.cpp @@ -378,7 +378,7 @@ TIMER_CALLBACK_MEMBER( amiga_state::amiga_irq_proc ) // INPUTS //************************************************************************** -UINT16 amiga_state::joy0dat_r() +uint16_t amiga_state::joy0dat_r() { if (!m_input_device.found() || (m_input_device->read() & 0x10)) return m_joy0dat_port.read_safe(0xffff); @@ -386,7 +386,7 @@ UINT16 amiga_state::joy0dat_r() return (m_p1_mouse_y.read_safe(0xff) << 8) | m_p1_mouse_x.read_safe(0xff); } -UINT16 amiga_state::joy1dat_r() +uint16_t amiga_state::joy1dat_r() { if (!m_input_device.found() || m_input_device->read() & 0x20) return m_joy1dat_port.read_safe(0xffff); @@ -396,7 +396,7 @@ UINT16 amiga_state::joy1dat_r() CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert ) { - UINT8 bits = m_joy_ports[(int)(uintptr_t)param].read_safe(0xff); + uint8_t bits = m_joy_ports[(int)(uintptr_t)param].read_safe(0xff); int up = (bits >> 0) & 1; int down = (bits >> 1) & 1; @@ -417,15 +417,15 @@ CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert ) * *************************************/ -static UINT32 blit_ascending(amiga_state *state) +static uint32_t blit_ascending(amiga_state *state) { - UINT32 shifta = (CUSTOM_REG(REG_BLTCON0) >> 12) & 0xf; - UINT32 shiftb = (CUSTOM_REG(REG_BLTCON1) >> 12) & 0xf; - UINT32 height = CUSTOM_REG(REG_BLTSIZV); - UINT32 width = CUSTOM_REG(REG_BLTSIZH); - UINT32 acca = 0, accb = 0; - UINT32 blitsum = 0; - UINT32 x, y; + uint32_t shifta = (CUSTOM_REG(REG_BLTCON0) >> 12) & 0xf; + uint32_t shiftb = (CUSTOM_REG(REG_BLTCON1) >> 12) & 0xf; + uint32_t height = CUSTOM_REG(REG_BLTSIZV); + uint32_t width = CUSTOM_REG(REG_BLTSIZH); + uint32_t acca = 0, accb = 0; + uint32_t blitsum = 0; + uint32_t x, y; /* iterate over the height */ for (y = 0; y < height; y++) @@ -433,9 +433,9 @@ static UINT32 blit_ascending(amiga_state *state) /* iterate over the width */ for (x = 0; x < width; x++) { - UINT16 abc0, abc1, abc2, abc3; - UINT32 tempa, tempd = 0; - UINT32 b; + uint16_t abc0, abc1, abc2, abc3; + uint32_t tempa, tempd = 0; + uint32_t b; /* fetch data for A */ if (CUSTOM_REG(REG_BLTCON0) & 0x0800) @@ -479,7 +479,7 @@ static UINT32 blit_ascending(amiga_state *state) /* now loop over bits and compute the destination value */ for (b = 0; b < 4; b++) { - UINT32 bit; + uint32_t bit; /* shift previous data up 4 bits */ tempd <<= 4; @@ -539,29 +539,29 @@ static UINT32 blit_ascending(amiga_state *state) * *************************************/ -static UINT32 blit_descending(amiga_state *state) +static uint32_t blit_descending(amiga_state *state) { - UINT32 fill_exclusive = (CUSTOM_REG(REG_BLTCON1) >> 4); - UINT32 fill_inclusive = (CUSTOM_REG(REG_BLTCON1) >> 3); - UINT32 shifta = (CUSTOM_REG(REG_BLTCON0) >> 12) & 0xf; - UINT32 shiftb = (CUSTOM_REG(REG_BLTCON1) >> 12) & 0xf; - UINT32 height = CUSTOM_REG(REG_BLTSIZV); - UINT32 width = CUSTOM_REG(REG_BLTSIZH); - UINT32 acca = 0, accb = 0; - UINT32 blitsum = 0; - UINT32 x, y; + uint32_t fill_exclusive = (CUSTOM_REG(REG_BLTCON1) >> 4); + uint32_t fill_inclusive = (CUSTOM_REG(REG_BLTCON1) >> 3); + uint32_t shifta = (CUSTOM_REG(REG_BLTCON0) >> 12) & 0xf; + uint32_t shiftb = (CUSTOM_REG(REG_BLTCON1) >> 12) & 0xf; + uint32_t height = CUSTOM_REG(REG_BLTSIZV); + uint32_t width = CUSTOM_REG(REG_BLTSIZH); + uint32_t acca = 0, accb = 0; + uint32_t blitsum = 0; + uint32_t x, y; /* iterate over the height */ for (y = 0; y < height; y++) { - UINT32 fill_state = (CUSTOM_REG(REG_BLTCON1) >> 2) & 1; + uint32_t fill_state = (CUSTOM_REG(REG_BLTCON1) >> 2) & 1; /* iterate over the width */ for (x = 0; x < width; x++) { - UINT16 abc0, abc1, abc2, abc3; - UINT32 tempa, tempd = 0; - UINT32 b; + uint16_t abc0, abc1, abc2, abc3; + uint32_t tempa, tempd = 0; + uint32_t b; /* fetch data for A */ if (CUSTOM_REG(REG_BLTCON0) & 0x0800) @@ -604,8 +604,8 @@ static UINT32 blit_descending(amiga_state *state) /* now loop over bits and compute the destination value */ for (b = 0; b < 4; b++) { - UINT32 prev_fill_state; - UINT32 bit; + uint32_t prev_fill_state; + uint32_t bit; /* shift previous data up 4 bits */ tempd >>= 4; @@ -720,12 +720,12 @@ static UINT32 blit_descending(amiga_state *state) BLTAMOD = 4 * (dy - dx) and BLTBMOD = 4 * dy. */ -static UINT32 blit_line(amiga_state *state) +static uint32_t blit_line(amiga_state *state) { - UINT32 singlemode = (CUSTOM_REG(REG_BLTCON1) & 0x0002) ? 0x0000 : 0xffff; - UINT32 singlemask = 0xffff; - UINT32 blitsum = 0; - UINT32 height; + uint32_t singlemode = (CUSTOM_REG(REG_BLTCON1) & 0x0002) ? 0x0000 : 0xffff; + uint32_t singlemask = 0xffff; + uint32_t blitsum = 0; + uint32_t height; /* see if folks are breaking the rules */ if (CUSTOM_REG(REG_BLTSIZH) != 0x0002) @@ -739,8 +739,8 @@ static UINT32 blit_line(amiga_state *state) /* iterate over the line height */ while (height--) { - UINT16 abc0, abc1, abc2, abc3; - UINT32 tempa, tempb, tempd = 0; + uint16_t abc0, abc1, abc2, abc3; + uint32_t tempa, tempb, tempd = 0; int b, dx, dy; /* fetch data for C */ @@ -766,7 +766,7 @@ static UINT32 blit_line(amiga_state *state) /* now loop over bits and compute the destination value */ for (b = 0; b < 4; b++) { - UINT32 bit; + uint32_t bit; /* shift previous data up 4 bits */ tempd <<= 4; @@ -831,7 +831,7 @@ static UINT32 blit_line(amiga_state *state) if (dx) { /* adjust the A shift value */ - UINT32 temp = CUSTOM_REG(REG_BLTCON0) + (INT32)(dx << 12); + uint32_t temp = CUSTOM_REG(REG_BLTCON0) + (int32_t)(dx << 12); CUSTOM_REG(REG_BLTCON0) = temp; /* if we went from 0xf to 0x0 or vice-versa, adjust the actual pointers */ @@ -846,8 +846,8 @@ static UINT32 blit_line(amiga_state *state) if (dy) { /* BLTCMOD seems to be used for both C and D pointers */ - CUSTOM_REG_LONG(REG_BLTCPTH) += dy * (INT16)(CUSTOM_REG_SIGNED(REG_BLTCMOD) & ~1); - CUSTOM_REG_LONG(REG_BLTDPTH) += dy * (INT16)(CUSTOM_REG_SIGNED(REG_BLTCMOD) & ~1); + CUSTOM_REG_LONG(REG_BLTCPTH) += dy * (int16_t)(CUSTOM_REG_SIGNED(REG_BLTCMOD) & ~1); + CUSTOM_REG_LONG(REG_BLTDPTH) += dy * (int16_t)(CUSTOM_REG_SIGNED(REG_BLTCMOD) & ~1); /* reset the single mask since we're on a new line */ singlemask = 0xffff; @@ -874,7 +874,7 @@ static UINT32 blit_line(amiga_state *state) TIMER_CALLBACK_MEMBER( amiga_state::amiga_blitter_proc ) { amiga_state *state = machine().driver_data(); - UINT32 blitsum = 0; + uint32_t blitsum = 0; /* logging */ if (LOG_BLITS) @@ -1027,7 +1027,7 @@ WRITE_LINE_MEMBER( amiga_state::centronics_select_w ) READ16_MEMBER( amiga_state::cia_r ) { - UINT16 data = 0; + uint16_t data = 0; if ((offset & 0x1000/2) == 0 && ACCESSING_BITS_0_7) data |= m_cia_0->read(space, offset >> 7); @@ -1092,7 +1092,7 @@ WRITE_LINE_MEMBER( amiga_state::cia_0_irq ) READ8_MEMBER( amiga_state::cia_1_port_a_read ) { - UINT8 data = 0; + uint8_t data = 0; // bit 0 to 2, centronics data |= m_centronics_busy << 0; @@ -1147,7 +1147,7 @@ void amiga_state::custom_chip_reset() READ16_MEMBER( amiga_state::custom_chip_r ) { amiga_state *state = this; - UINT16 temp; + uint16_t temp; if (LOG_CUSTOM) logerror("%06X:read from custom %s\n", space.device().safe_pc(), amiga_custom_names[offset & 0xff]); @@ -1261,7 +1261,7 @@ READ16_MEMBER( amiga_state::custom_chip_r ) WRITE16_MEMBER( amiga_state::custom_chip_w ) { amiga_state *state = space.machine().driver_data(); - UINT16 temp; + uint16_t temp; offset &= 0xff; if (LOG_CUSTOM) @@ -1574,8 +1574,8 @@ void amiga_state::serial_adjust() { amiga_state *state = this; - UINT32 divisor = (CUSTOM_REG(REG_SERPER) & 0x7fff) + 1; - UINT32 baud = m_sound->clock() / divisor; + uint32_t divisor = (CUSTOM_REG(REG_SERPER) & 0x7fff) + 1; + uint32_t baud = m_sound->clock() / divisor; m_serial_timer->adjust(attotime::from_hz(baud) / 2, 0, attotime::from_hz(baud)); } diff --git a/src/mame/machine/amigakbd.cpp b/src/mame/machine/amigakbd.cpp index 55f832310ac..21d1c11d71e 100644 --- a/src/mame/machine/amigakbd.cpp +++ b/src/mame/machine/amigakbd.cpp @@ -260,7 +260,7 @@ ioport_constructor amigakbd_device::device_input_ports() const // amigakbd_device - constructor //------------------------------------------------- -amigakbd_device::amigakbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amigakbd_device::amigakbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AMIGAKBD, "Amiga 500 Keyboard with 6570-036 MPU", tag, owner, clock, "amigakbd", __FILE__), m_write_kclk(*this), m_write_kdat(*this), @@ -394,7 +394,7 @@ void amigakbd_device::device_timer(emu_timer &timer, device_timer_id tid, int pa INPUT_CHANGED_MEMBER( amigakbd_device::check_reset ) { - UINT8 keys = m_special->read(); + uint8_t keys = m_special->read(); // ctrl-amiga-amiga pressed? if (!BIT(keys, 6) && !BIT(keys, 3) && !BIT(keys, 2)) @@ -421,7 +421,7 @@ void amigakbd_device::update_irqs() READ8_MEMBER( amigakbd_device::port_a_r ) { - UINT8 data = 0xfc; + uint8_t data = 0xfc; // kdat & kclk data |= m_kdat << 0; diff --git a/src/mame/machine/amigakbd.h b/src/mame/machine/amigakbd.h index 1ae08514d97..687401a1c20 100644 --- a/src/mame/machine/amigakbd.h +++ b/src/mame/machine/amigakbd.h @@ -42,7 +42,7 @@ class amigakbd_device : public device_t { public: // construction/destruction - amigakbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amigakbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_kclk_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_kclk.set_callback(object); } @@ -130,11 +130,11 @@ private: int m_kdat; int m_kclk; - UINT8 m_port_c; - UINT8 m_port_d; - UINT16 m_latch; - UINT16 m_counter; - UINT8 m_control; + uint8_t m_port_c; + uint8_t m_port_d; + uint16_t m_latch; + uint16_t m_counter; + uint8_t m_control; }; // device type definition diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index 1cda012e914..611a2cbaf41 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -67,7 +67,7 @@ enum { // This is the sequence for unlocking the ASIC in the CPC+/GX4000 // These are outed to port &bc00, after syncing the lock by outing a non-zero value then a zero to &bc00 // To lock the ASIC again, repeat the sequence without the last &ee -static const UINT8 asic_unlock_seq[15] = +static const uint8_t asic_unlock_seq[15] = { 0xff, 0x77, 0xb3, 0x51, 0xa8, 0xd4, 0x62, 0x39, 0x9c, 0x46, 0x2b, 0x15, 0x8a, 0xcd, 0xee }; @@ -290,7 +290,7 @@ with different data and be able to select the other entries - not tested on a re and not supported by this driver */ PALETTE_INIT_MEMBER(amstrad_state,kccomp) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; color_prom = color_prom+0x018000; @@ -599,7 +599,7 @@ TIMER_CALLBACK_MEMBER(amstrad_state::amstrad_video_update_timer) } /* Set the new colour from the GateArray */ -void amstrad_state::amstrad_vh_update_colour(int PenIndex, UINT16 hw_colour_index) +void amstrad_state::amstrad_vh_update_colour(int PenIndex, uint16_t hw_colour_index) { if ( m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000 ) { @@ -622,7 +622,7 @@ void amstrad_state::amstrad_vh_update_colour(int PenIndex, UINT16 hw_colour_inde } -void amstrad_state::aleste_vh_update_colour(int PenIndex, UINT16 hw_colour_index) +void amstrad_state::aleste_vh_update_colour(int PenIndex, uint16_t hw_colour_index) { timer_set(attotime::from_usec(0), TIMER_VIDEO_UPDATE, 0); m_GateArray_render_colours[PenIndex] = hw_colour_index+32; @@ -653,7 +653,7 @@ void amstrad_state::amstrad_update_video() if ( m_gate_array.draw_p ) { - UINT32 cycles_passed = (now - m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); + uint32_t cycles_passed = (now - m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); while( cycles_passed ) { @@ -701,9 +701,9 @@ void amstrad_state::amstrad_update_video() void amstrad_state::amstrad_plus_gate_array_get_video_data() { - UINT16 caddr; - UINT16 ma = ( m_gate_array.ma - m_asic.split_ma_started ) + m_asic.split_ma_base; - UINT16 ra = m_gate_array.ra + ( ( m_asic.ram[0x2804] >> 4 ) & 0x07 ); + uint16_t caddr; + uint16_t ma = ( m_gate_array.ma - m_asic.split_ma_started ) + m_asic.split_ma_base; + uint16_t ra = m_gate_array.ra + ( ( m_asic.ram[0x2804] >> 4 ) & 0x07 ); if ( ra > 7 ) { @@ -728,7 +728,7 @@ void amstrad_state::amstrad_plus_update_video() if ( m_gate_array.draw_p ) { - UINT32 cycles_passed = (now - m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); + uint32_t cycles_passed = (now - m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); while( cycles_passed ) { @@ -751,7 +751,7 @@ void amstrad_state::amstrad_plus_update_video() m_gate_array.colour_ticks--; if ( ! m_gate_array.colour_ticks ) { - UINT16 caddr; + uint16_t caddr; m_gate_array.data <<= 1; if((m_asic.ram[0x2804] & 0x80) && m_asic.hsync_first_tick) @@ -766,7 +766,7 @@ void amstrad_state::amstrad_plus_update_video() { case 8: { - UINT16 caddr; + uint16_t caddr; m_gate_array.data = m_ram->pointer()[ m_gate_array.address + 1 ]; if((m_asic.ram[0x2804] & 0x80) && m_asic.hsync_first_tick) @@ -803,9 +803,9 @@ void amstrad_state::amstrad_plus_update_video() void amstrad_state::amstrad_plus_update_video_sprites() { - UINT16 *p; + uint16_t *p; int i; - UINT16 horiz; + uint16_t horiz; if ( m_gate_array.y < 0 ) return; @@ -818,14 +818,14 @@ void amstrad_state::amstrad_plus_update_video_sprites() p = &m_gate_array.bitmap->pix16(m_gate_array.y, horiz ); for ( i = 15 * 8; i >= 0; i -= 8 ) { - UINT8 xmag = ( m_asic.ram[ 0x2000 + i + 4 ] >> 2 ) & 0x03; - UINT8 ymag = m_asic.ram[ 0x2000 + i + 4 ] & 0x03; + uint8_t xmag = ( m_asic.ram[ 0x2000 + i + 4 ] >> 2 ) & 0x03; + uint8_t ymag = m_asic.ram[ 0x2000 + i + 4 ] & 0x03; /* Check if sprite is enabled */ if ( xmag && ymag ) { - INT16 spr_x = m_asic.ram[ 0x2000 + i ] + ( m_asic.ram[ 0x2001 + i ] << 8 ); - INT16 spr_y = m_asic.ram[ 0x2002 + i ] + ( m_asic.ram[ 0x2003 + i ] << 8 ); + int16_t spr_x = m_asic.ram[ 0x2000 + i ] + ( m_asic.ram[ 0x2001 + i ] << 8 ); + int16_t spr_y = m_asic.ram[ 0x2002 + i ] + ( m_asic.ram[ 0x2003 + i ] << 8 ); xmag -= 1; ymag -= 1; @@ -834,16 +834,16 @@ void amstrad_state::amstrad_plus_update_video_sprites() //if(i == 0) printf("%i <= %i, %i < %i, %i < %i, %i > 0\n", spr_y,m_asic.vpos,m_asic.vpos,spr_y+(16< 0 ) { - UINT16 spr_addr = i * 32 + ( ( ( m_asic.vpos - spr_y ) >> ymag ) * 16 ); + uint16_t spr_addr = i * 32 + ( ( ( m_asic.vpos - spr_y ) >> ymag ) * 16 ); int j, k; for ( j = 0; j < 16; j++ ) { for ( k = 0; k < ( 1 << xmag ); k++ ) { - INT16 x = spr_x + ( j << xmag ) + k; + int16_t x = spr_x + ( j << xmag ) + k; if ( x >= 0 && x < (m_asic.h_end - horiz)) { - UINT8 spr_col = ( m_asic.ram[ spr_addr + j ] & 0x0f ) * 2; + uint8_t spr_col = ( m_asic.ram[ spr_addr + j ] & 0x0f ) * 2; if ( spr_col ) p[x] = m_asic.ram[ 0x2420 + spr_col ] + ( m_asic.ram[ 0x2421 + spr_col ] << 8 ); } @@ -1093,7 +1093,7 @@ VIDEO_START_MEMBER(amstrad_state,amstrad) } -UINT32 amstrad_state::screen_update_amstrad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t amstrad_state::screen_update_amstrad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap( bitmap, *m_gate_array.bitmap, 0, 0, 0, 0, cliprect ); return 0; @@ -1146,7 +1146,7 @@ WRITE_LINE_MEMBER(amstrad_state::cpc_romdis) -----------------*/ void amstrad_state::amstrad_setLowerRom() { - UINT8 *bank_base; + uint8_t *bank_base; /* b2 : "1" Lower rom area disable or "0" Lower rom area enable */ if ( m_system_type == SYSTEM_CPC || m_system_type == SYSTEM_ALESTE ) @@ -1246,7 +1246,7 @@ void amstrad_state::amstrad_setLowerRom() -----------------*/ void amstrad_state::amstrad_setUpperRom() { - UINT8 *bank_base = nullptr; + uint8_t *bank_base = nullptr; /* b3 : "1" Upper rom area disable or "0" Upper rom area enable */ if ( ! ( m_gate_array.mrer & 0x08 ) && m_gate_array.romdis == 0) @@ -1300,7 +1300,7 @@ void amstrad_state::AmstradCPC_GA_SetRamConfiguration() int ConfigurationIndex = m_GateArray_RamConfiguration & 0x07; int BankIndex,i; unsigned char *BankAddr; - UINT8 banknum = (m_GateArray_RamConfiguration & 0x38) >> 3; + uint8_t banknum = (m_GateArray_RamConfiguration & 0x38) >> 3; /* if b5 = 0 */ if(m_ram->size() > 65536) @@ -1310,7 +1310,7 @@ void amstrad_state::AmstradCPC_GA_SetRamConfiguration() BankIndex = RamConfigurations[(ConfigurationIndex << 2) + i]; if(BankIndex > 3) { - UINT8 maxbank = ((m_ram->size()-65536) / 65536); + uint8_t maxbank = ((m_ram->size()-65536) / 65536); BankAddr = m_ram->pointer() + (BankIndex << 14) + ((banknum%maxbank)*0x10000); } else @@ -1406,7 +1406,7 @@ WRITE8_MEMBER(amstrad_state::amstrad_plus_asic_4000_w) m_asic.ram[offset] = data & 0x0f; else { - UINT8* RAM = (UINT8*)m_bank11->base(); + uint8_t* RAM = (uint8_t*)m_bank11->base(); RAM[offset] = data; } } @@ -1509,7 +1509,7 @@ WRITE8_MEMBER(amstrad_state::amstrad_plus_asic_6000_w) } else { - UINT8* RAM = (UINT8*)m_bank12->base(); + uint8_t* RAM = (uint8_t*)m_bank12->base(); RAM[offset] = data; } } @@ -1522,7 +1522,7 @@ READ8_MEMBER(amstrad_state::amstrad_plus_asic_4000_r) return m_asic.ram[offset]; else { - UINT8* RAM = (UINT8*)m_bank3->base(); + uint8_t* RAM = (uint8_t*)m_bank3->base(); return RAM[offset]; } } @@ -1565,7 +1565,7 @@ READ8_MEMBER(amstrad_state::amstrad_plus_asic_6000_r) } else { - UINT8* RAM = (UINT8*)m_bank4->base(); + uint8_t* RAM = (uint8_t*)m_bank4->base(); return RAM[offset]; } } @@ -1602,7 +1602,7 @@ Bit 7 Bit 6 Function Note 1 : This function is not available in the Gate-Array, but is performed by a device at the same I/O port address location. In the CPC464,CPC664 and KC compact, this function is performed in a memory-expansion (e.g. Dk'Tronics 64K Ram Expansion), if this expansion is not present then the function is not available. In the CPC6128, this function is performed by a PAL located on the main PCB, or a memory-expansion. In the 464+ and 6128+ this function is performed by the ASIC or a memory expansion. Please read the document on Ram Management for more information.*/ -void amstrad_state::amstrad_GateArray_write(UINT8 dataToGateArray) +void amstrad_state::amstrad_GateArray_write(uint8_t dataToGateArray) { /* Get Bit 7 and 6 of the dataToGateArray = Gate Array function selected */ switch ((dataToGateArray & 0xc0)>>6) @@ -1733,7 +1733,7 @@ WRITE8_MEMBER(amstrad_state::aleste_msx_mapper) int ramptr = (data & 0x3f) * 0x4000; int rampage = data & 0x3f; int function = (data & 0xc0) >> 6; - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); // It is assumed that functions are all mapped to each port &7cff-&7fff, and b8 and b9 are only used for RAM bank location switch(function) @@ -2249,20 +2249,20 @@ void amstrad_state::amstrad_handle_snapshot(unsigned char *pSnapshot) if ((pSnapshot[0x01b] & 1)==1) { - m_maincpu->set_state_int(Z80_IFF1, (UINT64)1); + m_maincpu->set_state_int(Z80_IFF1, (uint64_t)1); } else { - m_maincpu->set_state_int(Z80_IFF1, (UINT64)0); + m_maincpu->set_state_int(Z80_IFF1, (uint64_t)0); } if ((pSnapshot[0x01c] & 1)==1) { - m_maincpu->set_state_int(Z80_IFF2, (UINT64)1); + m_maincpu->set_state_int(Z80_IFF2, (uint64_t)1); } else { - m_maincpu->set_state_int(Z80_IFF2, (UINT64)0); + m_maincpu->set_state_int(Z80_IFF2, (uint64_t)0); } RegData = (pSnapshot[0x01d] & 0x0ff) | ((pSnapshot[0x01e] & 0x0ff)<<8); @@ -2772,8 +2772,8 @@ IRQ_CALLBACK_MEMBER(amstrad_state::amstrad_cpu_acknowledge_int) // update AMX mouse inputs (normally done every 1/300th of a second) if (m_io_ctrltype.read_safe(0) == 1) { - static UINT8 prev_x,prev_y; - UINT8 data_x, data_y; + static uint8_t prev_x,prev_y; + uint8_t data_x, data_y; m_amx_mouse_data = 0x0f; data_x = m_io_mouse1.read_safe(0); @@ -2799,7 +2799,7 @@ IRQ_CALLBACK_MEMBER(amstrad_state::amstrad_cpu_acknowledge_int) /* the following timings have been measured! */ -static const UINT8 amstrad_cycle_table_op[256] = { +static const uint8_t amstrad_cycle_table_op[256] = { 4, 12, 8, 8, 4, 4, 8, 4, 4, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, 8, 12, 20, 8, 4, 4, 8, 4, 8, 12, 20, 8, 4, 4, 8, 4, @@ -2818,7 +2818,7 @@ static const UINT8 amstrad_cycle_table_op[256] = { 8, 12, 12, 4, 12, 16, 8, 16, 8, 8, 12, 4, 12, 4, 8, 16 }; -static const UINT8 amstrad_cycle_table_cb[256]= +static const uint8_t amstrad_cycle_table_cb[256]= { 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, @@ -2838,7 +2838,7 @@ static const UINT8 amstrad_cycle_table_cb[256]= 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4 }; -static const UINT8 amstrad_cycle_table_ed[256]= +static const uint8_t amstrad_cycle_table_ed[256]= { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, @@ -2858,7 +2858,7 @@ static const UINT8 amstrad_cycle_table_ed[256]= 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; -static const UINT8 amstrad_cycle_table_xy[256]= +static const uint8_t amstrad_cycle_table_xy[256]= { 4, 12, 8, 8, 4, 4, 8, 4, 4, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, @@ -2878,7 +2878,7 @@ static const UINT8 amstrad_cycle_table_xy[256]= 8, 12, 12, 4, 12, 16, 8, 16, 8, 8, 12, 4, 12, 4, 8, 16 }; -static const UINT8 amstrad_cycle_table_xycb[256]= +static const uint8_t amstrad_cycle_table_xycb[256]= { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, @@ -2898,7 +2898,7 @@ static const UINT8 amstrad_cycle_table_xycb[256]= 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 }; -static const UINT8 amstrad_cycle_table_ex[256]= +static const uint8_t amstrad_cycle_table_ex[256]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2924,13 +2924,13 @@ static const UINT8 amstrad_cycle_table_ex[256]= void amstrad_state::enumerate_roms() { - UINT8 m_rom_count = 1; - UINT8 *rom = m_region_maincpu->base(); + uint8_t m_rom_count = 1; + uint8_t *rom = m_region_maincpu->base(); bool slot7 = false; if (m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000) { - UINT8 *crt = m_region_cart->base(); + uint8_t *crt = m_region_cart->base(); int bank_mask = (m_cart->get_rom_size() / 0x4000) - 1; /* ROMs are stored on the inserted cartridge in the Plus/GX4000 */ @@ -3071,12 +3071,12 @@ void amstrad_state::amstrad_common_init() /* Using the cool code Juergen has provided, I will override the timing tables with the values for the amstrad */ m_maincpu->z80_set_cycle_tables( - (const UINT8*)amstrad_cycle_table_op, - (const UINT8*)amstrad_cycle_table_cb, - (const UINT8*)amstrad_cycle_table_ed, - (const UINT8*)amstrad_cycle_table_xy, - (const UINT8*)amstrad_cycle_table_xycb, - (const UINT8*)amstrad_cycle_table_ex); + (const uint8_t*)amstrad_cycle_table_op, + (const uint8_t*)amstrad_cycle_table_cb, + (const uint8_t*)amstrad_cycle_table_ed, + (const uint8_t*)amstrad_cycle_table_xy, + (const uint8_t*)amstrad_cycle_table_xycb, + (const uint8_t*)amstrad_cycle_table_ex); /* Juergen is a cool dude! */ } @@ -3262,7 +3262,7 @@ MACHINE_RESET_MEMBER(amstrad_state,aleste) /* load snapshot */ SNAPSHOT_LOAD_MEMBER( amstrad_state,amstrad) { - std::vector snapshot; + std::vector snapshot; /* get file size */ if (snapshot_size < 8) @@ -3285,7 +3285,7 @@ SNAPSHOT_LOAD_MEMBER( amstrad_state,amstrad) DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); unsigned char header[12]; bool is_cpr = FALSE; logerror("IMG: loading CPC+ cartridge file\n"); @@ -3336,9 +3336,9 @@ DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge) // 'cb01' represent Cartridge block 1, and is loaded to &4000-&7fff // ... and so on. - UINT32 offset = 0; - UINT8 *crt = m_cart->get_rom_base(); - std::vector temp_copy; + uint32_t offset = 0; + uint8_t *crt = m_cart->get_rom_base(); + std::vector temp_copy; temp_copy.resize(size); image.fread(&temp_copy[0], size); diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp index 8adf11a98c5..5575a5fd90c 100644 --- a/src/mame/machine/apollo.cpp +++ b/src/mame/machine/apollo.cpp @@ -59,7 +59,7 @@ #undef VERBOSE #define VERBOSE 0 -static UINT16 config = 0; +static uint16_t config = 0; /*************************************************************************** apollo_config - check configuration setting @@ -127,7 +127,7 @@ INPUT_PORTS_END class apollo_config_device : public device_t { public: - apollo_config_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apollo_config_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_config_complete() override; @@ -141,7 +141,7 @@ extern const device_type APOLLO_CONF; const device_type APOLLO_CONF = &device_creator; -apollo_config_device::apollo_config_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apollo_config_device::apollo_config_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APOLLO_CONF, "Apollo Configuration", tag, owner, clock, "apollo_config", __FILE__) { } @@ -187,8 +187,8 @@ void apollo_config_device::device_reset() #define CPU_CONTROL_REGISTER_ADDRESS 0x010100 -static UINT16 cpu_status_register = APOLLO_CSR_SR_BIT15 | APOLLO_CSR_SR_SERVICE; -static UINT16 cpu_control_register = 0x0000; +static uint16_t cpu_status_register = APOLLO_CSR_SR_BIT15 | APOLLO_CSR_SR_SERVICE; +static uint16_t cpu_control_register = 0x0000; /*------------------------------------------------- apollo_csr_get/set_servicemode @@ -204,19 +204,19 @@ static void apollo_csr_set_servicemode(int mode) apollo_csr_set_status_register(1, mode ? APOLLO_CSR_SR_SERVICE : 0); } -UINT16 apollo_csr_get_control_register(void) +uint16_t apollo_csr_get_control_register(void) { return cpu_control_register; } -UINT16 apollo_csr_get_status_register(void) +uint16_t apollo_csr_get_status_register(void) { return cpu_status_register; } -void apollo_csr_set_status_register(UINT16 mask, UINT16 data) +void apollo_csr_set_status_register(uint16_t mask, uint16_t data) { - UINT16 new_value = (cpu_status_register & ~mask) | (data & mask); + uint16_t new_value = (cpu_status_register & ~mask) | (data & mask); if (new_value != cpu_status_register) { @@ -313,15 +313,15 @@ READ16_MEMBER(apollo_state::apollo_csr_control_register_r) #undef VERBOSE #define VERBOSE 0 -static UINT16 address_translation_map[0x400]; +static uint16_t address_translation_map[0x400]; -static UINT16 dma_page_register[16] = +static uint16_t dma_page_register[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -static const UINT8 channel2page_register[8] = { 7, 3, 1, 2, 0, 11, 9, 10}; +static const uint8_t channel2page_register[8] = { 7, 3, 1, 2, 0, 11, 9, 10}; -static UINT8 dn3000_dma_channel1 = 1; // 1 = memory/ctape, 2 = floppy dma channel -static UINT8 dn3000_dma_channel2 = 5; // 5 = memory dma channel +static uint8_t dn3000_dma_channel1 = 1; // 1 = memory/ctape, 2 = floppy dma channel +static uint8_t dn3000_dma_channel2 = 5; // 5 = memory dma channel /*------------------------------------------------- DN3000/DN3500 DMA Controller 1 at 0x9000/0x10c00 @@ -333,7 +333,7 @@ WRITE8_MEMBER(apollo_state::apollo_dma_1_w){ } READ8_MEMBER(apollo_state::apollo_dma_1_r){ - UINT8 data = m_dma8237_1->read(space, offset); + uint8_t data = m_dma8237_1->read(space, offset); SLOG1(("apollo_dma_1_r: reading DMA Controller 1 at offset %02x = %02x", offset, data)); return data; } @@ -363,7 +363,7 @@ READ8_MEMBER(apollo_state::apollo_dma_2_r){ break; } } - UINT8 data = m_dma8237_2->read(space, offset / 2); + uint8_t data = m_dma8237_2->read(space, offset / 2); SLOG1(("apollo_dma_2_r: reading DMA Controller 2 at offset %02x = %02x", offset/2, data)); return data; } @@ -378,7 +378,7 @@ WRITE8_MEMBER(apollo_state::apollo_dma_page_register_w){ } READ8_MEMBER(apollo_state::apollo_dma_page_register_r){ - UINT8 data = dma_page_register[offset & 0x0f]; + uint8_t data = dma_page_register[offset & 0x0f]; SLOG1(("reading DMA Page Register at offset %02x = %02x", offset, data)); return data; } @@ -393,13 +393,13 @@ WRITE16_MEMBER(apollo_state::apollo_address_translation_map_w){ } READ16_MEMBER(apollo_state::apollo_address_translation_map_r){ - UINT16 data = address_translation_map[offset & 0x3ff]; + uint16_t data = address_translation_map[offset & 0x3ff]; SLOG2(("reading Address Translation Map at offset %02x = %04x", offset, data)); return data; } READ8_MEMBER(apollo_state::apollo_dma_read_byte){ - UINT8 data; + uint8_t data; offs_t page_offset; if (apollo_is_dn3000()) { @@ -440,7 +440,7 @@ WRITE8_MEMBER(apollo_state::apollo_dma_write_byte){ } READ8_MEMBER(apollo_state::apollo_dma_read_word){ - UINT16 data; + uint16_t data; offs_t page_offset; if (apollo_is_dn3000()) { @@ -578,7 +578,7 @@ void apollo_state::apollo_pic_set_irq_line(int irq, int state) IRQ_CALLBACK_MEMBER(apollo_state::apollo_pic_acknowledge) { - UINT32 vector = m_pic8259_master->acknowledge(); + uint32_t vector = m_pic8259_master->acknowledge(); if ((vector & 0x0f) == APOLLO_IRQ_PIC_SLAVE) { vector = m_pic8259_slave->acknowledge(); } @@ -694,7 +694,7 @@ WRITE8_MEMBER(apollo_state::apollo_rtc_w) READ8_MEMBER(apollo_state::apollo_rtc_r) { - UINT8 data; + uint8_t data; m_rtc->write(space, 0, offset); data = m_rtc->read(space, 1); if (offset >= 0x0b && offset <= 0x0c) @@ -725,7 +725,7 @@ TIMER_CALLBACK_MEMBER( apollo_state::apollo_rtc_timer ) #define VERBOSE 0 apollo_sio::apollo_sio(const machine_config &mconfig, const char *tag, - device_t *owner, UINT32 clock) : + device_t *owner, uint32_t clock) : mc68681_device(mconfig, tag, owner, clock), m_csrb(0), m_ip6(0) @@ -734,7 +734,7 @@ apollo_sio::apollo_sio(const machine_config &mconfig, const char *tag, void apollo_sio::device_reset() { - UINT8 input_data = apollo_get_ram_config_byte(); + uint8_t input_data = apollo_get_ram_config_byte(); ip0_w((input_data & 0x01) ? ASSERT_LINE : CLEAR_LINE); ip1_w((input_data & 0x02) ? ASSERT_LINE : CLEAR_LINE); ip2_w((input_data & 0x04) ? ASSERT_LINE : CLEAR_LINE); @@ -881,7 +881,7 @@ const device_type APOLLO_NI = &device_creator ; //------------------------------------------------- apollo_ni::apollo_ni(const machine_config &mconfig, const char *tag, - device_t *owner, UINT32 clock) : + device_t *owner, uint32_t clock) : device_t(mconfig, APOLLO_NI, "Node ID", tag, owner, clock, "node_id", __FILE__), device_image_interface(mconfig, *this) { @@ -923,7 +923,7 @@ void apollo_ni::device_reset() // set node ID //------------------------------------------------- -void apollo_ni::set_node_id(UINT32 node_id) +void apollo_ni::set_node_id(uint32_t node_id) { m_node_id = node_id; CLOG1(("apollo_ni::set_node_id: node ID is %x", node_id)); @@ -940,7 +940,7 @@ WRITE16_MEMBER(apollo_ni::write) READ16_MEMBER(apollo_ni::read) { - UINT16 data = 0; + uint16_t data = 0; switch (offset & 0x0f) { case 1: // msb @@ -971,17 +971,17 @@ image_init_result apollo_ni::call_load() { CLOG1(("apollo_ni::call_load: %s", filename())); - UINT64 size = length(); + uint64_t size = length(); if (size != 32) { CLOG(("apollo_ni::call_load: %s has unexpected file size %d", filename(), size)); } else { - UINT8 data[32]; + uint8_t data[32]; fread(data, sizeof(data)); - UINT8 checksum = data[2] + data[4] + data[6]; + uint8_t checksum = data[2] + data[4] + data[6]; if (checksum != data[30]) { CLOG(("apollo_ni::call_load: checksum is %02x - should be %02x", checksum, data[30])); @@ -1010,7 +1010,7 @@ image_init_result apollo_ni::call_create(int format_type, util::option_resolutio } else { - UINT32 node_id = 0; + uint32_t node_id = 0; sscanf(basename_noext(), "%x", &node_id); if (node_id == 0 || node_id > 0xfffff) { @@ -1018,7 +1018,7 @@ image_init_result apollo_ni::call_create(int format_type, util::option_resolutio } else { - UINT8 data[32]; + uint8_t data[32]; memset(data, 0, sizeof(data)); data[2] = node_id >> 16; data[4] = node_id >> 8; @@ -1048,7 +1048,7 @@ void apollo_ni::call_unload() void apollo_ni::set_node_id_from_disk() { omti8621_apollo_device *omti8621 = machine().device("isa1:wdc"); - UINT8 db[0x50]; + uint8_t db[0x50]; // check label of physical volume and get sector data of logical volume 1 // Note: sector data starts with 32 byte block header @@ -1057,7 +1057,7 @@ void apollo_ni::set_node_id_from_disk() && omti8621->get_sector(0, db, sizeof(db), 0) == sizeof(db) && memcmp(db + 0x22, "APOLLO", 6) == 0) { - UINT16 sector1 = apollo_is_dn5500() ? 4 : 1; + uint16_t sector1 = apollo_is_dn5500() ? 4 : 1; if (omti8621->get_sector(sector1, db, sizeof(db), 0) == sizeof(db)) { @@ -1228,7 +1228,7 @@ MACHINE_START_MEMBER(apollo_state,apollo) MACHINE_RESET_MEMBER(apollo_state,apollo) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 year = apollo_rtc_r(space, 9); + uint8_t year = apollo_rtc_r(space, 9); MLOG1(("machine_reset_apollo")); @@ -1288,7 +1288,7 @@ const device_type APOLLO_STDIO = &device_creator ; //------------------------------------------------- apollo_stdio_device::apollo_stdio_device(const machine_config &mconfig, - const char *tag, device_t *owner, UINT32 clock) : + const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APOLLO_STDIO, "Apollo STDIO", tag, owner, clock, "apollo_stdio", __FILE__), device_serial_interface(mconfig, *this), m_tx_w(*this) @@ -1344,7 +1344,7 @@ void apollo_stdio_device::device_timer(emu_timer &timer, device_timer_id id, void apollo_stdio_device::rcv_complete() // Rx completed receiving byte { receive_register_extract(); - UINT8 data = get_received_char(); + uint8_t data = get_received_char(); // output data to stdout (FIXME: '\r' may confuse ceterm) if (data != '\r') @@ -1383,7 +1383,7 @@ void apollo_stdio_device::tra_callback() // Tx send bit TIMER_CALLBACK_MEMBER(apollo_stdio_device::poll_timer) { #if defined(__linux__) - UINT8 data; + uint8_t data; while (::read(STDIN_FILENO, &data, 1) == 1) { xmit_char(data == '\n' ? '\r' : data); @@ -1391,7 +1391,7 @@ TIMER_CALLBACK_MEMBER(apollo_stdio_device::poll_timer) #endif } -void apollo_stdio_device::xmit_char(UINT8 data) +void apollo_stdio_device::xmit_char(uint8_t data) { CLOG1(("xmit_char %02x - %c", data, data)); diff --git a/src/mame/machine/apollo_dbg.cpp b/src/mame/machine/apollo_dbg.cpp index f2991f8934c..1b551fa38ee 100644 --- a/src/mame/machine/apollo_dbg.cpp +++ b/src/mame/machine/apollo_dbg.cpp @@ -863,9 +863,9 @@ static const char* trap8[] = { // get parameter string for parameter type and value at addr -static const char *get_param(m68000_base_device *m68k, UINT32 addr, char type) +static const char *get_param(m68000_base_device *m68k, uint32_t addr, char type) { - UINT32 value = ~0; + uint32_t value = ~0; // FIXME: static char sb[256]; @@ -873,7 +873,7 @@ static const char *get_param(m68000_base_device *m68k, UINT32 addr, char type) int i; char ch; int maxlen = sizeof(sb) - 2; - UINT32 value1; + uint32_t value1; sb[0] = 0; @@ -936,8 +936,8 @@ static const char *get_param(m68000_base_device *m68k, UINT32 addr, char type) static const char* get_svc_call(m68000_base_device *m68k, int trap_no, int trap_code, char *sb) { - UINT32 sp = REG_A(m68k)[7]; - UINT32 pa; + uint32_t sp = REG_A(m68k)[7]; + uint32_t pa; const char * name = nullptr; const char * param = nullptr; @@ -1035,13 +1035,13 @@ static const char* get_svc_call(m68000_base_device *m68k, int trap_no, static const char * disassemble(m68000_base_device *m68k, offs_t pc, char* sb) { - UINT8 oprom[10]; - UINT8 opram[10]; - UINT32 options = 0; + uint8_t oprom[10]; + uint8_t opram[10]; + uint32_t options = 0; // remember bus error state - UINT32 tmp_buserror_occurred = m68k->mmu_tmp_buserror_occurred; - UINT32 tmp_buserror_address = m68k->mmu_tmp_buserror_address; + uint32_t tmp_buserror_occurred = m68k->mmu_tmp_buserror_occurred; + uint32_t tmp_buserror_address = m68k->mmu_tmp_buserror_address; m68k->mmu_tmp_buserror_occurred = 0; m68k->mmu_tmp_rw = 1; @@ -1070,13 +1070,13 @@ static const char * disassemble(m68000_base_device *m68k, offs_t pc, char* sb) return sb; } -static const UINT16 *get_data(m68000_base_device *m68k, offs_t addr) +static const uint16_t *get_data(m68000_base_device *m68k, offs_t addr) { - static UINT16 data[4]; + static uint16_t data[4]; // remember bus error state - UINT32 tmp_buserror_occurred = m68k->mmu_tmp_buserror_occurred; - UINT32 tmp_buserror_address = m68k->mmu_tmp_buserror_address; + uint32_t tmp_buserror_occurred = m68k->mmu_tmp_buserror_occurred; + uint32_t tmp_buserror_address = m68k->mmu_tmp_buserror_address; m68k->mmu_tmp_buserror_occurred = 0; m68k->mmu_tmp_rw = 1; @@ -1103,16 +1103,16 @@ int apollo_debug_instruction_hook(m68000_base_device *device, offs_t curpc) { // trap data remembered for next rte static struct { - UINT32 pc; - UINT32 sp; - UINT16 trap_no; - UINT16 trap_code; + uint32_t pc; + uint32_t sp; + uint16_t trap_no; + uint16_t trap_code; } trap = { 0, 0, 0, 0 }; if (apollo_config( APOLLO_CONF_TRAP_TRACE | APOLLO_CONF_FPU_TRACE)) { - UINT32 ppc_save; - UINT16 ir; + uint32_t ppc_save; + uint16_t ir; m68000_base_device *m68k = device; m68k->mmu_tmp_buserror_occurred = 0; @@ -1140,7 +1140,7 @@ int apollo_debug_instruction_hook(m68000_base_device *device, offs_t curpc) } else if (ir == 0x4e73) // RTE { - const UINT16 *data = get_data(m68k, REG_A(m68k)[7]); + const uint16_t *data = get_data(m68k, REG_A(m68k)[7]); if ( REG_USP(m68k) == 0 && (data[0] & 0x2000) == 0) { DLOG(("%s sp=%08x RTE: sr=%04x pc=%04x%04x v=%04x usp=%08x", apollo_cpu_context(device->machine().firstcpu), diff --git a/src/mame/machine/apollo_kbd.cpp b/src/mame/machine/apollo_kbd.cpp index 837418b4adc..e86c2465d65 100644 --- a/src/mame/machine/apollo_kbd.cpp +++ b/src/mame/machine/apollo_kbd.cpp @@ -61,7 +61,7 @@ const device_type APOLLO_KBD = &device_creator; // apollo_kbd_device - constructor //------------------------------------------------- -apollo_kbd_device::apollo_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apollo_kbd_device::apollo_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APOLLO_KBD, "Apollo Keyboard", tag, owner, clock, "apollo_kbd", __FILE__), device_serial_interface(mconfig, *this), m_tx_w(*this), @@ -269,7 +269,7 @@ void apollo_kbd_device::mouse::read_mouse() } else if (b != m_last_b || x != m_last_x || y != m_last_y) { - UINT8 mouse_data[4]; + uint8_t mouse_data[4]; int mouse_data_size; int dx = x - m_last_x; @@ -321,7 +321,7 @@ int apollo_kbd_device::keyboard_is_german() return (m_german_r() == ASSERT_LINE) ? true : false; } -void apollo_kbd_device::set_mode(UINT16 mode) +void apollo_kbd_device::set_mode(uint16_t mode) { xmit_char(0xff); xmit_char(mode); @@ -348,7 +348,7 @@ void apollo_kbd_device::tra_complete() // Tx completed sending byte void apollo_kbd_device::rcv_complete() // Rx completed receiving byte { receive_register_extract(); - UINT8 data = get_received_char(); + uint8_t data = get_received_char(); kgetchar(data); } @@ -359,11 +359,11 @@ void apollo_kbd_device::tra_callback() // Tx send bit m_tx_w(bit); } -void apollo_kbd_device::input_callback(UINT8 state) +void apollo_kbd_device::input_callback(uint8_t state) { } -void apollo_kbd_device::xmit_char(UINT8 data) +void apollo_kbd_device::xmit_char(uint8_t data) { // if tx is busy it'll pick this up automatically when it completes if (!m_tx_busy) @@ -386,7 +386,7 @@ void apollo_kbd_device::xmit_char(UINT8 data) putdata - put keyboard data to sio -------------------------------------------------*/ -void apollo_kbd_device::putdata(const UINT8 *data, int data_length) +void apollo_kbd_device::putdata(const uint8_t *data, int data_length) { // send data only if no real Apollo keyboard has been connected if (m_mode > KBD_MODE_1_KEYSTATE) @@ -406,12 +406,12 @@ void apollo_kbd_device::putdata(const UINT8 *data, int data_length) void apollo_kbd_device::putstring(const char *data) { - putdata((UINT8 *) data, strlen(data)); + putdata((uint8_t *) data, strlen(data)); } -void apollo_kbd_device::kgetchar(UINT8 data) +void apollo_kbd_device::kgetchar(uint8_t data) { - static const UINT8 ff1116_data[] = { 0x00, 0xff, 0x00 }; + static const uint8_t ff1116_data[] = { 0x00, 0xff, 0x00 }; LOG1(("getchar <- %02x", data)); @@ -502,15 +502,15 @@ void apollo_kbd_device::kgetchar(UINT8 data) } } -int apollo_kbd_device::push_scancode(UINT8 code, UINT8 repeat) +int apollo_kbd_device::push_scancode(uint8_t code, uint8_t repeat) { int n_chars = 0; - UINT16 key_code = 0; - UINT8 caps = BIT(machine().root_device().ioport("keyboard4")->read(),0); - UINT8 shift = BIT(machine().root_device().ioport("keyboard4")->read(),1) | BIT(machine().root_device().ioport("keyboard4")->read(),5); - UINT8 ctrl = BIT(machine().root_device().ioport("keyboard4")->read(),2); - UINT8 numlock = BIT(machine().root_device().ioport("keyboard4")->read(),6); - UINT16 index; + uint16_t key_code = 0; + uint8_t caps = BIT(machine().root_device().ioport("keyboard4")->read(),0); + uint8_t shift = BIT(machine().root_device().ioport("keyboard4")->read(),1) | BIT(machine().root_device().ioport("keyboard4")->read(),5); + uint8_t ctrl = BIT(machine().root_device().ioport("keyboard4")->read(),2); + uint8_t numlock = BIT(machine().root_device().ioport("keyboard4")->read(),6); + uint16_t index; if (keyboard_is_german()) { @@ -672,7 +672,7 @@ TIMER_CALLBACK_MEMBER(apollo_kbd_device::kbd_scan_timer) } } -UINT16 apollo_kbd_device::m_code_table[] = { +uint16_t apollo_kbd_device::m_code_table[] = { /* Key | Keycap | Down | Up |Unshifted|Shifted|Control|Caps Lock|Up Trans|Auto */ /* Number| Legend | Code | Code|Code | Code | Code |Code | Code |Repeat*/ diff --git a/src/mame/machine/apollo_kbd.h b/src/mame/machine/apollo_kbd.h index 7e5fafe4fba..69921a444ad 100644 --- a/src/mame/machine/apollo_kbd.h +++ b/src/mame/machine/apollo_kbd.h @@ -47,7 +47,7 @@ class apollo_kbd_device : public device_t, public device_serial_interface { public: // construction/destruction - apollo_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apollo_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_tx_cb(device_t &device, _Object object) { return downcast(device).m_tx_w.set_callback(object); } template static devcb_base &set_german_cb(device_t &device, _Object object) { return downcast(device).m_german_r.set_callback(object); } @@ -65,7 +65,7 @@ private: virtual void rcv_complete() override; // Rx completed receiving byte virtual void tra_complete() override; // Tx completed sending byte virtual void tra_callback() override; // Tx send bit - void input_callback(UINT8 state); + void input_callback(uint8_t state); TIMER_CALLBACK_MEMBER( kbd_scan_timer ); @@ -73,15 +73,15 @@ private: template void logerror(Format &&fmt, Params &&... args) const; - void kgetchar(UINT8 data); + void kgetchar(uint8_t data); int keyboard_is_german(); - void set_mode(UINT16 mode); - void putdata(const UINT8 *data, int data_length); + void set_mode(uint16_t mode); + void putdata(const uint8_t *data, int data_length); void putstring(const char *data); - int push_scancode( UINT8 code, UINT8 repeat); + int push_scancode( uint8_t code, uint8_t repeat); void scan_keyboard(); // the keyboard beeper @@ -121,11 +121,11 @@ private: static const int XMIT_RING_SIZE = 64; - UINT8 m_xmitring[XMIT_RING_SIZE]; + uint8_t m_xmitring[XMIT_RING_SIZE]; int m_xmit_read, m_xmit_write; bool m_tx_busy; - void xmit_char(UINT8 data); + void xmit_char(uint8_t data); beeper m_beeper; mouse m_mouse; @@ -141,18 +141,18 @@ private: ioport_port *m_io_mouse3; /* Receiver */ - UINT32 m_rx_message; - UINT16 m_loopback_mode; + uint32_t m_rx_message; + uint16_t m_loopback_mode; emu_timer* m_timer; - UINT16 m_mode; - UINT16 m_delay; // key press delay after initial press - UINT16 m_repeat; // key press repeat rate - UINT16 m_last_pressed; // last key pressed, for repeat key handling + uint16_t m_mode; + uint16_t m_delay; // key press delay after initial press + uint16_t m_repeat; // key press repeat rate + uint16_t m_last_pressed; // last key pressed, for repeat key handling int m_keytime[0x80]; // time until next key press (1 ms) - UINT8 m_keyon[0x80]; // is 1 if key is pressed + uint8_t m_keyon[0x80]; // is 1 if key is pressed - static UINT16 m_code_table[]; + static uint16_t m_code_table[]; }; // device type definition diff --git a/src/mame/machine/apple2.cpp b/src/mame/machine/apple2.cpp index b6c1b9ed651..6ed41ea5d9b 100644 --- a/src/mame/machine/apple2.cpp +++ b/src/mame/machine/apple2.cpp @@ -62,8 +62,8 @@ void apple2_state::apple2_update_memory() read8_delegate *rh; write8_delegate *wh; offs_t begin, end_r, end_w; - UINT8 *rbase, *wbase; - UINT32 offset; + uint8_t *rbase, *wbase; + uint32_t offset; bank_disposition_t bank_disposition; int wh_nop = 0; @@ -378,7 +378,7 @@ READ8_MEMBER(apple2_state::apple2_c080_r) if ((m_machinetype == LASER128) && (slot == 5)) { offset &= 0xf; - UINT8 retval = m_exp_regs[offset]; + uint8_t retval = m_exp_regs[offset]; if (offset == 3) { @@ -513,7 +513,7 @@ WRITE8_MEMBER(apple2_state::apple2_c080_w) } /* returns default CnXX slotram for a slot space */ -INT8 apple2_state::apple2_slotram_r(address_space &space, int slotnum, int offset) +int8_t apple2_state::apple2_slotram_r(address_space &space, int slotnum, int offset) { if (m_slot_ram) { @@ -1097,7 +1097,7 @@ static const apple2_memmap_entry tk2000_memmap_entries[] = { 0 } }; -void apple2_state::apple2_setvar(UINT32 val, UINT32 mask) +void apple2_state::apple2_setvar(uint32_t val, uint32_t mask) { LOG(("apple2_setvar(): val=0x%06x mask=0x%06x pc=0x%04x\n", val, mask, (unsigned int) m_maincpu->pc())); @@ -1127,7 +1127,7 @@ void apple2_state::apple2_setvar(UINT32 val, UINT32 mask) * with FIX: * ----------------------------------------------------------------------- */ -UINT8 apple2_state::apple2_getfloatingbusvalue() +uint8_t apple2_state::apple2_getfloatingbusvalue() { enum { @@ -1301,7 +1301,7 @@ void apple2_state::machine_reset() m_joystick_x1_time = m_joystick_y1_time = 0; m_joystick_x2_time = m_joystick_y2_time = 0; - memset(m_exp_regs, 0, sizeof(UINT8) * 0x10); + memset(m_exp_regs, 0, sizeof(uint8_t) * 0x10); m_exp_wptr = m_exp_liveptr = 0; } @@ -1743,7 +1743,7 @@ WRITE8_MEMBER ( apple2_state::apple2_auxrame000_w ) READ8_MEMBER ( apple2_state::apple2_c00x_r ) { - UINT8 result = 0; + uint8_t result = 0; if(!space.debugger_access()) { @@ -1783,7 +1783,7 @@ READ8_MEMBER ( apple2_state::apple2_c00x_r ) WRITE8_MEMBER ( apple2_state::apple2_c00x_w ) { - UINT32 mask; + uint32_t mask; mask = 1 << (offset / 2); apple2_setvar((offset & 1) ? mask : 0, mask); @@ -1797,7 +1797,7 @@ WRITE8_MEMBER ( apple2_state::apple2_c00x_w ) READ8_MEMBER( apple2_state::apple2_c01x_r ) { - UINT8 result = apple2_getfloatingbusvalue() & 0x7F; + uint8_t result = apple2_getfloatingbusvalue() & 0x7F; if(!space.debugger_access()) { @@ -1917,7 +1917,7 @@ READ8_MEMBER ( apple2_state::apple2_c05x_r ) { if(!space.debugger_access()) { - UINT32 mask; + uint32_t mask; if (m_machinetype == TK2000) { @@ -2078,7 +2078,7 @@ int apple2_state::apple2_fdc_has_525() return 1; //apple525_get_count(machine) > 0; } -static void apple2_fdc_set_lines(device_t *device, UINT8 lines) +static void apple2_fdc_set_lines(device_t *device, uint8_t lines) { apple2_state *state = device->machine().driver_data(); if (state->m_fdc_diskreg & 0x40) @@ -2127,10 +2127,10 @@ static void apple2_fdc_set_enable_lines(device_t *device,int enable_mask) -static UINT8 apple2_fdc_read_data(device_t *device) +static uint8_t apple2_fdc_read_data(device_t *device) { apple2_state *state = device->machine().driver_data(); - UINT8 result = 0x00; + uint8_t result = 0x00; if (state->m_fdc_diskreg & 0x40) { @@ -2153,7 +2153,7 @@ static UINT8 apple2_fdc_read_data(device_t *device) -static void apple2_fdc_write_data(device_t *device, UINT8 data) +static void apple2_fdc_write_data(device_t *device, uint8_t data) { apple2_state *state = device->machine().driver_data(); if (state->m_fdc_diskreg & 0x40) @@ -2201,7 +2201,7 @@ static int apple2_fdc_read_status(device_t *device) } -void apple2_state::apple2_iwm_setdiskreg(UINT8 data) +void apple2_state::apple2_iwm_setdiskreg(uint8_t data) { m_fdc_diskreg = data & 0xC0; if (apple2_fdc_has_35()) @@ -2275,7 +2275,7 @@ void apple2_state::apple2eplus_init_common(void *apple2cp_ce00_ram) memset(&mem_cfg, 0, sizeof(mem_cfg)); mem_cfg.first_bank = 1; mem_cfg.memmap = apple2_memmap_entries; - mem_cfg.auxmem = (UINT8*)apple2cp_ce00_ram; + mem_cfg.auxmem = (uint8_t*)apple2cp_ce00_ram; apple2_setup_memory(&mem_cfg); } @@ -2300,8 +2300,8 @@ MACHINE_START_MEMBER(apple2_state,apple2cp) /* there appears to be some hidden RAM that is swapped in on the Apple * IIc plus; I have not found any official documentation but the BIOS * clearly uses this area as writeable memory */ - apple2cp_ce00_ram = auto_alloc_array(machine(), UINT8, 0x200); - memset(apple2cp_ce00_ram, 0, sizeof(UINT8) * 0x200); + apple2cp_ce00_ram = auto_alloc_array(machine(), uint8_t, 0x200); + memset(apple2cp_ce00_ram, 0, sizeof(uint8_t) * 0x200); m_machinetype = APPLE_IICPLUS; @@ -2322,7 +2322,7 @@ MACHINE_START_MEMBER(apple2_state,apple2e) memset(&mem_cfg, 0, sizeof(mem_cfg)); mem_cfg.first_bank = 1; mem_cfg.memmap = apple2_memmap_entries; - mem_cfg.auxmem = (UINT8*)nullptr; + mem_cfg.auxmem = (uint8_t*)nullptr; apple2_setup_memory(&mem_cfg); } @@ -2336,7 +2336,7 @@ MACHINE_START_MEMBER(apple2_state,laser128) apple2_init_common(); // 1 MB of expansion RAM in slot 5 - m_exp_ram = std::make_unique(1024*1024); + m_exp_ram = std::make_unique(1024*1024); memset(m_exp_ram.get(), 0xff, 1024*1024); m_exp_bankhior = 0xf0; @@ -2353,7 +2353,7 @@ MACHINE_START_MEMBER(apple2_state,laser128) memset(&mem_cfg, 0, sizeof(mem_cfg)); mem_cfg.first_bank = 1; mem_cfg.memmap = apple2_memmap_entries; - mem_cfg.auxmem = (UINT8*)nullptr; + mem_cfg.auxmem = (uint8_t*)nullptr; apple2_setup_memory(&mem_cfg); } @@ -2373,7 +2373,7 @@ MACHINE_START_MEMBER(apple2_state,apple2orig) memset(&mem_cfg, 0, sizeof(mem_cfg)); mem_cfg.first_bank = 1; mem_cfg.memmap = apple2_memmap_entries; - mem_cfg.auxmem = (UINT8*)apple2cp_ce00_ram; + mem_cfg.auxmem = (uint8_t*)apple2cp_ce00_ram; apple2_setup_memory(&mem_cfg); } @@ -2393,7 +2393,7 @@ MACHINE_START_MEMBER(apple2_state,space84) memset(&mem_cfg, 0, sizeof(mem_cfg)); mem_cfg.first_bank = 1; mem_cfg.memmap = apple2_memmap_entries; - mem_cfg.auxmem = (UINT8*)apple2cp_ce00_ram; + mem_cfg.auxmem = (uint8_t*)apple2cp_ce00_ram; apple2_setup_memory(&mem_cfg); } @@ -2413,7 +2413,7 @@ MACHINE_START_MEMBER(apple2_state,laba2p) memset(&mem_cfg, 0, sizeof(mem_cfg)); mem_cfg.first_bank = 1; mem_cfg.memmap = apple2_memmap_entries; - mem_cfg.auxmem = (UINT8*)apple2cp_ce00_ram; + mem_cfg.auxmem = (uint8_t*)apple2cp_ce00_ram; apple2_setup_memory(&mem_cfg); } @@ -2432,11 +2432,11 @@ MACHINE_START_MEMBER(apple2_state,tk2000) memset(&mem_cfg, 0, sizeof(mem_cfg)); mem_cfg.first_bank = 1; mem_cfg.memmap = tk2000_memmap_entries; - mem_cfg.auxmem = (UINT8*)nullptr; + mem_cfg.auxmem = (uint8_t*)nullptr; apple2_setup_memory(&mem_cfg); } -int apple2_state::apple2_pressed_specialkey(UINT8 key) +int apple2_state::apple2_pressed_specialkey(uint8_t key) { return (m_kbspecial.read_safe(0) & key) || (m_joybuttons.read_safe(0) & key); @@ -2533,7 +2533,7 @@ READ_LINE_MEMBER(apple2_state::ay3600_control_r) return CLEAR_LINE; } -static const UINT8 a2_key_remap[0x32][4] = +static const uint8_t a2_key_remap[0x32][4] = { /* norm shft ctrl both */ { 0x33,0x23,0x33,0x23 }, /* 3 # 00 */ @@ -2612,8 +2612,8 @@ WRITE_LINE_MEMBER(apple2_state::ay3600_iie_data_ready_w) { if (state == ASSERT_LINE) { - UINT8 *decode = m_kbdrom->base(); - UINT16 trans; + uint8_t *decode = m_kbdrom->base(); + uint16_t trans; m_lastchar = m_ay3600->b_r(); diff --git a/src/mame/machine/apple2gs.cpp b/src/mame/machine/apple2gs.cpp index 91430cdce15..37cee8f58e5 100644 --- a/src/mame/machine/apple2gs.cpp +++ b/src/mame/machine/apple2gs.cpp @@ -139,7 +139,7 @@ void apple2gs_state::process_clock() { - UINT8 operation; + uint8_t operation; seconds_t current_interval; /* update clock_curtime */ @@ -233,7 +233,7 @@ void apple2gs_state::process_clock() * Interrupts * ----------------------------------------------------------------------- */ -const char *apple2gs_state::apple2gs_irq_name(UINT16 irq_mask) +const char *apple2gs_state::apple2gs_irq_name(uint16_t irq_mask) { switch(irq_mask) { @@ -250,7 +250,7 @@ const char *apple2gs_state::apple2gs_irq_name(UINT16 irq_mask) return nullptr; } -void apple2gs_state::apple2gs_add_irq(UINT16 irq_mask) +void apple2gs_state::apple2gs_add_irq(uint16_t irq_mask) { if ((m_pending_irqs & irq_mask) == 0x00) { @@ -264,7 +264,7 @@ void apple2gs_state::apple2gs_add_irq(UINT16 irq_mask) -void apple2gs_state::apple2gs_remove_irq(UINT16 irq_mask) +void apple2gs_state::apple2gs_remove_irq(uint16_t irq_mask) { if (m_pending_irqs & irq_mask) { @@ -317,7 +317,7 @@ TIMER_CALLBACK_MEMBER(apple2gs_state::apple2gs_qsecond_tick) #if !RUN_ADB_MICRO -UINT8 apple2gs_state::adb_read_memory(UINT32 address) +uint8_t apple2gs_state::adb_read_memory(uint32_t address) { if (address < ARRAY_LENGTH(m_adb_memory)) return m_adb_memory[address]; @@ -327,7 +327,7 @@ UINT8 apple2gs_state::adb_read_memory(UINT32 address) -void apple2gs_state::adb_write_memory(UINT32 address, UINT8 data) +void apple2gs_state::adb_write_memory(uint32_t address, uint8_t data) { if (address < ARRAY_LENGTH(m_adb_memory)) m_adb_memory[address] = data; @@ -335,21 +335,21 @@ void apple2gs_state::adb_write_memory(UINT32 address, UINT8 data) -void apple2gs_state::adb_set_mode(UINT8 mode) +void apple2gs_state::adb_set_mode(uint8_t mode) { m_adb_mode = mode; } -void apple2gs_state::adb_set_config(UINT8 b1, UINT8 b2, UINT8 b3) +void apple2gs_state::adb_set_config(uint8_t b1, uint8_t b2, uint8_t b3) { /* ignore for now */ } -void apple2gs_state::adb_post_response(const UINT8 *bytes, size_t length) +void apple2gs_state::adb_post_response(const uint8_t *bytes, size_t length) { assert(length < ARRAY_LENGTH(m_adb_response_bytes)); memcpy(m_adb_response_bytes, bytes, length); @@ -361,16 +361,16 @@ void apple2gs_state::adb_post_response(const UINT8 *bytes, size_t length) -void apple2gs_state::adb_post_response_1(UINT8 b) +void apple2gs_state::adb_post_response_1(uint8_t b) { adb_post_response(&b, 1); } -void apple2gs_state::adb_post_response_2(UINT8 b1, UINT8 b2) +void apple2gs_state::adb_post_response_2(uint8_t b1, uint8_t b2) { - UINT8 b[2]; + uint8_t b[2]; b[0] = b1; b[1] = b2; adb_post_response(b, 2); @@ -380,8 +380,8 @@ void apple2gs_state::adb_post_response_2(UINT8 b1, UINT8 b2) void apple2gs_state::adb_do_command() { int device; - UINT32 address; - UINT8 val; + uint32_t address; + uint8_t val; m_adb_state = ADBSTATE_IDLE; if (LOG_ADB) @@ -467,9 +467,9 @@ void apple2gs_state::adb_do_command() } -UINT8 apple2gs_state::adb_read_datareg() +uint8_t apple2gs_state::adb_read_datareg() { - UINT8 result; + uint8_t result; switch(m_adb_state) { @@ -495,7 +495,7 @@ UINT8 apple2gs_state::adb_read_datareg() } -void apple2gs_state::adb_write_datareg(UINT8 data) +void apple2gs_state::adb_write_datareg(uint8_t data) { if (LOG_ADB) logerror("adb_write_datareg(): data=0x%02x\n", data); @@ -612,13 +612,13 @@ void apple2gs_state::adb_write_datareg(UINT8 data) // real rom 3 h/w reads 0x90 when idle, 0x98 when key pressed // current MESS reads back 0xb0 when idle -UINT8 apple2gs_state::adb_read_kmstatus() +uint8_t apple2gs_state::adb_read_kmstatus() { return m_adb_kmstatus; } -void apple2gs_state::adb_write_kmstatus(UINT8 data) +void apple2gs_state::adb_write_kmstatus(uint8_t data) { m_adb_kmstatus &= ~0x54; m_adb_kmstatus |= data & 0x54; @@ -626,11 +626,11 @@ void apple2gs_state::adb_write_kmstatus(UINT8 data) -UINT8 apple2gs_state::adb_read_mousedata() +uint8_t apple2gs_state::adb_read_mousedata() { - UINT8 result = 0x00; - UINT8 absolute; - INT8 delta; + uint8_t result = 0x00; + uint8_t absolute; + int8_t delta; if (m_adb_kmstatus & 0x80) // mouse register full { @@ -659,7 +659,7 @@ UINT8 apple2gs_state::adb_read_mousedata() } -INT8 apple2gs_state::seven_bit_diff(UINT8 v1, UINT8 v2) +int8_t apple2gs_state::seven_bit_diff(uint8_t v1, uint8_t v2) { v1 -= v2; if (v1 & 0x40) @@ -673,7 +673,7 @@ INT8 apple2gs_state::seven_bit_diff(UINT8 v1, UINT8 v2) void apple2gs_state::adb_check_mouse() { - UINT8 new_mouse_x, new_mouse_y; + uint8_t new_mouse_x, new_mouse_y; /* read mouse values */ if ((m_adb_kmstatus & 0x80) == 0x00) @@ -698,7 +698,7 @@ void apple2gs_state::adb_check_mouse() #endif -void apple2gs_state::apple2gs_set_scanint(UINT8 data) +void apple2gs_state::apple2gs_set_scanint(uint8_t data) { /* second interrupt */ if ((m_vgcint & 0x40) && !(data & 0x40)) @@ -729,7 +729,7 @@ TIMER_CALLBACK_MEMBER(apple2gs_state::apple2gs_scanline_tick) /* check scanline interrupt bits if we're in super hi-res and the current scanline is within the active display area */ if ((m_newvideo & 0x80) && (scanline >= (BORDER_TOP-1)) && (scanline < (200+BORDER_TOP-1))) { - UINT8 scb; + uint8_t scb; scb = m_slowmem[0x19D00 + scanline - BORDER_TOP + 1]; @@ -785,7 +785,7 @@ TIMER_CALLBACK_MEMBER(apple2gs_state::apple2gs_scanline_tick) READ8_MEMBER( apple2gs_state::gssnd_r ) { - UINT8 ret = 0; + uint8_t ret = 0; switch (offset) { @@ -797,7 +797,7 @@ READ8_MEMBER( apple2gs_state::gssnd_r ) if (m_sndglu_ctrl & 0x40) // docram access { - UINT8 *docram = memregion("es5503")->base(); + uint8_t *docram = memregion("es5503")->base(); m_sndglu_dummy_read = docram[m_sndglu_addr]; } else @@ -837,7 +837,7 @@ WRITE8_MEMBER( apple2gs_state::gssnd_w ) case 1: // data write if (m_sndglu_ctrl & 0x40) // docram access { - UINT8 *docram = memregion("es5503")->base(); + uint8_t *docram = memregion("es5503")->base(); docram[m_sndglu_addr] = data; } else @@ -871,7 +871,7 @@ WRITE8_MEMBER( apple2gs_state::gssnd_w ) int apple2gs_state::apple2gs_get_vpos() { int result, scan; - static const UINT8 top_border_vert[BORDER_TOP] = + static const uint8_t top_border_vert[BORDER_TOP] = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xff, @@ -894,7 +894,7 @@ int apple2gs_state::apple2gs_get_vpos() READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r ) { - UINT8 result; + uint8_t result; scc8530_t *scc; if(space.debugger_access()) @@ -943,7 +943,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r ) result = 0; { - UINT8 temp = m_kbspecial->read(); + uint8_t temp = m_kbspecial->read(); if (temp & 1) // capslock { result |= 4; @@ -1447,7 +1447,7 @@ static void apple2gs_mem_004000(running_machine &machine,offs_t begin, offs_t en meminfo->write_handler = (state->m_flags & VAR_RAMWRT) ? &state->write_delegates_2gs4000[0] : &state->write_delegates_2gs4000[1]; } -static void apple2gs_mem_xxD000(running_machine &machine,apple2_meminfo *meminfo, UINT32 lcmem) +static void apple2gs_mem_xxD000(running_machine &machine,apple2_meminfo *meminfo, uint32_t lcmem) { apple2gs_state *state = machine.driver_data(); if (state->m_flags & VAR_LCRAM) @@ -1475,7 +1475,7 @@ static void apple2gs_mem_xxD000(running_machine &machine,apple2_meminfo *meminfo } } -static void apple2gs_mem_xxE000(running_machine &machine,apple2_meminfo *meminfo, UINT32 lcmem) +static void apple2gs_mem_xxE000(running_machine &machine,apple2_meminfo *meminfo, uint32_t lcmem) { apple2gs_state *state = machine.driver_data(); if (state->m_flags & VAR_LCRAM) @@ -1590,9 +1590,9 @@ static const apple2_memmap_entry apple2gs_memmap_entries[] = -UINT8 *apple2gs_state::apple2gs_getslotmem(offs_t address) +uint8_t *apple2gs_state::apple2gs_getslotmem(offs_t address) { - UINT8 *rom; + uint8_t *rom; address %= 0x00FFFF; assert(address >= 0xC000); @@ -1605,9 +1605,9 @@ UINT8 *apple2gs_state::apple2gs_getslotmem(offs_t address) -UINT8 apple2gs_state::apple2gs_xxCxxx_r(address_space &space, offs_t address) +uint8_t apple2gs_state::apple2gs_xxCxxx_r(address_space &space, offs_t address) { - UINT8 result; + uint8_t result; int slot; if ((m_shadow & 0x40) && ((address & 0xF00000) == 0x000000)) // shadow all banks and C0xx? @@ -1687,7 +1687,7 @@ UINT8 apple2gs_state::apple2gs_xxCxxx_r(address_space &space, offs_t address) -void apple2gs_state::apple2gs_xxCxxx_w(address_space &space, offs_t address, UINT8 data) +void apple2gs_state::apple2gs_xxCxxx_w(address_space &space, offs_t address, uint8_t data) { int slot; @@ -1821,7 +1821,7 @@ void apple2gs_state::apple2gs_setup_memory() apple2_memmap_config cfg; /* allocate memory for E00000-E1FFFF */ - m_slowmem = make_unique_clear(128*1024); + m_slowmem = make_unique_clear(128*1024); save_pointer(m_slowmem.get(), "APPLE2GS_SLOWMEM", 128*1024); // install expanded memory @@ -1972,7 +1972,7 @@ MACHINE_START_MEMBER(apple2gs_state,apple2gscommon) machine().device("nvram")->set_base(m_clock_bram, sizeof(m_clock_bram)); /* save state stuff. note that the driver takes care of docram. */ - UINT8* ram = m_ram->pointer(); + uint8_t* ram = m_ram->pointer(); save_pointer(ram, "APPLE2GS_RAM", m_ram->size()); save_item(m_newvideo, "NEWVIDEO"); @@ -2061,9 +2061,9 @@ void apple2gs_state::apple2gs_refresh_delegates() * Keym_glu / low-level ADB emulation * ----------------------------------------------------------------------- */ #if RUN_ADB_MICRO -UINT8 apple2gs_state::keyglu_mcu_read(UINT8 offset) +uint8_t apple2gs_state::keyglu_mcu_read(uint8_t offset) { - UINT8 rv = m_glu_regs[offset]; + uint8_t rv = m_glu_regs[offset]; // printf("MCU reads reg %x\n", offset); @@ -2085,7 +2085,7 @@ UINT8 apple2gs_state::keyglu_mcu_read(UINT8 offset) return rv; } -void apple2gs_state::keyglu_mcu_write(UINT8 offset, UINT8 data) +void apple2gs_state::keyglu_mcu_write(uint8_t offset, uint8_t data) { m_glu_regs[offset] = data; @@ -2127,13 +2127,13 @@ void apple2gs_state::keyglu_mcu_write(UINT8 offset, UINT8 data) C027 KMSTATUS = GLU system status register */ -UINT8 apple2gs_state::keyglu_816_read(UINT8 offset) +uint8_t apple2gs_state::keyglu_816_read(uint8_t offset) { switch (offset) { case GLU_C000: { - UINT8 rv; + uint8_t rv; rv = m_glu_regs[GLU_KEY_DATA] & 0x7f; if (m_glu_regs[GLU_KG_STATUS] & KGS_KEYSTROBE) { @@ -2145,7 +2145,7 @@ UINT8 apple2gs_state::keyglu_816_read(UINT8 offset) case GLU_C010: { - UINT8 rv; + uint8_t rv; rv = m_glu_regs[GLU_KEY_DATA] & 0x7f; if (m_glu_regs[GLU_KG_STATUS] & KGS_KEYSTROBE) { @@ -2209,7 +2209,7 @@ UINT8 apple2gs_state::keyglu_816_read(UINT8 offset) return 0xff; } -void apple2gs_state::keyglu_816_write(UINT8 offset, UINT8 data) +void apple2gs_state::keyglu_816_write(uint8_t offset, uint8_t data) { if (offset < GLU_C000) { diff --git a/src/mame/machine/apple3.cpp b/src/mame/machine/apple3.cpp index 1edd8fdbbd8..238e0f46f27 100644 --- a/src/mame/machine/apple3.cpp +++ b/src/mame/machine/apple3.cpp @@ -62,7 +62,7 @@ READ8_MEMBER(apple3_state::apple3_c0xx_r) { - UINT8 result = 0xFF; + uint8_t result = 0xFF; device_a2bus_card_interface *slotdevice; switch(offset) @@ -77,7 +77,7 @@ READ8_MEMBER(apple3_state::apple3_c0xx_r) case 0x08: case 0x09: case 0x0A: case 0x0B: case 0x0C: case 0x0D: case 0x0E: case 0x0F: { - UINT8 tmp = m_kbspecial->read(); + uint8_t tmp = m_kbspecial->read(); result = 0x7c | (m_transchar & 0x80); @@ -476,9 +476,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple3_state::apple3_interrupt) m_via_1->write_cb2(machine().first_screen()->vblank()); } -UINT8 *apple3_state::apple3_bankaddr(UINT16 bank, offs_t offset) +uint8_t *apple3_state::apple3_bankaddr(uint16_t bank, offs_t offset) { - if (bank != (UINT16) ~0) + if (bank != (uint16_t) ~0) { bank %= m_ram->size() / 0x8000; if ((bank + 1) == (m_ram->size() / 0x8000)) @@ -489,7 +489,7 @@ UINT8 *apple3_state::apple3_bankaddr(UINT16 bank, offs_t offset) return &m_ram->pointer()[offset]; } -UINT8 *apple3_state::apple3_get_zpa_addr(offs_t offset) +uint8_t *apple3_state::apple3_get_zpa_addr(offs_t offset) { m_zpa = (((offs_t) m_via_0_b) * 0x100) + offset; @@ -503,8 +503,8 @@ UINT8 *apple3_state::apple3_get_zpa_addr(offs_t offset) void apple3_state::apple3_update_memory() { - UINT16 bank; - UINT8 page; + uint16_t bank; + uint8_t page; if (LOG_MEMORY) { @@ -589,7 +589,7 @@ void apple3_state::apple3_update_memory() -void apple3_state::apple3_via_out(UINT8 *var, UINT8 data) +void apple3_state::apple3_via_out(uint8_t *var, uint8_t data) { if (*var != data) { @@ -680,9 +680,9 @@ MACHINE_RESET_MEMBER(apple3_state,apple3) -UINT8 *apple3_state::apple3_get_indexed_addr(offs_t offset) +uint8_t *apple3_state::apple3_get_indexed_addr(offs_t offset) { - UINT8 *result = nullptr; + uint8_t *result = nullptr; // m_indir_bank is guaranteed to be between 0x80 and 0x8f if (m_indir_bank == 0x8f) @@ -784,14 +784,14 @@ void apple3_state::apple3_postload() READ8_MEMBER(apple3_state::apple3_memory_r) { - UINT8 rv = 0xff; + uint8_t rv = 0xff; // (zp), y or (zp,x) read if (!space.debugger_access()) { if ((m_indir_bank & 0x80) && (offset >= 0x100)) { - UINT8 *test; + uint8_t *test; test = apple3_get_indexed_addr(offset); if (test) @@ -922,7 +922,7 @@ WRITE8_MEMBER(apple3_state::apple3_memory_w) { if ((m_indir_bank & 0x80) && (offset >= 0x100)) { - UINT8 *test; + uint8_t *test; test = apple3_get_indexed_addr(offset); if (test) @@ -1133,7 +1133,7 @@ READ_LINE_MEMBER(apple3_state::ay3600_control_r) return CLEAR_LINE; } -static const UINT8 key_remap[0x50][4] = +static const uint8_t key_remap[0x50][4] = { /* norm shft ctrl both */ { 0x9b,0x9b,0x9b,0x9b }, /* Escape 00 */ @@ -1224,7 +1224,7 @@ WRITE_LINE_MEMBER(apple3_state::ay3600_data_ready_w) if (state == ASSERT_LINE) { - UINT16 trans; + uint16_t trans; int mod = 0; m_lastchar = m_ay3600->b_r(); @@ -1246,7 +1246,7 @@ WRITE_LINE_MEMBER(apple3_state::ay3600_data_ready_w) void apple3_state::pdl_handler(int offset) { - UINT8 pdlread; + uint8_t pdlread; switch (offset) { @@ -1341,7 +1341,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple3_state::paddle_timer) WRITE_LINE_MEMBER(apple3_state::a2bus_irq_w) { - UINT8 irq_mask = m_a2bus->get_a2bus_irq_mask(); + uint8_t irq_mask = m_a2bus->get_a2bus_irq_mask(); m_via_1->write_ca1(state); m_via_1->write_pa7(state); diff --git a/src/mame/machine/apricotkb.cpp b/src/mame/machine/apricotkb.cpp index d58997bb40a..2717e8cb397 100644 --- a/src/mame/machine/apricotkb.cpp +++ b/src/mame/machine/apricotkb.cpp @@ -245,7 +245,7 @@ ioport_constructor apricot_keyboard_device::device_input_ports() const // apricot_keyboard_device - constructor //------------------------------------------------- -apricot_keyboard_device::apricot_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +apricot_keyboard_device::apricot_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APRICOT_KEYBOARD, "Apricot Keyboard", tag, owner, clock, "aprikb", __FILE__), m_write_txd(*this), m_y(*this, "Y%u", 0), @@ -278,9 +278,9 @@ void apricot_keyboard_device::device_reset() // read_keyboard - //------------------------------------------------- -UINT8 apricot_keyboard_device::read_keyboard() +uint8_t apricot_keyboard_device::read_keyboard() { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 13; i++) { @@ -327,7 +327,7 @@ READ8_MEMBER( apricot_keyboard_device::kb_p6_r ) */ - UINT8 modifiers = m_modifiers->read(); + uint8_t modifiers = m_modifiers->read(); return modifiers << 1; } diff --git a/src/mame/machine/apricotkb.h b/src/mame/machine/apricotkb.h index 5cc9ed9d2ac..cc5da305b38 100644 --- a/src/mame/machine/apricotkb.h +++ b/src/mame/machine/apricotkb.h @@ -42,7 +42,7 @@ class apricot_keyboard_device : public device_t { public: // construction/destruction - apricot_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apricot_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_txd_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_txd.set_callback(object); } @@ -51,7 +51,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const override; virtual ioport_constructor device_input_ports() const override; - UINT8 read_keyboard(); + uint8_t read_keyboard(); DECLARE_READ8_MEMBER( kb_lo_r ); DECLARE_READ8_MEMBER( kb_hi_r ); @@ -73,7 +73,7 @@ private: required_ioport_array<13> m_y; required_ioport m_modifiers; - UINT16 m_kb_y; + uint16_t m_kb_y; }; diff --git a/src/mame/machine/archimds.cpp b/src/mame/machine/archimds.cpp index a82c38c91c9..ad0d68d0611 100644 --- a/src/mame/machine/archimds.cpp +++ b/src/mame/machine/archimds.cpp @@ -34,7 +34,7 @@ #include "debugger.h" static const int page_sizes[4] = { 4096, 8192, 16384, 32768 }; -static const UINT32 pixel_rate[4] = { 8000000, 12000000, 16000000, 24000000}; +static const uint32_t pixel_rate[4] = { 8000000, 12000000, 16000000, 24000000}; #define IOC_LOG 0 @@ -126,10 +126,10 @@ void archimedes_state::vidc_vblank() void archimedes_state::vidc_video_tick() { address_space &space = m_maincpu->space(AS_PROGRAM); - static UINT8 *vram = m_region_vram->base(); - UINT32 size; - UINT32 m_vidc_ccur; - UINT32 offset_ptr; + static uint8_t *vram = m_region_vram->base(); + uint32_t size; + uint32_t m_vidc_ccur; + uint32_t offset_ptr; size = m_vidc_vidend-m_vidc_vidstart+0x10; @@ -165,10 +165,10 @@ void archimedes_state::vidc_video_tick() void archimedes_state::vidc_audio_tick() { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 ulaw_comp; - INT16 res; - UINT8 ch; - static const INT16 mulawTable[256] = + uint8_t ulaw_comp; + int16_t res; + uint8_t ch; + static const int16_t mulawTable[256] = { -32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956, -23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764, @@ -206,7 +206,7 @@ void archimedes_state::vidc_audio_tick() for(ch=0;ch<8;ch++) { - UINT8 ulaw_temp = (space.read_byte(m_vidc_sndstart+m_vidc_sndcur + ch)) ^ 0xff; + uint8_t ulaw_temp = (space.read_byte(m_vidc_sndstart+m_vidc_sndcur + ch)) ^ 0xff; ulaw_comp = (ulaw_temp>>1) | ((ulaw_temp&1)<<7); @@ -314,14 +314,14 @@ void archimedes_state::archimedes_init() READ32_MEMBER(archimedes_state::archimedes_memc_logical_r) { - UINT32 page, poffs; + uint32_t page, poffs; // are we mapping in the boot ROM? if (m_memc_latchrom) { - UINT32 *rom; + uint32_t *rom; - rom = (UINT32 *)m_region_maincpu->base(); + rom = (uint32_t *)m_region_maincpu->base(); return rom[offset & 0x1fffff]; } @@ -352,7 +352,7 @@ READ32_MEMBER(archimedes_state::archimedes_memc_logical_r) WRITE32_MEMBER(archimedes_state::archimedes_memc_logical_w) { - UINT32 page, poffs; + uint32_t page, poffs; // if the boot ROM is mapped, ignore writes if (m_memc_latchrom) @@ -381,14 +381,14 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_logical_w) /* Aristocrat Mark 5 - same as normal AA except with Dram emulator */ READ32_MEMBER(archimedes_state::aristmk5_drame_memc_logical_r) { - UINT32 page, poffs; + uint32_t page, poffs; // are we mapping in the boot ROM? if (m_memc_latchrom) { - UINT32 *rom; + uint32_t *rom; - rom = (UINT32 *)m_region_maincpu->base(); + rom = (uint32_t *)m_region_maincpu->base(); return rom[offset & 0x1fffff]; } @@ -430,7 +430,7 @@ READ32_MEMBER(archimedes_state::aristmk5_drame_memc_logical_r) void archimedes_state::archimedes_driver_init() { - m_archimedes_memc_physmem = reinterpret_cast(memshare("physicalram")->ptr()); + m_archimedes_memc_physmem = reinterpret_cast(memshare("physicalram")->ptr()); // address_space &space = m_maincpu->space(AS_PROGRAM); // space.set_direct_update_handler(direct_update_delegate(FUNC(a310_setopbase), &machine)); } @@ -475,7 +475,7 @@ void archimedes_state::latch_timer_cnt(int tmr) { double time = m_timer[tmr]->elapsed().as_double(); time *= 2000000.0; // find out how many 2 MHz ticks have gone by - m_ioc_timerout[tmr] = m_ioc_timercnt[tmr] - (UINT32)time; + m_ioc_timerout[tmr] = m_ioc_timercnt[tmr] - (uint32_t)time; } bool archimedes_state::check_floppy_ready() @@ -509,8 +509,8 @@ READ32_MEMBER( archimedes_state::ioc_ctrl_r ) { case CONTROL: { - UINT8 i2c_data = 1; - UINT8 flyback; //internal name for vblank here + uint8_t i2c_data = 1; + uint8_t flyback; //internal name for vblank here int vert_pos; bool floppy_ready_state; @@ -708,7 +708,7 @@ WRITE32_MEMBER( archimedes_state::ioc_ctrl_w ) READ32_MEMBER(archimedes_state::archimedes_ioc_r) { - UINT32 ioc_addr; + uint32_t ioc_addr; ioc_addr = offset*4; @@ -779,7 +779,7 @@ READ32_MEMBER(archimedes_state::archimedes_ioc_r) WRITE32_MEMBER(archimedes_state::archimedes_ioc_w) { - UINT32 ioc_addr; + uint32_t ioc_addr; ioc_addr = offset*4; @@ -927,8 +927,8 @@ void archimedes_state::vidc_dynamic_res_change() WRITE32_MEMBER(archimedes_state::archimedes_vidc_w) { - UINT32 reg = data>>24; - UINT32 val = data & 0xffffff; + uint32_t reg = data>>24; + uint32_t val = data & 0xffffff; //#ifdef MAME_DEBUG static const char *const vrnames[] = { @@ -1155,7 +1155,7 @@ The physical page is encoded differently depending on the page size : WRITE32_MEMBER(archimedes_state::archimedes_memc_page_w) { - UINT32 log, phys, memc; + uint32_t log, phys, memc; // perms = (data & 0x300)>>8; log = phys = memc = 0; diff --git a/src/mame/machine/arkanoid.cpp b/src/mame/machine/arkanoid.cpp index bda577de801..7f3af3157ce 100644 --- a/src/mame/machine/arkanoid.cpp +++ b/src/mame/machine/arkanoid.cpp @@ -144,7 +144,7 @@ READ8_MEMBER(arkanoid_state::arkanoid_68705_port_c_r) WRITE8_MEMBER(arkanoid_state::arkanoid_68705_port_c_w) { m_portC_internal = data|0xF0; - UINT8 changed_m_portC_out = (m_portC_out^(m_portC_internal|(~m_ddrC))); + uint8_t changed_m_portC_out = (m_portC_out^(m_portC_internal|(~m_ddrC))); m_portC_out = (m_portC_internal|(~m_ddrC)); /* bits 0 and 1 are inputs, should never be set as outputs here. if they are, ignore them. */ @@ -176,7 +176,7 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_68705_ddr_c_w) { if ((data|0xF0)^m_ddrC) // if ddr changed, recalculate the port c output { - UINT8 changed_m_portC_out = (m_portC_out^(m_portC_internal|(~(data|0xF0)))); + uint8_t changed_m_portC_out = (m_portC_out^(m_portC_internal|(~(data|0xF0)))); m_portC_out = (m_portC_internal|(~(data|0xF0))); /* bits 0 and 1 are inputs, should never be set as outputs here. if they are, ignore them. */ @@ -291,7 +291,7 @@ TO DO (2006.09.12) : /* Kludge for some bootlegs that read this address */ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_f000_r) { - UINT8 arkanoid_bootleg_val = 0x00; + uint8_t arkanoid_bootleg_val = 0x00; switch (m_bootleg_id) { @@ -333,7 +333,7 @@ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_f000_r) /* Kludge for some bootlegs that read this address */ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_f002_r) { - UINT8 arkanoid_bootleg_val = 0x00; + uint8_t arkanoid_bootleg_val = 0x00; switch (m_bootleg_id) { @@ -682,9 +682,9 @@ READ8_MEMBER(arkanoid_state::block2_bootleg_f000_r) /* Kludge for some bootlegs that read this address */ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_d008_r) { - UINT8 arkanoid_bootleg_d008_bit[8]; - UINT8 arkanoid_bootleg_d008_val; - UINT8 arkanoid_paddle_value = ioport("MUX")->read(); + uint8_t arkanoid_bootleg_d008_bit[8]; + uint8_t arkanoid_bootleg_d008_val; + uint8_t arkanoid_paddle_value = ioport("MUX")->read(); int b; arkanoid_bootleg_d008_bit[4] = arkanoid_bootleg_d008_bit[6] = arkanoid_bootleg_d008_bit[7] = 0; /* untested bits */ diff --git a/src/mame/machine/asic65.cpp b/src/mame/machine/asic65.cpp index 58b46fda1fb..a1ea4d222a1 100644 --- a/src/mame/machine/asic65.cpp +++ b/src/mame/machine/asic65.cpp @@ -36,7 +36,7 @@ #define MAX_COMMANDS 0x2b -static const UINT8 command_map[3][MAX_COMMANDS] = +static const uint8_t command_map[3][MAX_COMMANDS] = { { /* standard version */ @@ -84,7 +84,7 @@ static const UINT8 command_map[3][MAX_COMMANDS] = const device_type ASIC65 = &device_creator; -asic65_device::asic65_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +asic65_device::asic65_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASIC65, "Atari ASIC65", tag, owner, clock, "asic65", __FILE__), m_asic65_type(0), m_command(0), @@ -239,8 +239,8 @@ WRITE16_MEMBER( asic65_device::data_w ) READ16_MEMBER( asic65_device::read ) { - INT64 element, result64 = 0; - UINT16 result = 0; + int64_t element, result64 = 0; + uint16_t result = 0; /* rom-based just returns latched data */ if (m_asic65_type == ASIC65_ROMBASED) @@ -282,21 +282,21 @@ READ16_MEMBER( asic65_device::read ) case OP_SIN: /* sin */ if (m_param_index >= 1) - result = (int)(16384. * sin(M_PI * (double)(INT16)m_param[0] / 32768.)); + result = (int)(16384. * sin(M_PI * (double)(int16_t)m_param[0] / 32768.)); break; case OP_COS: /* cos */ if (m_param_index >= 1) - result = (int)(16384. * cos(M_PI * (double)(INT16)m_param[0] / 32768.)); + result = (int)(16384. * cos(M_PI * (double)(int16_t)m_param[0] / 32768.)); break; case OP_ATAN: /* vector angle */ if (m_param_index >= 4) { - INT32 xint = (INT32)((m_param[0] << 16) | m_param[1]); - INT32 yint = (INT32)((m_param[2] << 16) | m_param[3]); + int32_t xint = (int32_t)((m_param[0] << 16) | m_param[1]); + int32_t yint = (int32_t)((m_param[2] << 16) | m_param[3]); double a = atan2((double)yint, (double)xint); - result = (INT16)(a * 32768. / M_PI); + result = (int16_t)(a * 32768. / M_PI); } break; @@ -305,29 +305,29 @@ READ16_MEMBER( asic65_device::read ) /* in Race Drivin' will be off */ if (m_param_index >= 9+6) { - INT32 v0 = (INT32)((m_param[9] << 16) | m_param[10]); - INT32 v1 = (INT32)((m_param[11] << 16) | m_param[12]); - INT32 v2 = (INT32)((m_param[13] << 16) | m_param[14]); + int32_t v0 = (int32_t)((m_param[9] << 16) | m_param[10]); + int32_t v1 = (int32_t)((m_param[11] << 16) | m_param[12]); + int32_t v2 = (int32_t)((m_param[13] << 16) | m_param[14]); /* 2 results per element */ switch (m_result_index / 2) { case 0: - result64 = (INT64)v0 * (INT16)m_param[0] + - (INT64)v1 * (INT16)m_param[3] + - (INT64)v2 * (INT16)m_param[6]; + result64 = (int64_t)v0 * (int16_t)m_param[0] + + (int64_t)v1 * (int16_t)m_param[3] + + (int64_t)v2 * (int16_t)m_param[6]; break; case 1: - result64 = (INT64)v0 * (INT16)m_param[1] + - (INT64)v1 * (INT16)m_param[4] + - (INT64)v2 * (INT16)m_param[7]; + result64 = (int64_t)v0 * (int16_t)m_param[1] + + (int64_t)v1 * (int16_t)m_param[4] + + (int64_t)v2 * (int16_t)m_param[7]; break; case 2: - result64 = (INT64)v0 * (INT16)m_param[2] + - (INT64)v1 * (INT16)m_param[5] + - (INT64)v2 * (INT16)m_param[8]; + result64 = (int64_t)v0 * (int16_t)m_param[2] + + (int64_t)v1 * (int16_t)m_param[5] + + (int64_t)v2 * (int16_t)m_param[8]; break; } @@ -341,29 +341,29 @@ READ16_MEMBER( asic65_device::read ) case OP_MATRIXMULT: /* matrix multiply???? */ if (m_param_index >= 9+6) { - INT32 v0 = (INT32)((m_param[9] << 16) | m_param[10]); - INT32 v1 = (INT32)((m_param[11] << 16) | m_param[12]); - INT32 v2 = (INT32)((m_param[13] << 16) | m_param[14]); + int32_t v0 = (int32_t)((m_param[9] << 16) | m_param[10]); + int32_t v1 = (int32_t)((m_param[11] << 16) | m_param[12]); + int32_t v2 = (int32_t)((m_param[13] << 16) | m_param[14]); /* 2 results per element */ switch (m_result_index / 2) { case 0: - result64 = (INT64)v0 * (INT16)m_param[0] + - (INT64)v1 * (INT16)m_param[1] + - (INT64)v2 * (INT16)m_param[2]; + result64 = (int64_t)v0 * (int16_t)m_param[0] + + (int64_t)v1 * (int16_t)m_param[1] + + (int64_t)v2 * (int16_t)m_param[2]; break; case 1: - result64 = (INT64)v0 * (INT16)m_param[3] + - (INT64)v1 * (INT16)m_param[4] + - (INT64)v2 * (INT16)m_param[5]; + result64 = (int64_t)v0 * (int16_t)m_param[3] + + (int64_t)v1 * (int16_t)m_param[4] + + (int64_t)v2 * (int16_t)m_param[5]; break; case 2: - result64 = (INT64)v0 * (INT16)m_param[6] + - (INT64)v1 * (INT16)m_param[7] + - (INT64)v2 * (INT16)m_param[8]; + result64 = (int64_t)v0 * (int16_t)m_param[6] + + (int64_t)v1 * (int16_t)m_param[7] + + (int64_t)v2 * (int16_t)m_param[8]; break; } @@ -389,22 +389,22 @@ READ16_MEMBER( asic65_device::read ) /* return 0 == scale factor for 1/z */ /* return 1 == transformed X */ /* return 2 == transformed Y, taking height into account */ - element = (INT16)m_param[0]; + element = (int16_t)m_param[0]; if (m_param_index == 2) { - result64 = (element * (INT16)m_param[1]) >> 8; + result64 = (element * (int16_t)m_param[1]) >> 8; result64 -= 1; if (result64 > 0x3fff) result64 = 0; } else if (m_param_index == 3) { - result64 = (element * (INT16)m_param[2]) >> 15; + result64 = (element * (int16_t)m_param[2]) >> 15; result64 += 0xa8; } else if (m_param_index == 4) { - result64 = (INT16)((element * (INT16)m_param[3]) >> 10); - result64 = (INT16)m_yorigin - result64 - (result64 << 1); + result64 = (int16_t)((element * (int16_t)m_param[3]) >> 10); + result64 = (int16_t)m_yorigin - result64 - (result64 << 1); } result = result64 & 0xffff; } @@ -416,13 +416,13 @@ READ16_MEMBER( asic65_device::read ) case OP_SETBANK: /* set a bank */ { - static const UINT8 banklist[] = + static const uint8_t banklist[] = { 1,4,0,4,4,3,4,2, 4,4,4,4,4,4,4,4, 3,3,4,4,1,1,0,0, 4,4,4,4,2,2,4,4, 4,4 }; - static const UINT16 bankaddr[][8] = + static const uint16_t bankaddr[][8] = { { 0x77c0,0x77ce,0x77c2,0x77cc,0x77c4,0x77ca,0x77c6,0x77c8 }, { 0x77d0,0x77de,0x77d2,0x77dc,0x77d4,0x77da,0x77d6,0x77d8 }, @@ -442,7 +442,7 @@ READ16_MEMBER( asic65_device::read ) case OP_VERIFYBANK: /* verify a bank */ { - static const UINT16 bankverify[] = + static const uint16_t bankverify[] = { 0x0eb2,0x1000,0x171b,0x3d28 }; diff --git a/src/mame/machine/asic65.h b/src/mame/machine/asic65.h index 0f481e2b6c0..1a4111afc51 100644 --- a/src/mame/machine/asic65.h +++ b/src/mame/machine/asic65.h @@ -18,7 +18,7 @@ class asic65_device : public device_t { public: - asic65_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + asic65_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // (static) configuration helpers static void set_type(device_t &device, int type) { downcast(device).m_asic65_type = type; } @@ -48,23 +48,23 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 m_asic65_type; + uint8_t m_asic65_type; int m_command; - UINT16 m_param[32]; - UINT16 m_yorigin; - UINT8 m_param_index; - UINT8 m_result_index; - UINT8 m_reset_state; - UINT8 m_last_bank; + uint16_t m_param[32]; + uint16_t m_yorigin; + uint8_t m_param_index; + uint8_t m_result_index; + uint8_t m_reset_state; + uint8_t m_last_bank; /* ROM-based interface states */ required_device m_ourcpu; - UINT8 m_tfull; - UINT8 m_68full; - UINT8 m_cmd; - UINT8 m_xflg; - UINT16 m_68data; - UINT16 m_tdata; + uint8_t m_tfull; + uint8_t m_68full; + uint8_t m_cmd; + uint8_t m_xflg; + uint16_t m_68data; + uint16_t m_tdata; FILE * m_log; }; diff --git a/src/mame/machine/asteroid.cpp b/src/mame/machine/asteroid.cpp index de7eb074d29..eb236c12fd1 100644 --- a/src/mame/machine/asteroid.cpp +++ b/src/mame/machine/asteroid.cpp @@ -122,8 +122,8 @@ void asteroid_state::machine_start() /* configure RAM banks if present (not on llander) */ if (m_ram1.target() != nullptr) { - UINT8 *ram1 = reinterpret_cast(memshare("ram1")->ptr()); - UINT8 *ram2 = reinterpret_cast(memshare("ram2")->ptr()); + uint8_t *ram1 = reinterpret_cast(memshare("ram1")->ptr()); + uint8_t *ram2 = reinterpret_cast(memshare("ram2")->ptr()); /* swapped */ m_ram1->configure_entry(1, ram2); diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp index fe5e4bf790b..43239c8095e 100644 --- a/src/mame/machine/at.cpp +++ b/src/mame/machine/at.cpp @@ -17,7 +17,7 @@ const device_type AT_MB = &device_creator; -at_mb_device::at_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at_mb_device::at_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AT_MB, "PC/AT Motherboard", tag, owner, clock, "at_mb", __FILE__), m_maincpu(*this, ":maincpu"), m_isabus(*this, "isabus"), @@ -173,7 +173,7 @@ READ8_MEMBER( at_mb_device::get_slave_ack ) * *************************************************************************/ -void at_mb_device::speaker_set_spkrdata(UINT8 data) +void at_mb_device::speaker_set_spkrdata(uint8_t data) { m_at_spkrdata = data ? 1 : 0; m_speaker->level_w(m_at_spkrdata & m_pit_out2); @@ -202,7 +202,7 @@ WRITE_LINE_MEMBER( at_mb_device::pit8254_out2_changed ) READ8_MEMBER( at_mb_device::page8_r ) { - UINT8 data = m_at_pages[offset % 0x10]; + uint8_t data = m_at_pages[offset % 0x10]; switch(offset % 8) { @@ -264,7 +264,7 @@ READ8_MEMBER(at_mb_device::dma_read_byte) address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space if(m_dma_channel == -1) return 0xff; - UINT8 result; + uint8_t result; offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16; result = prog_space.read_byte(page_offset + offset); @@ -288,7 +288,7 @@ READ8_MEMBER(at_mb_device::dma_read_word) address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space if(m_dma_channel == -1) return 0xff; - UINT16 result; + uint16_t result; offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; result = prog_space.read_word((page_offset & 0xfe0000) | (offset << 1)); @@ -312,9 +312,9 @@ READ8_MEMBER( at_mb_device::dma8237_0_dack_r ) { return m_isabus->dack_r(0); } READ8_MEMBER( at_mb_device::dma8237_1_dack_r ) { return m_isabus->dack_r(1); } READ8_MEMBER( at_mb_device::dma8237_2_dack_r ) { return m_isabus->dack_r(2); } READ8_MEMBER( at_mb_device::dma8237_3_dack_r ) { return m_isabus->dack_r(3); } -READ8_MEMBER( at_mb_device::dma8237_5_dack_r ) { UINT16 ret = m_isabus->dack16_r(5); m_dma_high_byte = ret & 0xff00; return ret; } -READ8_MEMBER( at_mb_device::dma8237_6_dack_r ) { UINT16 ret = m_isabus->dack16_r(6); m_dma_high_byte = ret & 0xff00; return ret; } -READ8_MEMBER( at_mb_device::dma8237_7_dack_r ) { UINT16 ret = m_isabus->dack16_r(7); m_dma_high_byte = ret & 0xff00; return ret; } +READ8_MEMBER( at_mb_device::dma8237_5_dack_r ) { uint16_t ret = m_isabus->dack16_r(5); m_dma_high_byte = ret & 0xff00; return ret; } +READ8_MEMBER( at_mb_device::dma8237_6_dack_r ) { uint16_t ret = m_isabus->dack16_r(6); m_dma_high_byte = ret & 0xff00; return ret; } +READ8_MEMBER( at_mb_device::dma8237_7_dack_r ) { uint16_t ret = m_isabus->dack16_r(7); m_dma_high_byte = ret & 0xff00; return ret; } WRITE8_MEMBER( at_mb_device::dma8237_0_dack_w ){ m_isabus->dack_w(0, data); } @@ -358,7 +358,7 @@ WRITE8_MEMBER( at_mb_device::write_rtc ) } } -UINT32 at_mb_device::a20_286(bool state) +uint32_t at_mb_device::a20_286(bool state) { return (state ? 0xffffff : 0xefffff); } @@ -379,7 +379,7 @@ WRITE_LINE_MEMBER( at_mb_device::dack7_w ) { set_dma_channel(7, state); } READ8_MEMBER( at_mb_device::portb_r ) { - UINT8 data = m_at_speaker; + uint8_t data = m_at_speaker; data &= ~0xd0; /* AT BIOS don't likes this being set */ /* 0x10 is the dram refresh line bit, 15.085us. */ diff --git a/src/mame/machine/at.h b/src/mame/machine/at.h index 98f22c0ce2d..12d6895197c 100644 --- a/src/mame/machine/at.h +++ b/src/mame/machine/at.h @@ -16,7 +16,7 @@ class at_mb_device : public device_t { public: - at_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_ADDRESS_MAP(map, 16); @@ -59,14 +59,14 @@ public: DECLARE_READ8_MEMBER(dma_read_word); DECLARE_WRITE8_MEMBER(dma_write_word); - UINT32 a20_286(bool state); + uint32_t a20_286(bool state); protected: void device_start() override; void device_reset() override; virtual machine_config_constructor device_mconfig_additions() const override; private: void set_dma_channel(int channel, int state); - void speaker_set_spkrdata(UINT8 data); + void speaker_set_spkrdata(uint8_t data); required_device m_maincpu; required_device m_isabus; @@ -76,16 +76,16 @@ private: required_device m_pit8254; required_device m_speaker; required_device m_mc146818; - UINT8 m_at_spkrdata; - UINT8 m_pit_out2; + uint8_t m_at_spkrdata; + uint8_t m_pit_out2; int m_dma_channel; bool m_cur_eop; - UINT8 m_dma_offset[2][4]; - UINT8 m_at_pages[0x10]; - UINT16 m_dma_high_byte; - UINT8 m_at_speaker; - UINT8 m_channel_check; - UINT8 m_nmi_enabled; + uint8_t m_dma_offset[2][4]; + uint8_t m_at_pages[0x10]; + uint16_t m_dma_high_byte; + uint8_t m_at_speaker; + uint8_t m_channel_check; + uint8_t m_nmi_enabled; }; extern const device_type AT_MB; diff --git a/src/mame/machine/atari400.cpp b/src/mame/machine/atari400.cpp index a2bf49f3b0d..d911c1c2ce5 100644 --- a/src/mame/machine/atari400.cpp +++ b/src/mame/machine/atari400.cpp @@ -91,7 +91,7 @@ POKEY_INTERRUPT_CB_MEMBER(atari_common_state::interrupt_cb) POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a800_keyboard) { int ipt; - UINT8 ret = 0x00; + uint8_t ret = 0x00; /* decode special */ switch (k543210) @@ -155,7 +155,7 @@ POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a800_keyboard) POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a5200_keypads) { int ipt; - UINT8 ret = 0x00; + uint8_t ret = 0x00; /* decode special */ switch (k543210) diff --git a/src/mame/machine/atari_vg.cpp b/src/mame/machine/atari_vg.cpp index c7d8d514817..0ae26eef201 100644 --- a/src/mame/machine/atari_vg.cpp +++ b/src/mame/machine/atari_vg.cpp @@ -41,7 +41,7 @@ const device_type ATARIVGEAROM = &device_creator; // atari_vg_earom_device - constructor //------------------------------------------------- -atari_vg_earom_device::atari_vg_earom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_vg_earom_device::atari_vg_earom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATARIVGEAROM, "Atari VG EAROM", tag, owner, clock, "atari_vg_earom", __FILE__), device_nvram_interface(mconfig, *this) { diff --git a/src/mame/machine/atari_vg.h b/src/mame/machine/atari_vg.h index 3d7aba7b440..49515261e4b 100644 --- a/src/mame/machine/atari_vg.h +++ b/src/mame/machine/atari_vg.h @@ -26,7 +26,7 @@ class atari_vg_earom_device : public device_t, { public: // construction/destruction - atari_vg_earom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_vg_earom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; diff --git a/src/mame/machine/atarifdc.cpp b/src/mame/machine/atarifdc.cpp index 0221eb398e4..83c870ffac4 100644 --- a/src/mame/machine/atarifdc.cpp +++ b/src/mame/machine/atarifdc.cpp @@ -45,21 +45,21 @@ struct atari_dsk_format { - UINT8 density; - UINT8 tracks; - UINT8 door; - UINT8 sta1; - UINT8 spt; - UINT8 doublesided; - UINT8 highdensity; - UINT8 seclen_hi; - UINT8 seclen_lo; - UINT8 status; - UINT8 sta2; - UINT8 sta3; - UINT8 sta4; - UINT8 cr; - UINT8 info[65+1]; + uint8_t density; + uint8_t tracks; + uint8_t door; + uint8_t sta1; + uint8_t spt; + uint8_t doublesided; + uint8_t highdensity; + uint8_t seclen_hi; + uint8_t seclen_lo; + uint8_t status; + uint8_t sta2; + uint8_t sta3; + uint8_t sta4; + uint8_t cr; + uint8_t info[65+1]; }; /* combined with the size the image should have */ @@ -113,7 +113,7 @@ void atari_fdc_device::atari_load_proc(device_image_interface &image, bool is_cr int id = floppy_get_drive(image); int size, i; - m_drv[id].image = std::make_unique(MAXSIZE); + m_drv[id].image = std::make_unique(MAXSIZE); if (!m_drv[id].image) return; @@ -141,7 +141,7 @@ void atari_fdc_device::atari_load_proc(device_image_interface &image, bool is_cr /* re allocate the buffer; we don't want to be too lazy ;) */ - //m_drv[id].image = (UINT8*)image.image_realloc(m_drv[id].image, size); + //m_drv[id].image = (uint8_t*)image.image_realloc(m_drv[id].image, size); // hack alert, this means we can only load ATR via the softlist at the moment, image.filetype returns "" :/ bool is_softlist_entry = image.software_entry() != nullptr; @@ -351,9 +351,9 @@ void atari_fdc_device::atari_load_proc(device_image_interface &image, bool is_cr * F->A 128/256 byte CKS bad sector table * *****************************************************************************/ -static void make_chksum(device_t *device,UINT8 * chksum, UINT8 data) +static void make_chksum(device_t *device,uint8_t * chksum, uint8_t data) { - UINT8 newone; + uint8_t newone; newone= *chksum + data; if (newone < *chksum) newone++; @@ -386,7 +386,7 @@ void atari_fdc_device::clr_serin(int ser_delay) pokey->serin_ready(ser_delay * 40); } -void atari_fdc_device::add_serin(UINT8 data, int with_checksum) +void atari_fdc_device::add_serin(uint8_t data, int with_checksum) { m_serin_buff[m_serin_count++] = data; if (with_checksum) @@ -751,7 +751,7 @@ legacy_floppy_image_device *atari_fdc_device::atari_floppy_get_device_child(int const device_type ATARI_FDC = &device_creator; -atari_fdc_device::atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_fdc_device::atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATARI_FDC, "Atari FDC", tag, owner, clock, "atari_fdc", __FILE__), m_serout_count(0), m_serout_offs(0), diff --git a/src/mame/machine/atarifdc.h b/src/mame/machine/atarifdc.h index 355dea59aad..f7d8045e207 100644 --- a/src/mame/machine/atarifdc.h +++ b/src/mame/machine/atarifdc.h @@ -13,7 +13,7 @@ class atari_fdc_device : public device_t { public: - atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( serin_r ); DECLARE_WRITE8_MEMBER( serout_w ); @@ -29,14 +29,14 @@ private: void clr_serout(int expect_data); void add_serout(int expect_data); void clr_serin(int ser_delay); - void add_serin(UINT8 data, int with_checksum); + void add_serin(uint8_t data, int with_checksum); void a800_serial_command(); void a800_serial_write(); legacy_floppy_image_device *atari_floppy_get_device_child(int drive); struct atari_drive { - std::unique_ptr image; /* alloc'd image */ + std::unique_ptr image; /* alloc'd image */ int type; /* type of image (XFD, ATR, DSK) */ int mode; /* 0 read only, != 0 read/write */ int density; /* 0 SD, 1 MD, 2 DD */ @@ -51,14 +51,14 @@ private: int m_serout_count; int m_serout_offs; - UINT8 m_serout_buff[512]; - UINT8 m_serout_chksum; + uint8_t m_serout_buff[512]; + uint8_t m_serout_chksum; // int m_serout_delay; int m_serin_count; int m_serin_offs; - UINT8 m_serin_buff[512]; - UINT8 m_serin_chksum; + uint8_t m_serin_buff[512]; + uint8_t m_serin_chksum; int m_serin_delay; atari_drive m_drv[4]; diff --git a/src/mame/machine/atarigen.cpp b/src/mame/machine/atarigen.cpp index ab9a2117bc1..baa7f4b465e 100644 --- a/src/mame/machine/atarigen.cpp +++ b/src/mame/machine/atarigen.cpp @@ -55,7 +55,7 @@ const device_type ATARI_SOUND_COMM = &device_creator; // atari_sound_comm_device - constructor //------------------------------------------------- -atari_sound_comm_device::atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_sound_comm_device::atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATARI_SOUND_COMM, "Atari Sound Communications", tag, owner, clock, "atarscom", __FILE__), m_sound_cpu_tag(nullptr), m_main_int_cb(*this), @@ -348,7 +348,7 @@ const device_type ATARI_VAD = &device_creator; // atari_vad_device - constructor //------------------------------------------------- -atari_vad_device::atari_vad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_vad_device::atari_vad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATARI_VAD, "Atari VAD", tag, owner, clock, "atarivad", __FILE__), device_video_interface(mconfig, *this), m_scanline_int_cb(*this), @@ -378,7 +378,7 @@ atari_vad_device::atari_vad_device(const machine_config &mconfig, const char *ta WRITE16_MEMBER(atari_vad_device::control_write) { - UINT16 newword = m_control[offset]; + uint16_t newword = m_control[offset]; COMBINE_DATA(&newword); internal_control_write(offset, newword); } @@ -441,7 +441,7 @@ WRITE16_MEMBER(atari_vad_device::playfield_latched_lsb_w) { m_playfield_tilemap->write(space, offset, data, mem_mask); if ((m_control[0x0a] & 0x80) != 0) - m_playfield_tilemap->write_ext(space, offset, m_control[0x1d], UINT16(0x00ff)); + m_playfield_tilemap->write_ext(space, offset, m_control[0x1d], uint16_t(0x00ff)); } @@ -455,7 +455,7 @@ WRITE16_MEMBER(atari_vad_device::playfield_latched_msb_w) { m_playfield_tilemap->write(space, offset, data, mem_mask); if ((m_control[0x0a] & 0x80) != 0) - m_playfield_tilemap->write_ext(space, offset, m_control[0x1c], UINT16(0xff00)); + m_playfield_tilemap->write_ext(space, offset, m_control[0x1c], uint16_t(0xff00)); } @@ -469,7 +469,7 @@ WRITE16_MEMBER(atari_vad_device::playfield2_latched_msb_w) { m_playfield2_tilemap->write(space, offset, data, mem_mask); if ((m_control[0x0a] & 0x80) != 0) - m_playfield2_tilemap->write_ext(space, offset, m_control[0x1c], UINT16(0xff00)); + m_playfield2_tilemap->write_ext(space, offset, m_control[0x1c], uint16_t(0xff00)); } @@ -557,10 +557,10 @@ void atari_vad_device::device_timer(emu_timer &timer, device_timer_id id, int pa // control registers and EOF updates //------------------------------------------------- -void atari_vad_device::internal_control_write(offs_t offset, UINT16 newword) +void atari_vad_device::internal_control_write(offs_t offset, uint16_t newword) { // switch off the offset - UINT16 oldword = m_control[offset]; + uint16_t oldword = m_control[offset]; m_control[offset] = newword; switch (offset) { @@ -697,7 +697,7 @@ inline void atari_vad_device::update_pf_xscrolls() // direct control writes. //------------------------------------------------- -void atari_vad_device::update_parameter(UINT16 newword) +void atari_vad_device::update_parameter(uint16_t newword) { switch (newword & 15) { @@ -893,7 +893,7 @@ void atari_eeprom_device::device_reset() // atari_eeprom_2804_device - constructor //------------------------------------------------- -atari_eeprom_2804_device::atari_eeprom_2804_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_eeprom_2804_device::atari_eeprom_2804_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atari_eeprom_device(mconfig, ATARI_EEPROM_2804, "Atari EEPROM Interface (2804)", tag, owner, "atari2804", __FILE__) { } @@ -918,7 +918,7 @@ machine_config_constructor atari_eeprom_2804_device::device_mconfig_additions() // atari_eeprom_2816_device - constructor //------------------------------------------------- -atari_eeprom_2816_device::atari_eeprom_2816_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_eeprom_2816_device::atari_eeprom_2816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atari_eeprom_device(mconfig, ATARI_EEPROM_2816, "Atari EEPROM Interface (2816)", tag, owner, "atari2816", __FILE__) { } @@ -1190,7 +1190,7 @@ void atarigen_state::device_post_load() // slapstic and sets the chip number. //------------------------------------------------- -void atarigen_state::slapstic_configure(cpu_device &device, offs_t base, offs_t mirror, UINT8 *mem) +void atarigen_state::slapstic_configure(cpu_device &device, offs_t base, offs_t mirror, uint8_t *mem) { if (!m_slapstic_device.found()) fatalerror("Slapstic device is missing\n"); @@ -1202,7 +1202,7 @@ void atarigen_state::slapstic_configure(cpu_device &device, offs_t base, offs_t // install the memory handlers address_space &program = device.space(AS_PROGRAM); program.install_readwrite_handler(base, base + 0x7fff, 0, mirror, 0, read16_delegate(FUNC(atarigen_state::slapstic_r), this), write16_delegate(FUNC(atarigen_state::slapstic_w), this)); - m_slapstic = (UINT16 *)mem; + m_slapstic = (uint16_t *)mem; // allocate memory for a copy of bank 0 m_slapstic_bank0.resize(0x2000); @@ -1331,24 +1331,24 @@ void atarigen_state::blend_gfx(int gfx0, int gfx1, int mask0, int mask1) { gfx_element *gx0 = m_gfxdecode->gfx(gfx0); gfx_element *gx1 = m_gfxdecode->gfx(gfx1); - UINT8 *srcdata, *dest; + uint8_t *srcdata, *dest; int c, x, y; // allocate memory for the assembled data - srcdata = auto_alloc_array(machine(), UINT8, gx0->elements() * gx0->width() * gx0->height()); + srcdata = auto_alloc_array(machine(), uint8_t, gx0->elements() * gx0->width() * gx0->height()); // loop over elements dest = srcdata; for (c = 0; c < gx0->elements(); c++) { - const UINT8 *c0base = gx0->get_data(c); - const UINT8 *c1base = gx1->get_data(c); + const uint8_t *c0base = gx0->get_data(c); + const uint8_t *c1base = gx1->get_data(c); // loop over height for (y = 0; y < gx0->height(); y++) { - const UINT8 *c0 = c0base; - const UINT8 *c1 = c1base; + const uint8_t *c0 = c0base; + const uint8_t *c1 = c1base; for (x = 0; x < gx0->width(); x++) *dest++ = (*c0++ & mask0) | (*c1++ & mask1); diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h index b73eb42dd50..9927be55daa 100644 --- a/src/mame/machine/atarigen.h +++ b/src/mame/machine/atarigen.h @@ -108,7 +108,7 @@ class atari_sound_comm_device : public device_t { public: // construction/destruction - atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void static_set_sound_cpu(device_t &device, const char *cputag); @@ -163,10 +163,10 @@ private: m6502_device * m_sound_cpu; bool m_main_to_sound_ready; bool m_sound_to_main_ready; - UINT8 m_main_to_sound_data; - UINT8 m_sound_to_main_data; - UINT8 m_timed_int; - UINT8 m_ym2151_int; + uint8_t m_main_to_sound_data; + uint8_t m_sound_to_main_data; + uint8_t m_timed_int; + uint8_t m_ym2151_int; }; @@ -181,7 +181,7 @@ class atari_vad_device : public device_t, { public: // construction/destruction - atari_vad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_vad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &static_set_scanline_int_cb(device_t &device, _Object object) { return downcast(device).m_scanline_int_cb.set_callback(object); } @@ -219,9 +219,9 @@ private: }; // internal helpers - void internal_control_write(offs_t offset, UINT16 newword); + void internal_control_write(offs_t offset, uint16_t newword); void update_pf_xscrolls(); - void update_parameter(UINT16 newword); + void update_parameter(uint16_t newword); void update_tilerow(emu_timer &timer, int scanline); void eof_update(emu_timer &timer); @@ -233,22 +233,22 @@ private: required_device m_playfield_tilemap; optional_device m_playfield2_tilemap; optional_device m_mob; - optional_shared_ptr m_eof_data; + optional_shared_ptr m_eof_data; emu_timer * m_scanline_int_timer; emu_timer * m_tilerow_update_timer; emu_timer * m_eof_timer; - UINT32 m_palette_bank; // which palette bank is enabled - //UINT32 m_pf0_xscroll; // playfield 1 xscroll - UINT32 m_pf0_xscroll_raw; // playfield 1 xscroll raw value - UINT32 m_pf0_yscroll; // playfield 1 yscroll - UINT32 m_pf1_xscroll_raw; // playfield 2 xscroll raw value - UINT32 m_pf1_yscroll; // playfield 2 yscroll - UINT32 m_mo_xscroll; // sprite xscroll - UINT32 m_mo_yscroll; // sprite xscroll + uint32_t m_palette_bank; // which palette bank is enabled + //uint32_t m_pf0_xscroll; // playfield 1 xscroll + uint32_t m_pf0_xscroll_raw; // playfield 1 xscroll raw value + uint32_t m_pf0_yscroll; // playfield 1 yscroll + uint32_t m_pf1_xscroll_raw; // playfield 2 xscroll raw value + uint32_t m_pf1_yscroll; // playfield 2 yscroll + uint32_t m_mo_xscroll; // sprite xscroll + uint32_t m_mo_yscroll; // sprite xscroll - UINT16 m_control[0x40/2]; // control data + uint16_t m_control[0x40/2]; // control data }; @@ -293,7 +293,7 @@ class atari_eeprom_2804_device : public atari_eeprom_device { public: // construction/destruction - atari_eeprom_2804_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_eeprom_2804_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -304,7 +304,7 @@ class atari_eeprom_2816_device : public atari_eeprom_device { public: // construction/destruction - atari_eeprom_2816_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_eeprom_2816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -355,7 +355,7 @@ public: DECLARE_WRITE16_MEMBER(video_int_ack_w); // slapstic helpers - void slapstic_configure(cpu_device &device, offs_t base, offs_t mirror, UINT8 *mem); + void slapstic_configure(cpu_device &device, offs_t base, offs_t mirror, uint8_t *mem); void slapstic_update_bank(int bank); DECLARE_WRITE16_MEMBER(slapstic_w); DECLARE_READ16_MEMBER(slapstic_r); @@ -380,24 +380,24 @@ public: TID_ATARIGEN_LAST }; - UINT8 m_scanline_int_state; - UINT8 m_sound_int_state; - UINT8 m_video_int_state; + uint8_t m_scanline_int_state; + uint8_t m_sound_int_state; + uint8_t m_video_int_state; - optional_shared_ptr m_xscroll; - optional_shared_ptr m_yscroll; + optional_shared_ptr m_xscroll; + optional_shared_ptr m_yscroll; /* internal state */ - UINT8 m_slapstic_num; - UINT16 * m_slapstic; - UINT8 m_slapstic_bank; - std::vector m_slapstic_bank0; + uint8_t m_slapstic_num; + uint16_t * m_slapstic; + uint8_t m_slapstic_bank; + std::vector m_slapstic_bank0; offs_t m_slapstic_last_pc; offs_t m_slapstic_last_address; offs_t m_slapstic_base; offs_t m_slapstic_mirror; - UINT32 m_scanlines_per_callback; + uint32_t m_scanlines_per_callback; atarigen_screen_timer m_screen_timer[2]; @@ -406,7 +406,7 @@ public: optional_device m_gfxdecode; optional_device m_screen; optional_device m_palette; - optional_shared_ptr m_generic_paletteram_16; + optional_shared_ptr m_generic_paletteram_16; optional_device m_slapstic_device; }; diff --git a/src/mame/machine/atarixga.cpp b/src/mame/machine/atarixga.cpp index 7680a09005a..93054e84fce 100644 --- a/src/mame/machine/atarixga.cpp +++ b/src/mame/machine/atarixga.cpp @@ -24,7 +24,7 @@ extern const device_type ATARI_XGA = &device_creator; -atari_xga_device::atari_xga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_xga_device::atari_xga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATARI_XGA, "Atari XGA", tag, owner, clock, "xga", __FILE__), m_mode(FPGA_RESET), m_address(0), @@ -42,16 +42,16 @@ atari_xga_device::atari_xga_device(const machine_config &mconfig, const char *ta void atari_xga_device::device_start() { - m_ram = std::make_unique(RAM_WORDS); + m_ram = std::make_unique(RAM_WORDS); - save_pointer(NAME(m_ram.get()), RAM_WORDS * sizeof(UINT16)); + save_pointer(NAME(m_ram.get()), RAM_WORDS * sizeof(uint16_t)); save_item(NAME(m_address)); save_item(NAME(m_ciphertext)); } void atari_xga_device::device_reset() { - memset(m_ram.get(), 0, RAM_WORDS * sizeof(UINT16)); + memset(m_ram.get(), 0, RAM_WORDS * sizeof(uint16_t)); m_mode = FPGA_RESET; m_address = 0; m_ciphertext = 0; @@ -69,7 +69,7 @@ void atari_xga_device::device_reset() // Moto Frenzy /* key 0x10 is special, it has 15 "identical twins". */ -static const UINT8 kmap[128] = +static const uint8_t kmap[128] = { 0x6B,0x11,0x1B,0x19,0x4B,0x50,0x17,0x09, 0x5D,0x69,0x43,0x33,0x0F,0x0C,0x28,0x3F, @@ -97,9 +97,9 @@ static const UINT8 kmap[128] = * *************************************/ -UINT16 atari_xga_device::ctz(UINT16 x) +uint16_t atari_xga_device::ctz(uint16_t x) { - UINT16 n = 0; + uint16_t n = 0; if (x == 0) return 16; if (!(x & 0x00FF)) n += 8, x >>= 8; if (!(x & 0x000F)) n += 4, x >>= 4; @@ -108,7 +108,7 @@ UINT16 atari_xga_device::ctz(UINT16 x) return n; } -size_t atari_xga_device::popcount(UINT16 x) +size_t atari_xga_device::popcount(uint16_t x) { size_t count = 0; while (x != 0) @@ -119,33 +119,33 @@ size_t atari_xga_device::popcount(UINT16 x) return count; } -UINT16 atari_xga_device::parity(UINT16 x) +uint16_t atari_xga_device::parity(uint16_t x) { return popcount(x) & 1; } -UINT16 atari_xga_device::lfsr1(UINT16 x) +uint16_t atari_xga_device::lfsr1(uint16_t x) { - const UINT16 bit = parity(x & 0x8016); + const uint16_t bit = parity(x & 0x8016); return (x << 1) | bit; } -UINT16 atari_xga_device::lfsr2(UINT16 x) +uint16_t atari_xga_device::lfsr2(uint16_t x) { - UINT16 bit = parity(x & 0x002D); + uint16_t bit = parity(x & 0x002D); return (x >> 1) | (bit << 15); } -UINT16 atari_xga_device::powers2(UINT8 k, UINT16 x) +uint16_t atari_xga_device::powers2(uint8_t k, uint16_t x) { - static const UINT16 L[16] = { + static const uint16_t L[16] = { 0x5E85,0xBD0B,0x2493,0x17A3, 0x2F47,0x0005,0x000B,0x0017, 0x002F,0x005E,0x00BD,0x017A, 0x02F4,0x05E8,0x0BD0,0x17A1 }; - UINT16 t = (x == 16) ? (L[4] ^ L[5]) : L[x]; + uint16_t t = (x == 16) ? (L[4] ^ L[5]) : L[x]; for (size_t i = 0; i < k; ++i) t = lfsr1(t); @@ -153,9 +153,9 @@ UINT16 atari_xga_device::powers2(UINT8 k, UINT16 x) return t; } -UINT16 atari_xga_device::decipher(UINT8 k, UINT16 c) +uint16_t atari_xga_device::decipher(uint8_t k, uint16_t c) { - UINT16 p = 0; + uint16_t p = 0; /* Only 128 keys internally, if high bit set, then find the 7-bit "twin" by xor 0xA8. */ @@ -167,7 +167,7 @@ UINT16 atari_xga_device::decipher(UINT8 k, UINT16 c) if ((c & (c - 1)) == 0) return powers2(k, ctz(c)); - for (UINT16 bit = 0; bit < 5; ++bit) + for (uint16_t bit = 0; bit < 5; ++bit) { if ((c >> bit) & 1) { @@ -175,7 +175,7 @@ UINT16 atari_xga_device::decipher(UINT8 k, UINT16 c) } } - for (UINT16 bit = 5; bit < 16; ++bit) + for (uint16_t bit = 5; bit < 16; ++bit) { if ((c >> bit) & 1) { @@ -183,8 +183,8 @@ UINT16 atari_xga_device::decipher(UINT8 k, UINT16 c) } } - UINT16 x = 0x8010; - for (UINT16 i = 0; i < k + 3; ++i) + uint16_t x = 0x8010; + for (uint16_t i = 0; i < k + 3; ++i) { if (x == c) { @@ -214,9 +214,9 @@ WRITE32_MEMBER(atari_xga_device::write) case FPGA_SETKEY: /* Write table to FPGA SRAM. */ if (ACCESSING_BITS_16_31) - m_ram[offset << 1] = UINT16 (data >> 16); + m_ram[offset << 1] = uint16_t (data >> 16); if (ACCESSING_BITS_0_15) - m_ram[(offset << 1) + 1] = UINT16(data & 0xFFFF); + m_ram[(offset << 1) + 1] = uint16_t(data & 0xFFFF); break; case FPGA_DECIPHER: @@ -224,12 +224,12 @@ WRITE32_MEMBER(atari_xga_device::write) if (ACCESSING_BITS_16_31) { m_address = offset << 2; - m_ciphertext = UINT16(data >> 16); + m_ciphertext = uint16_t(data >> 16); } if (ACCESSING_BITS_0_15) { m_address = (offset << 2) + 2; - m_ciphertext = UINT16(data & 0xFFFF); + m_ciphertext = uint16_t(data & 0xFFFF); } break; } @@ -253,10 +253,10 @@ READ32_MEMBER(atari_xga_device::read) if (m_mode == FPGA_RESET) return 0; - UINT32 plaintext = 0; + uint32_t plaintext = 0; if (m_mode == FPGA_DECIPHER) { - UINT16 address = (offset << 2) - 0x400; + uint16_t address = (offset << 2) - 0x400; if (ACCESSING_BITS_0_15) address += 2; @@ -264,7 +264,7 @@ READ32_MEMBER(atari_xga_device::read) /* Reply with decrypted plaintext */ if (address == m_address) { - UINT16 key_offset, key_byte; + uint16_t key_offset, key_byte; /* Algorithm to select key byte based on offset. */ key_offset = ((((address >> 4) & 1) ^ 1) << 0) diff --git a/src/mame/machine/atarixga.h b/src/mame/machine/atarixga.h index 8d6980a3ac3..933cf68fce7 100644 --- a/src/mame/machine/atarixga.h +++ b/src/mame/machine/atarixga.h @@ -17,7 +17,7 @@ class atari_xga_device : public device_t { public: // construction/destruction - atari_xga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_xga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE32_MEMBER(write); DECLARE_READ32_MEMBER(read); @@ -36,18 +36,18 @@ private: FPGA_DECIPHER }; - UINT16 powers2(UINT8 k, UINT16 x); - UINT16 lfsr2(UINT16 x); - UINT16 lfsr1(UINT16 x); - UINT16 parity(UINT16 x); - size_t popcount(UINT16 x); - UINT16 ctz(UINT16 x); - UINT16 decipher(UINT8 k, UINT16 c); + uint16_t powers2(uint8_t k, uint16_t x); + uint16_t lfsr2(uint16_t x); + uint16_t lfsr1(uint16_t x); + uint16_t parity(uint16_t x); + size_t popcount(uint16_t x); + uint16_t ctz(uint16_t x); + uint16_t decipher(uint8_t k, uint16_t c); fpga_mode m_mode; - UINT16 m_address; // last written address - UINT16 m_ciphertext; // last written ciphertext - std::unique_ptr m_ram; // CY7C185-45PC, only 16-Kbit used + uint16_t m_address; // last written address + uint16_t m_ciphertext; // last written ciphertext + std::unique_ptr m_ram; // CY7C185-45PC, only 16-Kbit used }; diff --git a/src/mame/machine/awboard.cpp b/src/mame/machine/awboard.cpp index 1e734800c2c..85be7ef263a 100644 --- a/src/mame/machine/awboard.cpp +++ b/src/mame/machine/awboard.cpp @@ -165,7 +165,7 @@ DEVICE_ADDRESS_MAP_START(submap, 16, aw_rom_board) AM_RANGE(0x40, 0x41) AM_READWRITE(pio_r, pio_w) ADDRESS_MAP_END -aw_rom_board::aw_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +aw_rom_board::aw_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : naomi_g1_device(mconfig, AW_ROM_BOARD, "Sammy Atomiswave ROM Board", tag, owner, clock, "aw_rom_board", __FILE__) , m_region(*this, DEVICE_SELF) , m_keyregion(*this, finder_base::DUMMY_TAG) @@ -230,10 +230,10 @@ const aw_rom_board::sbox_set aw_rom_board::sboxes_table[4] = }, }; -UINT16 aw_rom_board::decrypt(UINT16 cipherText, UINT32 address, const UINT32 key) +uint16_t aw_rom_board::decrypt(uint16_t cipherText, uint32_t address, const uint32_t key) { - UINT8 b0,b1,b2,b3; - UINT16 aux; + uint8_t b0,b1,b2,b3; + uint16_t aux; const int* pbox = permutation_table[key>>18]; const sbox_set* ss = &sboxes_table[(key>>16)&3]; @@ -263,7 +263,7 @@ void aw_rom_board::set_key() if (m_keyregion->bytes() != 4) throw emu_fatalerror("AW-ROM-BOARD: key region %s has incorrect size (%d, expected 4)\n", m_keyregion.finder_tag(), m_keyregion->bytes()); - const UINT8 *krp = m_keyregion->base(); + const uint8_t *krp = m_keyregion->base(); rombd_key = (krp[0] << 24) | (krp[1] << 16) | (krp[2] << 8) | krp[3]; } @@ -298,10 +298,10 @@ void aw_rom_board::device_reset() READ16_MEMBER(aw_rom_board::pio_r) { - UINT32 roffset = epr_offset & 0x3ffffff; + uint32_t roffset = epr_offset & 0x3ffffff; if (roffset >= (mpr_offset / 2)) roffset += mpr_bank * 0x4000000; - UINT16 retval = (m_region->bytes() > (roffset * 2)) ? m_region->u16(roffset) : 0; // not endian-safe? + uint16_t retval = (m_region->bytes() > (roffset * 2)) ? m_region->u16(roffset) : 0; // not endian-safe? return retval; } @@ -359,26 +359,26 @@ void aw_rom_board::recalc_dma_offset(int mode) case MPR_RECORD: dma_offset = mpr_offset + mpr_record_index * 0x40; - dma_limit = std::min((UINT32)0x8000000, m_region->bytes()); + dma_limit = std::min((uint32_t)0x8000000, m_region->bytes()); break; case MPR_FILE: { - UINT32 filedata_offs = (mpr_bank * 0x8000000 + mpr_offset + mpr_first_file_index * 0x40 + 8) / 2; + uint32_t filedata_offs = (mpr_bank * 0x8000000 + mpr_offset + mpr_first_file_index * 0x40 + 8) / 2; dma_offset = decrypt16(filedata_offs) | (decrypt16(filedata_offs + 1) << 16); dma_offset = (mpr_offset + dma_offset + mpr_file_offset * 2) & 0x7ffffff; - dma_limit = std::min((UINT32)0x8000000, m_region->bytes()); + dma_limit = std::min((uint32_t)0x8000000, m_region->bytes()); break; } } if (dma_offset >= mpr_offset) { - UINT32 bank_base = mpr_bank * 0x8000000; + uint32_t bank_base = mpr_bank * 0x8000000; dma_offset += bank_base; dma_limit = std::min(dma_limit + bank_base, m_region->bytes()); } } -void aw_rom_board::dma_get_position(UINT8 *&base, UINT32 &limit, bool to_mainram) +void aw_rom_board::dma_get_position(uint8_t *&base, uint32_t &limit, bool to_mainram) { if(!to_mainram) { limit = 0; @@ -386,14 +386,14 @@ void aw_rom_board::dma_get_position(UINT8 *&base, UINT32 &limit, bool to_mainram return; } - UINT32 offset = dma_offset / 2; + uint32_t offset = dma_offset / 2; for (int i = 0; i < 16; i++) decrypted_buf[i] = decrypt16(offset + i); - base = (UINT8*)decrypted_buf; + base = (uint8_t*)decrypted_buf; limit = 32; } -void aw_rom_board::dma_advance(UINT32 size) +void aw_rom_board::dma_advance(uint32_t size) { dma_offset += size; } diff --git a/src/mame/machine/awboard.h b/src/mame/machine/awboard.h index 5ae885079c1..acc075bc209 100644 --- a/src/mame/machine/awboard.h +++ b/src/mame/machine/awboard.h @@ -12,7 +12,7 @@ class aw_rom_board : public naomi_g1_device { public: - aw_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + aw_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_keyregion(device_t &device, const char *keyregion); @@ -31,33 +31,33 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void dma_get_position(UINT8 *&base, UINT32 &limit, bool to_mainram) override; - virtual void dma_advance(UINT32 size) override; + virtual void dma_get_position(uint8_t *&base, uint32_t &limit, bool to_mainram) override; + virtual void dma_advance(uint32_t size) override; private: enum { EPR, MPR_RECORD, MPR_FILE }; required_memory_region m_region; optional_memory_region m_keyregion; - UINT32 rombd_key; - UINT32 mpr_offset, mpr_bank; - UINT32 epr_offset, mpr_file_offset; - UINT16 mpr_record_index, mpr_first_file_index; - UINT16 decrypted_buf[16]; + uint32_t rombd_key; + uint32_t mpr_offset, mpr_bank; + uint32_t epr_offset, mpr_file_offset; + uint16_t mpr_record_index, mpr_first_file_index; + uint16_t decrypted_buf[16]; - UINT32 dma_offset, dma_limit; + uint32_t dma_offset, dma_limit; struct sbox_set { - UINT8 S0[32]; - UINT8 S1[16]; - UINT8 S2[16]; - UINT8 S3[8]; + uint8_t S0[32]; + uint8_t S1[16]; + uint8_t S2[16]; + uint8_t S3[8]; }; static const int permutation_table[4][16]; static const sbox_set sboxes_table[4]; - static UINT16 decrypt(UINT16 cipherText, UINT32 address, const UINT32 key); - UINT16 decrypt16(UINT32 address) { return decrypt(m_region->u16(address), address, rombd_key); } + static uint16_t decrypt(uint16_t cipherText, uint32_t address, const uint32_t key); + uint16_t decrypt16(uint32_t address) { return decrypt(m_region->u16(address), address, rombd_key); } void set_key(); void recalc_dma_offset(int mode); diff --git a/src/mame/machine/b2m.cpp b/src/mame/machine/b2m.cpp index 10e9f587c21..e771ffa3529 100644 --- a/src/mame/machine/b2m.cpp +++ b/src/mame/machine/b2m.cpp @@ -21,7 +21,7 @@ READ8_MEMBER(b2m_state::b2m_keyboard_r) { - UINT8 key = 0x00; + uint8_t key = 0x00; if (offset < 0x100) { if ((offset & 0x01)!=0) { key |= ioport("LINE0")->read(); } if ((offset & 0x02)!=0) { key |= ioport("LINE1")->read(); } @@ -42,9 +42,9 @@ READ8_MEMBER(b2m_state::b2m_keyboard_r) void b2m_state::b2m_set_bank(int bank) { - UINT8 *rom; + uint8_t *rom; address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); space.install_write_bank(0x0000, 0x27ff, "bank1"); space.install_write_bank(0x2800, 0x2fff, "bank2"); @@ -179,8 +179,8 @@ WRITE_LINE_MEMBER( b2m_state::b2m_fdc_drq ) WRITE8_MEMBER(b2m_state::b2m_ext_8255_portc_w) { - UINT8 drive = ((data >> 1) & 1) ^ 1; - UINT8 side = (data & 1) ^ 1; + uint8_t drive = ((data >> 1) & 1) ^ 1; + uint8_t side = (data & 1) ^ 1; static const char *names[] = { "fd0", "fd1"}; floppy_image_device *floppy = nullptr; @@ -210,7 +210,7 @@ WRITE8_MEMBER(b2m_state::b2m_ext_8255_portc_w) READ8_MEMBER(b2m_state::b2m_romdisk_porta_r) { - UINT8 *romdisk = memregion("maincpu")->base() + 0x12000; + uint8_t *romdisk = memregion("maincpu")->base() + 0x12000; return romdisk[m_b2m_romdisk_msb*256+m_b2m_romdisk_lsb]; } @@ -232,11 +232,11 @@ DRIVER_INIT_MEMBER(b2m_state,b2m) WRITE8_MEMBER(b2m_state::b2m_palette_w) { - UINT8 b = (3 - ((data >> 6) & 3)) * 0x55; - UINT8 g = (3 - ((data >> 4) & 3)) * 0x55; - UINT8 r = (3 - ((data >> 2) & 3)) * 0x55; + uint8_t b = (3 - ((data >> 6) & 3)) * 0x55; + uint8_t g = (3 - ((data >> 4) & 3)) * 0x55; + uint8_t r = (3 - ((data >> 2) & 3)) * 0x55; - UINT8 bw = (3 - (data & 3)) * 0x55; + uint8_t bw = (3 - (data & 3)) * 0x55; m_b2m_color[offset & 3] = data; diff --git a/src/mame/machine/bagman.cpp b/src/mame/machine/bagman.cpp index ede20bbb513..1b51fbb35a1 100644 --- a/src/mame/machine/bagman.cpp +++ b/src/mame/machine/bagman.cpp @@ -29,7 +29,7 @@ ** 1 - fuse blown: disconnected from input (equal to 1) ** 0 - fuse not blown: connected to input (ie. x, not x, q, not q accordingly) */ -static const UINT8 fusemap[64*32]= +static const uint8_t fusemap[64*32]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1, @@ -100,8 +100,8 @@ static const UINT8 fusemap[64*32]= void bagman_state::update_pal() { -UINT16 rowoffs; -UINT8 row, column, val; +uint16_t rowoffs; +uint8_t row, column, val; /*calculate all rows ANDs*/ for (row = 0; row < 64; row++) @@ -203,7 +203,7 @@ UINT8 row, column, val; WRITE8_MEMBER(bagman_state::pal16r6_w) { -UINT8 line; +uint8_t line; line = offset * 4; m_columnvalue[line ] = data & 1; diff --git a/src/mame/machine/balsente.cpp b/src/mame/machine/balsente.cpp index 8cb63a2e3a6..3390a42fbe4 100644 --- a/src/mame/machine/balsente.cpp +++ b/src/mame/machine/balsente.cpp @@ -49,7 +49,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(balsente_state::balsente_interrupt_timer) /* if we're a shooter, we do a little more work */ if (m_shooter) { - UINT8 tempx, tempy; + uint8_t tempx, tempy; /* we latch the beam values on the first interrupt after VBLANK */ if (param == 64) @@ -186,8 +186,8 @@ void balsente_state::machine_reset() void balsente_state::poly17_init() { - UINT32 i, x = 0; - UINT8 *p, *r; + uint32_t i, x = 0; + uint8_t *p, *r; /* allocate memory */ p = m_poly17; @@ -209,8 +209,8 @@ void balsente_state::poly17_init() inline void balsente_state::noise_gen_chip(int chip, int count, short *buffer) { /* noise generator runs at 100kHz */ - UINT32 step = (100000 << 14) / CEM3394_SAMPLE_RATE; - UINT32 noise_counter = m_noise_position[chip]; + uint32_t step = (100000 << 14) / CEM3394_SAMPLE_RATE; + uint32_t noise_counter = m_noise_position[chip]; while (count--) { @@ -244,7 +244,7 @@ WRITE8_MEMBER(balsente_state::balsente_random_reset_w) READ8_MEMBER(balsente_state::balsente_random_num_r) { - UINT32 cc; + uint32_t cc; /* CPU runs at 1.25MHz, noise source at 100kHz --> multiply by 12.5 */ cc = m_maincpu->total_cycles(); @@ -328,7 +328,7 @@ WRITE8_MEMBER(balsente_state::balsente_misc_output_w) void balsente_state::m6850_update_io() { - UINT8 new_state; + uint8_t new_state; /* sound -> main CPU communications */ if (!(m_m6850_sound_status & 0x02)) @@ -940,7 +940,7 @@ READ8_MEMBER(balsente_state::balsente_counter_state_r) WRITE8_MEMBER(balsente_state::balsente_counter_control_w) { - UINT8 diff_counter_control = m_counter_control ^ data; + uint8_t diff_counter_control = m_counter_control ^ data; /* set the new global value */ m_counter_control = data; @@ -987,7 +987,7 @@ WRITE8_MEMBER(balsente_state::balsente_counter_control_w) WRITE8_MEMBER(balsente_state::balsente_chip_select_w) { - static const UINT8 register_map[8] = + static const uint8_t register_map[8] = { CEM3394_VCO_FREQUENCY, CEM3394_FINAL_GAIN, @@ -1059,7 +1059,7 @@ WRITE8_MEMBER(balsente_state::balsente_dac_data_w) /* if there are open channels, force the values in */ if ((m_chip_select & 0x3f) != 0x3f) { - UINT8 temp = m_chip_select; + uint8_t temp = m_chip_select; balsente_chip_select_w(space, 0, 0x3f); balsente_chip_select_w(space, 0, temp); } @@ -1102,7 +1102,7 @@ WRITE8_MEMBER(balsente_state::spiker_expand_w) READ8_MEMBER(balsente_state::spiker_expand_r) { - UINT8 left, right; + uint8_t left, right; /* first rotate each nibble */ m_spiker_expand_bits = ((m_spiker_expand_bits << 1) & 0xee) | ((m_spiker_expand_bits >> 3) & 0x11); @@ -1121,8 +1121,8 @@ READ8_MEMBER(balsente_state::spiker_expand_r) void balsente_state::update_grudge_steering() { - UINT8 wheel[3]; - INT8 diff[3]; + uint8_t wheel[3]; + int8_t diff[3]; /* read the current steering values */ wheel[0] = ioport("AN0")->read(); @@ -1177,7 +1177,7 @@ READ8_MEMBER(balsente_state::grudge_steering_r) READ8_MEMBER(balsente_state::shrike_shared_6809_r) { - UINT16 mem_mask_int = offset & 1 ? 0xff00 : 0x00ff; + uint16_t mem_mask_int = offset & 1 ? 0xff00 : 0x00ff; switch( offset ) { @@ -1191,7 +1191,7 @@ READ8_MEMBER(balsente_state::shrike_shared_6809_r) WRITE8_MEMBER(balsente_state::shrike_shared_6809_w) { - UINT16 mem_mask_int = offset & 1 ? 0xff00 : 0x00ff; + uint16_t mem_mask_int = offset & 1 ? 0xff00 : 0x00ff; m_shrike_shared[offset >> 1] = ( m_shrike_shared[offset >> 1] & mem_mask_int ) | ( data << ( mem_mask_int & 0x8 ) ); } diff --git a/src/mame/machine/bbc.cpp b/src/mame/machine/bbc.cpp index e284ea720e6..32d3e876085 100644 --- a/src/mame/machine/bbc.cpp +++ b/src/mame/machine/bbc.cpp @@ -157,7 +157,7 @@ WRITE8_MEMBER(bbc_state::bbc_memorybp1_w) DIRECT_UPDATE_MEMBER(bbc_state::bbcbp_direct_handler) { - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); if (m_vdusel == 0) { // not in shadow ram mode so just read normal ram @@ -182,7 +182,7 @@ DIRECT_UPDATE_MEMBER(bbc_state::bbcbp_direct_handler) WRITE8_MEMBER(bbc_state::bbc_memorybp2_w) { - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); if (m_vdusel==0) { // not in shadow ram mode so just write to normal ram @@ -426,7 +426,7 @@ DIRECT_UPDATE_MEMBER(bbc_state::bbcm_direct_handler) WRITE8_MEMBER(bbc_state::bbc_memorybm2_w) { - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); if (m_ACCCON_X) { RAM[offset + 0xb000] = data; @@ -1574,7 +1574,7 @@ WRITE8_MEMBER(bbc_state::bbcm_wd1772l_write) image_init_result bbc_state::bbc_load_rom(device_image_interface &image, generic_slot_device *slot) { - UINT32 size = slot->common_get_size("rom"); + uint32_t size = slot->common_get_size("rom"); // socket accepts 8K and 16K ROM only if (size != 0x2000 && size != 0x4000) @@ -1597,7 +1597,7 @@ image_init_result bbc_state::bbcm_load_cart(device_image_interface &image, gener { if (image.software_entry() == nullptr) { - UINT32 filesize = image.length(); + uint32_t filesize = image.length(); if (filesize != 0x8000) { @@ -1611,8 +1611,8 @@ image_init_result bbc_state::bbcm_load_cart(device_image_interface &image, gener } else { - UINT32 size_lo = image.get_software_region_length("lorom"); - UINT32 size_hi = image.get_software_region_length("uprom"); + uint32_t size_lo = image.get_software_region_length("lorom"); + uint32_t size_hi = image.get_software_region_length("uprom"); if (size_lo + size_hi != 0x8000) { @@ -1652,11 +1652,11 @@ DRIVER_INIT_MEMBER(bbc_state,bbc) // setup pointers for optional EPROMs -void bbc_state::bbc_setup_banks(memory_bank *membank, int banks, UINT32 shift, UINT32 size) +void bbc_state::bbc_setup_banks(memory_bank *membank, int banks, uint32_t shift, uint32_t size) { std::string region_tag; memory_region *tmp_reg; - UINT8 *eprom[4]; + uint8_t *eprom[4]; if (m_exp1 && (tmp_reg = memregion(region_tag.assign(m_exp1->tag()).append(GENERIC_ROM_REGION_TAG).c_str()))) eprom[0] = tmp_reg->base() + shift; else @@ -1686,11 +1686,11 @@ void bbc_state::bbc_setup_banks(memory_bank *membank, int banks, UINT32 shift, U } } -void bbc_state::bbcm_setup_banks(memory_bank *membank, int banks, UINT32 shift, UINT32 size) +void bbc_state::bbcm_setup_banks(memory_bank *membank, int banks, uint32_t shift, uint32_t size) { std::string region_tag; memory_region *tmp_reg; - UINT8 *eprom[2]; + uint8_t *eprom[2]; if (m_exp1 && (tmp_reg = memregion(region_tag.assign(m_exp1->tag()).append(GENERIC_ROM_REGION_TAG).c_str()))) eprom[0] = tmp_reg->base() + shift; else @@ -1725,7 +1725,7 @@ MACHINE_RESET_MEMBER(bbc_state, bbca) m_Speech = m_bbcconfig.read_safe(0) & 0x04; m_SWRAMtype = m_bbcconfig.read_safe(0) & 0x18; - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); m_bank1->set_base(RAM); if (m_ram->size() == 32*1024) @@ -1760,7 +1760,7 @@ MACHINE_RESET_MEMBER(bbc_state, bbcb) m_Speech = m_bbcconfig.read_safe(1) & 0x04; m_SWRAMtype = m_bbcconfig.read_safe(0) & 0x18; - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); m_bank1->set_base(RAM); m_bank3->set_base(RAM + 0x4000); diff --git a/src/mame/machine/bebox.cpp b/src/mame/machine/bebox.cpp index c13fa303c8b..2fc0a30f0f8 100644 --- a/src/mame/machine/bebox.cpp +++ b/src/mame/machine/bebox.cpp @@ -111,7 +111,7 @@ * *************************************/ -static void bebox_mbreg32_w(UINT32 *target, UINT64 data, UINT64 mem_mask) +static void bebox_mbreg32_w(uint32_t *target, uint64_t data, uint64_t mem_mask) { int i; @@ -130,22 +130,22 @@ static void bebox_mbreg32_w(UINT32 *target, UINT64 data, UINT64 mem_mask) READ64_MEMBER(bebox_state::bebox_cpu0_imask_r ) { - return ((UINT64) m_cpu_imask[0]) << 32; + return ((uint64_t) m_cpu_imask[0]) << 32; } READ64_MEMBER(bebox_state::bebox_cpu1_imask_r ) { - return ((UINT64) m_cpu_imask[1]) << 32; + return ((uint64_t) m_cpu_imask[1]) << 32; } READ64_MEMBER(bebox_state::bebox_interrupt_sources_r ) { - return ((UINT64) m_interrupts) << 32; + return ((uint64_t) m_interrupts) << 32; } WRITE64_MEMBER(bebox_state::bebox_cpu0_imask_w ) { - UINT32 old_imask = m_cpu_imask[0]; + uint32_t old_imask = m_cpu_imask[0]; bebox_mbreg32_w(&m_cpu_imask[0], data, mem_mask); @@ -162,7 +162,7 @@ WRITE64_MEMBER(bebox_state::bebox_cpu0_imask_w ) WRITE64_MEMBER(bebox_state::bebox_cpu1_imask_w ) { - UINT32 old_imask = m_cpu_imask[1]; + uint32_t old_imask = m_cpu_imask[1]; bebox_mbreg32_w(&m_cpu_imask[1], data, mem_mask); @@ -179,7 +179,7 @@ WRITE64_MEMBER(bebox_state::bebox_cpu1_imask_w ) READ64_MEMBER(bebox_state::bebox_crossproc_interrupts_r ) { - UINT32 result; + uint32_t result; result = m_crossproc_interrupts; /* return a different result depending on which CPU is accessing this handler */ @@ -188,14 +188,14 @@ READ64_MEMBER(bebox_state::bebox_crossproc_interrupts_r ) else result &= ~0x02000000; - return ((UINT64) result) << 32; + return ((uint64_t) result) << 32; } WRITE64_MEMBER(bebox_state::bebox_crossproc_interrupts_w ) { static const struct { - UINT32 mask; + uint32_t mask; int cpunum; int active_high; int inputline; @@ -207,7 +207,7 @@ WRITE64_MEMBER(bebox_state::bebox_crossproc_interrupts_w ) { 0x04000000, 1, 0, 0/*PPC_INPUT_LINE_TLBISYNC*/ } }; int i, line; - UINT32 old_crossproc_interrupts = m_crossproc_interrupts; + uint32_t old_crossproc_interrupts = m_crossproc_interrupts; cpu_device *cpus[] = { m_ppc1, m_ppc2 }; bebox_mbreg32_w(&m_crossproc_interrupts, data, mem_mask); @@ -237,7 +237,7 @@ WRITE64_MEMBER(bebox_state::bebox_crossproc_interrupts_w ) WRITE64_MEMBER(bebox_state::bebox_processor_resets_w ) { - UINT8 b = (UINT8) (data >> 56); + uint8_t b = (uint8_t) (data >> 56); if (b & 0x20) { @@ -248,7 +248,7 @@ WRITE64_MEMBER(bebox_state::bebox_processor_resets_w ) void bebox_state::bebox_update_interrupts() { - UINT32 interrupt; + uint32_t interrupt; cpu_device *cpus[] = { m_ppc1, m_ppc2 }; for (int cpunum = 0; cpunum < 2; cpunum++) @@ -303,7 +303,7 @@ void bebox_state::bebox_set_irq_bit(unsigned int interrupt_bit, int val) "SMI0", nullptr }; - UINT32 old_interrupts; + uint32_t old_interrupts; if (LOG_INTERRUPTS) { @@ -348,10 +348,10 @@ WRITE_LINE_MEMBER( bebox_state::fdc_interrupt ) READ64_MEMBER(bebox_state::bebox_interrupt_ack_r ) { - UINT32 result; + uint32_t result; result = m_pic8259_1->acknowledge(); bebox_set_irq_bit(5, 0); /* HACK */ - return ((UINT64) result) << 56; + return ((uint64_t) result) << 56; } @@ -398,24 +398,24 @@ WRITE_LINE_MEMBER(bebox_state::bebox_ide_interrupt) /* static READ64_MEMBER(bebox_state::bebox_video_r ) { - UINT64 result = 0; + uint64_t result = 0; mem_mask = FLIPENDIAN_INT64(mem_mask); if (ACCESSING_BITS_0_7) - result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 0, mem_mask >> 0) << 0; + result |= (uint64_t)vga_mem_linear_r(space, offset * 8 + 0, mem_mask >> 0) << 0; if (ACCESSING_BITS_8_15) - result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 1, mem_mask >> 8) << 8; + result |= (uint64_t)vga_mem_linear_r(space, offset * 8 + 1, mem_mask >> 8) << 8; if (ACCESSING_BITS_16_23) - result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 2, mem_mask >> 16) << 16; + result |= (uint64_t)vga_mem_linear_r(space, offset * 8 + 2, mem_mask >> 16) << 16; if (ACCESSING_BITS_24_31) - result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 3, mem_mask >> 24) << 24; + result |= (uint64_t)vga_mem_linear_r(space, offset * 8 + 3, mem_mask >> 24) << 24; if (ACCESSING_BITS_32_39) - result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 4, mem_mask >> 32) << 32; + result |= (uint64_t)vga_mem_linear_r(space, offset * 8 + 4, mem_mask >> 32) << 32; if (ACCESSING_BITS_40_47) - result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 5, mem_mask >> 40) << 40; + result |= (uint64_t)vga_mem_linear_r(space, offset * 8 + 5, mem_mask >> 40) << 40; if (ACCESSING_BITS_48_55) - result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 6, mem_mask >> 48) << 48; + result |= (uint64_t)vga_mem_linear_r(space, offset * 8 + 6, mem_mask >> 48) << 48; if (ACCESSING_BITS_56_63) - result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 7, mem_mask >> 56) << 56; + result |= (uint64_t)vga_mem_linear_r(space, offset * 8 + 7, mem_mask >> 56) << 56; return FLIPENDIAN_INT64(result); } @@ -451,7 +451,7 @@ static WRITE64_MEMBER(bebox_state::bebox_video_w ) READ8_MEMBER(bebox_state::bebox_page_r) { - UINT8 data = m_at_pages[offset % 0x10]; + uint8_t data = m_at_pages[offset % 0x10]; switch(offset % 8) { @@ -480,19 +480,19 @@ WRITE8_MEMBER(bebox_state::bebox_page_w) { case 1: m_dma_offset[(offset / 8) & 1][2] &= 0xFF00; - m_dma_offset[(offset / 8) & 1][2] |= ((UINT16 ) data) << 0; + m_dma_offset[(offset / 8) & 1][2] |= ((uint16_t ) data) << 0; break; case 2: m_dma_offset[(offset / 8) & 1][3] &= 0xFF00; - m_dma_offset[(offset / 8) & 1][3] |= ((UINT16 ) data) << 0; + m_dma_offset[(offset / 8) & 1][3] |= ((uint16_t ) data) << 0; break; case 3: m_dma_offset[(offset / 8) & 1][1] &= 0xFF00; - m_dma_offset[(offset / 8) & 1][1] |= ((UINT16 ) data) << 0; + m_dma_offset[(offset / 8) & 1][1] |= ((uint16_t ) data) << 0; break; case 7: m_dma_offset[(offset / 8) & 1][0] &= 0xFF00; - m_dma_offset[(offset / 8) & 1][0] |= ((UINT16 ) data) << 0; + m_dma_offset[(offset / 8) & 1][0] |= ((uint16_t ) data) << 0; break; } } @@ -504,19 +504,19 @@ WRITE8_MEMBER(bebox_state::bebox_80000480_w) { case 1: m_dma_offset[(offset / 8) & 1][2] &= 0x00FF; - m_dma_offset[(offset / 8) & 1][2] |= ((UINT16 ) data) << 8; + m_dma_offset[(offset / 8) & 1][2] |= ((uint16_t ) data) << 8; break; case 2: m_dma_offset[(offset / 8) & 1][3] &= 0x00FF; - m_dma_offset[(offset / 8) & 1][3] |= ((UINT16 ) data) << 8; + m_dma_offset[(offset / 8) & 1][3] |= ((uint16_t ) data) << 8; break; case 3: m_dma_offset[(offset / 8) & 1][1] &= 0x00FF; - m_dma_offset[(offset / 8) & 1][1] |= ((UINT16 ) data) << 8; + m_dma_offset[(offset / 8) & 1][1] |= ((uint16_t ) data) << 8; break; case 7: m_dma_offset[(offset / 8) & 1][0] &= 0x00FF; - m_dma_offset[(offset / 8) & 1][0] |= ((UINT16 ) data) << 8; + m_dma_offset[(offset / 8) & 1][0] |= ((uint16_t ) data) << 8; break; } } @@ -621,30 +621,30 @@ WRITE8_MEMBER(bebox_state::bebox_flash_w ) READ64_MEMBER(bebox_state::scsi53c810_r ) { int reg = offset*8; - UINT64 r = 0; + uint64_t r = 0; if (!ACCESSING_BITS_56_63) { - r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+0) << 56; + r |= (uint64_t)m_lsi53c810->lsi53c810_reg_r(reg+0) << 56; } if (!ACCESSING_BITS_48_55) { - r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+1) << 48; + r |= (uint64_t)m_lsi53c810->lsi53c810_reg_r(reg+1) << 48; } if (!ACCESSING_BITS_40_47) { - r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+2) << 40; + r |= (uint64_t)m_lsi53c810->lsi53c810_reg_r(reg+2) << 40; } if (!ACCESSING_BITS_32_39) { - r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+3) << 32; + r |= (uint64_t)m_lsi53c810->lsi53c810_reg_r(reg+3) << 32; } if (!ACCESSING_BITS_24_31) { - r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+4) << 24; + r |= (uint64_t)m_lsi53c810->lsi53c810_reg_r(reg+4) << 24; } if (!ACCESSING_BITS_16_23) { - r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+5) << 16; + r |= (uint64_t)m_lsi53c810->lsi53c810_reg_r(reg+5) << 16; } if (!ACCESSING_BITS_8_15) { - r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+6) << 8; + r |= (uint64_t)m_lsi53c810->lsi53c810_reg_r(reg+6) << 8; } if (!ACCESSING_BITS_0_7) { - r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+7) << 0; + r |= (uint64_t)m_lsi53c810->lsi53c810_reg_r(reg+7) << 0; } return r; @@ -681,10 +681,10 @@ WRITE64_MEMBER(bebox_state::scsi53c810_w ) } -UINT32 scsi53c810_pci_read(device_t *busdevice, device_t *device, int function, int offset, UINT32 mem_mask) +uint32_t scsi53c810_pci_read(device_t *busdevice, device_t *device, int function, int offset, uint32_t mem_mask) { bebox_state *state = device->machine().driver_data(); - UINT32 result = 0; + uint32_t result = 0; if (function == 0) { @@ -707,7 +707,7 @@ UINT32 scsi53c810_pci_read(device_t *busdevice, device_t *device, int function, } -void scsi53c810_pci_write(device_t *busdevice, device_t *device, int function, int offset, UINT32 data, UINT32 mem_mask) +void scsi53c810_pci_write(device_t *busdevice, device_t *device, int function, int offset, uint32_t data, uint32_t mem_mask) { bebox_state *state = device->machine().driver_data(); offs_t addr; @@ -800,7 +800,7 @@ DRIVER_INIT_MEMBER(bebox_state,bebox) * the crash */ { - static UINT64 ops[2] = + static uint64_t ops[2] = { /* li r0, 0x0700 */ /* mtspr ctr, r0 */ diff --git a/src/mame/machine/beezer.cpp b/src/mame/machine/beezer.cpp index c8ffe89b5ba..55fb06f1292 100644 --- a/src/mame/machine/beezer.cpp +++ b/src/mame/machine/beezer.cpp @@ -138,7 +138,7 @@ WRITE8_MEMBER(beezer_state::beezer_bankswitch_w) } else { - UINT8 *rom = memregion("maincpu")->base() + 0x10000; + uint8_t *rom = memregion("maincpu")->base() + 0x10000; space.install_ram(0xc000, 0xcfff, rom + (data & 0x07) * 0x2000 + ((data & 0x08) ? 0x1000: 0)); } } diff --git a/src/mame/machine/beta.cpp b/src/mame/machine/beta.cpp index 52f1500f884..9185aa933f3 100644 --- a/src/mame/machine/beta.cpp +++ b/src/mame/machine/beta.cpp @@ -26,7 +26,7 @@ BUGS: const device_type BETA_DISK = &device_creator; -beta_disk_device::beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +beta_disk_device::beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BETA_DISK, "Beta Disk Interface", tag, owner, clock, "betadisk", __FILE__) , m_betadisk_active(0) , m_wd179x(*this, "wd179x") @@ -107,7 +107,7 @@ READ8_MEMBER(beta_disk_device::data_r) READ8_MEMBER(beta_disk_device::state_r) { if (m_betadisk_active==1) { - UINT8 result = 0x3F; // actually open bus + uint8_t result = 0x3F; // actually open bus result |= m_wd179x->drq_r() ? 0x40 : 0; result |= m_wd179x->intrq_r() ? 0x80 : 0; return result; diff --git a/src/mame/machine/beta.h b/src/mame/machine/beta.h index 8aa23e21c35..c1ffa85db4d 100644 --- a/src/mame/machine/beta.h +++ b/src/mame/machine/beta.h @@ -20,7 +20,7 @@ class beta_disk_device : public device_t { public: - beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~beta_disk_device() {} DECLARE_READ8_MEMBER(status_r); @@ -40,7 +40,7 @@ public: void enable(); void disable(); - UINT8 m_betadisk_active; + uint8_t m_betadisk_active; protected: // device-level overrides diff --git a/src/mame/machine/bfm_bd1.cpp b/src/mame/machine/bfm_bd1.cpp index 78132ae5acf..3c1b6ea32f4 100644 --- a/src/mame/machine/bfm_bd1.cpp +++ b/src/mame/machine/bfm_bd1.cpp @@ -33,7 +33,7 @@ const device_type BFM_BD1 = &device_creator; */ -static const UINT16 BD1charset[]= +static const uint16_t BD1charset[]= { // FEDC BA98 7654 3210 0xA626, // 1010 0110 0010 0110 @. 0xE027, // 1110 0000 0010 0111 A. @@ -101,7 +101,7 @@ static const UINT16 BD1charset[]= 0x4406, // 0100 0100 0000 0110 ? }; -bfm_bd1_t::bfm_bd1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bfm_bd1_t::bfm_bd1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BFM_BD1, "BFM BD1 VFD controller", tag, owner, clock, "bfm_bd1", __FILE__), m_port_val(0) { @@ -162,7 +162,7 @@ void bfm_bd1_t::device_reset() memset(m_attrs, 0, sizeof(m_attrs)); } -UINT16 bfm_bd1_t::set_display(UINT16 segin) +uint16_t bfm_bd1_t::set_display(uint16_t segin) { return BITSWAP16(segin,8,12,11,7,6,4,10,3,14,15,0,13,9,5,1,2); } diff --git a/src/mame/machine/bfm_bd1.h b/src/mame/machine/bfm_bd1.h index 70742e807f9..02026b586b1 100644 --- a/src/mame/machine/bfm_bd1.h +++ b/src/mame/machine/bfm_bd1.h @@ -15,28 +15,28 @@ class bfm_bd1_t : public device_t { public: - bfm_bd1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bfm_bd1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_value(device_t &device, int val); int write_char(int data); virtual void update_display(); - UINT8 m_port_val; + uint8_t m_port_val; void blank(int data); void shift_clock(int state); void setdata(int segdata, int data); - UINT16 set_display(UINT16 segin); + uint16_t set_display(uint16_t segin); DECLARE_WRITE_LINE_MEMBER( sclk ); DECLARE_WRITE_LINE_MEMBER( data ); DECLARE_WRITE_LINE_MEMBER( por ); protected: - static const UINT8 AT_NORMAL = 0x00; - static const UINT8 AT_FLASH = 0x01; - static const UINT8 AT_BLANK = 0x02; - static const UINT8 AT_FLASHED = 0x80; // set when character should be blinked off + static const uint8_t AT_NORMAL = 0x00; + static const uint8_t AT_FLASH = 0x01; + static const uint8_t AT_BLANK = 0x02; + static const uint8_t AT_FLASHED = 0x80; // set when character should be blinked off int m_cursor_pos; int m_window_start; // display window start pos 0-15 @@ -52,12 +52,12 @@ protected: int m_sclk; int m_data; - UINT8 m_cursor; - UINT16 m_chars[16]; - UINT16 m_outputs[16]; - UINT8 m_attrs[16]; - UINT16 m_user_data; // user defined character data (16 bit) - UINT16 m_user_def; // user defined character state + uint8_t m_cursor; + uint16_t m_chars[16]; + uint16_t m_outputs[16]; + uint8_t m_attrs[16]; + uint16_t m_user_data; // user defined character data (16 bit) + uint16_t m_user_def; // user defined character state virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/machine/bfm_bda.cpp b/src/mame/machine/bfm_bda.cpp index 0984bf7ecab..2efd4a9f630 100644 --- a/src/mame/machine/bfm_bda.cpp +++ b/src/mame/machine/bfm_bda.cpp @@ -15,7 +15,7 @@ const device_type BFM_BDA = &device_creator; //I currently use the BDA character set, until a suitable image can be programmed -static const UINT16 BDAcharset[]= +static const uint16_t BDAcharset[]= { // FEDC BA98 7654 3210 0xA626, // 1010 0110 0010 0110 @. 0xE027, // 1110 0000 0010 0111 A. @@ -83,7 +83,7 @@ static const UINT16 BDAcharset[]= 0x4406, // 0100 0100 0000 0110 ? }; -bfm_bda_t::bfm_bda_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bfm_bda_t::bfm_bda_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BFM_BDA, "BFM BDA VFD controller", tag, owner, clock, "bfm_bda", __FILE__), m_port_val(0) { @@ -144,7 +144,7 @@ void bfm_bda_t::device_reset() memset(m_attrs, 0, sizeof(m_attrs)); } -UINT16 bfm_bda_t::set_display(UINT16 segin) +uint16_t bfm_bda_t::set_display(uint16_t segin) { return BITSWAP16(segin,8,12,11,7,6,4,10,3,14,15,0,13,9,5,1,2); } diff --git a/src/mame/machine/bfm_bda.h b/src/mame/machine/bfm_bda.h index 3570c478f81..1e5c8a664cd 100644 --- a/src/mame/machine/bfm_bda.h +++ b/src/mame/machine/bfm_bda.h @@ -15,25 +15,25 @@ class bfm_bda_t : public device_t { public: - bfm_bda_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bfm_bda_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_value(device_t &device, int val); int write_char(int data); virtual void update_display(); - UINT8 m_port_val; + uint8_t m_port_val; void blank(int data); void shift_data(int data); void setdata(int segdata, int data); - UINT16 set_display(UINT16 segin); + uint16_t set_display(uint16_t segin); protected: - static const UINT8 AT_NORMAL = 0x00; - static const UINT8 AT_FLASH = 0x01; - static const UINT8 AT_BLANK = 0x02; - static const UINT8 AT_FLASHED = 0x80; // set when character should be blinked off + static const uint8_t AT_NORMAL = 0x00; + static const uint8_t AT_FLASH = 0x01; + static const uint8_t AT_BLANK = 0x02; + static const uint8_t AT_FLASHED = 0x80; // set when character should be blinked off int m_cursor_pos; int m_window_start; // display window start pos 0-15 @@ -48,12 +48,12 @@ protected: int m_display_mode; int m_flash_rate; int m_flash_control; - UINT8 m_cursor; - UINT16 m_chars[16]; - UINT16 m_outputs[16]; - UINT8 m_attrs[16]; - UINT16 m_user_data; // user defined character data (16 bit) - UINT16 m_user_def; // user defined character state + uint8_t m_cursor; + uint16_t m_chars[16]; + uint16_t m_outputs[16]; + uint8_t m_attrs[16]; + uint16_t m_user_data; // user defined character data (16 bit) + uint16_t m_user_def; // user defined character state virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/machine/bfm_comn.cpp b/src/mame/machine/bfm_comn.cpp index 1faa709b40a..dd381a9b0d9 100644 --- a/src/mame/machine/bfm_comn.cpp +++ b/src/mame/machine/bfm_comn.cpp @@ -4,14 +4,14 @@ #include "emu.h" -static const UINT16 AddressDecode[]= +static const uint16_t AddressDecode[]= { 0x0800,0x1000,0x0001,0x0004,0x0008,0x0020,0x0080,0x0200, 0x0100,0x0040,0x0002,0x0010,0x0400,0x2000,0x4000,0x8000, 0 }; -static const UINT8 DataDecode[]= +static const uint8_t DataDecode[]= { 0x02,0x08,0x20,0x40,0x10,0x04,0x01,0x80, 0 @@ -19,24 +19,24 @@ static const UINT8 DataDecode[]= /////////////////////////////////////////////////////////////////////////// -void bfm_decode_mainrom(running_machine &machine, const char *rom_region, UINT8* codec_data) +void bfm_decode_mainrom(running_machine &machine, const char *rom_region, uint8_t* codec_data) { - UINT8 *rom; + uint8_t *rom; rom = machine.root_device().memregion(rom_region)->base(); { - std::vector tmp(0x10000); + std::vector tmp(0x10000); int i; memcpy(&tmp[0], rom, 0x10000); for ( i = 0; i < 256; i++ ) { - UINT8 data,pattern,newdata,*tab; + uint8_t data,pattern,newdata,*tab; data = i; - tab = (UINT8*)DataDecode; + tab = (uint8_t*)DataDecode; pattern = 0x01; newdata = 0; @@ -52,9 +52,9 @@ void bfm_decode_mainrom(running_machine &machine, const char *rom_region, UINT8* for ( int address = 0; address < 0x10000; address++) { int newaddress,pattern; - UINT16 *tab; + uint16_t *tab; - tab = (UINT16*)AddressDecode; + tab = (uint16_t*)AddressDecode; pattern = 0x0001; newaddress = 0; do diff --git a/src/mame/machine/bfm_comn.h b/src/mame/machine/bfm_comn.h index d45c0291b4e..a53191f4ffd 100644 --- a/src/mame/machine/bfm_comn.h +++ b/src/mame/machine/bfm_comn.h @@ -2,4 +2,4 @@ // copyright-holders:David Haywood -void bfm_decode_mainrom(running_machine &machine, const char *rom_region, UINT8* codec_data); +void bfm_decode_mainrom(running_machine &machine, const char *rom_region, uint8_t* codec_data); diff --git a/src/mame/machine/bfm_sc45_helper.cpp b/src/mame/machine/bfm_sc45_helper.cpp index 4c269798ba9..a6312c70e64 100644 --- a/src/mame/machine/bfm_sc45_helper.cpp +++ b/src/mame/machine/bfm_sc45_helper.cpp @@ -16,7 +16,7 @@ int find_project_string(running_machine &machine, int addrxor, int mode) // search for the title const int strlength = 14; char title_string[] = "PROJECT NUMBER"; - UINT8 *src = machine.root_device().memregion( "maincpu" )->base(); + uint8_t *src = machine.root_device().memregion( "maincpu" )->base(); int size = machine.root_device().memregion( "maincpu" )->bytes(); int search_start = 0; @@ -42,8 +42,8 @@ int find_project_string(running_machine &machine, int addrxor, int mode) int found = 1; for (j=search_start;jbase(); - UINT16* rom = &src[addr]; + uint16_t *src = (uint16_t*)machine.root_device().memregion( "maincpu" )->base(); + uint16_t* rom = &src[addr]; if ((rom[0] != 0x48e7) || (rom[1] != 0x3020) || (rom[2] != 0x322f) || (rom[3] != 0x0010) || (rom[4] != 0x227c)) @@ -162,11 +162,11 @@ int find_input_strings(running_machine &machine) int foundat = -1; - UINT32 startblock = 0; - UINT32 endblock = 0; + uint32_t startblock = 0; + uint32_t endblock = 0; - UINT16 *rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base(); - UINT8 *rom8 = machine.root_device().memregion( "maincpu" )->base(); + uint16_t *rom = (uint16_t*)machine.root_device().memregion( "maincpu" )->base(); + uint8_t *rom8 = machine.root_device().memregion( "maincpu" )->base(); for (int i=0;i<(0x100000-0x40)/2;i++) { @@ -184,19 +184,19 @@ int find_input_strings(running_machine &machine) { for (int j = startblock / 2; j < endblock / 2; j+=4) { - UINT16 portpos = rom[j + 0]; + uint16_t portpos = rom[j + 0]; int port = (portpos & 0x1f); int pos = (portpos >> 5); - UINT16 unk2 = rom[j + 1]; - UINT32 stringaddr = (rom[j + 2] << 16) | rom[j + 3]; + uint16_t unk2 = rom[j + 1]; + uint32_t stringaddr = (rom[j + 2] << 16) | rom[j + 3]; sc45helperlog("(port %02x position %02x) unk %04x addr %08x ", port,pos, unk2, stringaddr); std::string tempstring; for (int k = stringaddr; k < stringaddr + 6; k++) { - UINT8 chr = rom8[k^1]; + uint8_t chr = rom8[k^1]; if ((chr == 0xff) || (chr == 0x00)) { @@ -458,8 +458,8 @@ int find_lamp_strings(running_machine &machine) - UINT16 *rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base(); - UINT8 *rom8 = machine.root_device().memregion( "maincpu" )->base(); + uint16_t *rom = (uint16_t*)machine.root_device().memregion( "maincpu" )->base(); + uint8_t *rom8 = machine.root_device().memregion( "maincpu" )->base(); // sc45helperlog("------------ LAMPS -----------------\n"); @@ -467,11 +467,11 @@ int find_lamp_strings(running_machine &machine) { for (int j = startblock / 2; j < endblock / 2; j+=3) { - UINT16 portpos = rom[j + 0]; + uint16_t portpos = rom[j + 0]; int row = portpos & 0xf; int col = (portpos >> 4 ) & 0xf; - UINT32 stringaddr = (rom[j + 1] << 16) | rom[j + 2]; + uint32_t stringaddr = (rom[j + 1] << 16) | rom[j + 2]; //sc45helperlog("(row %02d, col %02d, unused %02x) addr %08x ", row,col, (portpos&0xff00)>>8, stringaddr); @@ -479,7 +479,7 @@ int find_lamp_strings(running_machine &machine) for (int k = stringaddr; k < stringaddr + 10; k++) { - UINT8 chr = rom8[k^1]; + uint8_t chr = rom8[k^1]; if ((chr == 0xff) || (chr == 0x00)) { @@ -843,8 +843,8 @@ int find_reel_strings(running_machine &machine) - UINT16 *rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base(); - UINT8 *rom8 = machine.root_device().memregion( "maincpu" )->base(); + uint16_t *rom = (uint16_t*)machine.root_device().memregion( "maincpu" )->base(); + uint8_t *rom8 = machine.root_device().memregion( "maincpu" )->base(); @@ -870,7 +870,7 @@ int find_reel_strings(running_machine &machine) sc45helperlog("= (0x10000 - 16)) @@ -882,7 +882,7 @@ int find_reel_strings(running_machine &machine) for (int k = stringaddr; k < stringaddr + 10; k++) { - UINT8 chr = rom8[k^1]; + uint8_t chr = rom8[k^1]; if ((chr == 0xff) || (chr == 0x00)) { diff --git a/src/mame/machine/bk.cpp b/src/mame/machine/bk.cpp index 605b66dc74b..10cbd4df372 100644 --- a/src/mame/machine/bk.cpp +++ b/src/mame/machine/bk.cpp @@ -17,7 +17,7 @@ TIMER_CALLBACK_MEMBER(bk_state::keyboard_callback) { - UINT8 code, i, j; + uint8_t code, i, j; static const char *const keynames[] = { "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9", "LINE10", "LINE11" @@ -102,7 +102,7 @@ READ16_MEMBER(bk_state::bk_vid_scrool_r) READ16_MEMBER(bk_state::bk_key_press_r) { double level = m_cassette->input(); - UINT16 cas; + uint16_t cas; if (level < 0) { cas = 0x00; diff --git a/src/mame/machine/bonzeadv.cpp b/src/mame/machine/bonzeadv.cpp index b2bec33c7e1..fe49790ca32 100644 --- a/src/mame/machine/bonzeadv.cpp +++ b/src/mame/machine/bonzeadv.cpp @@ -28,17 +28,17 @@ struct cchip_mapping { - UINT16 xmin; - UINT16 xmax; - UINT16 ymin; - UINT16 ymax; - UINT16 sx; - UINT16 sy; - UINT16 px; - UINT16 py; + uint16_t xmin; + uint16_t xmax; + uint16_t ymin; + uint16_t ymax; + uint16_t sx; + uint16_t sy; + uint16_t px; + uint16_t py; }; -static const UINT16 CLEV[][13] = +static const uint16_t CLEV[][13] = { /* map start player start player y-range player x-range map y-range map x-range time */ { 0x0000, 0x0018, 0x0020, 0x0030, 0x0028, 0x00D0, 0x0050, 0x0090, 0x0000, 0x0118, 0x0000, 0x0C90, 0x3800 }, @@ -310,7 +310,7 @@ void asuka_state::WriteLevelData() for (i = 0; i < 13; i++) { - UINT16 v = CLEV[m_current_round][i]; + uint16_t v = CLEV[m_current_round][i]; m_cval[2 * i + 0] = v & 0xff; m_cval[2 * i + 1] = v >> 8; diff --git a/src/mame/machine/btime.cpp b/src/mame/machine/btime.cpp index fb70d3419bc..02f653948b0 100644 --- a/src/mame/machine/btime.cpp +++ b/src/mame/machine/btime.cpp @@ -8,7 +8,7 @@ READ8_MEMBER(btime_state::mmonkey_protection_r) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); int ret = 0; if (offset == 0x0000) @@ -25,7 +25,7 @@ READ8_MEMBER(btime_state::mmonkey_protection_r) WRITE8_MEMBER(btime_state::mmonkey_protection_w) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); if (offset == 0) { diff --git a/src/mame/machine/bublbobl.cpp b/src/mame/machine/bublbobl.cpp index 1b9a288e153..2e66aad50ff 100644 --- a/src/mame/machine/bublbobl.cpp +++ b/src/mame/machine/bublbobl.cpp @@ -57,7 +57,7 @@ WRITE8_MEMBER(bublbobl_state::bublbobl_nmitrigger_w) } -static const UINT8 tokio_prot_data[] = +static const uint8_t tokio_prot_data[] = { 0x6c, 0x7f,0x5f,0x7f,0x6f,0x5f,0x77,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5b,0x7f,0x5f,0x7f, diff --git a/src/mame/machine/buggychl.cpp b/src/mame/machine/buggychl.cpp index 608189588f2..843113992b5 100644 --- a/src/mame/machine/buggychl.cpp +++ b/src/mame/machine/buggychl.cpp @@ -7,7 +7,7 @@ const device_type BUGGYCHL_MCU = &device_creator; -buggychl_mcu_device::buggychl_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +buggychl_mcu_device::buggychl_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BUGGYCHL_MCU, "M68705 MCU Simulation (Buggy Challenge)", tag, owner, clock, "buggychl_mcu", __FILE__), m_port_a_in(0), m_port_a_out(0), diff --git a/src/mame/machine/buggychl.h b/src/mame/machine/buggychl.h index 7f7a3e7c1e8..ec76e77e467 100644 --- a/src/mame/machine/buggychl.h +++ b/src/mame/machine/buggychl.h @@ -3,7 +3,7 @@ class buggychl_mcu_device : public device_t { public: - buggychl_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + buggychl_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~buggychl_mcu_device() {} DECLARE_WRITE8_MEMBER( buggychl_mcu_w ); @@ -27,17 +27,17 @@ protected: private: // internal state - UINT8 m_port_a_in; - UINT8 m_port_a_out; - UINT8 m_ddr_a; - UINT8 m_port_b_in; - UINT8 m_port_b_out; - UINT8 m_ddr_b; - UINT8 m_port_c_in; - UINT8 m_port_c_out; - UINT8 m_ddr_c; - UINT8 m_from_main; - UINT8 m_from_mcu; + uint8_t m_port_a_in; + uint8_t m_port_a_out; + uint8_t m_ddr_a; + uint8_t m_port_b_in; + uint8_t m_port_b_out; + uint8_t m_ddr_b; + uint8_t m_port_c_in; + uint8_t m_port_c_out; + uint8_t m_ddr_c; + uint8_t m_from_main; + uint8_t m_from_mcu; int m_mcu_sent; int m_main_sent; device_t *m_mcu; diff --git a/src/mame/machine/c117.cpp b/src/mame/machine/c117.cpp index 5ca4c429074..b1d86b3ee03 100644 --- a/src/mame/machine/c117.cpp +++ b/src/mame/machine/c117.cpp @@ -38,7 +38,7 @@ const device_type NAMCO_C117 = &device_creator; // namco_c117_device - constructor //------------------------------------------------- -namco_c117_device::namco_c117_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_c117_device::namco_c117_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_C117, "Namco C117 MMU", tag, owner, clock, "namco_c117", __FILE__), device_memory_interface(mconfig, *this), m_subres_cb(*this), @@ -160,7 +160,7 @@ WRITE8_MEMBER(namco_c117_device::sound_watchdog_w) } -void namco_c117_device::register_w(int whichcpu, offs_t offset, UINT8 data) +void namco_c117_device::register_w(int whichcpu, offs_t offset, uint8_t data) { int reg = (offset >> 9) & 0xf; bool unknown_reg = false; @@ -219,9 +219,9 @@ void namco_c117_device::register_w(int whichcpu, offs_t offset, UINT8 data) logerror("'%s' writing to unknown CUS117 register %04X = %02X\n", (whichcpu ? m_subcpu_tag : m_maincpu_tag), offset, data); } -void namco_c117_device::bankswitch(int whichcpu, int whichbank, int a0, UINT8 data) +void namco_c117_device::bankswitch(int whichcpu, int whichbank, int a0, uint8_t data) { - UINT32 &bank = m_offsets[whichcpu][whichbank]; + uint32_t &bank = m_offsets[whichcpu][whichbank]; // even writes set a22-a21; odd writes set a20-a13 if (a0 == 0) diff --git a/src/mame/machine/c117.h b/src/mame/machine/c117.h index 7c224781c4d..1ff70089072 100644 --- a/src/mame/machine/c117.h +++ b/src/mame/machine/c117.h @@ -30,7 +30,7 @@ class namco_c117_device : { public: //construction/destruction - namco_c117_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_c117_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void set_cpu_tags(device_t &device, const char *maintag, const char *subtag); @@ -57,13 +57,13 @@ protected: private: // internal helpers - void register_w(int whichcpu, offs_t offset, UINT8 data); - void bankswitch(int whichcpu, int whichbank, int a0, UINT8 data); + void register_w(int whichcpu, offs_t offset, uint8_t data); + void bankswitch(int whichcpu, int whichbank, int a0, uint8_t data); void kick_watchdog(int whichcpu); // internal state - UINT32 m_offsets[2][8]; - UINT8 m_subres, m_wdog; + uint32_t m_offsets[2][8]; + uint8_t m_subres, m_wdog; // callbacks devcb_write_line m_subres_cb; diff --git a/src/mame/machine/carpolo.cpp b/src/mame/machine/carpolo.cpp index a252fe6ac42..721e23cbda1 100644 --- a/src/mame/machine/carpolo.cpp +++ b/src/mame/machine/carpolo.cpp @@ -89,7 +89,7 @@ WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2u_2_q_cb) } -void carpolo_state::carpolo_generate_ball_screen_interrupt(UINT8 cause) +void carpolo_state::carpolo_generate_ball_screen_interrupt(uint8_t cause) { m_ball_screen_collision_cause = cause; @@ -198,7 +198,7 @@ READ8_MEMBER(carpolo_state::carpolo_interrupt_cause_r) INTERRUPT_GEN_MEMBER(carpolo_state::carpolo_timer_interrupt) { - UINT8 port_value; + uint8_t port_value; int player; @@ -392,7 +392,7 @@ READ8_MEMBER(carpolo_state::pia_0_port_b_r) READ8_MEMBER(carpolo_state::pia_1_port_a_r) { - UINT8 ret; + uint8_t ret; /* bit 0 - Player 4 steering input (left or right) bit 1 - Player 3 steering input (left or right) @@ -415,7 +415,7 @@ READ8_MEMBER(carpolo_state::pia_1_port_a_r) READ8_MEMBER(carpolo_state::pia_1_port_b_r) { - UINT8 ret; + uint8_t ret; /* bit 4 - Player 4 steering input (wheel moving or stopped) bit 5 - Player 3 steering input (wheel moving or stopped) diff --git a/src/mame/machine/cat702.cpp b/src/mame/machine/cat702.cpp index 8811ac3e4a5..69f57604ca1 100644 --- a/src/mame/machine/cat702.cpp +++ b/src/mame/machine/cat702.cpp @@ -88,7 +88,7 @@ const device_type CAT702 = &device_creator; -cat702_device::cat702_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cat702_device::cat702_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CAT702, "CAT702", tag, owner, clock, "cat702", __FILE__), m_region(*this, DEVICE_SELF), m_dataout_handler(*this) @@ -124,10 +124,10 @@ void cat702_device::device_start() // Given the value for x7..x0 and linear transform coefficients a7..a0 // compute the value of the transform #if 0 -static int c_linear(UINT8 x, UINT8 a) +static int c_linear(uint8_t x, uint8_t a) { int i; - UINT8 r; + uint8_t r; x &= a; r = 0; for(i=0; i<8; i++) @@ -138,12 +138,12 @@ static int c_linear(UINT8 x, UINT8 a) #endif // Derive the sbox xor mask for a given input and select bit -UINT8 cat702_device::compute_sbox_coef(int sel, int bit) +uint8_t cat702_device::compute_sbox_coef(int sel, int bit) { if(!sel) return m_transform[bit]; - UINT8 r = compute_sbox_coef((sel-1) & 7, (bit-1) & 7); + uint8_t r = compute_sbox_coef((sel-1) & 7, (bit-1) & 7); r = (r << 1)|(((r >> 7)^(r >> 6)) & 1); if(bit != 7) return r; @@ -155,7 +155,7 @@ UINT8 cat702_device::compute_sbox_coef(int sel, int bit) void cat702_device::apply_bit_sbox(int sel) { int i; - UINT8 r = 0; + uint8_t r = 0; for(i=0; i<8; i++) if(m_state & (1< static devcb_base &set_dataout_handler(device_t &device, _Object object) { return downcast(device).m_dataout_handler.set_callback(object); } @@ -30,18 +30,18 @@ protected: virtual void device_start() override; private: - UINT8 compute_sbox_coef(int sel, int bit); + uint8_t compute_sbox_coef(int sel, int bit); void apply_bit_sbox(int sel); - void apply_sbox(const UINT8 *sbox); + void apply_sbox(const uint8_t *sbox); optional_memory_region m_region; - UINT8 m_transform[8]; + uint8_t m_transform[8]; int m_select; int m_clock; int m_datain; - UINT8 m_state; - UINT8 m_bit; + uint8_t m_state; + uint8_t m_bit; devcb_write_line m_dataout_handler; }; diff --git a/src/mame/machine/cbm_snqk.cpp b/src/mame/machine/cbm_snqk.cpp index 988575ae54e..ceb4ab67315 100644 --- a/src/mame/machine/cbm_snqk.cpp +++ b/src/mame/machine/cbm_snqk.cpp @@ -25,12 +25,12 @@ image_init_result general_cbm_loadsnap( device_image_interface &image, const char *file_type, int snapshot_size, - address_space &space, offs_t offset, void (*cbm_sethiaddress)(address_space &space, UINT16 hiaddress) ) + address_space &space, offs_t offset, void (*cbm_sethiaddress)(address_space &space, uint16_t hiaddress) ) { char buffer[7]; - std::vector data; - UINT32 bytesread; - UINT16 address = 0; + std::vector data; + uint32_t bytesread; + uint16_t address = 0; int i; if (!file_type) @@ -87,7 +87,7 @@ error: return image_init_result::FAIL; } -void cbm_quick_sethiaddress( address_space &space, UINT16 hiaddress ) +void cbm_quick_sethiaddress( address_space &space, uint16_t hiaddress ) { space.write_byte(0xae, hiaddress & 0xff); space.write_byte(0x31, hiaddress & 0xff); diff --git a/src/mame/machine/cbm_snqk.h b/src/mame/machine/cbm_snqk.h index 74ed76a134e..25fbcab989b 100644 --- a/src/mame/machine/cbm_snqk.h +++ b/src/mame/machine/cbm_snqk.h @@ -14,8 +14,8 @@ #define CBM_QUICKLOAD_DELAY_SECONDS 3 image_init_result general_cbm_loadsnap( device_image_interface &image, const char *file_type, int snapshot_size, - address_space &space, offs_t offset, void (*cbm_sethiaddress)(address_space &space, UINT16 hiaddress) ); + address_space &space, offs_t offset, void (*cbm_sethiaddress)(address_space &space, uint16_t hiaddress) ); -void cbm_quick_sethiaddress( address_space &space, UINT16 hiaddress ); +void cbm_quick_sethiaddress( address_space &space, uint16_t hiaddress ); #endif /* __CBM_SNQK_H__ */ diff --git a/src/mame/machine/cchip.cpp b/src/mame/machine/cchip.cpp index 2149d4c0c08..2ab59e3b8ec 100644 --- a/src/mame/machine/cchip.cpp +++ b/src/mame/machine/cchip.cpp @@ -38,7 +38,7 @@ This code requires that the player & coin inputs be in input ports 2-4. /* This code for sound communication is a hack, it will not be identical to the code derived from the real c-chip */ -static const UINT8 superman_code[40] = +static const uint8_t superman_code[40] = { 0x48, 0xe7, 0x80, 0x80, /* MOVEM.L D0/A0,-(A7) ( Preserve Regs ) */ 0x20, 0x6d, 0x1c, 0x40, /* MOVEA.L ($1C40,A5),A0 ( Load sound pointer in A0 ) */ diff --git a/src/mame/machine/cclimber.cpp b/src/mame/machine/cclimber.cpp index 78275edb63e..e659624d970 100644 --- a/src/mame/machine/cclimber.cpp +++ b/src/mame/machine/cclimber.cpp @@ -6,14 +6,14 @@ /* set to 1 to fix protection check after bonus round (see notes in pacman.c driver) */ #define CANNONB_HACK 0 -void cclimber_state::cclimber_decode(const UINT8 convtable[8][16]) +void cclimber_state::cclimber_decode(const uint8_t convtable[8][16]) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int A = 0x0000;A < 0x6000;A++) { int i,j; - UINT8 src = rom[A]; + uint8_t src = rom[A]; /* pick the translation table from bit 0 of the address */ /* and from bits 1 7 of the source data */ @@ -29,7 +29,7 @@ void cclimber_state::cclimber_decode(const UINT8 convtable[8][16]) DRIVER_INIT_MEMBER(cclimber_state,cclimber) { - static const UINT8 convtable[8][16] = + static const uint8_t convtable[8][16] = { /* 0xff marks spots which are unused and therefore unknown */ { 0x44,0x14,0x54,0x10,0x11,0x41,0x05,0x50,0x51,0x00,0x40,0x55,0x45,0x04,0x01,0x15 }, @@ -47,7 +47,7 @@ DRIVER_INIT_MEMBER(cclimber_state,cclimber) DRIVER_INIT_MEMBER(cclimber_state,cclimberj) { - static const UINT8 convtable[8][16] = + static const uint8_t convtable[8][16] = { { 0x41,0x54,0x51,0x14,0x05,0x10,0x01,0x55,0x44,0x11,0x00,0x50,0x15,0x40,0x04,0x45 }, { 0x50,0x11,0x40,0x55,0x51,0x14,0x45,0x04,0x54,0x15,0x10,0x05,0x44,0x01,0x00,0x41 }, @@ -65,7 +65,7 @@ DRIVER_INIT_MEMBER(cclimber_state,cclimberj) DRIVER_INIT_MEMBER(cclimber_state,ckongb) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0x0000;A < 0x6000;A++) /* all the program ROMs are encrypted */ { @@ -76,7 +76,7 @@ DRIVER_INIT_MEMBER(cclimber_state,ckongb) #if CANNONB_HACK void ::cannonb_patch() { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); rom[0x2ba0] = 0x21; rom[0x2ba1] = 0xfb; @@ -88,13 +88,13 @@ void ::cannonb_patch() DRIVER_INIT_MEMBER(cclimber_state,cannonb) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0x0000;A < 0x1000;A++) /* only first ROM is encrypted */ { - UINT8 src; + uint8_t src; int i; - static const UINT8 xor_tab[4] ={0x92, 0x82, 0x12, 0x10}; + static const uint8_t xor_tab[4] ={0x92, 0x82, 0x12, 0x10}; src = rom[A+0x10000]; diff --git a/src/mame/machine/cdi070.cpp b/src/mame/machine/cdi070.cpp index 4bbb0e26aa5..6f4bfbbd3b5 100644 --- a/src/mame/machine/cdi070.cpp +++ b/src/mame/machine/cdi070.cpp @@ -54,7 +54,7 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t& device, int n_level, co // cdi68070_device - constructor //------------------------------------------------- -cdi68070_device::cdi68070_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdi68070_device::cdi68070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MACHINE_CDI68070, "CDI68070", tag, owner, clock, "cdi68070", __FILE__) { } @@ -210,8 +210,8 @@ void cdi68070_device::device_reset() m_mmu.desc[index].base = 0; } - memset(m_seeds, 0, 10 * sizeof(UINT16)); - memset(m_state, 0, 8 * sizeof(UINT8)); + memset(m_seeds, 0, 10 * sizeof(uint16_t)); + memset(m_state, 0, 8 * sizeof(uint8_t)); m_mcu_value = 0; m_mcu_ack = 0; } @@ -222,7 +222,7 @@ void cdi68070_device::set_timer_callback(int channel) { case 0: { - UINT32 compare = 0x10000 - m_timers.timer0; + uint32_t compare = 0x10000 - m_timers.timer0; attotime period = attotime::from_hz(CLOCK_A/192) * compare; m_timers.timer0_timer->adjust(period); break; @@ -234,12 +234,12 @@ void cdi68070_device::set_timer_callback(int channel) } } -void cdi68070_device::set_quizard_mcu_ack(UINT8 ack) +void cdi68070_device::set_quizard_mcu_ack(uint8_t ack) { m_mcu_ack = ack; } -void cdi68070_device::set_quizard_mcu_value(UINT16 value) +void cdi68070_device::set_quizard_mcu_value(uint16_t value) { m_mcu_value = value; } @@ -252,7 +252,7 @@ TIMER_CALLBACK_MEMBER( cdi68070_device::timer0_callback ) m_timers.timer_status_register |= TSR_OV0; if(m_picr1 & 7) { - UINT8 interrupt = m_picr1 & 7; + uint8_t interrupt = m_picr1 & 7; m_timers.timer_status_register |= TSR_OV0; if(interrupt) { @@ -268,7 +268,7 @@ void cdi68070_device::uart_rx_check() { if((m_uart.command_register & 3) == 1) { - UINT32 div = 0x10000 >> ((m_uart.clock_select >> 4) & 7); + uint32_t div = 0x10000 >> ((m_uart.clock_select >> 4) & 7); m_uart.rx_timer->adjust(attotime::from_hz((49152000 / div) / 8)); } else @@ -293,7 +293,7 @@ void cdi68070_device::uart_tx_check() if(m_uart.tx_timer->remaining() == attotime::never) { - UINT32 div = 0x10000 >> (m_uart.clock_select & 7); + uint32_t div = 0x10000 >> (m_uart.clock_select & 7); m_uart.tx_timer->adjust(attotime::from_hz((49152000 / div) / 8)); } } @@ -303,14 +303,14 @@ void cdi68070_device::uart_tx_check() } } -void cdi68070_device::uart_rx(UINT8 data) +void cdi68070_device::uart_rx(uint8_t data) { m_uart.receive_pointer++; m_uart.receive_buffer[m_uart.receive_pointer] = data; uart_rx_check(); } -void cdi68070_device::uart_tx(UINT8 data) +void cdi68070_device::uart_tx(uint8_t data) { m_uart.transmit_pointer++; m_uart.transmit_buffer[m_uart.transmit_pointer] = data; @@ -338,7 +338,7 @@ TIMER_CALLBACK_MEMBER( cdi68070_device::rx_callback ) { verboselog(*this, 2, "scc68070_rx_callback: Receiving %02x\n", m_uart.receive_holding_register); - UINT8 interrupt = (m_picr2 >> 4) & 7; + uint8_t interrupt = (m_picr2 >> 4) & 7; if(interrupt) { state->m_maincpu->set_input_line_vector(M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); @@ -346,7 +346,7 @@ TIMER_CALLBACK_MEMBER( cdi68070_device::rx_callback ) } m_uart.status_register |= USR_RXRDY; - UINT32 div = 0x10000 >> ((m_uart.clock_select >> 4) & 7); + uint32_t div = 0x10000 >> ((m_uart.clock_select >> 4) & 7); m_uart.rx_timer->adjust(attotime::from_hz((49152000 / div) / 8)); } else @@ -362,13 +362,13 @@ TIMER_CALLBACK_MEMBER( cdi68070_device::rx_callback ) uart_rx_check(); } -void cdi68070_device::quizard_rx(UINT8 data) +void cdi68070_device::quizard_rx(uint8_t data) { uart_rx(0x5a); uart_rx(data); } -void cdi68070_device::quizard_set_seeds(UINT8 *rx) +void cdi68070_device::quizard_set_seeds(uint8_t *rx) { m_seeds[0] = (rx[1] << 8) | rx[0]; m_seeds[1] = (rx[3] << 8) | rx[2]; @@ -384,12 +384,12 @@ void cdi68070_device::quizard_set_seeds(UINT8 *rx) void cdi68070_device::quizard_calculate_state() { - //const UINT16 desired_bitfield = mcu_value; - const UINT16 field0 = 0x00ff; - const UINT16 field1 = m_mcu_value ^ 0x00ff; + //const uint16_t desired_bitfield = mcu_value; + const uint16_t field0 = 0x00ff; + const uint16_t field1 = m_mcu_value ^ 0x00ff; - UINT16 total0 = 0; - UINT16 total1 = 0; + uint16_t total0 = 0; + uint16_t total1 = 0; for(int index = 0; index < 10; index++) { @@ -403,19 +403,19 @@ void cdi68070_device::quizard_calculate_state() } } - UINT16 hi0 = (total0 >> 8) + 0x40; + uint16_t hi0 = (total0 >> 8) + 0x40; m_state[2] = hi0 / 2; m_state[3] = hi0 - m_state[2]; - UINT16 lo0 = (total0 & 0x00ff) + 0x40; + uint16_t lo0 = (total0 & 0x00ff) + 0x40; m_state[0] = lo0 / 2; m_state[1] = lo0 - m_state[0]; - UINT16 hi1 = (total1 >> 8) + 0x40; + uint16_t hi1 = (total1 >> 8) + 0x40; m_state[6] = hi1 / 2; m_state[7] = hi1 - m_state[6]; - UINT16 lo1 = (total1 & 0x00ff) + 0x40; + uint16_t lo1 = (total1 & 0x00ff) + 0x40; m_state[4] = lo1 / 2; m_state[5] = lo1 - m_state[4]; } @@ -436,9 +436,9 @@ void cdi68070_device::mcu_frame() void cdi68070_device::quizard_handle_byte_tx() { static int state = 0; - static UINT8 rx[0x100]; - static UINT8 rx_ptr = 0xff; - UINT8 tx = m_uart.transmit_holding_register; + static uint8_t rx[0x100]; + static uint8_t rx_ptr = 0xff; + uint8_t tx = m_uart.transmit_holding_register; switch(state) { @@ -535,7 +535,7 @@ TIMER_CALLBACK_MEMBER( cdi68070_device::tx_callback ) if(((m_uart.command_register >> 2) & 3) == 1) { - UINT8 interrupt = m_picr2 & 7; + uint8_t interrupt = m_picr2 & 7; if(interrupt) { state->m_maincpu->set_input_line_vector(M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); @@ -554,7 +554,7 @@ TIMER_CALLBACK_MEMBER( cdi68070_device::tx_callback ) } m_uart.transmit_pointer--; - UINT32 div = 0x10000 >> (m_uart.clock_select & 7); + uint32_t div = 0x10000 >> (m_uart.clock_select & 7); m_uart.tx_timer->adjust(attotime::from_hz((49152000 / div) / 8)); } else @@ -993,7 +993,7 @@ WRITE16_MEMBER( cdi68070_device::periphs_w ) m_timers.timer_status_register &= ~(data >> 8); if(!m_timers.timer_status_register) { - UINT8 interrupt = m_picr1 & 7; + uint8_t interrupt = m_picr1 & 7; state->m_maincpu->set_input_line(M68K_IRQ_1 + (interrupt - 1), CLEAR_LINE); } } diff --git a/src/mame/machine/cdi070.h b/src/mame/machine/cdi070.h index 7f3cff2d905..2d944e3609c 100644 --- a/src/mame/machine/cdi070.h +++ b/src/mame/machine/cdi070.h @@ -140,16 +140,16 @@ class cdi68070_device : public device_t { public: // construction/destruction - cdi68070_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdi68070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // external callbacks - void uart_rx(UINT8 data); - void uart_tx(UINT8 data); + void uart_rx(uint8_t data); + void uart_tx(uint8_t data); // UART Access for Quizard - void set_quizard_mcu_value(UINT16 value); - void set_quizard_mcu_ack(UINT8 ack); - void quizard_rx(UINT8 data); + void set_quizard_mcu_value(uint16_t value); + void set_quizard_mcu_ack(uint8_t ack); + void quizard_rx(uint8_t data); void mcu_frame(); @@ -163,76 +163,76 @@ public: // register structures struct i2c_regs_t { - UINT8 reserved0; - UINT8 data_register; - UINT8 reserved1; - UINT8 address_register; - UINT8 reserved2; - UINT8 status_register; - UINT8 reserved3; - UINT8 control_register; - UINT8 reserved; - UINT8 clock_control_register; + uint8_t reserved0; + uint8_t data_register; + uint8_t reserved1; + uint8_t address_register; + uint8_t reserved2; + uint8_t status_register; + uint8_t reserved3; + uint8_t control_register; + uint8_t reserved; + uint8_t clock_control_register; }; struct uart_regs_t { - UINT8 reserved0; - UINT8 mode_register; - UINT8 reserved1; - UINT8 status_register; - UINT8 reserved2; - UINT8 clock_select; - UINT8 reserved3; - UINT8 command_register; - UINT8 reserved4; - UINT8 transmit_holding_register; - UINT8 reserved5; - UINT8 receive_holding_register; - - INT16 receive_pointer; - UINT8 receive_buffer[32768]; + uint8_t reserved0; + uint8_t mode_register; + uint8_t reserved1; + uint8_t status_register; + uint8_t reserved2; + uint8_t clock_select; + uint8_t reserved3; + uint8_t command_register; + uint8_t reserved4; + uint8_t transmit_holding_register; + uint8_t reserved5; + uint8_t receive_holding_register; + + int16_t receive_pointer; + uint8_t receive_buffer[32768]; emu_timer* rx_timer; - INT16 transmit_pointer; - UINT8 transmit_buffer[32768]; + int16_t transmit_pointer; + uint8_t transmit_buffer[32768]; emu_timer* tx_timer; }; struct timer_regs_t { - UINT8 timer_status_register; - UINT8 timer_control_register; - UINT16 reload_register; - UINT16 timer0; - UINT16 timer1; - UINT16 timer2; + uint8_t timer_status_register; + uint8_t timer_control_register; + uint16_t reload_register; + uint16_t timer0; + uint16_t timer1; + uint16_t timer2; emu_timer* timer0_timer; }; struct dma_channel_t { - UINT8 channel_status; - UINT8 channel_error; + uint8_t channel_status; + uint8_t channel_error; - UINT8 reserved0[2]; + uint8_t reserved0[2]; - UINT8 device_control; - UINT8 operation_control; - UINT8 sequence_control; - UINT8 channel_control; + uint8_t device_control; + uint8_t operation_control; + uint8_t sequence_control; + uint8_t channel_control; - UINT8 reserved1[3]; + uint8_t reserved1[3]; - UINT16 transfer_counter; + uint16_t transfer_counter; - UINT32 memory_address_counter; + uint32_t memory_address_counter; - UINT8 reserved2[4]; + uint8_t reserved2[4]; - UINT32 device_address_counter; + uint32_t device_address_counter; - UINT8 reserved3[40]; + uint8_t reserved3[40]; }; struct dma_regs_t @@ -242,26 +242,26 @@ public: struct mmu_desc_t { - UINT16 attr; - UINT16 length; - UINT8 undefined; - UINT8 segment; - UINT16 base; + uint16_t attr; + uint16_t length; + uint8_t undefined; + uint8_t segment; + uint16_t base; }; struct mmu_regs_t { - UINT8 status; - UINT8 control; + uint8_t status; + uint8_t control; - UINT8 reserved[0x3e]; + uint8_t reserved[0x3e]; mmu_desc_t desc[8]; }; dma_regs_t& dma() { return m_dma; } - UINT16 get_lir() { return m_lir; } + uint16_t get_lir() { return m_lir; } protected: // device-level overrides @@ -275,15 +275,15 @@ private: void set_timer_callback(int channel); // internal state - UINT16 m_seeds[10]; - UINT8 m_state[8]; + uint16_t m_seeds[10]; + uint8_t m_state[8]; - UINT16 m_mcu_value; - UINT8 m_mcu_ack; + uint16_t m_mcu_value; + uint8_t m_mcu_ack; - UINT16 m_lir; - UINT8 m_picr1; - UINT8 m_picr2; + uint16_t m_lir; + uint8_t m_picr1; + uint8_t m_picr2; i2c_regs_t m_i2c; uart_regs_t m_uart; @@ -293,7 +293,7 @@ private: // non-static internal members void quizard_calculate_state(); - void quizard_set_seeds(UINT8 *rx); + void quizard_set_seeds(uint8_t *rx); void quizard_handle_byte_tx(); }; diff --git a/src/mame/machine/cdicdic.cpp b/src/mame/machine/cdicdic.cpp index bc01d5a6164..a5c5628c6cf 100644 --- a/src/mame/machine/cdicdic.cpp +++ b/src/mame/machine/cdicdic.cpp @@ -86,7 +86,7 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t& device, int n_level, co // GLOBAL VARIABLES //************************************************************************** -const INT32 cdicdic_device::s_cdic_adpcm_filter_coef[5][2] = +const int32_t cdicdic_device::s_cdic_adpcm_filter_coef[5][2] = { { 0,0 }, { 60,0 }, @@ -99,9 +99,9 @@ const INT32 cdicdic_device::s_cdic_adpcm_filter_coef[5][2] = // INLINES //************************************************************************** -static inline int CDIC_IS_VALID_SAMPLE_BUF(UINT16 *cdram, UINT16 addr) +static inline int CDIC_IS_VALID_SAMPLE_BUF(uint16_t *cdram, uint16_t addr) { - UINT8 *cdram8 = ((UINT8*)cdram) + addr + 8; + uint8_t *cdram8 = ((uint8_t*)cdram) + addr + 8; if(cdram8[2] != 0xff) { return 1; @@ -109,9 +109,9 @@ static inline int CDIC_IS_VALID_SAMPLE_BUF(UINT16 *cdram, UINT16 addr) return 0; } -static inline double CDIC_SAMPLE_BUF_FREQ(UINT16 *cdram, UINT16 addr) +static inline double CDIC_SAMPLE_BUF_FREQ(uint16_t *cdram, uint16_t addr) { - UINT8 *cdram8 = ((UINT8*)cdram) + addr + 8; + uint8_t *cdram8 = ((uint8_t*)cdram) + addr + 8; switch(cdram8[2] & 0x3f) { case 0: @@ -129,9 +129,9 @@ static inline double CDIC_SAMPLE_BUF_FREQ(UINT16 *cdram, UINT16 addr) } } -static inline int CDIC_SAMPLE_BUF_SIZE(UINT16 *cdram, UINT16 addr) +static inline int CDIC_SAMPLE_BUF_SIZE(uint16_t *cdram, uint16_t addr) { - UINT8 *cdram8 = ((UINT8*)cdram) + addr + 8; + uint8_t *cdram8 = ((uint8_t*)cdram) + addr + 8; switch(cdram8[2] & 0x3f) { case 0: @@ -151,7 +151,7 @@ static inline int CDIC_SAMPLE_BUF_SIZE(UINT16 *cdram, UINT16 addr) } } -static inline INT16 clamp(INT16 in) +static inline int16_t clamp(int16_t in) { return in; } @@ -160,16 +160,16 @@ static inline INT16 clamp(INT16 in) // MEMBER FUNCTIONS //************************************************************************** -UINT32 cdicdic_device::increment_cdda_frame_bcd(UINT32 bcd) +uint32_t cdicdic_device::increment_cdda_frame_bcd(uint32_t bcd) { - UINT8 nybbles[6] = + uint8_t nybbles[6] = { - static_cast(bcd & 0x0000000f), - static_cast((bcd & 0x000000f0) >> 4), - static_cast((bcd & 0x00000f00) >> 8), - static_cast((bcd & 0x0000f000) >> 12), - static_cast((bcd & 0x000f0000) >> 16), - static_cast((bcd & 0x00f00000) >> 20) + static_cast(bcd & 0x0000000f), + static_cast((bcd & 0x000000f0) >> 4), + static_cast((bcd & 0x00000f00) >> 8), + static_cast((bcd & 0x0000f000) >> 12), + static_cast((bcd & 0x000f0000) >> 16), + static_cast((bcd & 0x00f00000) >> 20) }; nybbles[0]++; if(nybbles[0] == 5 && nybbles[1] == 7) @@ -200,16 +200,16 @@ UINT32 cdicdic_device::increment_cdda_frame_bcd(UINT32 bcd) return (nybbles[5] << 20) | (nybbles[4] << 16) | (nybbles[3] << 12) | (nybbles[2] << 8) | (nybbles[1] << 4) | nybbles[0]; } -UINT32 cdicdic_device::increment_cdda_sector_bcd(UINT32 bcd) +uint32_t cdicdic_device::increment_cdda_sector_bcd(uint32_t bcd) { - UINT8 nybbles[6] = + uint8_t nybbles[6] = { - static_cast(bcd & 0x0000000f), - static_cast((bcd & 0x000000f0) >> 4), - static_cast((bcd & 0x00000f00) >> 8), - static_cast((bcd & 0x0000f000) >> 12), - static_cast((bcd & 0x000f0000) >> 16), - static_cast((bcd & 0x00f00000) >> 20) + static_cast(bcd & 0x0000000f), + static_cast((bcd & 0x000000f0) >> 4), + static_cast((bcd & 0x00000f00) >> 8), + static_cast((bcd & 0x0000f000) >> 12), + static_cast((bcd & 0x000f0000) >> 16), + static_cast((bcd & 0x00f00000) >> 20) }; nybbles[2]++; if(nybbles[2] == 10) @@ -230,24 +230,24 @@ UINT32 cdicdic_device::increment_cdda_sector_bcd(UINT32 bcd) return (nybbles[5] << 20) | (nybbles[4] << 16) | (nybbles[3] << 12) | (nybbles[2] << 8) | (nybbles[1] << 4) | nybbles[0]; } -void cdicdic_device::decode_xa_mono(INT32 *cdic_xa_last, const UINT8 *xa, INT16 *dp) +void cdicdic_device::decode_xa_mono(int32_t *cdic_xa_last, const uint8_t *xa, int16_t *dp) { - INT32 l0 = cdic_xa_last[0]; - INT32 l1 = cdic_xa_last[1]; + int32_t l0 = cdic_xa_last[0]; + int32_t l1 = cdic_xa_last[1]; - for(INT32 b = 0; b < 18; b++) + for(int32_t b = 0; b < 18; b++) { - for(INT32 s = 0; s < 4; s++) + for(int32_t s = 0; s < 4; s++) { - UINT8 flags = xa[(4 + (s << 1)) ^ 1]; - UINT8 shift = flags & 0xf; - UINT8 filter = flags >> 4; - INT32 f0 = s_cdic_adpcm_filter_coef[filter][0]; - INT32 f1 = s_cdic_adpcm_filter_coef[filter][1]; + uint8_t flags = xa[(4 + (s << 1)) ^ 1]; + uint8_t shift = flags & 0xf; + uint8_t filter = flags >> 4; + int32_t f0 = s_cdic_adpcm_filter_coef[filter][0]; + int32_t f1 = s_cdic_adpcm_filter_coef[filter][1]; - for(INT32 i = 0; i < 28; i++) + for(int32_t i = 0; i < 28; i++) { - INT16 d = (xa[(16 + (i << 2) + s) ^ 1] & 0xf) << 12; + int16_t d = (xa[(16 + (i << 2) + s) ^ 1] & 0xf) << 12; d = clamp((d >> shift) + (((l0 * f0) + (l1 * f1) + 32) >> 6)); *dp = d; dp++; @@ -261,9 +261,9 @@ void cdicdic_device::decode_xa_mono(INT32 *cdic_xa_last, const UINT8 *xa, INT16 f0 = s_cdic_adpcm_filter_coef[filter][0]; f1 = s_cdic_adpcm_filter_coef[filter][1]; - for(INT32 i = 0; i < 28; i++) + for(int32_t i = 0; i < 28; i++) { - INT16 d = (xa[(16 + (i << 2) + s) ^ 1] >> 4) << 12; + int16_t d = (xa[(16 + (i << 2) + s) ^ 1] >> 4) << 12; d = clamp((d >> shift) + (((l0 * f0) + (l1 * f1) + 32) >> 6)); *dp = d; dp++; @@ -281,22 +281,22 @@ void cdicdic_device::decode_xa_mono(INT32 *cdic_xa_last, const UINT8 *xa, INT16 void cdicdic_device::decode_xa_mono8(int *cdic_xa_last, const unsigned char *xa, signed short *dp) { - INT32 l0 = cdic_xa_last[0]; - INT32 l1 = cdic_xa_last[1]; + int32_t l0 = cdic_xa_last[0]; + int32_t l1 = cdic_xa_last[1]; - for(INT32 b = 0; b < 18; b++) + for(int32_t b = 0; b < 18; b++) { - for(INT32 s = 0; s < 4; s++) + for(int32_t s = 0; s < 4; s++) { - UINT8 flags = xa[(4 + s) ^ 1]; - UINT8 shift = flags & 0xf; - UINT8 filter = flags >> 4; - INT32 f0 = s_cdic_adpcm_filter_coef[filter][0]; - INT32 f1 = s_cdic_adpcm_filter_coef[filter][1]; + uint8_t flags = xa[(4 + s) ^ 1]; + uint8_t shift = flags & 0xf; + uint8_t filter = flags >> 4; + int32_t f0 = s_cdic_adpcm_filter_coef[filter][0]; + int32_t f1 = s_cdic_adpcm_filter_coef[filter][1]; - for(INT32 i = 0; i < 28; i++) + for(int32_t i = 0; i < 28; i++) { - INT16 d = (xa[(16 + (i << 2) + s) ^ 1] << 8); + int16_t d = (xa[(16 + (i << 2) + s) ^ 1] << 8); d = clamp((d >> shift) + (((l0 * f0) + (l1 * f1) + 32) >> 6)); *dp = d; dp++; @@ -312,34 +312,34 @@ void cdicdic_device::decode_xa_mono8(int *cdic_xa_last, const unsigned char *xa, cdic_xa_last[1] = l1; } -void cdicdic_device::decode_xa_stereo(INT32 *cdic_xa_last, const UINT8 *xa, INT16 *dp) +void cdicdic_device::decode_xa_stereo(int32_t *cdic_xa_last, const uint8_t *xa, int16_t *dp) { - INT32 l0=cdic_xa_last[0]; - INT32 l1=cdic_xa_last[1]; - INT32 l2=cdic_xa_last[2]; - INT32 l3=cdic_xa_last[3]; + int32_t l0=cdic_xa_last[0]; + int32_t l1=cdic_xa_last[1]; + int32_t l2=cdic_xa_last[2]; + int32_t l3=cdic_xa_last[3]; - for(INT32 b = 0; b < 18; b++) + for(int32_t b = 0; b < 18; b++) { - for(INT32 s = 0; s < 4; s++) + for(int32_t s = 0; s < 4; s++) { - UINT8 flags0 = xa[(4 + (s << 1)) ^ 1]; - UINT8 shift0 = flags0 & 0xf; - UINT8 filter0 = flags0 >> 4; - UINT8 flags1 = xa[(5 + (s << 1)) ^ 1]; - UINT8 shift1 = flags1 & 0xf; - UINT8 filter1 = flags1 >> 4; - - INT32 f0 = s_cdic_adpcm_filter_coef[filter0][0]; - INT32 f1 = s_cdic_adpcm_filter_coef[filter0][1]; - INT32 f2 = s_cdic_adpcm_filter_coef[filter1][0]; - INT32 f3 = s_cdic_adpcm_filter_coef[filter1][1]; - - for(INT32 i = 0; i < 28; i++) + uint8_t flags0 = xa[(4 + (s << 1)) ^ 1]; + uint8_t shift0 = flags0 & 0xf; + uint8_t filter0 = flags0 >> 4; + uint8_t flags1 = xa[(5 + (s << 1)) ^ 1]; + uint8_t shift1 = flags1 & 0xf; + uint8_t filter1 = flags1 >> 4; + + int32_t f0 = s_cdic_adpcm_filter_coef[filter0][0]; + int32_t f1 = s_cdic_adpcm_filter_coef[filter0][1]; + int32_t f2 = s_cdic_adpcm_filter_coef[filter1][0]; + int32_t f3 = s_cdic_adpcm_filter_coef[filter1][1]; + + for(int32_t i = 0; i < 28; i++) { - INT16 d=xa[(16 + (i << 2) + s) ^ 1]; - INT16 d0 = (d & 0xf) << 12; - INT16 d1 = (d >> 4) << 12; + int16_t d=xa[(16 + (i << 2) + s) ^ 1]; + int16_t d0 = (d & 0xf) << 12; + int16_t d1 = (d >> 4) << 12; d0 = clamp((d0 >> shift0) + (((l0 * f0) + (l1 * f1) + 32) >> 6)); *dp = d0; dp++; @@ -363,32 +363,32 @@ void cdicdic_device::decode_xa_stereo(INT32 *cdic_xa_last, const UINT8 *xa, INT1 cdic_xa_last[3] = l3; } -void cdicdic_device::decode_xa_stereo8(INT32 *cdic_xa_last, const UINT8 *xa, INT16 *dp) +void cdicdic_device::decode_xa_stereo8(int32_t *cdic_xa_last, const uint8_t *xa, int16_t *dp) { - INT32 l0 = cdic_xa_last[0]; - INT32 l1 = cdic_xa_last[1]; - INT32 l2 = cdic_xa_last[2]; - INT32 l3 = cdic_xa_last[3]; + int32_t l0 = cdic_xa_last[0]; + int32_t l1 = cdic_xa_last[1]; + int32_t l2 = cdic_xa_last[2]; + int32_t l3 = cdic_xa_last[3]; - for(INT32 b = 0; b < 18; b++) + for(int32_t b = 0; b < 18; b++) { - for(INT32 s = 0; s < 4; s += 2) + for(int32_t s = 0; s < 4; s += 2) { - UINT8 flags0 = xa[(4 + s) ^ 1]; - UINT8 shift0 = flags0 & 0xf; - UINT8 filter0 = flags0 >> 4; - UINT8 flags1 = xa[(5 + s) ^ 1]; - UINT8 shift1 = flags1 & 0xf; - UINT8 filter1 = flags1 >> 4; - INT32 f0 = s_cdic_adpcm_filter_coef[filter0][0]; - INT32 f1 = s_cdic_adpcm_filter_coef[filter0][1]; - INT32 f2 = s_cdic_adpcm_filter_coef[filter1][0]; - INT32 f3 = s_cdic_adpcm_filter_coef[filter1][1]; - - for(INT32 i = 0; i < 28; i++) + uint8_t flags0 = xa[(4 + s) ^ 1]; + uint8_t shift0 = flags0 & 0xf; + uint8_t filter0 = flags0 >> 4; + uint8_t flags1 = xa[(5 + s) ^ 1]; + uint8_t shift1 = flags1 & 0xf; + uint8_t filter1 = flags1 >> 4; + int32_t f0 = s_cdic_adpcm_filter_coef[filter0][0]; + int32_t f1 = s_cdic_adpcm_filter_coef[filter0][1]; + int32_t f2 = s_cdic_adpcm_filter_coef[filter1][0]; + int32_t f3 = s_cdic_adpcm_filter_coef[filter1][1]; + + for(int32_t i = 0; i < 28; i++) { - INT16 d0 = (xa[(16 + (i << 2) + s + 0) ^ 1] << 8); - INT16 d1 = (xa[(16 + (i << 2) + s + 1) ^ 1] << 8); + int16_t d0 = (xa[(16 + (i << 2) + s + 0) ^ 1] << 8); + int16_t d1 = (xa[(16 + (i << 2) + s + 1) ^ 1] << 8); d0 = clamp((d0 >> shift0) + (((l0 * f0) + (l1 * f1) + 32) >> 6)); *dp = d0; @@ -413,16 +413,16 @@ void cdicdic_device::decode_xa_stereo8(INT32 *cdic_xa_last, const UINT8 *xa, INT cdic_xa_last[3] = l3; } -void cdicdic_device::decode_audio_sector(const UINT8 *xa, INT32 triggered) +void cdicdic_device::decode_audio_sector(const uint8_t *xa, int32_t triggered) { // Get XA format from sector header cdi_state *state = machine().driver_data(); - const UINT8 *hdr = xa + 4; - INT32 channels; - INT32 bits = 4; - INT32 index = 0; - INT16 samples[18*28*16+16]; + const uint8_t *hdr = xa + 4; + int32_t channels; + int32_t bits = 4; + int32_t index = 0; + int16_t samples[18*28*16+16]; if(hdr[2] == 0xff && triggered == 1) { @@ -568,7 +568,7 @@ void cdicdic_device::sample_trigger() verboselog(*this, 0, "Hit audio_sample_trigger, with m_decode_addr == %04x, calling decode_audio_sector\n", m_decode_addr ); // Decode the data at Z+4, the same offset as a normal CD sector. - decode_audio_sector(((UINT8*)m_ram.get()) + (m_decode_addr & 0x3ffe) + 4, 1); + decode_audio_sector(((uint8_t*)m_ram.get()) + (m_decode_addr & 0x3ffe) + 4, 1); // Swap buffer positions to indicate our new buffer position at the next read m_decode_addr ^= 0x1a00; @@ -609,18 +609,18 @@ void cdicdic_device::process_delayed_command() case 0x2a: // Read Mode 2 //case 0x2c: // Seek { - UINT8 buffer[2560] = { 0 }; - UINT32 msf = m_time >> 8; - UINT32 lba = 0; + uint8_t buffer[2560] = { 0 }; + uint32_t msf = m_time >> 8; + uint32_t lba = 0; int index = 0; - UINT8 nybbles[6] = + uint8_t nybbles[6] = { - static_cast(msf & 0x0000000f), - static_cast((msf & 0x000000f0) >> 4), - static_cast((msf & 0x00000f00) >> 8), - static_cast((msf & 0x0000f000) >> 12), - static_cast((msf & 0x000f0000) >> 16), - static_cast((msf & 0x00f00000) >> 20) + static_cast(msf & 0x0000000f), + static_cast((msf & 0x000000f0) >> 4), + static_cast((msf & 0x00000f00) >> 8), + static_cast((msf & 0x0000f000) >> 12), + static_cast((msf & 0x000f0000) >> 16), + static_cast((msf & 0x00f00000) >> 20) }; if(msf & 0x000080) { @@ -706,7 +706,7 @@ void cdicdic_device::process_delayed_command() m_ram[(m_data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1]; } - decode_audio_sector(((UINT8*)m_ram.get()) + ((m_data_buffer & 5) * 0xa00 + 4), 0); + decode_audio_sector(((uint8_t*)m_ram.get()) + ((m_data_buffer & 5) * 0xa00 + 4), 0); //printf( "Setting CDIC interrupt line\n" ); verboselog(*this, 0, "%s", "Setting CDIC interrupt line for audio sector\n" ); @@ -776,23 +776,23 @@ void cdicdic_device::process_delayed_command() case 0x28: // Play CDDA audio { - UINT8 buffer[2560] = { 0 }; + uint8_t buffer[2560] = { 0 }; int index = 0; - UINT32 msf = (m_time & 0xffff7f00) >> 8; - UINT32 next_msf = increment_cdda_frame_bcd((m_time & 0xffff7f00) >> 8); - UINT32 rounded_next_msf = increment_cdda_sector_bcd((m_time & 0xffff0000) >> 8); - UINT32 lba = 0; -// UINT32 next_lba = 0; - UINT8 nybbles[6] = + uint32_t msf = (m_time & 0xffff7f00) >> 8; + uint32_t next_msf = increment_cdda_frame_bcd((m_time & 0xffff7f00) >> 8); + uint32_t rounded_next_msf = increment_cdda_sector_bcd((m_time & 0xffff0000) >> 8); + uint32_t lba = 0; +// uint32_t next_lba = 0; + uint8_t nybbles[6] = { - static_cast(msf & 0x0000000f), - static_cast((msf & 0x000000f0) >> 4), - static_cast((msf & 0x00000f00) >> 8), - static_cast((msf & 0x0000f000) >> 12), - static_cast((msf & 0x000f0000) >> 16), - static_cast((msf & 0x00f00000) >> 20) + static_cast(msf & 0x0000000f), + static_cast((msf & 0x000000f0) >> 4), + static_cast((msf & 0x00000f00) >> 8), + static_cast((msf & 0x0000f000) >> 12), + static_cast((msf & 0x000f0000) >> 16), + static_cast((msf & 0x00f00000) >> 20) }; -/* UINT8 next_nybbles[6] = +/* uint8_t next_nybbles[6] = { rounded_next_msf & 0x0000000f, (rounded_next_msf & 0x000000f0) >> 4, @@ -850,19 +850,19 @@ void cdicdic_device::process_delayed_command() } case 0x2c: // Seek { - UINT8 buffer[2560] = { 0 }; + uint8_t buffer[2560] = { 0 }; int index = 0; - UINT32 msf = (m_time & 0xffff7f00) >> 8; - UINT32 next_msf = increment_cdda_frame_bcd((m_time & 0xffff7f00) >> 8); - UINT32 lba = 0; - UINT8 nybbles[6] = + uint32_t msf = (m_time & 0xffff7f00) >> 8; + uint32_t next_msf = increment_cdda_frame_bcd((m_time & 0xffff7f00) >> 8); + uint32_t lba = 0; + uint8_t nybbles[6] = { - static_cast(msf & 0x0000000f), - static_cast((msf & 0x000000f0) >> 4), - static_cast((msf & 0x00000f00) >> 8), - static_cast((msf & 0x0000f000) >> 12), - static_cast((msf & 0x000f0000) >> 16), - static_cast((msf & 0x00f00000) >> 20) + static_cast(msf & 0x0000000f), + static_cast((msf & 0x000000f0) >> 4), + static_cast((msf & 0x00000f00) >> 8), + static_cast((msf & 0x0000f000) >> 12), + static_cast((msf & 0x000f0000) >> 16), + static_cast((msf & 0x00f00000) >> 20) }; lba = nybbles[0] + nybbles[1]*10 + ((nybbles[2] + nybbles[3]*10)*75) + ((nybbles[4] + nybbles[5]*10)*75*60); @@ -905,7 +905,7 @@ void cdicdic_device::process_delayed_command() READ16_MEMBER( cdicdic_device::regs_r ) { cdi_state *state = machine().driver_data(); - UINT32 addr = offset + 0x3c00/2; + uint32_t addr = offset + 0x3c00/2; switch(addr) { @@ -918,7 +918,7 @@ READ16_MEMBER( cdicdic_device::regs_r ) return m_time >> 16; case 0x3c04/2: // Time register (LSW) - verboselog(*this, 0, "cdic_r: Time Register (LSW) = %04x & %04x\n", (UINT16)(m_time & 0x0000ffff), mem_mask); + verboselog(*this, 0, "cdic_r: Time Register (LSW) = %04x & %04x\n", (uint16_t)(m_time & 0x0000ffff), mem_mask); return m_time & 0x0000ffff; case 0x3c06/2: // File register @@ -939,7 +939,7 @@ READ16_MEMBER( cdicdic_device::regs_r ) case 0x3ff4/2: // ABUF { - UINT16 temp = m_audio_buffer; + uint16_t temp = m_audio_buffer; m_audio_buffer &= 0x7fff; if(!((m_audio_buffer | m_x_buffer) & 0x8000)) { @@ -953,7 +953,7 @@ READ16_MEMBER( cdicdic_device::regs_r ) case 0x3ff6/2: // XBUF { - UINT16 temp = m_x_buffer; + uint16_t temp = m_x_buffer; m_x_buffer &= 0x7fff; if(!((m_audio_buffer | m_x_buffer) & 0x8000)) { @@ -990,7 +990,7 @@ WRITE16_MEMBER( cdicdic_device::regs_w ) { cdi_state *state = machine().driver_data(); - UINT32 addr = offset + 0x3c00/2; + uint32_t addr = offset + 0x3c00/2; switch(addr) { @@ -1045,11 +1045,11 @@ WRITE16_MEMBER( cdicdic_device::regs_w ) case 0x3ff8/2: { - UINT32 start = state->m_scc->dma().channel[0].memory_address_counter; - UINT32 count = state->m_scc->dma().channel[0].transfer_counter; - UINT32 index = 0; - UINT32 device_index = (data & 0x3fff) >> 1; - UINT16 *memory = state->m_planea; + uint32_t start = state->m_scc->dma().channel[0].memory_address_counter; + uint32_t count = state->m_scc->dma().channel[0].transfer_counter; + uint32_t index = 0; + uint32_t device_index = (data & 0x3fff) >> 1; + uint16_t *memory = state->m_planea; verboselog(*this, 0, "memory address counter: %08x\n", state->m_scc->dma().channel[0].memory_address_counter); verboselog(*this, 0, "cdic_w: DMA Control Register = %04x & %04x\n", data, mem_mask); verboselog(*this, 0, "Doing copy, transferring %04x bytes\n", count * 2 ); @@ -1161,7 +1161,7 @@ WRITE16_MEMBER( cdicdic_device::regs_w ) // cdicdic_device - constructor //------------------------------------------------- -cdicdic_device::cdicdic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdicdic_device::cdicdic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MACHINE_CDICDIC, "CDICDIC", tag, owner, clock, "cdicdic", __FILE__) { } @@ -1193,7 +1193,7 @@ void cdicdic_device::device_start() m_audio_sample_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdicdic_device::audio_sample_trigger), this)); m_audio_sample_timer->adjust(attotime::never); - m_ram = std::make_unique(0x3c00/2); + m_ram = std::make_unique(0x3c00/2); } //------------------------------------------------- diff --git a/src/mame/machine/cdicdic.h b/src/mame/machine/cdicdic.h index 33ca053e066..7663dd33fcf 100644 --- a/src/mame/machine/cdicdic.h +++ b/src/mame/machine/cdicdic.h @@ -51,7 +51,7 @@ class cdicdic_device : public device_t { public: // construction/destruction - cdicdic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdicdic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // non-static internal members void sample_trigger(); @@ -74,45 +74,45 @@ protected: private: // internal state - UINT16 m_command; // CDIC Command Register (0x303c00) - UINT32 m_time; // CDIC Time Register (0x303c02) - UINT16 m_file; // CDIC File Register (0x303c06) - UINT32 m_channel; // CDIC Channel Register (0x303c08) - UINT16 m_audio_channel; // CDIC Audio Channel Register (0x303c0c) - - UINT16 m_audio_buffer; // CDIC Audio Buffer Register (0x303ff4) - UINT16 m_x_buffer; // CDIC X-Buffer Register (0x303ff6) - UINT16 m_dma_control; // CDIC DMA Control Register (0x303ff8) - UINT16 m_z_buffer; // CDIC Z-Buffer Register (0x303ffa) - UINT16 m_interrupt_vector; // CDIC Interrupt Vector Register (0x303ffc) - UINT16 m_data_buffer; // CDIC Data Buffer Register (0x303ffe) + uint16_t m_command; // CDIC Command Register (0x303c00) + uint32_t m_time; // CDIC Time Register (0x303c02) + uint16_t m_file; // CDIC File Register (0x303c06) + uint32_t m_channel; // CDIC Channel Register (0x303c08) + uint16_t m_audio_channel; // CDIC Audio Channel Register (0x303c0c) + + uint16_t m_audio_buffer; // CDIC Audio Buffer Register (0x303ff4) + uint16_t m_x_buffer; // CDIC X-Buffer Register (0x303ff6) + uint16_t m_dma_control; // CDIC DMA Control Register (0x303ff8) + uint16_t m_z_buffer; // CDIC Z-Buffer Register (0x303ffa) + uint16_t m_interrupt_vector; // CDIC Interrupt Vector Register (0x303ffc) + uint16_t m_data_buffer; // CDIC Data Buffer Register (0x303ffe) emu_timer *m_interrupt_timer; cdrom_file *m_cd; emu_timer *m_audio_sample_timer; - INT32 m_audio_sample_freq; - INT32 m_audio_sample_size; + int32_t m_audio_sample_freq; + int32_t m_audio_sample_size; - UINT16 m_decode_addr; - UINT8 m_decode_delay; + uint16_t m_decode_addr; + uint8_t m_decode_delay; attotime m_decode_period; int m_xa_last[4]; - std::unique_ptr m_ram; + std::unique_ptr m_ram; // static internal members - static void decode_xa_mono(INT32 *cdic_xa_last, const UINT8 *xa, INT16 *dp); - static void decode_xa_mono8(INT32 *cdic_xa_last, const UINT8 *xa, INT16 *dp); - static void decode_xa_stereo(INT32 *cdic_xa_last, const UINT8 *xa, INT16 *dp); - static void decode_xa_stereo8(INT32 *cdic_xa_last, const UINT8 *xa, INT16 *dp); + static void decode_xa_mono(int32_t *cdic_xa_last, const uint8_t *xa, int16_t *dp); + static void decode_xa_mono8(int32_t *cdic_xa_last, const uint8_t *xa, int16_t *dp); + static void decode_xa_stereo(int32_t *cdic_xa_last, const uint8_t *xa, int16_t *dp); + static void decode_xa_stereo8(int32_t *cdic_xa_last, const uint8_t *xa, int16_t *dp); - static const INT32 s_cdic_adpcm_filter_coef[5][2]; + static const int32_t s_cdic_adpcm_filter_coef[5][2]; // non-static internal members - UINT32 increment_cdda_frame_bcd(UINT32 bcd); - UINT32 increment_cdda_sector_bcd(UINT32 bcd); - void decode_audio_sector(const UINT8 *xa, INT32 triggered); + uint32_t increment_cdda_frame_bcd(uint32_t bcd); + uint32_t increment_cdda_sector_bcd(uint32_t bcd); + void decode_audio_sector(const uint8_t *xa, int32_t triggered); }; // device type definition diff --git a/src/mame/machine/cdislave.cpp b/src/mame/machine/cdislave.cpp index fbf21c839c8..23141055e59 100644 --- a/src/mame/machine/cdislave.cpp +++ b/src/mame/machine/cdislave.cpp @@ -62,7 +62,7 @@ TIMER_CALLBACK_MEMBER( cdislave_device::trigger_readback_int ) m_interrupt_timer->adjust(attotime::never); } -void cdislave_device::prepare_readback(const attotime &delay, UINT8 channel, UINT8 count, UINT8 data0, UINT8 data1, UINT8 data2, UINT8 data3, UINT8 cmd) +void cdislave_device::prepare_readback(const attotime &delay, uint8_t channel, uint8_t count, uint8_t data0, uint8_t data1, uint8_t data2, uint8_t data3, uint8_t cmd) { m_channel[channel].m_out_index = 0; m_channel[channel].m_out_count = count; @@ -79,12 +79,12 @@ void cdislave_device::perform_mouse_update() { cdi_state *state = machine().driver_data(); - UINT16 x = state->m_mousex->read(); - UINT16 y = state->m_mousey->read(); - UINT8 buttons = state->m_mousebtn->read(); + uint16_t x = state->m_mousex->read(); + uint16_t y = state->m_mousey->read(); + uint8_t buttons = state->m_mousebtn->read(); - UINT16 old_mouse_x = m_real_mouse_x; - UINT16 old_mouse_y = m_real_mouse_y; + uint16_t old_mouse_x = m_real_mouse_x; + uint16_t old_mouse_y = m_real_mouse_y; if(m_real_mouse_x == 0xffff) { @@ -128,7 +128,7 @@ READ16_MEMBER( cdislave_device::slave_r ) if(m_channel[offset].m_out_count) { - UINT8 ret = m_channel[offset].m_out_buf[m_channel[offset].m_out_index]; + uint8_t ret = m_channel[offset].m_out_buf[m_channel[offset].m_out_index]; verboselog(*this, 0, "slave_r: Channel %d: %d, %02x\n", offset, m_channel[offset].m_out_index, ret ); if(m_channel[offset].m_out_index == 0) { @@ -161,7 +161,7 @@ READ16_MEMBER( cdislave_device::slave_r ) void cdislave_device::set_mouse_position() { -// UINT16 x, y; +// uint16_t x, y; //printf( "Set mouse position: %02x %02x %02x\n", m_in_buf[0], m_in_buf[1], m_in_buf[2] ); @@ -418,7 +418,7 @@ WRITE16_MEMBER( cdislave_device::slave_w ) // cdislave_device - constructor //------------------------------------------------- -cdislave_device::cdislave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdislave_device::cdislave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MACHINE_CDISLAVE, "CDISLAVE", tag, owner, clock, "cdislave", __FILE__) { } diff --git a/src/mame/machine/cdislave.h b/src/mame/machine/cdislave.h index 4211574c018..29e748f9528 100644 --- a/src/mame/machine/cdislave.h +++ b/src/mame/machine/cdislave.h @@ -46,12 +46,12 @@ class cdislave_device : public device_t { public: // construction/destruction - cdislave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdislave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // external callbacks DECLARE_INPUT_CHANGED_MEMBER( mouse_update ); - UINT8* get_lcd_state() { return m_lcd_state; } + uint8_t* get_lcd_state() { return m_lcd_state; } DECLARE_READ16_MEMBER( slave_r ); DECLARE_WRITE16_MEMBER( slave_w ); @@ -73,35 +73,35 @@ private: public: channel_state() { } - UINT8 m_out_buf[4]; - UINT8 m_out_index; - UINT8 m_out_count; - UINT8 m_out_cmd; + uint8_t m_out_buf[4]; + uint8_t m_out_index; + uint8_t m_out_count; + uint8_t m_out_cmd; }; channel_state m_channel[4]; emu_timer *m_interrupt_timer; - UINT8 m_in_buf[17]; - UINT8 m_in_index; - UINT8 m_in_count; + uint8_t m_in_buf[17]; + uint8_t m_in_index; + uint8_t m_in_count; - UINT8 m_polling_active; + uint8_t m_polling_active; - UINT8 m_xbus_interrupt_enable; + uint8_t m_xbus_interrupt_enable; - UINT8 m_lcd_state[16]; + uint8_t m_lcd_state[16]; - UINT16 m_real_mouse_x; - UINT16 m_real_mouse_y; + uint16_t m_real_mouse_x; + uint16_t m_real_mouse_y; - UINT16 m_fake_mouse_x; - UINT16 m_fake_mouse_y; + uint16_t m_fake_mouse_x; + uint16_t m_fake_mouse_y; // static internal members // non-static internal members - void prepare_readback(const attotime &delay, UINT8 channel, UINT8 count, UINT8 data0, UINT8 data1, UINT8 data2, UINT8 data3, UINT8 cmd); + void prepare_readback(const attotime &delay, uint8_t channel, uint8_t count, uint8_t data0, uint8_t data1, uint8_t data2, uint8_t data3, uint8_t cmd); void perform_mouse_update(); void set_mouse_position(); }; diff --git a/src/mame/machine/chaknpop.cpp b/src/mame/machine/chaknpop.cpp index c6f31df3312..50c39d2aafc 100644 --- a/src/mame/machine/chaknpop.cpp +++ b/src/mame/machine/chaknpop.cpp @@ -12,7 +12,7 @@ /* mcu data that is extracted from the real board! */ /* updated on 2st Jun 2003 */ -static const UINT8 mcu_data[256] = { +static const uint8_t mcu_data[256] = { 0x3a, 0xe6, 0x80, 0xc6, 0x0e, 0xdd, 0x77, 0xfd, 0x7e, 0xfe, 0x10, 0x38, 0x10, 0xdd, 0x7e, 0x03, 0xc6, 0x08, 0xdd, 0x77, 0x03, 0xdd, 0x7e, 0xff, @@ -47,7 +47,7 @@ static const UINT8 mcu_data[256] = { 0x10, 0xfc, 0x3e, 0x01, 0x32, 0x5b, 0x81, 0xc9 }; -void chaknpop_state::mcu_update_seed( UINT8 data ) +void chaknpop_state::mcu_update_seed( uint8_t data ) { if (!(data & 0x80)) { @@ -87,7 +87,7 @@ READ8_MEMBER(chaknpop_state::mcu_port_c_r) WRITE8_MEMBER(chaknpop_state::mcu_port_a_w) { - UINT8 mcu_command; + uint8_t mcu_command; mcu_command = data + m_mcu_seed; m_mcu_result = 0; diff --git a/src/mame/machine/coco.cpp b/src/mame/machine/coco.cpp index beb835077ef..84dc7a482e8 100644 --- a/src/mame/machine/coco.cpp +++ b/src/mame/machine/coco.cpp @@ -243,9 +243,9 @@ void coco_state::device_timer(emu_timer &timer, device_timer_id id, int param, v // CoCo 1/2 you should get $F627 instead. //------------------------------------------------- -UINT8 coco_state::floating_bus_read(void) +uint8_t coco_state::floating_bus_read(void) { - UINT8 result; + uint8_t result; // this method calls program.read_byte() - therefore we run the risk of a stack overflow if we don't check for // a reentrant invocation @@ -264,11 +264,11 @@ UINT8 coco_state::floating_bus_read(void) address_space &program = m_maincpu->space(AS_PROGRAM); // get the previous and current PC - UINT16 prev_pc = m_maincpu->pcbase(); - UINT16 pc = m_maincpu->pc(); + uint16_t prev_pc = m_maincpu->pcbase(); + uint16_t pc = m_maincpu->pc(); // get the byte; and skip over header bytes - UINT8 byte = program.read_byte(prev_pc); + uint8_t byte = program.read_byte(prev_pc); if ((byte == 0x10) || (byte == 0x11)) byte = program.read_byte(++prev_pc); @@ -459,7 +459,7 @@ READ8_MEMBER( coco_state::pia1_pb_r ) { // Port B: lines in output mode are handled automatically by the PIA object. // We only need to specify the input lines here - UINT32 ram_size = m_ram->size(); + uint32_t ram_size = m_ram->size(); // For the CoCo 1, the logic has been changed to only select 64K rams // if there is more than 16K of memory, as the Color Basic 1.0 rom @@ -663,7 +663,7 @@ void coco_state::update_sound(void) * * Source: Page 31 of the Tandy Color Computer Serice Manual */ - UINT8 single_bit_sound = (m_pia_1->b_output() & 0x02) ? 0x80 : 0x00; + uint8_t single_bit_sound = (m_pia_1->b_output() & 0x02) ? 0x80 : 0x00; /* determine the sound mux status */ soundmux_status_t status = soundmux_status(); @@ -671,12 +671,12 @@ void coco_state::update_sound(void) /* the SC77526 DAC chip internally biases the AC-coupled sound inputs for Cassette and Cartridge at the midpoint of the 3.9v output range */ bool bCassSoundEnable = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL1)); bool bCartSoundEnable = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL2)); - UINT8 cassette_sound = (bCassSoundEnable ? 0x40 : 0); - UINT8 cart_sound = (bCartSoundEnable ? 0x40 : 0); + uint8_t cassette_sound = (bCassSoundEnable ? 0x40 : 0); + uint8_t cart_sound = (bCartSoundEnable ? 0x40 : 0); /* determine the value to send to the DAC (this is used by the Joystick read as well as audio out) */ m_dac_output = (m_pia_1->a_output() & 0xFC) >> 2; - UINT8 dac_sound = (status == SOUNDMUX_ENABLE ? m_dac_output << 1 : 0); + uint8_t dac_sound = (status == SOUNDMUX_ENABLE ? m_dac_output << 1 : 0); /* The CoCo uses a single DAC for both audio output and joystick axis position measurement. * To avoid introducing artifacts while reading the axis positions, some software will disable @@ -768,7 +768,7 @@ bool coco_state::is_joystick_hires(int joystick_index) // poll_joystick //------------------------------------------------- -void coco_state::poll_joystick(bool *joyin, UINT8 *buttons) +void coco_state::poll_joystick(bool *joyin, uint8_t *buttons) { static const analog_input_t s_empty = {}; static const int joy_rat_table[] = {15, 24, 42, 33 }; @@ -781,7 +781,7 @@ void coco_state::poll_joystick(bool *joyin, UINT8 *buttons) /* determine the JOYIN value */ const analog_input_t *analog; bool joyin_value; - UINT8 joyval; + uint8_t joyval; int dclg_vpos; switch(joystick_type(joystick)) { @@ -850,11 +850,11 @@ void coco_state::poll_joystick(bool *joyin, UINT8 *buttons) void coco_state::poll_keyboard(void) { - UINT8 pia0_pb = m_pia_0->b_output(); - UINT8 pia0_pb_z = m_pia_0->port_b_z_mask(); + uint8_t pia0_pb = m_pia_0->b_output(); + uint8_t pia0_pb_z = m_pia_0->port_b_z_mask(); - UINT8 pia0_pa = 0x7F; - UINT8 pia0_pa_z = 0x7F; + uint8_t pia0_pa = 0x7F; + uint8_t pia0_pa_z = 0x7F; /* poll the keyboard, and update PA6-PA0 accordingly*/ for (unsigned i = 0; i < m_keyboard.size(); i++) @@ -875,7 +875,7 @@ void coco_state::poll_keyboard(void) /* poll the joystick (*/ bool joyin; - UINT8 buttons; + uint8_t buttons; poll_joystick(&joyin, &buttons); /* PA7 comes from JOYIN */ @@ -896,7 +896,7 @@ void coco_state::poll_keyboard(void) // on the CoCo 3 controls a GIME input //------------------------------------------------- -void coco_state::update_keyboard_input(UINT8 value, UINT8 z) +void coco_state::update_keyboard_input(uint8_t value, uint8_t z) { m_pia_0->set_a_input(value, z); } @@ -983,7 +983,7 @@ void coco_state::update_prinout(bool prinout) // pia1_pa_changed - called when PIA1 PA changes //------------------------------------------------- -void coco_state::pia1_pa_changed(UINT8 data) +void coco_state::pia1_pa_changed(uint8_t data) { update_sound(); // DAC is connected to PIA1 PA2-PA7 poll_keyboard(); @@ -997,7 +997,7 @@ void coco_state::pia1_pa_changed(UINT8 data) // pia1_pb_changed - called when PIA1 PB changes //------------------------------------------------- -void coco_state::pia1_pb_changed(UINT8 data) +void coco_state::pia1_pb_changed(uint8_t data) { update_sound(); // singe_bit_sound is connected to PIA1 PB1 } @@ -1080,7 +1080,7 @@ void coco_state::poll_hires_joystick(void) double value = m_joystick.input(joystick_index, axis) / 255.0; value *= is_cocomax3 ? 2500.0 : 4160.0; value += is_cocomax3 ? 400.0 : 592.0; - attotime duration = m_maincpu->clocks_to_attotime((UINT64) value) * 8; + attotime duration = m_maincpu->clocks_to_attotime((uint64_t) value) * 8; m_hiresjoy_transition_timer[axis]->adjust(duration); } else if (!m_hiresjoy_ca && newvalue) @@ -1120,7 +1120,7 @@ coco_vhd_image_device *coco_state::current_vhd(void) READ8_MEMBER( coco_state::ff60_read ) { - UINT8 result; + uint8_t result; if ((current_vhd() != nullptr) && (offset >= 32) && (offset <= 37)) { @@ -1354,7 +1354,7 @@ static const char *const os9syscalls[] = }; -offs_t coco_state::dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) +offs_t coco_state::dasm_override(device_t &device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options) { unsigned call; unsigned result = 0; diff --git a/src/mame/machine/coco12.cpp b/src/mame/machine/coco12.cpp index e2f3fbdb521..ac98b91468e 100644 --- a/src/mame/machine/coco12.cpp +++ b/src/mame/machine/coco12.cpp @@ -29,10 +29,10 @@ void coco12_state::device_start() void coco12_state::configure_sam() { cococart_slot_device *cart = m_cococart; - UINT8 *ram = m_ram->pointer(); - UINT32 ram_size = m_ram->size(); - UINT8 *rom = memregion(MAINCPU_TAG)->base(); - UINT8 *cart_rom = cart->get_cart_base(); + uint8_t *ram = m_ram->pointer(); + uint32_t ram_size = m_ram->size(); + uint8_t *rom = memregion(MAINCPU_TAG)->base(); + uint8_t *cart_rom = cart->get_cart_base(); m_sam->configure_bank(0, ram, ram_size, false); // $0000-$7FFF m_sam->configure_bank(1, &rom[0x0000], 0x2000, true); // $8000-$9FFF @@ -82,7 +82,7 @@ WRITE_LINE_MEMBER( coco12_state::field_sync ) READ8_MEMBER( coco12_state::sam_read ) { - UINT8 data = m_ram->read(offset); + uint8_t data = m_ram->read(offset); m_vdg->as_w(data & 0x80 ? ASSERT_LINE : CLEAR_LINE); m_vdg->inv_w(data & 0x40 ? ASSERT_LINE : CLEAR_LINE); return data; @@ -94,7 +94,7 @@ READ8_MEMBER( coco12_state::sam_read ) // pia1_pb_changed //------------------------------------------------- -void coco12_state::pia1_pb_changed(UINT8 data) +void coco12_state::pia1_pb_changed(uint8_t data) { /* call inherited function */ coco_state::pia1_pb_changed(data); @@ -113,7 +113,7 @@ void coco12_state::pia1_pb_changed(UINT8 data) // update_cart_base //------------------------------------------------- -void coco12_state::update_cart_base(UINT8 *cart_base) +void coco12_state::update_cart_base(uint8_t *cart_base) { m_sam->configure_bank(3, cart_base, 0x4000, true); // $C000-$FEFF } diff --git a/src/mame/machine/coco3.cpp b/src/mame/machine/coco3.cpp index 40624853dec..dab68c0761e 100644 --- a/src/mame/machine/coco3.cpp +++ b/src/mame/machine/coco3.cpp @@ -65,7 +65,7 @@ WRITE8_MEMBER( coco3_state::ff20_write ) READ8_MEMBER( coco3_state::ff40_read ) { - UINT8 result = 0x00; + uint8_t result = 0x00; if (m_gime->spare_chip_select_enabled()) result = coco_state::ff40_read(space, offset, mem_mask); return result; @@ -111,7 +111,7 @@ bool coco3_state::irq_get_line(void) // update_keyboard_input //------------------------------------------------- -void coco3_state::update_keyboard_input(UINT8 value, UINT8 z) +void coco3_state::update_keyboard_input(uint8_t value, uint8_t z) { coco_state::update_keyboard_input(value, z); m_gime->set_il1(value == 0xFF); @@ -135,7 +135,7 @@ void coco3_state::cart_w(bool state) // update_cart_base //------------------------------------------------- -void coco3_state::update_cart_base(UINT8 *cart_base) +void coco3_state::update_cart_base(uint8_t *cart_base) { m_gime->update_cart_rom(); } @@ -146,7 +146,7 @@ void coco3_state::update_cart_base(UINT8 *cart_base) // screen_update //------------------------------------------------- -UINT32 coco3_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t coco3_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bool result; if (!strcmp(screen.tag(), ":" COMPOSITE_SCREEN_TAG)) diff --git a/src/mame/machine/coco_vhd.cpp b/src/mame/machine/coco_vhd.cpp index 1a0c7e680da..1fd772418d9 100644 --- a/src/mame/machine/coco_vhd.cpp +++ b/src/mame/machine/coco_vhd.cpp @@ -71,7 +71,7 @@ const device_type COCO_VHD = &device_creator; // coco_vhd_image_device - constructor //------------------------------------------------- -coco_vhd_image_device::coco_vhd_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +coco_vhd_image_device::coco_vhd_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COCO_VHD, "Virtual Hard Disk", tag, owner, clock, "coco_vhd_image", __FILE__), device_image_interface(mconfig, *this) { @@ -130,13 +130,13 @@ image_init_result coco_vhd_image_device::call_load() // coco_vhd_readwrite //------------------------------------------------- -void coco_vhd_image_device::coco_vhd_readwrite(UINT8 data) +void coco_vhd_image_device::coco_vhd_readwrite(uint8_t data) { int result, i; - UINT32 bytes_to_read; - UINT32 bytes_to_write; - UINT64 seek_position; - UINT64 total_size; + uint32_t bytes_to_read; + uint32_t bytes_to_write; + uint64_t seek_position; + uint64_t total_size; char buffer[1024]; /* access the image */ @@ -147,7 +147,7 @@ void coco_vhd_image_device::coco_vhd_readwrite(UINT8 data) } /* perform the seek */ - seek_position = ((UINT64) 256) * m_logical_record_number; + seek_position = ((uint64_t) 256) * m_logical_record_number; total_size = length(); result = fseek(std::min(seek_position, total_size), SEEK_SET); if (result < 0) @@ -163,7 +163,7 @@ void coco_vhd_image_device::coco_vhd_readwrite(UINT8 data) { memset(buffer, 0, sizeof(buffer)); - bytes_to_write = (UINT32)std::min(seek_position - total_size, (UINT64) sizeof(buffer)); + bytes_to_write = (uint32_t)std::min(seek_position - total_size, (uint64_t) sizeof(buffer)); result = fwrite(buffer, bytes_to_write); if (result != bytes_to_write) { @@ -181,7 +181,7 @@ void coco_vhd_image_device::coco_vhd_readwrite(UINT8 data) memset(buffer, 0, 256); if (total_size > seek_position) { - bytes_to_read = (UINT32)std::min((UINT64) 256, total_size - seek_position); + bytes_to_read = (uint32_t)std::min((uint64_t) 256, total_size - seek_position); result = fread(buffer, bytes_to_read); if (result != bytes_to_read) { @@ -225,9 +225,9 @@ void coco_vhd_image_device::coco_vhd_readwrite(UINT8 data) -UINT8 coco_vhd_image_device::read(offs_t offset) +uint8_t coco_vhd_image_device::read(offs_t offset) { - UINT8 result = 0; + uint8_t result = 0; switch(offset) { @@ -242,7 +242,7 @@ UINT8 coco_vhd_image_device::read(offs_t offset) -void coco_vhd_image_device::write(offs_t offset, UINT8 data) +void coco_vhd_image_device::write(offs_t offset, uint8_t data) { int pos; diff --git a/src/mame/machine/coco_vhd.h b/src/mame/machine/coco_vhd.h index 02c6ef1574e..87f9fa57147 100644 --- a/src/mame/machine/coco_vhd.h +++ b/src/mame/machine/coco_vhd.h @@ -23,7 +23,7 @@ class coco_vhd_image_device : public device_t, { public: // construction/destruction - coco_vhd_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + coco_vhd_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~coco_vhd_image_device(); // image-level overrides @@ -41,22 +41,22 @@ public: // specific implementation DECLARE_READ8_MEMBER(read) { return read(offset); } DECLARE_WRITE8_MEMBER(write) { write(offset, data); } - UINT8 read(offs_t offset); - void write(offs_t offset, UINT8 data); + uint8_t read(offs_t offset); + void write(offs_t offset, uint8_t data); protected: // device-level overrides virtual void device_config_complete() override; virtual void device_start() override; - void coco_vhd_readwrite(UINT8 data); + void coco_vhd_readwrite(uint8_t data); private: cpu_device * m_cpu; address_space * m_cpu_space; - UINT32 m_logical_record_number; - UINT32 m_buffer_address; - UINT8 m_status; + uint32_t m_logical_record_number; + uint32_t m_buffer_address; + uint8_t m_status; }; // device type definition diff --git a/src/mame/machine/compiskb.cpp b/src/mame/machine/compiskb.cpp index a83dc9fd6b8..12262b17159 100644 --- a/src/mame/machine/compiskb.cpp +++ b/src/mame/machine/compiskb.cpp @@ -235,7 +235,7 @@ ioport_constructor compis_keyboard_device::device_input_ports() const // compis_keyboard_device - constructor //------------------------------------------------- -compis_keyboard_device::compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +compis_keyboard_device::compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMPIS_KEYBOARD, "Compis Keyboard", tag, owner, clock, "compiskb", __FILE__), m_maincpu(*this, I8748_TAG), m_speaker(*this, SPEAKER_TAG), @@ -324,7 +324,7 @@ WRITE8_MEMBER( compis_keyboard_device::bus_w ) READ8_MEMBER( compis_keyboard_device::p1_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_keylatch) { @@ -349,7 +349,7 @@ READ8_MEMBER( compis_keyboard_device::p1_r ) READ8_MEMBER( compis_keyboard_device::p2_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_keylatch) { diff --git a/src/mame/machine/compiskb.h b/src/mame/machine/compiskb.h index 0dd79a6f453..4585e39241a 100644 --- a/src/mame/machine/compiskb.h +++ b/src/mame/machine/compiskb.h @@ -37,7 +37,7 @@ class compis_keyboard_device : public device_t { public: // construction/destruction - compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_tx_handler(device_t &device, _Object object) { return downcast(device).m_out_tx_handler.set_callback(object); } @@ -69,8 +69,8 @@ private: required_ioport m_special; devcb_write_line m_out_tx_handler; - UINT8 m_bus; - UINT8 m_keylatch; + uint8_t m_bus; + uint8_t m_keylatch; }; diff --git a/src/mame/machine/concept.cpp b/src/mame/machine/concept.cpp index 7beeb8fe1d7..1192bd7bd62 100644 --- a/src/mame/machine/concept.cpp +++ b/src/mame/machine/concept.cpp @@ -61,12 +61,12 @@ void concept_state::video_start() { } -UINT32 concept_state::screen_update_concept(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t concept_state::screen_update_concept(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* resolution is 720*560 */ - UINT16 *videoram = m_videoram; + uint16_t *videoram = m_videoram; int x, y; - UINT16 *line; + uint16_t *line; for (y = 0; y < 560; y++) { @@ -138,7 +138,7 @@ WRITE8_MEMBER(concept_state::via_out_a) */ READ8_MEMBER(concept_state::via_in_b) { - UINT8 status; + uint8_t status; status = ((ioport("DSW0")->read() & 0x80) >> 1) | ((ioport("DSW0")->read() & 0x40) << 1); LOG(("via_in_b: VIA port B (DIP switches, Video, Comm Rate) - status: 0x%2.2x\n", status)); diff --git a/src/mame/machine/cps2crypt.cpp b/src/mame/machine/cps2crypt.cpp index 0171570fbd9..efdff933a9f 100644 --- a/src/mame/machine/cps2crypt.cpp +++ b/src/mame/machine/cps2crypt.cpp @@ -134,7 +134,7 @@ static const int fn2_groupB[8] = { 3, 5, 9, 10, 8, 15, 12, 11 }; struct sbox { - const UINT8 table[64]; + const uint8_t table[64]; const int inputs[6]; // positions of the inputs bits, -1 means no input except from key const int outputs[2]; // positions of the output bits }; @@ -144,8 +144,8 @@ struct sbox // following one struct optimised_sbox { - UINT8 input_lookup[256]; - UINT8 output[64]; + uint8_t input_lookup[256]; + uint8_t output[64]; }; @@ -442,7 +442,7 @@ static const struct sbox fn2_r4_boxes[4] = /******************************************************************************/ -static UINT8 fn(UINT8 in, const struct optimised_sbox *sboxes, UINT32 key) +static uint8_t fn(uint8_t in, const struct optimised_sbox *sboxes, uint32_t key) { const struct optimised_sbox *sbox1 = &sboxes[0]; const struct optimised_sbox *sbox2 = &sboxes[1]; @@ -460,7 +460,7 @@ static UINT8 fn(UINT8 in, const struct optimised_sbox *sboxes, UINT32 key) // srckey is the 64-bit master key (2x32 bits) // dstkey will contain the 96-bit key for the 1st FN (4x24 bits) -static void expand_1st_key(UINT32 *dstkey, const UINT32 *srckey) +static void expand_1st_key(uint32_t *dstkey, const uint32_t *srckey) { static const int bits[96] = { @@ -495,7 +495,7 @@ static void expand_1st_key(UINT32 *dstkey, const UINT32 *srckey) // srckey is the 64-bit master key (2x32 bits) XORed with the subkey // dstkey will contain the 96-bit key for the 2nd FN (4x24 bits) -static void expand_2nd_key(UINT32 *dstkey, const UINT32 *srckey) +static void expand_2nd_key(uint32_t *dstkey, const uint32_t *srckey) { static const int bits[96] = { @@ -532,7 +532,7 @@ static void expand_2nd_key(UINT32 *dstkey, const UINT32 *srckey) // seed is the 16-bit seed generated by the first FN // subkey will contain the 64-bit key to be XORed with the master key // for the 2nd FN (2x32 bits) -static void expand_subkey(UINT32* subkey, UINT16 seed) +static void expand_subkey(uint32_t* subkey, uint16_t seed) { // Note that each row of the table is a permutation of the seed bits. static const int bits[64] = @@ -553,12 +553,12 @@ static void expand_subkey(UINT32* subkey, UINT16 seed) -static UINT16 feistel(UINT16 val, const int *bitsA, const int *bitsB, +static uint16_t feistel(uint16_t val, const int *bitsA, const int *bitsB, const struct optimised_sbox* boxes1, const struct optimised_sbox* boxes2, const struct optimised_sbox* boxes3, const struct optimised_sbox* boxes4, - UINT32 key1, UINT32 key2, UINT32 key3, UINT32 key4) + uint32_t key1, uint32_t key2, uint32_t key3, uint32_t key4) { - UINT8 l = BITSWAP8(val, bitsB[7],bitsB[6],bitsB[5],bitsB[4],bitsB[3],bitsB[2],bitsB[1],bitsB[0]); - UINT8 r = BITSWAP8(val, bitsA[7],bitsA[6],bitsA[5],bitsA[4],bitsA[3],bitsA[2],bitsA[1],bitsA[0]); + uint8_t l = BITSWAP8(val, bitsB[7],bitsB[6],bitsB[5],bitsB[4],bitsB[3],bitsB[2],bitsB[1],bitsB[0]); + uint8_t r = BITSWAP8(val, bitsA[7],bitsA[6],bitsA[5],bitsA[4],bitsA[3],bitsA[2],bitsA[1],bitsA[0]); l ^= fn(r, boxes1, key1); r ^= fn(l, boxes2, key2); @@ -586,7 +586,7 @@ static UINT16 feistel(UINT16 val, const int *bitsA, const int *bitsB, -static int extract_inputs(UINT32 val, const int *inputs) +static int extract_inputs(uint32_t val, const int *inputs) { int i; int res = 0; @@ -632,10 +632,10 @@ static void optimise_sboxes(struct optimised_sbox* out, const struct sbox* in) -static void cps2_decrypt(running_machine &machine, UINT16 *rom, UINT16 *dec, int length, const UINT32 *master_key, UINT32 lower_limit, UINT32 upper_limit) +static void cps2_decrypt(running_machine &machine, uint16_t *rom, uint16_t *dec, int length, const uint32_t *master_key, uint32_t lower_limit, uint32_t upper_limit) { int i; - UINT32 key1[4]; + uint32_t key1[4]; struct optimised_sbox sboxes1[4*4]; struct optimised_sbox sboxes2[4*4]; @@ -664,9 +664,9 @@ static void cps2_decrypt(running_machine &machine, UINT16 *rom, UINT16 *dec, int for (i = 0; i < 0x10000; ++i) { int a; - UINT16 seed; - UINT32 subkey[2]; - UINT32 key2[4]; + uint16_t seed; + uint32_t subkey[2]; + uint32_t key2[4]; if ((i & 0xff) == 0) { @@ -732,8 +732,8 @@ static void cps2_decrypt(running_machine &machine, UINT16 *rom, UINT16 *dec, int struct game_keys { const char *name; /* game driver name */ - const UINT32 keys[2]; - UINT32 upper_limit; + const uint32_t keys[2]; + uint32_t upper_limit; }; @@ -745,9 +745,9 @@ DRIVER_INIT_MEMBER(cps_state,cps2crypt) { if (m_region_key) { - UINT32 key[2]; - UINT32 lower; - UINT32 upper; + uint32_t key[2]; + uint32_t lower; + uint32_t upper; int b; @@ -787,6 +787,6 @@ DRIVER_INIT_MEMBER(cps_state,cps2crypt) logerror("cps2 decrypt 0x%08x,0x%08x,0x%08x,0x%08x\n", key[0], key[1], lower, upper); // we have a proper key so use it to decrypt - cps2_decrypt(machine(), (UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, memregion("maincpu")->bytes(), key, lower / 2, upper / 2); + cps2_decrypt(machine(), (uint16_t *)memregion("maincpu")->base(), m_decrypted_opcodes, memregion("maincpu")->bytes(), key, lower / 2, upper / 2); } } diff --git a/src/mame/machine/cuda.cpp b/src/mame/machine/cuda.cpp index b42b8ee11f3..c578e6a3181 100644 --- a/src/mame/machine/cuda.cpp +++ b/src/mame/machine/cuda.cpp @@ -108,7 +108,7 @@ const tiny_rom_entry *cuda_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -void cuda_device::send_port(address_space &space, UINT8 offset, UINT8 data) +void cuda_device::send_port(address_space &space, uint8_t offset, uint8_t data) { // printf("PORT %c write %02x (DDR = %02x) (PC=%x)\n", 'A' + offset, data, ddrs[offset], m_maincpu->pc()); @@ -211,7 +211,7 @@ WRITE8_MEMBER( cuda_device::ddr_w ) READ8_MEMBER( cuda_device::ports_r ) { - UINT8 incoming = 0; + uint8_t incoming = 0; switch (offset) { @@ -382,7 +382,7 @@ WRITE8_MEMBER( cuda_device::pram_w ) // cuda_device - constructor //------------------------------------------------- -cuda_device::cuda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cuda_device::cuda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CUDA, "Apple Cuda", tag, owner, clock, "cuda", __FILE__), device_nvram_interface(mconfig, *this), write_reset(*this), @@ -440,7 +440,7 @@ void cuda_device::device_start() save_item(NAME(pram)); save_item(NAME(disk_pram)); - UINT8 *rom = device().machine().root_device().memregion(device().subtag(CUDA_CPU_TAG).c_str())->base(); + uint8_t *rom = device().machine().root_device().memregion(device().subtag(CUDA_CPU_TAG).c_str())->base(); if (rom) { diff --git a/src/mame/machine/cuda.h b/src/mame/machine/cuda.h index a236acffc94..9d6786e9803 100644 --- a/src/mame/machine/cuda.h +++ b/src/mame/machine/cuda.h @@ -60,7 +60,7 @@ class cuda_device : public device_t, public device_nvram_interface { public: // construction/destruction - cuda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cuda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_type(device_t &device, int type); @@ -86,12 +86,12 @@ public: DECLARE_WRITE8_MEMBER( pram_w ); // VIA interface routines - UINT8 get_treq() { return treq; } - void set_tip(UINT8 val) { tip = val; } - void set_byteack(UINT8 val) { byteack = val; } - UINT8 get_via_data() { return via_data; } - void set_via_data(UINT8 dat) { via_data = dat; } - UINT8 get_via_clock() { return via_clock; } + uint8_t get_treq() { return treq; } + void set_tip(uint8_t val) { tip = val; } + void set_byteack(uint8_t val) { byteack = val; } + uint8_t get_via_data() { return via_data; } + void set_via_data(uint8_t dat) { via_data = dat; } + uint8_t get_via_clock() { return via_clock; } void set_adb_line(int linestate) { adb_in = (linestate == ASSERT_LINE) ? true : false; } int get_adb_dtime() { return m_adb_dtime; } @@ -116,23 +116,23 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 ddrs[3]; - UINT8 ports[3]; - UINT8 pll_ctrl; - UINT8 timer_ctrl; - UINT8 timer_counter, ripple_counter; - UINT8 onesec; - UINT8 treq, byteack, tip, via_data, via_clock, last_adb; - UINT64 last_adb_time; + uint8_t ddrs[3]; + uint8_t ports[3]; + uint8_t pll_ctrl; + uint8_t timer_ctrl; + uint8_t timer_counter, ripple_counter; + uint8_t onesec; + uint8_t treq, byteack, tip, via_data, via_clock, last_adb; + uint64_t last_adb_time; bool cuda_controls_power; bool adb_in; int reset_line; int m_adb_dtime; emu_timer *m_timer, *m_prog_timer; - UINT8 pram[0x100], disk_pram[0x100]; + uint8_t pram[0x100], disk_pram[0x100]; bool pram_loaded; - void send_port(address_space &space, UINT8 offset, UINT8 data); + void send_port(address_space &space, uint8_t offset, uint8_t data); }; // device type definition diff --git a/src/mame/machine/cx4data.hxx b/src/mame/machine/cx4data.hxx index b7d1610a304..a76343eb896 100644 --- a/src/mame/machine/cx4data.hxx +++ b/src/mame/machine/cx4data.hxx @@ -10,7 +10,7 @@ ***************************************************************************/ -static const UINT8 CX4_immediate_data[48] = +static const uint8_t CX4_immediate_data[48] = { 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x80, 0xff, 0xff, 0x7f, @@ -18,7 +18,7 @@ static const UINT8 CX4_immediate_data[48] = 0x00, 0x00, 0x01, 0xff, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0xfe, 0x00 }; -static const UINT16 CX4_wave_data[40] = +static const uint16_t CX4_wave_data[40] = { 0x0000, 0x0002, 0x0004, 0x0006, 0x0008, 0x000a, 0x000c, 0x000e, 0x0200, 0x0202, 0x0204, 0x0206, 0x0208, 0x020a, 0x020c, 0x020e, @@ -27,7 +27,7 @@ static const UINT16 CX4_wave_data[40] = 0x0800, 0x0802, 0x0804, 0x0806, 0x0808, 0x080a, 0x080c, 0x080e }; -static const UINT32 CX4_sin_table[256] = +static const uint32_t CX4_sin_table[256] = { 0x000000, 0x000324, 0x000648, 0x00096c, 0x000c8f, 0x000fb2, 0x0012d5, 0x0015f6, 0x001917, 0x001c37, 0x001f56, 0x002273, 0x002590, 0x0028aa, 0x002bc4, 0x002edb, @@ -63,7 +63,7 @@ static const UINT32 CX4_sin_table[256] = 0xff013b, 0xff00f1, 0xff00b1, 0xff007b, 0xff004e, 0xff002c, 0xff0013, 0xff0004 }; -static const INT16 CX4_SinTable[512] = +static const int16_t CX4_SinTable[512] = { 0, 402, 804, 1206, 1607, 2009, 2410, 2811, 3211, 3611, 4011, 4409, 4808, 5205, 5602, 5997, @@ -131,7 +131,7 @@ static const INT16 CX4_SinTable[512] = -3211, -2811, -2410, -2009, -1607, -1206, -804, -402 }; -static const INT16 CX4_CosTable[512] = +static const int16_t CX4_CosTable[512] = { 32767, 32765, 32758, 32745, 32728, 32706, 32679, 32647, 32610, 32568, 32521, 32469, 32413, 32351, 32285, 32214, diff --git a/src/mame/machine/cx4fn.hxx b/src/mame/machine/cx4fn.hxx index 2b5a302a227..37c1e4b1967 100644 --- a/src/mame/machine/cx4fn.hxx +++ b/src/mame/machine/cx4fn.hxx @@ -11,7 +11,7 @@ ***************************************************************************/ #include -#define CX4_Tan(a) (CX4_CosTable[a] ? ((((INT32)CX4_SinTable[a]) << 16) / CX4_CosTable[a]) : 0x80000000) +#define CX4_Tan(a) (CX4_CosTable[a] ? ((((int32_t)CX4_SinTable[a]) << 16) / CX4_CosTable[a]) : 0x80000000) #define CX4_sar(b, n) ((b) >> (n)) #ifdef PI #undef PI @@ -41,8 +41,8 @@ static void CX4_C4TransfWireFrame(void) cx4.c4y = cx4.c4x2 * sin(cx4.tanval) + cx4.c4y2 * cos(cx4.tanval); //Scale - cx4.C4WFXVal = (INT16)(cx4.c4x * cx4.C4WFScale / (0x90 * (cx4.c4z + 0x95)) * 0x95); - cx4.C4WFYVal = (INT16)(cx4.c4y * cx4.C4WFScale / (0x90 * (cx4.c4z + 0x95)) * 0x95); + cx4.C4WFXVal = (int16_t)(cx4.c4x * cx4.C4WFScale / (0x90 * (cx4.c4z + 0x95)) * 0x95); + cx4.C4WFYVal = (int16_t)(cx4.c4y * cx4.C4WFScale / (0x90 * (cx4.c4z + 0x95)) * 0x95); } static void CX4_C4CalcWireFrame(void) @@ -90,18 +90,18 @@ static void CX4_C4TransfWireFrame2(void) cx4.c4y = cx4.c4x2 * sin(cx4.tanval) + cx4.c4y2 * cos(cx4.tanval); //Scale - cx4.C4WFXVal = (INT16)(cx4.c4x * cx4.C4WFScale / 0x100); - cx4.C4WFYVal = (INT16)(cx4.c4y * cx4.C4WFScale / 0x100); + cx4.C4WFXVal = (int16_t)(cx4.c4x * cx4.C4WFScale / 0x100); + cx4.C4WFYVal = (int16_t)(cx4.c4y * cx4.C4WFScale / 0x100); } static void CX4_C4DrawWireFrame(running_machine &machine) { - UINT32 line = CX4_readl(0x1f80); - UINT32 point1, point2; - INT16 X1, Y1, Z1; - INT16 X2, Y2, Z2; - UINT8 Color; - INT32 i; + uint32_t line = CX4_readl(0x1f80); + uint32_t point1, point2; + int16_t X1, Y1, Z1; + int16_t X2, Y2, Z2; + uint8_t Color; + int32_t i; address_space &space = machine.device("maincpu")->space(AS_PROGRAM); for(i = cx4.ram[0x0295]; i > 0; i--, line += 5) @@ -109,7 +109,7 @@ static void CX4_C4DrawWireFrame(running_machine &machine) if(space.read_byte(line) == 0xff && space.read_byte(line + 1) == 0xff) { - INT32 tmp = line - 5; + int32_t tmp = line - 5; while(space.read_byte(tmp + 2) == 0xff && space.read_byte(tmp + 3) == 0xff && (tmp + 2) >= 0) @@ -147,13 +147,13 @@ static void CX4_C4DrawWireFrame(running_machine &machine) } } -static void CX4_C4DrawLine(INT32 X1, INT32 Y1, INT16 Z1, INT32 X2, INT32 Y2, INT16 Z2, UINT8 Color) +static void CX4_C4DrawLine(int32_t X1, int32_t Y1, int16_t Z1, int32_t X2, int32_t Y2, int16_t Z2, uint8_t Color) { - INT32 i; + int32_t i; //Transform coordinates - cx4.C4WFXVal = (INT16)X1; - cx4.C4WFYVal = (INT16)Y1; + cx4.C4WFXVal = (int16_t)X1; + cx4.C4WFYVal = (int16_t)Y1; cx4.C4WFZVal = Z1; cx4.C4WFScale = CX4_read(0x1f90); cx4.C4WFX2Val = CX4_read(0x1f86); @@ -163,29 +163,29 @@ static void CX4_C4DrawLine(INT32 X1, INT32 Y1, INT16 Z1, INT32 X2, INT32 Y2, INT X1 = (cx4.C4WFXVal + 48) << 8; Y1 = (cx4.C4WFYVal + 48) << 8; - cx4.C4WFXVal = (INT16)X2; - cx4.C4WFYVal = (INT16)Y2; + cx4.C4WFXVal = (int16_t)X2; + cx4.C4WFYVal = (int16_t)Y2; cx4.C4WFZVal = Z2; CX4_C4TransfWireFrame2(); X2 = (cx4.C4WFXVal + 48) << 8; Y2 = (cx4.C4WFYVal + 48) << 8; //Get line info - cx4.C4WFXVal = (INT16)(X1 >> 8); - cx4.C4WFYVal = (INT16)(Y1 >> 8); - cx4.C4WFX2Val = (INT16)(X2 >> 8); - cx4.C4WFY2Val = (INT16)(Y2 >> 8); + cx4.C4WFXVal = (int16_t)(X1 >> 8); + cx4.C4WFYVal = (int16_t)(Y1 >> 8); + cx4.C4WFX2Val = (int16_t)(X2 >> 8); + cx4.C4WFY2Val = (int16_t)(Y2 >> 8); CX4_C4CalcWireFrame(); - X2 = (INT16)cx4.C4WFXVal; - Y2 = (INT16)cx4.C4WFYVal; + X2 = (int16_t)cx4.C4WFXVal; + Y2 = (int16_t)cx4.C4WFYVal; //Render line for(i = cx4.C4WFDist ? cx4.C4WFDist : 1; i > 0; i--) { if(X1 > 0xff && Y1 > 0xff && X1 < 0x6000 && Y1 < 0x6000) { - UINT16 addr = (((Y1 >> 8) >> 3) << 8) - (((Y1 >> 8) >> 3) << 6) + (((X1 >> 8) >> 3) << 4) + ((Y1 >> 8) & 7) * 2; - UINT8 bit = 0x80 >> ((X1 >> 8) & 7); + uint16_t addr = (((Y1 >> 8) >> 3) << 8) - (((Y1 >> 8) >> 3) << 6) + (((X1 >> 8) >> 3) << 4) + ((Y1 >> 8) & 7) * 2; + uint8_t bit = 0x80 >> ((X1 >> 8) & 7); cx4.ram[addr + 0x300] &= ~bit; cx4.ram[addr + 0x301] &= ~bit; if(Color & 1) @@ -204,25 +204,25 @@ static void CX4_C4DrawLine(INT32 X1, INT32 Y1, INT16 Z1, INT32 X2, INT32 Y2, INT static void CX4_C4DoScaleRotate(int row_padding) { - INT16 A, B, C, D; - INT32 x, y; + int16_t A, B, C, D; + int32_t x, y; //Calculate Pixel Resolution - UINT8 w = CX4_read(0x1f89) & ~7; - UINT8 h = CX4_read(0x1f8c) & ~7; + uint8_t w = CX4_read(0x1f89) & ~7; + uint8_t h = CX4_read(0x1f8c) & ~7; - INT32 Cx = (INT16)CX4_readw(0x1f83); - INT32 Cy = (INT16)CX4_readw(0x1f86); + int32_t Cx = (int16_t)CX4_readw(0x1f83); + int32_t Cy = (int16_t)CX4_readw(0x1f86); - INT32 LineX, LineY; - UINT32 X, Y; - UINT8 byte; - INT32 outidx = 0; - UINT8 bit = 0x80; + int32_t LineX, LineY; + uint32_t X, Y; + uint8_t byte; + int32_t outidx = 0; + uint8_t bit = 0x80; //Calculate matrix - INT32 XScale = CX4_readw(0x1f8f); - INT32 YScale = CX4_readw(0x1f92); + int32_t XScale = CX4_readw(0x1f8f); + int32_t YScale = CX4_readw(0x1f92); if(XScale & 0x8000) { @@ -235,38 +235,38 @@ static void CX4_C4DoScaleRotate(int row_padding) if(CX4_readw(0x1f80) == 0) { //no rotation - A = (INT16)XScale; + A = (int16_t)XScale; B = 0; C = 0; - D = (INT16)YScale; + D = (int16_t)YScale; } else if(CX4_readw(0x1f80) == 128) { //90 degree rotation A = 0; - B = (INT16)(-YScale); - C = (INT16)XScale; + B = (int16_t)(-YScale); + C = (int16_t)XScale; D = 0; } else if(CX4_readw(0x1f80) == 256) { //180 degree rotation - A = (INT16)(-XScale); + A = (int16_t)(-XScale); B = 0; C = 0; - D = (INT16)(-YScale); + D = (int16_t)(-YScale); } else if(CX4_readw(0x1f80) == 384) { //270 degree rotation A = 0; - B = (INT16)YScale; - C = (INT16)(-XScale); + B = (int16_t)YScale; + C = (int16_t)(-XScale); D = 0; } else { - A = (INT16) CX4_sar(CX4_CosTable[CX4_readw(0x1f80) & 0x1ff] * XScale, 15); - B = (INT16)(-CX4_sar(CX4_SinTable[CX4_readw(0x1f80) & 0x1ff] * YScale, 15)); - C = (INT16) CX4_sar(CX4_SinTable[CX4_readw(0x1f80) & 0x1ff] * XScale, 15); - D = (INT16) CX4_sar(CX4_CosTable[CX4_readw(0x1f80) & 0x1ff] * YScale, 15); + A = (int16_t) CX4_sar(CX4_CosTable[CX4_readw(0x1f80) & 0x1ff] * XScale, 15); + B = (int16_t)(-CX4_sar(CX4_SinTable[CX4_readw(0x1f80) & 0x1ff] * YScale, 15)); + C = (int16_t) CX4_sar(CX4_SinTable[CX4_readw(0x1f80) & 0x1ff] * XScale, 15); + D = (int16_t) CX4_sar(CX4_CosTable[CX4_readw(0x1f80) & 0x1ff] * YScale, 15); } //Clear the output RAM @@ -292,7 +292,7 @@ static void CX4_C4DoScaleRotate(int row_padding) } else { - UINT32 addr = (Y >> 12) * w + (X >> 12); + uint32_t addr = (Y >> 12) * w + (X >> 12); byte = CX4_read(0x600 + (addr >> 1)); if(addr & 1) { diff --git a/src/mame/machine/cx4oam.hxx b/src/mame/machine/cx4oam.hxx index abf74defea2..f249bdad550 100644 --- a/src/mame/machine/cx4oam.hxx +++ b/src/mame/machine/cx4oam.hxx @@ -13,16 +13,16 @@ //Build OAM static void CX4_op00_00(running_machine &machine) { - INT32 i; + int32_t i; - UINT32 oamptr = cx4.ram[0x626] << 2; - UINT16 globalx, globaly; - UINT32 oamptr2; - INT16 sprx, spry; - UINT8 sprname, sprattr; - UINT8 sprcount; - UINT8 offset; - UINT32 srcptr; + uint32_t oamptr = cx4.ram[0x626] << 2; + uint16_t globalx, globaly; + uint32_t oamptr2; + int16_t sprx, spry; + uint8_t sprname, sprattr; + uint8_t sprcount; + uint8_t offset; + uint32_t srcptr; for(i = 0x1fd; i > oamptr && i >= 0; i -= 4) { @@ -49,7 +49,7 @@ static void CX4_op00_00(running_machine &machine) address_space &space = machine.device("maincpu")->space(AS_PROGRAM); for(i = cx4.ram[0x620]; i > 0 && sprcount > 0; i--, srcptr += 16) { - UINT32 spraddr = CX4_readl(srcptr + 7); + uint32_t spraddr = CX4_readl(srcptr + 7); sprx = CX4_readw(srcptr) - globalx; spry = CX4_readw(srcptr + 2) - globaly; @@ -58,11 +58,11 @@ static void CX4_op00_00(running_machine &machine) if(space.read_byte(spraddr)) { - INT16 x, y; - INT32 sprcnt; + int16_t x, y; + int32_t sprcnt; for(sprcnt = space.read_byte(spraddr++); sprcnt > 0 && sprcount > 0; sprcnt--, spraddr += 4) { - x = (INT8)space.read_byte(spraddr + 1); + x = (int8_t)space.read_byte(spraddr + 1); if(sprattr & 0x40) { x = -x - ((space.read_byte(spraddr) & 0x20) ? 16 : 8); @@ -70,7 +70,7 @@ static void CX4_op00_00(running_machine &machine) x += sprx; if(x >= -16 && x <= 272) { - y = (INT8)space.read_byte(spraddr + 2); + y = (int8_t)space.read_byte(spraddr + 2); if(sprattr & 0x80) { y = -y - ((space.read_byte(spraddr) & 0x20) ? 16 : 8); @@ -78,8 +78,8 @@ static void CX4_op00_00(running_machine &machine) y += spry; if(y >= -16 && y <= 224) { - cx4.ram[oamptr ] = (UINT8)x; - cx4.ram[oamptr + 1] = (UINT8)y; + cx4.ram[oamptr ] = (uint8_t)x; + cx4.ram[oamptr + 1] = (uint8_t)y; cx4.ram[oamptr + 2] = sprname + space.read_byte(spraddr + 3); cx4.ram[oamptr + 3] = sprattr ^ (space.read_byte(spraddr) & 0xc0); cx4.ram[oamptr2] &= ~(3 << offset); @@ -104,8 +104,8 @@ static void CX4_op00_00(running_machine &machine) } else if(sprcount > 0) { - cx4.ram[oamptr ] = (UINT8)sprx; - cx4.ram[oamptr + 1] = (UINT8)spry; + cx4.ram[oamptr ] = (uint8_t)sprx; + cx4.ram[oamptr + 1] = (uint8_t)spry; cx4.ram[oamptr + 2] = sprname; cx4.ram[oamptr + 3] = sprattr; cx4.ram[oamptr2] &= ~(3 << offset); @@ -137,8 +137,8 @@ static void CX4_op00_03(void) //Transform Lines static void CX4_op00_05(running_machine &machine) { - INT32 i; - UINT32 ptr = 0, ptr2 = 0; + int32_t i; + uint32_t ptr = 0, ptr2 = 0; cx4.C4WFX2Val = CX4_read(0x1f83); cx4.C4WFY2Val = CX4_read(0x1f86); @@ -195,21 +195,21 @@ static void CX4_op00_08(running_machine &machine) //Disintegrate static void CX4_op00_0b(running_machine &machine) { - UINT8 width, height; - UINT32 startx, starty; - UINT32 srcptr; - UINT32 x, y; - INT32 scalex, scaley; - INT32 cx, cy; - INT32 i, j; + uint8_t width, height; + uint32_t startx, starty; + uint32_t srcptr; + uint32_t x, y; + int32_t scalex, scaley; + int32_t cx, cy; + int32_t i, j; width = CX4_read(0x1f89); height = CX4_read(0x1f8c); cx = CX4_readw(0x1f80); cy = CX4_readw(0x1f83); - scalex = (INT16)CX4_readw(0x1f86); - scaley = (INT16)CX4_readw(0x1f8f); + scalex = (int16_t)CX4_readw(0x1f86); + scaley = (int16_t)CX4_readw(0x1f8f); startx = -cx * scalex + (cx << 8); starty = -cy * scaley + (cy << 8); srcptr = 0x600; @@ -225,9 +225,9 @@ static void CX4_op00_0b(running_machine &machine) { if((x >> 8) < width && (y >> 8) < height && (y >> 8) * width + (x >> 8) < 0x2000) { - UINT8 pixel = (j & 1) ? (cx4.ram[srcptr] >> 4) : (cx4.ram[srcptr]); - INT32 index = (y >> 11) * width * 4 + (x >> 11) * 32 + ((y >> 8) & 7) * 2; - UINT8 mask = 0x80 >> ((x >> 8) & 7); + uint8_t pixel = (j & 1) ? (cx4.ram[srcptr] >> 4) : (cx4.ram[srcptr]); + int32_t index = (y >> 11) * width * 4 + (x >> 11) * 32 + ((y >> 8) & 7) * 2; + uint8_t mask = 0x80 >> ((x >> 8) & 7); if(pixel & 1) cx4.ram[index ] |= mask; if(pixel & 2) cx4.ram[index + 1] |= mask; @@ -246,19 +246,19 @@ static void CX4_op00_0b(running_machine &machine) static void CX4_op00_0c(running_machine &machine) { int i, j; - UINT32 destptr = 0; - UINT32 waveptr = CX4_read(0x1f83); - UINT16 mask1 = 0xc0c0; - UINT16 mask2 = 0x3f3f; + uint32_t destptr = 0; + uint32_t waveptr = CX4_read(0x1f83); + uint16_t mask1 = 0xc0c0; + uint16_t mask2 = 0x3f3f; for(j = 0; j < 0x10; j++) { do { - INT16 height = -((INT8)CX4_read(waveptr + 0xb00)) - 16; + int16_t height = -((int8_t)CX4_read(waveptr + 0xb00)) - 16; for(i = 0; i < 40; i++) { - UINT16 temp = CX4_readw(destptr + CX4_wave_data[i]) & mask2; + uint16_t temp = CX4_readw(destptr + CX4_wave_data[i]) & mask2; if(height >= 0) { if(height < 8) @@ -281,10 +281,10 @@ static void CX4_op00_0c(running_machine &machine) do { - INT16 height = -((INT8)CX4_read(waveptr + 0xb00)) - 16; + int16_t height = -((int8_t)CX4_read(waveptr + 0xb00)) - 16; for(i = 0; i < 40; i++) { - UINT16 temp = CX4_readw(destptr + CX4_wave_data[i]) & mask2; + uint16_t temp = CX4_readw(destptr + CX4_wave_data[i]) & mask2; if(height >= 0) { if(height < 8) diff --git a/src/mame/machine/cx4ops.hxx b/src/mame/machine/cx4ops.hxx index 02b97bc944d..9496f0a3ecd 100644 --- a/src/mame/machine/cx4ops.hxx +++ b/src/mame/machine/cx4ops.hxx @@ -35,7 +35,7 @@ static void CX4_op01(running_machine& machine) //Propulsion static void CX4_op05(running_machine &machine) { - INT32 temp = 0x10000; + int32_t temp = 0x10000; if(CX4_readw(0x1f83)) { temp = CX4_sar((temp / CX4_readw(0x1f83)) * CX4_readw(0x1f81), 8); @@ -51,8 +51,8 @@ static void CX4_op0d(running_machine &machine) cx4.C41FDistVal = CX4_readw(0x1f86); cx4.tanval = sqrt(((double)cx4.C41FYVal) * ((double)cx4.C41FYVal) + ((double)cx4.C41FXVal) * ((double)cx4.C41FXVal)); cx4.tanval = (double)cx4.C41FDistVal / cx4.tanval; - cx4.C41FYVal = (INT16)(((double)cx4.C41FYVal * cx4.tanval) * 0.99); - cx4.C41FXVal = (INT16)(((double)cx4.C41FXVal * cx4.tanval) * 0.98); + cx4.C41FYVal = (int16_t)(((double)cx4.C41FYVal * cx4.tanval) * 0.99); + cx4.C41FXVal = (int16_t)(((double)cx4.C41FXVal * cx4.tanval) * 0.98); CX4_writew(machine, 0x1f89, cx4.C41FXVal); CX4_writew(machine, 0x1f8c, cx4.C41FYVal); } @@ -116,7 +116,7 @@ static void CX4_op15(running_machine &machine) cx4.C41FXVal = CX4_readw(0x1f80); cx4.C41FYVal = CX4_readw(0x1f83); temp = sqrt((double)cx4.C41FXVal * (double)cx4.C41FXVal + (double)cx4.C41FYVal * (double)cx4.C41FYVal); - cx4.C41FDist = (INT16)temp; + cx4.C41FDist = (int16_t)temp; CX4_writew(machine, 0x1f80, cx4.C41FDist); } @@ -132,7 +132,7 @@ static void CX4_op1f(running_machine &machine) else { cx4.tanval = ((double)cx4.C41FYVal) / ((double)cx4.C41FXVal); - cx4.C41FAngleRes = (INT16)(atan(cx4.tanval) / (PI * 2) * 512); + cx4.C41FAngleRes = (int16_t)(atan(cx4.tanval) / (PI * 2) * 512); cx4.C41FAngleRes = cx4.C41FAngleRes; if(cx4.C41FXVal < 0) { @@ -146,20 +146,20 @@ static void CX4_op1f(running_machine &machine) //Trapezoid static void CX4_op22(void) { - INT16 angle1 = CX4_readw(0x1f8c) & 0x1ff; - INT16 angle2 = CX4_readw(0x1f8f) & 0x1ff; - INT32 tan1 = CX4_Tan(angle1); - INT32 tan2 = CX4_Tan(angle2); - INT16 y = CX4_readw(0x1f83) - CX4_readw(0x1f89); - INT16 left, right; - INT32 j; + int16_t angle1 = CX4_readw(0x1f8c) & 0x1ff; + int16_t angle2 = CX4_readw(0x1f8f) & 0x1ff; + int32_t tan1 = CX4_Tan(angle1); + int32_t tan2 = CX4_Tan(angle2); + int16_t y = CX4_readw(0x1f83) - CX4_readw(0x1f89); + int16_t left, right; + int32_t j; for(j = 0; j < 225; j++, y++) { if(y >= 0) { - left = CX4_sar((INT32)tan1 * y, 16) - CX4_readw(0x1f80) + CX4_readw(0x1f86); - right = CX4_sar((INT32)tan2 * y, 16) - CX4_readw(0x1f80) + CX4_readw(0x1f86) + CX4_readw(0x1f93); + left = CX4_sar((int32_t)tan1 * y, 16) - CX4_readw(0x1f80) + CX4_readw(0x1f86); + right = CX4_sar((int32_t)tan2 * y, 16) - CX4_readw(0x1f80) + CX4_readw(0x1f86) + CX4_readw(0x1f93); if(left < 0 && right < 0) { @@ -194,8 +194,8 @@ static void CX4_op22(void) left = 1; right = 0; } - cx4.ram[j + 0x800] = (UINT8)left; - cx4.ram[j + 0x900] = (UINT8)right; + cx4.ram[j + 0x800] = (uint8_t)left; + cx4.ram[j + 0x900] = (uint8_t)right; } } @@ -227,7 +227,7 @@ static void CX4_op2d(running_machine &machine) //Sum static void CX4_op40(void) { - UINT32 i; + uint32_t i; cx4.r0 = 0; for(i=0;i<0x800;i++) { diff --git a/src/mame/machine/cybiko.cpp b/src/mame/machine/cybiko.cpp index aa0d116b6dd..116d7676cdc 100644 --- a/src/mame/machine/cybiko.cpp +++ b/src/mame/machine/cybiko.cpp @@ -38,7 +38,7 @@ DRIVER_INIT_MEMBER(cybiko_state,cybikoxt) QUICKLOAD_LOAD_MEMBER( cybiko_state, cybiko ) { - image.fread(m_flash1->get_ptr(), std::min(image.length(), UINT64(0x84000))); + image.fread(m_flash1->get_ptr(), std::min(image.length(), uint64_t(0x84000))); return image_init_result::PASS; } @@ -46,9 +46,9 @@ QUICKLOAD_LOAD_MEMBER( cybiko_state, cybiko ) QUICKLOAD_LOAD_MEMBER( cybiko_state, cybikoxt ) { address_space &dest = m_maincpu->space(AS_PROGRAM); - UINT32 size = std::min(image.length(), UINT64(RAMDISK_SIZE)); + uint32_t size = std::min(image.length(), uint64_t(RAMDISK_SIZE)); - std::vector buffer(size); + std::vector buffer(size); image.fread(&buffer[0], size); for (int byte = 0; byte < size; byte++) dest.write_byte(0x400000 + byte, buffer[byte]); @@ -86,7 +86,7 @@ void cybiko_state::machine_reset() READ16_MEMBER( cybiko_state::cybiko_lcd_r ) { - UINT16 data = 0; + uint16_t data = 0; if (ACCESSING_BITS_8_15) data |= (m_crtc->reg_idx_r(space, offset) << 8); if (ACCESSING_BITS_0_7) data |= (m_crtc->reg_dat_r(space, offset) << 0); return data; @@ -100,8 +100,8 @@ WRITE16_MEMBER( cybiko_state::cybiko_lcd_w ) int cybiko_state::cybiko_key_r( offs_t offset, int mem_mask) { - UINT16 data = 0xFFFF; - for (UINT8 i = 0; i < 15; i++) + uint16_t data = 0xFFFF; + for (uint8_t i = 0; i < 15; i++) { if (m_input[i].found() && !BIT(offset, i)) data &= ~m_input[i]->read(); @@ -120,7 +120,7 @@ READ16_MEMBER( cybiko_state::cybikov1_key_r ) READ16_MEMBER( cybiko_state::cybikov2_key_r ) { - UINT16 data = cybiko_key_r(offset, mem_mask); + uint16_t data = cybiko_key_r(offset, mem_mask); if (!BIT(offset, 0)) data |= 0x0002; // or else [esc] does not work in "lost in labyrinth" return data; @@ -134,7 +134,7 @@ READ16_MEMBER( cybiko_state::cybikoxt_key_r ) #if 0 READ16_MEMBER( cybiko_state::cybikov1_io_reg_r ) { - UINT16 data = 0; + uint16_t data = 0; #if 0 _logerror( 2, ("cybikov1_io_reg_r (%08X)\n", offset)); switch (offset) @@ -182,7 +182,7 @@ READ16_MEMBER( cybiko_state::cybikov1_io_reg_r ) READ16_MEMBER( cybiko_state::cybikov2_io_reg_r ) { - UINT16 data = 0; + uint16_t data = 0; #if 0 _logerror( 2, ("cybikov2_io_reg_r (%08X)\n", offset)); switch (offset) @@ -230,7 +230,7 @@ READ16_MEMBER( cybiko_state::cybikov2_io_reg_r ) READ16_MEMBER( cybiko_state::cybikoxt_io_reg_r ) { - UINT16 data = 0; + uint16_t data = 0; #if 0 _logerror( 2, ("cybikoxt_io_reg_r (%08X)\n", offset)); switch (offset) diff --git a/src/mame/machine/dai.cpp b/src/mame/machine/dai.cpp index 9ea8258f805..f785feeed92 100644 --- a/src/mame/machine/dai.cpp +++ b/src/mame/machine/dai.cpp @@ -55,7 +55,7 @@ void dai_state::dai_update_memory(int dai_rom_bank) READ8_MEMBER(dai_state::dai_keyboard_r) { - UINT8 data = 0x00; + uint8_t data = 0x00; static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" }; for (int i = 0; i < 8; i++) @@ -122,7 +122,7 @@ void dai_state::machine_reset() READ8_MEMBER(dai_state::dai_io_discrete_devices_r) { - UINT8 data = 0x00; + uint8_t data = 0x00; switch(offset & 0x000f) { case 0x00: diff --git a/src/mame/machine/dc-ctrl.cpp b/src/mame/machine/dc-ctrl.cpp index f2b5531b64a..36bada88469 100644 --- a/src/mame/machine/dc-ctrl.cpp +++ b/src/mame/machine/dc-ctrl.cpp @@ -29,7 +29,7 @@ void dc_controller_device::static_set_versions(device_t &device, const char *ver ctrl.versions = versions; } -dc_controller_device::dc_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dc_controller_device::dc_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : maple_device(mconfig, DC_CONTROLLER, "Dreamcast Controller", tag, owner, clock, "dcctrl", __FILE__) { memset(port_tag, 0, sizeof(port_tag)); @@ -39,7 +39,7 @@ dc_controller_device::dc_controller_device(const machine_config &mconfig, const versions = "Version 1.010,1998/09/28,315-6211-AB ,Analog Module : The 4th Edition.5/8 +DF"; } -void dc_controller_device::maple_w(const UINT32 *data, UINT32 in_size) +void dc_controller_device::maple_w(const uint32_t *data, uint32_t in_size) { switch(data[0] & 0xff) { case 0x01: // Device request @@ -70,7 +70,7 @@ void dc_controller_device::maple_w(const UINT32 *data, UINT32 in_size) } } -void dc_controller_device::fixed_status(UINT32 *dest) +void dc_controller_device::fixed_status(uint32_t *dest) { dest[0] = 0x20000000; // Controller dest[1] = @@ -85,17 +85,17 @@ void dc_controller_device::fixed_status(UINT32 *dest) dest[2] = 0; // No 2nd function dest[3] = 0; // No 3rd function dest[4] = 0x00ff; // Every region, no expansion - copy_with_spaces(((UINT8 *)dest) + 18, id, 30); - copy_with_spaces(((UINT8 *)dest) + 48, license, 60); + copy_with_spaces(((uint8_t *)dest) + 18, id, 30); + copy_with_spaces(((uint8_t *)dest) + 48, license, 60); dest[27] = 0x01f401ae; // standby 43mA, max 50mA } -void dc_controller_device::free_status(UINT32 *dest) +void dc_controller_device::free_status(uint32_t *dest) { - copy_with_spaces((UINT8 *)dest, versions, 80); + copy_with_spaces((uint8_t *)dest, versions, 80); } -void dc_controller_device::read(UINT32 *dest) +void dc_controller_device::read(uint32_t *dest) { dest[0] = 0x21000000; // Controller dest[1] = diff --git a/src/mame/machine/dc-ctrl.h b/src/mame/machine/dc-ctrl.h index ed408ea7885..afc935c5f75 100644 --- a/src/mame/machine/dc-ctrl.h +++ b/src/mame/machine/dc-ctrl.h @@ -29,23 +29,23 @@ class dc_controller_device : public maple_device { public: // construction/destruction - dc_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dc_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_port_tag(device_t &device, int port, const char *tag); static void static_set_id(device_t &device, const char *id); static void static_set_license(device_t &device, const char *license); static void static_set_versions(device_t &device, const char *versions); - void maple_w(const UINT32 *data, UINT32 in_size) override; + void maple_w(const uint32_t *data, uint32_t in_size) override; protected: // device-level overrides virtual void device_start() override; private: - void fixed_status(UINT32 *dest); - void free_status(UINT32 *dest); - void read(UINT32 *dest); + void fixed_status(uint32_t *dest); + void free_status(uint32_t *dest); + void read(uint32_t *dest); const char *port_tag[8]; const char *id, *license, *versions; diff --git a/src/mame/machine/dc.cpp b/src/mame/machine/dc.cpp index e74d9757967..d35ec8612cb 100644 --- a/src/mame/machine/dc.cpp +++ b/src/mame/machine/dc.cpp @@ -77,7 +77,7 @@ static const char *const sysctrl_names[] = #endif -void dc_state::generic_dma(UINT32 main_adr, void *dma_ptr, UINT32 length, UINT32 size, bool to_mainram) +void dc_state::generic_dma(uint32_t main_adr, void *dma_ptr, uint32_t length, uint32_t size, bool to_mainram) { sh4_ddt_dma ddt; if(to_mainram) @@ -194,7 +194,7 @@ TIMER_CALLBACK_MEMBER(dc_state::ch2_dma_irq) void dc_state::g2_dma_execute(address_space &space, int channel) { - UINT32 src,dst,size; + uint32_t src,dst,size; dst = m_g2_dma[channel].g2_addr; src = m_g2_dma[channel].root_addr; size = 0; @@ -234,7 +234,7 @@ void dc_state::g2_dma_execute(address_space &space, int channel) // register decode helpers // this accepts only 32-bit accesses -int dc_state::decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) +int dc_state::decode_reg32_64(uint32_t offset, uint64_t mem_mask, uint64_t *shift) { int reg = offset * 2; @@ -257,7 +257,7 @@ int dc_state::decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) } // this accepts only 32 and 16 bit accesses -int dc_state::decode_reg3216_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) +int dc_state::decode_reg3216_64(uint32_t offset, uint64_t mem_mask, uint64_t *shift) { int reg = offset * 2; @@ -282,7 +282,7 @@ int dc_state::decode_reg3216_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) int dc_state::dc_compute_interrupt_level() { - UINT32 ln,lx,le; + uint32_t ln,lx,le; ln=dc_sysctrl_regs[SB_ISTNRM] & dc_sysctrl_regs[SB_IML6NRM]; lx=dc_sysctrl_regs[SB_ISTEXT] & dc_sysctrl_regs[SB_IML6EXT]; @@ -367,7 +367,7 @@ void dc_state::dc_update_interrupt_status() READ64_MEMBER(dc_state::dc_sysctrl_r ) { int reg; - UINT64 shift; + uint64_t shift; reg = decode_reg32_64(offset, mem_mask, &shift); @@ -378,19 +378,19 @@ READ64_MEMBER(dc_state::dc_sysctrl_r ) } #endif - return (UINT64)dc_sysctrl_regs[reg] << shift; + return (uint64_t)dc_sysctrl_regs[reg] << shift; } WRITE64_MEMBER(dc_state::dc_sysctrl_w ) { int reg; - UINT64 shift; - UINT32 old,dat; - UINT32 address; + uint64_t shift; + uint32_t old,dat; + uint32_t address; struct sh4_ddt_dma ddtdata; reg = decode_reg32_64(offset, mem_mask, &shift); - dat = (UINT32)(data >> shift); + dat = (uint32_t)(data >> shift); old = dc_sysctrl_regs[reg]; dc_sysctrl_regs[reg] = dat; // 5f6800+off*4=dat switch (reg) @@ -479,7 +479,7 @@ WRITE64_MEMBER(dc_state::dc_sysctrl_w ) READ64_MEMBER(dc_state::dc_gdrom_r ) { - UINT32 off; + uint32_t off; if ((int)~mem_mask & 1) { @@ -500,16 +500,16 @@ READ64_MEMBER(dc_state::dc_gdrom_r ) WRITE64_MEMBER(dc_state::dc_gdrom_w ) { - UINT32 dat,off; + uint32_t dat,off; if ((int)~mem_mask & 1) { - dat=(UINT32)(data >> 32); + dat=(uint32_t)(data >> 32); off=(offset << 1) | 1; } else { - dat=(UINT32)data; + dat=(uint32_t)data; off=offset << 1; } @@ -519,22 +519,22 @@ WRITE64_MEMBER(dc_state::dc_gdrom_w ) READ64_MEMBER(dc_state::dc_g2_ctrl_r ) { int reg; - UINT64 shift; + uint64_t shift; reg = decode_reg32_64(offset, mem_mask, &shift); osd_printf_verbose("G2CTRL: Unmapped read %08x\n", 0x5f7800+reg*4); - return (UINT64)g2bus_regs[reg] << shift; + return (uint64_t)g2bus_regs[reg] << shift; } WRITE64_MEMBER(dc_state::dc_g2_ctrl_w ) { int reg; - UINT64 shift; - UINT32 dat; - UINT8 old; + uint64_t shift; + uint32_t dat; + uint8_t old; reg = decode_reg32_64(offset, mem_mask, &shift); - dat = (UINT32)(data >> shift); + dat = (uint32_t)(data >> shift); g2bus_regs[reg] = dat; // 5f7800+reg*4=dat @@ -584,7 +584,7 @@ WRITE64_MEMBER(dc_state::dc_g2_ctrl_w ) } } -int dc_state::decode_reg_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) +int dc_state::decode_reg_64(uint32_t offset, uint64_t mem_mask, uint64_t *shift) { int reg = offset * 2; @@ -609,7 +609,7 @@ int dc_state::decode_reg_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) READ64_MEMBER(dc_state::dc_modem_r ) { int reg; - UINT64 shift; + uint64_t shift; reg = decode_reg32_64(offset, mem_mask, &shift); @@ -627,11 +627,11 @@ READ64_MEMBER(dc_state::dc_modem_r ) WRITE64_MEMBER(dc_state::dc_modem_w ) { int reg; - UINT64 shift; - UINT32 dat; + uint64_t shift; + uint32_t dat; reg = decode_reg32_64(offset, mem_mask, &shift); - dat = (UINT32)(data >> shift); + dat = (uint32_t)(data >> shift); osd_printf_verbose("%s",string_format("MODEM: [%08x=%x] write %I64x to %x, mask %I64x\n", 0x600000+reg*4, dat, data, offset, mem_mask).c_str()); } @@ -674,7 +674,7 @@ void dc_state::machine_reset() READ32_MEMBER(dc_state::dc_aica_reg_r) { -// osd_printf_verbose("%s",string_format("AICA REG: [%08x] read %I64x, mask %I64x\n", 0x700000+reg*4, (UINT64)offset, mem_mask).c_str()); +// osd_printf_verbose("%s",string_format("AICA REG: [%08x] read %I64x, mask %I64x\n", 0x700000+reg*4, (uint64_t)offset, mem_mask).c_str()); if(offset == 0x2c00/4) return m_armrst; diff --git a/src/mame/machine/dccons.cpp b/src/mame/machine/dccons.cpp index 0a0792c14d6..cc040d07456 100644 --- a/src/mame/machine/dccons.cpp +++ b/src/mame/machine/dccons.cpp @@ -40,7 +40,7 @@ WRITE_LINE_MEMBER(dc_cons_state::ata_interrupt) TIMER_CALLBACK_MEMBER(dc_cons_state::atapi_xfer_end ) { - UINT8 sector_buffer[ 4096 ]; + uint8_t sector_buffer[ 4096 ]; atapi_timer->adjust(attotime::never); diff --git a/src/mame/machine/dec0.cpp b/src/mame/machine/dec0.cpp index cd8d501efda..7a1c48ee654 100644 --- a/src/mame/machine/dec0.cpp +++ b/src/mame/machine/dec0.cpp @@ -346,7 +346,7 @@ WRITE16_MEMBER(dec0_state::robocop_68000_share_w) void dec0_state::h6280_decrypt(const char *cputag) { int i; - UINT8 *RAM = memregion(cputag)->base(); + uint8_t *RAM = memregion(cputag)->base(); /* Read each byte, decrypt it */ for (i = 0x00000; i < 0x10000; i++) @@ -355,7 +355,7 @@ void dec0_state::h6280_decrypt(const char *cputag) DRIVER_INIT_MEMBER(dec0_state,hippodrm) { - UINT8 *RAM = memregion("sub")->base(); + uint8_t *RAM = memregion("sub")->base(); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x180000, 0x18003f, read16_delegate(FUNC(dec0_state::hippodrm_68000_share_r),this), write16_delegate(FUNC(dec0_state::hippodrm_68000_share_w),this)); m_maincpu->space(AS_PROGRAM).install_write_handler(0xffc800, 0xffcfff, write16_delegate(FUNC(dec0_state::sprite_mirror_w),this)); @@ -373,7 +373,7 @@ DRIVER_INIT_MEMBER(dec0_state,hippodrm) DRIVER_INIT_MEMBER(dec0_state,slyspy) { - UINT8 *RAM = memregion("audiocpu")->base(); + uint8_t *RAM = memregion("audiocpu")->base(); h6280_decrypt("audiocpu"); /* Slyspy sound cpu has some protection */ diff --git a/src/mame/machine/dec_lk201.cpp b/src/mame/machine/dec_lk201.cpp index e9fb58aaaf0..3e611d1f4e0 100644 --- a/src/mame/machine/dec_lk201.cpp +++ b/src/mame/machine/dec_lk201.cpp @@ -510,7 +510,7 @@ ioport_constructor lk201_device::device_input_ports() const // lk201_device - constructor //------------------------------------------------- -lk201_device::lk201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lk201_device::lk201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LK201, "DEC LK201 keyboard", tag, owner, clock, "lk201", __FILE__), device_serial_interface(mconfig, *this), m_maincpu(*this, LK201_CPU_TAG), @@ -639,9 +639,9 @@ void lk201_device::update_interrupts() READ8_MEMBER( lk201_device::timer_r ) { - static UINT16 count; + static uint16_t count; - UINT8 ret = m_timer.regs[offset]; + uint8_t ret = m_timer.regs[offset]; switch (offset) { @@ -664,7 +664,7 @@ READ8_MEMBER( lk201_device::timer_r ) WRITE8_MEMBER( lk201_device::timer_w ) { - static UINT16 count; + static uint16_t count; static int save_tsr; m_timer.regs[offset] = data; @@ -695,14 +695,14 @@ WRITE8_MEMBER( lk201_device::ddr_w ) { // printf("%02x to PORT %c DDR (PC=%x)\n", data, 'A' + offset, m_maincpu->pc()); - UINT8 olddata = ddrs[offset]; + uint8_t olddata = ddrs[offset]; ddrs[offset] = data; send_port(space, offset, ports[offset] & olddata); } READ8_MEMBER( lk201_device::ports_r ) { - UINT8 incoming = 0; + uint8_t incoming = 0; // apply data direction registers incoming &= (ddrs[offset] ^ 0xff); @@ -716,17 +716,17 @@ READ8_MEMBER( lk201_device::ports_r ) WRITE8_MEMBER( lk201_device::ports_w ) { - UINT8 olddata = ports[offset]; + uint8_t olddata = ports[offset]; ports[offset] = data; // "port writes are independent of DDRC" send_port(space, offset, olddata & ddrs[offset]); // printf("\nPORT %c write %02x (OLD = %02x) (DDR = %02x) (PC=%x)\n", 'A' + offset, data, olddata, ddrs[offset], m_maincpu->pc()); } -void lk201_device::send_port(address_space &space, UINT8 offset, UINT8 olddata) +void lk201_device::send_port(address_space &space, uint8_t offset, uint8_t olddata) { - UINT8 porta = ports[0] & ddrs[0]; - UINT8 portb = ports[1] & ddrs[1]; - UINT8 portc = ports[2] & ddrs[2]; + uint8_t porta = ports[0] & ddrs[0]; + uint8_t portb = ports[1] & ddrs[1]; + uint8_t portc = ports[2] & ddrs[2]; switch (offset) { @@ -817,7 +817,7 @@ void lk201_device::send_port(address_space &space, UINT8 offset, UINT8 olddata) READ8_MEMBER( lk201_device::sci_r ) { - UINT8 incoming = 0; + uint8_t incoming = 0; switch (offset) { @@ -880,7 +880,7 @@ WRITE8_MEMBER( lk201_device::sci_w ) READ8_MEMBER( lk201_device::spi_r ) { - UINT8 incoming = 0; + uint8_t incoming = 0; switch (offset) { diff --git a/src/mame/machine/dec_lk201.h b/src/mame/machine/dec_lk201.h index 87b61ad3af6..5db6a35219a 100644 --- a/src/mame/machine/dec_lk201.h +++ b/src/mame/machine/dec_lk201.h @@ -48,7 +48,7 @@ class lk201_device : public device_t, public device_serial_interface { public: // construction/destruction - lk201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lk201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(ddr_r); DECLARE_WRITE8_MEMBER(ddr_w); @@ -78,36 +78,36 @@ protected: virtual void tra_callback() override; // Tx send bit private: - UINT8 ddrs[3]; - UINT8 ports[3]; - UINT8 led_data; - UINT8 kbd_data; + uint8_t ddrs[3]; + uint8_t ports[3]; + uint8_t led_data; + uint8_t kbd_data; union { struct { - UINT8 tcr; - UINT8 tsr; - UINT8 icrh; - UINT8 icrl; - UINT8 ocrh; - UINT8 ocrl; - UINT8 crh; - UINT8 crl; - UINT8 acrh; - UINT8 acrl; + uint8_t tcr; + uint8_t tsr; + uint8_t icrh; + uint8_t icrl; + uint8_t ocrh; + uint8_t ocrl; + uint8_t crh; + uint8_t crl; + uint8_t acrh; + uint8_t acrl; }; - UINT8 regs[10]; + uint8_t regs[10]; } m_timer; emu_timer *m_count; emu_timer *m_beeper; - UINT8 sci_ctl2; - UINT8 sci_status; - //UINT8 sci_data; + uint8_t sci_ctl2; + uint8_t sci_status; + //uint8_t sci_data; - UINT8 spi_status; - UINT8 spi_data; + uint8_t spi_status; + uint8_t spi_data; required_device m_maincpu; required_device m_speaker; @@ -131,7 +131,7 @@ private: required_ioport m_kbd16; required_ioport m_kbd17; - void send_port(address_space &space, UINT8 offset, UINT8 data); + void send_port(address_space &space, uint8_t offset, uint8_t data); void update_interrupts(); int m_kbd_state; diff --git a/src/mame/machine/deco102.cpp b/src/mame/machine/deco102.cpp index bc6e7d9cabf..210ee3f6afa 100644 --- a/src/mame/machine/deco102.cpp +++ b/src/mame/machine/deco102.cpp @@ -13,13 +13,13 @@ #include "cpu/m68000/m68000.h" #include "machine/deco102.h" -static UINT16 decrypt(UINT16 data, int address, int select_xor) +static uint16_t decrypt(uint16_t data, int address, int select_xor) { - static const UINT16 xors[16] = + static const uint16_t xors[16] = { 0xb52c,0x2458,0x139a,0xc998,0xce8e,0x5144,0x0429,0xaad4,0xa331,0x3645,0x69a3,0xac64,0x1a53,0x5083,0x4dea,0xd237 }; - static const UINT8 bitswaps[16][16] = + static const uint8_t bitswaps[16][16] = { { 12,8,13,11,14,10,15,9, 3,2,1,0,4,5,6,7 }, { 10,11,14,12,15,13,8,9, 6,7,5,3,0,4,2,1 }, { 14,13,15,9,8,12,11,10, 7,4,1,5,6,0,3,2 }, { 15,14,8,9,10,11,13,12, 1,2,7,3,4,6,0,5 }, @@ -31,7 +31,7 @@ static UINT16 decrypt(UINT16 data, int address, int select_xor) { 13,8,12,14,11,15,10,9, 7,6,5,4,3,2,1,0 }, { 15,14,13,12,11,10,9,8, 0,6,7,4,3,2,1,5 } }; int j, xorval; - const UINT8 *bs; + const uint8_t *bs; // calculate bitswap to use j = ((address ^ select_xor) & 0xf0) >> 4; @@ -49,9 +49,9 @@ static UINT16 decrypt(UINT16 data, int address, int select_xor) bs[8],bs[9],bs[10],bs[11],bs[12],bs[13],bs[14],bs[15]); } -void deco102_decrypt_cpu(UINT16 *rom, UINT16 *opcodes, int size, int address_xor, int data_select_xor, int opcode_select_xor) +void deco102_decrypt_cpu(uint16_t *rom, uint16_t *opcodes, int size, int address_xor, int data_select_xor, int opcode_select_xor) { - std::vector buf(size / 2); + std::vector buf(size / 2); memcpy(&buf[0], rom, size); diff --git a/src/mame/machine/deco102.h b/src/mame/machine/deco102.h index 449745e6eb0..ea87834e47b 100644 --- a/src/mame/machine/deco102.h +++ b/src/mame/machine/deco102.h @@ -1,4 +1,4 @@ // license:BSD-3-Clause // copyright-holders:Nicola Salmoria -void deco102_decrypt_cpu(UINT16 *rom, UINT16 *opcodes, int size, int address_xor, int data_select_xor, int opcode_select_xor); +void deco102_decrypt_cpu(uint16_t *rom, uint16_t *opcodes, int size, int address_xor, int data_select_xor, int opcode_select_xor); diff --git a/src/mame/machine/deco104.cpp b/src/mame/machine/deco104.cpp index 554ad3ac47f..f750c6f776d 100644 --- a/src/mame/machine/deco104.cpp +++ b/src/mame/machine/deco104.cpp @@ -1055,7 +1055,7 @@ const device_type DECO104PROT = &device_creator; -deco104_device::deco104_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +deco104_device::deco104_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : deco_146_base_device(mconfig, DECO104PROT, "DECO 104 Protection", tag, owner, clock, "deco104", __FILE__) { m_bankswitch_swap_read_address = 0x66; diff --git a/src/mame/machine/deco104.h b/src/mame/machine/deco104.h index 5576f7fd6b2..a4fb85f8bf5 100644 --- a/src/mame/machine/deco104.h +++ b/src/mame/machine/deco104.h @@ -13,7 +13,7 @@ class deco104_device : public deco_146_base_device { public: - deco104_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + deco104_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/machine/deco146.cpp b/src/mame/machine/deco146.cpp index 0f0cd068100..cb60367241c 100644 --- a/src/mame/machine/deco146.cpp +++ b/src/mame/machine/deco146.cpp @@ -1122,9 +1122,9 @@ deco146port_xx port_table[] = { /* 0x7fe */ { 0x04c, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 1 } }; -UINT16 reorder(UINT16 input, UINT8 *weights) +uint16_t reorder(uint16_t input, uint8_t *weights) { - UINT16 temp = 0; + uint16_t temp = 0; for(int i = 0; i < 16; i++) { if(input & (1 << i)) // if input bit is set @@ -1143,7 +1143,7 @@ UINT16 reorder(UINT16 input, UINT8 *weights) /* there are probably less dumb ways of doing the CS logic, it could be hooked up more like the system16 mapper chips */ -void deco_146_base_device::write_data(address_space &space, UINT16 address, UINT16 data, UINT16 mem_mask, UINT8 &csflags) +void deco_146_base_device::write_data(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask, uint8_t &csflags) { address = BITSWAP16(address>>1, 15,14,13,12,11,10, m_external_addrswap[9],m_external_addrswap[8] ,m_external_addrswap[7],m_external_addrswap[6],m_external_addrswap[5],m_external_addrswap[4],m_external_addrswap[3],m_external_addrswap[2],m_external_addrswap[1],m_external_addrswap[0]) << 1; @@ -1200,7 +1200,7 @@ void deco_146_base_device::write_data(address_space &space, UINT16 address, UINT -UINT16 deco_146_base_device::read_protport(UINT16 address, UINT16 mem_mask) +uint16_t deco_146_base_device::read_protport(uint16_t address, uint16_t mem_mask) { // if we read the last written address immediately after then ignore all other logic and just return what was written unmodified if ((address==m_latchaddr) && (m_latchflag==1)) @@ -1215,7 +1215,7 @@ UINT16 deco_146_base_device::read_protport(UINT16 address, UINT16 mem_mask) if (m_magic_read_address_xor_enabled) address ^= m_magic_read_address_xor; int location = 0; - UINT16 realret = read_data_getloc(address, location); + uint16_t realret = read_data_getloc(address, location); @@ -1236,7 +1236,7 @@ UINT16 deco_146_base_device::read_protport(UINT16 address, UINT16 mem_mask) return realret; } -void deco_146_base_device::write_protport(address_space &space, UINT16 address, UINT16 data, UINT16 mem_mask) +void deco_146_base_device::write_protport(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask) { m_latchaddr = address; m_latchdata = data; @@ -1269,11 +1269,11 @@ void deco_146_base_device::write_protport(address_space &space, UINT16 address, -UINT16 deco_146_base_device::read_data(UINT16 address, UINT16 mem_mask, UINT8 &csflags) +uint16_t deco_146_base_device::read_data(uint16_t address, uint16_t mem_mask, uint8_t &csflags) { address = BITSWAP16(address>>1, 15,14,13,12,11,10, m_external_addrswap[9],m_external_addrswap[8] ,m_external_addrswap[7],m_external_addrswap[6],m_external_addrswap[5],m_external_addrswap[4],m_external_addrswap[3],m_external_addrswap[2],m_external_addrswap[1],m_external_addrswap[0]) << 1; - UINT16 retdata = 0; + uint16_t retdata = 0; csflags = 0; int upper_addr_bits = (address & 0x7800) >> 11; @@ -1319,7 +1319,7 @@ UINT16 deco_146_base_device::read_data(UINT16 address, UINT16 mem_mask, UINT8 &c -deco_146_base_device::deco_146_base_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) +deco_146_base_device::deco_146_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), m_sound_latch(*this, ":soundlatch") { @@ -1346,31 +1346,31 @@ void deco_146_base_device::device_config_complete() -UINT16 deco_146_base_device::port_dummy_cb(int unused) +uint16_t deco_146_base_device::port_dummy_cb(int unused) { return 0x00; } -void deco_146_base_device::soundlatch_dummy(address_space &space, UINT16 data, UINT16 mem_mask) +void deco_146_base_device::soundlatch_dummy(address_space &space, uint16_t data, uint16_t mem_mask) { } -UINT16 deco_146_base_device::port_a_default(int unused) +uint16_t deco_146_base_device::port_a_default(int unused) { return ioport(":INPUTS")->read(); } -UINT16 deco_146_base_device::port_b_default(int unused) +uint16_t deco_146_base_device::port_b_default(int unused) { return ioport(":SYSTEM")->read(); } -UINT16 deco_146_base_device::port_c_default(int unused) +uint16_t deco_146_base_device::port_c_default(int unused) { return ioport(":DSW")->read(); } -void deco_146_base_device::soundlatch_default(address_space &space, UINT16 data, UINT16 mem_mask) +void deco_146_base_device::soundlatch_default(address_space &space, uint16_t data, uint16_t mem_mask) { if (m_sound_latch != nullptr) m_sound_latch->write(space, 0, data & 0xff); @@ -1385,7 +1385,7 @@ void deco_146_base_device::set_port_a_cb(device_t &device,deco146_port_read_cb p void deco_146_base_device::set_port_b_cb(device_t &device,deco146_port_read_cb port_cb) { deco_146_base_device &dev = downcast(device); dev.m_port_b_r = port_cb; } void deco_146_base_device::set_port_c_cb(device_t &device,deco146_port_read_cb port_cb) { deco_146_base_device &dev = downcast(device); dev.m_port_c_r = port_cb; } void deco_146_base_device::set_soundlatch_cb(device_t &device,deco146_port_write_cb port_cb) { deco_146_base_device &dev = downcast(device); dev.m_soundlatch_w = port_cb; } -void deco_146_base_device::set_interface_scramble(device_t &device,UINT8 a9, UINT8 a8, UINT8 a7, UINT8 a6, UINT8 a5, UINT8 a4, UINT8 a3,UINT8 a2,UINT8 a1,UINT8 a0) +void deco_146_base_device::set_interface_scramble(device_t &device,uint8_t a9, uint8_t a8, uint8_t a7, uint8_t a6, uint8_t a5, uint8_t a4, uint8_t a3,uint8_t a2,uint8_t a1,uint8_t a0) { deco_146_base_device &dev = downcast(device); dev.m_external_addrswap[9] = a9; @@ -1471,9 +1471,9 @@ void deco_146_base_device::device_reset() const device_type DECO146PROT = &device_creator; -UINT16 deco_146_base_device::read_data_getloc(UINT16 address, int& location) +uint16_t deco_146_base_device::read_data_getloc(uint16_t address, int& location) { - UINT16 retdata = 0; + uint16_t retdata = 0; location = m_lookup_table[address>>1].write_offset; @@ -1497,7 +1497,7 @@ UINT16 deco_146_base_device::read_data_getloc(UINT16 address, int& location) retdata = m_rambank1[location>>1]; } - UINT16 realret = reorder(retdata, &m_lookup_table[address>>1].mapping[0] ); + uint16_t realret = reorder(retdata, &m_lookup_table[address>>1].mapping[0] ); if (m_lookup_table[address>>1].use_xor) realret ^= m_xor; if (m_lookup_table[address>>1].use_nand) realret = (realret & ~m_nand); @@ -1506,7 +1506,7 @@ UINT16 deco_146_base_device::read_data_getloc(UINT16 address, int& location) } -deco146_device::deco146_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +deco146_device::deco146_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : deco_146_base_device(mconfig, DECO146PROT, "DECO 146 Protection", tag, owner, clock, "deco146", __FILE__) { m_bankswitch_swap_read_address = 0x78; diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h index f38479dfc51..924e70b2357 100644 --- a/src/mame/machine/deco146.h +++ b/src/mame/machine/deco146.h @@ -6,8 +6,8 @@ #include "machine/gen_latch.h" -typedef device_delegate deco146_port_read_cb; -typedef device_delegate deco146_port_write_cb; +typedef device_delegate deco146_port_read_cb; +typedef device_delegate deco146_port_write_cb; #define MCFG_DECO146_SET_PORTA_CALLBACK( _class, _method) \ @@ -70,7 +70,7 @@ typedef device_delegate m_sound_latch; }; @@ -167,7 +167,7 @@ extern const device_type DECO146BASE; class deco146_device : public deco_146_base_device { public: - deco146_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + deco146_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type DECO146PROT; diff --git a/src/mame/machine/deco156.cpp b/src/mame/machine/deco156.cpp index a5f190e1adc..3258c55a66d 100644 --- a/src/mame/machine/deco156.cpp +++ b/src/mame/machine/deco156.cpp @@ -36,7 +36,7 @@ #include "machine/deco156.h" -static void decrypt(UINT32 *src, UINT32 *dst, int length) +static void decrypt(uint32_t *src, uint32_t *dst, int length) { int a; @@ -126,9 +126,9 @@ static void decrypt(UINT32 *src, UINT32 *dst, int length) void deco156_decrypt(running_machine &machine) { - UINT32 *rom = (UINT32 *)machine.root_device().memregion("maincpu")->base(); + uint32_t *rom = (uint32_t *)machine.root_device().memregion("maincpu")->base(); int length = machine.root_device().memregion("maincpu")->bytes(); - std::vector buf(length/4); + std::vector buf(length/4); memcpy(&buf[0], rom, length); decrypt(&buf[0], rom, length); diff --git a/src/mame/machine/deco222.cpp b/src/mame/machine/deco222.cpp index 1df8a720dd2..722a2f0e2ac 100644 --- a/src/mame/machine/deco222.cpp +++ b/src/mame/machine/deco222.cpp @@ -8,7 +8,7 @@ #include "deco222.h" -deco_222_device::deco_222_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +deco_222_device::deco_222_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, DECO_222, "DECO 222", tag, owner, clock, "deco222", __FILE__) { } @@ -25,14 +25,14 @@ void deco_222_device::device_reset() static_cast(mintf)->had_written = false; } -UINT8 deco_222_device::mi_decrypt::read_sync(UINT16 adr) +uint8_t deco_222_device::mi_decrypt::read_sync(uint16_t adr) { return BITSWAP8(direct->read_byte(adr) ,7,5,6,4,3,2,1,0); } -deco_c10707_device::deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +deco_c10707_device::deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, DECO_C10707, "DECO C10707", tag, owner, clock, "decoc10707", __FILE__) { } @@ -49,7 +49,7 @@ void deco_c10707_device::device_reset() static_cast(mintf)->had_written = false; } -UINT8 deco_c10707_device::mi_decrypt::read_sync(UINT16 adr) +uint8_t deco_c10707_device::mi_decrypt::read_sync(uint16_t adr) { return BITSWAP8(direct->read_byte(adr) ,7,5,6,4,3,2,1,0); } diff --git a/src/mame/machine/deco222.h b/src/mame/machine/deco222.h index 9a7c8ba8822..3d765e5aee4 100644 --- a/src/mame/machine/deco222.h +++ b/src/mame/machine/deco222.h @@ -6,7 +6,7 @@ class deco_222_device : public m6502_device { public: - deco_222_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + deco_222_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: class mi_decrypt : public mi_default_normal { @@ -14,7 +14,7 @@ protected: bool had_written; virtual ~mi_decrypt() {} - virtual UINT8 read_sync(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; }; virtual void device_start() override; @@ -28,7 +28,7 @@ static const device_type DECO_222 = &device_creator; class deco_c10707_device : public m6502_device { public: - deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: class mi_decrypt : public mi_default_normal { @@ -36,7 +36,7 @@ protected: bool had_written; virtual ~mi_decrypt() {} - virtual UINT8 read_sync(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; }; virtual void device_start() override; diff --git a/src/mame/machine/decocass.cpp b/src/mame/machine/decocass.cpp index c0bb1c642e9..f1529ebba4e 100644 --- a/src/mame/machine/decocass.cpp +++ b/src/mame/machine/decocass.cpp @@ -14,14 +14,14 @@ /* dongle type #1: jumpers C and D assignments */ #define MAKE_MAP(m0,m1,m2,m3,m4,m5,m6,m7) \ - ((UINT32)(m0)) | \ - ((UINT32)(m1) << 3) | \ - ((UINT32)(m2) << 6) | \ - ((UINT32)(m3) << 9) | \ - ((UINT32)(m4) << 12) | \ - ((UINT32)(m5) << 15) | \ - ((UINT32)(m6) << 18) | \ - ((UINT32)(m7) << 21) + ((uint32_t)(m0)) | \ + ((uint32_t)(m1) << 3) | \ + ((uint32_t)(m2) << 6) | \ + ((uint32_t)(m3) << 9) | \ + ((uint32_t)(m4) << 12) | \ + ((uint32_t)(m5) << 15) | \ + ((uint32_t)(m6) << 18) | \ + ((uint32_t)(m7) << 21) #define T1MAP(x, m) (((m)>>(x*3))&7) @@ -66,14 +66,14 @@ WRITE8_MEMBER(decocass_state::decocass_sound_command_w) READ8_MEMBER(decocass_state::decocass_sound_data_r) { - UINT8 data = m_soundlatch2->read(space, 0); + uint8_t data = m_soundlatch2->read(space, 0); LOG(2,("CPU %s sound data <- $%02x\n", space.device().tag(), data)); return data; } READ8_MEMBER(decocass_state::decocass_sound_ack_r) { - UINT8 data = m_sound_ack; /* D6+D7 */ + uint8_t data = m_sound_ack; /* D6+D7 */ LOG(4,("CPU %s sound ack <- $%02x\n", space.device().tag(), data)); return data; } @@ -87,7 +87,7 @@ WRITE8_MEMBER(decocass_state::decocass_sound_data_w) READ8_MEMBER(decocass_state::decocass_sound_command_r) { - UINT8 data = m_soundlatch->read(space, 0); + uint8_t data = m_soundlatch->read(space, 0); LOG(4,("CPU %s sound command <- $%02x\n", space.device().tag(), data)); m_audiocpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE); m_sound_ack &= ~0x80; @@ -116,7 +116,7 @@ READ8_MEMBER(decocass_state::decocass_sound_nmi_enable_r) READ8_MEMBER(decocass_state::decocass_sound_data_ack_reset_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; LOG(2,("CPU %s sound ack rst <- $%02x\n", space.device().tag(), data)); m_sound_ack &= ~0x40; return data; @@ -158,7 +158,7 @@ WRITE8_MEMBER(decocass_state::decocass_adc_w) */ READ8_MEMBER(decocass_state::decocass_input_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; static const char *const portnames[] = { "IN0", "IN1", "IN2" }; switch (offset & 7) @@ -211,7 +211,7 @@ WRITE8_MEMBER(decocass_state::decocass_reset_w) #ifdef MAME_DEBUG -void decocass_state::decocass_fno( offs_t offset, UINT8 data ) +void decocass_state::decocass_fno( offs_t offset, uint8_t data ) { /* 8041ENA/ and is this a FNO write (function number)? */ if (0 == (m_i8041_p2 & 0x01)) @@ -246,7 +246,7 @@ READ8_MEMBER(decocass_state::decocass_type1_r) if (!m_type1_map) return 0x00; - UINT8 data; + uint8_t data; if (1 == (offset & 1)) { @@ -264,8 +264,8 @@ READ8_MEMBER(decocass_state::decocass_type1_r) else { offs_t promaddr; - UINT8 save; - UINT8 *prom = space.machine().root_device().memregion("dongle")->base(); + uint8_t save; + uint8_t *prom = space.machine().root_device().memregion("dongle")->base(); if (m_firsttime) { @@ -333,7 +333,7 @@ READ8_MEMBER(decocass_state::decocass_type1_r) * ***************************************************************************/ -static UINT8 type1_latch_26_pass_3_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1DIRECT,T1PROM, T1PROM,T1LATCH,T1PROM }; +static uint8_t type1_latch_26_pass_3_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1DIRECT,T1PROM, T1PROM,T1LATCH,T1PROM }; /*************************************************************************** * @@ -345,7 +345,7 @@ static UINT8 type1_latch_26_pass_3_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T * ***************************************************************************/ -static UINT8 type1_pass_136_table[8] ={ T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM,T1PROM,T1DIRECT,T1PROM }; +static uint8_t type1_pass_136_table[8] ={ T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM,T1PROM,T1DIRECT,T1PROM }; /*************************************************************************** * @@ -358,7 +358,7 @@ static UINT8 type1_pass_136_table[8] ={ T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM,T * ***************************************************************************/ -static UINT8 type1_latch_xab_pass_x54_table[8] = { T1PROM,T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM }; +static uint8_t type1_latch_xab_pass_x54_table[8] = { T1PROM,T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM }; /*************************************************************************** * @@ -371,7 +371,7 @@ static UINT8 type1_latch_xab_pass_x54_table[8] = { T1PROM,T1PROM,T1DIRECT,T1PROM * ***************************************************************************/ -static UINT8 type1_latch_27_pass_3_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1DIRECT,T1PROM,T1PROM,T1PROM,T1LATCH }; +static uint8_t type1_latch_27_pass_3_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1DIRECT,T1PROM,T1PROM,T1PROM,T1LATCH }; /*************************************************************************** * @@ -384,7 +384,7 @@ static UINT8 type1_latch_27_pass_3_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T * ***************************************************************************/ -static UINT8 type1_latch_26_pass_5_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1PROM,T1PROM,T1DIRECT,T1LATCH,T1PROM }; +static uint8_t type1_latch_26_pass_5_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1PROM,T1PROM,T1DIRECT,T1LATCH,T1PROM }; /*************************************************************************** * @@ -397,7 +397,7 @@ static UINT8 type1_latch_26_pass_5_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T * ***************************************************************************/ -static UINT8 type1_latch_16_pass_3_inv_1_table[8] = { T1PROM,T1LATCHINV,T1PROM,T1DIRECT,T1PROM,T1PROM,T1LATCH,T1PROM }; +static uint8_t type1_latch_16_pass_3_inv_1_table[8] = { T1PROM,T1LATCHINV,T1PROM,T1DIRECT,T1PROM,T1PROM,T1LATCH,T1PROM }; /*************************************************************************** * @@ -418,7 +418,7 @@ static UINT8 type1_latch_16_pass_3_inv_1_table[8] = { T1PROM,T1LATCHINV,T1PROM,T * ***************************************************************************/ -static UINT8 type1_map1100[8] = { T1PROM,T1PROM,T1LATCHINV,T1PROM,T1DIRECT,T1PROM,T1LATCH,T1PROM }; +static uint8_t type1_map1100[8] = { T1PROM,T1PROM,T1LATCHINV,T1PROM,T1DIRECT,T1PROM,T1LATCH,T1PROM }; MACHINE_RESET_MEMBER(decocass_state,cocean1a) /* 10 */ { @@ -442,13 +442,13 @@ MACHINE_RESET_MEMBER(decocass_state,cocean1a) /* 10 */ ***************************************************************************/ READ8_MEMBER(decocass_state::decocass_type2_r) { - UINT8 data; + uint8_t data; if (1 == m_type2_xx_latch) { if (1 == (offset & 1)) { - UINT8 *prom = memregion("dongle")->base(); + uint8_t *prom = memregion("dongle")->base(); data = prom[256 * m_type2_d2_latch + m_type2_promaddr]; LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, 256 * m_type2_d2_latch + m_type2_promaddr)); } @@ -524,13 +524,13 @@ WRITE8_MEMBER(decocass_state::decocass_type2_w) ***************************************************************************/ READ8_MEMBER(decocass_state::decocass_type3_r) { - UINT8 data, save; + uint8_t data, save; if (1 == (offset & 1)) { if (1 == m_type3_pal_19) { - UINT8 *prom = memregion("dongle")->base(); + uint8_t *prom = memregion("dongle")->base(); data = prom[m_type3_ctrs]; LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, m_type3_ctrs)); if (++m_type3_ctrs == 4096) @@ -762,7 +762,7 @@ WRITE8_MEMBER(decocass_state::decocass_type3_w) READ8_MEMBER(decocass_state::decocass_type4_r) { - UINT8 data; + uint8_t data; if (1 == (offset & 1)) { @@ -781,7 +781,7 @@ READ8_MEMBER(decocass_state::decocass_type4_r) { if (m_type4_latch) { - UINT8 *prom = space.machine().root_device().memregion("dongle")->base(); + uint8_t *prom = space.machine().root_device().memregion("dongle")->base(); data = prom[m_type4_ctrs]; LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, (data >= 32) ? data : '.', m_type4_ctrs)); @@ -845,7 +845,7 @@ WRITE8_MEMBER(decocass_state::decocass_type4_w) READ8_MEMBER(decocass_state::decocass_type5_r) { - UINT8 data; + uint8_t data; if (1 == (offset & 1)) { @@ -921,7 +921,7 @@ WRITE8_MEMBER(decocass_state::decocass_type5_w) READ8_MEMBER(decocass_state::decocass_nodong_r) { - UINT8 data; + uint8_t data; if (1 == (offset & 1)) { @@ -961,12 +961,12 @@ READ8_MEMBER(decocass_state::decocass_nodong_r) READ8_MEMBER(decocass_state::decocass_e5xx_r) { - UINT8 data; + uint8_t data; /* E5x2-E5x3 and mirrors */ if (2 == (offset & E5XX_MASK)) { - UINT8 bot_eot = (m_cassette->get_status_bits() >> 5) & 1; + uint8_t bot_eot = (m_cassette->get_status_bits() >> 5) & 1; data = (BIT(m_i8041_p1, 7) << 0) | /* D0 = P17 - REQ/ */ @@ -1406,7 +1406,7 @@ MACHINE_RESET_MEMBER(decocass_state,csdtenis) MACHINE_RESET_MEMBER(decocass_state,czeroize) { - UINT8 *mem = memregion("dongle")->base(); + uint8_t *mem = memregion("dongle")->base(); decocass_state::machine_reset(); LOG(0,("dongle type #3 (PAL)\n")); m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type3_r),this); @@ -1510,7 +1510,7 @@ WRITE8_MEMBER(decocass_state::i8041_p1_w) READ8_MEMBER(decocass_state::i8041_p1_r) { - UINT8 data = m_i8041_p1; + uint8_t data = m_i8041_p1; if (data != m_i8041_p1_read_latch) { @@ -1554,7 +1554,7 @@ WRITE8_MEMBER(decocass_state::i8041_p2_w) READ8_MEMBER(decocass_state::i8041_p2_r) { - UINT8 data; + uint8_t data; data = (m_i8041_p2 & ~0xe0) | m_cassette->get_status_bits(); diff --git a/src/mame/machine/decocass_tape.cpp b/src/mame/machine/decocass_tape.cpp index 982cd9018aa..a4ae654f5b9 100644 --- a/src/mame/machine/decocass_tape.cpp +++ b/src/mame/machine/decocass_tape.cpp @@ -54,11 +54,11 @@ #define REGION_BOT_GAP_LEN_CLOCKS TAPE_MSEC_TO_CLOCKS(300) /* 300ms */ #define REGION_BOT_GAP_END_CLOCK (REGION_BOT_GAP_START_CLOCK+REGION_BOT_GAP_LEN_CLOCKS) -static UINT16 tape_crc16_byte(UINT16 crc, UINT8 data); +static uint16_t tape_crc16_byte(uint16_t crc, uint8_t data); const device_type DECOCASS_TAPE = &device_creator; -decocass_tape_device::decocass_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +decocass_tape_device::decocass_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DECOCASS_TAPE, "DECO Cassette Tape", tag, owner, clock, "decocass_tape", __FILE__), m_tape_timer(nullptr), m_speed(0), @@ -108,7 +108,7 @@ void decocass_tape_device::device_start() /* compute CRCs for each block */ for (curblock = 0; curblock < numblocks; curblock++) { - UINT16 crc = 0; + uint16_t crc = 0; int testval; /* first CRC the 256 bytes of data */ @@ -143,7 +143,7 @@ void decocass_tape_device::device_reset() CRC data -------------------------------------------------*/ -static UINT16 tape_crc16_byte(UINT16 crc, UINT8 data) +static uint16_t tape_crc16_byte(uint16_t crc, uint8_t data) { int bit; @@ -214,7 +214,7 @@ const char *decocass_tape_device::describe_state() /* in the main data area, the clock alternates at the clock rate */ if (m_bytenum >= BYTE_LEADIN && m_bytenum <= BYTE_LEADOUT) - clk = ((UINT32)(m_clockpos - REGION_BOT_GAP_END_CLOCK) & 1) ? 0 : 1; + clk = ((uint32_t)(m_clockpos - REGION_BOT_GAP_END_CLOCK) & 1) ? 0 : 1; else if (m_bytenum == BYTE_LONGCLOCK) clk = 1; else @@ -264,7 +264,7 @@ TIMER_CALLBACK_MEMBER( decocass_tape_device::tape_clock_callback ) /* everything else is data */ else { - UINT32 dataclock = m_clockpos - REGION_BOT_GAP_END_CLOCK; + uint32_t dataclock = m_clockpos - REGION_BOT_GAP_END_CLOCK; /* compute the block number */ m_region = (tape_region)(REGION_DATA_BLOCK_0 + dataclock / (TAPE_CLOCKS_PER_BYTE * BYTE_BLOCK_TOTAL)); @@ -289,9 +289,9 @@ TIMER_CALLBACK_MEMBER( decocass_tape_device::tape_clock_callback ) bits from the tape -------------------------------------------------*/ -UINT8 decocass_tape_device::get_status_bits() +uint8_t decocass_tape_device::get_status_bits() { - UINT8 tape_bits = 0; + uint8_t tape_bits = 0; /* bit 0x20 is the BOT/EOT signal, which is also set in the leader/trailer area */ if (m_region == REGION_LEADER || m_region == REGION_BOT || m_region == REGION_EOT || m_region == REGION_TRAILER) @@ -302,11 +302,11 @@ UINT8 decocass_tape_device::get_status_bits() if (m_region >= REGION_DATA_BLOCK_0 && m_region <= REGION_DATA_BLOCK_255) { int blocknum = m_region - REGION_DATA_BLOCK_0; - UINT8 byteval = 0x00; + uint8_t byteval = 0x00; /* in the main data area, the clock alternates at the clock rate */ if (m_bytenum >= BYTE_LEADIN && m_bytenum <= BYTE_LEADOUT) - tape_bits |= ((UINT32)(m_clockpos - REGION_BOT_GAP_END_CLOCK) & 1) ? 0x00 : 0x40; + tape_bits |= ((uint32_t)(m_clockpos - REGION_BOT_GAP_END_CLOCK) & 1) ? 0x00 : 0x40; /* in the longclock area, the clock holds high */ else if (m_bytenum == BYTE_LONGCLOCK) @@ -347,7 +347,7 @@ UINT8 decocass_tape_device::get_status_bits() present -------------------------------------------------*/ -UINT8 decocass_tape_device::is_present() +uint8_t decocass_tape_device::is_present() { return m_tape_data.found(); } @@ -358,10 +358,10 @@ UINT8 decocass_tape_device::is_present() playback -------------------------------------------------*/ -void decocass_tape_device::change_speed(INT8 newspeed) +void decocass_tape_device::change_speed(int8_t newspeed) { attotime newperiod; - INT8 absnewspeed; + int8_t absnewspeed; /* do nothing if speed has not changed */ if (m_speed == newspeed) diff --git a/src/mame/machine/decocass_tape.h b/src/mame/machine/decocass_tape.h index 4d7f03ada4a..ee6b2837308 100644 --- a/src/mame/machine/decocass_tape.h +++ b/src/mame/machine/decocass_tape.h @@ -6,12 +6,12 @@ class decocass_tape_device : public device_t { public: - decocass_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + decocass_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~decocass_tape_device() {} - UINT8 get_status_bits(); - UINT8 is_present(); - void change_speed(INT8 newspeed); + uint8_t get_status_bits(); + uint8_t is_present(); + void change_speed(int8_t newspeed); protected: // device-level overrides @@ -57,14 +57,14 @@ private: // internal state emu_timer * m_tape_timer; /* timer for running the tape */ - INT8 m_speed; /* speed: <-1=fast rewind, -1=reverse, 0=stopped, 1=normal, >1=fast forward */ + int8_t m_speed; /* speed: <-1=fast rewind, -1=reverse, 0=stopped, 1=normal, >1=fast forward */ tape_region m_region; /* current region */ tape_byte m_bytenum; /* byte number within a datablock */ - UINT8 m_bitnum; /* bit number within a byte */ - UINT32 m_clockpos; /* the current clock position of the tape */ - UINT32 m_numclocks; /* total number of clocks on the entire tape */ - UINT16 m_crc16[256]; /* CRC16 for each block */ - optional_region_ptr m_tape_data; + uint8_t m_bitnum; /* bit number within a byte */ + uint32_t m_clockpos; /* the current clock position of the tape */ + uint32_t m_numclocks; /* total number of clocks on the entire tape */ + uint16_t m_crc16[256]; /* CRC16 for each block */ + optional_region_ptr m_tape_data; const char *describe_state(); TIMER_CALLBACK_MEMBER( tape_clock_callback ); diff --git a/src/mame/machine/decocpu6.cpp b/src/mame/machine/decocpu6.cpp index 957c602976f..28cdac73105 100644 --- a/src/mame/machine/decocpu6.cpp +++ b/src/mame/machine/decocpu6.cpp @@ -8,7 +8,7 @@ #include "decocpu6.h" -deco_cpu6_device::deco_cpu6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +deco_cpu6_device::deco_cpu6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, DECO_CPU6, "DECO CPU-6", tag, owner, clock, "decocpu6", __FILE__) { } @@ -24,7 +24,7 @@ void deco_cpu6_device::device_reset() m6502_device::device_reset(); } -UINT8 deco_cpu6_device::mi_decrypt::read_sync(UINT16 adr) +uint8_t deco_cpu6_device::mi_decrypt::read_sync(uint16_t adr) { if (adr&1) return BITSWAP8(direct->read_byte(adr),6,4,7,5,3,2,1,0); diff --git a/src/mame/machine/decocpu6.h b/src/mame/machine/decocpu6.h index 27279a6cbe1..0de17580c16 100644 --- a/src/mame/machine/decocpu6.h +++ b/src/mame/machine/decocpu6.h @@ -7,13 +7,13 @@ class deco_cpu6_device : public m6502_device { public: - deco_cpu6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + deco_cpu6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: class mi_decrypt : public mi_default_normal { public: virtual ~mi_decrypt() {} - virtual UINT8 read_sync(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; }; virtual void device_start() override; diff --git a/src/mame/machine/decocpu7.cpp b/src/mame/machine/decocpu7.cpp index dc6bb85dff8..61b959d061b 100644 --- a/src/mame/machine/decocpu7.cpp +++ b/src/mame/machine/decocpu7.cpp @@ -3,7 +3,7 @@ #include "decocpu7.h" -deco_cpu7_device::deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +deco_cpu7_device::deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, DECO_CPU7, "DECO CPU-7", tag, owner, clock, "decocpu7", __FILE__) { } @@ -20,9 +20,9 @@ void deco_cpu7_device::device_reset() static_cast(mintf)->had_written = false; } -UINT8 deco_cpu7_device::mi_decrypt::read_sync(UINT16 adr) +uint8_t deco_cpu7_device::mi_decrypt::read_sync(uint16_t adr) { - UINT8 res = direct->read_byte(adr); + uint8_t res = direct->read_byte(adr); if(had_written) { had_written = false; if((adr & 0x0104) == 0x0104) @@ -31,7 +31,7 @@ UINT8 deco_cpu7_device::mi_decrypt::read_sync(UINT16 adr) return res; } -void deco_cpu7_device::mi_decrypt::write(UINT16 adr, UINT8 val) +void deco_cpu7_device::mi_decrypt::write(uint16_t adr, uint8_t val) { program->write_byte(adr, val); had_written = true; diff --git a/src/mame/machine/decocpu7.h b/src/mame/machine/decocpu7.h index 2f2490ed46c..d03007efc04 100644 --- a/src/mame/machine/decocpu7.h +++ b/src/mame/machine/decocpu7.h @@ -6,7 +6,7 @@ class deco_cpu7_device : public m6502_device { public: - deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: class mi_decrypt : public mi_default_normal { @@ -14,8 +14,8 @@ protected: bool had_written; virtual ~mi_decrypt() {} - virtual UINT8 read_sync(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; virtual void device_start() override; diff --git a/src/mame/machine/decocrpt.cpp b/src/mame/machine/decocrpt.cpp index 680481a3e52..dda584c2d76 100644 --- a/src/mame/machine/decocrpt.cpp +++ b/src/mame/machine/decocrpt.cpp @@ -46,13 +46,13 @@ Sotsugyo Shousho 1995 #include "emu.h" #include "machine/decocrpt.h" -static const UINT16 xor_masks[16] = +static const uint16_t xor_masks[16] = { 0xd556,0x73cb,0x2963,0x4b9a,0xb3bc,0xbc73,0xcbc9,0xaeb5, 0x1e6d,0xd5b5,0xe676,0x5cc5,0x395a,0xdaae,0x2629,0xe59e, }; -static const UINT8 swap_patterns[8][16] = +static const uint8_t swap_patterns[8][16] = { { 0xf,0x8,0x9,0xc,0xa,0xd,0xb,0xe, 0x2,0x7,0x4,0x3,0x1,0x5,0x6,0x0 }, { 0xc,0xa,0xb,0x9,0x8,0xf,0xe,0xd, 0x6,0x0,0x3,0x5,0x7,0x4,0x2,0x1 }, @@ -64,7 +64,7 @@ static const UINT8 swap_patterns[8][16] = { 0x9,0x8,0xe,0xa,0xf,0xb,0xd,0xc, 0x6,0x0,0x5,0x2,0x4,0x1,0x3,0x7 }, }; -static const UINT8 deco56_xor_table[0x800] = +static const uint8_t deco56_xor_table[0x800] = { 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9,10, 7,11,11, 9,11, 3, 7,10,12,13, 3,14, 0, 0, 9, 0,15, 3, 4,14, 6, 3,14,14, 3,12, 3,13, 9, 5,13, 3, 8, 2, 7,14, 2, 5, 1, 2, 3, 4,14,11, 8, 0, 6, 7,10, 3, 4, 7, @@ -132,7 +132,7 @@ static const UINT8 deco56_xor_table[0x800] = 11, 6, 3, 0, 5,11,14,14,14, 4,13, 6,11, 6, 4,12,15, 2, 4, 1, 1, 5, 1,15, 7, 0, 5, 0, 0, 0,12, 1, }; -static const UINT16 deco56_address_table[0x800] = +static const uint16_t deco56_address_table[0x800] = { 0x527,0x1a1,0x2f6,0x523,0x297,0x005,0x141,0x3b4,0x539,0x794,0x6dd,0x498,0x59b,0x119,0x5db,0x631, 0x2f1,0x565,0x409,0x158,0x2d6,0x16e,0x571,0x0b9,0x543,0x52b,0x668,0x0c0,0x5fd,0x216,0x5ea,0x24e, @@ -264,7 +264,7 @@ static const UINT16 deco56_address_table[0x800] = 0x625,0x4bc,0x335,0x42b,0x5d8,0x07d,0x03f,0x089,0x7e9,0x07c,0x1cf,0x024,0x188,0x53b,0x2bf,0x726, }; -static const UINT8 deco56_swap_table[0x800] = +static const uint8_t deco56_swap_table[0x800] = { 4,0,7,2,0,0,7,2,0,1,6,3,2,2,2,2,0,5,6,3,7,0,0,5,1,1,1,7,1,0,0,0, 2,5,6,6,2,0,4,1,5,0,1,7,4,7,0,4,6,2,1,5,3,1,2,4,6,4,2,0,4,3,3,7, @@ -332,7 +332,7 @@ static const UINT8 deco56_swap_table[0x800] = 6,5,6,0,1,1,6,0,6,1,7,2,4,5,6,5,0,4,0,3,2,3,7,7,0,3,5,0,4,1,1,1, }; -static const UINT8 deco74_xor_table[0x800] = +static const uint8_t deco74_xor_table[0x800] = { 13,13, 0,10, 8,15,12, 0,10, 8,13,15,12, 3,15, 2,11, 1, 8,10,13, 4,10,12,11, 2, 0, 3, 0,11, 8,11, 5,14,11, 2, 5, 3, 8,11, 8,13,14, 4, 3,13,11,10,14, 6, 9,11,11, 8, 0,15, 2, 4, 5, 7,15, 8,13,11, @@ -400,7 +400,7 @@ static const UINT8 deco74_xor_table[0x800] = 7, 7,12, 5, 3,14, 1, 5, 1,10, 6, 7, 9, 8,15, 7,13,11, 4, 5, 4,10,14,14,12, 1,13,14,15,14,15,10, }; -static const UINT16 deco74_address_table[0x800] = +static const uint16_t deco74_address_table[0x800] = { 0x526,0x684,0x15f,0x1ad,0x736,0x341,0x4c3,0x23c,0x3eb,0x01f,0x18e,0x375,0x029,0x227,0x707,0x506, 0x5ce,0x0dc,0x5dc,0x5fd,0x15c,0x013,0x7b9,0x3c1,0x77d,0x1eb,0x53d,0x4a9,0x66e,0x0a9,0x4e2,0x361, @@ -532,7 +532,7 @@ static const UINT16 deco74_address_table[0x800] = 0x174,0x060,0x674,0x6ec,0x7bb,0x288,0x6ee,0x737,0x34c,0x617,0x4bc,0x5d5,0x78c,0x465,0x126,0x626, }; -static const UINT8 deco74_swap_table[0x800] = +static const uint8_t deco74_swap_table[0x800] = { 2,7,5,7,1,1,4,4,7,5,6,7,7,3,4,3,0,2,1,3,0,4,7,7,2,5,3,1,4,4,6,7, 6,7,4,5,1,3,0,3,7,2,5,0,1,5,2,1,4,0,6,1,1,2,4,2,1,0,6,5,2,6,4,6, @@ -600,11 +600,11 @@ static const UINT8 deco74_swap_table[0x800] = 4,7,2,2,1,3,4,4,1,7,0,2,5,4,7,3,7,6,1,5,6,0,7,4,1,1,5,2,2,6,7,2, }; -static void deco_decrypt(running_machine &machine,const char *rgntag,const UINT8 *xor_table,const UINT16 *address_table,const UINT8 *swap_table,int remap_only) +static void deco_decrypt(running_machine &machine,const char *rgntag,const uint8_t *xor_table,const uint16_t *address_table,const uint8_t *swap_table,int remap_only) { - UINT16 *rom = (UINT16 *)machine.root_device().memregion(rgntag)->base(); + uint16_t *rom = (uint16_t *)machine.root_device().memregion(rgntag)->base(); int len = machine.root_device().memregion(rgntag)->bytes()/2; - std::vector buffer(len); + std::vector buffer(len); int i; /* we work on 16-bit words but data is loaded as 8-bit, so swap bytes on LSB machines */ diff --git a/src/mame/machine/decopincpu.cpp b/src/mame/machine/decopincpu.cpp index e1ad37b8b89..c0f7087e2f4 100644 --- a/src/mame/machine/decopincpu.cpp +++ b/src/mame/machine/decopincpu.cpp @@ -128,7 +128,7 @@ WRITE8_MEMBER( decocpu_type1_device::lamp1_w ) READ8_MEMBER( decocpu_type1_device::display_strobe_r ) { - UINT8 ret = 0x80; + uint8_t ret = 0x80; if(BIT(ioport("DIAGS")->read(), 4)) // W7 Jumper ret &= ~0x80; @@ -262,7 +262,7 @@ ioport_constructor decocpu_type1_device::device_input_ports() const return INPUT_PORTS_NAME( decocpu1 ); } -decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DECOCPU1, "Data East Pinball CPU Board Type 1", tag, owner, clock, "decocpu1", __FILE__), m_cpu(*this,"maincpu"), m_pia21(*this, "pia21"), @@ -281,7 +281,7 @@ decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, const m_write_solenoid(*this) {} -decocpu_type1_device::decocpu_type1_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) +decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), m_cpu(*this,"maincpu"), m_pia21(*this, "pia21"), @@ -302,7 +302,7 @@ decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, device void decocpu_type1_device::device_start() { - UINT8* ROM = memregion(m_cputag)->base(); + uint8_t* ROM = memregion(m_cputag)->base(); // resolve callbacks m_read_display.resolve_safe(0); @@ -327,11 +327,11 @@ void decocpu_type1_device::static_set_cpuregion(device_t &device, const char *ta cpuboard.m_cputag = tag; } -decocpu_type2_device::decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +decocpu_type2_device::decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : decocpu_type1_device(mconfig, DECOCPU2, "Data East Pinball CPU Board Type 2", tag, owner, clock, "decocpu2", __FILE__) {} -decocpu_type2_device::decocpu_type2_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) +decocpu_type2_device::decocpu_type2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : decocpu_type1_device(mconfig, type, name, tag, owner, clock, shortname, source) {} @@ -345,11 +345,11 @@ void decocpu_type2_device::device_start() decocpu_type1_device::device_start(); } -decocpu_type3_device::decocpu_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +decocpu_type3_device::decocpu_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : decocpu_type2_device(mconfig, DECOCPU3, "Data East Pinball CPU Board Type 3", tag, owner, clock, "decocpu3", __FILE__) {} -decocpu_type3_device::decocpu_type3_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) +decocpu_type3_device::decocpu_type3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : decocpu_type2_device(mconfig, type, name, tag, owner, clock, shortname, source) {} @@ -358,7 +358,7 @@ void decocpu_type3_device::device_start() decocpu_type1_device::device_start(); } -decocpu_type3b_device::decocpu_type3b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +decocpu_type3b_device::decocpu_type3b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : decocpu_type3_device(mconfig, DECOCPU3, "Data East Pinball CPU Board Type 3B", tag, owner, clock, "decocpu3b", __FILE__) {} diff --git a/src/mame/machine/decopincpu.h b/src/mame/machine/decopincpu.h index 7a8264e8508..e4e5fffa304 100644 --- a/src/mame/machine/decopincpu.h +++ b/src/mame/machine/decopincpu.h @@ -64,8 +64,8 @@ class decocpu_type1_device : public device_t { public: - decocpu_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - decocpu_type1_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); + decocpu_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + decocpu_type1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); required_device m_cpu; required_device m_pia21; required_device m_pia24; @@ -134,8 +134,8 @@ private: class decocpu_type2_device : public decocpu_type1_device { public: - decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - decocpu_type2_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); + decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + decocpu_type2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); protected: // overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -145,8 +145,8 @@ protected: class decocpu_type3_device : public decocpu_type2_device { public: - decocpu_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - decocpu_type3_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); + decocpu_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + decocpu_type3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); protected: // overrides @@ -156,7 +156,7 @@ protected: class decocpu_type3b_device : public decocpu_type3_device { public: - decocpu_type3b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + decocpu_type3b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // overrides diff --git a/src/mame/machine/dgn_beta.cpp b/src/mame/machine/dgn_beta.cpp index 3ce329ca8fe..d9f66ae9c3f 100644 --- a/src/mame/machine/dgn_beta.cpp +++ b/src/mame/machine/dgn_beta.cpp @@ -142,7 +142,7 @@ void dgn_beta_state::UpdateBanks(int first, int last) address_space &space_0 = m_maincpu->space(AS_PROGRAM); address_space &space_1 = machine().device(DMACPU_TAG)->memory().space(AS_PROGRAM); int Page; - UINT8 *readbank; + uint8_t *readbank; int bank_start; int bank_end; int MapPage; @@ -213,7 +213,7 @@ void dgn_beta_state::UpdateBanks(int first, int last) // void dgn_beta_state::SetDefaultTask() { -// UINT8 *videoram = m_videoram; +// uint8_t *videoram = m_videoram; int Idx; LOG_DEFAULT_TASK(("SetDefaultTask()\n")); @@ -747,12 +747,12 @@ void dgn_beta_state::cpu0_recalc_irq(int state) pia6821_device *pia_0 = machine().device( PIA_0_TAG ); pia6821_device *pia_1 = machine().device( PIA_1_TAG ); pia6821_device *pia_2 = machine().device( PIA_2_TAG ); - UINT8 pia0_irq_a = pia_0->irq_a_state(); - UINT8 pia1_irq_a = pia_1->irq_a_state(); - UINT8 pia1_irq_b = pia_1->irq_b_state(); - UINT8 pia2_irq_a = pia_2->irq_a_state(); - UINT8 pia2_irq_b = pia_2->irq_b_state(); - UINT8 IRQ; + uint8_t pia0_irq_a = pia_0->irq_a_state(); + uint8_t pia1_irq_a = pia_1->irq_a_state(); + uint8_t pia1_irq_b = pia_1->irq_b_state(); + uint8_t pia2_irq_a = pia_2->irq_a_state(); + uint8_t pia2_irq_b = pia_2->irq_b_state(); + uint8_t IRQ; if (pia0_irq_a || pia1_irq_a || pia1_irq_b || pia2_irq_a || pia2_irq_b) IRQ = ASSERT_LINE; @@ -766,8 +766,8 @@ void dgn_beta_state::cpu0_recalc_irq(int state) void dgn_beta_state::cpu0_recalc_firq(int state) { pia6821_device *pia_0 = machine().device( PIA_0_TAG ); - UINT8 pia0_irq_b = pia_0->irq_b_state(); - UINT8 FIRQ; + uint8_t pia0_irq_b = pia_0->irq_b_state(); + uint8_t FIRQ; if (pia0_irq_b) FIRQ = ASSERT_LINE; @@ -1101,7 +1101,7 @@ static const char *const os9syscalls[] = }; -offs_t dgn_beta_state::dgnbeta_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) +offs_t dgn_beta_state::dgnbeta_dasm_override(device_t &device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options) { unsigned call; unsigned result = 0; diff --git a/src/mame/machine/dgnalpha.cpp b/src/mame/machine/dgnalpha.cpp index 760df71256a..3523f97ecab 100644 --- a/src/mame/machine/dgnalpha.cpp +++ b/src/mame/machine/dgnalpha.cpp @@ -102,7 +102,7 @@ void dragon_alpha_state::device_reset(void) // modem_r //------------------------------------------------- -UINT8 dragon_alpha_state::modem_r(offs_t offset) +uint8_t dragon_alpha_state::modem_r(offs_t offset) { return 0xFF; } @@ -113,7 +113,7 @@ UINT8 dragon_alpha_state::modem_r(offs_t offset) // modem_w //------------------------------------------------- -void dragon_alpha_state::modem_w(offs_t offset, UINT8 data) +void dragon_alpha_state::modem_w(offs_t offset, uint8_t data) { } @@ -129,7 +129,7 @@ void dragon_alpha_state::modem_w(offs_t offset, UINT8 data) READ8_MEMBER( dragon_alpha_state::ff20_read ) { - UINT8 result = 0x00; + uint8_t result = 0x00; switch(offset & 0x0f) { @@ -220,7 +220,7 @@ WRITE8_MEMBER( dragon_alpha_state::ff20_write ) WRITE8_MEMBER( dragon_alpha_state::pia2_pa_w ) { - UINT8 ddr = ~m_pia_2->port_b_z_mask(); + uint8_t ddr = ~m_pia_2->port_b_z_mask(); /* If bit 2 of the pia2 ddra is 1 then this pin is an output so use it */ /* to control the paging of the boot and basic roms */ diff --git a/src/mame/machine/dmv_keyb.cpp b/src/mame/machine/dmv_keyb.cpp index 48af0593f83..9d8e58134f0 100644 --- a/src/mame/machine/dmv_keyb.cpp +++ b/src/mame/machine/dmv_keyb.cpp @@ -207,7 +207,7 @@ ioport_constructor dmv_keyboard_device::device_input_ports() const // dmv_keyboard_device - constructor //------------------------------------------------- -dmv_keyboard_device::dmv_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_keyboard_device::dmv_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMV_KEYBOARD, "Decision Mate V Keyboard", tag, owner, clock, "dmv_keyboard", __FILE__) , m_maincpu(*this, "mcu") , m_keyboard(*this, "COL.%u", 0) diff --git a/src/mame/machine/dmv_keyb.h b/src/mame/machine/dmv_keyb.h index e83e6957641..f0a2930210a 100644 --- a/src/mame/machine/dmv_keyb.h +++ b/src/mame/machine/dmv_keyb.h @@ -34,7 +34,7 @@ class dmv_keyboard_device : public device_t { public: // construction/destruction - dmv_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -58,7 +58,7 @@ private: required_device m_maincpu; required_ioport_array<16> m_keyboard; - UINT8 m_col; + uint8_t m_col; int m_sd_data_state; int m_sd_poll_state; }; diff --git a/src/mame/machine/docastle.cpp b/src/mame/machine/docastle.cpp index d4bc39159a6..3d34c7f1668 100644 --- a/src/mame/machine/docastle.cpp +++ b/src/mame/machine/docastle.cpp @@ -36,7 +36,7 @@ if it was a small shared buffer. The order of operations is: READ8_MEMBER(docastle_state::docastle_shared0_r) { if (offset == 8 && LOG) - logerror("CPU #0 shared0r clock = %d\n", (UINT32)m_maincpu->total_cycles()); + logerror("CPU #0 shared0r clock = %d\n", (uint32_t)m_maincpu->total_cycles()); return m_buffer0[offset]; } @@ -45,7 +45,7 @@ READ8_MEMBER(docastle_state::docastle_shared0_r) READ8_MEMBER(docastle_state::docastle_shared1_r) { if (offset == 8 && LOG) - logerror("CPU #1 shared1r clock = %d\n", (UINT32)m_slave->total_cycles()); + logerror("CPU #1 shared1r clock = %d\n", (uint32_t)m_slave->total_cycles()); return m_buffer1[offset]; } @@ -57,7 +57,7 @@ WRITE8_MEMBER(docastle_state::docastle_shared0_w) logerror("CPU #1 shared0w %02x %02x %02x %02x %02x %02x %02x %02x %02x clock = %d\n", m_buffer0[0], m_buffer0[1], m_buffer0[2], m_buffer0[3], m_buffer0[4], m_buffer0[5], m_buffer0[6], m_buffer0[7], - data, (UINT32)m_slave->total_cycles()); + data, (uint32_t)m_slave->total_cycles()); m_buffer0[offset] = data; @@ -75,7 +75,7 @@ WRITE8_MEMBER(docastle_state::docastle_shared1_w) logerror("CPU #0 shared1w %02x %02x %02x %02x %02x %02x %02x %02x %02x clock = %d\n", m_buffer1[0], m_buffer1[1], m_buffer1[2], m_buffer1[3], m_buffer1[4], m_buffer1[5], m_buffer1[6], m_buffer1[7], - data, (UINT32)m_maincpu->total_cycles()); + data, (uint32_t)m_maincpu->total_cycles()); /* freeze execution of the master CPU until the slave has used the shared memory */ if (offset == 8) diff --git a/src/mame/machine/docg3.cpp b/src/mame/machine/docg3.cpp index 1d6fee6c0c6..4ab93b55ea0 100644 --- a/src/mame/machine/docg3.cpp +++ b/src/mame/machine/docg3.cpp @@ -38,33 +38,33 @@ const device_type DISKONCHIP_G3 = &device_creator; // diskonchip_g3_device - constructor //------------------------------------------------- -diskonchip_g3_device::diskonchip_g3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +diskonchip_g3_device::diskonchip_g3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DISKONCHIP_G3, "DiskOnChip G3", tag, owner, clock, "diskonchip_g3", __FILE__), device_nvram_interface(mconfig, *this) { } -UINT32 diskonchip_g3_device::g3_offset_data_1() +uint32_t diskonchip_g3_device::g3_offset_data_1() { // printf( "block %d pages %d page %d planes %d plane %d user_data_size %d extra_area_size %d\n", doc->block, doc->pages, doc->page, doc->planes, doc->plane, doc->user_data_size, doc->extra_area_size); return ((((m_block * m_pages) + m_page) * m_planes) + m_plane) * (m_user_data_size + m_extra_area_size); } -UINT32 diskonchip_g3_device::g3_offset_data_2() +uint32_t diskonchip_g3_device::g3_offset_data_2() { return ((((m_block * m_pages) + m_page) * m_planes) + m_plane) * 16; } -UINT32 diskonchip_g3_device::g3_offset_data_3() +uint32_t diskonchip_g3_device::g3_offset_data_3() { return m_block * 8; } -UINT8 diskonchip_g3_device::g3_read_data() +uint8_t diskonchip_g3_device::g3_read_data() { - UINT8 data = 0; - UINT32 offset; + uint8_t data = 0; + uint32_t offset; if (m_test == 0) { // read page data (512 + 16) @@ -105,7 +105,7 @@ UINT8 diskonchip_g3_device::g3_read_data() READ16_MEMBER( diskonchip_g3_device::sec_1_r ) { - UINT16 data; + uint16_t data; if (m_sec_2[0x1B] & 0x40) { data = g3_read_data(); @@ -119,9 +119,9 @@ READ16_MEMBER( diskonchip_g3_device::sec_1_r ) return data; } -void diskonchip_g3_device::g3_write_data(UINT8 data) +void diskonchip_g3_device::g3_write_data(uint8_t data) { - UINT32 offset; + uint32_t offset; if (m_test == 3) { // read page data (512 + 16) @@ -132,7 +132,7 @@ void diskonchip_g3_device::g3_write_data(UINT8 data) } if (m_transfer_offset == 0) { - const UINT8 xxx[] = { 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + const uint8_t xxx[] = { 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; offset = g3_offset_data_2(); memcpy( m_data[1].get() + offset, xxx, 16); } @@ -169,7 +169,7 @@ WRITE16_MEMBER( diskonchip_g3_device::sec_1_w ) // #define DoC_G3_FlashCtrl 0x1038 // #define DoC_G3_Nop 0x103e -UINT16 diskonchip_g3_device::sec_2_read_1000() +uint16_t diskonchip_g3_device::sec_2_read_1000() { if (m_device == 0) { @@ -181,7 +181,7 @@ UINT16 diskonchip_g3_device::sec_2_read_1000() } } -UINT16 diskonchip_g3_device::sec_2_read_1074() +uint16_t diskonchip_g3_device::sec_2_read_1074() { if (m_device == 0) { @@ -193,16 +193,16 @@ UINT16 diskonchip_g3_device::sec_2_read_1074() } } -UINT8 diskonchip_g3_device::sec_2_read_1042() +uint8_t diskonchip_g3_device::sec_2_read_1042() { - UINT8 data; + uint8_t data; if ((m_block == 0) && (m_page == 0) && (m_transfersize == 0x27)) { data = 0x07; } else { - UINT32 offset = g3_offset_data_2() + 0x02; + uint32_t offset = g3_offset_data_2() + 0x02; data = m_data[1][offset]; //0x07; //data & ~(1 << 7); if ((m_sec_2[0x41] & 0x10) == 0) { @@ -220,11 +220,11 @@ UINT8 diskonchip_g3_device::sec_2_read_1042() return data; } -UINT8 diskonchip_g3_device::sec_2_read_1046() +uint8_t diskonchip_g3_device::sec_2_read_1046() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x06; + uint32_t offset = g3_offset_data_2() + 0x06; return m_data[1][offset]; } else @@ -233,11 +233,11 @@ UINT8 diskonchip_g3_device::sec_2_read_1046() } } -UINT8 diskonchip_g3_device::sec_2_read_1048() +uint8_t diskonchip_g3_device::sec_2_read_1048() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x08; + uint32_t offset = g3_offset_data_2() + 0x08; return m_data[1][offset]; } else @@ -246,11 +246,11 @@ UINT8 diskonchip_g3_device::sec_2_read_1048() } } -UINT8 diskonchip_g3_device::sec_2_read_1049() +uint8_t diskonchip_g3_device::sec_2_read_1049() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x09; + uint32_t offset = g3_offset_data_2() + 0x09; return m_data[1][offset]; } else @@ -259,11 +259,11 @@ UINT8 diskonchip_g3_device::sec_2_read_1049() } } -UINT8 diskonchip_g3_device::sec_2_read_104A() +uint8_t diskonchip_g3_device::sec_2_read_104A() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x0A; + uint32_t offset = g3_offset_data_2() + 0x0A; return m_data[1][offset]; } else @@ -272,11 +272,11 @@ UINT8 diskonchip_g3_device::sec_2_read_104A() } } -UINT8 diskonchip_g3_device::sec_2_read_104B() +uint8_t diskonchip_g3_device::sec_2_read_104B() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x0B; + uint32_t offset = g3_offset_data_2() + 0x0B; return m_data[1][offset]; } else @@ -285,11 +285,11 @@ UINT8 diskonchip_g3_device::sec_2_read_104B() } } -UINT8 diskonchip_g3_device::sec_2_read_104C() +uint8_t diskonchip_g3_device::sec_2_read_104C() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x0C; + uint32_t offset = g3_offset_data_2() + 0x0C; return m_data[1][offset]; } else @@ -298,11 +298,11 @@ UINT8 diskonchip_g3_device::sec_2_read_104C() } } -UINT8 diskonchip_g3_device::sec_2_read_104D() +uint8_t diskonchip_g3_device::sec_2_read_104D() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x0D; + uint32_t offset = g3_offset_data_2() + 0x0D; return m_data[1][offset]; } else @@ -311,11 +311,11 @@ UINT8 diskonchip_g3_device::sec_2_read_104D() } } -UINT8 diskonchip_g3_device::sec_2_read_104E() +uint8_t diskonchip_g3_device::sec_2_read_104E() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x0E; + uint32_t offset = g3_offset_data_2() + 0x0E; return m_data[1][offset]; } else @@ -324,11 +324,11 @@ UINT8 diskonchip_g3_device::sec_2_read_104E() } } -UINT8 diskonchip_g3_device::sec_2_read_104F() +uint8_t diskonchip_g3_device::sec_2_read_104F() { if (m_test == 0) { - UINT32 offset = g3_offset_data_2() + 0x0F; + uint32_t offset = g3_offset_data_2() + 0x0F; return m_data[1][offset]; } else @@ -337,22 +337,22 @@ UINT8 diskonchip_g3_device::sec_2_read_104F() } } -UINT8 diskonchip_g3_device::sec_2_read_100E() +uint8_t diskonchip_g3_device::sec_2_read_100E() { return 0x81; } -UINT8 diskonchip_g3_device::sec_2_read_1014() +uint8_t diskonchip_g3_device::sec_2_read_1014() { return 0x01; } -UINT8 diskonchip_g3_device::sec_2_read_1022() +uint8_t diskonchip_g3_device::sec_2_read_1022() { return 0x85; } -UINT8 diskonchip_g3_device::sec_2_read_1038() +uint8_t diskonchip_g3_device::sec_2_read_1038() { // bit 0 = ? // bit 1 = ? error 0x7C @@ -372,9 +372,9 @@ UINT8 diskonchip_g3_device::sec_2_read_1038() } } -UINT16 diskonchip_g3_device::sec_2_read16(UINT32 offset) +uint16_t diskonchip_g3_device::sec_2_read16(uint32_t offset) { - UINT16 data = (m_sec_2[offset+0] << 0) + (m_sec_2[offset+1] << 8); + uint16_t data = (m_sec_2[offset+0] << 0) + (m_sec_2[offset+1] << 8); switch (0x1000 + offset) { // ? @@ -403,9 +403,9 @@ UINT16 diskonchip_g3_device::sec_2_read16(UINT32 offset) return data; } -UINT8 diskonchip_g3_device::sec_2_read8(UINT32 offset) +uint8_t diskonchip_g3_device::sec_2_read8(uint32_t offset) { - UINT8 data = m_sec_2[offset]; + uint8_t data = m_sec_2[offset]; switch (0x1000 + offset) { // ? @@ -434,10 +434,10 @@ UINT8 diskonchip_g3_device::sec_2_read8(UINT32 offset) return data; } -void diskonchip_g3_device::sec_2_write_100C(UINT8 data) +void diskonchip_g3_device::sec_2_write_100C(uint8_t data) { const char *mode_name[] = { "reset", "normal", "deep power down" }; - UINT32 mode = data & 3; + uint32_t mode = data & 3; verboselog(*this, 5, "mode %d (%s)\n", mode, mode_name[mode]); if (mode == 0) { @@ -445,7 +445,7 @@ void diskonchip_g3_device::sec_2_write_100C(UINT8 data) } } -void diskonchip_g3_device::sec_2_write_1032(UINT8 data) +void diskonchip_g3_device::sec_2_write_1032(uint8_t data) { verboselog(*this, 5, "flash select %02X\n", data); if ((data == 0x12) || (data == 0x27)) @@ -459,9 +459,9 @@ void diskonchip_g3_device::sec_2_write_1032(UINT8 data) void diskonchip_g3_device::g3_erase_block() { - UINT32 offset; + uint32_t offset; int i, j; - const UINT8 xxx[] = { 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0xCE, 0x00, 0xCF, 0x72, 0xFC, 0x1B, 0xA9, 0xC7, 0xB9, 0x00 }; + const uint8_t xxx[] = { 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0xCE, 0x00, 0xCF, 0x72, 0xFC, 0x1B, 0xA9, 0xC7, 0xB9, 0x00 }; verboselog(*this, 5, "erase block %04X\n", m_block); for (i=0;i> 7); if (block >= m_blocks) fatalerror( "DOCG3: invalid block (%d)\n", block); plane = (m_data_1036 >> 6) & 1; @@ -616,7 +616,7 @@ void diskonchip_g3_device::sec_2_write_1036(UINT8 data) m_data_1036 |= data << (8 * m_data_1036_count++); if (m_data_1036_count == 4) { - UINT32 block, page, plane, unk; + uint32_t block, page, plane, unk; block = (m_data_1036 >> 15); plane = (m_data_1036 >> 14) & 1; page = (m_data_1036 >> 8) & 0x3F; @@ -638,19 +638,19 @@ void diskonchip_g3_device::sec_2_write_1036(UINT8 data) } } -void diskonchip_g3_device::sec_2_write_1040(UINT16 data) +void diskonchip_g3_device::sec_2_write_1040(uint16_t data) { m_transfersize = (data & 0x3FF); verboselog(*this, 5, "flash transfer size %04X\n", m_transfersize); } -void diskonchip_g3_device::sec_2_write_100A(UINT8 data) +void diskonchip_g3_device::sec_2_write_100A(uint8_t data) { m_device = data & 3; verboselog(*this, 5, "select device %d\n", m_device); } -void diskonchip_g3_device::sec_2_write16(UINT32 offset, UINT16 data) +void diskonchip_g3_device::sec_2_write16(uint32_t offset, uint16_t data) { m_sec_2[offset+0] = (data >> 0) & 0xFF; m_sec_2[offset+1] = (data >> 8) & 0xFF; @@ -672,7 +672,7 @@ void diskonchip_g3_device::sec_2_write16(UINT32 offset, UINT16 data) } } -void diskonchip_g3_device::sec_2_write8(UINT32 offset, UINT8 data) +void diskonchip_g3_device::sec_2_write8(uint32_t offset, uint8_t data) { m_sec_2[offset] = data; verboselog(*this, 9, "(DOC) %08X <- %02X\n", 0x1000 + offset, data); @@ -734,7 +734,7 @@ WRITE16_MEMBER( diskonchip_g3_device::sec_2_w ) READ16_MEMBER( diskonchip_g3_device::sec_3_r ) { - UINT16 data = 0; + uint16_t data = 0; verboselog(*this, 9, "(DOC) %08X -> %04X\n", 0x1800 + (offset << 1), data); return data; } @@ -777,12 +777,12 @@ void diskonchip_g3_device::device_start() memset(m_sec_2, 0, sizeof(m_sec_2)); - m_data[0] = std::make_unique(m_data_size[0]); - memset(m_data[0].get(), 0, sizeof(UINT8) * m_data_size[0]); - m_data[1] = std::make_unique(m_data_size[1]); - memset(m_data[1].get(), 0, sizeof(UINT8) * m_data_size[1]); - m_data[2] = std::make_unique(m_data_size[2]); - memset(m_data[2].get(), 0, sizeof(UINT8) * m_data_size[2]); + m_data[0] = std::make_unique(m_data_size[0]); + memset(m_data[0].get(), 0, sizeof(uint8_t) * m_data_size[0]); + m_data[1] = std::make_unique(m_data_size[1]); + memset(m_data[1].get(), 0, sizeof(uint8_t) * m_data_size[1]); + m_data[2] = std::make_unique(m_data_size[2]); + memset(m_data[2].get(), 0, sizeof(uint8_t) * m_data_size[2]); // diskonchip_load( device, "diskonchip"); diff --git a/src/mame/machine/docg3.h b/src/mame/machine/docg3.h index 36423f12641..76346933d1e 100644 --- a/src/mame/machine/docg3.h +++ b/src/mame/machine/docg3.h @@ -22,7 +22,7 @@ class diskonchip_g3_device : public device_t, { public: // construction/destruction - diskonchip_g3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + diskonchip_g3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_size(int _size) { m_size = _size; } protected: @@ -42,59 +42,59 @@ public: DECLARE_READ16_MEMBER( sec_3_r ); DECLARE_WRITE16_MEMBER( sec_3_w ); private: - UINT32 g3_offset_data_1(); - UINT32 g3_offset_data_2(); - UINT32 g3_offset_data_3(); - UINT8 g3_read_data(); - void g3_write_data(UINT8 data); - UINT16 sec_2_read_1000(); - UINT16 sec_2_read_1074(); - UINT8 sec_2_read_1042(); - UINT8 sec_2_read_1046(); - UINT8 sec_2_read_1048(); - UINT8 sec_2_read_1049(); - UINT8 sec_2_read_104A(); - UINT8 sec_2_read_104B(); - UINT8 sec_2_read_104C(); - UINT8 sec_2_read_104D(); - UINT8 sec_2_read_104E(); - UINT8 sec_2_read_104F(); - UINT8 sec_2_read_100E(); - UINT8 sec_2_read_1014(); - UINT8 sec_2_read_1022(); - UINT8 sec_2_read_1038(); - UINT16 sec_2_read16(UINT32 offset); - UINT8 sec_2_read8(UINT32 offset); - void sec_2_write_100C(UINT8 data); - void sec_2_write_1032(UINT8 data); + uint32_t g3_offset_data_1(); + uint32_t g3_offset_data_2(); + uint32_t g3_offset_data_3(); + uint8_t g3_read_data(); + void g3_write_data(uint8_t data); + uint16_t sec_2_read_1000(); + uint16_t sec_2_read_1074(); + uint8_t sec_2_read_1042(); + uint8_t sec_2_read_1046(); + uint8_t sec_2_read_1048(); + uint8_t sec_2_read_1049(); + uint8_t sec_2_read_104A(); + uint8_t sec_2_read_104B(); + uint8_t sec_2_read_104C(); + uint8_t sec_2_read_104D(); + uint8_t sec_2_read_104E(); + uint8_t sec_2_read_104F(); + uint8_t sec_2_read_100E(); + uint8_t sec_2_read_1014(); + uint8_t sec_2_read_1022(); + uint8_t sec_2_read_1038(); + uint16_t sec_2_read16(uint32_t offset); + uint8_t sec_2_read8(uint32_t offset); + void sec_2_write_100C(uint8_t data); + void sec_2_write_1032(uint8_t data); void g3_erase_block(); - void sec_2_write_1034(UINT8 data); - void sec_2_write_1036(UINT8 data); - void sec_2_write_1040(UINT16 data); - void sec_2_write_100A(UINT8 data); - void sec_2_write16(UINT32 offset, UINT16 data); - void sec_2_write8(UINT32 offset, UINT8 data); + void sec_2_write_1034(uint8_t data); + void sec_2_write_1036(uint8_t data); + void sec_2_write_1040(uint16_t data); + void sec_2_write_100A(uint8_t data); + void sec_2_write16(uint32_t offset, uint16_t data); + void sec_2_write8(uint32_t offset, uint8_t data); int m_size; - UINT32 m_planes; - UINT32 m_blocks; - UINT32 m_pages; - UINT32 m_user_data_size; - UINT32 m_extra_area_size; - std::unique_ptr m_data[3]; - UINT32 m_data_size[3]; - UINT8 m_sec_2[0x800]; - UINT32 m_data_1036; - UINT32 m_data_1036_count; - UINT32 m_transfer_offset; - UINT8 m_device; - UINT32 m_block; - UINT32 m_page; - UINT32 m_plane; - UINT32 m_transfersize; - UINT8 m_test; - UINT32 m_address_count; + uint32_t m_planes; + uint32_t m_blocks; + uint32_t m_pages; + uint32_t m_user_data_size; + uint32_t m_extra_area_size; + std::unique_ptr m_data[3]; + uint32_t m_data_size[3]; + uint8_t m_sec_2[0x800]; + uint32_t m_data_1036; + uint32_t m_data_1036_count; + uint32_t m_transfer_offset; + uint8_t m_device; + uint32_t m_block; + uint32_t m_page; + uint32_t m_plane; + uint32_t m_transfersize; + uint8_t m_test; + uint32_t m_address_count; }; // device type definition diff --git a/src/mame/machine/dragon.cpp b/src/mame/machine/dragon.cpp index 12c902d5c93..0e5f9cb553e 100644 --- a/src/mame/machine/dragon.cpp +++ b/src/mame/machine/dragon.cpp @@ -48,7 +48,7 @@ easier to manage. // pia1_pa_changed - called when PIA1 PA changes //------------------------------------------------- -void dragon_state::pia1_pa_changed(UINT8 data) +void dragon_state::pia1_pa_changed(uint8_t data) { /* call inherited function */ coco12_state::pia1_pa_changed(data); @@ -56,7 +56,7 @@ void dragon_state::pia1_pa_changed(UINT8 data) /* if strobe bit is high send data from pia0 port b to dragon parallel printer */ if (data & 0x02) { - UINT8 output = m_pia_1->b_output(); + uint8_t output = m_pia_1->b_output(); m_printer->output(output); } } @@ -72,7 +72,7 @@ void dragon_state::pia1_pa_changed(UINT8 data) READ8_MEMBER( dragon64_state::ff00_read ) { - UINT8 result = 0x00; + uint8_t result = 0x00; switch(offset & 0x07) { @@ -113,11 +113,11 @@ WRITE8_MEMBER( dragon64_state::ff00_write ) // pia1_pb_changed //------------------------------------------------- -void dragon64_state::pia1_pb_changed(UINT8 data) +void dragon64_state::pia1_pb_changed(uint8_t data) { dragon_state::pia1_pb_changed(data); - UINT8 ddr = ~m_pia_1->port_b_z_mask(); + uint8_t ddr = ~m_pia_1->port_b_z_mask(); /* If bit 2 of the pia1 ddrb is 1 then this pin is an output so use it */ /* to control the paging of the 32k and 64k basic roms */ diff --git a/src/mame/machine/egret.cpp b/src/mame/machine/egret.cpp index 9a211847e52..1aee97637e2 100644 --- a/src/mame/machine/egret.cpp +++ b/src/mame/machine/egret.cpp @@ -107,7 +107,7 @@ const tiny_rom_entry *egret_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -void egret_device::send_port(address_space &space, UINT8 offset, UINT8 data) +void egret_device::send_port(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -208,7 +208,7 @@ WRITE8_MEMBER( egret_device::ddr_w ) READ8_MEMBER( egret_device::ports_r ) { - UINT8 incoming = 0; + uint8_t incoming = 0; switch (offset) { @@ -333,7 +333,7 @@ WRITE8_MEMBER( egret_device::pram_w ) // egret_device - constructor //------------------------------------------------- -egret_device::egret_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +egret_device::egret_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EGRET, "Apple Egret", tag, owner, clock, "egret", __FILE__), device_nvram_interface(mconfig, *this), write_reset(*this), @@ -389,7 +389,7 @@ void egret_device::device_start() save_item(NAME(pram)); save_item(NAME(disk_pram)); - UINT8 *rom = device().machine().root_device().memregion(device().subtag(EGRET_CPU_TAG).c_str())->base(); + uint8_t *rom = device().machine().root_device().memregion(device().subtag(EGRET_CPU_TAG).c_str())->base(); if (rom) { diff --git a/src/mame/machine/egret.h b/src/mame/machine/egret.h index 75f8e1888ed..8ab3b085cd7 100644 --- a/src/mame/machine/egret.h +++ b/src/mame/machine/egret.h @@ -59,7 +59,7 @@ class egret_device : public device_t, public device_nvram_interface { public: // construction/destruction - egret_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + egret_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_type(device_t &device, int type); @@ -85,12 +85,12 @@ public: DECLARE_WRITE8_MEMBER( pram_w ); // interface routines - UINT8 get_xcvr_session() { return xcvr_session; } - void set_via_full(UINT8 val) { via_full = val; } - void set_sys_session(UINT8 val) { sys_session = val; } - UINT8 get_via_data() { return via_data; } - void set_via_data(UINT8 dat) { via_data = dat; } - UINT8 get_via_clock() { return via_clock; } + uint8_t get_xcvr_session() { return xcvr_session; } + void set_via_full(uint8_t val) { via_full = val; } + void set_sys_session(uint8_t val) { sys_session = val; } + uint8_t get_via_data() { return via_data; } + void set_via_data(uint8_t dat) { via_data = dat; } + uint8_t get_via_clock() { return via_clock; } void set_adb_line(int linestate) { adb_in = (linestate == ASSERT_LINE) ? true : false; } int get_adb_dtime() { return m_adb_dtime; } @@ -115,23 +115,23 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 ddrs[3]; - UINT8 ports[3]; - UINT8 pll_ctrl; - UINT8 timer_ctrl; - UINT8 timer_counter; - UINT8 onesec; - UINT8 xcvr_session, via_full, sys_session, via_data, via_clock, last_adb; - UINT64 last_adb_time; + uint8_t ddrs[3]; + uint8_t ports[3]; + uint8_t pll_ctrl; + uint8_t timer_ctrl; + uint8_t timer_counter; + uint8_t onesec; + uint8_t xcvr_session, via_full, sys_session, via_data, via_clock, last_adb; + uint64_t last_adb_time; bool egret_controls_power; bool adb_in; int reset_line; int m_adb_dtime; emu_timer *m_timer; - UINT8 pram[0x100], disk_pram[0x100]; + uint8_t pram[0x100], disk_pram[0x100]; bool pram_loaded; - void send_port(address_space &space, UINT8 offset, UINT8 data); + void send_port(address_space &space, uint8_t offset, uint8_t data); }; // device type definition diff --git a/src/mame/machine/einstein.cpp b/src/mame/machine/einstein.cpp index a2582ee93e3..0a9035df945 100644 --- a/src/mame/machine/einstein.cpp +++ b/src/mame/machine/einstein.cpp @@ -26,7 +26,7 @@ const device_type EINSTEIN_KEYBOARD_DAISY = &device_creatorbase())[0x43E00 + offset]; + uint8_t data = ((uint8_t *)memregion("user1")->base())[0x43E00 + offset]; switch ( offset & 0x0f ) { case 0x00: /* Interrupt status */ @@ -212,7 +212,7 @@ READ8_MEMBER(electron_state::electron_sheila_r) } static const int electron_palette_offset[4] = { 0, 4, 5, 1 }; -static const UINT16 electron_screen_base[8] = { 0x3000, 0x3000, 0x3000, 0x4000, 0x5800, 0x5800, 0x6000, 0x5800 }; +static const uint16_t electron_screen_base[8] = { 0x3000, 0x3000, 0x3000, 0x4000, 0x5800, 0x5800, 0x6000, 0x5800 }; WRITE8_MEMBER(electron_state::electron_sheila_w) { @@ -307,7 +307,7 @@ WRITE8_MEMBER(electron_state::electron_sheila_w) m_ula.screen_mode = ( data >> 3 ) & 0x07; m_ula.screen_base = electron_screen_base[ m_ula.screen_mode ]; m_ula.screen_size = 0x8000 - m_ula.screen_base; - m_ula.vram = (UINT8 *)m_ram->pointer() + m_ula.screen_base; + m_ula.vram = (uint8_t *)m_ram->pointer() + m_ula.screen_base; logerror( "ULA: screen mode set to %d\n", m_ula.screen_mode ); m_ula.cassette_motor_mode = ( data >> 6 ) & 0x01; m_cassette->change_state(m_ula.cassette_motor_mode ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MOTOR_DISABLED ); @@ -375,12 +375,12 @@ void electron_state::machine_reset() m_ula.screen_size = 0x8000 - 0x3000; m_ula.screen_addr = 0; m_ula.tape_running = 0; - m_ula.vram = (UINT8 *)m_ram->pointer() + m_ula.screen_base; + m_ula.vram = (uint8_t *)m_ram->pointer() + m_ula.screen_base; } void electron_state::machine_start() { - UINT8 *lo_rom, *up_rom; + uint8_t *lo_rom, *up_rom; std::string region_tag; memory_region *cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); @@ -409,7 +409,7 @@ DEVICE_IMAGE_LOAD_MEMBER( electron_state, electron_cart ) { if (image.software_entry() == nullptr) { - UINT32 filesize = image.length(); + uint32_t filesize = image.length(); if (filesize != 16384) { diff --git a/src/mame/machine/esqlcd.cpp b/src/mame/machine/esqlcd.cpp index f98d70f9b12..f03cb36d2fb 100644 --- a/src/mame/machine/esqlcd.cpp +++ b/src/mame/machine/esqlcd.cpp @@ -341,7 +341,7 @@ void esq2x16_sq1_t::write_char(int data) #endif } //-------------------------------------------------------------------------------------------------------------------------------------------- -esq2x16_sq1_t::esq2x16_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : esqvfd_t(mconfig, ESQ2x16_SQ1, "Ensoniq 2x16 VFD (SQ-1 variant)", tag, owner, clock, "esq2x16_sq1", __FILE__) +esq2x16_sq1_t::esq2x16_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : esqvfd_t(mconfig, ESQ2x16_SQ1, "Ensoniq 2x16 VFD (SQ-1 variant)", tag, owner, clock, "esq2x16_sq1", __FILE__) { m_rows = 2; m_cols = 16; @@ -393,7 +393,7 @@ void esq2x16_sq1_t::page_reset() m_lcdPos = m_LcdCommand = 0; } //-------------------------------------------------------------------------------------------------------------------------------------------- -char esq2x16_sq1_t::RotateLcdChar(UINT8 lcdChar, int charRow) +char esq2x16_sq1_t::RotateLcdChar(uint8_t lcdChar, int charRow) { char lcdCharRow = 0; for (int cc=0; cc<5; cc++){ diff --git a/src/mame/machine/esqlcd.h b/src/mame/machine/esqlcd.h index 0fa306f5161..eb5aaaa648c 100644 --- a/src/mame/machine/esqlcd.h +++ b/src/mame/machine/esqlcd.h @@ -17,7 +17,7 @@ class esq2x16_sq1_t : public esqvfd_t { public: - esq2x16_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esq2x16_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_char(int data) override; virtual void update_display() override; @@ -26,15 +26,15 @@ public: void lcd_reset(); void page_reset(); - char RotateLcdChar(UINT8 lcdChar, int charRow); + char RotateLcdChar(uint8_t lcdChar, int charRow); protected: virtual machine_config_constructor device_mconfig_additions() const override; - UINT8 m_lcdpg[4][32]; + uint8_t m_lcdpg[4][32]; int m_lcdPage; int m_lcdPos,m_lcdSavedPos; - UINT8 m_leds[16]; - UINT8 m_ledsDirty[16]; + uint8_t m_leds[16]; + uint8_t m_ledsDirty[16]; private: int m_LcdCommand; diff --git a/src/mame/machine/esqpanel.cpp b/src/mame/machine/esqpanel.cpp index 4c084a6d5c5..741e8e71003 100644 --- a/src/mame/machine/esqpanel.cpp +++ b/src/mame/machine/esqpanel.cpp @@ -26,7 +26,7 @@ const device_type ESQPANEL2x16_SQ1 = &device_creator; // esqpanel_device - constructor //------------------------------------------------- -esqpanel_device::esqpanel_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) : +esqpanel_device::esqpanel_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_serial_interface(mconfig, *this), m_write_tx(*this), @@ -71,7 +71,7 @@ void esqpanel_device::device_timer(emu_timer &timer, device_timer_id id, int par void esqpanel_device::rcv_complete() // Rx completed receiving byte { receive_register_extract(); - UINT8 data = get_received_char(); + uint8_t data = get_received_char(); // if (data >= 0xe0) printf("Got %02x from motherboard (second %s)\n", data, m_bCalibSecondByte ? "yes" : "no"); @@ -172,7 +172,7 @@ void esqpanel_device::tra_callback() // Tx send bit m_write_tx(transmit_register_get_data_bit()); } -void esqpanel_device::xmit_char(UINT8 data) +void esqpanel_device::xmit_char(uint8_t data) { // printf("Panel: xmit %02x\n", data); @@ -193,7 +193,7 @@ void esqpanel_device::xmit_char(UINT8 data) } } -void esqpanel_device::set_analog_value(offs_t offset, UINT16 value) +void esqpanel_device::set_analog_value(offs_t offset, uint16_t value) { m_write_analog(offset, value); } @@ -209,7 +209,7 @@ machine_config_constructor esqpanel1x22_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( esqpanel1x22 ); } -esqpanel1x22_device::esqpanel1x22_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +esqpanel1x22_device::esqpanel1x22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : esqpanel_device(mconfig, ESQPANEL1x22, "Ensoniq front panel with 1x22 VFD", tag, owner, clock, "esqpanel122", __FILE__), m_vfd(*this, "vfd") { @@ -227,7 +227,7 @@ machine_config_constructor esqpanel2x40_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( esqpanel2x40 ); } -esqpanel2x40_device::esqpanel2x40_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +esqpanel2x40_device::esqpanel2x40_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : esqpanel_device(mconfig, ESQPANEL2x40, "Ensoniq front panel with 2x40 VFD", tag, owner, clock, "esqpanel240", __FILE__), m_vfd(*this, "vfd") { @@ -244,7 +244,7 @@ machine_config_constructor esqpanel2x16_sq1_device::device_mconfig_additions() c return MACHINE_CONFIG_NAME( esqpanel2x16_sq1 ); } // --- SQ1 - Parduz -------------------------------------------------------------------------------------------------------------------------- -esqpanel2x16_sq1_device::esqpanel2x16_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +esqpanel2x16_sq1_device::esqpanel2x16_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : esqpanel_device(mconfig, ESQPANEL2x16_SQ1, "Ensoniq front panel with 2x16 LCD", tag, owner, clock, "esqpanel216_sq1", __FILE__), m_vfd(*this, "vfd") { diff --git a/src/mame/machine/esqpanel.h b/src/mame/machine/esqpanel.h index 46f9f07ec03..64b8ee67b40 100644 --- a/src/mame/machine/esqpanel.h +++ b/src/mame/machine/esqpanel.h @@ -56,15 +56,15 @@ class esqpanel_device : public device_t, public device_serial_interface { public: // construction/destruction - esqpanel_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); + esqpanel_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); template static devcb_base &set_tx_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_tx.set_callback(object); } template static devcb_base &set_analog_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_analog.set_callback(object); } - virtual void send_to_display(UINT8 data) = 0; + virtual void send_to_display(uint8_t data) = 0; - void xmit_char(UINT8 data); - void set_analog_value(offs_t offset, UINT16 value); + void xmit_char(uint8_t data); + void set_analog_value(offs_t offset, uint16_t value); protected: // device-level overrides @@ -87,18 +87,18 @@ private: devcb_write_line m_write_tx; devcb_write16 m_write_analog; - UINT8 m_xmitring[XMIT_RING_SIZE]; + uint8_t m_xmitring[XMIT_RING_SIZE]; int m_xmit_read, m_xmit_write; bool m_tx_busy; }; class esqpanel1x22_device : public esqpanel_device { public: - esqpanel1x22_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esqpanel1x22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_vfd; - virtual void send_to_display(UINT8 data) override { m_vfd->write_char(data); } + virtual void send_to_display(uint8_t data) override { m_vfd->write_char(data); } protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -108,11 +108,11 @@ private: class esqpanel2x40_device : public esqpanel_device { public: - esqpanel2x40_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esqpanel2x40_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_vfd; - virtual void send_to_display(UINT8 data) override { m_vfd->write_char(data); } + virtual void send_to_display(uint8_t data) override { m_vfd->write_char(data); } protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -122,11 +122,11 @@ private: class esqpanel2x40_sq1_device : public esqpanel_device { public: - esqpanel2x40_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esqpanel2x40_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_vfd; - virtual void send_to_display(UINT8 data) override { m_vfd->write_char(data); } + virtual void send_to_display(uint8_t data) override { m_vfd->write_char(data); } protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -137,11 +137,11 @@ private: // --- SQ1 - Parduz -------------------------------------------------------------------------------------------------------------------------- class esqpanel2x16_sq1_device : public esqpanel_device { public: - esqpanel2x16_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esqpanel2x16_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_vfd; - virtual void send_to_display(UINT8 data) override { m_vfd->write_char(data); } + virtual void send_to_display(uint8_t data) override { m_vfd->write_char(data); } protected: virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/mame/machine/esqvfd.cpp b/src/mame/machine/esqvfd.cpp index a4acad6deaf..3c879a4451e 100644 --- a/src/mame/machine/esqvfd.cpp +++ b/src/mame/machine/esqvfd.cpp @@ -14,7 +14,7 @@ const device_type ESQ2x40 = &device_creator; const device_type ESQ2x40_SQ1 = &device_creator; // adapted from bfm_bd1, rearranged to work with ASCII data used by the Ensoniq h/w -static const UINT16 font[]= +static const uint16_t font[]= { // FEDC BA98 7654 3210 0x0000, // 0000 0000 0000 0000 (space) 0x0000, // 0000 0000 0000 0000 ! (not defined) @@ -114,7 +114,7 @@ static const UINT16 font[]= 0x0000, // 0000 0000 0000 0000 (DEL) }; -esqvfd_t::esqvfd_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +esqvfd_t::esqvfd_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -139,9 +139,9 @@ void esqvfd_t::device_timer(emu_timer &timer, device_timer_id id, int param, voi } // why isn't the font just stored in this order? -UINT32 esqvfd_t::conv_segments(UINT16 segin) +uint32_t esqvfd_t::conv_segments(uint16_t segin) { - UINT32 segout = 0; + uint32_t segout = 0; if ( segin & 0x0004 ) segout |= 0x0001; if ( segin & 0x0002 ) segout |= 0x0002; @@ -171,7 +171,7 @@ void esqvfd_t::update_display() { if (m_dirty[row][col]) { - UINT32 segdata = conv_segments(font[m_chars[row][col]]); + uint32_t segdata = conv_segments(font[m_chars[row][col]]); // force bottom bar on all underlined chars if (m_attrs[row][col] & AT_UNDERLINE) @@ -281,7 +281,7 @@ void esq2x40_t::write_char(int data) update_display(); } -esq2x40_t::esq2x40_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : esqvfd_t(mconfig, ESQ2x40, "Ensoniq 2x40 VFD", tag, owner, clock, "esq2x40", __FILE__) +esq2x40_t::esq2x40_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : esqvfd_t(mconfig, ESQ2x40, "Ensoniq 2x40 VFD", tag, owner, clock, "esq2x40", __FILE__) { m_rows = 2; m_cols = 40; @@ -334,7 +334,7 @@ void esq1x22_t::write_char(int data) update_display(); } -esq1x22_t::esq1x22_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : esqvfd_t(mconfig, ESQ1x22, "Ensoniq 1x22 VFD", tag, owner, clock, "esq1x22", __FILE__) +esq1x22_t::esq1x22_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : esqvfd_t(mconfig, ESQ1x22, "Ensoniq 1x22 VFD", tag, owner, clock, "esq1x22", __FILE__) { m_rows = 1; m_cols = 22; @@ -398,7 +398,7 @@ void esq2x40_sq1_t::write_char(int data) } } -esq2x40_sq1_t::esq2x40_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : esqvfd_t(mconfig, ESQ2x40_SQ1, "Ensoniq 2x40 VFD (SQ-1 variant)", tag, owner, clock, "esq2x40_sq1", __FILE__) +esq2x40_sq1_t::esq2x40_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : esqvfd_t(mconfig, ESQ2x40_SQ1, "Ensoniq 2x40 VFD (SQ-1 variant)", tag, owner, clock, "esq2x40_sq1", __FILE__) { m_rows = 2; m_cols = 40; diff --git a/src/mame/machine/esqvfd.h b/src/mame/machine/esqvfd.h index 174ea5157d7..c4043f35956 100644 --- a/src/mame/machine/esqvfd.h +++ b/src/mame/machine/esqvfd.h @@ -25,21 +25,21 @@ class esqvfd_t : public device_t { public: - esqvfd_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + esqvfd_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); DECLARE_WRITE8_MEMBER( write ) { write_char(data); } virtual void write_char(int data) = 0; virtual void update_display(); - UINT32 conv_segments(UINT16 segin); + uint32_t conv_segments(uint16_t segin); protected: - static const UINT8 AT_NORMAL = 0x00; - static const UINT8 AT_BOLD = 0x01; - static const UINT8 AT_UNDERLINE = 0x02; - static const UINT8 AT_BLINK = 0x04; - static const UINT8 AT_BLINKED = 0x80; // set when character should be blinked off + static const uint8_t AT_NORMAL = 0x00; + static const uint8_t AT_BOLD = 0x01; + static const uint8_t AT_UNDERLINE = 0x02; + static const uint8_t AT_BLINK = 0x04; + static const uint8_t AT_BLINKED = 0x80; // set when character should be blinked off virtual void device_start() override; virtual void device_reset() override; @@ -48,16 +48,16 @@ protected: int m_cursx, m_cursy; int m_savedx, m_savedy; int m_rows, m_cols; - UINT8 m_curattr; - UINT8 m_lastchar; - UINT8 m_chars[2][40]; - UINT8 m_attrs[2][40]; - UINT8 m_dirty[2][40]; + uint8_t m_curattr; + uint8_t m_lastchar; + uint8_t m_chars[2][40]; + uint8_t m_attrs[2][40]; + uint8_t m_dirty[2][40]; }; class esq1x22_t : public esqvfd_t { public: - esq1x22_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esq1x22_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_char(int data) override; @@ -69,7 +69,7 @@ private: class esq2x40_t : public esqvfd_t { public: - esq2x40_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esq2x40_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_char(int data) override; @@ -81,7 +81,7 @@ private: class esq2x40_sq1_t : public esqvfd_t { public: - esq2x40_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esq2x40_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void write_char(int data) override; diff --git a/src/mame/machine/fd1089.cpp b/src/mame/machine/fd1089.cpp index f786bf29c2d..bf12b35cbae 100644 --- a/src/mame/machine/fd1089.cpp +++ b/src/mame/machine/fd1089.cpp @@ -66,7 +66,7 @@ { if ("we must encrypt this data table position") { - UINT8 byteval; + uint8_t byteval; do { @@ -88,7 +88,7 @@ { if ("we mustn't encrypt this data table position") { - UINT8 byteval; + uint8_t byteval; do { @@ -146,7 +146,7 @@ const device_type FD1089A = &device_creator; const device_type FD1089B = &device_creator; // common base lookup table, shared between A and B variants -const UINT8 fd1089_base_device::s_basetable_fd1089[0x100] = +const uint8_t fd1089_base_device::s_basetable_fd1089[0x100] = { 0x00,0x1c,0x76,0x6a,0x5e,0x42,0x24,0x38,0x4b,0x67,0xad,0x81,0xe9,0xc5,0x03,0x2f, 0x45,0x69,0xaf,0x83,0xe7,0xcb,0x01,0x2d,0x02,0x1e,0x78,0x64,0x5c,0x40,0x2a,0x36, @@ -221,7 +221,7 @@ ADDRESS_MAP_END // fd1089_base_device - constructor //------------------------------------------------- -fd1089_base_device::fd1089_base_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) +fd1089_base_device::fd1089_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : m68000_device(mconfig, tag, owner, clock, shortname, source), m_region(*this, DEVICE_SELF), m_key(*this, "key"), @@ -234,12 +234,12 @@ fd1089_base_device::fd1089_base_device(const machine_config &mconfig, device_typ m_address_map[AS_DECRYPTED_OPCODES] = ADDRESS_MAP_NAME(decrypted_opcodes_map); } -fd1089a_device::fd1089a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fd1089a_device::fd1089a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : fd1089_base_device(mconfig, FD1089A, "FD1089A", tag, owner, clock, "fd1089a", __FILE__) { } -fd1089b_device::fd1089b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fd1089b_device::fd1089b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : fd1089_base_device(mconfig, FD1089B, "FD1089B", tag, owner, clock, "fd1089b", __FILE__) { } @@ -254,10 +254,10 @@ void fd1089_base_device::device_start() m68000_device::device_start(); // get a pointer to the ROM region - UINT16 *rombase = reinterpret_cast(m_region->base()); + uint16_t *rombase = reinterpret_cast(m_region->base()); // determine length and resize our internal buffers - UINT32 romsize = m_region->bytes(); + uint32_t romsize = m_region->bytes(); m_plaintext.resize(romsize/2); // copy the plaintext @@ -279,7 +279,7 @@ void fd1089_base_device::device_start() // decode //------------------------------------------------- -UINT8 fd1089_base_device::rearrange_key(UINT8 table, bool opcode) +uint8_t fd1089_base_device::rearrange_key(uint8_t table, bool opcode) { if (!opcode) { @@ -336,13 +336,13 @@ UINT8 fd1089_base_device::rearrange_key(UINT8 table, bool opcode) // according to FD1089A rules //------------------------------------------------- -UINT8 fd1089a_device::decode(UINT8 val, UINT8 key, bool opcode) +uint8_t fd1089a_device::decode(uint8_t val, uint8_t key, bool opcode) { // special case - don't decrypt if (key == 0x40) return val; - UINT8 table = rearrange_key(key, opcode); + uint8_t table = rearrange_key(key, opcode); const decrypt_parameters &p = s_addr_params[table >> 4]; val = BITSWAP8(val, p.s7,p.s6,p.s5,p.s4,p.s3,p.s2,p.s1,p.s0) ^ p.xorval; @@ -356,7 +356,7 @@ UINT8 fd1089a_device::decode(UINT8 val, UINT8 key, bool opcode) val = s_basetable_fd1089[val]; - UINT8 family = table & 0x07; + uint8_t family = table & 0x07; if (opcode == 0) { if (BIT(~table,6) & BIT(table,2)) family ^= 8; @@ -396,13 +396,13 @@ UINT8 fd1089a_device::decode(UINT8 val, UINT8 key, bool opcode) // according to FD1089B rules //------------------------------------------------- -UINT8 fd1089b_device::decode(UINT8 val, UINT8 key, bool opcode) +uint8_t fd1089b_device::decode(uint8_t val, uint8_t key, bool opcode) { // special case - don't decrypt if (key == 0x40) return val; - UINT8 table = rearrange_key(key, opcode); + uint8_t table = rearrange_key(key, opcode); const decrypt_parameters &p = s_addr_params[table >> 4]; val = BITSWAP8(val, p.s7,p.s6,p.s5,p.s4,p.s3,p.s2,p.s1,p.s0) ^ p.xorval; @@ -416,7 +416,7 @@ UINT8 fd1089b_device::decode(UINT8 val, UINT8 key, bool opcode) val = s_basetable_fd1089[val]; - UINT8 xorval = 0; + uint8_t xorval = 0; if (opcode == 0) { if (BIT(~table,6) & BIT(table,2)) xorval ^= 0x01; @@ -455,7 +455,7 @@ UINT8 fd1089b_device::decode(UINT8 val, UINT8 key, bool opcode) // as either an opcode or as data //------------------------------------------------- -UINT16 fd1089_base_device::decrypt_one(offs_t addr, UINT16 val, const UINT8 *key, bool opcode) +uint16_t fd1089_base_device::decrypt_one(offs_t addr, uint16_t val, const uint8_t *key, bool opcode) { // pick the translation table from bits ff022a of the address int tbl_num = ((addr & 0x000002) >> 1) | @@ -464,7 +464,7 @@ UINT16 fd1089_base_device::decrypt_one(offs_t addr, UINT16 val, const UINT8 *key ((addr & 0x000200) >> 6) | ((addr & 0xff0000) >> 12); - UINT16 src = ((val & 0x0008) >> 3) | + uint16_t src = ((val & 0x0008) >> 3) | ((val & 0x0040) >> 5) | ((val & 0xfc00) >> 8); @@ -483,11 +483,11 @@ UINT16 fd1089_base_device::decrypt_one(offs_t addr, UINT16 val, const UINT8 *key // and data //------------------------------------------------- -void fd1089_base_device::decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT16 *dataptr) +void fd1089_base_device::decrypt(offs_t baseaddr, uint32_t size, const uint16_t *srcptr, uint16_t *opcodesptr, uint16_t *dataptr) { for (offs_t offset = 0; offset < size; offset += 2) { - UINT16 src = srcptr[offset / 2]; + uint16_t src = srcptr[offset / 2]; opcodesptr[offset / 2] = decrypt_one(baseaddr + offset, src, &m_key[0], true); dataptr[offset / 2] = decrypt_one(baseaddr + offset, src, &m_key[0], false); } diff --git a/src/mame/machine/fd1089.h b/src/mame/machine/fd1089.h index 0bf37ba75b9..f77427ff3f6 100644 --- a/src/mame/machine/fd1089.h +++ b/src/mame/machine/fd1089.h @@ -39,36 +39,36 @@ class fd1089_base_device : public m68000_device { public: // construction/destruction - fd1089_base_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); + fd1089_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); // explicit decryption helpers - void decrypt(offs_t baseaddr, UINT32 size, offs_t regionoffs, UINT16 *opcodesptr, UINT16 *dataptr) { decrypt(baseaddr, size, &m_plaintext[regionoffs/2], opcodesptr, dataptr); } + void decrypt(offs_t baseaddr, uint32_t size, offs_t regionoffs, uint16_t *opcodesptr, uint16_t *dataptr) { decrypt(baseaddr, size, &m_plaintext[regionoffs/2], opcodesptr, dataptr); } protected: // device overrides virtual void device_start() override; // internal helpers - UINT8 rearrange_key(UINT8 table, bool opcode); - virtual UINT8 decode(UINT8 val, UINT8 key, bool opcode) = 0; - UINT16 decrypt_one(offs_t addr, UINT16 val, const UINT8 *key, bool opcode); - void decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT16 *dataptr); + uint8_t rearrange_key(uint8_t table, bool opcode); + virtual uint8_t decode(uint8_t val, uint8_t key, bool opcode) = 0; + uint16_t decrypt_one(offs_t addr, uint16_t val, const uint8_t *key, bool opcode); + void decrypt(offs_t baseaddr, uint32_t size, const uint16_t *srcptr, uint16_t *opcodesptr, uint16_t *dataptr); // internal state required_memory_region m_region; - required_region_ptr m_key; - std::vector m_plaintext; - required_shared_ptr m_decrypted_opcodes; + required_region_ptr m_key; + std::vector m_plaintext; + required_shared_ptr m_decrypted_opcodes; // internal types struct decrypt_parameters { - UINT8 xorval; - UINT8 s7,s6,s5,s4,s3,s2,s1,s0; + uint8_t xorval; + uint8_t s7,s6,s5,s4,s3,s2,s1,s0; }; // static tables - static const UINT8 s_basetable_fd1089[0x100]; + static const uint8_t s_basetable_fd1089[0x100]; static const decrypt_parameters s_addr_params[16]; static const decrypt_parameters s_data_params_a[16]; }; @@ -81,10 +81,10 @@ class fd1089a_device : public fd1089_base_device { public: // construction/destruction - fd1089a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1089a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT8 decode(UINT8 val, UINT8 key, bool opcode) override; + virtual uint8_t decode(uint8_t val, uint8_t key, bool opcode) override; }; @@ -95,10 +95,10 @@ class fd1089b_device : public fd1089_base_device { public: // construction/destruction - fd1089b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1089b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT8 decode(UINT8 val, UINT8 key, bool opcode) override; + virtual uint8_t decode(uint8_t val, uint8_t key, bool opcode) override; }; diff --git a/src/mame/machine/fd1094.cpp b/src/mame/machine/fd1094.cpp index 7080c9630ff..93cfe1d9a99 100644 --- a/src/mame/machine/fd1094.cpp +++ b/src/mame/machine/fd1094.cpp @@ -130,13 +130,13 @@ successfully for all known keys, given the values of the 'shift' and 'B' parameters, as well as an initial 'seed' for the generator: - void genkey(UINT32 seed, UINT8 *output) + void genkey(uint32_t seed, uint8_t *output) { int bytenum; for (bytenum = 4; bytenum < 8192; bytenum++) { - UINT8 byteval; + uint8_t byteval; seed = seed * 0x29; seed += seed << 16; @@ -393,7 +393,7 @@ const device_type FD1094 = &device_creator; 0x1e7a, this only happens with 317-0162 so far; I assume it is a fault in the CPU. */ -const UINT16 fd1094_device::s_masked_opcodes[] = +const uint16_t fd1094_device::s_masked_opcodes[] = { 0x013a,0x033a,0x053a,0x073a,0x083a,0x093a,0x0b3a,0x0d3a,0x0f3a, @@ -510,7 +510,7 @@ void fd1094_decryption_cache::reset() // of the region we are caching //------------------------------------------------- -void fd1094_decryption_cache::configure(offs_t baseaddress, UINT32 size, offs_t rgnoffset) +void fd1094_decryption_cache::configure(offs_t baseaddress, uint32_t size, offs_t rgnoffset) { // if something important changes, throw away what we have if (m_baseaddress != baseaddress || m_size != size || m_rgnoffset != rgnoffset) @@ -528,7 +528,7 @@ void fd1094_decryption_cache::configure(offs_t baseaddress, UINT32 size, offs_t // decrypted opcodes for the given state //------------------------------------------------- -UINT16 *fd1094_decryption_cache::decrypted_opcodes(UINT8 state) +uint16_t *fd1094_decryption_cache::decrypted_opcodes(uint8_t state) { // if we have already decrypted this state, use it if (!m_decrypted_opcodes[state].empty()) @@ -552,7 +552,7 @@ UINT16 *fd1094_decryption_cache::decrypted_opcodes(UINT8 state) //------------------------------------------------- -fd1094_device::fd1094_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fd1094_device::fd1094_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_device(mconfig, tag, owner, clock, "fd1094", __FILE__) , m_decrypted_opcodes_bank(*this, "^fd1094_decrypted_opcodes") , m_state(0x00) @@ -635,7 +635,7 @@ void fd1094_device::change_state(int newstate) void fd1094_device::device_start() { m_srcbase = m_rom; - UINT32 size = m_rom.bytes(); + uint32_t size = m_rom.bytes(); // if no ROM region, see if there's a memory share with our name if (!m_rom.found()) @@ -644,7 +644,7 @@ void fd1094_device::device_start() if (!share) throw emu_fatalerror("FD1094 found no data to decrypt!"); - m_srcbase = reinterpret_cast(share->ptr()); + m_srcbase = reinterpret_cast(share->ptr()); size = share->bytes(); } @@ -704,12 +704,12 @@ void fd1094_device::device_postload() // (physical address / 2) //------------------------------------------------- -UINT16 fd1094_device::decrypt_one(offs_t address, UINT16 val, const UINT8 *main_key, UINT8 state, bool vector_fetch) +uint16_t fd1094_device::decrypt_one(offs_t address, uint16_t val, const uint8_t *main_key, uint8_t state, bool vector_fetch) { // extract and adjust the global key - UINT8 gkey1 = main_key[1]; - UINT8 gkey2 = main_key[2]; - UINT8 gkey3 = main_key[3]; + uint8_t gkey1 = main_key[1]; + uint8_t gkey2 = main_key[2]; + uint8_t gkey3 = main_key[3]; if (state & 0x0001) { gkey1 ^= 0x04; // global_xor1 @@ -760,13 +760,13 @@ UINT16 fd1094_device::decrypt_one(offs_t address, UINT16 val, const UINT8 *main_ } // for address xx0000-xx0006 (but only if >= 000008), use key xx2000-xx2006 - UINT8 mainkey; + uint8_t mainkey; if ((address & 0x0ffc) == 0 && address >= 4) mainkey = main_key[(address & 0x1fff) | 0x1000]; else mainkey = main_key[address & 0x1fff]; - UINT8 key_F; + uint8_t key_F; if (address & 0x1000) key_F = BIT(mainkey,7); else key_F = BIT(mainkey,6); @@ -780,40 +780,40 @@ UINT16 fd1094_device::decrypt_one(offs_t address, UINT16 val, const UINT8 *main_ if (address <= 1) key_F = 0; } - UINT8 global_xor0 = 1^BIT(gkey1,5); - UINT8 global_xor1 = 1^BIT(gkey1,2); - UINT8 global_swap2 = 1^BIT(gkey1,0); + uint8_t global_xor0 = 1^BIT(gkey1,5); + uint8_t global_xor1 = 1^BIT(gkey1,2); + uint8_t global_swap2 = 1^BIT(gkey1,0); - UINT8 global_swap0a = 1^BIT(gkey2,5); - UINT8 global_swap0b = 1^BIT(gkey2,2); + uint8_t global_swap0a = 1^BIT(gkey2,5); + uint8_t global_swap0b = 1^BIT(gkey2,2); - UINT8 global_swap3 = 1^BIT(gkey3,6); - UINT8 global_swap1 = 1^BIT(gkey3,4); - UINT8 global_swap4 = 1^BIT(gkey3,2); + uint8_t global_swap3 = 1^BIT(gkey3,6); + uint8_t global_swap1 = 1^BIT(gkey3,4); + uint8_t global_swap4 = 1^BIT(gkey3,2); - UINT8 key_0a = BIT(mainkey,0) ^ BIT(gkey3,1); - UINT8 key_0b = BIT(mainkey,0) ^ BIT(gkey1,7); - UINT8 key_0c = BIT(mainkey,0) ^ BIT(gkey1,1); + uint8_t key_0a = BIT(mainkey,0) ^ BIT(gkey3,1); + uint8_t key_0b = BIT(mainkey,0) ^ BIT(gkey1,7); + uint8_t key_0c = BIT(mainkey,0) ^ BIT(gkey1,1); - UINT8 key_1a = BIT(mainkey,1) ^ BIT(gkey2,7); - UINT8 key_1b = BIT(mainkey,1) ^ BIT(gkey1,3); + uint8_t key_1a = BIT(mainkey,1) ^ BIT(gkey2,7); + uint8_t key_1b = BIT(mainkey,1) ^ BIT(gkey1,3); - UINT8 key_2a = BIT(mainkey,2) ^ BIT(gkey3,7); - UINT8 key_2b = BIT(mainkey,2) ^ BIT(gkey1,4); + uint8_t key_2a = BIT(mainkey,2) ^ BIT(gkey3,7); + uint8_t key_2b = BIT(mainkey,2) ^ BIT(gkey1,4); - UINT8 key_3a = BIT(mainkey,3) ^ BIT(gkey2,0); - UINT8 key_3b = BIT(mainkey,3) ^ BIT(gkey3,3); + uint8_t key_3a = BIT(mainkey,3) ^ BIT(gkey2,0); + uint8_t key_3b = BIT(mainkey,3) ^ BIT(gkey3,3); - UINT8 key_4a = BIT(mainkey,4) ^ BIT(gkey2,3); - UINT8 key_4b = BIT(mainkey,4) ^ BIT(gkey3,0); + uint8_t key_4a = BIT(mainkey,4) ^ BIT(gkey2,3); + uint8_t key_4b = BIT(mainkey,4) ^ BIT(gkey3,0); - UINT8 key_5a = BIT(mainkey,5) ^ BIT(gkey3,5); - UINT8 key_5b = BIT(mainkey,5) ^ BIT(gkey1,6); + uint8_t key_5a = BIT(mainkey,5) ^ BIT(gkey3,5); + uint8_t key_5b = BIT(mainkey,5) ^ BIT(gkey1,6); - UINT8 key_6a = BIT(mainkey,6) ^ BIT(gkey2,1); - UINT8 key_6b = BIT(mainkey,6) ^ BIT(gkey2,6); + uint8_t key_6a = BIT(mainkey,6) ^ BIT(gkey2,1); + uint8_t key_6b = BIT(mainkey,6) ^ BIT(gkey2,6); - UINT8 key_7a = BIT(mainkey,7) ^ BIT(gkey2,4); + uint8_t key_7a = BIT(mainkey,7) ^ BIT(gkey2,4); if (val & 0x8000) // block invariant: val & 0x8000 != 0 @@ -891,7 +891,7 @@ UINT16 fd1094_device::decrypt_one(offs_t address, UINT16 val, const UINT8 *main_ // decrypt - decrypt a buffers' worth of opcodes //------------------------------------------------- -void fd1094_device::decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT8 state) +void fd1094_device::decrypt(offs_t baseaddr, uint32_t size, const uint16_t *srcptr, uint16_t *opcodesptr, uint8_t state) { for (offs_t offset = 0; offset < size; offset += 2) opcodesptr[offset / 2] = decrypt_one((baseaddr + offset) / 2, srcptr[offset / 2], &m_key[0], state, (baseaddr + offset) < 8); @@ -903,7 +903,7 @@ void fd1094_device::decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, // for standard cases //------------------------------------------------- -void fd1094_device::default_state_change(UINT8 state) +void fd1094_device::default_state_change(uint8_t state) { m_decrypted_opcodes_bank->set_base(m_cache.decrypted_opcodes(state)); } diff --git a/src/mame/machine/fd1094.h b/src/mame/machine/fd1094.h index 5981f0640a0..ba04da2858a 100644 --- a/src/mame/machine/fd1094.h +++ b/src/mame/machine/fd1094.h @@ -44,19 +44,19 @@ public: // getters fd1094_device &fd1094() const { return m_fd1094; } - UINT16 *decrypted_opcodes(UINT8 state); + uint16_t *decrypted_opcodes(uint8_t state); // operations void reset(); - void configure(offs_t baseaddress, UINT32 size, offs_t rgnoffset); + void configure(offs_t baseaddress, uint32_t size, offs_t rgnoffset); protected: // internal state fd1094_device & m_fd1094; - UINT32 m_baseaddress; - UINT32 m_size; - UINT32 m_rgnoffset; - std::vector m_decrypted_opcodes[256]; + uint32_t m_baseaddress; + uint32_t m_size; + uint32_t m_rgnoffset; + std::vector m_decrypted_opcodes[256]; }; @@ -66,16 +66,16 @@ protected: class fd1094_device : public m68000_device { public: - typedef delegate state_change_delegate; + typedef delegate state_change_delegate; // construction/destruction - fd1094_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1094_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // explicit decryption helpers - void decrypt(offs_t baseaddr, UINT32 size, offs_t regionoffs, UINT16 *opcodesptr, UINT8 state) { decrypt(baseaddr, size, &m_srcbase[regionoffs/2], opcodesptr, state); } + void decrypt(offs_t baseaddr, uint32_t size, offs_t regionoffs, uint16_t *opcodesptr, uint8_t state) { decrypt(baseaddr, size, &m_srcbase[regionoffs/2], opcodesptr, state); } // live state management - UINT8 state() const { return m_irqmode ? m_key[0] : m_state; } + uint8_t state() const { return m_irqmode ? m_key[0] : m_state; } void change_state(int newstate = -1); void notify_state_change(state_change_delegate callback) { m_state_change = callback; } @@ -96,9 +96,9 @@ protected: virtual void device_postload(); // internal helpers - UINT16 decrypt_one(offs_t address, UINT16 val, const UINT8 *main_key, UINT8 state, bool vector_fetch); - void decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT8 state); - void default_state_change(UINT8 state); + uint16_t decrypt_one(offs_t address, uint16_t val, const uint8_t *main_key, uint8_t state, bool vector_fetch); + void decrypt(offs_t baseaddr, uint32_t size, const uint16_t *srcptr, uint16_t *opcodesptr, uint8_t state); + void default_state_change(uint8_t state); IRQ_CALLBACK_MEMBER( irq_callback ); // static helpers @@ -106,25 +106,25 @@ protected: DECLARE_WRITE_LINE_MEMBER(rte_callback); // internal state - UINT8 m_state; + uint8_t m_state; bool m_irqmode; state_change_delegate m_state_change; fd1094_decryption_cache m_cache; - UINT16 const *m_srcbase; - optional_region_ptr m_rom; - required_region_ptr m_key; - UINT8 m_masked_opcodes_lookup[2][65536/8/2]; + uint16_t const *m_srcbase; + optional_region_ptr m_rom; + required_region_ptr m_key; + uint8_t m_masked_opcodes_lookup[2][65536/8/2]; // static tables - static const UINT16 s_masked_opcodes[]; + static const uint16_t s_masked_opcodes[]; }; struct fd1094_constraint { offs_t pc; - UINT16 state; - UINT16 value; - UINT16 mask; + uint16_t state; + uint16_t value; + uint16_t mask; }; #endif diff --git a/src/mame/machine/fddebug.cpp b/src/mame/machine/fddebug.cpp index 22276a29f66..ee7fe6f69f0 100644 --- a/src/mame/machine/fddebug.cpp +++ b/src/mame/machine/fddebug.cpp @@ -198,16 +198,16 @@ struct fd1094_possibility { offs_t basepc; /* starting PC of the possibility */ int length; /* number of words */ - UINT8 instrbuffer[10]; /* instruction data for disassembler */ - UINT8 keybuffer[10]; /* array of key values to produce the instruction data */ - UINT8 iffy; /* is this an iffy possibility? */ + uint8_t instrbuffer[10]; /* instruction data for disassembler */ + uint8_t keybuffer[10]; /* array of key values to produce the instruction data */ + uint8_t iffy; /* is this an iffy possibility? */ char dasm[256]; /* disassembly */ }; /* an entry in the opcode table */ struct optable_entry { - UINT32 flags; /* per-opcode flags */ + uint32_t flags; /* per-opcode flags */ const char * string; /* identifying string */ }; @@ -218,41 +218,41 @@ struct optable_entry ***************************************************************************/ /* array of PCs not to stop at */ -static UINT8 * ignorepc; -static UINT8 ignore_all; +static uint8_t * ignorepc; +static uint8_t ignore_all; /* array of information about each opcode */ static optable_entry * optable; /* buffer for undoing operations */ -static UINT8 * undobuff; +static uint8_t * undobuff; /* array of possible instruction decodings */ static fd1094_possibility posslist[4*4*4*4*4]; static int posscount; /* array of possible seeds */ -static UINT32 * possible_seed; +static uint32_t * possible_seed; /* array of constraints */ static fd1094_constraint constraints[MAX_CONSTRAINTS]; static int constcount; /* stack of search addresses */ -static UINT32 searchstack[MAX_SEARCH_DEPTH]; +static uint32_t searchstack[MAX_SEARCH_DEPTH]; static int searchsp; /* current key generation parameters */ -static UINT32 fd1094_global; -static UINT32 fd1094_seed; -static UINT8 keydirty; +static uint32_t fd1094_global; +static uint32_t fd1094_seed; +static uint8_t keydirty; /* pointers to our data */ -static UINT16 * coderegion; -static UINT32 coderegion_words; -static UINT8 * keyregion; -static UINT16 * keystatus; -static UINT32 keystatus_words; +static uint16_t * coderegion; +static uint32_t coderegion_words; +static uint8_t * keyregion; +static uint16_t * keystatus; +static uint32_t keystatus_words; /* key changed callback */ static void (*key_changed)(running_machine &); @@ -286,18 +286,18 @@ static void execute_fdcset(running_machine &machine, int ref, int params, const static void execute_fdclist(running_machine &machine, int ref, int params, const char **param); static void execute_fdcsearch(running_machine &machine, int ref, int params, const char **param); -static fd1094_possibility *try_all_possibilities(address_space &space, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata); -static void tag_possibility(running_machine &machine, fd1094_possibility *possdata, UINT8 status); +static fd1094_possibility *try_all_possibilities(address_space &space, int basepc, int offset, int length, uint8_t *instrbuffer, uint8_t *keybuffer, fd1094_possibility *possdata); +static void tag_possibility(running_machine &machine, fd1094_possibility *possdata, uint8_t status); static void perform_constrained_search(running_machine &machine); -static UINT32 find_global_key_matches(UINT32 startwith, UINT16 *output); -static int find_constraint_sequence(UINT32 global, int quick); -static int does_key_work_for_constraints(const UINT16 *base, UINT8 *key); -static UINT32 reconstruct_base_seed(int keybaseaddr, UINT32 startseed); +static uint32_t find_global_key_matches(uint32_t startwith, uint16_t *output); +static int find_constraint_sequence(uint32_t global, int quick); +static int does_key_work_for_constraints(const uint16_t *base, uint8_t *key); +static uint32_t reconstruct_base_seed(int keybaseaddr, uint32_t startseed); static void build_optable(running_machine &machine); -static int validate_ea(address_space &space, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags); -static int validate_opcode(address_space &space, UINT32 pc, const UINT8 *opdata, int maxwords); +static int validate_ea(address_space &space, uint32_t pc, uint8_t modereg, const uint8_t *parambase, uint32_t flags); +static int validate_opcode(address_space &space, uint32_t pc, const uint8_t *opdata, int maxwords); @@ -328,7 +328,7 @@ static inline int addr_to_keyaddr(offs_t address) always be 1 -----------------------------------------------*/ -static inline UINT8 mask_for_keyaddr(offs_t address) +static inline uint8_t mask_for_keyaddr(offs_t address) { /* the first half of the key always has bit 0x80 set; the second half 0x40 */ /* however, the values at 0000-0003 and 1000-1003 don't follow this rule */ @@ -346,7 +346,7 @@ static inline UINT8 mask_for_keyaddr(offs_t address) the specified number of steps -----------------------------------------------*/ -static inline UINT32 advance_seed(UINT32 seed, int count) +static inline uint32_t advance_seed(uint32_t seed, int count) { /* iterate over the seed for 'count' reps */ while (count--) @@ -363,7 +363,7 @@ static inline UINT32 advance_seed(UINT32 seed, int count) from a seed and apply the given mask -----------------------------------------------*/ -static inline UINT8 key_value_from_seed(UINT32 seed, UINT8 mask) +static inline uint8_t key_value_from_seed(uint32_t seed, uint8_t mask) { /* put bits 16-21 of the seed in the low 6 bits and OR with the mask */ return ((~seed >> 16) & 0x3f) | mask; @@ -376,15 +376,15 @@ static inline UINT8 key_value_from_seed(UINT32 seed, UINT8 mask) given seed -----------------------------------------------*/ -static inline void generate_key_bytes(UINT8 *dest, UINT32 keyoffs, UINT32 count, UINT32 seed) +static inline void generate_key_bytes(uint8_t *dest, uint32_t keyoffs, uint32_t count, uint32_t seed) { int bytenum; /* generate 'count' bytes of a key */ for (bytenum = 0; bytenum < count; bytenum++) { - UINT32 keyaddr = (keyoffs + bytenum) & 0x1fff; - UINT8 mask = mask_for_keyaddr(keyaddr); + uint32_t keyaddr = (keyoffs + bytenum) & 0x1fff; + uint8_t mask = mask_for_keyaddr(keyaddr); /* advance the seed first, then store the derived value */ seed = advance_seed(seed, 1); @@ -398,7 +398,7 @@ static inline void generate_key_bytes(UINT8 *dest, UINT32 keyoffs, UINT32 count, an opcode based on the opcode -----------------------------------------------*/ -static inline UINT8 get_opcode_length(UINT16 opcode) +static inline uint8_t get_opcode_length(uint16_t opcode) { /* return the length from the table */ return optable[opcode].flags >> 28; @@ -410,7 +410,7 @@ static inline UINT8 get_opcode_length(UINT16 opcode) constraint -----------------------------------------------*/ -static inline void set_constraint(fd1094_constraint *constraint, UINT32 pc, UINT16 state, UINT16 value, UINT16 mask) +static inline void set_constraint(fd1094_constraint *constraint, uint32_t pc, uint16_t state, uint16_t value, uint16_t mask) { constraint->pc = pc; constraint->state = state; @@ -436,7 +436,7 @@ static inline void print_possibilities(running_machine &machine) 0=no, 1=yes, 2=unlikely -----------------------------------------------*/ -static inline int pc_is_valid(address_space &space, UINT32 pc, UINT32 flags) +static inline int pc_is_valid(address_space &space, uint32_t pc, uint32_t flags) { /* if we're odd or out of range, fail */ if ((pc & 1) == 1) @@ -454,7 +454,7 @@ static inline int pc_is_valid(address_space &space, UINT32 pc, UINT32 flags) valid? 0=no, 1=yes, 2=unlikely -----------------------------------------------*/ -static inline int addr_is_valid(address_space &space, UINT32 addr, UINT32 flags) +static inline int addr_is_valid(address_space &space, uint32_t addr, uint32_t flags) { /* if this a JMP, the address is a PC */ if (flags & OF_JMP) @@ -489,22 +489,22 @@ void fd1094_init_debugging(running_machine &machine, const char *cpureg, const c key_changed = changed; /* set up the regions */ - coderegion = (UINT16 *)machine.root_device().memregion(cpureg)->base(); + coderegion = (uint16_t *)machine.root_device().memregion(cpureg)->base(); coderegion_words = machine.root_device().memregion(cpureg)->bytes() / 2; - keyregion = (UINT8 *)machine.root_device().memregion(keyreg)->base(); - keystatus = (UINT16 *)machine.root_device().memregion(statreg)->base(); + keyregion = (uint8_t *)machine.root_device().memregion(keyreg)->base(); + keystatus = (uint16_t *)machine.root_device().memregion(statreg)->base(); keystatus_words = machine.root_device().memregion(statreg)->bytes() / 2; assert(coderegion_words == keystatus_words); /* allocate memory for the ignore table */ - ignorepc = make_unique_clear(1 << 23); + ignorepc = make_unique_clear(1 << 23); /* allocate memory for the undo buffer */ - undobuff = std::make_unique(keystatus_words * 2); + undobuff = std::make_unique(keystatus_words * 2); memcpy(undobuff, keystatus, keystatus_words * 2); /* allocate memory for the possible seeds array */ - possible_seed = std::make_unique(65536); + possible_seed = std::make_unique(65536); /* build the opcode table */ build_optable(machine); @@ -561,8 +561,8 @@ static void set_default_key_params(running_machine &machine) static const struct { const char * gamename; - UINT32 global; - UINT32 seed; + uint32_t global; + uint32_t seed; } default_keys[] = { { "altbeastj1", 0xFCAFF9F9, 0x177AC6 }, @@ -691,7 +691,7 @@ void fd1094_regenerate_key(running_machine &machine) static int instruction_hook(device_t &device, offs_t curpc) { int curfdstate = fd1094_set_state(keyregion, -1); - UINT8 instrbuffer[10], keybuffer[5]; + uint8_t instrbuffer[10], keybuffer[5]; int i, keystat; /* quick exit if we're ignoring */ @@ -703,7 +703,7 @@ static int instruction_hook(device_t &device, offs_t curpc) keystatus[curpc/2] = (keystatus[curpc/2] & ~STATE_MASK) | (curfdstate << 8); if (keystat == STATUS_LOCKED || keystat == STATUS_NOCHANGE) { - UINT16 opcode = fd1094_decode(curpc/2, coderegion[curpc/2], keyregion, 0); + uint16_t opcode = fd1094_decode(curpc/2, coderegion[curpc/2], keyregion, 0); int length = get_opcode_length(opcode); for (i = 1; i < length; i++) { @@ -776,7 +776,7 @@ static void execute_fdoutput(running_machine &machine, int ref, int params, cons static void execute_fdseed(running_machine &machine, int ref, int params, const char **param) { - UINT64 num1, num2; + uint64_t num1, num2; /* extract the parameters */ if (!machine.debugger().commands().validate_number_parameter(param[0], &num1)) @@ -803,7 +803,7 @@ static void execute_fdseed(running_machine &machine, int ref, int params, const static void execute_fdlockguess(running_machine &machine, int ref, int params, const char **param) { - UINT64 num1; + uint64_t num1; /* extract the parameter */ if (!machine.debugger().commands().validate_number_parameter(param[0], &num1)) @@ -838,7 +838,7 @@ static void execute_fdeliminate(running_machine &machine, int ref, int params, c /* extract parameters */ for (pnum = 0; pnum < params; pnum++) { - UINT64 num1; + uint64_t num1; /* extract the parameters */ if (!machine.debugger().commands().validate_number_parameter(param[pnum], &num1)) @@ -886,7 +886,7 @@ static void execute_fdunlock(running_machine &machine, int ref, int params, cons device_t *cpu = machine.debugger().cpu().get_visible_cpu(); /* support 0 or 1 parameters */ - UINT64 offset; + uint64_t offset; if (params != 1 || !machine.debugger().commands().validate_number_parameter(param[0], &offset)) offset = cpu->safe_pc(); int keyaddr = addr_to_keyaddr(offset / 2); @@ -898,7 +898,7 @@ static void execute_fdunlock(running_machine &machine, int ref, int params, cons const int reps = keystatus_words / KEY_SIZE; for (int repnum = 0; repnum < reps; repnum++) { - UINT16 *dest = &keystatus[repnum * KEY_SIZE + keyaddr]; + uint16_t *dest = &keystatus[repnum * KEY_SIZE + keyaddr]; if ((*dest & STATUS_MASK) == STATUS_LOCKED) *dest &= ~STATUS_MASK & ~HIBITS_MASK; @@ -930,7 +930,7 @@ static void execute_fdignore(running_machine &machine, int ref, int params, cons return; } - UINT64 offset; + uint64_t offset; if (params != 1 || !machine.debugger().commands().validate_number_parameter(param[0], &offset)) offset = cpu->safe_pc(); offset /= 2; @@ -1001,7 +1001,7 @@ static void execute_fdstatus(running_machine &machine, int ref, int params, cons static void execute_fdstate(running_machine &machine, int ref, int params, const char **param) { - UINT64 newstate; + uint64_t newstate; /* set the new state if we got a parameter */ if (params > 0) @@ -1029,7 +1029,7 @@ static void execute_fdpc(running_machine &machine, int ref, int params, const ch device_t *cpu = machine.debugger().cpu().get_visible_cpu(); /* support 0 or 1 parameters */ - UINT64 newpc = 0; + uint64_t newpc = 0; if (!machine.debugger().commands().validate_number_parameter(param[0], &newpc)) newpc = cpu->safe_pc(); @@ -1051,8 +1051,8 @@ static void execute_fdsearch(running_machine &machine, int ref, int params, cons address_space &space = machine->debugger().cpu().get_visible_cpu()->memory().space(AS_PROGRAM); int pc = space.device().safe_pc(); int length, first = TRUE; - UINT8 instrdata[2]; - UINT16 decoded; + uint8_t instrdata[2]; + uint16_t decoded; /* if we don't match, reset the stack */ if (searchsp == 0 || searchstack[searchsp-1] != pc) @@ -1115,14 +1115,14 @@ static void execute_fdsearch(running_machine &machine, int ref, int params, cons /* handle branches */ if (optable[decoded].flags & OF_BRANCH) { - int deltapc = (INT8)decoded; + int deltapc = (int8_t)decoded; int targetpc; /* extract the delta PC */ if ((optable[decoded].flags & OF_ISIZEMASK) == OF_IMMW) - deltapc = (INT16)fd1094_decode((pc+2)/2, coderegion[(pc+2)/2], keyregion, 0); + deltapc = (int16_t)fd1094_decode((pc+2)/2, coderegion[(pc+2)/2], keyregion, 0); else if ((optable[decoded].flags & OF_ISIZEMASK) == OF_IMML) - deltapc = (INT32)(fd1094_decode((pc+2)/2, coderegion[(pc+2)/2], keyregion, 0) << 16) + fd1094_decode((pc+4)/2, coderegion[(pc+4)/2], keyregion, 0); + deltapc = (int32_t)(fd1094_decode((pc+2)/2, coderegion[(pc+2)/2], keyregion, 0) << 16) + fd1094_decode((pc+4)/2, coderegion[(pc+4)/2], keyregion, 0); /* for everything but unconditional branches, push the target on the stack; else just go there */ targetpc = (pc + 2 + deltapc) & 0xffffff; @@ -1143,9 +1143,9 @@ static void execute_fdsearch(running_machine &machine, int ref, int params, cons /* determine the target PC */ if ((decoded & 0x3f) == 0x38) - targetpc = (INT16)fd1094_decode((pc+2)/2, coderegion[(pc+2)/2], keyregion, 0); + targetpc = (int16_t)fd1094_decode((pc+2)/2, coderegion[(pc+2)/2], keyregion, 0); else - targetpc = (INT32)(fd1094_decode((pc+2)/2, coderegion[(pc+2)/2], keyregion, 0) << 16) + fd1094_decode((pc+4)/2, coderegion[(pc+4)/2], keyregion, 0); + targetpc = (int32_t)(fd1094_decode((pc+2)/2, coderegion[(pc+2)/2], keyregion, 0) << 16) + fd1094_decode((pc+4)/2, coderegion[(pc+4)/2], keyregion, 0); /* for jsr's, add a stack entry to explore the destination; else just go there */ if ((decoded & 0xffc0) == 0x4e80) @@ -1178,7 +1178,7 @@ static void execute_fddasm(running_machine &machine, int ref, int params, const int origstate = fd1094_set_state(keyregion, -1); const char *filename; int skipped = FALSE; - UINT32 pcaddr; + uint32_t pcaddr; /* extract the parameters */ filename = param[0]; @@ -1195,11 +1195,11 @@ static void execute_fddasm(running_machine &machine, int ref, int params, const /* now do the disassembly */ for (pcaddr = 0; pcaddr < coderegion_words; ) { - UINT8 instrbuffer[10]; + uint8_t instrbuffer[10]; int unknowns = FALSE; int length, pcoffs; char disasm[256]; - UINT16 decoded; + uint16_t decoded; int pnum; /* if we haven't visited this word, go to the next */ @@ -1259,7 +1259,7 @@ static void execute_fddasm(running_machine &machine, int ref, int params, const /* if we have unknowns, display them as well */ if (unknowns > 0) { - UINT8 keybuffer[5]; + uint8_t keybuffer[5]; int posscount = try_all_possibilities(space, pcaddr * 2, 0, 0, instrbuffer, keybuffer, posslist) - posslist; for (pnum = 0; pnum < posscount; pnum++) if (strcmp(disasm, posslist[pnum].dasm) != 0) @@ -1290,7 +1290,7 @@ static void execute_fddasm(running_machine &machine, int ref, int params, const static void execute_fdcset(running_machine &machine, int ref, int params, const char **param) { - UINT64 pc, value, mask = 0xffff, state = FD1094_STATE_RESET; + uint64_t pc, value, mask = 0xffff, state = FD1094_STATE_RESET; int cnum; /* extract the parameters */ @@ -1311,7 +1311,7 @@ static void execute_fdcset(running_machine &machine, int ref, int params, const /* validate parameters */ if ((pc & 1) != 0 || pc > 0xffffff) { - machine.debugger().console().printf("Invalid PC specified (%08X)\n", (UINT32)pc); + machine.debugger().console().printf("Invalid PC specified (%08X)\n", (uint32_t)pc); return; } @@ -1379,11 +1379,11 @@ static void execute_fdcsearch(running_machine &machine, int ref, int params, con length -----------------------------------------------*/ -static fd1094_possibility *try_all_possibilities(address_space &space, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata) +static fd1094_possibility *try_all_possibilities(address_space &space, int basepc, int offset, int length, uint8_t *instrbuffer, uint8_t *keybuffer, fd1094_possibility *possdata) { - UINT8 keymask, keystat; - UINT16 possvalue[4]; - UINT8 posskey[4]; + uint8_t keymask, keystat; + uint16_t possvalue[4]; + uint8_t posskey[4]; int numposs = 0; int decoded; int keyaddr; @@ -1408,7 +1408,7 @@ static fd1094_possibility *try_all_possibilities(address_space &space, int basep else { /* remember the original key and iterate over high bits */ - UINT8 origkey = keyregion[keyaddr]; + uint8_t origkey = keyregion[keyaddr]; for (hibit = 0x00; hibit < 0x100; hibit += 0x40) if ((hibit & keymask) == keymask) { @@ -1418,7 +1418,7 @@ static fd1094_possibility *try_all_possibilities(address_space &space, int basep /* see if we already got that value */ for (i = 0; i < numposs; i++) - if ((UINT16)decoded == possvalue[i]) + if ((uint16_t)decoded == possvalue[i]) break; /* if not, add it to the list */ @@ -1503,12 +1503,12 @@ static fd1094_possibility *try_all_possibilities(address_space &space, int basep with the specified status -----------------------------------------------*/ -static void tag_possibility(running_machine &machine, fd1094_possibility *possdata, UINT8 status) +static void tag_possibility(running_machine &machine, fd1094_possibility *possdata, uint8_t status) { int curfdstate = fd1094_set_state(keyregion, -1); int nomatter = 0, locked = 0, guessed = 0; int reps = keystatus_words / KEY_SIZE; - UINT8 newstat[5]; + uint8_t newstat[5]; int pcoffs; /* determine the new status for each word */ @@ -1579,7 +1579,7 @@ static void tag_possibility(running_machine &machine, fd1094_possibility *possda static void perform_constrained_search(running_machine &machine) { - UINT32 global; + uint32_t global; /* ensure our first 4 constraints are what we expect */ assert(constraints[0].pc == 0x000000); @@ -1593,7 +1593,7 @@ static void perform_constrained_search(running_machine &machine) /* loop until we run out of possibilities */ while (1) { - UINT16 output[4]; + uint16_t output[4]; int numseeds; /* look for the next global key match */ @@ -1620,10 +1620,10 @@ static void perform_constrained_search(running_machine &machine) given sequence/mask pair -----------------------------------------------*/ -static UINT32 find_global_key_matches(UINT32 startwith, UINT16 *output) +static uint32_t find_global_key_matches(uint32_t startwith, uint16_t *output) { int key0, key1, key2, key3; - UINT8 key[4]; + uint8_t key[4]; /* iterate over the first key byte, allowing all possible values */ for (key0 = (startwith >> 24) & 0xff; key0 < 256; key0++) @@ -1692,16 +1692,16 @@ static UINT32 find_global_key_matches(UINT32 startwith, UINT16 *output) results -----------------------------------------------*/ -static int find_constraint_sequence(UINT32 global, int quick) +static int find_constraint_sequence(uint32_t global, int quick) { const fd1094_constraint *minkeyaddr = &constraints[4]; const fd1094_constraint *maxkeyaddr = &constraints[4]; const fd1094_constraint *curr; int keyvalue, keyaddr, keysneeded; int seedcount = 0; - UINT16 decrypted; - UINT8 key[8192]; - UINT8 keymask; + uint16_t decrypted; + uint8_t key[8192]; + uint8_t keymask; offs_t pcaddr; /* if we don't have any extra constraints, we're good */ @@ -1779,7 +1779,7 @@ static int find_constraint_sequence(UINT32 global, int quick) /* if we got a match, then iterate over all possible PRNG sequences starting with this */ if ((decrypted & minkeyaddr->mask) == minkeyaddr->value) { - UINT32 seedlow; + uint32_t seedlow; // machine.debugger().console().printf("Global %08X ... Looking for keys that generate a keyvalue of %02X at %04X\n", // global, keyvalue, keyaddr); @@ -1788,7 +1788,7 @@ static int find_constraint_sequence(UINT32 global, int quick) for (seedlow = 0; seedlow < (1 << 16); seedlow++) { /* start with the known upper bits together with the 16 guessed lower bits */ - UINT32 seedstart = (~keyvalue << 16) | seedlow; + uint32_t seedstart = (~keyvalue << 16) | seedlow; /* generate data starting with this seed into the key */ generate_key_bytes(key, keyaddr + 1, keysneeded - 1, seedstart); @@ -1814,17 +1814,17 @@ static int find_constraint_sequence(UINT32 global, int quick) of constraints -----------------------------------------------*/ -static int does_key_work_for_constraints(const UINT16 *base, UINT8 *key) +static int does_key_work_for_constraints(const uint16_t *base, uint8_t *key) { const fd1094_constraint *curr; - UINT16 decrypted; + uint16_t decrypted; /* iterate over the sequence */ for (curr = &constraints[4]; curr < &constraints[constcount]; curr++) { offs_t pcaddr = curr->pc / 2; int keyaddr = addr_to_keyaddr(pcaddr); - UINT8 keymask = mask_for_keyaddr(keyaddr); + uint8_t keymask = mask_for_keyaddr(keyaddr); int hibits; /* set the state */ @@ -1860,10 +1860,10 @@ static int does_key_work_for_constraints(const UINT16 *base, UINT8 *key) first key value (at offset 4) -----------------------------------------------*/ -static UINT32 reconstruct_base_seed(int keybaseaddr, UINT32 startseed) +static uint32_t reconstruct_base_seed(int keybaseaddr, uint32_t startseed) { - UINT32 seed = startseed; - UINT32 window[8192]; + uint32_t seed = startseed; + uint32_t window[8192]; int index = 0; /* keep generating, starting from the start seed until we re-generate the start seed */ @@ -1899,7 +1899,7 @@ static const struct { const char * bitstring; const char * eastring; - UINT32 flags; + uint32_t flags; const char * instring; } instr_table[] = { @@ -2100,10 +2100,10 @@ static void build_optable(running_machine &machine) const char *bitstring = instr_table[inum].bitstring; const char *eastring = instr_table[inum].eastring; const char *instring = instr_table[inum].instring; - UINT32 flags = instr_table[inum].flags; - UINT8 ea_allowed[64], ea2_allowed[64]; + uint32_t flags = instr_table[inum].flags; + uint8_t ea_allowed[64], ea2_allowed[64]; int bitnum, step, eanum, ea2num; - UINT16 mask = 0, value = 0; + uint16_t mask = 0, value = 0; /* build up the mask and value from the bitstring */ for (bitnum = 0; bitnum < 16; bitnum++) @@ -2168,7 +2168,7 @@ static void build_optable(running_machine &machine) for (eanum = 0; eanum < 64; eanum++) if (ea_allowed[eanum]) { - UINT16 eabits = ((ea2num & 0x38) << 3) | ((ea2num & 0x07) << 9) | eanum; + uint16_t eabits = ((ea2num & 0x38) << 3) | ((ea2num & 0x07) << 9) | eanum; /* iterate over opcode entries */ for (opnum = 0; opnum <= mask; opnum += step) @@ -2200,7 +2200,7 @@ static void build_optable(running_machine &machine) #ifdef MAME_DEBUG { char dummybuffer[40]; - UINT8 instrbuffer[10]; + uint8_t instrbuffer[10]; instrbuffer[0] = (opnum | eabits) >> 8; instrbuffer[1] = (opnum | eabits); dummybuffer[0] = 0; @@ -2222,9 +2222,9 @@ static void build_optable(running_machine &machine) valid or not, and return the length -----------------------------------------------*/ -static int validate_ea(address_space &space, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags) +static int validate_ea(address_space &space, uint32_t pc, uint8_t modereg, const uint8_t *parambase, uint32_t flags) { - UINT32 addr; + uint32_t addr; int valid; /* switch off of the mode */ @@ -2254,7 +2254,7 @@ static int validate_ea(address_space &space, UINT32 pc, UINT8 modereg, const UIN switch (modereg & 7) { case 0: /* (xxx).W -- make sure it is not odd for word/long */ - addr = (INT16)((parambase[0] << 8) | parambase[1]); + addr = (int16_t)((parambase[0] << 8) | parambase[1]); valid = addr_is_valid(space, addr & 0xffffff, flags); return (valid == 0) ? 1000 : (valid == 2) ? -1 : 1; @@ -2263,7 +2263,7 @@ static int validate_ea(address_space &space, UINT32 pc, UINT8 modereg, const UIN return (valid == 0) ? 1000 : (valid == 2) ? -2 : 2; case 2: /* (d16,PC) -- make sure it is not odd for word/long */ - valid = addr_is_valid(space, pc + (INT16)((parambase[0] << 8) | parambase[1]), flags); + valid = addr_is_valid(space, pc + (int16_t)((parambase[0] << 8) | parambase[1]), flags); return (valid == 0) ? 1000 : (valid == 2) ? -1 : 1; case 3: /* (d8,PC,Xn) -- odd displacements are a warning for word/long */ @@ -2292,13 +2292,13 @@ static int validate_ea(address_space &space, UINT32 pc, UINT8 modereg, const UIN the length specified -----------------------------------------------*/ -static int validate_opcode(address_space &space, UINT32 pc, const UINT8 *opdata, int maxwords) +static int validate_opcode(address_space &space, uint32_t pc, const uint8_t *opdata, int maxwords) { - UINT32 immvalue = 0; + uint32_t immvalue = 0; int iffy = FALSE; int offset = 0; - UINT16 opcode; - UINT32 flags; + uint16_t opcode; + uint32_t flags; int oplength; assert(maxwords >= 1); @@ -2362,9 +2362,9 @@ static int validate_opcode(address_space &space, UINT32 pc, const UINT8 *opdata, /* first adjust the PC based on the size of the branch */ pc += 2; if ((flags & OF_SIZEMASK) == OF_BYTE) - pc += (INT8)opcode; + pc += (int8_t)opcode; else if ((flags & OF_SIZEMASK) == OF_WORD) - pc += (INT16)immvalue; + pc += (int16_t)immvalue; else pc += immvalue; diff --git a/src/mame/machine/flstory.cpp b/src/mame/machine/flstory.cpp index 47c91810b61..79f65e86e11 100644 --- a/src/mame/machine/flstory.cpp +++ b/src/mame/machine/flstory.cpp @@ -139,7 +139,7 @@ READ8_MEMBER(flstory_state::flstory_mcu_status_r) WRITE8_MEMBER(flstory_state::onna34ro_mcu_w) { - UINT16 score_adr = m_workram[0x29e] * 0x100 + m_workram[0x29d]; + uint16_t score_adr = m_workram[0x29e] * 0x100 + m_workram[0x29d]; switch (data) { @@ -181,7 +181,7 @@ READ8_MEMBER(flstory_state::onna34ro_mcu_status_r) #define VICTNINE_MCU_SEED (m_workram[0x685]) -static const UINT8 victnine_mcu_data[0x100] = +static const uint8_t victnine_mcu_data[0x100] = { 0x3e, 0x08, 0xdd, 0x29, 0xcb, 0x14, 0xfd, 0x29, 0xcb, 0x15, 0xd9, 0x29, 0xd9, 0x30, 0x0d, 0xd9, @@ -219,7 +219,7 @@ static const UINT8 victnine_mcu_data[0x100] = WRITE8_MEMBER(flstory_state::victnine_mcu_w) { - UINT8 seed = VICTNINE_MCU_SEED; + uint8_t seed = VICTNINE_MCU_SEED; if (!seed && (data & 0x37) == 0x37) { diff --git a/src/mame/machine/fm_scsi.cpp b/src/mame/machine/fm_scsi.cpp index a63795db0c2..6187c91aab7 100644 --- a/src/mame/machine/fm_scsi.cpp +++ b/src/mame/machine/fm_scsi.cpp @@ -38,7 +38,7 @@ const device_type FMSCSI = &device_creator; * Device */ -fmscsi_device::fmscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fmscsi_device::fmscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_scsi_host_adapter(mconfig, FMSCSI, "FM-SCSI", tag, owner, clock, "fmscsi", __FILE__), m_irq_handler(*this), m_drq_handler(*this) @@ -81,7 +81,7 @@ void fmscsi_device::device_reset() } // get the length of a SCSI command based on it's command byte type -int fmscsi_device::get_scsi_cmd_len(UINT8 cbyte) +int fmscsi_device::get_scsi_cmd_len(uint8_t cbyte) { int group; @@ -126,7 +126,7 @@ void fmscsi_device::stop_transfer() logerror("FMSCSI: Stopping transfer : (%i/%i)\n",m_result_index,m_result_length); } -UINT8 fmscsi_device::fmscsi_data_r(void) +uint8_t fmscsi_device::fmscsi_data_r(void) { // read from data bus // ACK is automatic on accessing the data bus, so REQ will go low. @@ -169,7 +169,7 @@ UINT8 fmscsi_device::fmscsi_data_r(void) return m_data; } -void fmscsi_device::fmscsi_data_w(UINT8 data) +void fmscsi_device::fmscsi_data_w(uint8_t data) { int phase; @@ -304,7 +304,7 @@ int fmscsi_device::get_phase(void) return m_phase; } -void fmscsi_device::set_input_line(UINT8 line, UINT8 state) +void fmscsi_device::set_input_line(uint8_t line, uint8_t state) { if(line == FMSCSI_LINE_REQ) { @@ -334,12 +334,12 @@ void fmscsi_device::set_input_line(UINT8 line, UINT8 state) // logerror("FMSCSI: input line %02x set to %i\n",line,state); } -UINT8 fmscsi_device::get_input_line(UINT8 line) +uint8_t fmscsi_device::get_input_line(uint8_t line) { return m_input_lines & line; } -void fmscsi_device::set_output_line(UINT8 line, UINT8 state) +void fmscsi_device::set_output_line(uint8_t line, uint8_t state) { if(line == FMSCSI_LINE_RST && state != 0) { @@ -372,18 +372,18 @@ void fmscsi_device::set_output_line(UINT8 line, UINT8 state) // logerror("FMSCSI: output line %02x set to %i\n",line,state); } -UINT8 fmscsi_device::get_output_line(UINT8 line) +uint8_t fmscsi_device::get_output_line(uint8_t line) { return m_output_lines & line; } -UINT8 fmscsi_device::fmscsi_status_r(void) +uint8_t fmscsi_device::fmscsi_status_r(void) { // status inputs return m_input_lines; } -void fmscsi_device::fmscsi_control_w(UINT8 data) +void fmscsi_device::fmscsi_control_w(uint8_t data) { // control outputs set_output_line(FMSCSI_LINE_RST,data & FMSCSI_LINE_RST); diff --git a/src/mame/machine/fm_scsi.h b/src/mame/machine/fm_scsi.h index cc7c1ab1fc8..895d25e494c 100644 --- a/src/mame/machine/fm_scsi.h +++ b/src/mame/machine/fm_scsi.h @@ -44,26 +44,26 @@ class fmscsi_device : public legacy_scsi_host_adapter { public: // construction/destruction - fmscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fmscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } template static devcb_base &set_drq_handler(device_t &device, _Object object) { return downcast(device).m_drq_handler.set_callback(object); } // any publically accessible interfaces needed for runtime - UINT8 fmscsi_data_r(void); - void fmscsi_data_w(UINT8 data); - UINT8 fmscsi_status_r(void); - void fmscsi_control_w(UINT8 data); + uint8_t fmscsi_data_r(void); + void fmscsi_data_w(uint8_t data); + uint8_t fmscsi_status_r(void); + void fmscsi_control_w(uint8_t data); DECLARE_READ8_MEMBER( fmscsi_r ); DECLARE_WRITE8_MEMBER( fmscsi_w ); void set_phase(int phase); int get_phase(void); - void set_input_line(UINT8 line, UINT8 state); - UINT8 get_input_line(UINT8 line); - void set_output_line(UINT8 line, UINT8 state); - UINT8 get_output_line(UINT8 line); + void set_input_line(uint8_t line, uint8_t state); + uint8_t get_input_line(uint8_t line); + void set_output_line(uint8_t line, uint8_t state); + uint8_t get_output_line(uint8_t line); protected: // device-level overrides (none are required, but these are common) @@ -76,24 +76,24 @@ private: static const device_timer_id TIMER_TRANSFER = 0; static const device_timer_id TIMER_PHASE = 1; - int get_scsi_cmd_len(UINT8 cbyte); + int get_scsi_cmd_len(uint8_t cbyte); void stop_transfer(); devcb_write_line m_irq_handler; devcb_write_line m_drq_handler; - UINT8 m_command[32]; - //UINT8 m_result[32]; - UINT8 m_command_index; + uint8_t m_command[32]; + //uint8_t m_result[32]; + uint8_t m_command_index; int m_result_length; - UINT32 m_result_index; - UINT8 m_input_lines; - UINT8 m_output_lines; - UINT8 m_data; - UINT8 m_last_id; - UINT8 m_phase; - UINT8 m_target; - UINT8 m_buffer[512]; + uint32_t m_result_index; + uint8_t m_input_lines; + uint8_t m_output_lines; + uint8_t m_data; + uint8_t m_last_id; + uint8_t m_phase; + uint8_t m_target; + uint8_t m_buffer[512]; emu_timer* m_transfer_timer; emu_timer* m_phase_timer; }; diff --git a/src/mame/machine/gaelco2.cpp b/src/mame/machine/gaelco2.cpp index 1b6700caf24..e6794b5f42a 100644 --- a/src/mame/machine/gaelco2.cpp +++ b/src/mame/machine/gaelco2.cpp @@ -25,10 +25,10 @@ void gaelco2_state::gaelco2_ROM16_split_gfx(const char *src_reg, const char *dst int i; /* get a pointer to the source data */ - UINT8 *src = (UINT8 *)memregion(src_reg)->base(); + uint8_t *src = (uint8_t *)memregion(src_reg)->base(); /* get a pointer to the destination data */ - UINT8 *dst = (UINT8 *)memregion(dst_reg)->base(); + uint8_t *dst = (uint8_t *)memregion(dst_reg)->base(); /* fill destination areas with the proper data */ for (i = 0; i < length/2; i++){ @@ -287,12 +287,12 @@ WRITE16_MEMBER(gaelco2_state::gaelco2_eeprom_data_w) ***************************************************************************/ -static UINT32 rol(UINT32 x, unsigned int c) +static uint32_t rol(uint32_t x, unsigned int c) { return (x << c) | (x >> (32 - c)); } -static UINT16 get_lo(UINT32 x) +static uint16_t get_lo(uint32_t x) { return ((x & 0x00000010) << 1) | ((x & 0x00000800) << 3) | @@ -309,7 +309,7 @@ static UINT16 get_lo(UINT32 x) ((x & 0x00000020) >> 1); } -static UINT16 get_hi(UINT32 x) +static uint16_t get_hi(uint32_t x) { return ((x & 0x00001400) >> 0) | ((x & 0x10000000) >> 26) | @@ -328,7 +328,7 @@ static UINT16 get_hi(UINT32 x) ((x & 0x00000100) >> 1); } -static UINT16 get_out(UINT16 x) +static uint16_t get_out(uint16_t x) { return ((x & 0xc840) << 0) | ((x & 0x0080) << 2) | @@ -344,16 +344,16 @@ static UINT16 get_out(UINT16 x) ((x & 0x0020) >> 2); } -UINT16 mangle(UINT32 x) +uint16_t mangle(uint32_t x) { - UINT16 a = get_lo(x); - UINT16 b = get_hi(x); + uint16_t a = get_lo(x); + uint16_t b = get_hi(x); return get_out(((a ^ 0x0010) - (b ^ 0x0024)) ^ 0x5496); } READ16_MEMBER(gaelco2_state::snowboar_protection_r) { - UINT16 ret = mangle(snowboard_latch); + uint16_t ret = mangle(snowboard_latch); ret = ((ret & 0xff00) >> 8) | ((ret & 0x00ff) << 8); return ret; diff --git a/src/mame/machine/gaelco3d.cpp b/src/mame/machine/gaelco3d.cpp index 904676448e7..18f0322d019 100644 --- a/src/mame/machine/gaelco3d.cpp +++ b/src/mame/machine/gaelco3d.cpp @@ -170,7 +170,7 @@ static void buf_reset(buf_t *buf) const device_type GAELCO_SERIAL = &device_creator; -gaelco_serial_device::gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gaelco_serial_device::gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GAELCO_SERIAL, "Gaelco 3D Serial Hardware", tag, owner, clock, "gaelco_serial", __FILE__), m_irq_handler(*this), m_status(0), @@ -253,14 +253,14 @@ void gaelco_serial_device::device_stop() TIMER_CALLBACK_MEMBER( gaelco_serial_device::set_status_cb ) { - UINT8 mask = param >> 8; - UINT8 set = param & 0xff; + uint8_t mask = param >> 8; + uint8_t set = param & 0xff; m_status &= mask; m_status |= set; } -void gaelco_serial_device::set_status(UINT8 mask, UINT8 set, int wait) +void gaelco_serial_device::set_status(uint8_t mask, uint8_t set, int wait) { machine().scheduler().timer_set(attotime::from_hz(wait), timer_expired_delegate(FUNC(gaelco_serial_device::set_status_cb), this), (mask << 8)|set); } @@ -338,7 +338,7 @@ WRITE8_MEMBER( gaelco_serial_device::irq_enable ) READ8_MEMBER( gaelco_serial_device::status_r) { - UINT8 ret = 0; + uint8_t ret = 0; std::lock_guard guard(m_mutex); @@ -366,7 +366,7 @@ WRITE8_MEMBER( gaelco_serial_device::data_w) READ8_MEMBER( gaelco_serial_device::data_r) { - UINT8 ret; + uint8_t ret; std::lock_guard guard(m_mutex); process_in(); diff --git a/src/mame/machine/gaelco3d.h b/src/mame/machine/gaelco3d.h index 1c1eec722d3..50e9fafdaed 100644 --- a/src/mame/machine/gaelco3d.h +++ b/src/mame/machine/gaelco3d.h @@ -38,8 +38,8 @@ struct buf_t { - volatile UINT8 data; - volatile UINT8 stat; + volatile uint8_t data; + volatile uint8_t stat; volatile int cnt; volatile int data_cnt; }; @@ -60,7 +60,7 @@ struct osd_shared_mem class gaelco_serial_device : public device_t { public: - gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~gaelco_serial_device() {} template static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } @@ -94,7 +94,7 @@ private: // internal state devcb_write_line m_irq_handler; - UINT8 m_status; + uint8_t m_status; int m_last_in_msg_cnt; int m_slack_cnt; @@ -108,7 +108,7 @@ private: TIMER_CALLBACK_MEMBER( set_status_cb ); TIMER_CALLBACK_MEMBER( link_cb ); - void set_status(UINT8 mask, UINT8 set, int wait); + void set_status(uint8_t mask, uint8_t set, int wait); void process_in(); void sync_link(); }; diff --git a/src/mame/machine/gaelcrpt.cpp b/src/mame/machine/gaelcrpt.cpp index 4f2b0f57a1e..2dbe0f1153f 100644 --- a/src/mame/machine/gaelcrpt.cpp +++ b/src/mame/machine/gaelcrpt.cpp @@ -122,7 +122,7 @@ static int decrypt(int const param1, int const param2, int const enc_prev_word, -UINT16 gaelco_decrypt(address_space &space, int offset, int data, int param1, int param2) +uint16_t gaelco_decrypt(address_space &space, int offset, int data, int param1, int param2) { static int lastpc, lastoffset, lastencword, lastdecword; diff --git a/src/mame/machine/galaxold.cpp b/src/mame/machine/galaxold.cpp index 0aa0eec1673..93ce35ba9f9 100644 --- a/src/mame/machine/galaxold.cpp +++ b/src/mame/machine/galaxold.cpp @@ -155,7 +155,7 @@ DRIVER_INIT_MEMBER(galaxold_state,4in1) { address_space &space = m_maincpu->space(AS_PROGRAM); offs_t i, len = memregion("maincpu")->bytes(); - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); /* Decrypt Program Roms */ for (i = 0; i < len; i++) @@ -185,7 +185,7 @@ DRIVER_INIT_MEMBER(galaxold_state,bullsdrtg) int i; // patch char supposed to be space - UINT8 *gfxrom = memregion("gfx1")->base(); + uint8_t *gfxrom = memregion("gfx1")->base(); for (i = 0; i < 8; i++) { gfxrom[i] = 0; diff --git a/src/mame/machine/galaxy.cpp b/src/mame/machine/galaxy.cpp index 681eaffb16c..1fc4c053dc0 100644 --- a/src/mame/machine/galaxy.cpp +++ b/src/mame/machine/galaxy.cpp @@ -62,7 +62,7 @@ IRQ_CALLBACK_MEMBER(galaxy_state::galaxy_irq_callback) #define GALAXY_SNAPSHOT_V1_SIZE 8268 #define GALAXY_SNAPSHOT_V2_SIZE 8244 -void galaxy_state::galaxy_setup_snapshot (const UINT8 * data, UINT32 size) +void galaxy_state::galaxy_setup_snapshot (const uint8_t * data, uint32_t size) { switch (size) { @@ -104,9 +104,9 @@ void galaxy_state::galaxy_setup_snapshot (const UINT8 * data, UINT32 size) m_maincpu->set_state_int(Z80_HL2, data[0x16] | data[0x17] << 8); m_maincpu->set_state_int(Z80_IFF1, data[0x18] & 0x01); - m_maincpu->set_state_int(Z80_IFF2, (UINT64)0); + m_maincpu->set_state_int(Z80_IFF2, (uint64_t)0); - m_maincpu->set_state_int(Z80_HALT, (UINT64)0); + m_maincpu->set_state_int(Z80_HALT, (uint64_t)0); m_maincpu->set_state_int(Z80_IM, (data[0x18] >> 1) & 0x03); @@ -124,13 +124,13 @@ void galaxy_state::galaxy_setup_snapshot (const UINT8 * data, UINT32 size) SNAPSHOT_LOAD_MEMBER( galaxy_state, galaxy ) { - UINT8* snapshot_data; + uint8_t* snapshot_data; switch (snapshot_size) { case GALAXY_SNAPSHOT_V1_SIZE: case GALAXY_SNAPSHOT_V2_SIZE: - snapshot_data = auto_alloc_array(machine(), UINT8, snapshot_size); + snapshot_data = auto_alloc_array(machine(), uint8_t, snapshot_size); break; default: return image_init_result::FAIL; @@ -196,7 +196,7 @@ DRIVER_INIT_MEMBER(galaxy_state,galaxyp) MACHINE_RESET_MEMBER(galaxy_state,galaxyp) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); address_space &space = m_maincpu->space(AS_PROGRAM); ROM[0x0037] = 0x29; diff --git a/src/mame/machine/gamecom.cpp b/src/mame/machine/gamecom.cpp index 24e9a238ada..1dcc1b8c2d2 100644 --- a/src/mame/machine/gamecom.cpp +++ b/src/mame/machine/gamecom.cpp @@ -9,7 +9,7 @@ static const int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32 TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_clock_timer_callback) { - UINT8 val = m_p_ram[SM8521_CLKT] + 1; + uint8_t val = m_p_ram[SM8521_CLKT] + 1; m_p_ram[SM8521_CLKT] = ( m_p_ram[SM8521_CLKT] & 0xC0 ) | (val & 0x3f); m_maincpu->set_input_line(sm8500_cpu_device::CK_INT, ASSERT_LINE ); } @@ -52,7 +52,7 @@ TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_sound1_timer_callback) void gamecom_state::machine_reset() { - UINT8 *rom = m_region_kernel->base(); + uint8_t *rom = m_region_kernel->base(); m_bank1->set_base(rom); m_bank2->set_base(rom); m_bank3->set_base(rom); @@ -70,7 +70,7 @@ void gamecom_state::machine_reset() m_cart2_rom = memregion(region_tag.assign(m_cart2->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); } -void gamecom_state::gamecom_set_mmu(UINT8 mmu, UINT8 data) +void gamecom_state::gamecom_set_mmu(uint8_t mmu, uint8_t data) { if (data < 0x20) { @@ -101,10 +101,10 @@ void gamecom_state::gamecom_set_mmu(UINT8 mmu, UINT8 data) void gamecom_state::handle_stylus_press( int column ) { - UINT16 data = m_io_grid[column]->read(); + uint16_t data = m_io_grid[column]->read(); if (data) { - UINT16 stylus_y = data ^ 0x3ff; + uint16_t stylus_y = data ^ 0x3ff; m_p_ram[SM8521_P0] = stylus_y; m_p_ram[SM8521_P1] = ( m_p_ram[SM8521_P1] & 0xFC ) | ( stylus_y >> 8 ); } @@ -115,7 +115,7 @@ void gamecom_state::handle_stylus_press( int column ) } } -void gamecom_state::handle_input_press(UINT16 mux_data) +void gamecom_state::handle_input_press(uint16_t mux_data) { switch( mux_data ) { @@ -458,7 +458,7 @@ WRITE8_MEMBER( gamecom_state::gamecom_internal_w ) which page for source or destination is used */ WRITE8_MEMBER( gamecom_state::gamecom_handle_dma ) { - UINT8 dmc = m_p_ram[SM8521_DMC]; + uint8_t dmc = m_p_ram[SM8521_DMC]; m_dma.overwrite_mode = dmc & 0x01; m_dma.transfer_mode = dmc & 0x06; m_dma.decrement_x = dmc & 0x08; @@ -536,20 +536,20 @@ WRITE8_MEMBER( gamecom_state::gamecom_handle_dma ) { for( x_count = 0; x_count <= m_dma.width_x; x_count++ ) { - UINT16 src_addr = m_dma.source_current & m_dma.source_mask; - UINT16 dest_addr = m_dma.dest_current & m_dma.dest_mask; - UINT8 dest_adj = (3 - (m_dma.dest_x_current & 3)) << 1; - UINT8 src_adj = (3 - (m_dma.source_x_current & 3)) << 1; + uint16_t src_addr = m_dma.source_current & m_dma.source_mask; + uint16_t dest_addr = m_dma.dest_current & m_dma.dest_mask; + uint8_t dest_adj = (3 - (m_dma.dest_x_current & 3)) << 1; + uint8_t src_adj = (3 - (m_dma.source_x_current & 3)) << 1; /* handle DMA for 1 pixel */ // Get new pixel - UINT8 source_pixel = (m_dma.source_bank[src_addr] >> src_adj) & 3; + uint8_t source_pixel = (m_dma.source_bank[src_addr] >> src_adj) & 3; // If overwrite mode, write new pixel if ( m_dma.overwrite_mode || source_pixel) { // Get 4 pixels and remove the one about to be replaced - UINT8 other_pixels = m_dma.dest_bank[dest_addr] & ~(3 << dest_adj); + uint8_t other_pixels = m_dma.dest_bank[dest_addr] & ~(3 << dest_adj); // Get palette of new pixel and place into the hole m_dma.dest_bank[dest_addr] = other_pixels | (m_dma.palette[ source_pixel ] << dest_adj); } @@ -631,8 +631,8 @@ DRIVER_INIT_MEMBER(gamecom_state,gamecom) image_init_result gamecom_state::common_load(device_image_interface &image, generic_slot_device *slot) { - UINT32 size = slot->common_get_size("rom"); - UINT32 load_offset = 0; + uint32_t size = slot->common_get_size("rom"); + uint32_t load_offset = 0; if (size != 0x008000 && size != 0x040000 && size != 0x080000 && size != 0x100000 && size != 0x1c0000 && size != 0x200000) @@ -649,7 +649,7 @@ image_init_result gamecom_state::common_load(device_image_interface &image, gene // we load what we have slot->common_load_rom(slot->get_rom_base() + load_offset, size, "rom"); // and then we mirror the content, instead of masking out larger accesses - UINT8 *crt = slot->get_rom_base(); + uint8_t *crt = slot->get_rom_base(); if (size < 0x010000) { memcpy(crt + 0x008000, crt, 0x008000); } /* ->64KB */ if (size < 0x020000) { memcpy(crt + 0x010000, crt, 0x010000); } /* ->128KB */ if (size < 0x040000) { memcpy(crt + 0x020000, crt, 0x020000); } /* ->256KB */ diff --git a/src/mame/machine/gamepock.cpp b/src/mame/machine/gamepock.cpp index ecc94d723d5..2d5d543ab6a 100644 --- a/src/mame/machine/gamepock.cpp +++ b/src/mame/machine/gamepock.cpp @@ -6,11 +6,11 @@ #include "includes/gamepock.h" -void gamepock_state::hd44102ch_w( int which, int c_d, UINT8 data ) +void gamepock_state::hd44102ch_w( int which, int c_d, uint8_t data ) { if ( c_d ) { - UINT8 y; + uint8_t y; /* Data */ m_hd44102ch[which].ram[ m_hd44102ch[which].address ] = data; @@ -91,7 +91,7 @@ void gamepock_state::lcd_update() WRITE8_MEMBER( gamepock_state::port_a_w ) { - UINT8 old_port_a = m_port_a; + uint8_t old_port_a = m_port_a; m_port_a = data; @@ -117,7 +117,7 @@ READ8_MEMBER( gamepock_state::port_b_r ) READ8_MEMBER( gamepock_state::port_c_r ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; if ( m_port_a & 0x80 ) { @@ -144,9 +144,9 @@ void gamepock_state::machine_reset() } -UINT32 gamepock_state::screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gamepock_state::screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 ad; + uint8_t ad; int i,j; /* Handle HD44102CH #0 */ diff --git a/src/mame/machine/gb.cpp b/src/mame/machine/gb.cpp index 639e54c9231..97684a34240 100644 --- a/src/mame/machine/gb.cpp +++ b/src/mame/machine/gb.cpp @@ -230,7 +230,7 @@ MACHINE_RESET_MEMBER(gb_state,sgb) WRITE8_MEMBER(gb_state::gb_io_w) { - static const UINT8 timer_shifts[4] = {10, 4, 6, 8}; + static const uint8_t timer_shifts[4] = {10, 4, 6, 8}; switch (offset) { @@ -360,7 +360,7 @@ static const char *const sgbcmds[32] = WRITE8_MEMBER(gb_state::sgb_io_w) { - UINT8 *sgb_data = m_sgb_data; + uint8_t *sgb_data = m_sgb_data; switch (offset) { @@ -572,8 +572,8 @@ void gb_state::gb_timer_increment() // This gets called while the cpu is executing instructions to keep the timer state in sync WRITE8_MEMBER(gb_state::gb_timer_callback) { - UINT16 old_gb_divcount = m_divcount; - UINT16 old_internal_serial_clock = m_internal_serial_clock; + uint16_t old_gb_divcount = m_divcount; + uint16_t old_internal_serial_clock = m_internal_serial_clock; m_divcount += data; m_internal_serial_clock += data; @@ -584,8 +584,8 @@ WRITE8_MEMBER(gb_state::gb_timer_callback) if (TIMEFRQ & 0x04) { - UINT16 old_count = old_gb_divcount >> m_shift; - UINT16 new_count = m_divcount >> m_shift; + uint16_t old_count = old_gb_divcount >> m_shift; + uint16_t new_count = m_divcount >> m_shift; if (data > m_shift_cycles) { gb_timer_increment(); @@ -718,7 +718,7 @@ MACHINE_RESET_MEMBER(megaduck_state,megaduck) READ8_MEMBER(megaduck_state::megaduck_video_r) { - UINT8 data; + uint8_t data; if ((offset & 0x0C) && ((offset & 0x0C) ^ 0x0C)) { @@ -746,7 +746,7 @@ WRITE8_MEMBER(megaduck_state::megaduck_video_w) /* Map megaduck audio offset to game boy audio offsets */ /* Envelope and LFSR register nibbles are reversed relative to the game boy */ -static const UINT8 megaduck_sound_offsets[16] = { 0, 2, 1, 3, 4, 6, 5, 7, 8, 9, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; +static const uint8_t megaduck_sound_offsets[16] = { 0, 2, 1, 3, 4, 6, 5, 7, 8, 9, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; WRITE8_MEMBER(megaduck_state::megaduck_sound_w1) { @@ -758,7 +758,7 @@ WRITE8_MEMBER(megaduck_state::megaduck_sound_w1) READ8_MEMBER(megaduck_state::megaduck_sound_r1) { - UINT8 data = m_apu->sound_r(space, megaduck_sound_offsets[offset]); + uint8_t data = m_apu->sound_r(space, megaduck_sound_offsets[offset]); if ((offset == 0x01) || (offset == 0x07)) return ((data & 0x0f)<<4) | ((data & 0xf0)>>4); else @@ -775,7 +775,7 @@ WRITE8_MEMBER(megaduck_state::megaduck_sound_w2) READ8_MEMBER(megaduck_state::megaduck_sound_r2) { - UINT8 data = m_apu->sound_r(space, 0x10 + megaduck_sound_offsets[offset]); + uint8_t data = m_apu->sound_r(space, 0x10 + megaduck_sound_offsets[offset]); if ((offset == 0x01) || (offset == 0x02)) return ((data & 0x0f)<<4) | ((data & 0xf0)>>4); else diff --git a/src/mame/machine/gdrom.cpp b/src/mame/machine/gdrom.cpp index 5aead47aae1..abd310e565e 100644 --- a/src/mame/machine/gdrom.cpp +++ b/src/mame/machine/gdrom.cpp @@ -23,7 +23,7 @@ /* Following data contain real command reply obfuscated, it is extracted by such code: - for (UINT32 i = 0, offset = 0; i < length; i++) + for (uint32_t i = 0, offset = 0; i < length; i++) { offset++; offset += GDROM_Cmd71_Reply[offset] - 2; @@ -35,7 +35,7 @@ SysCalls/BIOS uses same extract routine for command 0x72 (14 bytes), but it seems not used on practice */ -static const UINT8 GDROM_Cmd71_Reply[] = +static const uint8_t GDROM_Cmd71_Reply[] = { 0x96, 0x0B, 0x45, 0xF0, 0x7E, 0xFF, 0x3D, 0x06, 0x4D, 0x7D, 0x10, 0xBF, 0x07, 0x00, 0x73, 0xCF, 0x9C, 0x00, 0xBC, 0x0C, 0x1C, 0xAF, 0x1C, 0x30, 0xE7, 0xA7, 0x03, 0xA8, 0x98, 0x00, 0xBD, 0x0F, @@ -106,7 +106,7 @@ static const UINT8 GDROM_Cmd71_Reply[] = void gdrom_device::device_reset() { - static const UINT8 GDROM_Def_Cmd11_Reply[32] = + static const uint8_t GDROM_Def_Cmd11_Reply[32] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x19, 0x00, 0x00, 0x08, 0x53, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x65, 0x76, 0x20, 0x36, 0x2E, 0x34, 0x32, 0x39, 0x39, 0x30, 0x33, 0x31, 0x36 @@ -267,10 +267,10 @@ void gdrom_device::ExecCommand() // // Read data from the device resulting from the execution of a command -void gdrom_device::ReadData( UINT8 *data, int dataLength ) +void gdrom_device::ReadData( uint8_t *data, int dataLength ) { int i; - UINT8 tmp_buffer[2048]; + uint8_t tmp_buffer[2048]; switch ( command[0] ) { @@ -327,7 +327,7 @@ void gdrom_device::ReadData( UINT8 *data, int dataLength ) int len; int in_len; int dptr; - UINT32 tstart; + uint32_t tstart; start_trk = command[2]; if( start_trk == 0 ) @@ -418,7 +418,7 @@ void gdrom_device::ReadData( UINT8 *data, int dataLength ) // // Write data to the CD-ROM device as part of the execution of a command -void gdrom_device::WriteData( UINT8 *data, int dataLength ) +void gdrom_device::WriteData( uint8_t *data, int dataLength ) { switch (command[ 0 ]) { @@ -435,7 +435,7 @@ void gdrom_device::WriteData( UINT8 *data, int dataLength ) // device type definition const device_type GDROM = &device_creator; -gdrom_device::gdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +gdrom_device::gdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atapi_cdrom_device(mconfig, GDROM, "GDROM", tag, owner, clock, "gdrom", __FILE__) { } diff --git a/src/mame/machine/gdrom.h b/src/mame/machine/gdrom.h index f96a5fcea28..954e3b29231 100644 --- a/src/mame/machine/gdrom.h +++ b/src/mame/machine/gdrom.h @@ -14,13 +14,13 @@ class gdrom_device : public atapi_cdrom_device { public: - gdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // Sega GD-ROM handler virtual void ExecCommand() override; - virtual void WriteData( UINT8 *data, int dataLength ) override; - virtual void ReadData( UINT8 *data, int dataLength ) override; + virtual void WriteData( uint8_t *data, int dataLength ) override; + virtual void ReadData( uint8_t *data, int dataLength ) override; protected: virtual void process_buffer() override; @@ -30,10 +30,10 @@ protected: virtual void device_reset() override; private: - UINT8 GDROM_Cmd11_Reply[32]; - UINT32 read_type; // for command 0x30 only - UINT32 data_select; // for command 0x30 only - UINT32 transferOffset; + uint8_t GDROM_Cmd11_Reply[32]; + uint32_t read_type; // for command 0x30 only + uint32_t data_select; // for command 0x30 only + uint32_t transferOffset; }; // device type definition diff --git a/src/mame/machine/harddriv.cpp b/src/mame/machine/harddriv.cpp index 46e075d1414..e28b307dd16 100644 --- a/src/mame/machine/harddriv.cpp +++ b/src/mame/machine/harddriv.cpp @@ -40,7 +40,7 @@ void harddriv_state::device_start() //atarigen_state::machine_start(); /* predetermine memory regions */ - m_adsp_pgm_memory_word = (UINT16 *)(reinterpret_cast(m_adsp_pgm_memory.target()) + 1); + m_adsp_pgm_memory_word = (uint16_t *)(reinterpret_cast(m_adsp_pgm_memory.target()) + 1); init_video(); @@ -140,7 +140,7 @@ WRITE_LINE_MEMBER(harddriv_state::hdmsp_irq_gen) READ16_MEMBER( harddriv_state::hd68k_gsp_io_r ) { - UINT16 result; + uint16_t result; offset = (offset / 2) ^ 1; m_hd34010_host_access = TRUE; result = m_gsp->host_r(space, offset, 0xffff); @@ -167,7 +167,7 @@ WRITE16_MEMBER( harddriv_state::hd68k_gsp_io_w ) READ16_MEMBER( harddriv_state::hd68k_msp_io_r ) { - UINT16 result; + uint16_t result; offset = (offset / 2) ^ 1; m_hd34010_host_access = TRUE; result = m_msp.found() ? m_msp->host_r(space, offset, 0xffff) : 0xffff; @@ -228,8 +228,8 @@ READ16_MEMBER( harddriv_state::hd68k_port0_r ) READ16_MEMBER( harddriv_state::hdc68k_port1_r ) { - UINT16 result = m_a80000->read(); - UINT16 diff = result ^ m_hdc68k_last_port1; + uint16_t result = m_a80000->read(); + uint16_t diff = result ^ m_hdc68k_last_port1; /* if a new shifter position is selected, use it */ /* if it's the same shifter position as last time, go back to neutral */ @@ -256,7 +256,7 @@ READ16_MEMBER( harddriv_state::hdc68k_port1_r ) READ16_MEMBER( harddriv_state::hda68k_port1_r ) { - UINT16 result = m_a80000->read(); + uint16_t result = m_a80000->read(); /* merge in the wheel edge latch bit */ if (m_hdc68k_wheel_edge) @@ -269,7 +269,7 @@ READ16_MEMBER( harddriv_state::hda68k_port1_r ) READ16_MEMBER( harddriv_state::hdc68k_wheel_r ) { /* grab the new wheel value */ - UINT16 new_wheel = m_12badc[0].read_safe(0xffff); + uint16_t new_wheel = m_12badc[0].read_safe(0xffff); /* hack to display the wheel position */ if (space.machine().input().code_pressed(KEYCODE_LSHIFT)) @@ -429,7 +429,7 @@ WRITE16_MEMBER( harddriv_state::hdc68k_wheel_edge_reset_w ) READ16_MEMBER( harddriv_state::hd68k_zram_r ) { - UINT16 data = 0; + uint16_t data = 0; if (ACCESSING_BITS_0_7) data |= m_210e->read(space, offset, mem_mask); @@ -479,7 +479,7 @@ WRITE16_MEMBER( harddriv_state::hdgsp_io_w ) /* detect an enabling of the shift register and force yielding */ if (offset == REG_DPYCTL) { - UINT8 new_shiftreg = (data >> 11) & 1; + uint8_t new_shiftreg = (data >> 11) & 1; if (new_shiftreg != m_last_gsp_shiftreg) { m_last_gsp_shiftreg = new_shiftreg; @@ -527,16 +527,16 @@ WRITE16_MEMBER( harddriv_state::hdgsp_protection_w ) READ16_MEMBER( harddriv_state::hd68k_adsp_program_r ) { - UINT32 word = m_adsp_pgm_memory[offset/2]; + uint32_t word = m_adsp_pgm_memory[offset/2]; return (!(offset & 1)) ? (word >> 16) : (word & 0xffff); } WRITE16_MEMBER( harddriv_state::hd68k_adsp_program_w ) { - UINT32 *base = &m_adsp_pgm_memory[offset/2]; - UINT32 oldword = *base; - UINT16 temp; + uint32_t *base = &m_adsp_pgm_memory[offset/2]; + uint32_t oldword = *base; + uint16_t temp; if (!(offset & 1)) { @@ -618,10 +618,10 @@ TIMER_CALLBACK_MEMBER(harddriv_state::deferred_adsp_bank_switch) if (!commands) commands = fopen("commands.log", "w"); if (commands) { - INT16 *base = (INT16 *)&m_som_memory[param * 0x2000]; - INT16 *end = base + (UINT16)*base; - INT16 *current = base + 1; - INT16 *table = base + 1 + (UINT16)*current++; + int16_t *base = (int16_t *)&m_som_memory[param * 0x2000]; + int16_t *end = base + (uint16_t)*base; + int16_t *current = base + 1; + int16_t *table = base + 1 + (uint16_t)*current++; fprintf(commands, "\n---------------\n"); @@ -635,15 +635,15 @@ TIMER_CALLBACK_MEMBER(harddriv_state::deferred_adsp_bank_switch) fprintf(commands, "Cmd @ %04X = %04X %d-%d @ %d\n", offset, c1, c2, c3, c4); while (current < table) { - UINT32 rslope, lslope; - rslope = (UINT16)*current++, + uint32_t rslope, lslope; + rslope = (uint16_t)*current++, rslope |= *current++ << 16; if (rslope == 0xffffffff) { fprintf(commands, " (end)\n"); break; } - lslope = (UINT16)*current++, + lslope = (uint16_t)*current++, lslope |= *current++ << 16; fprintf(commands, " L=%08X R=%08X count=%d\n", (int)lslope, (int)rslope, (int)*current++); @@ -957,12 +957,12 @@ READ16_MEMBER( harddriv_state::hd68k_ds3_gdata_r ) if (&space.device() == m_maincpu && pc == m_ds3_transfer_pc && !(!m_ds3_g68flag && m_ds3_g68irqs) && !(m_ds3_gflag && m_ds3_gfirqs)) { - UINT32 destaddr = m_maincpu->state_int(M68K_A1); - UINT16 count68k = m_maincpu->state_int(M68K_D1); - UINT16 mstat = m_adsp->state_int(ADSP2100_MSTAT); - UINT16 i6 = m_adsp->state_int((mstat & 1) ? ADSP2100_MR0 : ADSP2100_MR0_SEC); - UINT16 l6 = m_adsp->state_int(ADSP2100_L6) - 1; - UINT16 m7 = m_adsp->state_int(ADSP2100_M7); + uint32_t destaddr = m_maincpu->state_int(M68K_A1); + uint16_t count68k = m_maincpu->state_int(M68K_D1); + uint16_t mstat = m_adsp->state_int(ADSP2100_MSTAT); + uint16_t i6 = m_adsp->state_int((mstat & 1) ? ADSP2100_MR0 : ADSP2100_MR0_SEC); + uint16_t l6 = m_adsp->state_int(ADSP2100_L6) - 1; + uint16_t m7 = m_adsp->state_int(ADSP2100_M7); logerror("%06X:optimizing 68k transfer, %d words\n", m_maincpu->pcbase(), count68k); @@ -1186,7 +1186,7 @@ WRITE16_MEMBER( harddriv_state::hdds3_sdsp_control_w ) /* are we asserting BFORCE? */ if (data & 0x200) { - UINT32 page = (data >> 6) & 7; + uint32_t page = (data >> 6) & 7; m_ds3sdsp->load_boot_data(m_ds3sdsp_region->base() + (0x2000 * page), m_ds3sdsp_pgm_memory); m_ds3sdsp->set_input_line(INPUT_LINE_RESET, PULSE_LINE); data &= ~0x200; @@ -1227,8 +1227,8 @@ WRITE16_MEMBER( harddriv_state::hdds3_xdsp_control_w ) TIMER_DEVICE_CALLBACK_MEMBER( harddriv_state::ds3sdsp_internal_timer_callback ) { - UINT16 period = m_ds3sdsp_regs[0x1d]; - UINT16 scale = m_ds3sdsp_regs[0x1b] + 1; + uint16_t period = m_ds3sdsp_regs[0x1d]; + uint16_t scale = m_ds3sdsp_regs[0x1b] + 1; m_ds3sdsp_internal_timer->adjust(m_ds3sdsp->cycles_to_attotime(period * scale)); @@ -1243,8 +1243,8 @@ void harddriv_state::hdds3sdsp_reset_timer() if (!m_ds3sdsp_timer_en) return; - UINT16 count = m_ds3sdsp_regs[0x1c]; - UINT16 scale = m_ds3sdsp_regs[0x1b] + 1; + uint16_t count = m_ds3sdsp_regs[0x1c]; + uint16_t scale = m_ds3sdsp_regs[0x1b] + 1; m_ds3sdsp_internal_timer->adjust(m_ds3sdsp->cycles_to_attotime(count * scale)); } @@ -1262,8 +1262,8 @@ WRITE_LINE_MEMBER(harddriv_state::hdds3sdsp_timer_enable_callback) TIMER_DEVICE_CALLBACK_MEMBER( harddriv_state::ds3xdsp_internal_timer_callback ) { - UINT16 period = m_ds3xdsp_regs[0x1d]; - UINT16 scale = m_ds3xdsp_regs[0x1b] + 1; + uint16_t period = m_ds3xdsp_regs[0x1d]; + uint16_t scale = m_ds3xdsp_regs[0x1b] + 1; m_ds3xdsp_internal_timer->adjust(m_ds3xdsp->cycles_to_attotime(period * scale)); @@ -1278,8 +1278,8 @@ void harddriv_state::hdds3xdsp_reset_timer() if (!m_ds3xdsp_timer_en) return; - UINT16 count = m_ds3xdsp_regs[0x1c]; - UINT16 scale = m_ds3xdsp_regs[0x1b] + 1; + uint16_t count = m_ds3xdsp_regs[0x1c]; + uint16_t scale = m_ds3xdsp_regs[0x1b] + 1; m_ds3xdsp_internal_timer->adjust(m_ds3xdsp->cycles_to_attotime(count * scale)); } @@ -1447,17 +1447,17 @@ WRITE16_MEMBER( harddriv_state::hdds3_control_w ) READ16_MEMBER( harddriv_state::hd68k_ds3_program_r ) { - UINT32 *base = &m_adsp_pgm_memory[offset & 0x1fff]; - UINT32 word = *base; + uint32_t *base = &m_adsp_pgm_memory[offset & 0x1fff]; + uint32_t word = *base; return (!(offset & 0x2000)) ? (word >> 8) : (word & 0xff); } WRITE16_MEMBER( harddriv_state::hd68k_ds3_program_w ) { - UINT32 *base = &m_adsp_pgm_memory[offset & 0x1fff]; - UINT32 oldword = *base; - UINT16 temp; + uint32_t *base = &m_adsp_pgm_memory[offset & 0x1fff]; + uint32_t oldword = *base; + uint16_t temp; if (!(offset & 0x2000)) { @@ -1582,7 +1582,7 @@ WRITE16_MEMBER( harddriv_state::hd68k_dsk_dsp32_w ) READ16_MEMBER( harddriv_state::hd68k_dsk_dsp32_r ) { - UINT16 result; + uint16_t result; m_dsk_pio_access = TRUE; if (m_dsp32.found()) result = m_dsp32->pio_r(offset); else result = 0x00; @@ -1608,8 +1608,8 @@ WRITE32_MEMBER( harddriv_state::rddsp32_sync0_w ) { if (m_dsk_pio_access) { - UINT32 *dptr = &m_rddsp32_sync[0][offset]; - UINT32 newdata = *dptr; + uint32_t *dptr = &m_rddsp32_sync[0][offset]; + uint32_t newdata = *dptr; COMBINE_DATA(&newdata); m_dataptr[m_next_msp_sync % MAX_MSP_SYNC] = dptr; m_dataval[m_next_msp_sync % MAX_MSP_SYNC] = newdata; @@ -1624,8 +1624,8 @@ WRITE32_MEMBER( harddriv_state::rddsp32_sync1_w ) { if (m_dsk_pio_access) { - UINT32 *dptr = &m_rddsp32_sync[1][offset]; - UINT32 newdata = *dptr; + uint32_t *dptr = &m_rddsp32_sync[1][offset]; + uint32_t newdata = *dptr; COMBINE_DATA(&newdata); m_dataptr[m_next_msp_sync % MAX_MSP_SYNC] = dptr; m_dataval[m_next_msp_sync % MAX_MSP_SYNC] = newdata; @@ -1864,11 +1864,11 @@ WRITE16_MEMBER( harddriv_state::hdgsp_speedup2_w ) READ16_MEMBER( harddriv_state::rdgsp_speedup1_r ) { - UINT16 result = m_gsp_speedup_addr[0][offset]; + uint16_t result = m_gsp_speedup_addr[0][offset]; /* if this address is equal to $f000, spin until something gets written */ if (&space.device() == m_gsp && space.device().safe_pc() == m_gsp_speedup_pc && - (UINT8)result < space.device().state().state_int(TMS34010_A1)) + (uint8_t)result < space.device().state().state_int(TMS34010_A1)) { m_gsp_speedup_count[0]++; space.device().execute().spin_until_interrupt(); diff --git a/src/mame/machine/hec2hrp.cpp b/src/mame/machine/hec2hrp.cpp index fce1e0bb453..950a0a05ae6 100644 --- a/src/mame/machine/hec2hrp.cpp +++ b/src/mame/machine/hec2hrp.cpp @@ -172,7 +172,7 @@ WRITE8_MEMBER(hec2hrp_state::hector_keyboard_w) READ8_MEMBER(hec2hrp_state::hector_keyboard_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset ==7) /* Only when joy reading*/ { @@ -251,7 +251,7 @@ WRITE8_MEMBER(hec2hrp_state::hector_sn_2800_w) READ8_MEMBER(hec2hrp_state::hector_cassette_r) { double level; - UINT8 value=0; + uint8_t value=0; if ((m_state3000 & 0x38) != 0x38 ) /* Selon Sb choix cassette ou timer (74153)*/ { @@ -374,9 +374,9 @@ WRITE8_MEMBER(hec2hrp_state::hector_color_b_w) READ8_MEMBER(hec2hrp_state::hector_io_8255_r) { /* 8255 in mode 0 */ - UINT8 data =0; - UINT8 data_l=0; - UINT8 data_h=0; + uint8_t data =0; + uint8_t data_l=0; + uint8_t data_h=0; if ((offset & 0x3) == 0x0) /* Port A */ @@ -710,7 +710,7 @@ void hec2hrp_state::Init_Value_SN76477_Hector() m_ValMixer = 0; } -void hec2hrp_state::Update_Sound(address_space &space, UINT8 data) +void hec2hrp_state::Update_Sound(address_space &space, uint8_t data) { /* keep device*/ /* MIXER*/ diff --git a/src/mame/machine/hng64_net.cpp b/src/mame/machine/hng64_net.cpp index 44a9ebbfd3b..589d978d2d8 100644 --- a/src/mame/machine/hng64_net.cpp +++ b/src/mame/machine/hng64_net.cpp @@ -15,7 +15,7 @@ #include "includes/hng64.h" #include "cpu/z80/kl5c80a12.h" -UINT8 hng64_state::read_comm_data(UINT32 offset) +uint8_t hng64_state::read_comm_data(uint32_t offset) { if((offset & 0x10000) == 0) return m_comm_rom[offset & 0xffff]; @@ -27,7 +27,7 @@ UINT8 hng64_state::read_comm_data(UINT32 offset) return 0xff; } -void hng64_state::write_comm_data(UINT32 offset,UINT8 data) +void hng64_state::write_comm_data(uint32_t offset,uint8_t data) { if((offset & 0x10000) == 0) { diff --git a/src/mame/machine/hp48.cpp b/src/mame/machine/hp48.cpp index 21b5be8c42d..a8e95d35a45 100644 --- a/src/mame/machine/hp48.cpp +++ b/src/mame/machine/hp48.cpp @@ -54,8 +54,8 @@ static const char *const hp48_module_names[6] = { "HDW (I/O)", "NCE2 (RAM)", "CE1", "CE2", "NCE3", "NCE1 (ROM)" }; /* values returned by C=ID */ -static const UINT8 hp48_module_mask_id[6] = { 0x00, 0x03, 0x05, 0x07, 0x01, 0x00 }; -static const UINT8 hp48_module_addr_id[6] = { 0x19, 0xf4, 0xf6, 0xf8, 0xf2, 0x00 }; +static const uint8_t hp48_module_mask_id[6] = { 0x00, 0x03, 0x05, 0x07, 0x01, 0x00 }; +static const uint8_t hp48_module_addr_id[6] = { 0x19, 0xf4, 0xf6, 0xf8, 0xf2, 0x00 }; @@ -95,7 +95,7 @@ TIMER_CALLBACK_MEMBER(hp48_state::hp48_rs232_byte_recv_cb) } /* outside world initiates a receive event */ -void hp48_state::hp48_rs232_start_recv_byte( UINT8 data ) +void hp48_state::hp48_rs232_start_recv_byte( uint8_t data ) { LOG_SERIAL(( "%f hp48_rs232_start_recv_byte: start receiving, data=%02x\n", machine().time().as_double(), data )); @@ -138,7 +138,7 @@ TIMER_CALLBACK_MEMBER(hp48_state::hp48_rs232_byte_sent_cb) /* CPU initiates a send event */ void hp48_state::hp48_rs232_send_byte( ) { - UINT8 data = HP48_IO_8(0x16); /* byte to send */ + uint8_t data = HP48_IO_8(0x16); /* byte to send */ LOG_SERIAL(( "%s %f hp48_rs232_send_byte: start sending, data=%02x\n", machine().describe_context(), machine().time().as_double(), data )); @@ -394,7 +394,7 @@ WRITE8_MEMBER(hp48_state::hp48_io_w) READ8_MEMBER(hp48_state::hp48_io_r) { - UINT8 data = 0; + uint8_t data = 0; switch( offset ) { @@ -697,12 +697,12 @@ void hp48_state::hp48_apply_modules() /* from lowest to highest priority */ for ( i = 4; i >= 0; i-- ) { - UINT32 select_mask = m_modules[i].mask; - UINT32 nselect_mask = ~select_mask & 0xfffff; - UINT32 base = m_modules[i].base; - UINT32 off_mask = m_modules[i].off_mask; - UINT32 mirror = nselect_mask & ~off_mask; - UINT32 end = base + (off_mask & nselect_mask); + uint32_t select_mask = m_modules[i].mask; + uint32_t nselect_mask = ~select_mask & 0xfffff; + uint32_t base = m_modules[i].base; + uint32_t off_mask = m_modules[i].off_mask; + uint32_t mirror = nselect_mask & ~off_mask; + uint32_t end = base + (off_mask & nselect_mask); char bank[10]; sprintf(bank,"bank%d",i); @@ -890,7 +890,7 @@ WRITE32_MEMBER( hp48_state::hp48_mem_crc ) /* decodes size bytes into 2*size nibbles (least significant first) */ -void hp48_state::hp48_decode_nibble( UINT8* dst, UINT8* src, int size ) +void hp48_state::hp48_decode_nibble( uint8_t* dst, uint8_t* src, int size ) { int i; for ( i=size-1; i >= 0; i-- ) @@ -901,7 +901,7 @@ void hp48_state::hp48_decode_nibble( UINT8* dst, UINT8* src, int size ) } /* inverse of hp48_decode_nibble */ -void hp48_state::hp48_encode_nibble( UINT8* dst, UINT8* src, int size ) +void hp48_state::hp48_encode_nibble( uint8_t* dst, uint8_t* src, int size ) { int i; for ( i=0; i < size; i++ ) @@ -921,7 +921,7 @@ void hp48_port_image_device::hp48_fill_port() hp48_state *state = machine().driver_data(); int size = state->m_port_size[m_port]; LOG(( "hp48_fill_port: %s module=%i size=%i rw=%i\n", tag(), m_module, size, state->m_port_write[m_port] )); - state->m_port_data[m_port] = make_unique_clear(2 * size); + state->m_port_data[m_port] = make_unique_clear(2 * size); state->m_modules[m_module].off_mask = 2 * (( size > 128 * 1024 ) ? 128 * 1024 : size) - 1; state->m_modules[m_module].read = read8_delegate(); state->m_modules[m_module].write = write8_delegate(); @@ -1009,7 +1009,7 @@ void hp48_port_image_device::device_start() hp48_unfill_port(); } -hp48_port_image_device::hp48_port_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hp48_port_image_device::hp48_port_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP48_PORT, "HP48 memory card", tag, owner, clock, "hp48_port_image", __FILE__), device_image_interface(mconfig, *this) { @@ -1051,7 +1051,7 @@ void hp48_state::machine_reset() void hp48_state::hp48_machine_start( hp48_models model ) { - UINT8 *ram; + uint8_t *ram; int ram_size, rom_size, i; LOG(( "hp48_machine_start: model %i\n", model )); @@ -1063,7 +1063,7 @@ void hp48_state::hp48_machine_start( hp48_models model ) HP49_G_MODEL ? (512 * 1024) : HP48_GX_MODEL ? (128 * 1024) : (32 * 1024); - ram = auto_alloc_array(machine(), UINT8, 2 * ram_size); + ram = auto_alloc_array(machine(), uint8_t, 2 * ram_size); machine().device("nvram")->set_base(ram, 2 * ram_size); @@ -1071,7 +1071,7 @@ void hp48_state::hp48_machine_start( hp48_models model ) rom_size = HP49_G_MODEL ? (2048 * 1024) : HP48_S_SERIES ? (256 * 1024) : (512 * 1024); - m_rom = auto_alloc_array(machine(), UINT8, 2 * rom_size); + m_rom = auto_alloc_array(machine(), uint8_t, 2 * rom_size); hp48_decode_nibble( m_rom, memregion( "maincpu" )->base(), rom_size ); /* init state */ diff --git a/src/mame/machine/ie15_kbd.cpp b/src/mame/machine/ie15_kbd.cpp index 7e287ff6553..414b302ed33 100644 --- a/src/mame/machine/ie15_kbd.cpp +++ b/src/mame/machine/ie15_kbd.cpp @@ -14,7 +14,7 @@ ***************************************************************************/ -ie15_keyboard_device::ie15_keyboard_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) +ie15_keyboard_device::ie15_keyboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , m_io_kbd(*this, "TERM_LINE%u", 0) , m_io_kbdc(*this, "TERM_LINEC") @@ -22,7 +22,7 @@ ie15_keyboard_device::ie15_keyboard_device(const machine_config &mconfig, device { } -ie15_keyboard_device::ie15_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ie15_keyboard_device::ie15_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IE15_KEYBOARD, "15WWW-97-006 Keyboard", tag, owner, clock, "ie15_keyboard", __FILE__) , m_io_kbd(*this, "TERM_LINE%u", 0) , m_io_kbdc(*this, "TERM_LINEC") @@ -30,7 +30,7 @@ ie15_keyboard_device::ie15_keyboard_device(const machine_config &mconfig, const { } -UINT8 ie15_keyboard_device::row_number(UINT32 code) +uint8_t ie15_keyboard_device::row_number(uint32_t code) { int row = 0; @@ -39,14 +39,14 @@ UINT8 ie15_keyboard_device::row_number(UINT32 code) return row; } -UINT16 ie15_keyboard_device::keyboard_handler(UINT16 last_code, UINT8 *scan_line) +uint16_t ie15_keyboard_device::keyboard_handler(uint16_t last_code, uint8_t *scan_line) { int i; - UINT32 code = 0; - UINT16 key_code = 0; - UINT16 retVal = 0; - UINT8 ctrl = BIT(m_io_kbdc->read(), 0); - UINT8 shift = BIT(m_io_kbdc->read(), 1); + uint32_t code = 0; + uint16_t key_code = 0; + uint16_t retVal = 0; + uint8_t ctrl = BIT(m_io_kbdc->read(), 0); + uint8_t shift = BIT(m_io_kbdc->read(), 1); i = *scan_line; { @@ -102,7 +102,7 @@ UINT16 ie15_keyboard_device::keyboard_handler(UINT16 last_code, UINT8 *scan_line void ie15_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - UINT16 new_code; + uint16_t new_code; new_code = keyboard_handler(m_last_code, &m_scan_line); if ((m_last_code != new_code) /* && (new_code) */) send_key(new_code); @@ -135,7 +135,7 @@ void ie15_keyboard_device::device_start() { m_keyboard_cb.resolve_safe(); m_timer = timer_alloc(); - m_rom = (UINT8*)memregion("ie15kbd")->base(); + m_rom = (uint8_t*)memregion("ie15kbd")->base(); } void ie15_keyboard_device::device_reset() diff --git a/src/mame/machine/ie15_kbd.h b/src/mame/machine/ie15_kbd.h index 2ecbe4dc7e9..7292dd1ff84 100644 --- a/src/mame/machine/ie15_kbd.h +++ b/src/mame/machine/ie15_kbd.h @@ -42,8 +42,8 @@ class ie15_keyboard_device : public device_t { public: - ie15_keyboard_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); - ie15_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ie15_keyboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); + ie15_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_keyboard_callback(device_t &device, _Object object) { return downcast(device).m_keyboard_cb.set_callback(object); } @@ -58,16 +58,16 @@ protected: virtual void device_start() override; virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void send_key(UINT16 code) { m_keyboard_cb((offs_t)0, code); } + virtual void send_key(uint16_t code) { m_keyboard_cb((offs_t)0, code); } emu_timer *m_timer; private: - virtual UINT16 keyboard_handler(UINT16 last_code, UINT8 *scan_line); - UINT8 row_number(UINT32 code); - UINT16 m_last_code; - UINT8 m_scan_line; - UINT8 m_ruslat; - UINT8 *m_rom; + virtual uint16_t keyboard_handler(uint16_t last_code, uint8_t *scan_line); + uint8_t row_number(uint32_t code); + uint16_t m_last_code; + uint8_t m_scan_line; + uint8_t m_ruslat; + uint8_t *m_rom; devcb_write16 m_keyboard_cb; }; diff --git a/src/mame/machine/igs022.cpp b/src/mame/machine/igs022.cpp index 6a6e45b5c79..49dd549bf55 100644 --- a/src/mame/machine/igs022.cpp +++ b/src/mame/machine/igs022.cpp @@ -12,7 +12,7 @@ #include "igs022.h" -igs022_device::igs022_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +igs022_device::igs022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IGS022, "IGS022", tag, owner, clock, "igs022", __FILE__) { } @@ -28,7 +28,7 @@ void igs022_device::device_validity_check(validity_checker &valid) const void igs022_device::device_start() { // Reset stuff - memset(m_kb_regs, 0, 0x100 * sizeof(UINT32)); + memset(m_kb_regs, 0, 0x100 * sizeof(uint32_t)); m_sharedprotram = nullptr; save_item(NAME(m_kb_regs)); @@ -47,16 +47,16 @@ void igs022_device::device_reset() IGS022_reset(); - memset(m_kb_regs, 0, 0x100 * sizeof(UINT32)); + memset(m_kb_regs, 0, 0x100 * sizeof(uint32_t)); } -void igs022_device::IGS022_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mode) +void igs022_device::IGS022_do_dma(uint16_t src, uint16_t dst, uint16_t size, uint16_t mode) { //printf("igs022_device::IGS022_do_dma\n"); - UINT16 param; + uint16_t param; /* P_SRC =0x300290 (offset from prot rom base) P_DST =0x300292 (words from 0x300000) @@ -90,16 +90,16 @@ void igs022_device::IGS022_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo */ int x; - UINT16 *PROTROM = (UINT16*)memregion(":igs022data")->base(); + uint16_t *PROTROM = (uint16_t*)memregion(":igs022data")->base(); for (x = 0; x < size; x++) { - UINT16 dat2 = PROTROM[src + x]; + uint16_t dat2 = PROTROM[src + x]; - UINT8 extraoffset = param&0xff; - UINT8* dectable = (UINT8*)memregion(":igs022data")->base(); // the basic decryption table is at the start of the mcu data rom! - UINT8 taboff = ((x*2)+extraoffset) & 0xff; // must allow for overflow in instances of odd offsets - UINT16 extraxor = ((dectable[taboff+1]) << 8) | (dectable[taboff+0] << 0); + uint8_t extraoffset = param&0xff; + uint8_t* dectable = (uint8_t*)memregion(":igs022data")->base(); // the basic decryption table is at the start of the mcu data rom! + uint8_t taboff = ((x*2)+extraoffset) & 0xff; // must allow for overflow in instances of odd offsets + uint16_t extraxor = ((dectable[taboff+1]) << 8) | (dectable[taboff+0] << 0); if (mode==4) { @@ -123,7 +123,7 @@ void igs022_device::IGS022_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo if (mode==4) { - //printf("%06x | %04x (%04x)\n", (dst+x)*2, dat2, (UINT16)(dat2-extraxor)); + //printf("%06x | %04x (%04x)\n", (dst+x)*2, dat2, (uint16_t)(dat2-extraxor)); dat2 -= extraxor; } @@ -136,10 +136,10 @@ void igs022_device::IGS022_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo { /* mode 5 seems to be a byteswapped copy */ int x; - UINT16 *PROTROM = (UINT16*)memregion(":igs022data")->base(); + uint16_t *PROTROM = (uint16_t*)memregion(":igs022data")->base(); for (x = 0; x < size; x++) { - UINT16 dat = PROTROM[src + x]; + uint16_t dat = PROTROM[src + x]; dat = ((dat &0x00ff) << 8) | ((dat &0xff00) >> 8); m_sharedprotram[dst + x] = dat; @@ -149,10 +149,10 @@ void igs022_device::IGS022_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo { /* mode 6 seems to be a nibble swapped copy */ int x; - UINT16 *PROTROM = (UINT16*)memregion(":igs022data")->base(); + uint16_t *PROTROM = (uint16_t*)memregion(":igs022data")->base(); for (x = 0; x < size; x++) { - UINT16 dat = PROTROM[src + x]; + uint16_t dat = PROTROM[src + x]; dat = ((dat & 0xf0f0) >> 4)| ((dat & 0x0f0f) << 4); @@ -180,17 +180,17 @@ void igs022_device::IGS022_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo void igs022_device::IGS022_reset() { int i; - UINT16 *PROTROM = (UINT16*)memregion(":igs022data")->base(); + uint16_t *PROTROM = (uint16_t*)memregion(":igs022data")->base(); // fill ram with A5 patern for (i = 0; i < 0x4000/2; i++) m_sharedprotram[i] = 0xa55a; // the auto-dma - UINT16 src = PROTROM[0x100 / 2]; - UINT32 dst = PROTROM[0x102 / 2]; - UINT16 size = PROTROM[0x104 / 2]; - UINT16 mode = PROTROM[0x106 / 2]; + uint16_t src = PROTROM[0x100 / 2]; + uint32_t dst = PROTROM[0x102 / 2]; + uint16_t size = PROTROM[0x104 / 2]; + uint16_t mode = PROTROM[0x106 / 2]; mode &= 0xff; @@ -209,12 +209,12 @@ void igs022_device::IGS022_handle_command() //printf("igs022_device::IGS022_handle_command\n"); - UINT16 cmd = m_sharedprotram[0x200/2]; + uint16_t cmd = m_sharedprotram[0x200/2]; if (cmd == 0x6d) // Store values to asic ram { - UINT32 p1 = (m_sharedprotram[0x298/2] << 16) | m_sharedprotram[0x29a/2]; - UINT32 p2 = (m_sharedprotram[0x29c/2] << 16) | m_sharedprotram[0x29e/2]; + uint32_t p1 = (m_sharedprotram[0x298/2] << 16) | m_sharedprotram[0x29a/2]; + uint32_t p2 = (m_sharedprotram[0x29c/2] << 16) | m_sharedprotram[0x29e/2]; if ((p2 & 0xffff) == 0x9) // Set value { @@ -269,10 +269,10 @@ void igs022_device::IGS022_handle_command() if (cmd == 0x4f) // memcpy with encryption / scrambling { - UINT16 src = m_sharedprotram[0x290 / 2] >> 1; // External mcu data is 8 bit and addressed as such - UINT32 dst = m_sharedprotram[0x292 / 2]; - UINT16 size = m_sharedprotram[0x294 / 2]; - UINT16 mode = m_sharedprotram[0x296 / 2]; + uint16_t src = m_sharedprotram[0x290 / 2] >> 1; // External mcu data is 8 bit and addressed as such + uint32_t dst = m_sharedprotram[0x292 / 2]; + uint16_t size = m_sharedprotram[0x294 / 2]; + uint16_t mode = m_sharedprotram[0x296 / 2]; IGS022_do_dma(src,dst,size,mode); diff --git a/src/mame/machine/igs022.h b/src/mame/machine/igs022.h index 8b5ca3a8b62..40dae410cf4 100644 --- a/src/mame/machine/igs022.h +++ b/src/mame/machine/igs022.h @@ -6,9 +6,9 @@ class igs022_device : public device_t { public: - igs022_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + igs022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT16* m_sharedprotram; + uint16_t* m_sharedprotram; void IGS022_handle_command(); protected: @@ -17,9 +17,9 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT32 m_kb_regs[0x100]; + uint32_t m_kb_regs[0x100]; - void IGS022_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mode); + void IGS022_do_dma(uint16_t src, uint16_t dst, uint16_t size, uint16_t mode); void IGS022_reset(); }; diff --git a/src/mame/machine/igs025.cpp b/src/mame/machine/igs025.cpp index e7ac5803c58..544c62d662a 100644 --- a/src/mame/machine/igs025.cpp +++ b/src/mame/machine/igs025.cpp @@ -16,7 +16,7 @@ #include "igs025.h" -igs025_device::igs025_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +igs025_device::igs025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IGS025, "IGS025", tag, owner, clock, "igs_025_022", __FILE__) { m_execute_external = igs025_execute_external(FUNC(igs025_device::no_callback_setup), this); @@ -339,7 +339,7 @@ void igs025_device::killbld_protection_calculate_hold(int y, int z) void igs025_device::killbld_protection_calculate_hilo() { - UINT8 source; + uint8_t source; m_kb_prot_hilo_select++; diff --git a/src/mame/machine/igs025.h b/src/mame/machine/igs025.h index 32c0a483fd0..5373ed2fdc3 100644 --- a/src/mame/machine/igs025.h +++ b/src/mame/machine/igs025.h @@ -13,13 +13,13 @@ typedef device_delegate igs025_execute_external; class igs025_device : public device_t { public: - igs025_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + igs025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( killbld_igs025_prot_r ); // use setters instead of making public? - const UINT8 (*m_kb_source_data)[0xec]; - UINT32 m_kb_game_id; - UINT32 m_kb_region; + const uint8_t (*m_kb_source_data)[0xec]; + uint32_t m_kb_game_id; + uint32_t m_kb_region; igs025_execute_external m_execute_external; @@ -37,14 +37,14 @@ protected: virtual void device_reset() override; - UINT16 m_kb_prot_hold; - UINT16 m_kb_prot_hilo; - UINT16 m_kb_prot_hilo_select; + uint16_t m_kb_prot_hold; + uint16_t m_kb_prot_hilo; + uint16_t m_kb_prot_hilo_select; int m_kb_cmd; int m_kb_reg; int m_kb_ptr; - UINT8 m_kb_swap; + uint8_t m_kb_swap; void killbld_protection_calculate_hilo(); void killbld_protection_calculate_hold(int y, int z); @@ -52,8 +52,8 @@ protected: void no_callback_setup(void); - UINT16 m_olds_bs; - UINT16 m_kb_cmd3; + uint16_t m_olds_bs; + uint16_t m_kb_cmd3; }; diff --git a/src/mame/machine/igs028.cpp b/src/mame/machine/igs028.cpp index 5e71c2bff64..9ce225d5783 100644 --- a/src/mame/machine/igs028.cpp +++ b/src/mame/machine/igs028.cpp @@ -11,7 +11,7 @@ #include "igs028.h" -igs028_device::igs028_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +igs028_device::igs028_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IGS028, "IGS028", tag, owner, clock, "igs028", __FILE__) { } @@ -53,7 +53,7 @@ void igs028_device::device_reset() } -UINT32 igs028_device::olds_prot_addr(UINT16 addr) +uint32_t igs028_device::olds_prot_addr(uint16_t addr) { switch (addr & 0xff) { @@ -74,22 +74,22 @@ UINT32 igs028_device::olds_prot_addr(UINT16 addr) return 0; } -UINT32 igs028_device::olds_read_reg(UINT16 addr) +uint32_t igs028_device::olds_read_reg(uint16_t addr) { - UINT32 protaddr = (olds_prot_addr(addr) - 0x400000) / 2; + uint32_t protaddr = (olds_prot_addr(addr) - 0x400000) / 2; return m_sharedprotram[protaddr] << 16 | m_sharedprotram[protaddr + 1]; } -void igs028_device::olds_write_reg( UINT16 addr, UINT32 val ) +void igs028_device::olds_write_reg( uint16_t addr, uint32_t val ) { m_sharedprotram[((olds_prot_addr(addr) - 0x400000) / 2) + 0] = val >> 16; m_sharedprotram[((olds_prot_addr(addr) - 0x400000) / 2) + 1] = val & 0xffff; } -void igs028_device::IGS028_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mode) +void igs028_device::IGS028_do_dma(uint16_t src, uint16_t dst, uint16_t size, uint16_t mode) { - UINT16 param = mode >> 8; - UINT16 *PROTROM = (UINT16*)memregion(":user1")->base(); + uint16_t param = mode >> 8; + uint16_t *PROTROM = (uint16_t*)memregion(":user1")->base(); // logerror ("mode: %2.2x, src: %4.4x, dst: %4.4x, size: %4.4x, data: %4.4x\n", (mode &0xf), src, dst, size, mode); @@ -111,12 +111,12 @@ void igs028_device::IGS028_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo case 0x07: // unused? { - UINT8 extraoffset = param & 0xff; - UINT8 *dectable = (UINT8 *)(PROTROM + (0x100 / 2)); + uint8_t extraoffset = param & 0xff; + uint8_t *dectable = (uint8_t *)(PROTROM + (0x100 / 2)); - for (INT32 x = 0; x < size; x++) + for (int32_t x = 0; x < size; x++) { - UINT16 dat2 = PROTROM[src + x]; + uint16_t dat2 = PROTROM[src + x]; int taboff = ((x*2)+extraoffset) & 0xff; // must allow for overflow in instances of odd offsets unsigned short extraxor = ((dectable[taboff + 0]) << 0) | (dectable[taboff + 1] << 8); @@ -129,7 +129,7 @@ void igs028_device::IGS028_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo else { // if other modes are used we need to know about them - UINT16 extraxor2 = 0; + uint16_t extraxor2 = 0; if ((x & 0x003) == 0x000) extraxor2 |= 0x0049; // 'I' if ((x & 0x003) == 0x001) extraxor2 |= 0x0047; // 'G' if ((x & 0x003) == 0x002) extraxor2 |= 0x0053; // 'S' @@ -142,7 +142,7 @@ void igs028_device::IGS028_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo if ((x & 0x300) == 0x300) extraxor2 |= 0x2000; // ' ' - printf("mode %d - %04x (%04x %04x %04x - %04x %04x %04x - %04x %04x \n", mode, dat2, (UINT16)(dat2-extraxor), (UINT16)(dat2+extraxor), (UINT16)(dat2^extraxor), (UINT16)(dat2-extraxor2), (UINT16)(dat2+extraxor2), (UINT16)(dat2^extraxor2), ((dat2 & 0xf0f0) >> 4)|((dat2 & 0x0f0f) << 4), ((dat2 &0x00ff) << 8) | ((dat2 &0xff00) >> 8) ); + printf("mode %d - %04x (%04x %04x %04x - %04x %04x %04x - %04x %04x \n", mode, dat2, (uint16_t)(dat2-extraxor), (uint16_t)(dat2+extraxor), (uint16_t)(dat2^extraxor), (uint16_t)(dat2-extraxor2), (uint16_t)(dat2+extraxor2), (uint16_t)(dat2^extraxor2), ((dat2 & 0xf0f0) >> 4)|((dat2 & 0x0f0f) << 4), ((dat2 &0x00ff) << 8) | ((dat2 &0xff00) >> 8) ); dat2 = 0x4e75; // hack } @@ -158,7 +158,7 @@ void igs028_device::IGS028_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mo void igs028_device::IGS028_handle() { - UINT16 cmd = m_sharedprotram[0x3026 / 2]; + uint16_t cmd = m_sharedprotram[0x3026 / 2]; // logerror ("command: %x\n", cmd); @@ -166,10 +166,10 @@ void igs028_device::IGS028_handle() { case 0x12: { - UINT16 mode = m_sharedprotram[0x303e / 2]; // ? - UINT16 src = m_sharedprotram[0x306a / 2] >> 1; // ? - UINT16 dst = m_sharedprotram[0x3084 / 2] & 0x1fff; - UINT16 size = m_sharedprotram[0x30a2 / 2] & 0x1fff; + uint16_t mode = m_sharedprotram[0x303e / 2]; // ? + uint16_t src = m_sharedprotram[0x306a / 2] >> 1; // ? + uint16_t dst = m_sharedprotram[0x3084 / 2] & 0x1fff; + uint16_t size = m_sharedprotram[0x30a2 / 2] & 0x1fff; IGS028_do_dma(src, dst, size, mode); } @@ -177,10 +177,10 @@ void igs028_device::IGS028_handle() case 0x64: // incomplete? { - UINT16 p1 = m_sharedprotram[0x3050 / 2]; - UINT16 p2 = m_sharedprotram[0x3082 / 2]; - UINT16 p3 = m_sharedprotram[0x3054 / 2]; - UINT16 p4 = m_sharedprotram[0x3088 / 2]; + uint16_t p1 = m_sharedprotram[0x3050 / 2]; + uint16_t p2 = m_sharedprotram[0x3082 / 2]; + uint16_t p3 = m_sharedprotram[0x3054 / 2]; + uint16_t p4 = m_sharedprotram[0x3088 / 2]; if (p2 == 0x02) olds_write_reg(p1, olds_read_reg(p1) + 0x10000); diff --git a/src/mame/machine/igs028.h b/src/mame/machine/igs028.h index 42269cabc0f..f5b7d68c813 100644 --- a/src/mame/machine/igs028.h +++ b/src/mame/machine/igs028.h @@ -7,9 +7,9 @@ class igs028_device : public device_t { public: - igs028_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + igs028_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT16* m_sharedprotram; + uint16_t* m_sharedprotram; void IGS028_handle(void); @@ -19,10 +19,10 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT32 olds_prot_addr(UINT16 addr); - UINT32 olds_read_reg(UINT16 addr); - void olds_write_reg( UINT16 addr, UINT32 val ); - void IGS028_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mode); + uint32_t olds_prot_addr(uint16_t addr); + uint32_t olds_read_reg(uint16_t addr); + void olds_write_reg( uint16_t addr, uint32_t val ); + void IGS028_do_dma(uint16_t src, uint16_t dst, uint16_t size, uint16_t mode); }; diff --git a/src/mame/machine/igs036crypt.cpp b/src/mame/machine/igs036crypt.cpp index 7f837e9f755..3f1785ff467 100644 --- a/src/mame/machine/igs036crypt.cpp +++ b/src/mame/machine/igs036crypt.cpp @@ -60,7 +60,7 @@ TO-DO: complete the table with the 20-bytes values *****************************************************************************/ -igs036_decryptor::igs036_decryptor(const UINT16* game_key) +igs036_decryptor::igs036_decryptor(const uint16_t* game_key) : key(game_key) { } @@ -68,14 +68,14 @@ igs036_decryptor::igs036_decryptor(const UINT16* game_key) void igs036_decryptor::decrypter_rom(memory_region* region) { int size = region->bytes(); - UINT16* rom = (UINT16*)region->base(); + uint16_t* rom = (uint16_t*)region->base(); for (int i = 0; i < size / 2; i++) { rom[i] = decrypt(rom[i], i); } } -UINT16 igs036_decryptor::decrypt(UINT16 cipherword, int word_address)const +uint16_t igs036_decryptor::decrypt(uint16_t cipherword, int word_address)const { // key-independent manipulation int aux = deobfuscate(cipherword, word_address); @@ -93,7 +93,7 @@ UINT16 igs036_decryptor::decrypt(UINT16 cipherword, int word_address)const return aux^0x1a3a; } -UINT16 igs036_decryptor::deobfuscate(UINT16 cipherword, int word_address)const +uint16_t igs036_decryptor::deobfuscate(uint16_t cipherword, int word_address)const { // key-independent manipulation int shift = rotation(word_address); @@ -155,17 +155,17 @@ int igs036_decryptor::rot_group(int address, const int* group)const return (aux*2)-1; } -UINT16 igs036_decryptor::rol(UINT16 num, int shift)const +uint16_t igs036_decryptor::rol(uint16_t num, int shift)const { - UINT16 r = num<>(16-shift); + uint16_t r = num<>(16-shift); return r|l; } // the triggers describe under what conditions are every one of the 16 XORs activated -const UINT16 igs036_decryptor::triggers[16][2] = { +const uint16_t igs036_decryptor::triggers[16][2] = { {0x0001, 0x0000}, {0x0008, 0x0008}, {0x0002, 0x0000}, {0x0004, 0x0004}, {0x0100, 0x0000}, {0x0200, 0x0000}, {0x0400, 0x0000}, {0x0800, 0x0800}, {0x1001, 0x0001}, {0x2002, 0x2000}, {0x4004, 0x4000}, {0x8008, 0x0000}, // (the one at index #10 is a guess; his effect is not observed in any game) @@ -234,7 +234,7 @@ int (*igs036_decryptor::rot_direction[4][8])(int) = { // while simple, seems to be pretty robust, so few errors should be expected, // if any. The only exception is DDPDOJ (see below). -const UINT16 orleg2_key[0x100] = { +const uint16_t orleg2_key[0x100] = { 0x8100, 0x9202, 0x3000, 0x1200, 0x0100, 0x0800, 0x2100, 0xab05, 0x130a, 0xba0a, 0x0308, 0x9200, 0x8306, 0xab0f, 0x200c, 0x0301, 0x9010, 0x1b13, 0x1310, 0x1b11, 0x8104, 0x0212, 0x8204, 0x8214, @@ -269,7 +269,7 @@ const UINT16 orleg2_key[0x100] = { 0x121a, 0x80a0, 0x1238, 0x0000, 0x82ba, 0x0030, 0xc0c0, 0x4264, }; -const UINT16 m312cn_key[0x100] = { +const uint16_t m312cn_key[0x100] = { 0x1102, 0x1103, 0x1000, 0xb101, 0x2100, 0x2802, 0xa000, 0x0901, 0x000a, 0x8101, 0xa000, 0x2909, 0x000e, 0x2004, 0x210c, 0x2909, 0x8000, 0x0903, 0x0100, 0x8901, 0x0100, 0x8814, 0x8110, 0x0810, @@ -304,7 +304,7 @@ const UINT16 m312cn_key[0x100] = { 0xc0e2, 0xc0c0, 0x0028, 0x9191, 0x80b2, 0x0020, 0x4040, 0x80b0, }; -const UINT16 cjddzsp_key[0x100] = { +const uint16_t cjddzsp_key[0x100] = { 0x0142, 0x3903, 0xb0c0, 0x0040, 0x8006, 0xa145, 0x2004, 0x0141, 0x21c0, 0xa1c1, 0x0048, 0x8141, 0x8182, 0x884a, 0x2184, 0x0040, 0x8102, 0x98d2, 0x8180, 0x8941, 0x80d2, 0x0151, 0x01c0, 0x8901, @@ -339,7 +339,7 @@ const UINT16 cjddzsp_key[0x100] = { 0x4082, 0xd9d9, 0x5110, 0x4000, 0xc164, 0x41c7, 0xc050, 0xc9bd, }; -const UINT16 cjdh2_key[0x100] = { +const uint16_t cjdh2_key[0x100] = { 0x1180, 0x2983, 0x8080, 0x3981, 0x2182, 0x2181, 0x2100, 0x2901, 0x2182, 0x198b, 0xa008, 0x8181, 0x0106, 0xa000, 0x018c, 0x880c, 0x1110, 0x8101, 0x1190, 0x9890, 0x8090, 0x0812, 0x8014, 0x0111, @@ -374,7 +374,7 @@ const UINT16 cjdh2_key[0x100] = { 0x517a, 0x41e3, 0xd0d8, 0x49c9, 0xc1e6, 0x891d, 0x4044, 0x0125, }; -const UINT16 kov3_key[0x100] = { +const uint16_t kov3_key[0x100] = { 0x9100, 0x0202, 0x0200, 0xb101, 0x2306, 0x8004, 0x0104, 0x2b01, 0x8100, 0x3a0a, 0xa108, 0x2b09, 0x8206, 0x2b0f, 0xa004, 0x2b09, 0x9110, 0x0b03, 0x8200, 0x1b11, 0x8306, 0x0010, 0x8304, 0x0814, @@ -409,7 +409,7 @@ const UINT16 kov3_key[0x100] = { 0x1010, 0x4b6b, 0x1318, 0x5371, 0x023e, 0x0327, 0x0314, 0xc3d5, }; -const UINT16 kov2_key[0x100] = { +const uint16_t kov2_key[0x100] = { 0x1000, 0x3101, 0x9300, 0x0101, 0xa100, 0x8804, 0x8100, 0x2000, 0x0100, 0x1101, 0xb208, 0xa101, 0x8100, 0x0b0f, 0x200c, 0x0305, 0x0000, 0x9b13, 0x8000, 0x9911, 0x0302, 0x8804, 0x8200, 0x8a10, @@ -449,7 +449,7 @@ const UINT16 kov2_key[0x100] = { // more probable for this key to still contain errors than for the // other ones. -const UINT16 ddpdoj_key[0x100] = { +const uint16_t ddpdoj_key[0x100] = { 0xb102, 0x8802, 0x0000, 0x9101, 0x2004, 0xa105, 0x0000, 0x8905, 0x8102, 0x2000, 0x3000, 0x3808, 0x210e, 0xa006, 0x800c, 0xa004, 0x9110, 0x9911, 0x9010, 0x8800, 0x8006, 0x0901, 0x8114, 0x0115, diff --git a/src/mame/machine/igs036crypt.h b/src/mame/machine/igs036crypt.h index 2ae858e8389..c4d559f48d0 100644 --- a/src/mame/machine/igs036crypt.h +++ b/src/mame/machine/igs036crypt.h @@ -8,30 +8,30 @@ class igs036_decryptor { public: - igs036_decryptor(const UINT16* game_key); + igs036_decryptor(const uint16_t* game_key); void decrypter_rom(memory_region* region); - UINT16 decrypt(UINT16 cipherword, int word_address)const; - UINT16 deobfuscate(UINT16 cipherword, int word_address)const; + uint16_t decrypt(uint16_t cipherword, int word_address)const; + uint16_t deobfuscate(uint16_t cipherword, int word_address)const; private: - const UINT16* key; + const uint16_t* key; static int (*rot_enabling[16][4])(int); static int (*rot_direction[4][8])(int); - static const UINT16 triggers[16][2]; + static const uint16_t triggers[16][2]; int rotation(int address)const; - UINT16 rol(UINT16 num, int shift)const; + uint16_t rol(uint16_t num, int shift)const; int rot_enabled(int address, const int* group)const ; int rot_group(int address, const int* group)const; }; -extern const UINT16 orleg2_key[0x100]; -extern const UINT16 m312cn_key[0x100]; -extern const UINT16 cjddzsp_key[0x100]; -extern const UINT16 cjdh2_key[0x100]; -extern const UINT16 kov3_key[0x100]; -extern const UINT16 kov2_key[0x100]; -extern const UINT16 ddpdoj_key[0x100]; +extern const uint16_t orleg2_key[0x100]; +extern const uint16_t m312cn_key[0x100]; +extern const uint16_t cjddzsp_key[0x100]; +extern const uint16_t cjdh2_key[0x100]; +extern const uint16_t kov3_key[0x100]; +extern const uint16_t kov2_key[0x100]; +extern const uint16_t ddpdoj_key[0x100]; #endif diff --git a/src/mame/machine/inder_sb.cpp b/src/mame/machine/inder_sb.cpp index daddc97e6f4..66d297641d4 100644 --- a/src/mame/machine/inder_sb.cpp +++ b/src/mame/machine/inder_sb.cpp @@ -11,7 +11,7 @@ extern const device_type INDER_AUDIO = &device_creator; -inder_sb_device::inder_sb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +inder_sb_device::inder_sb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INDER_AUDIO, "Inder 4xDAC Sound Board", tag, owner, clock, "indersb", __FILE__), device_mixer_interface(mconfig, *this, 2), m_audiocpu(*this, "audiocpu"), diff --git a/src/mame/machine/inder_sb.h b/src/mame/machine/inder_sb.h index fab1b67ce30..87bed3d80ea 100644 --- a/src/mame/machine/inder_sb.h +++ b/src/mame/machine/inder_sb.h @@ -25,7 +25,7 @@ class inder_sb_device : public device_t, { public: // construction/destruction - inder_sb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + inder_sb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_audiocpu; required_device m_ctc; @@ -53,11 +53,11 @@ public: DECLARE_READ16_MEMBER(megaphx_0x050002_r); DECLARE_WRITE16_MEMBER(megaphx_0x050000_w); - UINT8 m_soundbank[4]; + uint8_t m_soundbank[4]; int m_soundsent; - UINT8 m_sounddata; - UINT8 m_soundback; + uint8_t m_sounddata; + uint8_t m_soundback; void install_sound_hacks(void); void update_sound_irqs(void); diff --git a/src/mame/machine/inder_vid.cpp b/src/mame/machine/inder_vid.cpp index 5d4ee0b79f9..2e3a7680a61 100644 --- a/src/mame/machine/inder_vid.cpp +++ b/src/mame/machine/inder_vid.cpp @@ -13,7 +13,7 @@ extern const device_type INDER_VIDEO = &device_creator; -inder_vid_device::inder_vid_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +inder_vid_device::inder_vid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INDER_VIDEO, "Inder / Dinamic TMS Video", tag, owner, clock, "indervd", __FILE__), /* device_video_interface(mconfig, *this, false), */ m_vram(*this, "vram"), @@ -37,8 +37,8 @@ ADDRESS_MAP_END TMS340X0_SCANLINE_RGB32_CB_MEMBER(inder_vid_device::scanline) { - UINT16 *vram = &m_vram[(params->rowaddr << 8) & 0x3ff00]; - UINT32 *dest = &bitmap.pix32(scanline); + uint16_t *vram = &m_vram[(params->rowaddr << 8) & 0x3ff00]; + uint32_t *dest = &bitmap.pix32(scanline); const pen_t *paldata = m_palette->pens(); @@ -47,7 +47,7 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(inder_vid_device::scanline) for (x = params->heblnk; x < params->hsblnk; x += 2) { - UINT16 pixels = vram[coladdr++ & 0xff]; + uint16_t pixels = vram[coladdr++ & 0xff]; dest[x + 0] = paldata[pixels & 0xff]; dest[x + 1] = paldata[pixels >> 8]; } diff --git a/src/mame/machine/inder_vid.h b/src/mame/machine/inder_vid.h index f8c850ed9c1..581ba051228 100644 --- a/src/mame/machine/inder_vid.h +++ b/src/mame/machine/inder_vid.h @@ -26,9 +26,9 @@ class inder_vid_device : public device_t { public: // construction/destruction - inder_vid_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + inder_vid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_device m_palette; required_device m_tms; diff --git a/src/mame/machine/intv.cpp b/src/mame/machine/intv.cpp index 0e5d05071cf..72ee38838e0 100644 --- a/src/mame/machine/intv.cpp +++ b/src/mame/machine/intv.cpp @@ -15,12 +15,12 @@ WRITE16_MEMBER( intv_state::intvkbd_dualport16_w ) /* copy the LSB over to the 6502 OP RAM, in case they are opcodes */ RAM = m_region_keyboard->base(); - RAM[offset] = (UINT8) (data >> 0); + RAM[offset] = (uint8_t) (data >> 0); } READ8_MEMBER( intv_state::intvkbd_dualport8_lsb_r ) { - return (UINT8) (m_intvkbd_dualport_ram[offset] >> 0); + return (uint8_t) (m_intvkbd_dualport_ram[offset] >> 0); } WRITE8_MEMBER( intv_state::intvkbd_dualport8_lsb_w ) @@ -28,7 +28,7 @@ WRITE8_MEMBER( intv_state::intvkbd_dualport8_lsb_w ) unsigned char *RAM; m_intvkbd_dualport_ram[offset] &= ~0x00FF; - m_intvkbd_dualport_ram[offset] |= ((UINT16) data) << 0; + m_intvkbd_dualport_ram[offset] |= ((uint16_t) data) << 0; /* copy over to the 6502 OP RAM, in case they are opcodes */ RAM = m_region_keyboard->base(); @@ -405,7 +405,7 @@ TIMER_CALLBACK_MEMBER(intv_state::intv_interrupt_complete) TIMER_CALLBACK_MEMBER(intv_state::intv_btb_fill) { - UINT8 row = m_backtab_row; + uint8_t row = m_backtab_row; //m_maincpu->adjust_icount(-STIC_ROW_FETCH); for (int column = 0; column < STIC_BACKTAB_WIDTH; column++) diff --git a/src/mame/machine/irem_cpu.cpp b/src/mame/machine/irem_cpu.cpp index b46ee68ff39..f80afa1bf74 100644 --- a/src/mame/machine/irem_cpu.cpp +++ b/src/mame/machine/irem_cpu.cpp @@ -59,7 +59,7 @@ #define xxxx 0x90 /* Unknown */ // gunforce, kengo, hasamu -const UINT8 gunforce_decryption_table[256] = { +const uint8_t gunforce_decryption_table[256] = { 0xff,xxxx,xxxx,0x2c,xxxx,xxxx,0x43,0x88, xxxx,0x13,0x0a,0xbd,0xba,0x60,0xea,xxxx, /* 00 */ xxxx,xxxx,0xf2,0x29,0xb3,0x22,xxxx,0x0c, 0xa9,0x5f,0x9d,0x07,xxxx,xxxx,0x0b,0xbb, /* 10 */ 0x8a,xxxx,xxxx,xxxx,0x3a,0x3c,0x5a,0x38, 0x99,xxxx,0xf8,0x89,xxxx,0x91,xxxx,0x55, /* 20 */ @@ -94,7 +94,7 @@ const UINT8 gunforce_decryption_table[256] = { // 0x00 is NOT 0x20 (no context in bomberman) // bmaster, bomberman -const UINT8 bomberman_decryption_table[256] = { +const uint8_t bomberman_decryption_table[256] = { xxxx,xxxx,0x79,xxxx,0x9d,0x48,xxxx,xxxx, xxxx,xxxx,0x2e,xxxx,xxxx,0xa5,0x72,xxxx, /* 00 */ 0x46,0x5b,0xb1,0x3a,0xc3,xxxx,0x35,xxxx, xxxx,0x23,xxxx,0x99,xxxx,0x05,xxxx,0x3c, /* 10 */ 0x3b,0x76,0x11,xxxx,xxxx,0x4b,xxxx,0x92, xxxx,0x32,0x5d,xxxx,0xf7,0x5a,0x9c,xxxx, /* 20 */ @@ -115,7 +115,7 @@ const UINT8 bomberman_decryption_table[256] = { // 49 -> 4a (verified in a bombrman PCB) // lethalth, gunforc2, quizf1 -const UINT8 lethalth_decryption_table[256] = { +const uint8_t lethalth_decryption_table[256] = { 0x7f,0x26,0x5d,xxxx,0xba,xxxx,0x1e,0x5e, 0xb8,0x49,0xbc,0xe8,0x01,xxxx,0x4a,0x25, /* 00 */ // ssss !!!! !!!! !!!! !!!! !!!! !!!! gggg !!!! !!!! !!!! !!!! xxxx,0xbd,xxxx,0x22,0x10,xxxx,0x02,0x57, 0x70,xxxx,0x7c,xxxx,0xe7,0x52,xxxx,0xa9, /* 10 */ @@ -203,7 +203,7 @@ b0 -> 0x63 (11479) // 0xc5 (0x7a) completely in the dark (game start after car seelction) // uccops, dynablaster -const UINT8 dynablaster_decryption_table[256] = { +const uint8_t dynablaster_decryption_table[256] = { 0x1f,0x51,0x84,xxxx,0x3d,0x09,0x0d,xxxx, xxxx,0x57,xxxx,xxxx,xxxx,0x32,0x11,xxxx, /* 00 */ xxxx,0x9c,xxxx,xxxx,0x4b,xxxx,xxxx,0x03, xxxx,xxxx,xxxx,0x89,0xb0,xxxx,xxxx,xxxx, /* 10 */ xxxx,0xbb,0x18,0xbe,0x53,0x21,0x55,0x7c, xxxx,xxxx,0x47,0x58,0xf6,xxxx,xxxx,0xb2, /* 20 */ @@ -238,7 +238,7 @@ const UINT8 dynablaster_decryption_table[256] = { /* note: mysticrib sound is identical revision to bbmanw sound code */ // mysticri -const UINT8 mysticri_decryption_table[256] = { +const uint8_t mysticri_decryption_table[256] = { xxxx,0x57,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0xbf,0x43,xxxx,xxxx,0xb3,xxxx,0xfc,xxxx, /* 00 */ /*r*/ xxxx,xxxx,xxxx,xxxx,xxxx,0x52,0xa3,0x26, xxxx,0xc7,xxxx,0x0f,xxxx,0x0c,xxxx,xxxx, /* 10 */ @@ -266,7 +266,7 @@ const UINT8 mysticri_decryption_table[256] = { // 0x8b (0xb3) needed by mysticrib // majtitl2 -const UINT8 majtitl2_decryption_table[256] = { +const uint8_t majtitl2_decryption_table[256] = { 0x87,xxxx,0x78,0xaa,xxxx,xxxx,xxxx,0x2c, 0x32,0x0a,0x0f,xxxx,0x5e,xxxx,0xc6,0x8a, /* 00 */ 0x33,xxxx,xxxx,xxxx,xxxx,0xea,xxxx,0x72, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x24,0x55, /* 10 */ xxxx,xxxx,xxxx,0x89,0xfb,xxxx,0x59,0x02, xxxx,xxxx,0x5d,xxxx,xxxx,xxxx,0x36,xxxx, /* 20 */ @@ -288,7 +288,7 @@ const UINT8 majtitl2_decryption_table[256] = { // 0x70 (0x2b) not sure, could be 0x1b // hook -const UINT8 hook_decryption_table[256] = { +const uint8_t hook_decryption_table[256] = { 0xb6,0x20,0x22,xxxx,0x0f,0x57,0x59,0xc6, 0xeb,xxxx,0xb0,0xbb,0x3b,xxxx,xxxx,xxxx, /* 00 */ 0x36,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,0xfe,xxxx,xxxx,xxxx,xxxx,xxxx,0xa0, /* 10 */ 0x2e,xxxx,0x0b,xxxx,xxxx,0x58,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,0x80,xxxx,xxxx, /* 20 */ @@ -310,7 +310,7 @@ const UINT8 hook_decryption_table[256] = { // 0xbb (0x2b) not sure, could be 0x1b // rtypeleo, firebarr -const UINT8 rtypeleo_decryption_table[256] = { +const uint8_t rtypeleo_decryption_table[256] = { 0x5d,xxxx,0xc6,xxxx,xxxx,xxxx,0x2a,0x3a,xxxx,xxxx,xxxx,0x86,xxxx,0x22,xxxx,0xf3, /* 00 */ xxxx,xxxx,xxxx,xxxx,xxxx,0x38,0xf7,0x42,0x04,xxxx,xxxx,0x1f,0x4b,xxxx,xxxx,0x58, /* 10 */ 0x57,0x2e,xxxx,xxxx,0x53,xxxx,0xb9,xxxx,xxxx,xxxx,xxxx,xxxx,0x20,0x55,xxxx,0x3d, /* 20 */ @@ -335,7 +335,7 @@ const UINT8 rtypeleo_decryption_table[256] = { // 3d = correct // inthunt -const UINT8 inthunt_decryption_table[256] = { +const uint8_t inthunt_decryption_table[256] = { 0x1f,xxxx,0xbb,0x50,xxxx,0x58,0x42,0x57, xxxx,xxxx,0xe9,xxxx,xxxx,xxxx,xxxx,0x0b, /* 00 */ xxxx,xxxx,0x9d,0x9c,xxxx,xxxx,0x1e,xxxx, xxxx,0xb4,0x5b,xxxx,xxxx,xxxx,xxxx,xxxx, /* 10 */ xxxx,xxxx,0x78,0xc7,xxxx,xxxx,0x83,xxxx, xxxx,0x0c,0xb0,0x04,xxxx,xxxx,xxxx,xxxx, /* 20 */ @@ -357,7 +357,7 @@ const UINT8 inthunt_decryption_table[256] = { // 0xb8 (0x2b) not sure, could be 0x1b // gussun -const UINT8 gussun_decryption_table[256] = { +const uint8_t gussun_decryption_table[256] = { 0x63,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0xa8,xxxx,xxxx, /* 00 */ // gggg gggg gggg gggg xxxx,xxxx,0x75,0x24,0x08,0x83,0x32,0xe9, xxxx,0x79,xxxx,0x8f,0x22,xxxx,0xac,xxxx, /* 10 */ @@ -504,7 +504,7 @@ ret */ // leagueman, wpksoc -const UINT8 leagueman_decryption_table[256] = { +const uint8_t leagueman_decryption_table[256] = { xxxx,xxxx,xxxx,0x55,0xbb,xxxx,0x23,0x79, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x38,xxxx, /* 00 */ 0xf7,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0x3d,xxxx,xxxx,xxxx,0xba,xxxx,0x1e,xxxx, /* 10 */ 0x2c,0x46,xxxx,0xb5,xxxx,0x4b,xxxx,0xfe, xxxx,xxxx,0xfb,0x2e,xxxx,xxxx,0x36,0x04, /* 20 */ @@ -526,7 +526,7 @@ const UINT8 leagueman_decryption_table[256] = { // fixed 0x10 = 0xf7 mapping // psoldier -const UINT8 psoldier_decryption_table[256] = { +const uint8_t psoldier_decryption_table[256] = { xxxx,xxxx,xxxx,0x8a,xxxx,0xaa,xxxx,xxxx, xxxx,0x20,0x23,0x55,xxxx,0xb5,0x0a,xxxx, /* 00 */ xxxx,0x46,xxxx,0xb6,xxxx,0x74,0x8b,xxxx, xxxx,0xba,0xf7,xxxx,xxxx,0x5a,0x86,0xfb, /* 10 */ 0xb2,xxxx,0xb0,xxxx,0x42,0x06,0x1e,0x08, 0x22,0x9d,xxxx,xxxx,xxxx,xxxx,xxxx,0x73, /* 20 */ @@ -548,7 +548,7 @@ const UINT8 psoldier_decryption_table[256] = { // fixed 0x1a = 0xf7 mapping // dsoccr94 -const UINT8 dsoccr94_decryption_table[256] = { +const uint8_t dsoccr94_decryption_table[256] = { xxxx,0xd1,xxxx,xxxx,xxxx,0x79,0x2e,xxxx, xxxx,xxxx,0x5a,0x0f,xxxx,xxxx,0x43,xxxx, /* 00 */ xxxx,xxxx,0xe8,0x50,xxxx,xxxx,xxxx,0xa0, 0x5d,0x22,xxxx,xxxx,0xb2,0x3a,xxxx,xxxx, /* 10 */ 0xf6,0x8a,0x41,xxxx,xxxx,0x81,xxxx,xxxx, xxxx,xxxx,0x2b,0x58,xxxx,xxxx,xxxx,0xc6, /* 20 */ @@ -574,7 +574,7 @@ const UINT8 dsoccr94_decryption_table[256] = { /* preliminary table by Pierpaolo Prazzoli */ // matchit2 -const UINT8 matchit2_decryption_table[256] = { +const uint8_t matchit2_decryption_table[256] = { xxxx,0x86,0x0a,xxxx,0x32,0x01,0x81,0xbe, 0xea,xxxx,0xbb,xxxx,xxxx,xxxx,0xa5,0xf6, /* 00 */ // new new new new new new new new new 0x5d,0x8c,0xf3,0xc4,0x42,0x5a,0x22,0x26, xxxx,0x58,xxxx,0xfd,0x59,0x53,0x80,0x09, /* 10 */ @@ -642,7 +642,7 @@ the ones marked with "new" are checked against dynablst and bomberman tables */ -const UINT8 test_decryption_table[256] = { +const uint8_t test_decryption_table[256] = { xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 00 */ xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 10 */ xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 20 */ diff --git a/src/mame/machine/irem_cpu.h b/src/mame/machine/irem_cpu.h index d14ab4dab95..8d1cf2d3edf 100644 --- a/src/mame/machine/irem_cpu.h +++ b/src/mame/machine/irem_cpu.h @@ -1,19 +1,19 @@ // license:BSD-3-Clause // copyright-holders:Bryan McPhail -extern const UINT8 gunforce_decryption_table[]; -extern const UINT8 bomberman_decryption_table[]; -extern const UINT8 lethalth_decryption_table[]; -extern const UINT8 dynablaster_decryption_table[]; -extern const UINT8 mysticri_decryption_table[]; -extern const UINT8 majtitl2_decryption_table[]; -extern const UINT8 hook_decryption_table[]; -extern const UINT8 rtypeleo_decryption_table[]; -extern const UINT8 inthunt_decryption_table[]; -extern const UINT8 gussun_decryption_table[]; -extern const UINT8 leagueman_decryption_table[]; -extern const UINT8 psoldier_decryption_table[]; -extern const UINT8 dsoccr94_decryption_table[]; -extern const UINT8 matchit2_decryption_table[]; +extern const uint8_t gunforce_decryption_table[]; +extern const uint8_t bomberman_decryption_table[]; +extern const uint8_t lethalth_decryption_table[]; +extern const uint8_t dynablaster_decryption_table[]; +extern const uint8_t mysticri_decryption_table[]; +extern const uint8_t majtitl2_decryption_table[]; +extern const uint8_t hook_decryption_table[]; +extern const uint8_t rtypeleo_decryption_table[]; +extern const uint8_t inthunt_decryption_table[]; +extern const uint8_t gussun_decryption_table[]; +extern const uint8_t leagueman_decryption_table[]; +extern const uint8_t psoldier_decryption_table[]; +extern const uint8_t dsoccr94_decryption_table[]; +extern const uint8_t matchit2_decryption_table[]; -extern const UINT8 test_decryption_table[]; +extern const uint8_t test_decryption_table[]; diff --git a/src/mame/machine/irobot.cpp b/src/mame/machine/irobot.cpp index 21838961b96..ba19a5a2f9a 100644 --- a/src/mame/machine/irobot.cpp +++ b/src/mame/machine/irobot.cpp @@ -95,7 +95,7 @@ WRITE8_MEMBER(irobot_state::irobot_statwr_w) WRITE8_MEMBER(irobot_state::irobot_out0_w) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); m_out0 = data; switch (data & 0x60) @@ -117,7 +117,7 @@ WRITE8_MEMBER(irobot_state::irobot_out0_w) WRITE8_MEMBER(irobot_state::irobot_rom_banksel_w) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); switch ((data & 0x0E) >> 1) { @@ -162,7 +162,7 @@ TIMER_CALLBACK_MEMBER(irobot_state::scanline_callback) void irobot_state::machine_reset() { - UINT8 *MB = memregion("mathbox")->base(); + uint8_t *MB = memregion("mathbox")->base(); /* initialize the memory regions */ m_mbROM = MB + 0x00000; @@ -282,38 +282,38 @@ static void disassemble_instruction(irmb_ops *op); #endif -UINT32 irobot_state::irmb_din(const irmb_ops *curop) +uint32_t irobot_state::irmb_din(const irmb_ops *curop) { - UINT32 d = 0; + uint32_t d = 0; if (!(curop->flags & FL_MBMEMDEC) && (curop->flags & FL_MBRW)) { - UINT32 ad = curop->diradd | (m_irmb_latch & curop->latchmask); + uint32_t ad = curop->diradd | (m_irmb_latch & curop->latchmask); if (curop->diren || (m_irmb_latch & 0x6000) == 0) - d = ((UINT16 *)m_mbRAM)[ad & 0xfff]; /* MB RAM read */ + d = ((uint16_t *)m_mbRAM)[ad & 0xfff]; /* MB RAM read */ else if (m_irmb_latch & 0x4000) - d = ((UINT16 *)m_mbROM)[ad + 0x2000]; /* MB ROM read, CEMATH = 1 */ + d = ((uint16_t *)m_mbROM)[ad + 0x2000]; /* MB ROM read, CEMATH = 1 */ else - d = ((UINT16 *)m_mbROM)[ad & 0x1fff]; /* MB ROM read, CEMATH = 0 */ + d = ((uint16_t *)m_mbROM)[ad & 0x1fff]; /* MB ROM read, CEMATH = 0 */ } return d; } -void irobot_state::irmb_dout(const irmb_ops *curop, UINT32 d) +void irobot_state::irmb_dout(const irmb_ops *curop, uint32_t d) { /* Write to video com ram */ if (curop->ramsel == 3) - ((UINT16 *)m_combase_mb)[m_irmb_latch & 0x7ff] = d; + ((uint16_t *)m_combase_mb)[m_irmb_latch & 0x7ff] = d; /* Write to mathox ram */ if (!(curop->flags & FL_MBMEMDEC)) { - UINT32 ad = curop->diradd | (m_irmb_latch & curop->latchmask); + uint32_t ad = curop->diradd | (m_irmb_latch & curop->latchmask); if (curop->diren || (m_irmb_latch & 0x6000) == 0) - ((UINT16 *)m_mbRAM)[ad & 0xfff] = d; /* MB RAM write */ + ((uint16_t *)m_mbRAM)[ad & 0xfff] = d; /* MB RAM write */ } } @@ -321,7 +321,7 @@ void irobot_state::irmb_dout(const irmb_ops *curop, UINT32 d) /* Convert microcode roms to a more usable form */ void irobot_state::load_oproms() { - UINT8 *MB = memregion("proms")->base() + 0x20; + uint8_t *MB = memregion("proms")->base() + 0x20; int i; /* allocate RAM */ @@ -529,23 +529,23 @@ void irobot_state::irmb_run() const irmb_ops *prevop = &m_mbops[0]; const irmb_ops *curop = &m_mbops[0]; - UINT32 Q = 0; - UINT32 Y = 0; - UINT32 nflag = 0; - UINT32 vflag = 0; - UINT32 cflag = 0; - UINT32 zresult = 1; - UINT32 CI = 0; - UINT32 SP = 0; - UINT32 icount = 0; + uint32_t Q = 0; + uint32_t Y = 0; + uint32_t nflag = 0; + uint32_t vflag = 0; + uint32_t cflag = 0; + uint32_t zresult = 1; + uint32_t CI = 0; + uint32_t SP = 0; + uint32_t icount = 0; g_profiler.start(PROFILER_USER1); while ((prevop->flags & (FL_DPSEL | FL_carry)) != (FL_DPSEL | FL_carry)) { - UINT32 result; - UINT32 fu; - UINT32 tmp; + uint32_t result; + uint32_t fu; + uint32_t tmp; icount += curop->cycles; diff --git a/src/mame/machine/isbc_215g.cpp b/src/mame/machine/isbc_215g.cpp index 8cc1c937dda..e94622e9367 100644 --- a/src/mame/machine/isbc_215g.cpp +++ b/src/mame/machine/isbc_215g.cpp @@ -10,7 +10,7 @@ const device_type ISBC_215G = &device_creator; -isbc_215g_device::isbc_215g_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isbc_215g_device::isbc_215g_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISBC_215G, "ISBC 215G Winchester Disk Controller", tag, owner, clock, "isbc_215g", __FILE__), m_dmac(*this, "u84"), m_hdd0(*this, "drive0"), @@ -30,8 +30,8 @@ void isbc_215g_device::find_sector() // 1: cyl low // 2: head // 3: sector - UINT16 cyl = ((m_idcompare[0] & 0xf) << 8) | m_idcompare[1]; - UINT16 bps = 128 << ((m_idcompare[0] >> 4) & 3); + uint16_t cyl = ((m_idcompare[0] & 0xf) << 8) | m_idcompare[1]; + uint16_t bps = 128 << ((m_idcompare[0] >> 4) & 3); if(!m_geom[m_drive]) return; @@ -57,9 +57,9 @@ void isbc_215g_device::find_sector() return; } -UINT16 isbc_215g_device::read_sector() +uint16_t isbc_215g_device::read_sector() { - UINT16 wps = 64 << ((m_idcompare[0] >> 4) & 3); + uint16_t wps = 64 << ((m_idcompare[0] >> 4) & 3); harddisk_image_device *drive = (m_drive ? m_hdd1 : m_hdd0); if(!m_secoffset) hard_disk_read(drive->get_hard_disk_file(), m_lba[m_drive], m_sector); @@ -68,9 +68,9 @@ UINT16 isbc_215g_device::read_sector() return m_sector[m_secoffset++]; } -bool isbc_215g_device::write_sector(UINT16 data) +bool isbc_215g_device::write_sector(uint16_t data) { - UINT16 wps = 64 << ((m_idcompare[0] >> 4) & 3); + uint16_t wps = 64 << ((m_idcompare[0] >> 4) & 3); harddisk_image_device *drive = (m_drive ? m_hdd1 : m_hdd0); if(m_secoffset >= wps) return true; @@ -85,7 +85,7 @@ bool isbc_215g_device::write_sector(UINT16 data) READ16_MEMBER(isbc_215g_device::io_r) { - UINT16 data = 0; + uint16_t data = 0; switch(offset) { case 0x00: diff --git a/src/mame/machine/isbc_215g.h b/src/mame/machine/isbc_215g.h index 85e1fee40b9..0a71ae4c10a 100644 --- a/src/mame/machine/isbc_215g.h +++ b/src/mame/machine/isbc_215g.h @@ -12,7 +12,7 @@ class isbc_215g_device : public device_t { public: - isbc_215g_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isbc_215g_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; const tiny_rom_entry *device_rom_region() const override; @@ -28,7 +28,7 @@ public: DECLARE_WRITE_LINE_MEMBER(isbx_irq_10_w); DECLARE_WRITE_LINE_MEMBER(isbx_irq_11_w); - static void static_set_wakeup_addr(device_t &device, UINT32 wakeup) { downcast(device).m_wakeup = wakeup; } + static void static_set_wakeup_addr(device_t &device, uint32_t wakeup) { downcast(device).m_wakeup = wakeup; } static void static_set_maincpu_tag(device_t &device, const char *maincpu_tag) { downcast(device).m_maincpu_tag = maincpu_tag; } template static devcb_base &static_set_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_func.set_callback(object); } @@ -38,8 +38,8 @@ protected: private: void find_sector(); - UINT16 read_sector(); - bool write_sector(UINT16 data); + uint16_t read_sector(); + bool write_sector(uint16_t data); required_device m_dmac; required_device m_hdd0; @@ -50,13 +50,13 @@ private: devcb_write_line m_out_irq_func; int m_reset; - UINT16 m_wakeup, m_secoffset, m_sector[512]; + uint16_t m_wakeup, m_secoffset, m_sector[512]; const char *m_maincpu_tag; address_space *m_maincpu_mem; - UINT32 m_lba[2]; - UINT16 m_cyl[2]; - UINT8 m_idcompare[4], m_drive, m_head, m_index; - INT8 m_format_bytes; + uint32_t m_lba[2]; + uint16_t m_cyl[2]; + uint8_t m_idcompare[4], m_drive, m_head, m_index; + int8_t m_format_bytes; bool m_idfound, m_stepdir, m_wrgate, m_rdgate, m_amsrch; bool m_isbx_irq[4], m_fdctc, m_step, m_format; diff --git a/src/mame/machine/iteagle_fpga.cpp b/src/mame/machine/iteagle_fpga.cpp index 82d78aca66f..7e5f8c133f1 100644 --- a/src/mame/machine/iteagle_fpga.cpp +++ b/src/mame/machine/iteagle_fpga.cpp @@ -28,7 +28,7 @@ DEVICE_ADDRESS_MAP_START(ram_map, 32, iteagle_fpga_device) AM_RANGE(0x00000, 0x1ffff) AM_READWRITE(ram_r, ram_w) ADDRESS_MAP_END -iteagle_fpga_device::iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iteagle_fpga_device::iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, ITEAGLE_FPGA, "ITEagle FPGA", tag, owner, clock, "iteagle_fpga", __FILE__), m_rtc(*this, "eagle2_rtc"), m_version(0), m_seq_init(0) { @@ -104,13 +104,13 @@ void iteagle_fpga_device::device_reset() m_serial_rx3.clear(); } -void iteagle_fpga_device::update_sequence(UINT32 data) +void iteagle_fpga_device::update_sequence(uint32_t data) { - UINT32 offset = 0x04/4; + uint32_t offset = 0x04/4; if (data & 0x80) { m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((m_version>>(8*(data&3)))&0xff); } else { - UINT32 val1, feed; + uint32_t val1, feed; feed = ((m_seq<<4) ^ m_seq)>>7; if (data & 0x1) { val1 = ((m_seq & 0x2)<<1) | ((m_seq & 0x4)>>1) | ((m_seq & 0x8)>>3); @@ -135,10 +135,10 @@ void iteagle_fpga_device::update_sequence(UINT32 data) } // Eagle 1 sequence generator -void iteagle_fpga_device::update_sequence_eg1(UINT32 data) +void iteagle_fpga_device::update_sequence_eg1(uint32_t data) { - UINT32 offset = 0x04/4; - UINT32 val1, feed; + uint32_t offset = 0x04/4; + uint32_t val1, feed; feed = ((m_seq<<4) ^ m_seq)>>7; if (data & 0x1) { val1 = ((m_seq & 0x2)<<6) | ((m_seq & 0x4)<<4) | ((m_seq & 0x8)<<2) | ((m_seq & 0x10)<<0) @@ -179,7 +179,7 @@ void iteagle_fpga_device::device_timer(emu_timer &timer, device_timer_id tid, in READ32_MEMBER( iteagle_fpga_device::fpga_r ) { - UINT32 result = m_fpga_regs[offset]; + uint32_t result = m_fpga_regs[offset]; switch (offset) { case 0x00/4: @@ -394,7 +394,7 @@ WRITE32_MEMBER( iteagle_fpga_device::fpga_w ) //************************************* READ32_MEMBER( iteagle_fpga_device::rtc_r ) { - UINT32 result = m_rtc_regs[offset]; + uint32_t result = m_rtc_regs[offset]; switch (offset) { default: @@ -446,7 +446,7 @@ WRITE32_MEMBER( iteagle_fpga_device::rtc_w ) //************************************* READ32_MEMBER( iteagle_fpga_device::ram_r ) { - UINT32 result = m_ram[offset]; + uint32_t result = m_ram[offset]; if (LOG_RAM) logerror("%s:FPGA ram_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); return result; @@ -478,7 +478,7 @@ machine_config_constructor iteagle_eeprom_device::device_mconfig_additions() con return MACHINE_CONFIG_NAME( iteagle_eeprom ); } -iteagle_eeprom_device::iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iteagle_eeprom_device::iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, ITEAGLE_EEPROM, "ITEagle EEPROM AT93C46", tag, owner, clock, "eeprom", __FILE__), m_eeprom(*this, "eeprom"), m_sw_version(0), m_hw_version(0) { @@ -508,7 +508,7 @@ void iteagle_eeprom_device::device_start() // EEPROM: Set software version and calc crc m_iteagle_default_eeprom[0xe] = m_sw_version; m_iteagle_default_eeprom[0x4] = (m_iteagle_default_eeprom[0x4] & 0xff00) | m_hw_version; - UINT16 checkSum = 0; + uint16_t checkSum = 0; for (int i=0; i<0x3f; i++) { checkSum += m_iteagle_default_eeprom[i]; //logerror("eeprom init i: %x data: %04x\n", i, iteagle_default_eeprom[i]); @@ -527,15 +527,15 @@ void iteagle_eeprom_device::device_reset() pci_device::device_reset(); } -void iteagle_eeprom_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, - UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) +void iteagle_eeprom_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, + uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) { m_memory_space = memory_space; } READ32_MEMBER( iteagle_eeprom_device::eeprom_r ) { - UINT32 result = 0; + uint32_t result = 0; switch (offset) { case 0xC/4: // I2C Handler @@ -602,7 +602,7 @@ DEVICE_ADDRESS_MAP_START(ctrl_map, 32, iteagle_periph_device) AM_RANGE(0x000, 0x0cf) AM_READWRITE(ctrl_r, ctrl_w) ADDRESS_MAP_END -iteagle_periph_device::iteagle_periph_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iteagle_periph_device::iteagle_periph_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, ITEAGLE_PERIPH, "ITEagle Peripheral Controller", tag, owner, clock, "periph", __FILE__), m_rtc(*this, "eagle1_rtc") { @@ -631,7 +631,7 @@ void iteagle_periph_device::device_reset() READ32_MEMBER( iteagle_periph_device::ctrl_r ) { system_time systime; - UINT32 result = m_ctrl_regs[offset]; + uint32_t result = m_ctrl_regs[offset]; switch (offset) { case 0x0/4: if (LOG_PERIPH) diff --git a/src/mame/machine/iteagle_fpga.h b/src/mame/machine/iteagle_fpga.h index 4c01b88b791..9814f1e255e 100644 --- a/src/mame/machine/iteagle_fpga.h +++ b/src/mame/machine/iteagle_fpga.h @@ -33,7 +33,7 @@ class iteagle_fpga_device : public pci_device { public: - iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; required_device m_rtc; @@ -54,26 +54,26 @@ private: int m_irq_num; int m_serial_irq_num; - UINT32 m_fpga_regs[0x20 / 4]; - UINT32 m_rtc_regs[0x800 / 4]; - UINT32 m_ram[0x20000 / 4]; - UINT32 m_prev_reg; + uint32_t m_fpga_regs[0x20 / 4]; + uint32_t m_rtc_regs[0x800 / 4]; + uint32_t m_ram[0x20000 / 4]; + uint32_t m_prev_reg; std::string m_serial_str; std::string m_serial_rx3; - UINT8 m_serial_idx; + uint8_t m_serial_idx; bool m_serial_data; - UINT8 m_serial_com0[0x10]; - UINT8 m_serial_com1[0x10]; - UINT8 m_serial_com2[0x10]; - UINT8 m_serial_com3[0x10]; - - UINT32 m_version; - UINT32 m_seq_init; - UINT32 m_seq; - UINT32 m_seq_rem1, m_seq_rem2; - void update_sequence(UINT32 data); - void update_sequence_eg1(UINT32 data); + uint8_t m_serial_com0[0x10]; + uint8_t m_serial_com1[0x10]; + uint8_t m_serial_com2[0x10]; + uint8_t m_serial_com3[0x10]; + + uint32_t m_version; + uint32_t m_seq_init; + uint32_t m_seq; + uint32_t m_seq_rem1, m_seq_rem2; + void update_sequence(uint32_t data); + void update_sequence_eg1(uint32_t data); DECLARE_ADDRESS_MAP(rtc_map, 32); DECLARE_ADDRESS_MAP(fpga_map, 32); @@ -90,11 +90,11 @@ private: class iteagle_eeprom_device : public pci_device { public: - iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; - virtual void map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, - UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) override; + virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, + uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override; required_device m_eeprom; @@ -105,10 +105,10 @@ protected: private: address_space *m_memory_space; - UINT16 m_sw_version; - UINT8 m_hw_version; + uint16_t m_sw_version; + uint8_t m_hw_version; - std::array m_iteagle_default_eeprom; + std::array m_iteagle_default_eeprom; DECLARE_ADDRESS_MAP(eeprom_map, 32); DECLARE_READ32_MEMBER( eeprom_r ); @@ -117,7 +117,7 @@ private: class iteagle_periph_device : public pci_device { public: - iteagle_periph_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iteagle_periph_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; protected: @@ -127,8 +127,8 @@ protected: private: optional_device m_rtc; - UINT32 m_ctrl_regs[0xd0/4]; - UINT8 m_rtc_regs[0x100]; + uint32_t m_ctrl_regs[0xd0/4]; + uint8_t m_rtc_regs[0x100]; DECLARE_ADDRESS_MAP(ctrl_map, 32); diff --git a/src/mame/machine/itech8.cpp b/src/mame/machine/itech8.cpp index 3592b1696e3..2e8b930b94d 100644 --- a/src/mame/machine/itech8.cpp +++ b/src/mame/machine/itech8.cpp @@ -88,8 +88,8 @@ *************************************/ #ifdef STANDALONE -static void sensors_to_words(UINT16 sens0, UINT16 sens1, UINT16 sens2, UINT16 sens3, - UINT16 *word1, UINT16 *word2, UINT16 *word3, UINT8 *beams) +static void sensors_to_words(uint16_t sens0, uint16_t sens1, uint16_t sens2, uint16_t sens3, + uint16_t *word1, uint16_t *word2, uint16_t *word3, uint8_t *beams) { /* word 1 contains the difference between the larger of sensors 2 & 3 and the smaller */ *word1 = (sens3 > sens2) ? (sens3 - sens2) : (sens2 - sens3); @@ -126,11 +126,11 @@ static void sensors_to_words(UINT16 sens0, UINT16 sens1, UINT16 sens2, UINT16 se *************************************/ #ifdef STANDALONE -static void words_to_inters(UINT16 word1, UINT16 word2, UINT16 word3, UINT8 beams, - UINT16 *inter1, UINT16 *inter2, UINT16 *inter3) +static void words_to_inters(uint16_t word1, uint16_t word2, uint16_t word3, uint8_t beams, + uint16_t *inter1, uint16_t *inter2, uint16_t *inter3) { /* word 2 is scaled up by 0x1.6553 */ - UINT16 word2mod = ((UINT64)word2 * 0x16553) >> 16; + uint16_t word2mod = ((uint64_t)word2 * 0x16553) >> 16; /* intermediate values 1 and 2 are determined based on the beams bits */ switch (beams) @@ -172,34 +172,34 @@ static void words_to_inters(UINT16 word1, UINT16 word2, UINT16 word3, UINT8 beam * *************************************/ -void itech8_state::inters_to_vels(UINT16 inter1, UINT16 inter2, UINT16 inter3, UINT8 beams, - UINT8 *xres, UINT8 *vxres, UINT8 *vyres) +void itech8_state::inters_to_vels(uint16_t inter1, uint16_t inter2, uint16_t inter3, uint8_t beams, + uint8_t *xres, uint8_t *vxres, uint8_t *vyres) { - UINT32 _27d8, _27c2; - UINT32 vx, vy, _283a, _283e; - UINT8 vxsgn; - UINT16 xoffs = 0x0016; - UINT8 xscale = 0xe6; - UINT16 x; + uint32_t _27d8, _27c2; + uint32_t vx, vy, _283a, _283e; + uint8_t vxsgn; + uint16_t xoffs = 0x0016; + uint8_t xscale = 0xe6; + uint16_t x; /* compute Vy */ vy = inter1 ? (0x31c28 / inter1) : 0; /* compute Vx */ _283a = inter2 ? (0x30f2e / inter2) : 0; - _27d8 = ((UINT64)vy * 0xfbd3) >> 16; + _27d8 = ((uint64_t)vy * 0xfbd3) >> 16; _27c2 = _283a - _27d8; vxsgn = 0; - if ((INT32)_27c2 < 0) + if ((int32_t)_27c2 < 0) { vxsgn = 1; _27c2 = _27d8 - _283a; } - vx = ((UINT64)_27c2 * 0x58f8c) >> 16; + vx = ((uint64_t)_27c2 * 0x58f8c) >> 16; /* compute X */ - _27d8 = ((UINT64)(inter3 << 16) * _283a) >> 16; - _283e = ((UINT64)_27d8 * 0x4a574b) >> 16; + _27d8 = ((uint64_t)(inter3 << 16) * _283a) >> 16; + _283e = ((uint64_t)_27d8 * 0x4a574b) >> 16; /* adjust X based on the low bit of the beams */ if (beams & 1) @@ -245,24 +245,24 @@ void itech8_state::inters_to_vels(UINT16 inter1, UINT16 inter2, UINT16 inter3, U * *************************************/ -void itech8_state::vels_to_inters(UINT8 x, UINT8 vx, UINT8 vy, - UINT16 *inter1, UINT16 *inter2, UINT16 *inter3, UINT8 *beams) +void itech8_state::vels_to_inters(uint8_t x, uint8_t vx, uint8_t vy, + uint16_t *inter1, uint16_t *inter2, uint16_t *inter3, uint8_t *beams) { - UINT32 _27d8; - UINT16 xoffs = 0x0016; - UINT8 xscale = 0xe6; - UINT8 x1, vx1, vy1; - UINT8 x2, vx2, vy2; - UINT8 diff1, diff2; - UINT16 inter2a; + uint32_t _27d8; + uint16_t xoffs = 0x0016; + uint8_t xscale = 0xe6; + uint8_t x1, vx1, vy1; + uint8_t x2, vx2, vy2; + uint8_t diff1, diff2; + uint16_t inter2a; /* inter1 comes from Vy */ *inter1 = vy ? 0x31c28 / vy : 0; /* inter2 can be derived from Vx and Vy */ - _27d8 = ((UINT64)vy * 0xfbd3) >> 16; - *inter2 = 0x30f2e / (_27d8 + (((UINT32)abs((INT8)vx) << 16) / 0x58f8c)); - inter2a = 0x30f2e / (_27d8 - (((UINT32)abs((INT8)vx) << 16) / 0x58f8c)); + _27d8 = ((uint64_t)vy * 0xfbd3) >> 16; + *inter2 = 0x30f2e / (_27d8 + (((uint32_t)abs((int8_t)vx) << 16) / 0x58f8c)); + inter2a = 0x30f2e / (_27d8 - (((uint32_t)abs((int8_t)vx) << 16) / 0x58f8c)); /* compute it back both ways and pick the closer */ inters_to_vels(*inter1, *inter2, 0, 0, &x1, &vx1, &vy1); @@ -276,12 +276,12 @@ void itech8_state::vels_to_inters(UINT8 x, UINT8 vx, UINT8 vy, if (((x << 8) / xscale) + xoffs >= 0x7a) { *beams = 1; - *inter3 = (((((((UINT64)(((x << 8) / xscale) + xoffs - 0x7a)) << 16) << 16) / 0x4a574b) << 16) / (0x30f2e / *inter2)) >> 16; + *inter3 = (((((((uint64_t)(((x << 8) / xscale) + xoffs - 0x7a)) << 16) << 16) / 0x4a574b) << 16) / (0x30f2e / *inter2)) >> 16; } else { *beams = 0; - *inter3 = (((((((UINT64)(((x << 8) / xscale) + xoffs - 0x7a) * -1) << 16) << 16) / 0x4a574b) << 16) / (0x30f2e / *inter2)) >> 16; + *inter3 = (((((((uint64_t)(((x << 8) / xscale) + xoffs - 0x7a) * -1) << 16) << 16) / 0x4a574b) << 16) / (0x30f2e / *inter2)) >> 16; } } @@ -298,10 +298,10 @@ void itech8_state::vels_to_inters(UINT8 x, UINT8 vx, UINT8 vy, * *************************************/ -void itech8_state::inters_to_words(UINT16 inter1, UINT16 inter2, UINT16 inter3, UINT8 *beams, - UINT16 *word1, UINT16 *word2, UINT16 *word3) +void itech8_state::inters_to_words(uint16_t inter1, uint16_t inter2, uint16_t inter3, uint8_t *beams, + uint16_t *word1, uint16_t *word2, uint16_t *word3) { - UINT16 word2mod; + uint16_t word2mod; /* intermediate value 3 is always equal to the third word */ *word3 = inter3; @@ -320,11 +320,11 @@ void itech8_state::inters_to_words(UINT16 inter1, UINT16 inter2, UINT16 inter3, /* compute the other values from that */ *word1 = inter2 - word2mod; - *word2 = ((UINT64)word2mod << 16) / 0x16553; + *word2 = ((uint64_t)word2mod << 16) / 0x16553; } else logerror("inters_to_words: unable to convert %04x %04x %04x %02x\n", - (UINT32)inter1, (UINT32)inter2, (UINT32)inter3, (UINT32)*beams); + (uint32_t)inter1, (uint32_t)inter2, (uint32_t)inter3, (uint32_t)*beams); } /* handle the case where low bit of beams is 0 */ @@ -340,11 +340,11 @@ void itech8_state::inters_to_words(UINT16 inter1, UINT16 inter2, UINT16 inter3, /* compute the other values from that */ *word1 = inter1 - word2mod; - *word2 = ((UINT64)word2mod << 16) / 0x16553; + *word2 = ((uint64_t)word2mod << 16) / 0x16553; } else logerror("inters_to_words: unable to convert %04x %04x %04x %02x\n", - (UINT32)inter1, (UINT32)inter2, (UINT32)inter3, (UINT32)*beams); + (uint32_t)inter1, (uint32_t)inter2, (uint32_t)inter3, (uint32_t)*beams); } } @@ -360,8 +360,8 @@ void itech8_state::inters_to_words(UINT16 inter1, UINT16 inter2, UINT16 inter3, * *************************************/ -void itech8_state::words_to_sensors(UINT16 word1, UINT16 word2, UINT16 word3, UINT8 beams, - UINT16 *sens0, UINT16 *sens1, UINT16 *sens2, UINT16 *sens3) +void itech8_state::words_to_sensors(uint16_t word1, uint16_t word2, uint16_t word3, uint8_t beams, + uint16_t *sens0, uint16_t *sens1, uint16_t *sens2, uint16_t *sens3) { /* if bit 0 of the beams is set, sensor 1 fired first; otherwise sensor 0 fired */ if (beams & 1) @@ -386,9 +386,9 @@ void itech8_state::words_to_sensors(UINT16 word1, UINT16 word2, UINT16 word3, UI void itech8_state::compute_sensors() { - UINT16 inter1, inter2, inter3; - UINT16 word1 = 0, word2 = 0, word3 = 0; - UINT8 beams; + uint16_t inter1, inter2, inter3; + uint16_t word1 = 0, word2 = 0, word3 = 0; + uint8_t beams; /* skip if we're not ready */ if (m_sensor0 != 0 || m_sensor1 != 0 || m_sensor2 != 0 || m_sensor3 != 0) @@ -537,7 +537,7 @@ VIDEO_START_MEMBER(itech8_state,slikshot) * *************************************/ -UINT32 itech8_state::screen_update_slikshot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t itech8_state::screen_update_slikshot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int totaldy, totaldx; int temp, i; @@ -613,13 +613,13 @@ UINT32 itech8_state::screen_update_slikshot(screen_device &screen, bitmap_rgb32 int main(int argc, char *argv[]) { - UINT16 word1, word2, word3; - UINT16 inter1, inter2, inter3; - UINT8 beams, x, vx, vy; + uint16_t word1, word2, word3; + uint16_t inter1, inter2, inter3; + uint8_t beams, x, vx, vy; if (argc == 5) { - UINT32 sens0, sens1, sens2, sens3; + uint32_t sens0, sens1, sens2, sens3; sscanf(argv[1], "%x", &sens0); sscanf(argv[2], "%x", &sens1); @@ -634,18 +634,18 @@ int main(int argc, char *argv[]) sensors_to_words(sens0, sens1, sens2, sens3, &word1, &word2, &word3, &beams); osd_printf_debug("word1 = %04x word2 = %04x word3 = %04x beams = %d\n", - (UINT32)word1, (UINT32)word2, (UINT32)word3, (UINT32)beams); + (uint32_t)word1, (uint32_t)word2, (uint32_t)word3, (uint32_t)beams); words_to_inters(word1, word2, word3, beams, &inter1, &inter2, &inter3); - osd_printf_debug("inter1 = %04x inter2 = %04x inter3 = %04x\n", (UINT32)inter1, (UINT32)inter2, (UINT32)inter3); + osd_printf_debug("inter1 = %04x inter2 = %04x inter3 = %04x\n", (uint32_t)inter1, (uint32_t)inter2, (uint32_t)inter3); inters_to_vels(inter1, inter2, inter3, beams, &x, &vx, &vy); - osd_printf_debug("x = %02x vx = %02x vy = %02x\n", (UINT32)x, (UINT32)vx, (UINT32)vy); + osd_printf_debug("x = %02x vx = %02x vy = %02x\n", (uint32_t)x, (uint32_t)vx, (uint32_t)vy); } else if (argc == 4) { - UINT32 xin, vxin, vyin; - UINT16 sens0, sens1, sens2, sens3; + uint32_t xin, vxin, vyin; + uint16_t sens0, sens1, sens2, sens3; sscanf(argv[1], "%x", &xin); sscanf(argv[2], "%x", &vxin); @@ -653,14 +653,14 @@ int main(int argc, char *argv[]) x = xin; vx = vxin; vy = vyin; - osd_printf_debug("x = %02x vx = %02x vy = %02x\n", (UINT32)x, (UINT32)vx, (UINT32)vy); + osd_printf_debug("x = %02x vx = %02x vy = %02x\n", (uint32_t)x, (uint32_t)vx, (uint32_t)vy); vels_to_inters(x, vx, vy, &inter1, &inter2, &inter3, &beams); - osd_printf_debug("inter1 = %04x inter2 = %04x inter3 = %04x beams = %d\n", (UINT32)inter1, (UINT32)inter2, (UINT32)inter3, (UINT32)beams); + osd_printf_debug("inter1 = %04x inter2 = %04x inter3 = %04x beams = %d\n", (uint32_t)inter1, (uint32_t)inter2, (uint32_t)inter3, (uint32_t)beams); inters_to_words(inter1, inter2, inter3, &beams, &word1, &word2, &word3); osd_printf_debug("word1 = %04x word2 = %04x word3 = %04x beams = %d\n", - (UINT32)word1, (UINT32)word2, (UINT32)word3, (UINT32)beams); + (uint32_t)word1, (uint32_t)word2, (uint32_t)word3, (uint32_t)beams); words_to_sensors(word1, word2, word3, beams, &sens0, &sens1, &sens2, &sens3); osd_printf_debug("sensors: %04x %04x %04x %04x\n", sens0, sens1, sens2, sens3); diff --git a/src/mame/machine/jalcrpt.cpp b/src/mame/machine/jalcrpt.cpp index 25efbd60f86..45c92d90ce4 100644 --- a/src/mame/machine/jalcrpt.cpp +++ b/src/mame/machine/jalcrpt.cpp @@ -6,13 +6,13 @@ void phantasm_rom_decode(running_machine &machine, const char *region) { - UINT16 *RAM = (UINT16 *) machine.root_device().memregion(region)->base(); + uint16_t *RAM = (uint16_t *) machine.root_device().memregion(region)->base(); int i, size = machine.root_device().memregion(region)->bytes(); if (size > 0x40000) size = 0x40000; for (i = 0 ; i < size/2 ; i++) { - UINT16 x,y; + uint16_t x,y; x = RAM[i]; @@ -40,13 +40,13 @@ void phantasm_rom_decode(running_machine &machine, const char *region) void astyanax_rom_decode(running_machine &machine, const char *region) { - UINT16 *RAM = (UINT16 *) machine.root_device().memregion(region)->base(); + uint16_t *RAM = (uint16_t *) machine.root_device().memregion(region)->base(); int i, size = machine.root_device().memregion(region)->bytes(); if (size > 0x40000) size = 0x40000; for (i = 0 ; i < size/2 ; i++) { - UINT16 x,y; + uint16_t x,y; x = RAM[i]; @@ -74,13 +74,13 @@ void astyanax_rom_decode(running_machine &machine, const char *region) void rodland_rom_decode(running_machine &machine, const char *region) { - UINT16 *RAM = (UINT16 *) machine.root_device().memregion(region)->base(); + uint16_t *RAM = (uint16_t *) machine.root_device().memregion(region)->base(); int i, size = machine.root_device().memregion(region)->bytes(); if (size > 0x40000) size = 0x40000; for (i = 0 ; i < size/2 ; i++) { - UINT16 x,y; + uint16_t x,y; x = RAM[i]; @@ -122,13 +122,13 @@ void ms32_rearrange_sprites(running_machine &machine, const char *region) { /* sprites are not encrypted, but we need to move the data around to handle them as 256x256 tiles */ int i; - UINT8 *source_data; + uint8_t *source_data; int source_size; source_data = machine.root_device().memregion ( region )->base(); source_size = machine.root_device().memregion( region )->bytes(); - std::vector result_data(source_size); + std::vector result_data(source_size); for(i=0; ibase(); source_size = machine.root_device().memregion( region )->bytes(); - std::vector result_data(source_size); + std::vector result_data(source_size); addr_xor ^= 0x1005d; @@ -195,13 +195,13 @@ void decrypt_ms32_tx(running_machine &machine, int addr_xor,int data_xor, const void decrypt_ms32_bg(running_machine &machine, int addr_xor,int data_xor, const char *region) { int i; - UINT8 *source_data; + uint8_t *source_data; int source_size; source_data = machine.root_device().memregion ( region )->base(); source_size = machine.root_device().memregion( region )->bytes(); - std::vector result_data(source_size); + std::vector result_data(source_size); addr_xor ^= 0xc1c5b; diff --git a/src/mame/machine/jumpshot.cpp b/src/mame/machine/jumpshot.cpp index 5df077f55b6..5cf9cb711a4 100644 --- a/src/mame/machine/jumpshot.cpp +++ b/src/mame/machine/jumpshot.cpp @@ -4,9 +4,9 @@ #include "includes/pacman.h" -UINT8 pacman_state::jumpshot_decrypt(int addr, UINT8 e) +uint8_t pacman_state::jumpshot_decrypt(int addr, uint8_t e) { - static const UINT8 swap_xor_table[6][9] = + static const uint8_t swap_xor_table[6][9] = { { 7,6,5,4,3,2,1,0, 0x00 }, { 7,6,3,4,5,2,1,0, 0x20 }, @@ -20,8 +20,8 @@ UINT8 pacman_state::jumpshot_decrypt(int addr, UINT8 e) 0,2,4,4,4,2,0,2,2,0,2,4,4,2,0,2, 5,3,5,1,5,3,5,3,1,5,1,5,5,3,5,3 }; - UINT32 method = 0; - const UINT8 *tbl; + uint32_t method = 0; + const uint8_t *tbl; /* pick method from bits 0 2 5 7 9 of the address */ @@ -44,7 +44,7 @@ UINT8 pacman_state::jumpshot_decrypt(int addr, UINT8 e) void pacman_state::jumpshot_decode() { int i; - UINT8 *RAM; + uint8_t *RAM; /* CPU ROMs */ diff --git a/src/mame/machine/jvs13551.cpp b/src/mame/machine/jvs13551.cpp index 261f311d796..f08ee51d1fc 100644 --- a/src/mame/machine/jvs13551.cpp +++ b/src/mame/machine/jvs13551.cpp @@ -51,7 +51,7 @@ ioport_constructor sega_837_13551::device_input_ports() const return INPUT_PORTS_NAME(sega_837_13551_coins); } -sega_837_13551::sega_837_13551(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : jvs_device(mconfig, SEGA_837_13551, "Sega 837-13551 I/O Board", tag, owner, clock, "jvs13551", __FILE__) +sega_837_13551::sega_837_13551(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jvs_device(mconfig, SEGA_837_13551, "Sega 837-13551 I/O Board", tag, owner, clock, "jvs13551", __FILE__) { memset(port_tag, 0, sizeof(port_tag)); } @@ -61,17 +61,17 @@ const char *sega_837_13551::device_id() return "SEGA ENTERPRISES,LTD.;I/O BD JVS;837-13551"; } -UINT8 sega_837_13551::command_format_version() +uint8_t sega_837_13551::command_format_version() { return 0x11; } -UINT8 sega_837_13551::jvs_standard_version() +uint8_t sega_837_13551::jvs_standard_version() { return 0x20; } -UINT8 sega_837_13551::comm_method_version() +uint8_t sega_837_13551::comm_method_version() { return 0x10; } @@ -101,7 +101,7 @@ void sega_837_13551::inc_coin(int coin) } -void sega_837_13551::function_list(UINT8 *&buf) +void sega_837_13551::function_list(uint8_t *&buf) { // SW input - 2 players, 13 bits *buf++ = 0x01; *buf++ = 2; *buf++ = 13; *buf++ = 0; @@ -116,7 +116,7 @@ void sega_837_13551::function_list(UINT8 *&buf) *buf++ = 0x12; *buf++ = 6; *buf++ = 0; *buf++ = 0; } -bool sega_837_13551::coin_counters(UINT8 *&buf, UINT8 count) +bool sega_837_13551::coin_counters(uint8_t *&buf, uint8_t count) { if(count > 2) return false; @@ -130,7 +130,7 @@ bool sega_837_13551::coin_counters(UINT8 *&buf, UINT8 count) return true; } -bool sega_837_13551::coin_add(UINT8 slot, INT32 count) +bool sega_837_13551::coin_add(uint8_t slot, int32_t count) { if(slot < 1 || slot > 2) return false; @@ -140,14 +140,14 @@ bool sega_837_13551::coin_add(UINT8 slot, INT32 count) return true; } -bool sega_837_13551::switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switch) +bool sega_837_13551::switches(uint8_t *&buf, uint8_t count_players, uint8_t bytes_per_switch) { if(count_players > 2 || bytes_per_switch > 2) return false; *buf++ = port[0] ? port[0]->read() : 0; for(int i=0; iread() : 0; + uint32_t val = port[1+i] ? port[1+i]->read() : 0; for(int j=0; j> ((1-j) << 3); } @@ -155,19 +155,19 @@ bool sega_837_13551::switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_ } -bool sega_837_13551::analogs(UINT8 *&buf, UINT8 count) +bool sega_837_13551::analogs(uint8_t *&buf, uint8_t count) { if(count > 8) return false; for(int i=0; iread() : 0x8000; + uint16_t val = port[3+i] ? port[3+i]->read() : 0x8000; *buf++ = val >> 8; *buf++ = val; } return true; } -bool sega_837_13551::swoutputs(UINT8 count, const UINT8 *vals) +bool sega_837_13551::swoutputs(uint8_t count, const uint8_t *vals) { // WARNING! JVS standard have reversed bits count order // so "board have 6 output bits" means 6 MSB bits is used, the same rules for input too @@ -182,7 +182,7 @@ bool sega_837_13551::swoutputs(UINT8 count, const UINT8 *vals) return true; } -bool sega_837_13551::swoutputs(UINT8 id, UINT8 val) +bool sega_837_13551::swoutputs(uint8_t id, uint8_t val) { if(id > 6) return false; diff --git a/src/mame/machine/jvs13551.h b/src/mame/machine/jvs13551.h index 566ecfa2a63..59038a4c84b 100644 --- a/src/mame/machine/jvs13551.h +++ b/src/mame/machine/jvs13551.h @@ -26,7 +26,7 @@ class jvs_host; class sega_837_13551 : public jvs_device { public: - sega_837_13551(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_837_13551(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_port_tag(device_t &device, int port, const char *tag); virtual const tiny_rom_entry *device_rom_region() const override; @@ -43,21 +43,21 @@ protected: // JVS device overrides virtual const char *device_id() override; - virtual UINT8 command_format_version() override; - virtual UINT8 jvs_standard_version() override; - virtual UINT8 comm_method_version() override; - virtual void function_list(UINT8 *&buf) override; - virtual bool switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switch) override; - virtual bool coin_counters(UINT8 *&buf, UINT8 count) override; - virtual bool coin_add(UINT8 slot, INT32 count) override; - virtual bool analogs(UINT8 *&buf, UINT8 count) override; - virtual bool swoutputs(UINT8 count, const UINT8 *vals) override; - virtual bool swoutputs(UINT8 id, UINT8 val) override; + virtual uint8_t command_format_version() override; + virtual uint8_t jvs_standard_version() override; + virtual uint8_t comm_method_version() override; + virtual void function_list(uint8_t *&buf) override; + virtual bool switches(uint8_t *&buf, uint8_t count_players, uint8_t bytes_per_switch) override; + virtual bool coin_counters(uint8_t *&buf, uint8_t count) override; + virtual bool coin_add(uint8_t slot, int32_t count) override; + virtual bool analogs(uint8_t *&buf, uint8_t count) override; + virtual bool swoutputs(uint8_t count, const uint8_t *vals) override; + virtual bool swoutputs(uint8_t id, uint8_t val) override; private: const char *port_tag[12]; ioport_port *port[12]; - UINT16 coin_counter[2]; + uint16_t coin_counter[2]; }; extern const device_type SEGA_837_13551; diff --git a/src/mame/machine/k573cass.cpp b/src/mame/machine/k573cass.cpp index 4f6c8769d6e..db096c04800 100644 --- a/src/mame/machine/k573cass.cpp +++ b/src/mame/machine/k573cass.cpp @@ -63,14 +63,14 @@ READ_LINE_MEMBER(konami573_cassette_interface::read_line_adc083x_sars) const device_type KONAMI573_CASSETTE_X = &device_creator; -konami573_cassette_x_device::konami573_cassette_x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +konami573_cassette_x_device::konami573_cassette_x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONAMI573_CASSETTE_X, "Konami 573 Cassette X", tag, owner, clock, "k573cassx", __FILE__), konami573_cassette_interface(mconfig, *this), m_x76f041(*this, "eeprom") { } -konami573_cassette_x_device::konami573_cassette_x_device(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +konami573_cassette_x_device::konami573_cassette_x_device(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), konami573_cassette_interface(mconfig, *this), m_x76f041(*this, "eeprom") @@ -119,7 +119,7 @@ READ_LINE_MEMBER(konami573_cassette_x_device::read_line_secflash_sda) const device_type KONAMI573_CASSETTE_XI = &device_creator; -konami573_cassette_xi_device::konami573_cassette_xi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +konami573_cassette_xi_device::konami573_cassette_xi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : konami573_cassette_x_device(mconfig, KONAMI573_CASSETTE_XI, "Konami 573 Cassette XI", tag, owner, clock, "k573cassxi", __FILE__), m_ds2401(*this, "id"), m_adc0838(*this, "adc0838") @@ -179,7 +179,7 @@ READ_LINE_MEMBER(konami573_cassette_xi_device::read_line_adc083x_sars) const device_type KONAMI573_CASSETTE_Y = &device_creator; -konami573_cassette_y_device::konami573_cassette_y_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +konami573_cassette_y_device::konami573_cassette_y_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONAMI573_CASSETTE_Y, "Konami 573 Cassette Y", tag, owner, clock, "k573cassy", __FILE__), konami573_cassette_interface(mconfig, *this), m_x76f100(*this, "eeprom"), @@ -194,7 +194,7 @@ konami573_cassette_y_device::konami573_cassette_y_device(const machine_config &m { } -konami573_cassette_y_device::konami573_cassette_y_device(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +konami573_cassette_y_device::konami573_cassette_y_device(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), konami573_cassette_interface(mconfig, *this), m_x76f100(*this, "eeprom"), @@ -284,7 +284,7 @@ WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d7) const device_type KONAMI573_CASSETTE_YI = &device_creator; -konami573_cassette_yi_device::konami573_cassette_yi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +konami573_cassette_yi_device::konami573_cassette_yi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : konami573_cassette_y_device(mconfig, KONAMI573_CASSETTE_YI, "Konami 573 Cassette YI", tag, owner, clock, "k573cassyi", __FILE__), m_ds2401(*this, "id") { @@ -315,7 +315,7 @@ READ_LINE_MEMBER(konami573_cassette_yi_device::read_line_ds2401) const device_type KONAMI573_CASSETTE_ZI = &device_creator; -konami573_cassette_zi_device::konami573_cassette_zi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +konami573_cassette_zi_device::konami573_cassette_zi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONAMI573_CASSETTE_ZI, "Konami 573 Cassette ZI", tag, owner, clock, "k573casszi", __FILE__), konami573_cassette_interface(mconfig, *this), m_zs01(*this,"eeprom"), @@ -377,7 +377,7 @@ READ_LINE_MEMBER(konami573_cassette_zi_device::read_line_secflash_sda) const device_type KONAMI573_CASSETTE_SLOT = &device_creator; -konami573_cassette_slot_device::konami573_cassette_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +konami573_cassette_slot_device::konami573_cassette_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONAMI573_CASSETTE_SLOT, "Konami 573 Cassette Slot", tag, owner, clock, "k573cassslot", __FILE__), device_slot_interface(mconfig, *this), m_dsr_handler(*this) diff --git a/src/mame/machine/k573cass.h b/src/mame/machine/k573cass.h index 899667c7b7b..ee5057746cc 100644 --- a/src/mame/machine/k573cass.h +++ b/src/mame/machine/k573cass.h @@ -30,7 +30,7 @@ class konami573_cassette_slot_device : public device_t, friend class konami573_cassette_interface; public: - konami573_cassette_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + konami573_cassette_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_dsr_handler(device_t &device, _Object object) { return downcast(device).m_dsr_handler.set_callback(object); } @@ -91,8 +91,8 @@ class konami573_cassette_x_device: public device_t, public konami573_cassette_interface { public: - konami573_cassette_x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - konami573_cassette_x_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); + konami573_cassette_x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + konami573_cassette_x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock,const char *shortname, const char *source); virtual DECLARE_READ_LINE_MEMBER(read_line_secflash_sda) override; virtual DECLARE_WRITE_LINE_MEMBER(write_line_d0) override; @@ -114,7 +114,7 @@ extern const device_type KONAMI573_CASSETTE_XI; class konami573_cassette_xi_device: public konami573_cassette_x_device { public: - konami573_cassette_xi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + konami573_cassette_xi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ_LINE_MEMBER(read_line_ds2401) override; virtual DECLARE_WRITE_LINE_MEMBER(write_line_d4) override; @@ -167,8 +167,8 @@ class konami573_cassette_y_device: public device_t, public konami573_cassette_interface { public: - konami573_cassette_y_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - konami573_cassette_y_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); + konami573_cassette_y_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + konami573_cassette_y_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock,const char *shortname, const char *source); // static configuration helpers template static devcb_base &set_d0_handler(device_t &device, _Object object) { return downcast(device).m_d0_handler.set_callback(object); } @@ -212,7 +212,7 @@ extern const device_type KONAMI573_CASSETTE_YI; class konami573_cassette_yi_device: public konami573_cassette_y_device { public: - konami573_cassette_yi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + konami573_cassette_yi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ_LINE_MEMBER(read_line_ds2401) override; virtual DECLARE_WRITE_LINE_MEMBER(write_line_d4) override; @@ -231,7 +231,7 @@ class konami573_cassette_zi_device: public device_t, public konami573_cassette_interface { public: - konami573_cassette_zi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + konami573_cassette_zi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ_LINE_MEMBER(read_line_ds2401) override; virtual DECLARE_READ_LINE_MEMBER(read_line_secflash_sda) override; diff --git a/src/mame/machine/k573dio.cpp b/src/mame/machine/k573dio.cpp index 99194a721c4..10aadf96119 100644 --- a/src/mame/machine/k573dio.cpp +++ b/src/mame/machine/k573dio.cpp @@ -105,7 +105,7 @@ static MACHINE_CONFIG_FRAGMENT( k573dio ) MCFG_DS2401_ADD( "digital_id" ) MACHINE_CONFIG_END -k573dio_device::k573dio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k573dio_device::k573dio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONAMI_573_DIGITAL_IO_BOARD, "Konami 573 digital I/O board", tag, owner, clock, "k573dio", __FILE__), mas3507d(*this, "mpeg"), digital_id(*this, "digital_id"), @@ -116,7 +116,7 @@ k573dio_device::k573dio_device(const machine_config &mconfig, const char *tag, d void k573dio_device::device_start() { output_cb.resolve_safe(); - ram = std::make_unique(12 * 1024 * 1024 ); + ram = std::make_unique(12 * 1024 * 1024 ); save_pointer( NAME(ram.get()), 12 * 1024 * 1024 ); } @@ -239,7 +239,7 @@ WRITE16_MEMBER(k573dio_device::ram_write_adr_low_w) READ16_MEMBER(k573dio_device::ram_r) { - UINT16 res = ram[ram_adr >> 1]; + uint16_t res = ram[ram_adr >> 1]; ram_adr += 2; return res; } @@ -338,7 +338,7 @@ WRITE16_MEMBER(k573dio_device::output_2_w) output(2, data); } -void k573dio_device::output(int offset, UINT16 data) +void k573dio_device::output(int offset, uint16_t data) { data = (data >> 12) & 0x0f; static const int shift[] = { 0, 2, 3, 1 }; diff --git a/src/mame/machine/k573dio.h b/src/mame/machine/k573dio.h index 8815b1fccfd..0fb3ee47ce5 100644 --- a/src/mame/machine/k573dio.h +++ b/src/mame/machine/k573dio.h @@ -17,7 +17,7 @@ class k573dio_device : public device_t { public: - k573dio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k573dio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_output_cb(_write _output_cb) { @@ -73,11 +73,11 @@ protected: private: devcb_write8 output_cb; - std::unique_ptr ram; - UINT32 ram_adr; - UINT8 output_data[8]; + std::unique_ptr ram; + uint32_t ram_adr; + uint8_t output_data[8]; - void output(int offset, UINT16 data); + void output(int offset, uint16_t data); }; extern const device_type KONAMI_573_DIGITAL_IO_BOARD; diff --git a/src/mame/machine/k573mcr.cpp b/src/mame/machine/k573mcr.cpp index 1b5842cfab6..a18a25e1d0c 100644 --- a/src/mame/machine/k573mcr.cpp +++ b/src/mame/machine/k573mcr.cpp @@ -11,7 +11,7 @@ GE885-PWB(A)A ( contains Toshiba tmpr3904af, ram, rom, tranceiver and glue ). */ -k573mcr_device::k573mcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +k573mcr_device::k573mcr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONAMI_573_MEMORY_CARD_READER, "Konami 573 Memory Card Reader", tag, owner, clock, "k573mcr", __FILE__) { } diff --git a/src/mame/machine/k573mcr.h b/src/mame/machine/k573mcr.h index 23517200cfc..7980321be3a 100644 --- a/src/mame/machine/k573mcr.h +++ b/src/mame/machine/k573mcr.h @@ -17,7 +17,7 @@ extern const device_type KONAMI_573_MEMORY_CARD_READER; class k573mcr_device : public device_t { public: - k573mcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k573mcr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/mame/machine/k573msu.cpp b/src/mame/machine/k573msu.cpp index df494d62bb8..d691a909942 100644 --- a/src/mame/machine/k573msu.cpp +++ b/src/mame/machine/k573msu.cpp @@ -71,7 +71,7 @@ */ -k573msu_device::k573msu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +k573msu_device::k573msu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONAMI_573_MULTI_SESSION_UNIT, "Konami 573 Multi Session Unit", tag, owner, clock, "k573msu", __FILE__) { } diff --git a/src/mame/machine/k573msu.h b/src/mame/machine/k573msu.h index 6e584100ece..2a6bbef1cba 100644 --- a/src/mame/machine/k573msu.h +++ b/src/mame/machine/k573msu.h @@ -17,7 +17,7 @@ extern const device_type KONAMI_573_MULTI_SESSION_UNIT; class k573msu_device : public device_t { public: - k573msu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k573msu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/mame/machine/k573npu.cpp b/src/mame/machine/k573npu.cpp index a935745bc7a..e9b0853a0d7 100644 --- a/src/mame/machine/k573npu.cpp +++ b/src/mame/machine/k573npu.cpp @@ -71,7 +71,7 @@ */ -k573npu_device::k573npu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +k573npu_device::k573npu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONAMI_573_NETWORK_PCB_UNIT, "Konami 573 Network PCB Unit", tag, owner, clock, "k573npu", __FILE__) { } diff --git a/src/mame/machine/k573npu.h b/src/mame/machine/k573npu.h index 7c28760821b..ec2302c25b7 100644 --- a/src/mame/machine/k573npu.h +++ b/src/mame/machine/k573npu.h @@ -17,7 +17,7 @@ extern const device_type KONAMI_573_NETWORK_PCB_UNIT; class k573npu_device : public device_t { public: - k573npu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k573npu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/mame/machine/k7659kb.cpp b/src/mame/machine/k7659kb.cpp index 4201b221213..343e7c0330b 100644 --- a/src/mame/machine/k7659kb.cpp +++ b/src/mame/machine/k7659kb.cpp @@ -212,7 +212,7 @@ ioport_constructor k7659_keyboard_device::device_input_ports() const // k7659_keyboard_device - constructor //------------------------------------------------- -k7659_keyboard_device::k7659_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k7659_keyboard_device::k7659_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K7659_KEYBOARD, "K7659 Keyboard", tag, owner, clock, "k7659kb", __FILE__) {} @@ -243,20 +243,20 @@ void k7659_keyboard_device::device_reset() void k7659_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - UINT8 retVal = 0;//m_lookup; - UINT8 a1 = ioport("A1")->read(); - UINT8 a2 = ioport("A2")->read(); - UINT8 a3 = ioport("A3")->read(); - UINT8 a4 = ioport("A4")->read(); - UINT8 a5 = ioport("A5")->read(); - UINT8 a6 = ioport("A6")->read(); - UINT8 a7 = ioport("A7")->read(); - UINT8 a8 = ioport("A8")->read(); - UINT8 a9 = ioport("A9")->read(); - UINT8 a10 = ioport("A10")->read(); - UINT8 a11 = ioport("A11")->read(); - UINT8 a12 = ioport("A12")->read(); - UINT16 code = 0; + uint8_t retVal = 0;//m_lookup; + uint8_t a1 = ioport("A1")->read(); + uint8_t a2 = ioport("A2")->read(); + uint8_t a3 = ioport("A3")->read(); + uint8_t a4 = ioport("A4")->read(); + uint8_t a5 = ioport("A5")->read(); + uint8_t a6 = ioport("A6")->read(); + uint8_t a7 = ioport("A7")->read(); + uint8_t a8 = ioport("A8")->read(); + uint8_t a9 = ioport("A9")->read(); + uint8_t a10 = ioport("A10")->read(); + uint8_t a11 = ioport("A11")->read(); + uint8_t a12 = ioport("A12")->read(); + uint16_t code = 0; if (a1) code = 0x10 + key_pos(a1); else if (a2) @@ -292,7 +292,7 @@ void k7659_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, i m_key = retVal; } -UINT8 k7659_keyboard_device::key_pos(UINT8 val) +uint8_t k7659_keyboard_device::key_pos(uint8_t val) { if (BIT(val,0)) return 1; if (BIT(val,1)) return 2; diff --git a/src/mame/machine/k7659kb.h b/src/mame/machine/k7659kb.h index ecb54acdd22..e84ce714b3a 100644 --- a/src/mame/machine/k7659kb.h +++ b/src/mame/machine/k7659kb.h @@ -43,7 +43,7 @@ class k7659_keyboard_device : public device_t { public: // construction/destruction - k7659_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k7659_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -60,10 +60,10 @@ protected: emu_timer *m_timer; private: - UINT8 key_pos(UINT8 val); - UINT8 m_lookup; - UINT8 m_key; - const UINT8 *m_p_rom; + uint8_t key_pos(uint8_t val); + uint8_t m_lookup; + uint8_t m_key; + const uint8_t *m_p_rom; }; diff --git a/src/mame/machine/kabuki.cpp b/src/mame/machine/kabuki.cpp index 4be230bc609..f2c82cbd67e 100644 --- a/src/mame/machine/kabuki.cpp +++ b/src/mame/machine/kabuki.cpp @@ -140,7 +140,7 @@ static int bytedecode(int src,int swap_key1,int swap_key2,int xor_key,int select return src; } -static void kabuki_decode(UINT8 *src,UINT8 *dest_op,UINT8 *dest_data, +static void kabuki_decode(uint8_t *src,uint8_t *dest_op,uint8_t *dest_data, int base_addr,int length,int swap_key1,int swap_key2,int addr_key,int xor_key) { int A; @@ -160,7 +160,7 @@ static void kabuki_decode(UINT8 *src,UINT8 *dest_op,UINT8 *dest_data, -static void mitchell_decode(UINT8 *src, UINT8 *dst, int size, int swap_key1,int swap_key2,int addr_key,int xor_key) +static void mitchell_decode(uint8_t *src, uint8_t *dst, int size, int swap_key1,int swap_key2,int addr_key,int xor_key) { int numbanks = (size - 0x10000) / 0x4000; @@ -172,25 +172,25 @@ static void mitchell_decode(UINT8 *src, UINT8 *dst, int size, int swap_key1,int kabuki_decode(src+i*0x4000,dst+i*0x4000,src+i*0x4000,0x8000,0x4000, swap_key1,swap_key2,addr_key,xor_key); } -void mgakuen2_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x76543210,0x01234567,0xaa55,0xa5); } -void pang_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x01234567,0x76543210,0x6548,0x24); } -void cworld_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x04152637,0x40516273,0x5751,0x43); } -void hatena_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x5751,0x43); } -void spang_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x5852,0x43); } -void spangj_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x45123670,0x67012345,0x55aa,0x5a); } -void sbbros_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x2130,0x12); } -void marukin_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x54321076,0x54321076,0x4854,0x4f); } -void qtono1_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x12345670,0x12345670,0x1111,0x11); } -void qsangoku_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x23456701,0x23456701,0x1828,0x18); } -void block_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x02461357,0x64207531,0x0002,0x01); } +void mgakuen2_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x76543210,0x01234567,0xaa55,0xa5); } +void pang_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x01234567,0x76543210,0x6548,0x24); } +void cworld_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x04152637,0x40516273,0x5751,0x43); } +void hatena_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x5751,0x43); } +void spang_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x5852,0x43); } +void spangj_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x45123670,0x67012345,0x55aa,0x5a); } +void sbbros_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x2130,0x12); } +void marukin_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x54321076,0x54321076,0x4854,0x4f); } +void qtono1_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x12345670,0x12345670,0x1111,0x11); } +void qsangoku_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x23456701,0x23456701,0x1828,0x18); } +void block_decode(uint8_t *src, uint8_t *dst, int size) { mitchell_decode(src,dst,size,0x02461357,0x64207531,0x0002,0x01); } -static void cps1_decode(UINT8 *src, UINT8 *dst,int swap_key1,int swap_key2,int addr_key,int xor_key) +static void cps1_decode(uint8_t *src, uint8_t *dst,int swap_key1,int swap_key2,int addr_key,int xor_key) { kabuki_decode(src,dst,src,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key); } -void wof_decode(UINT8 *src, UINT8 *dst) { cps1_decode(src,dst,0x01234567,0x54163072,0x5151,0x51); } -void dino_decode(UINT8 *src, UINT8 *dst) { cps1_decode(src,dst,0x76543210,0x24601357,0x4343,0x43); } -void punisher_decode(UINT8 *src, UINT8 *dst) { cps1_decode(src,dst,0x67452103,0x75316024,0x2222,0x22); } -void slammast_decode(UINT8 *src, UINT8 *dst) { cps1_decode(src,dst,0x54321076,0x65432107,0x3131,0x19); } +void wof_decode(uint8_t *src, uint8_t *dst) { cps1_decode(src,dst,0x01234567,0x54163072,0x5151,0x51); } +void dino_decode(uint8_t *src, uint8_t *dst) { cps1_decode(src,dst,0x76543210,0x24601357,0x4343,0x43); } +void punisher_decode(uint8_t *src, uint8_t *dst) { cps1_decode(src,dst,0x67452103,0x75316024,0x2222,0x22); } +void slammast_decode(uint8_t *src, uint8_t *dst) { cps1_decode(src,dst,0x54321076,0x65432107,0x3131,0x19); } diff --git a/src/mame/machine/kabuki.h b/src/mame/machine/kabuki.h index 1b9165bea07..ef7d375632e 100644 --- a/src/mame/machine/kabuki.h +++ b/src/mame/machine/kabuki.h @@ -2,18 +2,18 @@ // copyright-holders:Nicola Salmoria #include "emu.h" -void mgakuen2_decode(UINT8 *src, UINT8 *dst, int size); -void pang_decode(UINT8 *src, UINT8 *dst, int size); -void cworld_decode(UINT8 *src, UINT8 *dst, int size); -void hatena_decode(UINT8 *src, UINT8 *dst, int size); -void spang_decode(UINT8 *src, UINT8 *dst, int size); -void spangj_decode(UINT8 *src, UINT8 *dst, int size); -void sbbros_decode(UINT8 *src, UINT8 *dst, int size); -void marukin_decode(UINT8 *src, UINT8 *dst, int size); -void qtono1_decode(UINT8 *src, UINT8 *dst, int size); -void qsangoku_decode(UINT8 *src, UINT8 *dst, int size); -void block_decode(UINT8 *src, UINT8 *dst, int size); -void wof_decode(UINT8 *src, UINT8 *dst); -void dino_decode(UINT8 *src, UINT8 *dst); -void punisher_decode(UINT8 *src, UINT8 *dst); -void slammast_decode(UINT8 *src, UINT8 *dst); +void mgakuen2_decode(uint8_t *src, uint8_t *dst, int size); +void pang_decode(uint8_t *src, uint8_t *dst, int size); +void cworld_decode(uint8_t *src, uint8_t *dst, int size); +void hatena_decode(uint8_t *src, uint8_t *dst, int size); +void spang_decode(uint8_t *src, uint8_t *dst, int size); +void spangj_decode(uint8_t *src, uint8_t *dst, int size); +void sbbros_decode(uint8_t *src, uint8_t *dst, int size); +void marukin_decode(uint8_t *src, uint8_t *dst, int size); +void qtono1_decode(uint8_t *src, uint8_t *dst, int size); +void qsangoku_decode(uint8_t *src, uint8_t *dst, int size); +void block_decode(uint8_t *src, uint8_t *dst, int size); +void wof_decode(uint8_t *src, uint8_t *dst); +void dino_decode(uint8_t *src, uint8_t *dst); +void punisher_decode(uint8_t *src, uint8_t *dst); +void slammast_decode(uint8_t *src, uint8_t *dst); diff --git a/src/mame/machine/kaneko_calc3.cpp b/src/mame/machine/kaneko_calc3.cpp index dc5014df5cb..1e7811e194f 100644 --- a/src/mame/machine/kaneko_calc3.cpp +++ b/src/mame/machine/kaneko_calc3.cpp @@ -29,7 +29,7 @@ const device_type KANEKO_CALC3 = &device_creator; -kaneko_calc3_device::kaneko_calc3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kaneko_calc3_device::kaneko_calc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KANEKO_CALC3, "Kaneko CALC3 MCU", tag, owner, clock, "kaneko_calc3", __FILE__), m_mcuram(*this, ":mcuram"), m_mcu_status(0), @@ -129,7 +129,7 @@ void kaneko_calc3_device::mcu_init() m_mcu_command_offset = 0; } -void kaneko_calc3_device::mcu_com_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _n_) +void kaneko_calc3_device::mcu_com_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _n_) { logerror("calc3w %d %04x %04x\n", _n_, data, mem_mask); m_mcu_status |= (1 << _n_); @@ -190,7 +190,7 @@ where games specify the same decryption key the table used is the same, I don't part of the table to be 0 */ -static const INT16 keydata[0x40*0x100] = { +static const int16_t keydata[0x40*0x100] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -1217,7 +1217,7 @@ static const INT16 keydata[0x40*0x100] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; -UINT8 kaneko_calc3_device::shift_bits(UINT8 dat, int bits) +uint8_t kaneko_calc3_device::shift_bits(uint8_t dat, int bits) { bits &=0x7; @@ -1233,13 +1233,13 @@ UINT8 kaneko_calc3_device::shift_bits(UINT8 dat, int bits) return dat; } -int kaneko_calc3_device::decompress_table(int tabnum, UINT8* dstram, int dstoffset) +int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstoffset) { address_space &space = machine().device(":maincpu")->memory().space(AS_PROGRAM); - UINT8* datarom = memregion(":calc3_rom")->base(); + uint8_t* datarom = memregion(":calc3_rom")->base(); - UINT8 numregions; - UINT16 length; + uint8_t numregions; + uint16_t length; int local_counter=0; int x; int offset = 0; @@ -1257,7 +1257,7 @@ int kaneko_calc3_device::decompress_table(int tabnum, UINT8* dstram, int dstoffs // scan through the linked list to find the start of the requested table info for (x=0;xbase(); + uint8_t numregions; + uint8_t* datarom = memregion(":calc3_rom")->base(); int x; @@ -1552,7 +1552,7 @@ void kaneko_calc3_device::initial_scan_tables() for (x=0;x tmpdstram(0x2000); + std::vector tmpdstram(0x2000); #if VERBOSE_OUTPUT int length; #endif @@ -1615,7 +1615,7 @@ void kaneko_calc3_device::initial_scan_tables() void kaneko_calc3_device::mcu_run() { - UINT16 mcu_command; + uint16_t mcu_command; int i; address_space &space = machine().device(":maincpu")->memory().space(AS_PROGRAM); @@ -1697,9 +1697,9 @@ void kaneko_calc3_device::mcu_run() { int param1 = m_mcuram[(m_mcu_command_offset>>1) + 1 + (2*i)]; int param2 = m_mcuram[(m_mcu_command_offset>>1) + 2 + (2*i)]; - UINT8 commandtabl = (param1&0xff00) >> 8; - UINT16 commandaddr =param2;// (param1&0x00ff) | (param2&0xff00); - UINT8 commandunk = (param1&0x00ff); // brap boys sets.. seems to cause further writebasck address displacement?? (when tested on hw it looked like a simple +, but that doesn't work for brapboys...) + uint8_t commandtabl = (param1&0xff00) >> 8; + uint16_t commandaddr =param2;// (param1&0x00ff) | (param2&0xff00); + uint8_t commandunk = (param1&0x00ff); // brap boys sets.. seems to cause further writebasck address displacement?? (when tested on hw it looked like a simple +, but that doesn't work for brapboys...) #if VERBOSE_OUTPUT printf("transfer %d table %02x writeback address %04x unknown %02x\n", i, commandtabl, commandaddr, commandunk); #endif diff --git a/src/mame/machine/kaneko_calc3.h b/src/mame/machine/kaneko_calc3.h index af5e1d31d94..51a3b52a4b4 100644 --- a/src/mame/machine/kaneko_calc3.h +++ b/src/mame/machine/kaneko_calc3.h @@ -9,7 +9,7 @@ class kaneko_calc3_device : public device_t { public: - kaneko_calc3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kaneko_calc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE16_MEMBER(mcu_com0_w); DECLARE_WRITE16_MEMBER(mcu_com1_w); @@ -25,25 +25,25 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - required_shared_ptr m_mcuram; + required_shared_ptr m_mcuram; int m_mcu_status; int m_mcu_command_offset; - UINT16 m_mcu_crc; - UINT8 m_decryption_key_byte; - UINT8 m_alternateswaps; - UINT8 m_shift; - UINT8 m_subtracttype; - UINT8 m_mode; - UINT8 m_blocksize_offset; - UINT16 m_dataend; - UINT16 m_database; + uint16_t m_mcu_crc; + uint8_t m_decryption_key_byte; + uint8_t m_alternateswaps; + uint8_t m_shift; + uint8_t m_subtracttype; + uint8_t m_mode; + uint8_t m_blocksize_offset; + uint16_t m_dataend; + uint16_t m_database; int m_data_header[2]; - UINT32 m_writeaddress; - UINT32 m_writeaddress_current; - UINT16 m_dsw_addr; - UINT16 m_eeprom_addr; - UINT16 m_poll_addr; - UINT16 m_checksumaddress; + uint32_t m_writeaddress; + uint32_t m_writeaddress_current; + uint16_t m_dsw_addr; + uint16_t m_eeprom_addr; + uint16_t m_poll_addr; + uint16_t m_checksumaddress; emu_timer* m_runtimer; enum @@ -53,9 +53,9 @@ private: void mcu_init(); void initial_scan_tables(); - void mcu_com_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _n_); - UINT8 shift_bits(UINT8 dat, int bits); - int decompress_table(int tabnum, UINT8* dstram, int dstoffset); + void mcu_com_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _n_); + uint8_t shift_bits(uint8_t dat, int bits); + int decompress_table(int tabnum, uint8_t* dstram, int dstoffset); }; diff --git a/src/mame/machine/kaneko_hit.cpp b/src/mame/machine/kaneko_hit.cpp index f0954e2aedc..4ecd6cd1f7c 100644 --- a/src/mame/machine/kaneko_hit.cpp +++ b/src/mame/machine/kaneko_hit.cpp @@ -30,7 +30,7 @@ const device_type KANEKO_HIT = &device_creator; -kaneko_hit_device::kaneko_hit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kaneko_hit_device::kaneko_hit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KANEKO_HIT, "Kaneko CALC Hitbox", tag, owner, clock, "kaneko_hit", __FILE__), m_watchdog(*this, "^watchdog") { @@ -149,7 +149,7 @@ WRITE16_MEMBER(kaneko_hit_device::kaneko_hit_w) READ16_MEMBER(kaneko_hit_device::kaneko_hit_type0_r) { calc1_hit_t &hit = m_hit; - UINT16 data = 0; + uint16_t data = 0; switch (offset) { @@ -186,9 +186,9 @@ READ16_MEMBER(kaneko_hit_device::kaneko_hit_type0_r) return data; case 0x10/2: - return (((UINT32)hit.mult_a * (UINT32)hit.mult_b) >> 16); + return (((uint32_t)hit.mult_a * (uint32_t)hit.mult_b) >> 16); case 0x12/2: - return (((UINT32)hit.mult_a * (UINT32)hit.mult_b) & 0xffff); + return (((uint32_t)hit.mult_a * (uint32_t)hit.mult_b) & 0xffff); case 0x14/2: return (machine().rand() & 0xffff); @@ -234,8 +234,8 @@ WRITE16_MEMBER(kaneko_hit_device::kaneko_hit_type0_w) READ16_MEMBER(kaneko_hit_device::kaneko_hit_type1_r) { calc1_hit_t &hit = m_hit; - UINT16 data = 0; - INT16 x_coll, y_coll; + uint16_t data = 0; + int16_t x_coll, y_coll; x_coll = calc_compute_x(hit); @@ -328,9 +328,9 @@ WRITE16_MEMBER(kaneko_hit_device::kaneko_hit_type1_w) result <----------> | <--------> | <----> */ -INT16 kaneko_hit_device::calc_compute_x(calc1_hit_t &hit) +int16_t kaneko_hit_device::calc_compute_x(calc1_hit_t &hit) { - INT16 x_coll; + int16_t x_coll; // X distance if ((hit.x2p >= hit.x1p) && (hit.x2p < (hit.x1p + hit.x1s))) // x2p inside x1 @@ -343,9 +343,9 @@ INT16 kaneko_hit_device::calc_compute_x(calc1_hit_t &hit) return x_coll; } -INT16 kaneko_hit_device::calc_compute_y(calc1_hit_t &hit) +int16_t kaneko_hit_device::calc_compute_y(calc1_hit_t &hit) { - INT16 y_coll; + int16_t y_coll; // Y distance if ((hit.y2p >= hit.y1p) && (hit.y2p < (hit.y1p + hit.y1s))) // y2p inside y1 diff --git a/src/mame/machine/kaneko_hit.h b/src/mame/machine/kaneko_hit.h index 6add6b0d508..35cbbef2c50 100644 --- a/src/mame/machine/kaneko_hit.h +++ b/src/mame/machine/kaneko_hit.h @@ -7,12 +7,12 @@ struct calc1_hit_t { - UINT16 x1p, y1p, x1s, y1s; - UINT16 x2p, y2p, x2s, y2s; + uint16_t x1p, y1p, x1s, y1s; + uint16_t x2p, y2p, x2s, y2s; - INT16 x12, y12, x21, y21; + int16_t x12, y12, x21, y21; - UINT16 mult_a, mult_b; + uint16_t mult_a, mult_b; }; struct calc3_hit_t @@ -29,10 +29,10 @@ struct calc3_hit_t int x1tox2, y1toy2, z1toz2; - UINT16 mult_a, mult_b; + uint16_t mult_a, mult_b; - UINT16 flags; - UINT16 mode; + uint16_t flags; + uint16_t mode; }; @@ -40,7 +40,7 @@ struct calc3_hit_t class kaneko_hit_device : public device_t { public: - kaneko_hit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kaneko_hit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_type(device_t &device, int hittype); @@ -64,8 +64,8 @@ private: DECLARE_READ16_MEMBER(kaneko_hit_type1_r); DECLARE_WRITE16_MEMBER(kaneko_hit_type1_w); - INT16 calc_compute_x(calc1_hit_t &hit); - INT16 calc_compute_y(calc1_hit_t &hit); + int16_t calc_compute_x(calc1_hit_t &hit); + int16_t calc_compute_y(calc1_hit_t &hit); DECLARE_WRITE16_MEMBER(kaneko_hit_type2_w); DECLARE_READ16_MEMBER(kaneko_hit_type2_r); diff --git a/src/mame/machine/kaneko_toybox.cpp b/src/mame/machine/kaneko_toybox.cpp index ea0b67baab0..82e893b008a 100644 --- a/src/mame/machine/kaneko_toybox.cpp +++ b/src/mame/machine/kaneko_toybox.cpp @@ -53,7 +53,7 @@ mcu_subcmd = kaneko16_mcu_ram[0x0014/2]; // sub-command parameter, happens o const device_type KANEKO_TOYBOX = &device_creator; -kaneko_toybox_device::kaneko_toybox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kaneko_toybox_device::kaneko_toybox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KANEKO_TOYBOX, "Kaneko Toybox MCU", tag, owner, clock, "kaneko_toybox", __FILE__), m_mcuram(*this, ":mcuram"), m_gametype(GAME_NORMAL), @@ -76,7 +76,7 @@ void kaneko_toybox_device::set_game_type(device_t &device, int gametype) void kaneko_toybox_device::device_start() { - memset(m_mcu_com, 0, 4 * sizeof( UINT16) ); + memset(m_mcu_com, 0, 4 * sizeof( uint16_t) ); decrypt_rom(); save_item(NAME(m_mcu_com)); @@ -95,7 +95,7 @@ void kaneko_toybox_device::device_reset() // not sure if it's all 100% endian safe void kaneko_toybox_device::decrypt_rom() { - UINT8 *src = (UINT8 *)machine().root_device().memregion(":mcudata")->base(); + uint8_t *src = (uint8_t *)machine().root_device().memregion(":mcudata")->base(); int i; @@ -108,19 +108,19 @@ void kaneko_toybox_device::decrypt_rom() -void kaneko_toybox_device::handle_04_subcommand(UINT8 mcu_subcmd, UINT16 *mcu_ram) +void kaneko_toybox_device::handle_04_subcommand(uint8_t mcu_subcmd, uint16_t *mcu_ram) { - UINT8 *src = (UINT8 *)machine().root_device().memregion(":mcudata")->base()+0x10000; - UINT8* dst = (UINT8 *)mcu_ram; + uint8_t *src = (uint8_t *)machine().root_device().memregion(":mcudata")->base()+0x10000; + uint8_t* dst = (uint8_t *)mcu_ram; int offs = (mcu_subcmd&0x3f)*8; int x; - //UINT16 unused = src[offs+0] | (src[offs+1]<<8); - UINT16 romstart = src[offs+2] | (src[offs+3]<<8); - UINT16 romlength = src[offs+4] | (src[offs+5]<<8); - UINT16 ramdest = mcu_ram[0x0012/2]; - //UINT16 extra = src[offs+6] | (src[offs+7]<<8); // BONK .. important :-( + //uint16_t unused = src[offs+0] | (src[offs+1]<<8); + uint16_t romstart = src[offs+2] | (src[offs+3]<<8); + uint16_t romlength = src[offs+4] | (src[offs+5]<<8); + uint16_t ramdest = mcu_ram[0x0012/2]; + //uint16_t extra = src[offs+6] | (src[offs+7]<<8); // BONK .. important :-( //printf("romstart %04x length %04x\n",romstart,romlength); @@ -133,10 +133,10 @@ void kaneko_toybox_device::handle_04_subcommand(UINT8 mcu_subcmd, UINT16 *mcu_ra void kaneko_toybox_device::mcu_init() { - memset(m_mcu_com, 0, 4 * sizeof( UINT16) ); + memset(m_mcu_com, 0, 4 * sizeof( uint16_t) ); } -void kaneko_toybox_device::mcu_com_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _n_) +void kaneko_toybox_device::mcu_com_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _n_) { COMBINE_DATA(&m_mcu_com[_n_]); if (m_mcu_com[0] != 0xFFFF) return; @@ -144,7 +144,7 @@ void kaneko_toybox_device::mcu_com_w(offs_t offset, UINT16 data, UINT16 mem_mask if (m_mcu_com[2] != 0xFFFF) return; if (m_mcu_com[3] != 0xFFFF) return; - memset(m_mcu_com, 0, 4 * sizeof( UINT16 ) ); + memset(m_mcu_com, 0, 4 * sizeof( uint16_t ) ); mcu_run(); } @@ -166,9 +166,9 @@ READ16_MEMBER(kaneko_toybox_device::mcu_status_r) void kaneko_toybox_device::mcu_run() { - UINT16 mcu_command = m_mcuram[0x0010/2]; - UINT16 mcu_offset = m_mcuram[0x0012/2] / 2; - UINT16 mcu_data = m_mcuram[0x0014/2]; + uint16_t mcu_command = m_mcuram[0x0010/2]; + uint16_t mcu_offset = m_mcuram[0x0012/2] / 2; + uint16_t mcu_data = m_mcuram[0x0014/2]; //printf("command %04x\n",mcu_command); @@ -176,13 +176,13 @@ void kaneko_toybox_device::mcu_run() { case 0x02: // Read from NVRAM { - UINT8* nvdat = (UINT8*)&m_mcuram[mcu_offset]; + uint8_t* nvdat = (uint8_t*)&m_mcuram[mcu_offset]; eeprom_serial_93cxx_device *eeprom = machine().device(":eeprom"); for (int i=0;i<0x80;i+=2) { - UINT16 dat = eeprom->internal_read(i/2); + uint16_t dat = eeprom->internal_read(i/2); nvdat[i] = (dat & 0xff00) >> 8; nvdat[i+1] = (dat & 0x00ff); } @@ -195,10 +195,10 @@ void kaneko_toybox_device::mcu_run() case 0x42: // Write to NVRAM { eeprom_serial_93cxx_device *eeprom = machine().device(":eeprom"); - UINT8* nvdat = (UINT8*)&m_mcuram[mcu_offset]; + uint8_t* nvdat = (uint8_t*)&m_mcuram[mcu_offset]; for (int i=0;i<0x80;i+=2) { - UINT16 dat = (nvdat[i] << 8) | (nvdat[i+1]); + uint16_t dat = (nvdat[i] << 8) | (nvdat[i+1]); eeprom->internal_write(i/2, dat); } @@ -214,10 +214,10 @@ void kaneko_toybox_device::mcu_run() //memcpy(m_nvram_save, bonkadv_mcu_43, sizeof(bonkadv_mcu_43)); eeprom_serial_93cxx_device *eeprom = machine().device(":eeprom"); - UINT8* nvdat = (UINT8*)&bonkadv_mcu_43[0]; + uint8_t* nvdat = (uint8_t*)&bonkadv_mcu_43[0]; for (int i=0;i<0x80;i+=2) { - UINT16 dat = (nvdat[i] << 8) | (nvdat[i+1]); + uint16_t dat = (nvdat[i] << 8) | (nvdat[i+1]); eeprom->internal_write(i/2, dat); } diff --git a/src/mame/machine/kaneko_toybox.h b/src/mame/machine/kaneko_toybox.h index 98b4bbbec34..1a01e5c9306 100644 --- a/src/mame/machine/kaneko_toybox.h +++ b/src/mame/machine/kaneko_toybox.h @@ -24,7 +24,7 @@ // MCU executed command: 4300 0100 - factory settings // this command is issued whenever the nvram settings are corrupted // the MCU writes directly to NVRAM -static const UINT16 bonkadv_mcu_43[] = { +static const uint16_t bonkadv_mcu_43[] = { 0x8BE0,0x8E71,0x0102,0x0102,0x0300,0x010C,0x0202,0x0202, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0030,0x0020,0x4F6B,0x0305,0x0000,0x0000,0x0000,0x0000, @@ -47,12 +47,12 @@ static const UINT16 bonkadv_mcu_43[] = { 200E0E: 7E7F moveq #$7f, D7 200E10: 4E75 rts */ -static const UINT16 bonkadv_mcu_4_34[] = { +static const uint16_t bonkadv_mcu_4_34[] = { 0x7071,0x7273,0x7475,0x7677,0x7879,0x7a7b,0x7c7d,0x7e7f, 0x4e75 }; // MCU executed command: 0400 0180 0032 - 128 bytes at $200180 -static const UINT16 bonkadv_mcu_4_32[] = { +static const uint16_t bonkadv_mcu_4_32[] = { 0x00cc,0xcc0c,0xc0c0,0xc080,0x0484,0xb6a6,0x0404,0x80c0, 0x80b1,0xb1a1,0xa1b2,0xa2b3,0xb3a3,0xa3b1,0xb1b1,0xb1c0, 0xc0a1,0xa1a1,0xa1b2,0xb2a2,0xa290,0x9090,0xb9b9,0xa9a9, @@ -63,7 +63,7 @@ static const UINT16 bonkadv_mcu_4_32[] = { 0xc0c0,0xa1a1,0xa1a1,0xb2b2,0xa2a2,0x9090,0x9000,0x0000 }; // MCU executed command: 0400 0280 0031 - 112 bytes at $200280 -static const UINT16 bonkadv_mcu_4_31[] = { +static const uint16_t bonkadv_mcu_4_31[] = { 0x1013,0x1411,0x1216,0x1519,0x1a17,0x1824,0x2322,0x211f, 0x201e,0x1d1c,0x1b27,0x2825,0x2629,0x2a2b,0x2e2f,0x2c2d, 0x3130,0x3435,0x3233,0x3f3e,0x3d3c,0x3a3b,0x3938,0x3736, @@ -73,7 +73,7 @@ static const UINT16 bonkadv_mcu_4_31[] = { 0x7071,0x6f6e,0x6d6c,0x7879,0x7677,0x7a7b,0x7c7d,0x7e7f }; // MCU executed command: 0400 0E50 0030 - 655 bytes at $200E50 (656 here) -static const UINT16 bonkadv_mcu_4_30[] = { +static const uint16_t bonkadv_mcu_4_30[] = { 0x8c00,0x9700,0xa000,0xa700,0xb200,0xb700,0xc000,0xcc00, 0xd600,0xdf00,0xef00,0xf500,0xfd00,0x0501,0x0b01,0x1801, 0x1e01,0x2901,0x3101,0x3701,0x4101,0x4901,0x0b01,0x5d01, @@ -119,7 +119,7 @@ static const UINT16 bonkadv_mcu_4_30[] = { 0xff00,0x0005,0x2495,0x96ff,0x0000,0x009a,0xff00,0x0000 }; // MCU executed command: 0400 0400 0033 - 2560 bytes at $200400 -static const UINT16 bonkadv_mcu_4_33[] = { +static const uint16_t bonkadv_mcu_4_33[] = { 0x00a4,0x0001,0x00a5,0x005a,0x00a6,0x0074,0x00a7,0x009b, 0x00a8,0x00d0,0x00a9,0x00fe,0x00aa,0x015d,0x00ab,0x01b0, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, @@ -292,7 +292,7 @@ static const UINT16 bonkadv_mcu_4_33[] = { }; /* decryption table */ -static const UINT8 decryption_table[0x100] = { +static const uint8_t decryption_table[0x100] = { 0x7b,0x82,0xf0,0xbc,0x7f,0x1d,0xa2,0xc5,0x2a,0xfa,0x55,0xee,0x1a,0xd0,0x59,0x76, 0x5e,0x75,0x79,0x16,0xa5,0xf6,0x84,0xed,0x0f,0x2e,0xf2,0x36,0x61,0xac,0xcd,0xab, 0x01,0x3b,0x01,0x87,0x73,0xab,0xce,0x5d,0xd4,0x1d,0x68,0x2a,0x35,0xea,0x13,0x27, @@ -312,7 +312,7 @@ static const UINT8 decryption_table[0x100] = { }; /* alt decryption table (gtmr2) */ -static const UINT8 decryption_table_alt[0x100] = { +static const uint8_t decryption_table_alt[0x100] = { 0x26,0x17,0xb9,0xcf,0x1a,0xf5,0x14,0x1e,0x0c,0x35,0xb3,0x66,0xa0,0x17,0xe9,0xe4, 0x90,0xf6,0xd5,0x35,0xac,0x95,0x49,0x43,0x64,0x0c,0x03,0x75,0x4d,0xda,0xb6,0xdf, 0x06,0xcf,0x83,0x9e,0x35,0x2c,0x71,0x2a,0xab,0xcc,0x65,0xd4,0x1f,0xb0,0x88,0x3c, @@ -335,7 +335,7 @@ static const UINT8 decryption_table_alt[0x100] = { class kaneko_toybox_device : public device_t { public: - kaneko_toybox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kaneko_toybox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_table(device_t &device, int tabletype); static void set_game_type(device_t &device, int gametype); @@ -351,14 +351,14 @@ protected: virtual void device_reset() override; private: - required_shared_ptr m_mcuram; - UINT16 m_mcu_com[4]; + required_shared_ptr m_mcuram; + uint16_t 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 mcu_com_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _n_); void decrypt_rom(); - void handle_04_subcommand(UINT8 mcu_subcmd, UINT16 *mcu_ram); + void handle_04_subcommand(uint8_t mcu_subcmd, uint16_t *mcu_ram); void mcu_init(); void mcu_run(); }; diff --git a/src/mame/machine/kay_kbd.cpp b/src/mame/machine/kay_kbd.cpp index 617d7636365..29054381891 100644 --- a/src/mame/machine/kay_kbd.cpp +++ b/src/mame/machine/kay_kbd.cpp @@ -69,12 +69,12 @@ struct kay_kbd_t { beep_device *beeper; - UINT8 buff[16]; - UINT8 head; - UINT8 tail; - UINT8 beep_on; - UINT8 control_status; - UINT8 keyrows[10]; + uint8_t buff[16]; + uint8_t head; + uint8_t tail; + uint8_t beep_on; + uint8_t control_status; + uint8_t keyrows[10]; int lastrow; int mask; int key; @@ -181,7 +181,7 @@ INPUT_PORTS_START( kay_kbd ) PORT_BIT(0xf0, 0x00, IPT_UNUSED) INPUT_PORTS_END -static const UINT8 keyboard[8][10][8] = { +static const uint8_t keyboard[8][10][8] = { { /* normal */ { 27,'1','2','3','4','5','6','7'}, {'8','9','0','-','=','`', 8, 9}, @@ -305,7 +305,7 @@ INTERRUPT_GEN_MEMBER(kaypro_state::kay_kbd_interrupt) { kay_kbd_t *kbd = m_kbd; int mod, row, col, chg, newval; - UINT8 *keyrows = kbd->keyrows; + uint8_t *keyrows = kbd->keyrows; if( kbd->repeat ) { @@ -413,10 +413,10 @@ static WRITE8_HANDLER ( kaypro2_const_w ) * releases CPU if it was waiting for a key * sounds bell if buffer would overflow ******************************************************/ -void kaypro_state::kay_kbd_in(UINT8 data ) +void kaypro_state::kay_kbd_in(uint8_t data ) { kay_kbd_t *kbd = m_kbd; - UINT8 kbd_head_old; + uint8_t kbd_head_old; kbd_head_old = kbd->head; kbd->buff[kbd->head] = data; @@ -432,14 +432,14 @@ void kaypro_state::kay_kbd_in(UINT8 data ) } -UINT8 kaypro_state::kay_kbd_c_r() +uint8_t kaypro_state::kay_kbd_c_r() { /* d4 transmit buffer empty - 1=ok to send d2 appears to be receive buffer empty - 1=ok to receive d0 keyboard buffer empty - 1=key waiting to be used */ kay_kbd_t *kbd = m_kbd; - UINT8 data = kbd->control_status; + uint8_t data = kbd->control_status; if( kbd->head != kbd->tail ) data++; @@ -447,12 +447,12 @@ UINT8 kaypro_state::kay_kbd_c_r() return data; } -UINT8 kaypro_state::kay_kbd_d_r() +uint8_t kaypro_state::kay_kbd_d_r() { /* return next key in buffer */ kay_kbd_t *kbd = m_kbd; - UINT8 data = 0; + uint8_t data = 0; if (kbd->tail != kbd->head) { @@ -470,7 +470,7 @@ TIMER_CALLBACK_MEMBER( kaypro_state::kay_kbd_beepoff ) kbd->control_status |= 4; } -void kaypro_state::kay_kbd_d_w( UINT8 data ) +void kaypro_state::kay_kbd_d_w( uint8_t data ) { /* Beeper control - lengths need verifying 01 - keyclick @@ -480,7 +480,7 @@ void kaypro_state::kay_kbd_d_w( UINT8 data ) 16 - unmute */ kay_kbd_t *kbd = m_kbd; - UINT16 length = 0; + uint16_t length = 0; if (data & 0x10) kbd->beep_on = 1; diff --git a/src/mame/machine/kaypro.cpp b/src/mame/machine/kaypro.cpp index d396f7c6803..078d17b5e75 100644 --- a/src/mame/machine/kaypro.cpp +++ b/src/mame/machine/kaypro.cpp @@ -22,7 +22,7 @@ WRITE_LINE_MEMBER( kaypro_state::write_centronics_busy ) READ8_MEMBER( kaypro_state::pio_system_r ) { - UINT8 data = 0; + uint8_t data = 0; /* centronics busy */ data |= m_centronics_busy << 3; @@ -89,7 +89,7 @@ WRITE8_MEMBER( kaypro_state::kaypro4_pio_system_w ) READ8_MEMBER( kaypro_state::kaypro2x_system_port_r ) { - UINT8 data = m_centronics_busy << 6; + uint8_t data = m_centronics_busy << 6; return (m_system_port & 0xbf) | data; } @@ -271,9 +271,9 @@ MACHINE_RESET_MEMBER( kaypro_state,kaypro ) QUICKLOAD_LOAD_MEMBER( kaypro_state, kaypro ) { - UINT8 *RAM = memregion("rambank")->base(); - UINT16 i; - UINT8 data; + uint8_t *RAM = memregion("rambank")->base(); + uint16_t i; + uint8_t data; /* Load image to the TPA (Transient Program Area) */ for (i = 0; i < quickload_size; i++) diff --git a/src/mame/machine/kc.cpp b/src/mame/machine/kc.cpp index 81c3dee8c34..1ea9542ff4b 100644 --- a/src/mame/machine/kc.cpp +++ b/src/mame/machine/kc.cpp @@ -9,16 +9,16 @@ struct kcc_header { - UINT8 name[10]; - UINT8 reserved[6]; - UINT8 number_addresses; - UINT8 load_address_l; - UINT8 load_address_h; - UINT8 end_address_l; - UINT8 end_address_h; - UINT8 execution_address_l; - UINT8 execution_address_h; - UINT8 pad[128-2-2-2-1-16]; + uint8_t name[10]; + uint8_t reserved[6]; + uint8_t number_addresses; + uint8_t load_address_l; + uint8_t load_address_h; + uint8_t end_address_l; + uint8_t end_address_h; + uint8_t execution_address_l; + uint8_t execution_address_h; + uint8_t pad[128-2-2-2-1-16]; }; /* appears to work a bit.. */ @@ -29,18 +29,18 @@ struct kcc_header QUICKLOAD_LOAD_MEMBER( kc_state,kc) { struct kcc_header *header; - UINT16 addr; - UINT16 datasize; - UINT16 execution_address; - UINT16 i; + uint16_t addr; + uint16_t datasize; + uint16_t execution_address; + uint16_t i; /* get file size */ - UINT64 size = image.length(); + uint64_t size = image.length(); if (size == 0) return image_init_result::FAIL; - std::vector data(size); + std::vector data(size); image.fread( &data[0], size); header = (struct kcc_header *) &data[0]; @@ -50,7 +50,7 @@ QUICKLOAD_LOAD_MEMBER( kc_state,kc) if (datasize > size - 128) { - osd_printf_info("Invalid snapshot size: expected 0x%04x, found 0x%04x\n", datasize, (UINT32)size - 128); + osd_printf_info("Invalid snapshot size: expected 0x%04x, found 0x%04x\n", datasize, (uint32_t)size - 128); datasize = size - 128; } @@ -79,7 +79,7 @@ QUICKLOAD_LOAD_MEMBER( kc_state,kc) READ8_MEMBER( kc_state::expansion_read ) { - UINT8 result = 0xff; + uint8_t result = 0xff; // assert MEI line of first slot m_expansions[0]->mei_w(ASSERT_LINE); @@ -113,14 +113,14 @@ WRITE8_MEMBER( kc_state::expansion_write ) READ8_MEMBER( kc_state::expansion_io_read ) { - UINT8 result = 0xff; + uint8_t result = 0xff; // assert MEI line of first slot m_expansions[0]->mei_w(ASSERT_LINE); if ((offset & 0xff) == 0x80) { - UINT8 slot_id = (offset>>8) & 0xff; + uint8_t slot_id = (offset>>8) & 0xff; if (slot_id == 0x08 || slot_id == 0x0c) result = m_expansions[(slot_id - 8) >> 2]->module_id_r(); @@ -143,7 +143,7 @@ WRITE8_MEMBER( kc_state::expansion_io_write ) if ((offset & 0xff) == 0x80) { - UINT8 slot_id = (offset>>8) & 0xff; + uint8_t slot_id = (offset>>8) & 0xff; if (slot_id == 0x08 || slot_id == 0x0c) m_expansions[(slot_id - 8) >> 2]->control_w(data); @@ -485,7 +485,7 @@ void kc85_4_state::update_0x08000() /* IRM enabled - has priority over RAM8 enabled */ LOG(("IRM enabled\n")); - UINT8* ram_page = m_video_ram + ((BIT(m_port_84_data, 2)<<15) | (BIT(m_port_84_data, 1)<<14)); + uint8_t* ram_page = m_video_ram + ((BIT(m_port_84_data, 2)<<15) | (BIT(m_port_84_data, 1)<<14)); membank("bank3")->set_base(ram_page); space.install_readwrite_bank(0x8000, 0xa7ff, "bank3"); @@ -498,7 +498,7 @@ void kc85_4_state::update_0x08000() LOG(("RAM8 enabled\n")); int ram8_block; - UINT8 *mem_ptr; + uint8_t *mem_ptr; /* ram8 block chosen */ diff --git a/src/mame/machine/kc_keyb.cpp b/src/mame/machine/kc_keyb.cpp index 740d0dc7fce..55236d507ac 100644 --- a/src/mame/machine/kc_keyb.cpp +++ b/src/mame/machine/kc_keyb.cpp @@ -435,7 +435,7 @@ INPUT_PORTS_END //------------------------------------------------- // kc_keyboard_device - constructor //------------------------------------------------- -kc_keyboard_device::kc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +kc_keyboard_device::kc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KC_KEYBOARD, "KC Keyboard", tag, owner, clock, "kc_keyboard", __FILE__), m_write_out(*this) { @@ -525,7 +525,7 @@ void kc_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int // scan all lines (excluding shift) for (int i=0; i<8; i++) { - UINT8 keyboard_line_data = ioport(keynames[i])->read(); + uint8_t keyboard_line_data = ioport(keynames[i])->read(); // scan through each bit for (int b=0; b<8; b++) @@ -534,7 +534,7 @@ void kc_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int if ((keyboard_line_data & (1< start of code add_pulse_to_transmit_buffer(1); diff --git a/src/mame/machine/kc_keyb.h b/src/mame/machine/kc_keyb.h index 152a886e65f..4bebcd761a1 100644 --- a/src/mame/machine/kc_keyb.h +++ b/src/mame/machine/kc_keyb.h @@ -25,7 +25,7 @@ class kc_keyboard_device : public device_t { public: // construction/destruction - kc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~kc_keyboard_device(); template static devcb_base &set_out_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_out.set_callback(object); } @@ -41,7 +41,7 @@ protected: void add_pulse_to_transmit_buffer(int pulse_state, int pulse_number = 1); void add_bit(int bit); - void transmit_scancode(UINT8 scan_code); + void transmit_scancode(uint8_t scan_code); private: static const device_timer_id TIMER_TRANSMIT_PULSE = 1; @@ -53,7 +53,7 @@ private: // pulses to transmit struct { - UINT8 data[KC_TRANSMIT_BUFFER_LENGTH>>3]; + uint8_t data[KC_TRANSMIT_BUFFER_LENGTH>>3]; int pulse_sent; int pulse_count; } m_transmit_buffer; diff --git a/src/mame/machine/km035.cpp b/src/mame/machine/km035.cpp index f32ef6bffe7..a1b66e3e856 100644 --- a/src/mame/machine/km035.cpp +++ b/src/mame/machine/km035.cpp @@ -269,7 +269,7 @@ ioport_constructor km035_device::device_input_ports() const // km035_device - constructor //------------------------------------------------- -km035_device::km035_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +km035_device::km035_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KM035, "KM035 keyboard", tag, owner, clock, "km035", __FILE__), m_maincpu(*this, KM035_CPU_TAG), m_speaker(*this, KM035_SPK_TAG), diff --git a/src/mame/machine/km035.h b/src/mame/machine/km035.h index 26cbd115574..a25f29bdfb6 100644 --- a/src/mame/machine/km035.h +++ b/src/mame/machine/km035.h @@ -35,7 +35,7 @@ class km035_device : public device_t { public: // construction/destruction - km035_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + km035_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_tx_handler(device_t &device, _Object wr) { return downcast(device).m_tx_handler.set_callback(wr); } template static devcb_base &set_rts_handler(device_t &device, _Object wr) { return downcast(device).m_rts_handler.set_callback(wr); } @@ -65,9 +65,9 @@ private: required_ioport_array<16> m_kbd; int m_keylatch; // keyboard row latch - UINT8 m_p1; - UINT8 m_p2; - UINT8 m_rx; + uint8_t m_p1; + uint8_t m_p2; + uint8_t m_rx; devcb_write_line m_tx_handler; devcb_write_line m_rts_handler; diff --git a/src/mame/machine/konami1.cpp b/src/mame/machine/konami1.cpp index c0240bcbc78..5e84e9617f7 100644 --- a/src/mame/machine/konami1.cpp +++ b/src/mame/machine/konami1.cpp @@ -11,7 +11,7 @@ const device_type KONAMI1 = &device_creator; -konami1_device::konami1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +konami1_device::konami1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6809_base_device(mconfig, "KONAMI-1", tag, owner, clock, KONAMI1, 1, "konami1", __FILE__) { m_boundary = 0x0000; @@ -23,21 +23,21 @@ void konami1_device::device_start() m6809_base_device::device_start(); } -void konami1_device::set_encryption_boundary(UINT16 adr) +void konami1_device::set_encryption_boundary(uint16_t adr) { m_boundary = adr; if(m_mintf) static_cast(m_mintf)->m_boundary = adr; } -konami1_device::mi_konami1::mi_konami1(UINT16 adr) +konami1_device::mi_konami1::mi_konami1(uint16_t adr) { m_boundary = adr; } -UINT8 konami1_device::mi_konami1::read_opcode(UINT16 adr) +uint8_t konami1_device::mi_konami1::read_opcode(uint16_t adr) { - UINT8 val = m_sdirect->read_byte(adr); + uint8_t val = m_sdirect->read_byte(adr); if(adr < m_boundary) return val; switch(adr & 0xa) { diff --git a/src/mame/machine/konami1.h b/src/mame/machine/konami1.h index 4c5b369896d..a15ad165b36 100644 --- a/src/mame/machine/konami1.h +++ b/src/mame/machine/konami1.h @@ -5,20 +5,20 @@ class konami1_device : public m6809_base_device { public: - konami1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + konami1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_encryption_boundary(UINT16 adr); + void set_encryption_boundary(uint16_t adr); protected: class mi_konami1 : public mi_default { public: - UINT16 m_boundary; - mi_konami1(UINT16 boundary); + uint16_t m_boundary; + mi_konami1(uint16_t boundary); virtual ~mi_konami1() {} - virtual UINT8 read_opcode(UINT16 adr) override; + virtual uint8_t read_opcode(uint16_t adr) override; }; - UINT16 m_boundary; + uint16_t m_boundary; virtual void device_start() override; }; diff --git a/src/mame/machine/konamigx.cpp b/src/mame/machine/konamigx.cpp index 9515e5aa3cb..4889cbb8f87 100644 --- a/src/mame/machine/konamigx.cpp +++ b/src/mame/machine/konamigx.cpp @@ -52,7 +52,7 @@ READ16_MEMBER(konamigx_state::K055550_word_r) WRITE16_MEMBER(konamigx_state::K055550_word_w) { - UINT32 adr, bsize, count, i, lim; + uint32_t adr, bsize, count, i, lim; int src, tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2; int dx, dy, angle; @@ -181,7 +181,7 @@ WRITE16_MEMBER(konamigx_state::K053990_martchmp_word_w) int dst_addr, /*dst_count,*/ dst_skip; int mod_addr, mod_count, mod_skip, mod_offs; int mode, i, element_size = 1; - UINT16 mod_val, mod_data; + uint16_t mod_val, mod_data; COMBINE_DATA(m_prot_data+offset); @@ -260,14 +260,14 @@ WRITE16_MEMBER(konamigx_state::K053990_martchmp_word_w) } } -void konamigx_state::konamigx_esc_alert(UINT32 *srcbase, int srcoffs, int count, int mode) // (WARNING: assumed big endianess) +void konamigx_state::konamigx_esc_alert(uint32_t *srcbase, int srcoffs, int count, int mode) // (WARNING: assumed big endianess) { - UINT16* k053247_ram; + uint16_t* k053247_ram; m_k055673->k053247_get_ram(&k053247_ram); // hand-filled but should be close -static const UINT8 ztable[7][8] = +static const uint8_t ztable[7][8] = { {5,4,3,2,1,7,6,0}, {4,3,2,1,0,7,6,5}, @@ -278,7 +278,7 @@ static const UINT8 ztable[7][8] = {5,4,3,2,1,7,6,0} }; -static const UINT8 ptable[7][8] = +static const uint8_t ptable[7][8] = { {0x00,0x00,0x00,0x10,0x20,0x00,0x00,0x30}, {0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x20}, @@ -289,10 +289,10 @@ static const UINT8 ptable[7][8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10} }; - INT32 data1, data2, i, j, vpos, hpos, voffs, hoffs, vcorr, hcorr, vmask, magicid; - UINT32 *src, *srcend, *obj, *objend; - UINT16 *dst; - const UINT8 *zcode, *pcode; + int32_t data1, data2, i, j, vpos, hpos, voffs, hoffs, vcorr, hcorr, vmask, magicid; + uint32_t *src, *srcend, *obj, *objend; + uint16_t *dst; + const uint8_t *zcode, *pcode; if (!count || !srcbase) return; @@ -476,20 +476,20 @@ WRITE32_MEMBER(konamigx_state::fantjour_dma_w) { COMBINE_DATA(m_fantjour_dma + offset); if(!offset && ACCESSING_BITS_24_31) { - UINT32 sa = m_fantjour_dma[1]; - // UINT16 ss = (m_fantjour_dma[2] & 0xffff0000) >> 16; - // UINT32 sb = ((m_fantjour_dma[2] & 0xffff) << 16) | ((m_fantjour_dma[3] & 0xffff0000) >> 16); + uint32_t sa = m_fantjour_dma[1]; + // uint16_t ss = (m_fantjour_dma[2] & 0xffff0000) >> 16; + // uint32_t sb = ((m_fantjour_dma[2] & 0xffff) << 16) | ((m_fantjour_dma[3] & 0xffff0000) >> 16); - UINT32 da = ((m_fantjour_dma[3] & 0xffff) << 16) | ((m_fantjour_dma[4] & 0xffff0000) >> 16); - // UINT16 ds = m_fantjour_dma[4] & 0xffff; - UINT32 db = m_fantjour_dma[5]; + uint32_t da = ((m_fantjour_dma[3] & 0xffff) << 16) | ((m_fantjour_dma[4] & 0xffff0000) >> 16); + // uint16_t ds = m_fantjour_dma[4] & 0xffff; + uint32_t db = m_fantjour_dma[5]; - // UINT8 sz1 = m_fantjour_dma[0] >> 8; - UINT8 sz2 = m_fantjour_dma[0] >> 16; - UINT8 mode = m_fantjour_dma[0] >> 24; + // uint8_t sz1 = m_fantjour_dma[0] >> 8; + uint8_t sz2 = m_fantjour_dma[0] >> 16; + uint8_t mode = m_fantjour_dma[0] >> 24; - UINT32 x = m_fantjour_dma[6]; - UINT32 i1, i2; + uint32_t x = m_fantjour_dma[6]; + uint32_t i1, i2; if(mode == 0x93) for(i1=0; i1 <= sz2; i1++) diff --git a/src/mame/machine/konppc.cpp b/src/mame/machine/konppc.cpp index c3b3211feb4..d82c4eae573 100644 --- a/src/mame/machine/konppc.cpp +++ b/src/mame/machine/konppc.cpp @@ -16,7 +16,7 @@ const device_type KONPPC = &device_creator; -konppc_device::konppc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +konppc_device::konppc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KONPPC, "Konami PowerPC Common Functions", tag, owner, clock, "konppc", __FILE__), cgboard_type(0), num_cgboards(0)/*, @@ -33,7 +33,7 @@ void konppc_device::device_start() for (i=0; i < num_cgboards; i++) { dsp_comm_ppc[i][0] = 0x00; - dsp_shared_ram[i] = std::make_unique(DSP_BANK_SIZE * 2/4); + dsp_shared_ram[i] = std::make_unique(DSP_BANK_SIZE * 2/4); dsp_shared_ram_bank[i] = 0; dsp_state[i] = 0x80; @@ -43,8 +43,8 @@ void konppc_device::device_start() nwk_fifo_read_ptr[i] = 0; nwk_fifo_write_ptr[i] = 0; - nwk_fifo[i] = std::make_unique(0x800); - nwk_ram[i] = std::make_unique(0x2000); + nwk_fifo[i] = std::make_unique(0x800); + nwk_ram[i] = std::make_unique(0x2000); save_item(NAME(dsp_comm_ppc[i]), i); save_item(NAME(dsp_comm_sharc[i]), i); @@ -99,7 +99,7 @@ int konppc_device::get_cgboard_id(void) } } -void konppc_device::set_cgboard_texture_bank(int board, const char *bank, UINT8 *rom) +void konppc_device::set_cgboard_texture_bank(int board, const char *bank, uint8_t *rom) { texture_bank[board] = bank; @@ -193,12 +193,12 @@ WRITE32_MEMBER( konppc_device::cgboard_dsp_shared_w_ppc ) /* CG Board DSP interface for SHARC */ -UINT32 konppc_device::dsp_comm_sharc_r(int board, int offset) +uint32_t konppc_device::dsp_comm_sharc_r(int board, int offset) { return dsp_comm_ppc[board][offset]; } -void konppc_device::dsp_comm_sharc_w(address_space &space, int board, int offset, UINT32 data) +void konppc_device::dsp_comm_sharc_w(address_space &space, int board, int offset, uint32_t data) { if (offset >= 2) { @@ -266,9 +266,9 @@ void konppc_device::dsp_comm_sharc_w(address_space &space, int board, int offset dsp_comm_sharc[board][offset] = data; } -UINT32 konppc_device::dsp_shared_ram_r_sharc(int board, int offset) +uint32_t konppc_device::dsp_shared_ram_r_sharc(int board, int offset) { -// printf("dsp_shared_r: (board %d) %08X, (%08X, %08X)\n", cgboard_id, offset, (UINT32)dsp_shared_ram[(offset >> 1)], (UINT32)dsp_shared_ram[offset]); +// printf("dsp_shared_r: (board %d) %08X, (%08X, %08X)\n", cgboard_id, offset, (uint32_t)dsp_shared_ram[(offset >> 1)], (uint32_t)dsp_shared_ram[offset]); if (offset & 0x1) { @@ -280,7 +280,7 @@ UINT32 konppc_device::dsp_shared_ram_r_sharc(int board, int offset) } } -void konppc_device::dsp_shared_ram_w_sharc(int board, int offset, UINT32 data) +void konppc_device::dsp_shared_ram_w_sharc(int board, int offset, uint32_t data) { // printf("dsp_shared_w: (board %d) %08X, %08X\n", cgboard_id, offset, data); if (offset & 0x1) @@ -337,11 +337,11 @@ WRITE32_MEMBER( konppc_device::cgboard_1_shared_sharc_w ) /*****************************************************************************/ -UINT32 konppc_device::nwk_fifo_r(address_space &space, int board) +uint32_t konppc_device::nwk_fifo_r(address_space &space, int board) { const char *dsptag = (board == 0) ? "dsp" : "dsp2"; adsp21062_device *device = space.machine().device(dsptag); - UINT32 data; + uint32_t data; if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r) { @@ -368,7 +368,7 @@ UINT32 konppc_device::nwk_fifo_r(address_space &space, int board) return data; } -void konppc_device::nwk_fifo_w(int board, UINT32 data) +void konppc_device::nwk_fifo_w(int board, uint32_t data) { const char *dsptag = (board == 0) ? "dsp" : "dsp2"; adsp21062_device *device = machine().device(dsptag); @@ -527,7 +527,7 @@ WRITE32_MEMBER( konppc_device::nwk_voodoo_1_w) #define LED_ON 0xff00ff00 -void draw_7segment_led(bitmap_rgb32 &bitmap, int x, int y, UINT8 value) +void draw_7segment_led(bitmap_rgb32 &bitmap, int x, int y, uint8_t value) { if ((value & 0x7f) == 0x7f) { diff --git a/src/mame/machine/konppc.h b/src/mame/machine/konppc.h index cc3a3c386b9..a4657a01edc 100644 --- a/src/mame/machine/konppc.h +++ b/src/mame/machine/konppc.h @@ -21,14 +21,14 @@ class konppc_device : public device_t { public: // construction/destruction - konppc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + konppc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_num_boards(device_t &device, int num) { downcast(device).num_cgboards = num; } static void static_set_cbboard_type(device_t &device, int cgtype) { downcast(device).cgboard_type = cgtype; } void set_cgboard_id(int board_id); int get_cgboard_id(void); - void set_cgboard_texture_bank(int board, const char *bank, UINT8 *rom); + void set_cgboard_texture_bank(int board, const char *bank, uint8_t *rom); // read/write @@ -61,27 +61,27 @@ protected: // device-level overrides virtual void device_start() override; - UINT32 dsp_comm_sharc_r(int board, int offset); - void dsp_comm_sharc_w(address_space &space, int board, int offset, UINT32 data); - UINT32 dsp_shared_ram_r_sharc(int board, int offset); - void dsp_shared_ram_w_sharc(int board, int offset, UINT32 data); + uint32_t dsp_comm_sharc_r(int board, int offset); + void dsp_comm_sharc_w(address_space &space, int board, int offset, uint32_t data); + uint32_t dsp_shared_ram_r_sharc(int board, int offset); + void dsp_shared_ram_w_sharc(int board, int offset, uint32_t data); - UINT32 nwk_fifo_r(address_space &space, int board); - void nwk_fifo_w(int board, UINT32 data); + uint32_t nwk_fifo_r(address_space &space, int board); + void nwk_fifo_w(int board, uint32_t data); private: // internal state - UINT32 dsp_comm_ppc[MAX_CG_BOARDS][2]; - UINT32 dsp_comm_sharc[MAX_CG_BOARDS][2]; - UINT8 dsp_shared_ram_bank[MAX_CG_BOARDS]; + uint32_t dsp_comm_ppc[MAX_CG_BOARDS][2]; + uint32_t dsp_comm_sharc[MAX_CG_BOARDS][2]; + uint8_t dsp_shared_ram_bank[MAX_CG_BOARDS]; - INT32 cgboard_id; - INT32 cgboard_type; - INT32 num_cgboards; + int32_t cgboard_id; + int32_t cgboard_type; + int32_t num_cgboards; - std::unique_ptr dsp_shared_ram[MAX_CG_BOARDS]; + std::unique_ptr dsp_shared_ram[MAX_CG_BOARDS]; - UINT32 dsp_state[MAX_CG_BOARDS]; - UINT32 nwk_device_sel[MAX_CG_BOARDS]; + uint32_t dsp_state[MAX_CG_BOARDS]; + uint32_t nwk_device_sel[MAX_CG_BOARDS]; const char *texture_bank[MAX_CG_BOARDS]; int nwk_fifo_half_full_r; @@ -89,11 +89,11 @@ private: int nwk_fifo_full; int nwk_fifo_mask; - std::unique_ptr nwk_fifo[MAX_CG_BOARDS]; - INT32 nwk_fifo_read_ptr[MAX_CG_BOARDS]; - INT32 nwk_fifo_write_ptr[MAX_CG_BOARDS]; + std::unique_ptr nwk_fifo[MAX_CG_BOARDS]; + int32_t nwk_fifo_read_ptr[MAX_CG_BOARDS]; + int32_t nwk_fifo_write_ptr[MAX_CG_BOARDS]; - std::unique_ptr nwk_ram[MAX_CG_BOARDS]; + std::unique_ptr nwk_ram[MAX_CG_BOARDS]; }; @@ -101,6 +101,6 @@ private: extern const device_type KONPPC; -void draw_7segment_led(bitmap_rgb32 &bitmap, int x, int y, UINT8 value); +void draw_7segment_led(bitmap_rgb32 &bitmap, int x, int y, uint8_t value); #endif diff --git a/src/mame/machine/leland.cpp b/src/mame/machine/leland.cpp index ba0ce34ec38..64eaab33319 100644 --- a/src/mame/machine/leland.cpp +++ b/src/mame/machine/leland.cpp @@ -48,7 +48,7 @@ int leland_state::dial_compute_value(int new_val, int indx) { int delta = new_val - (int)m_dial_last_input[indx]; - UINT8 result = m_dial_last_result[indx] & 0x80; + uint8_t result = m_dial_last_result[indx] & 0x80; m_dial_last_input[indx] = new_val; @@ -135,8 +135,8 @@ WRITE8_MEMBER(leland_state::alleymas_joystick_kludge) void leland_state::update_dangerz_xy() { - UINT8 newy = ioport("AN0")->read(); - UINT8 newx = ioport("AN1")->read(); + uint8_t newy = ioport("AN0")->read(); + uint8_t newx = ioport("AN1")->read(); int deltay = newy - m_dial_last_input[0]; int deltax = newx - m_dial_last_input[1]; @@ -185,7 +185,7 @@ READ8_MEMBER(leland_state::dangerz_input_upper_r) * *************************************/ -static const UINT8 redline_pedal_value[8] = { 0xf0, 0xe0, 0xc0, 0xd0, 0x90, 0xb0, 0x30, 0x70 }; +static const uint8_t redline_pedal_value[8] = { 0xf0, 0xe0, 0xc0, 0xd0, 0x90, 0xb0, 0x30, 0x70 }; READ8_MEMBER(leland_state::redline_pedal_1_r) { @@ -318,7 +318,7 @@ WRITE8_MEMBER(leland_state::indyheat_analog_w) MACHINE_START_MEMBER(leland_state,leland) { /* allocate extra stuff */ - m_battery_ram = reinterpret_cast(memshare("battery")->ptr()); + m_battery_ram = reinterpret_cast(memshare("battery")->ptr()); /* start scanline interrupts going */ m_master_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::leland_interrupt_callback),this)); @@ -367,8 +367,8 @@ MACHINE_RESET_MEMBER(leland_state,leland) MACHINE_START_MEMBER(leland_state,ataxx) { /* set the odd data banks */ - m_battery_ram = reinterpret_cast(memshare("battery")->ptr()); - m_extra_tram = std::make_unique(ATAXX_EXTRA_TRAM_SIZE); + m_battery_ram = reinterpret_cast(memshare("battery")->ptr()); + m_extra_tram = std::make_unique(ATAXX_EXTRA_TRAM_SIZE); /* start scanline interrupts going */ m_master_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::ataxx_interrupt_callback),this)); @@ -483,7 +483,7 @@ void leland_state::cerberus_bankswitch() /* bankswitching for Mayhem 2002, Power Play, World Series Baseball, and Alley Master */ void leland_state::mayhem_bankswitch() { - UINT8 *address; + uint8_t *address; m_battery_ram_enable = ((m_sound_port_bank & 0x24) == 0); @@ -498,7 +498,7 @@ void leland_state::mayhem_bankswitch() /* bankswitching for Danger Zone */ void leland_state::dangerz_bankswitch() { - UINT8 *address; + uint8_t *address; m_battery_ram_enable = ((m_top_board_bank & 0x80) != 0); @@ -513,7 +513,7 @@ void leland_state::dangerz_bankswitch() /* bankswitching for Baseball the Season II, Super Baseball, and Strike Zone */ void leland_state::basebal2_bankswitch() { - UINT8 *address; + uint8_t *address; m_battery_ram_enable = (m_top_board_bank & 0x80); @@ -531,8 +531,8 @@ void leland_state::basebal2_bankswitch() /* bankswitching for Red Line Racer */ void leland_state::redline_bankswitch() { - static const UINT32 bank_list[] = { 0x10000, 0x18000, 0x02000, 0x02000 }; - UINT8 *address; + static const uint32_t bank_list[] = { 0x10000, 0x18000, 0x02000, 0x02000 }; + uint8_t *address; m_battery_ram_enable = ((m_alternate_bank & 3) == 1); @@ -547,8 +547,8 @@ void leland_state::redline_bankswitch() /* bankswitching for Viper, Quarterback, Team Quarterback, and All American Football */ void leland_state::viper_bankswitch() { - static const UINT32 bank_list[] = { 0x02000, 0x10000, 0x18000, 0x02000 }; - UINT8 *address; + static const uint32_t bank_list[] = { 0x02000, 0x10000, 0x18000, 0x02000 }; + uint8_t *address; m_battery_ram_enable = ((m_alternate_bank & 0x04) != 0); @@ -568,8 +568,8 @@ void leland_state::viper_bankswitch() /* bankswitching for Super Offroad, Super Offroad Track Pack, and Pig Out */ void leland_state::offroad_bankswitch() { - static const UINT32 bank_list[] = { 0x02000, 0x02000, 0x10000, 0x18000, 0x20000, 0x28000, 0x30000, 0x38000 }; - UINT8 *address; + static const uint32_t bank_list[] = { 0x02000, 0x02000, 0x10000, 0x18000, 0x20000, 0x28000, 0x30000, 0x38000 }; + uint8_t *address; m_battery_ram_enable = ((m_alternate_bank & 7) == 1); @@ -589,12 +589,12 @@ void leland_state::offroad_bankswitch() /* bankswitching for Ataxx, WSF, Indy Heat, and Brute Force */ void leland_state::ataxx_bankswitch() { - static const UINT32 bank_list[] = + static const uint32_t bank_list[] = { 0x02000, 0x18000, 0x20000, 0x28000, 0x30000, 0x38000, 0x40000, 0x48000, 0x50000, 0x58000, 0x60000, 0x68000, 0x70000, 0x78000, 0x80000, 0x88000 }; - UINT8 *address; + uint8_t *address; m_battery_ram_enable = ((m_master_bank & 0x30) == 0x10); @@ -625,11 +625,11 @@ void leland_state::ataxx_bankswitch() * *************************************/ -void leland_state::leland_init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type) +void leland_state::leland_init_eeprom(uint8_t default_val, const uint16_t *data, uint8_t serial_offset, uint8_t serial_type) { - UINT8 xorval = (serial_type == SERIAL_TYPE_ADD_XOR || serial_type == SERIAL_TYPE_ENCRYPT_XOR) ? 0xff : 0x00; - UINT8 eeprom_data[64*2]; - UINT32 serial; + uint8_t xorval = (serial_type == SERIAL_TYPE_ADD_XOR || serial_type == SERIAL_TYPE_ENCRYPT_XOR) ? 0xff : 0x00; + uint8_t eeprom_data[64*2]; + uint32_t serial; /* NOTE: This code is just illustrative, and explains how to generate the @@ -736,12 +736,12 @@ void leland_state::leland_init_eeprom(UINT8 default_val, const UINT16 *data, UIN * *************************************/ -void leland_state::ataxx_init_eeprom(const UINT16 *data) +void leland_state::ataxx_init_eeprom(const uint16_t *data) { - UINT8 eeprom_data[128*2]; - UINT8 serial_offset = 0; - UINT8 default_val = 0; - UINT32 serial; + uint8_t eeprom_data[128*2]; + uint8_t serial_offset = 0; + uint8_t default_val = 0; + uint32_t serial; /* NOTE: This code is just illustrative, and explains how to generate the @@ -899,7 +899,7 @@ WRITE8_MEMBER(leland_state::ataxx_battery_ram_w) for (i = 16, b = 0x70, r = 0x08; i < 128; i++, b--, r += 0x10) { - UINT8 a = original_data[i] ^ 0xff; + uint8_t a = original_data[i] ^ 0xff; a = (a >> 3) | (a << 5); a = (((a ^ r) + 1 + b) ^ b) - b; encrypted_data[i] = a; @@ -1407,8 +1407,8 @@ void leland_state::leland_rotate_memory(const char *cpuname) { int startaddr = 0x10000; int banks = (memregion(cpuname)->bytes() - startaddr) / 0x8000; - UINT8 *ram = memregion(cpuname)->base(); - UINT8 temp[0x2000]; + uint8_t *ram = memregion(cpuname)->base(); + uint8_t temp[0x2000]; int i; for (i = 0; i < banks; i++) diff --git a/src/mame/machine/lisa.cpp b/src/mame/machine/lisa.cpp index 94b05e25270..7d2ef1c92c8 100644 --- a/src/mame/machine/lisa.cpp +++ b/src/mame/machine/lisa.cpp @@ -200,7 +200,7 @@ void lisa_state::COPS_send_data_if_possible() { // printf("COPsim: sending %02x to VIA\n", m_fifo_data[m_fifo_head]); - UINT8 data = m_fifo_data[m_fifo_head];/* output data */ + uint8_t data = m_fifo_data[m_fifo_head];/* output data */ m_via0->write_pa0((data>>0)&1); m_via0->write_pa1((data>>1)&1); m_via0->write_pa2((data>>2)&1); @@ -220,7 +220,7 @@ void lisa_state::COPS_send_data_if_possible() } /* send data (queue it into the FIFO if needed) */ -void lisa_state::COPS_queue_data(const UINT8 *data, int len) +void lisa_state::COPS_queue_data(const uint8_t *data, int len) { #if 0 if (m_fifo_size + len <= 8) @@ -263,8 +263,8 @@ void lisa_state::COPS_queue_data(const UINT8 *data, int len) void lisa_state::scan_keyboard() { int i, j; - UINT8 keycode; - UINT32 keybuf[8] = { m_io_line0->read(), m_io_line1->read(), m_io_line2->read(), m_io_line3->read(), + uint8_t keycode; + uint32_t keybuf[8] = { m_io_line0->read(), m_io_line1->read(), m_io_line2->read(), m_io_line3->read(), m_io_line4->read(), m_io_line5->read(), m_io_line6->read(), m_io_line7->read() }; if (! m_COPS_force_unplug) @@ -540,7 +540,7 @@ TIMER_CALLBACK_MEMBER(lisa_state::read_COPS_command) { /* format and send reply */ - UINT8 reply[7]; + uint8_t reply[7]; reply[0] = 0x80; reply[1] = 0xE0 | m_clock_regs.years; @@ -584,7 +584,7 @@ void lisa_state::reset_COPS() void lisa_state::unplug_keyboard() { - static const UINT8 cmd[2] = + static const uint8_t cmd[2] = { 0x80, /* RESET code */ 0xFD /* keyboard unplugged */ @@ -611,7 +611,7 @@ void lisa_state::plug_keyboard() unknown : spanish, US dvorak, italian & swedish */ - static const UINT8 cmd[2] = + static const uint8_t cmd[2] = { 0x80, /* RESET code */ 0x3f /* keyboard ID - US for now */ @@ -742,15 +742,15 @@ void lisa_state::video_start() /* Video update */ -UINT32 lisa_state::screen_update_lisa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t lisa_state::screen_update_lisa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 *v; + uint16_t *v; int x, y; /* resolution is 720*364 on lisa, vs 608*431 on mac XL */ int resx = (m_features.has_mac_xl_video) ? 608 : 720; /* width */ int resy = (m_features.has_mac_xl_video) ? 431 : 364; /* height */ - UINT8 line_buffer[720]; + uint8_t line_buffer[720]; v = m_videoram_ptr; @@ -871,7 +871,7 @@ void lisa_state::nvram_init(nvram_device &nvram, void *data, size_t size) m_clock_regs.clock_write_ptr = -1; } #if 0 - UINT32 temp32; + uint32_t temp32; SINT8 temp8; temp32 = (m_clock_regs.alarm << 12) | (m_clock_regs.years << 8) | (m_clock_regs.days1 << 4) | m_clock_regs.days2; @@ -909,7 +909,7 @@ DRIVER_INIT_MEMBER(lisa_state,lisa2) m_features.has_double_sided_floppy = 0; m_features.has_mac_xl_video = 0; - m_bad_parity_table = std::make_unique(0x40000); /* 1 bit per byte of CPU RAM */ + m_bad_parity_table = std::make_unique(0x40000); /* 1 bit per byte of CPU RAM */ } DRIVER_INIT_MEMBER(lisa_state,lisa210) @@ -922,7 +922,7 @@ DRIVER_INIT_MEMBER(lisa_state,lisa210) m_features.has_double_sided_floppy = 0; m_features.has_mac_xl_video = 0; - m_bad_parity_table = std::make_unique(0x40000); /* 1 bit per byte of CPU RAM */ + m_bad_parity_table = std::make_unique(0x40000); /* 1 bit per byte of CPU RAM */ } DRIVER_INIT_MEMBER(lisa_state,mac_xl) @@ -935,7 +935,7 @@ DRIVER_INIT_MEMBER(lisa_state,mac_xl) m_features.has_double_sided_floppy = 0; m_features.has_mac_xl_video = 1; - m_bad_parity_table = std::make_unique(0x40000); /* 1 bit per byte of CPU RAM */ + m_bad_parity_table = std::make_unique(0x40000); /* 1 bit per byte of CPU RAM */ } void lisa_state::machine_start() @@ -975,7 +975,7 @@ void lisa_state::machine_reset() set_VTIR(0); m_video_address_latch = 0; - m_videoram_ptr = (UINT16 *) m_ram_ptr; + m_videoram_ptr = (uint16_t *) m_ram_ptr; m_FDIR = 0; m_via0->write_pb4(m_FDIR); @@ -1025,7 +1025,7 @@ INTERRUPT_GEN_MEMBER(lisa_state::lisa_interrupt) if (m_clock_regs.alarm == 0) { /* generate reset (should cause a VIA interrupt...) */ - static const UINT8 cmd[2] = + static const uint8_t cmd[2] = { 0x80, /* RESET code */ 0xFC /* timer time-out */ @@ -1257,7 +1257,7 @@ READ16_MEMBER(lisa_state::lisa_r) } else { /* system ROMs */ - answer = ((UINT16*)m_rom_ptr)[(offset & 0x001fff)]; + answer = ((uint16_t*)m_rom_ptr)[(offset & 0x001fff)]; /*logerror("dst address in ROM (setup mode)\n");*/ } @@ -1288,7 +1288,7 @@ READ16_MEMBER(lisa_state::lisa_r) /* out of segment limits : bus error */ } - answer = *(UINT16 *)(m_ram_ptr + address); + answer = *(uint16_t *)(m_ram_ptr + address); if (m_bad_parity_count && m_test_parity && (m_bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))) @@ -1306,7 +1306,7 @@ READ16_MEMBER(lisa_state::lisa_r) /* out of segment limits : bus error */ } - answer = *(UINT16 *)(m_ram_ptr + address); + answer = *(uint16_t *)(m_ram_ptr + address); if (m_bad_parity_count && m_test_parity && (m_bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))) @@ -1331,7 +1331,7 @@ READ16_MEMBER(lisa_state::lisa_r) case special_IO: if (! (address & 0x008000)) - answer = *(UINT16 *)(m_rom_ptr + (address & 0x003fff)); + answer = *(uint16_t *)(m_rom_ptr + (address & 0x003fff)); else { /* read serial number from ROM */ /* this has to be be the least efficient way to read a ROM :-) */ @@ -1490,7 +1490,7 @@ WRITE16_MEMBER(lisa_state::lisa_w) /* out of segment limits : bus error */ } - COMBINE_DATA((UINT16 *) (m_ram_ptr + address)); + COMBINE_DATA((uint16_t *) (m_ram_ptr + address)); if (m_diag2) { if ((ACCESSING_BITS_0_7) @@ -1529,7 +1529,7 @@ WRITE16_MEMBER(lisa_state::lisa_w) /* out of segment limits : bus error */ } - COMBINE_DATA((UINT16 *) (m_ram_ptr + address)); + COMBINE_DATA((uint16_t *) (m_ram_ptr + address)); if (m_diag2) { if ((ACCESSING_BITS_0_7) @@ -1857,7 +1857,7 @@ WRITE16_MEMBER(lisa_state::lisa_IO_w) case 0x1: /* Video Address Latch */ /*logerror("video address latch write offs=%X, data=%X\n", offset, data);*/ COMBINE_DATA(& m_video_address_latch); - m_videoram_ptr = ((UINT16 *)m_ram_ptr) + ((m_video_address_latch << 6) & 0xfc000); + m_videoram_ptr = ((uint16_t *)m_ram_ptr) + ((m_video_address_latch << 6) & 0xfc000); /*logerror("video address latch %X -> base address %X\n", m_video_address_latch, (m_video_address_latch << 7) & 0x1f8000);*/ break; diff --git a/src/mame/machine/llc.cpp b/src/mame/machine/llc.cpp index 94deded1675..a3778208b25 100644 --- a/src/mame/machine/llc.cpp +++ b/src/mame/machine/llc.cpp @@ -15,7 +15,7 @@ // LLC1 BASIC keyboard READ8_MEMBER(llc_state::llc1_port2_b_r) { - UINT8 retVal = 0; + uint8_t retVal = 0; if (m_term_status) { @@ -36,7 +36,7 @@ READ8_MEMBER(llc_state::llc1_port2_a_r) // LLC1 Monitor keyboard READ8_MEMBER(llc_state::llc1_port1_a_r) { - UINT8 data = 0; + uint8_t data = 0; if (!BIT(m_porta, 4)) data = ioport("X4")->read(); if (!BIT(m_porta, 5)) @@ -70,7 +70,7 @@ WRITE8_MEMBER(llc_state::llc1_port1_a_w) WRITE8_MEMBER(llc_state::llc1_port1_b_w) { - static UINT8 count = 0, digit = 0; + static uint8_t count = 0, digit = 0; if (data == 0) { @@ -131,7 +131,7 @@ MACHINE_RESET_MEMBER(llc_state,llc2) WRITE8_MEMBER(llc_state::llc2_rom_disable_w) { address_space &mem_space = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); mem_space.install_write_bank(0x0000, 0xbfff, "bank1"); membank("bank1")->set_base(ram); diff --git a/src/mame/machine/lviv.cpp b/src/mame/machine/lviv.cpp index 51674216119..f7dee34255b 100644 --- a/src/mame/machine/lviv.cpp +++ b/src/mame/machine/lviv.cpp @@ -28,7 +28,7 @@ void lviv_state::lviv_update_memory () { - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); if (m_ppi_port_outputs[0][2] & 0x02) { @@ -59,7 +59,7 @@ READ8_MEMBER(lviv_state::lviv_ppi_0_portb_r) READ8_MEMBER(lviv_state::lviv_ppi_0_portc_r) { - UINT8 data = m_ppi_port_outputs[0][2] & 0x0f; + uint8_t data = m_ppi_port_outputs[0][2] & 0x0f; if (m_cassette->input() > 0.038) data |= 0x10; if (m_ppi_port_outputs[0][0] & ioport("JOY")->read()) @@ -159,7 +159,7 @@ WRITE8_MEMBER(lviv_state::lviv_io_w) address_space &cpuspace = m_maincpu->space(AS_PROGRAM); if (m_startup_mem_map) { - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); m_startup_mem_map = 0; @@ -197,7 +197,7 @@ WRITE8_MEMBER(lviv_state::lviv_io_w) void lviv_state::machine_reset() { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *mem; + uint8_t *mem; m_video_ram = m_ram->pointer() + 0xc000; @@ -235,7 +235,7 @@ Lviv snapshot files (SAV) 1411D - 1412A: ??? (something additional) *******************************************************************************/ -void lviv_state::lviv_setup_snapshot (UINT8 * data) +void lviv_state::lviv_setup_snapshot (uint8_t * data) { unsigned char lo,hi; @@ -281,7 +281,7 @@ void lviv_state::dump_registers() logerror("HL = %04x\n", (unsigned) m_maincpu->state_int(I8085_HL)); } -image_verify_result lviv_state::lviv_verify_snapshot(UINT8 * data, UINT32 size) +image_verify_result lviv_state::lviv_verify_snapshot(uint8_t * data, uint32_t size) { const char* tag = "LVOV/DUMP/2.0/"; @@ -303,7 +303,7 @@ image_verify_result lviv_state::lviv_verify_snapshot(UINT8 * data, UINT32 size) SNAPSHOT_LOAD_MEMBER( lviv_state, lviv ) { - std::vector lviv_snapshot_data(LVIV_SNAPSHOT_SIZE); + std::vector lviv_snapshot_data(LVIV_SNAPSHOT_SIZE); image.fread( &lviv_snapshot_data[0], LVIV_SNAPSHOT_SIZE); diff --git a/src/mame/machine/lynx.cpp b/src/mame/machine/lynx.cpp index c4280708303..fcb0bc461a7 100644 --- a/src/mame/machine/lynx.cpp +++ b/src/mame/machine/lynx.cpp @@ -33,9 +33,9 @@ enum { SHADOW }; -UINT8 lynx_state::lynx_read_ram(UINT16 address) +uint8_t lynx_state::lynx_read_ram(uint16_t address) { - UINT8 result = 0x00; + uint8_t result = 0x00; if (address <= 0xfbff) result = m_mem_0000[address - 0x0000]; else if (address <= 0xfcff) @@ -49,7 +49,7 @@ UINT8 lynx_state::lynx_read_ram(UINT16 address) return result; } -void lynx_state::lynx_write_ram(UINT16 address, UINT8 data) +void lynx_state::lynx_write_ram(uint16_t address, uint8_t data) { if (address <= 0xfbff) m_mem_0000[address - 0x0000] = data; @@ -91,11 +91,11 @@ The sprite types relate to specific hardware functions according to the followin 0 0 0 0 0 0 0 1 exclusive-or the data */ -inline void lynx_state::lynx_plot_pixel(const int mode, const INT16 x, const int y, const int color) +inline void lynx_state::lynx_plot_pixel(const int mode, const int16_t x, const int y, const int color) { - UINT8 back; - UINT16 screen; - UINT16 colbuf; + uint8_t back; + uint16_t screen; + uint16_t colbuf; m_blitter.everon = TRUE; screen = m_blitter.screen + y * 80 + x / 2; @@ -371,7 +371,7 @@ void lynx_state::lynx_blit_do_work( const int y, const int xdir, const int bits_ { int next_line_addr,i,j; int xi, bits, color; - UINT16 width_accum, buffer; + uint16_t width_accum, buffer; next_line_addr = lynx_read_ram(m_blitter.bitmap); // offset to second sprite line width_accum = (xdir == 1) ? m_blitter.width_offset : 0; @@ -399,13 +399,13 @@ void lynx_state::lynx_blit_do_work( const int y, const int xdir, const int bits_ } } -void lynx_state::lynx_blit_rle_do_work( const INT16 y, const int xdir, const int bits_per_pixel, const int mask ) +void lynx_state::lynx_blit_rle_do_work( const int16_t y, const int xdir, const int bits_per_pixel, const int mask ) { int i; int xi; int buffer, bits, j; int literal_data, count, color; - UINT16 width_accum; + uint16_t width_accum; width_accum = (xdir == 1) ? m_blitter.width_offset : 0; for( bits = 0, j = 0, buffer = 0, xi = m_blitter.x_pos - m_blitter.xoff; ; ) /* through the rle entries */ @@ -486,7 +486,7 @@ void lynx_state::lynx_blit_rle_do_work( const INT16 y, const int xdir, const int void lynx_state::lynx_blit_lines() { static const int lynx_color_masks[4] = { 0x01, 0x03, 0x07, 0x0f }; - INT16 y; + int16_t y; int i; int ydir = 0, xdir = 0; int flip = 0; @@ -567,10 +567,10 @@ void lynx_state::lynx_blit_lines() else lynx_blit_do_work(y, xdir, m_blitter.line_color + 1, lynx_color_masks[m_blitter.line_color]); } - m_blitter.width += (INT16)m_blitter.stretch; + m_blitter.width += (int16_t)m_blitter.stretch; if (m_blitter.vstretch) // doesn't seem to be used { - m_blitter.height += (INT16)m_blitter.stretch; + m_blitter.height += (int16_t)m_blitter.stretch; logerror("vertical stretch enabled"); } m_blitter.tilt_accumulator += m_blitter.tilt; @@ -684,8 +684,8 @@ TIMER_CALLBACK_MEMBER(lynx_state::lynx_blitter_timer) void lynx_state::lynx_blitter() { static const int lynx_colors[4] = { 2, 4, 8, 16 }; - UINT8 palette_offset; - UINT8 coldep; + uint8_t palette_offset; + uint8_t coldep; int colors; m_blitter.busy = 1; // blitter working @@ -808,9 +808,9 @@ notes on these errors available) */ void lynx_state::lynx_divide() { - UINT32 left; - UINT16 right; - UINT32 res, mod; + uint32_t left; + uint16_t right; + uint32_t res, mod; /* Hardware divide: EFGH @@ -849,8 +849,8 @@ void lynx_state::lynx_divide() void lynx_state::lynx_multiply() { - UINT16 left, right; - UINT32 res, accu; + uint16_t left, right; + uint32_t res, accu; /* Hardware multiply: AB @@ -894,7 +894,7 @@ void lynx_state::lynx_multiply() READ8_MEMBER(lynx_state::suzy_read) { - UINT8 value = 0, input; + uint8_t value = 0, input; switch (offset) { @@ -1187,7 +1187,7 @@ WRITE8_MEMBER(lynx_state::suzy_write) to an unsigned one */ if (m_suzy.signed_math) { - UINT16 factor, temp; + uint16_t factor, temp; factor = m_suzy.data[MATH_D] | (m_suzy.data[MATH_C] << 8); if ((factor - 1) & 0x8000) /* here we use -1 to cover the math bugs on the sign of 0 and 0x8000 */ { @@ -1214,7 +1214,7 @@ WRITE8_MEMBER(lynx_state::suzy_write) case MATH_A: if (m_suzy.signed_math) { - UINT16 factor, temp; + uint16_t factor, temp; factor = m_suzy.data[MATH_B] | (m_suzy.data[MATH_A] << 8); if ((factor - 1) & 0x8000) /* here we use -1 to cover the math bugs on the sign of 0 and 0x8000 */ { @@ -1300,9 +1300,9 @@ DISPCTL EQU $FD92 ; set to $D by INITMIKEY void lynx_state::lynx_draw_line() { int x, y; - UINT16 j; // clipping needed! - UINT8 byte; - UINT16 *line; + uint16_t j; // clipping needed! + uint8_t byte; + uint16_t *line; // calculate y: first three lines are vblank, @@ -1476,7 +1476,7 @@ void lynx_state::lynx_timer_count_down(int which) } } -UINT32 lynx_state::lynx_time_factor(int val) +uint32_t lynx_state::lynx_time_factor(int val) { switch(val) { @@ -1506,9 +1506,9 @@ TIMER_CALLBACK_MEMBER(lynx_state::lynx_timer_shot) } } -UINT8 lynx_state::lynx_timer_read(int which, int offset) +uint8_t lynx_state::lynx_timer_read(int which, int offset) { - UINT8 value = 0; + uint8_t value = 0; switch (offset) { @@ -1527,7 +1527,7 @@ UINT8 lynx_state::lynx_timer_read(int which, int offset) { if ( m_timer[which].timer_active ) { - value = (UINT8) (m_timer[which].timer->remaining().as_ticks(1000000>>(m_timer[which].cntrl1 & 0x07))); + value = (uint8_t) (m_timer[which].timer->remaining().as_ticks(1000000>>(m_timer[which].cntrl1 & 0x07))); value -= value ? 1 : 0; } } @@ -1541,14 +1541,14 @@ UINT8 lynx_state::lynx_timer_read(int which, int offset) return value; } -void lynx_state::lynx_timer_write(int which, int offset, UINT8 data) +void lynx_state::lynx_timer_write(int which, int offset, uint8_t data) { //logerror("timer %d write %x %.2x\n", which, offset, data); attotime t; if ( m_timer[which].timer_active && ((m_timer[which].cntrl1 & 0x07) != 0x07)) { - m_timer[which].counter = (UINT8) (m_timer[which].timer->remaining().as_ticks(1000000>>(m_timer[which].cntrl1 & 0x07))); + m_timer[which].counter = (uint8_t) (m_timer[which].timer->remaining().as_ticks(1000000>>(m_timer[which].cntrl1 & 0x07))); m_timer[which].counter -= (m_timer[which].counter) ? 1 : 0; } @@ -1637,7 +1637,7 @@ TIMER_CALLBACK_MEMBER(lynx_state::lynx_uart_timer) READ8_MEMBER(lynx_state::lynx_uart_r) { - UINT8 value = 0x00; + uint8_t value = 0x00; switch (offset) { case 0x8c: @@ -1693,7 +1693,7 @@ WRITE8_MEMBER(lynx_state::lynx_uart_w) READ8_MEMBER(lynx_state::mikey_read) { - UINT8 direction, value = 0x00; + uint8_t direction, value = 0x00; switch (offset) { @@ -2063,8 +2063,8 @@ DEVICE_IMAGE_LOAD_MEMBER( lynx_state, lynx_cart ) /* Lynx carts have 19 address lines, the upper 8 used for bank select. The lower 11 bits are used to address data within the selected bank. Valid bank sizes are 256, 512, 1024 or 2048 bytes. Commercial roms use all 256 banks.*/ - UINT32 size = m_cart->common_get_size("rom"); - UINT16 gran = 0; + uint32_t size = m_cart->common_get_size("rom"); + uint16_t gran = 0; if (image.software_entry() == nullptr) { @@ -2077,7 +2077,7 @@ DEVICE_IMAGE_LOAD_MEMBER( lynx_state, lynx_cart ) // 0 0 1 0 // 32 chars name // 22 chars manufacturer - UINT8 header[0x40]; + uint8_t header[0x40]; image.fread(header, 0x40); // Check the image diff --git a/src/mame/machine/m1comm.cpp b/src/mame/machine/m1comm.cpp index 4cd4e25c748..73ff3147ba8 100644 --- a/src/mame/machine/m1comm.cpp +++ b/src/mame/machine/m1comm.cpp @@ -124,7 +124,7 @@ const tiny_rom_entry *m1comm_device::device_rom_region() const // m1comm_device - constructor //------------------------------------------------- -m1comm_device::m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m1comm_device::m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M1COMM, "MODEL-1 COMMUNICATION BD", tag, owner, clock, "m1comm", __FILE__), m_commcpu(*this, Z80_TAG), m_line_rx(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE ), @@ -177,7 +177,7 @@ READ8_MEMBER(m1comm_device::dlc_reg_r) } // dirty hack to keep Z80 in RESET state - UINT8 result = m_dlc_reg[offset]; + uint8_t result = m_dlc_reg[offset]; #ifdef __M1COMM_VERBOSE__ osd_printf_verbose("m1comm-dlc_reg_r: read register %02x for value %02x\n", offset, result); #endif @@ -194,7 +194,7 @@ WRITE8_MEMBER(m1comm_device::dlc_reg_w) READ8_MEMBER(m1comm_device::dma_reg_r) { - UINT8 result = m_dma_reg[offset]; + uint8_t result = m_dma_reg[offset]; #ifdef __M1COMM_VERBOSE__ osd_printf_verbose("m1comm-dma_reg_r: read register %02x for value %02x\n", offset, result); #endif @@ -211,7 +211,7 @@ WRITE8_MEMBER(m1comm_device::dma_reg_w) READ8_MEMBER(m1comm_device::syn_r) { - UINT8 result = m_syn | 0xFC; + uint8_t result = m_syn | 0xFC; #ifdef __M1COMM_VERBOSE__ osd_printf_verbose("m1comm-syn_r: read register %02x for value %02x\n", offset, result); #endif @@ -242,7 +242,7 @@ WRITE8_MEMBER(m1comm_device::syn_w) READ8_MEMBER(m1comm_device::zfg_r) { - UINT8 result = m_zfg | (~m_fg << 7) | 0x7e; + uint8_t result = m_zfg | (~m_fg << 7) | 0x7e; #ifdef __M1COMM_VERBOSE__ osd_printf_verbose("m1comm-zfg_r: read register %02x for value %02x\n", offset, result); #endif diff --git a/src/mame/machine/m1comm.h b/src/mame/machine/m1comm.h index 915e7ee671d..c9adb75dc80 100644 --- a/src/mame/machine/m1comm.h +++ b/src/mame/machine/m1comm.h @@ -20,7 +20,7 @@ class m1comm_device : public device_t { public: // construction/destruction - m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -66,26 +66,26 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; private: - UINT8 m_shared[0x1000]; // 2x 2k = 4k; model1 accesses this with 16bit data and 11bit address (A0 to A10) - UINT8 m_dlc_reg[0x20]; // MB89374 registers - UINT8 m_dma_reg[0x20]; // MB89237A registers - UINT8 m_syn; // bit0 is stored; purpose unknown, bit1 is used to enable/disable VINT/IRQ5 - UINT8 m_zfg; // z80 flip gate? purpose unknown, bit0 is stored - UINT8 m_cn; // bit0 is used to enable/disable the comm board - UINT8 m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 + uint8_t m_shared[0x1000]; // 2x 2k = 4k; model1 accesses this with 16bit data and 11bit address (A0 to A10) + uint8_t m_dlc_reg[0x20]; // MB89374 registers + uint8_t m_dma_reg[0x20]; // MB89237A registers + uint8_t m_syn; // bit0 is stored; purpose unknown, bit1 is used to enable/disable VINT/IRQ5 + uint8_t m_zfg; // z80 flip gate? purpose unknown, bit0 is stored + uint8_t m_cn; // bit0 is used to enable/disable the comm board + uint8_t m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink emu_file m_line_tx; // tx line - is differential, simple serial and toslink char m_localhost[256]; char m_remotehost[256]; - UINT8 m_buffer[0x1000]; + uint8_t m_buffer[0x1000]; #ifdef __M1COMM_SIMULATION__ - UINT8 m_linkenable; - UINT16 m_linktimer; - UINT8 m_linkalive; - UINT8 m_linkid; - UINT8 m_linkcount; + uint8_t m_linkenable; + uint16_t m_linktimer; + uint8_t m_linkalive; + uint8_t m_linkid; + uint8_t m_linkcount; void comm_tick(); #endif diff --git a/src/mame/machine/m20_8086.cpp b/src/mame/machine/m20_8086.cpp index 4acbce756c2..d12009726f2 100644 --- a/src/mame/machine/m20_8086.cpp +++ b/src/mame/machine/m20_8086.cpp @@ -5,7 +5,7 @@ const device_type M20_8086 = &device_creator; -m20_8086_device::m20_8086_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m20_8086_device::m20_8086_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M20_8086, "Olivetti M20 8086 Adapter", tag, owner, clock, "m20_8086", __FILE__), m_8086(*this, "8086"), m_maincpu(*this, ":maincpu"), @@ -16,7 +16,7 @@ m20_8086_device::m20_8086_device(const machine_config &mconfig, const char *tag, void m20_8086_device::device_start() { - UINT8* ram = machine().device("ram")->pointer(); + uint8_t* ram = machine().device("ram")->pointer(); m_8086->space(AS_PROGRAM).install_readwrite_bank(0x00000, machine().device("ram")->size() - 0x4001, "mainram"); membank("highram")->set_base(ram); membank("mainram")->set_base(&ram[0x4000]); diff --git a/src/mame/machine/m20_8086.h b/src/mame/machine/m20_8086.h index 125d5fe7ed9..67a715b7059 100644 --- a/src/mame/machine/m20_8086.h +++ b/src/mame/machine/m20_8086.h @@ -10,7 +10,7 @@ class m20_8086_device : public device_t { public: - m20_8086_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m20_8086_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/mame/machine/m20_kbd.cpp b/src/mame/machine/m20_kbd.cpp index d5e367152e4..00cfdd08a56 100644 --- a/src/mame/machine/m20_kbd.cpp +++ b/src/mame/machine/m20_kbd.cpp @@ -153,7 +153,7 @@ INPUT_PORTS_END } // anonymous namespace -m20_keyboard_device::m20_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) +m20_keyboard_device::m20_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : buffered_rs232_device(mconfig, M20_KEYBOARD, "M20 Keyboard", tag, owner, 0, "m20_keyboard", __FILE__) , device_matrix_keyboard_interface(mconfig, *this, "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8") , m_modifiers(*this, "MODIFIERS") @@ -195,11 +195,11 @@ void m20_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int } -void m20_keyboard_device::key_make(UINT8 row, UINT8 column) +void m20_keyboard_device::key_make(uint8_t row, uint8_t column) { - UINT8 const row_code(((row < 6U) ? row : (0x18U | (row - 6U))) << 3); - UINT8 const modifiers(m_modifiers->read()); - UINT8 mod_code(0U); + uint8_t const row_code(((row < 6U) ? row : (0x18U | (row - 6U))) << 3); + uint8_t const modifiers(m_modifiers->read()); + uint8_t mod_code(0U); switch (modifiers) { case 0x01U: // COMMAND @@ -218,7 +218,7 @@ void m20_keyboard_device::key_make(UINT8 row, UINT8 column) } -void m20_keyboard_device::received_byte(UINT8 byte) +void m20_keyboard_device::received_byte(uint8_t byte) { switch (byte) { diff --git a/src/mame/machine/m20_kbd.h b/src/mame/machine/m20_kbd.h index dfbd6d71a62..2c6ac21f144 100644 --- a/src/mame/machine/m20_kbd.h +++ b/src/mame/machine/m20_kbd.h @@ -9,16 +9,16 @@ class m20_keyboard_device : public buffered_rs232_device<16U>, protected device_matrix_keyboard_interface<9U> { public: - m20_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m20_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void key_make(UINT8 row, UINT8 column) override; + virtual void key_make(uint8_t row, uint8_t column) override; private: - virtual void received_byte(UINT8 byte) override; + virtual void received_byte(uint8_t byte) override; required_ioport m_modifiers; }; diff --git a/src/mame/machine/m24_kbd.cpp b/src/mame/machine/m24_kbd.cpp index 758a29c2edf..2a3c7e7142f 100644 --- a/src/mame/machine/m24_kbd.cpp +++ b/src/mame/machine/m24_kbd.cpp @@ -210,7 +210,7 @@ ioport_constructor m24_keyboard_device::device_input_ports() const return INPUT_PORTS_NAME( m24_keyboard ); } -m24_keyboard_device::m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m24_keyboard_device::m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M24_KEYBOARD, "Olivetti M24 Keyboard", tag, owner, clock, "m24_kbd", __FILE__) , m_rows(*this, "ROW.%u", 0) , m_mousebtn(*this, "MOUSEBTN") @@ -270,7 +270,7 @@ READ8_MEMBER( m24_keyboard_device::t1_r ) WRITE8_MEMBER( m24_keyboard_device::bus_w ) { - UINT8 col = m_rows[(data >> 3) & 0xf]->read(); + uint8_t col = m_rows[(data >> 3) & 0xf]->read(); m_keypress = (col & (1 << (data & 7))) ? 1 : 0; } diff --git a/src/mame/machine/m24_kbd.h b/src/mame/machine/m24_kbd.h index d9e18434af3..70a3a8946b8 100644 --- a/src/mame/machine/m24_kbd.h +++ b/src/mame/machine/m24_kbd.h @@ -12,7 +12,7 @@ class m24_keyboard_device : public device_t { public: - m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_data_handler(device_t &device, _Object object) { return downcast(device).m_out_data.set_callback(object); } @@ -35,7 +35,7 @@ public: private: required_ioport_array<16> m_rows; required_ioport m_mousebtn; - UINT8 m_p1; + uint8_t m_p1; bool m_keypress, m_kbcdata; devcb_write_line m_out_data; required_device m_mcu; diff --git a/src/mame/machine/m24_z8000.cpp b/src/mame/machine/m24_z8000.cpp index 29d4001fb8b..a9b0be408ed 100644 --- a/src/mame/machine/m24_z8000.cpp +++ b/src/mame/machine/m24_z8000.cpp @@ -4,7 +4,7 @@ const device_type M24_Z8000 = &device_creator; -m24_z8000_device::m24_z8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m24_z8000_device::m24_z8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M24_Z8000, "Olivetti M24 Z8000 Adapter", tag, owner, clock, "m24_z8000", __FILE__), m_z8000(*this, "z8000"), m_maincpu(*this, ":maincpu"), @@ -86,7 +86,7 @@ machine_config_constructor m24_z8000_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( m24_z8000 ); } -const UINT8 m24_z8000_device::pmem_table[16][4] = +const uint8_t m24_z8000_device::pmem_table[16][4] = {{0, 1, 2, 3}, {1, 2, 3, 255}, {4, 5, 6, 7}, {46, 40, 41, 42}, {255, 255, 255, 255}, {255, 255, 255, 47}, {1, 2, 3, 255}, {255, 255, 255, 255}, {1, 2, 8, 9}, {5, 6, 10, 11}, {1, 2, 8, 9}, {12, 13, 14, 15}, @@ -94,8 +94,8 @@ const UINT8 m24_z8000_device::pmem_table[16][4] = READ16_MEMBER(m24_z8000_device::pmem_r) { - UINT16 ret; - UINT8 hostseg; + uint16_t ret; + uint8_t hostseg; offset <<= 1; if(!m_z8000_mem) return memregion(subtag("z8000").c_str())->u16(offset >> 1); @@ -112,7 +112,7 @@ READ16_MEMBER(m24_z8000_device::pmem_r) WRITE16_MEMBER(m24_z8000_device::pmem_w) { - UINT8 hostseg; + uint8_t hostseg; data = (data << 8) | (data >> 8); offset <<= 1; hostseg = pmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3]; @@ -124,7 +124,7 @@ WRITE16_MEMBER(m24_z8000_device::pmem_w) m_maincpu->space(AS_PROGRAM).write_word(offset, data, (mem_mask << 8) | (mem_mask >> 8)); } -const UINT8 m24_z8000_device::dmem_table[16][4] = +const uint8_t m24_z8000_device::dmem_table[16][4] = {{0, 1, 2, 3}, {4, 5, 6, 7}, {4, 5, 6, 7}, {46, 40, 41, 42}, {255, 255, 255, 255}, {1, 2, 3, 47}, {1, 2, 3, 255}, {255, 255, 255, 255}, {5, 6, 10, 11}, {5, 6, 10, 11}, {1, 2, 8, 9}, {12, 13, 14, 15}, @@ -132,8 +132,8 @@ const UINT8 m24_z8000_device::dmem_table[16][4] = READ16_MEMBER(m24_z8000_device::dmem_r) { - UINT16 ret; - UINT8 hostseg; + uint16_t ret; + uint8_t hostseg; offset <<= 1; hostseg = dmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3]; if(hostseg == 255) @@ -147,7 +147,7 @@ READ16_MEMBER(m24_z8000_device::dmem_r) WRITE16_MEMBER(m24_z8000_device::dmem_w) { - UINT8 hostseg; + uint8_t hostseg; data = (data << 8) | (data >> 8); offset <<= 1; hostseg = dmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3]; @@ -161,7 +161,7 @@ WRITE16_MEMBER(m24_z8000_device::dmem_w) READ16_MEMBER(m24_z8000_device::i86_io_r) { - UINT16 ret = m_maincpu->space(AS_IO).read_word(offset << 1, (mem_mask << 8) | (mem_mask >> 8)); + uint16_t ret = m_maincpu->space(AS_IO).read_word(offset << 1, (mem_mask << 8) | (mem_mask >> 8)); return (ret << 8) | (ret >> 8); } diff --git a/src/mame/machine/m24_z8000.h b/src/mame/machine/m24_z8000.h index 4b265f84f14..aca70039736 100644 --- a/src/mame/machine/m24_z8000.h +++ b/src/mame/machine/m24_z8000.h @@ -15,7 +15,7 @@ class m24_z8000_device : public device_t { public: - m24_z8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m24_z8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -45,9 +45,9 @@ private: required_device m_maincpu; required_device m_pic; devcb_write_line m_halt_out; - static const UINT8 pmem_table[16][4]; - static const UINT8 dmem_table[16][4]; - UINT8 m_handshake, m_irq; + static const uint8_t pmem_table[16][4]; + static const uint8_t dmem_table[16][4]; + uint8_t m_handshake, m_irq; bool m_z8000_halt, m_z8000_mem, m_timer_irq; }; diff --git a/src/mame/machine/m2comm.cpp b/src/mame/machine/m2comm.cpp index 1a11403702a..f3355b0654d 100644 --- a/src/mame/machine/m2comm.cpp +++ b/src/mame/machine/m2comm.cpp @@ -197,7 +197,7 @@ machine_config_constructor m2comm_device::device_mconfig_additions() const // m2comm_device - constructor //------------------------------------------------- -m2comm_device::m2comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m2comm_device::m2comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M2COMM, "MODEL2 COMMUNICATION BD", tag, owner, clock, "m2comm", __FILE__), m_line_rx(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE ), m_line_tx(OPEN_FLAG_READ) @@ -238,7 +238,7 @@ void m2comm_device::device_reset() READ8_MEMBER(m2comm_device::zfg_r) { - UINT8 result = m_zfg | 0xFE; + uint8_t result = m_zfg | 0xFE; #ifdef __M2COMM_VERBOSE__ osd_printf_verbose("m2comm-zfg_r: read register %02x for value %02x\n", offset, result); #endif @@ -255,7 +255,7 @@ WRITE8_MEMBER(m2comm_device::zfg_w) READ8_MEMBER(m2comm_device::share_r) { - UINT8 result = m_shared[offset]; + uint8_t result = m_shared[offset]; #ifdef __M2COMM_VERBOSE__ osd_printf_verbose("m2comm-share_r: read shared memory %02x for value %02x\n", offset, result); #endif diff --git a/src/mame/machine/m2comm.h b/src/mame/machine/m2comm.h index 020ac38fbb2..c525a381409 100644 --- a/src/mame/machine/m2comm.h +++ b/src/mame/machine/m2comm.h @@ -20,7 +20,7 @@ class m2comm_device : public device_t { public: // construction/destruction - m2comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m2comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -48,7 +48,7 @@ public: // IRQ logic - 5 = VINT, 7 = DLC void check_vint_irq(); #ifdef __M2COMM_SIMULATION__ - void set_linktype(UINT16 linktype); + void set_linktype(uint16_t linktype); #endif protected: @@ -57,25 +57,25 @@ protected: virtual void device_reset() override; private: - UINT8 m_shared[0x4000]; // 16k shared memory - UINT8 m_zfg; // z80 flip gate? purpose unknown, bit0 is stored - UINT8 m_cn; // bit0 is used to enable/disable the comm board - UINT8 m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 + uint8_t m_shared[0x4000]; // 16k shared memory + uint8_t m_zfg; // z80 flip gate? purpose unknown, bit0 is stored + uint8_t m_cn; // bit0 is used to enable/disable the comm board + uint8_t m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink emu_file m_line_tx; // tx line - is differential, simple serial and toslink char m_localhost[256]; char m_remotehost[256]; - UINT8 m_buffer[0x4000]; + uint8_t m_buffer[0x4000]; #ifdef __M2COMM_SIMULATION__ - UINT8 m_linkenable; - UINT16 m_linktimer; - UINT8 m_linkalive; - UINT8 m_linkid; - UINT8 m_linkcount; + uint8_t m_linkenable; + uint16_t m_linktimer; + uint8_t m_linkalive; + uint8_t m_linkid; + uint8_t m_linkcount; - UINT16 m_linktype; + uint16_t m_linktype; void comm_init(); void comm_tick(); diff --git a/src/mame/machine/m3comm.cpp b/src/mame/machine/m3comm.cpp index bcacd9e2b04..5ec45c587ac 100644 --- a/src/mame/machine/m3comm.cpp +++ b/src/mame/machine/m3comm.cpp @@ -136,7 +136,7 @@ machine_config_constructor m3comm_device::device_mconfig_additions() const // m3comm_device - constructor //------------------------------------------------- -m3comm_device::m3comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m3comm_device::m3comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M3COMM, "MODEL-3 COMMUNICATION BD", tag, owner, clock, "m3comm", __FILE__), m68k_ram(*this, "m68k_ram"), m_commcpu(*this, M68K_TAG), @@ -190,7 +190,7 @@ void m3comm_device::device_reset_after_children() ///////////// -UINT16 swapb16(UINT16 data) +uint16_t swapb16(uint16_t data) { return (data << 8) | (data >> 8); } @@ -278,7 +278,7 @@ WRITE16_MEMBER(m3comm_device::ioregs_w) } if (m_line_rx.is_open()) { - UINT8 *commram = (UINT8*)membank("comm_ram")->base(); + uint8_t *commram = (uint8_t*)membank("comm_ram")->base(); m_line_rx.read(&commram[recv_offset], recv_size); } */ @@ -298,7 +298,7 @@ WRITE16_MEMBER(m3comm_device::ioregs_w) } if (m_line_tx.is_open()) { - UINT8 *commram = (UINT8*)membank("comm_ram")->base(); + uint8_t *commram = (uint8_t*)membank("comm_ram")->base(); m_line_tx.write(&commram[send_offset], send_size); } */ @@ -336,7 +336,7 @@ WRITE16_MEMBER(m3comm_device::ioregs_w) READ16_MEMBER(m3comm_device::m3_m68k_ram_r) { - UINT16 value = m68k_ram[offset]; // FIXME endian + uint16_t value = m68k_ram[offset]; // FIXME endian return swapb16(value); } WRITE16_MEMBER(m3comm_device::m3_m68k_ram_w) @@ -345,22 +345,22 @@ WRITE16_MEMBER(m3comm_device::m3_m68k_ram_w) } READ8_MEMBER(m3comm_device::m3_comm_ram_r) { - UINT8 *commram = (UINT8*)membank("comm_ram")->base(); + uint8_t *commram = (uint8_t*)membank("comm_ram")->base(); return commram[offset ^ 3]; } WRITE8_MEMBER(m3comm_device::m3_comm_ram_w) { - UINT8 *commram = (UINT8*)membank("comm_ram")->base(); + uint8_t *commram = (uint8_t*)membank("comm_ram")->base(); commram[offset ^ 3] = data; } READ16_MEMBER(m3comm_device::m3_ioregs_r) { - UINT16 value = ioregs_r(space, offset, swapb16(mem_mask)); + uint16_t value = ioregs_r(space, offset, swapb16(mem_mask)); return swapb16(value); } WRITE16_MEMBER(m3comm_device::m3_ioregs_w) { - UINT16 value = swapb16(data); + uint16_t value = swapb16(data); ioregs_w(space, offset, value, swapb16(mem_mask)); // guess, can be asserted at any reg write @@ -381,11 +381,11 @@ READ16_MEMBER(m3comm_device::naomi_r) case 2: // 5F7020 { // logerror("M3COMM read @ %08x\n", (naomi_control << 16) | naomi_offset); - UINT16 value; + uint16_t value; if (naomi_control & 1) value = m68k_ram[naomi_offset / 2]; // FIXME endian else { - UINT16 *commram = (UINT16*)membank("comm_ram")->base(); + uint16_t *commram = (uint16_t*)membank("comm_ram")->base(); value = commram[naomi_offset / 2]; // FIXME endian } @@ -424,7 +424,7 @@ WRITE16_MEMBER(m3comm_device::naomi_w) if (naomi_control & 1) m68k_ram[naomi_offset / 2] = data; // FIXME endian else { - UINT16 *commram = (UINT16*)membank("comm_ram")->base(); + uint16_t *commram = (uint16_t*)membank("comm_ram")->base(); commram[naomi_offset / 2] = data; // FIXME endian } naomi_offset += 2; diff --git a/src/mame/machine/m3comm.h b/src/mame/machine/m3comm.h index 6a9a77a4cc4..5e1ba416664 100644 --- a/src/mame/machine/m3comm.h +++ b/src/mame/machine/m3comm.h @@ -19,12 +19,12 @@ class m3comm_device : public device_t { public: // construction/destruction - m3comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m3comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; - required_shared_ptr m68k_ram; + required_shared_ptr m68k_ram; required_device m_commcpu; DECLARE_ADDRESS_MAP(m3_map, 32); @@ -56,16 +56,16 @@ protected: virtual void device_reset_after_children() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT16 naomi_control; - UINT16 naomi_offset; - UINT16 m_status0; - UINT16 m_status1; - UINT16 m_commbank; - - UINT16 recv_offset; - UINT16 recv_size; - UINT16 send_offset; - UINT16 send_size; + uint16_t naomi_control; + uint16_t naomi_offset; + uint16_t m_status0; + uint16_t m_status1; + uint16_t m_commbank; + + uint16_t recv_offset; + uint16_t recv_size; + uint16_t send_offset; + uint16_t send_size; emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp index 97ee0339c42..c2413522911 100644 --- a/src/mame/machine/mac.cpp +++ b/src/mame/machine/mac.cpp @@ -314,7 +314,7 @@ void mac_state::set_scc_waitrequest(int waitrequest) void mac_state::v8_resize() { offs_t memory_size; - UINT8 *memory_data; + uint8_t *memory_data; int is_rom; is_rom = (m_overlay) ? 1 : 0; @@ -347,8 +347,8 @@ void mac_state::v8_resize() else { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT32 onboard_amt, simm_amt, simm_size; - static const UINT32 simm_sizes[4] = { 0, 2*1024*1024, 4*1024*1024, 8*1024*1024 }; + uint32_t onboard_amt, simm_amt, simm_size; + static const uint32_t simm_sizes[4] = { 0, 2*1024*1024, 4*1024*1024, 8*1024*1024 }; // re-install ROM in its normal place size_t rom_mirror = 0xfffff ^ (memregion("bootrom")->bytes() - 1); @@ -398,7 +398,7 @@ void mac_state::v8_resize() void mac_state::set_memory_overlay(int overlay) { offs_t memory_size; - UINT8 *memory_data; + uint8_t *memory_data; int is_rom; /* normalize overlay */ @@ -490,7 +490,7 @@ void mac_state::set_memory_overlay(int overlay) READ32_MEMBER(mac_state::rom_switch_r) { offs_t ROM_size = memregion("bootrom")->bytes(); - UINT32 *ROM_data = (UINT32 *)memregion("bootrom")->base(); + uint32_t *ROM_data = (uint32_t *)memregion("bootrom")->base(); // disable the overlay if (m_overlay) @@ -1167,7 +1167,7 @@ void mac_state::scc_mouse_irq(int x, int y) READ16_MEMBER ( mac_state::mac_scc_r ) { scc8530_t *scc = space.machine().device("scc"); - UINT16 result; + uint16_t result; result = scc->reg_r(space, offset); return (result << 8) | result; @@ -1201,7 +1201,7 @@ READ16_MEMBER ( mac_state::mac_iwm_r ) * this driver along */ - UINT16 result = 0; + uint16_t result = 0; applefdc_base_device *fdc = space.machine().device("fdc"); result = fdc->read(offset >> 8); @@ -1628,7 +1628,7 @@ WRITE_LINE_MEMBER(mac_state::mac_via_irq) READ16_MEMBER ( mac_state::mac_via_r ) { - UINT16 data; + uint16_t data; offset >>= 8; offset &= 0x0f; @@ -1699,7 +1699,7 @@ WRITE16_MEMBER ( mac_state::mac_via2_w ) READ8_MEMBER(mac_state::mac_via2_in_a) { - UINT8 result; + uint8_t result; if ((m_model == MODEL_MAC_QUADRA_700) || (m_model == MODEL_MAC_QUADRA_900) || (m_model == MODEL_MAC_QUADRA_950)) { @@ -2194,10 +2194,10 @@ MAC_DRIVER_INIT(maciifdhd, MODEL_MAC_II_FDHD) MAC_DRIVER_INIT(maciix, MODEL_MAC_IIX) MAC_DRIVER_INIT(maclc520, MODEL_MAC_LC_520) -void mac_state::nubus_slot_interrupt(UINT8 slot, UINT32 state) +void mac_state::nubus_slot_interrupt(uint8_t slot, uint32_t state) { - static const UINT8 masks[8] = { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 }; - UINT8 mask = 0x3f; + static const uint8_t masks[8] = { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 }; + uint8_t mask = 0x3f; // quadra 700/900/950 use the top 2 bits of the interrupt register for ethernet and video if ((m_model == MODEL_MAC_QUADRA_700) || (m_model == MODEL_MAC_QUADRA_900) || (m_model == MODEL_MAC_QUADRA_950)) @@ -2364,11 +2364,11 @@ WRITE_LINE_MEMBER(mac_state::nubus_irq_e_w) * This is debug code that will output diagnostics regarding OS traps called * *************************************************************************/ -const char *lookup_trap(UINT16 opcode) +const char *lookup_trap(uint16_t opcode) { static const struct { - UINT16 trap; + uint16_t trap; const char *name; } traps[] = { @@ -3184,9 +3184,9 @@ const char *lookup_trap(UINT16 opcode) -offs_t mac_state::mac_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) +offs_t mac_state::mac_dasm_override(device_t &device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options) { - UINT16 opcode; + uint16_t opcode; unsigned result = 0; const char *trap; @@ -3266,9 +3266,9 @@ void mac_state::mac_tracetrap(const char *cpu_name_local, int addr, int trap) switch(trap) { case 0xa004: /* _Control */ - ioVRefNum = *((INT16*) (mem + a0 + 22)); - ioCRefNum = *((INT16*) (mem + a0 + 24)); - csCode = *((UINT16*) (mem + a0 + 26)); + ioVRefNum = *((int16_t*) (mem + a0 + 22)); + ioCRefNum = *((int16_t*) (mem + a0 + 24)); + csCode = *((uint16_t*) (mem + a0 + 26)); sprintf(s->state().state_int(" ioVRefNum=%i ioCRefNum=%i csCode=%i", ioVRefNum, ioCRefNum, csCode); for (i = 0; i < ARRAY_LENGTH(cscodes); i++) @@ -3283,18 +3283,18 @@ void mac_state::mac_tracetrap(const char *cpu_name_local, int addr, int trap) break; case 0xa002: /* _Read */ - ioCompletion = (*((INT16*) (mem + a0 + 12)) << 16) + *((INT16*) (mem + a0 + 14)); - ioVRefNum = *((INT16*) (mem + a0 + 22)); - ioRefNum = *((INT16*) (mem + a0 + 24)); - ioBuffer = (*((INT16*) (mem + a0 + 32)) << 16) + *((INT16*) (mem + a0 + 34)); - ioReqCount = (*((INT16*) (mem + a0 + 36)) << 16) + *((INT16*) (mem + a0 + 38)); - ioPosOffset = (*((INT16*) (mem + a0 + 46)) << 16) + *((INT16*) (mem + a0 + 48)); + ioCompletion = (*((int16_t*) (mem + a0 + 12)) << 16) + *((int16_t*) (mem + a0 + 14)); + ioVRefNum = *((int16_t*) (mem + a0 + 22)); + ioRefNum = *((int16_t*) (mem + a0 + 24)); + ioBuffer = (*((int16_t*) (mem + a0 + 32)) << 16) + *((int16_t*) (mem + a0 + 34)); + ioReqCount = (*((int16_t*) (mem + a0 + 36)) << 16) + *((int16_t*) (mem + a0 + 38)); + ioPosOffset = (*((int16_t*) (mem + a0 + 46)) << 16) + *((int16_t*) (mem + a0 + 48)); sprintf(s, " ioCompletion=0x%08x ioVRefNum=%i ioRefNum=%i ioBuffer=0x%08x ioReqCount=%i ioPosOffset=%i", ioCompletion, ioVRefNum, ioRefNum, ioBuffer, ioReqCount, ioPosOffset); break; case 0xa04e: /* _AddDrive */ - sprintf(s, " drvrRefNum=%i drvNum=%i qEl=0x%08x", (int) (INT16) d0, (int) (INT16) d1, a0); + sprintf(s, " drvrRefNum=%i drvNum=%i qEl=0x%08x", (int) (int16_t) d0, (int) (int16_t) d1, a0); break; case 0xa9a0: /* _GetResource */ @@ -3302,11 +3302,11 @@ void mac_state::mac_tracetrap(const char *cpu_name_local, int addr, int trap) * since this is just trace code it isn't much of an issue */ sprintf(s, " type='%c%c%c%c' id=%i", (char) mem[a7+3], (char) mem[a7+2], - (char) mem[a7+5], (char) mem[a7+4], *((INT16*) (mem + a7))); + (char) mem[a7+5], (char) mem[a7+4], *((int16_t*) (mem + a7))); break; case 0xa815: /* _SCSIDispatch */ - i = *((UINT16*) (mem + a7)); + i = *((uint16_t*) (mem + a7)); if (i < ARRAY_LENGTH(scsisels)) if (scsisels[i]) sprintf(s, " (%s)", scsisels[i]); diff --git a/src/mame/machine/macadb.cpp b/src/mame/machine/macadb.cpp index dae12965a75..a3f81e3a6b4 100644 --- a/src/mame/machine/macadb.cpp +++ b/src/mame/machine/macadb.cpp @@ -232,7 +232,7 @@ int mac_state::adb_pollmouse() return 0; } -void mac_state::adb_accummouse( UINT8 *MouseX, UINT8 *MouseY ) +void mac_state::adb_accummouse( uint8_t *MouseX, uint8_t *MouseY ) { int MouseCountX = 0, MouseCountY = 0; int NewX, NewY; @@ -272,8 +272,8 @@ void mac_state::adb_accummouse( UINT8 *MouseX, UINT8 *MouseY ) m_adb_lastbutton = m_mouse0->read() & 0x01; - *MouseX = (UINT8)MouseCountX; - *MouseY = (UINT8)MouseCountY; + *MouseX = (uint8_t)MouseCountX; + *MouseY = (uint8_t)MouseCountY; } void mac_state::adb_talk() @@ -352,7 +352,7 @@ void mac_state::adb_talk() m_adb_direction = 0; // output to Mac if (addr == m_adb_mouseaddr) { - UINT8 mouseX, mouseY; + uint8_t mouseX, mouseY; #if LOG_ADB || LOG_ADB_TALK_LISTEN printf("Talking to mouse, register %x\n", reg); @@ -758,7 +758,7 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_pmu_tick) } } -void mac_state::pmu_one_byte_reply(UINT8 result) +void mac_state::pmu_one_byte_reply(uint8_t result) { m_pm_out[0] = m_pm_out[1] = 1; // length m_pm_out[2] = result; @@ -766,7 +766,7 @@ void mac_state::pmu_one_byte_reply(UINT8 result) m_pmu_send_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(200))); } -void mac_state::pmu_three_byte_reply(UINT8 result1, UINT8 result2, UINT8 result3) +void mac_state::pmu_three_byte_reply(uint8_t result1, uint8_t result2, uint8_t result3) { m_pm_out[0] = m_pm_out[1] = 3; // length m_pm_out[2] = result1; diff --git a/src/mame/machine/mackbd.cpp b/src/mame/machine/mackbd.cpp index 56e55940aa5..cf768223e28 100644 --- a/src/mame/machine/mackbd.cpp +++ b/src/mame/machine/mackbd.cpp @@ -209,7 +209,7 @@ ioport_constructor mackbd_device::device_input_ports() const // mackbd_device - constructor //------------------------------------------------- -mackbd_device::mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mackbd_device::mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MACKBD, "Macintosh keyboard", tag, owner, clock, "mackbd", __FILE__), m_maincpu(*this, MACKBD_CPU_TAG), m_clkout_handler(*this), @@ -241,7 +241,7 @@ void mackbd_device::device_reset() void mackbd_device::scan_kbd_col(int col) { char tempcol[8]; - UINT16 keydata; + uint16_t keydata; // read the selected col sprintf(tempcol, "COL%d", col); @@ -256,7 +256,7 @@ void mackbd_device::scan_kbd_col(int col) READ8_MEMBER(mackbd_device::p0_r) { - UINT8 ret = p0; + uint8_t ret = p0; // capslock if (ioport("MODS")->read() & 0x1) diff --git a/src/mame/machine/mackbd.h b/src/mame/machine/mackbd.h index 338dabff258..621d1143b26 100644 --- a/src/mame/machine/mackbd.h +++ b/src/mame/machine/mackbd.h @@ -42,7 +42,7 @@ public: template static devcb_base &set_dataout_handler(device_t &device, _Object object) { return downcast(device).m_dataout_handler.set_callback(object); } // construction/destruction - mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(p0_r); DECLARE_WRITE8_MEMBER(p0_w); @@ -65,7 +65,7 @@ protected: required_device m_maincpu; private: - UINT8 p0, p1, p2, data_from_mac, data_to_mac; + uint8_t p0, p1, p2, data_from_mac, data_to_mac; devcb_write_line m_clkout_handler; devcb_write_line m_dataout_handler; diff --git a/src/mame/machine/macpci.cpp b/src/mame/machine/macpci.cpp index a8f9f0e007f..eaa735c24d2 100644 --- a/src/mame/machine/macpci.cpp +++ b/src/mame/machine/macpci.cpp @@ -65,7 +65,7 @@ WRITE8_MEMBER(macpci_state::mac_via_out_b) READ16_MEMBER ( macpci_state::mac_via_r ) { - UINT16 data; + uint16_t data; offset >>= 8; offset &= 0x0f; @@ -97,7 +97,7 @@ WRITE16_MEMBER ( macpci_state::mac_via_w ) READ_LINE_MEMBER(macpci_state::mac_adb_via_in_cb2) { - UINT8 ret; + uint8_t ret; ret = m_cuda->get_via_data(); #if LOG_ADB printf("PPC: Read VIA_DATA %x\n", ret); @@ -169,7 +169,7 @@ READ32_MEMBER(macpci_state::mac_read_id) READ16_MEMBER ( macpci_state::mac_scc_r ) { scc8530_t *scc = space.machine().device("scc"); - UINT16 result; + uint16_t result; result = scc->reg_r(space, offset); return (result << 8) | result; diff --git a/src/mame/machine/macrtc.cpp b/src/mame/machine/macrtc.cpp index 1a20c08811d..fc92e8660b6 100644 --- a/src/mame/machine/macrtc.cpp +++ b/src/mame/machine/macrtc.cpp @@ -40,7 +40,7 @@ const device_type RTC3430042 = &device_creator; // rtc4543_device - constructor //------------------------------------------------- -rtc3430042_device::rtc3430042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rtc3430042_device::rtc3430042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RTC3430042, "Apple 343-0042 clock/PRAM", tag, owner, clock, "rtc3430042", __FILE__), device_rtc_interface(mconfig, *this), device_nvram_interface(mconfig, *this) @@ -91,7 +91,7 @@ void rtc3430042_device::device_timer(emu_timer &timer, device_timer_id id, int p void rtc3430042_device::rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) { struct tm cur_time, mac_reference; - UINT32 seconds; + uint32_t seconds; cur_time.tm_sec = second; cur_time.tm_min = minute; diff --git a/src/mame/machine/macrtc.h b/src/mame/machine/macrtc.h index dc969e93f82..dd96403cd99 100644 --- a/src/mame/machine/macrtc.h +++ b/src/mame/machine/macrtc.h @@ -36,7 +36,7 @@ class rtc3430042_device : public device_t, { public: // construction/destruction - rtc3430042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rtc3430042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( ce_w ); DECLARE_WRITE_LINE_MEMBER( clk_w ); @@ -60,32 +60,32 @@ protected: private: /* state of rTCEnb and rTCClk lines */ - UINT8 m_rtc_rTCEnb; - UINT8 m_rtc_rTCClk; + uint8_t m_rtc_rTCEnb; + uint8_t m_rtc_rTCClk; /* serial transmit/receive register : bits are shifted in/out of this byte */ - UINT8 m_rtc_data_byte; + uint8_t m_rtc_data_byte; /* serial transmitted/received bit count */ - UINT8 m_rtc_bit_count; + uint8_t m_rtc_bit_count; /* direction of the current transfer (0 : VIA->RTC, 1 : RTC->VIA) */ - UINT8 m_rtc_data_dir; + uint8_t m_rtc_data_dir; /* when rtc_data_dir == 1, state of rTCData as set by RTC (-> data bit seen by VIA) */ - UINT8 m_rtc_data_out; + uint8_t m_rtc_data_out; /* set to 1 when command in progress */ - UINT8 m_rtc_cmd; + uint8_t m_rtc_cmd; /* write protect flag */ - UINT8 m_rtc_write_protect; + uint8_t m_rtc_write_protect; /* internal seconds register */ - UINT8 m_rtc_seconds[/*8*/4]; + uint8_t m_rtc_seconds[/*8*/4]; /* 20-byte long PRAM, or 256-byte long XPRAM */ - UINT8 m_pram[256]; + uint8_t m_pram[256]; /* current extended address and RTC state */ - UINT8 m_rtc_xpaddr; - UINT8 m_rtc_state; - UINT8 m_data_latch; + uint8_t m_rtc_xpaddr; + uint8_t m_rtc_state; + uint8_t m_data_latch; // timers emu_timer *m_clock_timer; diff --git a/src/mame/machine/maple-dc.cpp b/src/mame/machine/maple-dc.cpp index dcefe0fd84c..56a838a8967 100644 --- a/src/mame/machine/maple-dc.cpp +++ b/src/mame/machine/maple-dc.cpp @@ -28,7 +28,7 @@ void maple_dc_device::static_set_irq_cb(device_t &device, void (*irq_cb)(running maple_dc.irq_cb = irq_cb; } -maple_dc_device::maple_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +maple_dc_device::maple_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MAPLE_DC, "Dreamcast Maple Bus", tag, owner, clock, "maple_dc", __FILE__) { // Do not move that in device_start or there will be a race @@ -113,8 +113,8 @@ void maple_dc_device::dma_step() switch(dma_state) { case DMA_SEND: { sh4_ddt_dma ddtdata; - UINT32 header[2]; - UINT32 data[512]; + uint32_t header[2]; + uint32_t data[512]; ddtdata.source = dma_adr; // source address ddtdata.length = 2; // words to transfer ddtdata.size = 4; // bytes per word @@ -127,8 +127,8 @@ void maple_dc_device::dma_step() dma_endflag = header[0] & 0x80000000; dma_port = (header[0] >> 16) & 3; - UINT32 pattern = (header[0] >> 8) & 7; - UINT32 length = (header[0] & 255) + 1; + uint32_t pattern = (header[0] >> 8) & 7; + uint32_t length = (header[0] & 255) + 1; dma_dest = header[1]; ddtdata.source = dma_adr; // source address @@ -185,7 +185,7 @@ void maple_dc_device::dma_step() case DMA_TIMEOUT: { sh4_ddt_dma ddtdata; - UINT32 data = 0xffffffff; + uint32_t data = 0xffffffff; ddtdata.destination = dma_dest; // destination address ddtdata.length = 1; // words to transfer ddtdata.size = 4; // bytes per word @@ -202,8 +202,8 @@ void maple_dc_device::dma_step() timer->adjust(attotime::never); sh4_ddt_dma ddtdata; - UINT32 data[512]; - UINT32 length = 0; + uint32_t data[512]; + uint32_t length = 0; bool partial = false; if(devices[dma_port]) devices[dma_port]->maple_r(data, length, partial); @@ -291,7 +291,7 @@ READ32_MEMBER(maple_dc_device::sb_mdst_r) WRITE32_MEMBER(maple_dc_device::sb_mdst_w) { - UINT32 old = mdst; + uint32_t old = mdst; mdst = data & 1; if(!old && data && (mden & 1) && mdtsel == 0) { diff --git a/src/mame/machine/maple-dc.h b/src/mame/machine/maple-dc.h index dcecaa9d2b5..7c8e1b69c46 100644 --- a/src/mame/machine/maple-dc.h +++ b/src/mame/machine/maple-dc.h @@ -15,7 +15,7 @@ class maple_device; class maple_dc_device : public device_t { public: - maple_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + maple_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_maincpu_tag(device_t &device, const char *maincpu_tag); static void static_set_irq_cb(device_t &device, void (*irq_cb)(running_machine &)); @@ -60,10 +60,10 @@ private: sh4_device *cpu; emu_timer *timer; - UINT32 mdstar, mden, mdst, msys; - UINT32 mdtsel; + uint32_t mdstar, mden, mdst, msys; + uint32_t mdtsel; - UINT32 dma_state, dma_adr, dma_port, dma_dest; + uint32_t dma_state, dma_adr, dma_port, dma_dest; bool dma_endflag; void (*irq_cb)(running_machine &); diff --git a/src/mame/machine/mapledev.cpp b/src/mame/machine/mapledev.cpp index 0f7630e3315..01ba48849a9 100644 --- a/src/mame/machine/mapledev.cpp +++ b/src/mame/machine/mapledev.cpp @@ -12,7 +12,7 @@ void maple_device::static_set_host(device_t &device, const char *_host_tag, int } -maple_device::maple_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) +maple_device::maple_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) { host_tag = nullptr; host_port = 0; @@ -58,7 +58,7 @@ void maple_device::reply_ready() host->end_of_reply(); } -void maple_device::copy_with_spaces(UINT8 *dest, const char *source, int len) +void maple_device::copy_with_spaces(uint8_t *dest, const char *source, int len) { int i; for(i=0; i; -mathbox_device::mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mathbox_device::mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MATHBOX, "Atari MATHBOX", tag, owner, clock, "mathbox", __FILE__) { } @@ -72,14 +72,14 @@ void mathbox_device::device_start() void mathbox_device::device_reset() { m_result = 0; - memset(m_reg, 0, sizeof(INT16)*16); + memset(m_reg, 0, sizeof(int16_t)*16); } WRITE8_MEMBER( mathbox_device::go_w ) { - INT32 mb_temp; /* temp 32-bit multiply results */ - INT16 mb_q; /* temp used in division */ + int32_t mb_temp; /* temp 32-bit multiply results */ + int16_t mb_q; /* temp used in division */ int msb; LOG(("math box command %02x data %02x ", offset, data)); @@ -122,17 +122,17 @@ WRITE8_MEMBER( mathbox_device::go_w ) REG5 = (REG5 & 0x00ff) | (data << 8); - REGf = (INT16)0xffff; + REGf = (int16_t)0xffff; REG4 -= REG2; REG5 -= REG3; step_048: - mb_temp = ((INT32) REG0) * ((INT32) REG4); + mb_temp = ((int32_t) REG0) * ((int32_t) REG4); REGc = mb_temp >> 16; REGe = mb_temp & 0xffff; - mb_temp = ((INT32) -REG1) * ((INT32) REG5); + mb_temp = ((int32_t) -REG1) * ((int32_t) REG5); REG7 = mb_temp >> 16; mb_q = mb_temp & 0xffff; @@ -156,11 +156,11 @@ WRITE8_MEMBER( mathbox_device::go_w ) case 0x12: - mb_temp = ((INT32) REG1) * ((INT32) REG4); + mb_temp = ((int32_t) REG1) * ((int32_t) REG4); REGc = mb_temp >> 16; REG9 = mb_temp & 0xffff; - mb_temp = ((INT32) REG0) * ((INT32) REG5); + mb_temp = ((int32_t) REG0) * ((int32_t) REG5); REG8 = mb_temp >> 16; mb_q = mb_temp & 0xffff; diff --git a/src/mame/machine/mathbox.h b/src/mame/machine/mathbox.h index d50bb690687..df71e326019 100644 --- a/src/mame/machine/mathbox.h +++ b/src/mame/machine/mathbox.h @@ -19,7 +19,7 @@ class mathbox_device : public device_t { public: - mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( go_w ); DECLARE_READ8_MEMBER( status_r ); @@ -36,10 +36,10 @@ protected: // internal state /* math box scratch registers */ - INT16 m_reg[16]; + int16_t m_reg[16]; /* math box result */ - INT16 m_result; + int16_t m_result; }; extern const device_type MATHBOX; diff --git a/src/mame/machine/mbc55x.cpp b/src/mame/machine/mbc55x.cpp index a9cb70cc35e..99c6c6d2cd7 100644 --- a/src/mame/machine/mbc55x.cpp +++ b/src/mame/machine/mbc55x.cpp @@ -175,10 +175,10 @@ void mbc55x_state::keyboard_reset() void mbc55x_state::scan_keyboard() { - UINT8 keyrow; - UINT8 row; - UINT8 bitno; - UINT8 mask; + uint8_t keyrow; + uint8_t row; + uint8_t bitno; + uint8_t mask; char key; static const char *const keynames[] = @@ -244,7 +244,7 @@ TIMER_CALLBACK_MEMBER(mbc55x_state::keyscan_callback) READ8_MEMBER(mbc55x_state::mbc55x_kb_usart_r) { - UINT8 result = 0; + uint8_t result = 0; offset>>=1; switch (offset) @@ -281,8 +281,8 @@ void mbc55x_state::set_ram_size() int nobanks = ramsize / RAM_BANK_SIZE; char bank[10]; int bankno; - UINT8 *ram = &m_ram->pointer()[0]; - UINT8 *map_base; + uint8_t *ram = &m_ram->pointer()[0]; + uint8_t *map_base; int bank_base; @@ -373,9 +373,9 @@ static int instruction_hook(device_t &device, offs_t curpc) { mbc55x_state *state = device.machine().driver_data(); address_space &space = device.memory().space(AS_PROGRAM); - UINT8 *addr_ptr; + uint8_t *addr_ptr; - addr_ptr = (UINT8*)space.get_read_ptr(curpc); + addr_ptr = (uint8_t*)space.get_read_ptr(curpc); if ((addr_ptr !=nullptr) && (addr_ptr[0]==0xCD)) { @@ -392,18 +392,18 @@ static void decode_dos21(device_t *device,offs_t pc) { mbc55x_state *state = device->machine().driver_data(); - UINT16 ax = state->m_maincpu->state_int(I8086_AX); - UINT16 bx = state->m_maincpu->state_int(I8086_BX); - UINT16 cx = state->m_maincpu->state_int(I8086_CX); - UINT16 dx = state->m_maincpu->state_int(I8086_DX); - UINT16 cs = state->m_maincpu->state_int(I8086_CS); - UINT16 ds = state->m_maincpu->state_int(I8086_DS); - UINT16 es = state->m_maincpu->state_int(I8086_ES); - UINT16 ss = state->m_maincpu->state_int(I8086_SS); - - UINT16 si = state->m_maincpu->state_int(I8086_SI); - UINT16 di = state->m_maincpu->state_int(I8086_DI); - UINT16 bp = state->m_maincpu->state_int(I8086_BP); + uint16_t ax = state->m_maincpu->state_int(I8086_AX); + uint16_t bx = state->m_maincpu->state_int(I8086_BX); + uint16_t cx = state->m_maincpu->state_int(I8086_CX); + uint16_t dx = state->m_maincpu->state_int(I8086_DX); + uint16_t cs = state->m_maincpu->state_int(I8086_CS); + uint16_t ds = state->m_maincpu->state_int(I8086_DS); + uint16_t es = state->m_maincpu->state_int(I8086_ES); + uint16_t ss = state->m_maincpu->state_int(I8086_SS); + + uint16_t si = state->m_maincpu->state_int(I8086_SI); + uint16_t di = state->m_maincpu->state_int(I8086_DI); + uint16_t bp = state->m_maincpu->state_int(I8086_BP); device->logerror("=======================================================================\n"); device->logerror("DOS Int 0x21 call at %05X\n",pc); diff --git a/src/mame/machine/mbee.cpp b/src/mame/machine/mbee.cpp index 778d16c026d..b947362a433 100644 --- a/src/mame/machine/mbee.cpp +++ b/src/mame/machine/mbee.cpp @@ -57,7 +57,7 @@ WRITE8_MEMBER( mbee_state::pio_port_b_w ) READ8_MEMBER( mbee_state::pio_port_b_r ) { - UINT8 data = 0; + uint8_t data = 0; if (m_cassette->input() > 0.03) data |= 1; @@ -67,16 +67,16 @@ READ8_MEMBER( mbee_state::pio_port_b_r ) switch (m_io_config->read() & 0xc0) { case 0x00: - data |= (UINT8)m_b7_vs << 7; + data |= (uint8_t)m_b7_vs << 7; break; case 0x40: - data |= (UINT8)m_b7_rtc << 7; + data |= (uint8_t)m_b7_rtc << 7; break; case 0x80: data |= 0x80; break; } - data |= (UINT8)m_b2 << 1; // key pressed on new keyboard + data |= (uint8_t)m_b2 << 1; // key pressed on new keyboard return data; } @@ -156,7 +156,7 @@ TIMER_CALLBACK_MEMBER( mbee_state::timer_newkb ) It includes up to 4 KB of mask-programmable ROM, 64 bytes of scratchpad RAM and up to 64 bytes of executable RAM. The MCU also integrates 32-bit I/O and a programmable timer. */ - UINT8 i, j, pressed; + uint8_t i, j, pressed; // find what has changed for (i = 0; i < 15; i++) @@ -170,7 +170,7 @@ TIMER_CALLBACK_MEMBER( mbee_state::timer_newkb ) if (BIT(pressed^m_mbee256_was_pressed[i], j)) { // put it in the queue - UINT8 code = (i << 3) | j | (BIT(pressed, j) ? 0x80 : 0); + uint8_t code = (i << 3) | j | (BIT(pressed, j) ? 0x80 : 0); m_mbee256_q[m_mbee256_q_pos] = code; if (m_mbee256_q_pos < 19) m_mbee256_q_pos++; } @@ -191,7 +191,7 @@ TIMER_CALLBACK_MEMBER( mbee_state::timer_newkb ) READ8_MEMBER( mbee_state::port18_r ) { - UINT8 i, data = m_mbee256_q[0]; // get oldest key + uint8_t i, data = m_mbee256_q[0]; // get oldest key if (m_mbee256_q_pos) { @@ -273,14 +273,14 @@ WRITE_LINE_MEMBER( mbee_state::rtc_irq_w ) ************************************************************/ -void mbee_state::setup_banks(UINT8 data, bool first_time, UINT8 b_mask) +void mbee_state::setup_banks(uint8_t data, bool first_time, uint8_t b_mask) { data &= 0x3f; // (bits 0-5 are referred to as S0-S5) address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT8 *prom = memregion("pals")->base(); - UINT8 b_data = BITSWAP8(data, 7,5,3,2,4,6,1,0) & 0x3b; // arrange data bits to S0,S1,-,S4,S2,S3 - UINT8 b_bank, b_byte, b_byte_t, b_addr, p_bank = 1; - UINT16 b_vid; + uint8_t *prom = memregion("pals")->base(); + uint8_t b_data = BITSWAP8(data, 7,5,3,2,4,6,1,0) & 0x3b; // arrange data bits to S0,S1,-,S4,S2,S3 + uint8_t b_bank, b_byte, b_byte_t, b_addr, p_bank = 1; + uint16_t b_vid; char banktag[10]; if (first_time || (b_data != m_bank_array[0])) // if same data as last time, leave now @@ -494,7 +494,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbee ) DRIVER_INIT_MEMBER( mbee_state, mbeeic ) { - UINT8 *RAM = memregion("pakrom")->base(); + uint8_t *RAM = memregion("pakrom")->base(); m_pak->configure_entries(0, 16, &RAM[0x0000], 0x2000); m_pak->set_entry(0); @@ -504,7 +504,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbeeic ) DRIVER_INIT_MEMBER( mbee_state, mbeepc ) { - UINT8 *RAM = memregion("telcomrom")->base(); + uint8_t *RAM = memregion("telcomrom")->base(); m_telcom->configure_entries(0, 2, &RAM[0x0000], 0x1000); RAM = memregion("pakrom")->base(); @@ -517,7 +517,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbeepc ) DRIVER_INIT_MEMBER( mbee_state, mbeepc85 ) { - UINT8 *RAM = memregion("telcomrom")->base(); + uint8_t *RAM = memregion("telcomrom")->base(); m_telcom->configure_entries(0, 2, &RAM[0x0000], 0x1000); RAM = memregion("pakrom")->base(); @@ -530,7 +530,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbeepc85 ) DRIVER_INIT_MEMBER( mbee_state, mbeeppc ) { - UINT8 *RAM = memregion("basicrom")->base(); + uint8_t *RAM = memregion("basicrom")->base(); m_basic->configure_entries(0, 2, &RAM[0x0000], 0x2000); RAM = memregion("telcomrom")->base(); @@ -554,11 +554,11 @@ DRIVER_INIT_MEMBER( mbee_state, mbee56 ) // PP has 1024k which is 256 banks, but having 64 banks stops it crashing during the self-test. Need a schematic before we can fix it. DRIVER_INIT_MEMBER( mbee_state, mbee128 ) { - UINT8 *RAM = memregion("rams")->base(); - UINT8 *ROM = memregion("roms")->base(); + uint8_t *RAM = memregion("rams")->base(); + uint8_t *ROM = memregion("roms")->base(); char banktag[10]; - for (UINT8 b_bank = 0; b_bank < 16; b_bank++) + for (uint8_t b_bank = 0; b_bank < 16; b_bank++) { sprintf(banktag, "bankr%d", b_bank); membank(banktag)->configure_entries(0, 64, &RAM[0x0000], 0x1000); // RAM banks @@ -575,11 +575,11 @@ DRIVER_INIT_MEMBER( mbee_state, mbee128 ) DRIVER_INIT_MEMBER( mbee_state, mbee256 ) { - UINT8 *RAM = memregion("rams")->base(); - UINT8 *ROM = memregion("roms")->base(); + uint8_t *RAM = memregion("rams")->base(); + uint8_t *ROM = memregion("roms")->base(); char banktag[10]; - for (UINT8 b_bank = 0; b_bank < 16; b_bank++) + for (uint8_t b_bank = 0; b_bank < 16; b_bank++) { sprintf(banktag, "bankr%d", b_bank); membank(banktag)->configure_entries(0, 64, &RAM[0x0000], 0x1000); // RAM banks @@ -598,7 +598,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbee256 ) DRIVER_INIT_MEMBER( mbee_state, mbeett ) { - UINT8 *RAM = memregion("telcomrom")->base(); + uint8_t *RAM = memregion("telcomrom")->base(); m_telcom->configure_entries(0, 2, &RAM[0x0000], 0x1000); RAM = memregion("pakrom")->base(); @@ -624,8 +624,8 @@ DRIVER_INIT_MEMBER( mbee_state, mbeett ) QUICKLOAD_LOAD_MEMBER( mbee_state, mbee ) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT16 i, j; - UINT8 data, sw = m_io_config->read() & 1; /* reading the config switch: 1 = autorun */ + uint16_t i, j; + uint8_t data, sw = m_io_config->read() & 1; /* reading the config switch: 1 = autorun */ if (image.is_filetype("mwb")) { @@ -716,7 +716,7 @@ QUICKLOAD_LOAD_MEMBER( mbee_state, mbee ) QUICKLOAD_LOAD_MEMBER( mbee_state, mbee_z80bin ) { - UINT16 execute_address, start_addr, end_addr; + uint16_t execute_address, start_addr, end_addr; int autorun; address_space &space = m_maincpu->space(AS_PROGRAM); diff --git a/src/mame/machine/mc80.cpp b/src/mame/machine/mc80.cpp index d96f2c3cbaa..3be03fa4f98 100644 --- a/src/mame/machine/mc80.cpp +++ b/src/mame/machine/mc80.cpp @@ -78,8 +78,8 @@ WRITE8_MEMBER( mc80_state::mc8030_vis_w ) // 1 0 x - operation code in B reg // reg B // - UINT16 addr = ((offset & 0xff00) >> 2) | ((offset & 0x08) << 2) | (data >> 3); - static const UINT8 val[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; + uint16_t addr = ((offset & 0xff00) >> 2) | ((offset & 0x08) << 2) | (data >> 3); + static const uint8_t val[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; int c = offset & 1; m_p_videoram[addr] = m_p_videoram[addr] | (val[data & 7]*c); } diff --git a/src/mame/machine/mc8123.cpp b/src/mame/machine/mc8123.cpp index 551f29b9954..55d850a77ea 100644 --- a/src/mame/machine/mc8123.cpp +++ b/src/mame/machine/mc8123.cpp @@ -30,13 +30,13 @@ The LCG is the same that was used to generate the FD1094 keys. Note that the algorithm skips the special value that would instruct the CPU to not decrypt at that address. -void generate_key(UINT8 *key, int seed, int upper_bound) +void generate_key(uint8_t *key, int seed, int upper_bound) { int i; for (i = 0; i < upper_bound; ++i) { - UINT8 byteval; + uint8_t byteval; do { @@ -367,7 +367,7 @@ static int decrypt(int val, int key, int opcode) } -static UINT8 mc8123_decrypt(offs_t addr,UINT8 val,const UINT8 *key,int opcode) +static uint8_t mc8123_decrypt(offs_t addr,uint8_t val,const uint8_t *key,int opcode) { int tbl_num; @@ -377,12 +377,12 @@ static UINT8 mc8123_decrypt(offs_t addr,UINT8 val,const UINT8 *key,int opcode) return decrypt(val,key[tbl_num + (opcode ? 0 : 0x1000)],opcode); } -void mc8123_decode(UINT8 *rom, UINT8 *opcodes, const UINT8 *key, int length) +void mc8123_decode(uint8_t *rom, uint8_t *opcodes, const uint8_t *key, int length) { for (int A = 0x0000;A < length;A++) { int adr = A >= 0xc000 ? (A & 0x3fff) | 0x8000 : A; - UINT8 src = rom[A]; + uint8_t src = rom[A]; /* decode the opcodes */ opcodes[A] = mc8123_decrypt(adr,src,key,1); diff --git a/src/mame/machine/mc8123.h b/src/mame/machine/mc8123.h index f5a2078bec5..42c59851b18 100644 --- a/src/mame/machine/mc8123.h +++ b/src/mame/machine/mc8123.h @@ -9,4 +9,4 @@ // this function assumes a fixed portion of ROM at 0000-7FFF, and // an arbitrary amount of banks at 8000-BFFF. -void mc8123_decode(UINT8 *rom, UINT8 *opcodes, const UINT8 *key, int length); +void mc8123_decode(uint8_t *rom, uint8_t *opcodes, const uint8_t *key, int length); diff --git a/src/mame/machine/mcr.cpp b/src/mame/machine/mcr.cpp index 0332220fb50..fa781da57dd 100644 --- a/src/mame/machine/mcr.cpp +++ b/src/mame/machine/mcr.cpp @@ -20,10 +20,10 @@ * *************************************/ -UINT8 mcr_cocktail_flip; +uint8_t mcr_cocktail_flip; -UINT32 mcr_cpu_board; -UINT32 mcr_sprite_board; +uint32_t mcr_cpu_board; +uint32_t mcr_sprite_board; diff --git a/src/mame/machine/mcr68.cpp b/src/mame/machine/mcr68.cpp index 2158c4d5c28..4866a30f86f 100644 --- a/src/mame/machine/mcr68.cpp +++ b/src/mame/machine/mcr68.cpp @@ -21,7 +21,7 @@ READ8_MEMBER(mcr68_state::zwackery_port_1_r) { - UINT8 ret = ioport("IN1")->read(); + uint8_t ret = ioport("IN1")->read(); downcast(machine().device("pia1"))->set_port_a_z_mask(ret); @@ -31,7 +31,7 @@ READ8_MEMBER(mcr68_state::zwackery_port_1_r) READ8_MEMBER(mcr68_state::zwackery_port_3_r) { - UINT8 ret = ioport("IN3")->read(); + uint8_t ret = ioport("IN3")->read(); downcast(machine().device("pia2"))->set_port_a_z_mask(ret); @@ -369,7 +369,7 @@ LOG(("reload_count(%d): period = %f count = %d\n", counter, period.as_double(), } -UINT16 mcr68_state::compute_counter(int counter) +uint16_t mcr68_state::compute_counter(int counter) { struct counter_state *m6840 = &m_m6840_state[counter]; attotime period; @@ -416,7 +416,7 @@ WRITE8_MEMBER(mcr68_state::mcr68_6840_w_common) { int counter = (offset == 1) ? 1 : (m_m6840_state[1].control & 0x01) ? 0 : 2; struct counter_state *m6840 = &m_m6840_state[counter]; - UINT8 diffs = data ^ m6840->control; + uint8_t diffs = data ^ m6840->control; m6840->control = data; diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp index 3cab44e8d1b..e9aabbd27c6 100644 --- a/src/mame/machine/mega32x.cpp +++ b/src/mame/machine/mega32x.cpp @@ -205,7 +205,7 @@ GFX check (these don't explicitly fails): const device_type SEGA_32X_NTSC = &device_creator; const device_type SEGA_32X_PAL = &device_creator; -sega_32x_device::sega_32x_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) +sega_32x_device::sega_32x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , m_master_cpu(*this, "32x_master_sh2") , m_slave_cpu(*this, "32x_slave_sh2") @@ -216,12 +216,12 @@ sega_32x_device::sega_32x_device(const machine_config &mconfig, device_type type { } -sega_32x_ntsc_device::sega_32x_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_32x_ntsc_device::sega_32x_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega_32x_device(mconfig, SEGA_32X_NTSC, "sega_32x_ntsc", tag, owner, clock, "sega_32x_ntsc", __FILE__) { } -sega_32x_pal_device::sega_32x_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_32x_pal_device::sega_32x_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega_32x_device(mconfig, SEGA_32X_PAL, "sega_32x_pal", tag, owner, clock, "sega_32x_pal", __FILE__) { } @@ -347,7 +347,7 @@ WRITE16_MEMBER( sega_32x_device::_32x_68k_dram_overwrite_w ) READ16_MEMBER( sega_32x_device::_32x_68k_a15106_r ) { - UINT16 retval; + uint16_t retval; retval = m_a15106_reg; @@ -429,7 +429,7 @@ READ16_MEMBER( sega_32x_device::_32x_dreq_common_r ) return 0xffff; } - UINT16 retdat = m_current_fifo_readblock[m_current_fifo_read_pos]; + uint16_t retdat = m_current_fifo_readblock[m_current_fifo_read_pos]; m_current_fifo_read_pos++; @@ -943,16 +943,16 @@ WRITE16_MEMBER( sega_32x_device::_32x_68k_pwm_w ) // also accessed from the SH2 @ 4100 /**********************************************************************************************/ -UINT16 sega_32x_device::get_hposition(void) +uint16_t sega_32x_device::get_hposition(void) { attotime time_elapsed_since_megadriv_scanline_timer; - UINT16 value4; + uint16_t value4; time_elapsed_since_megadriv_scanline_timer = machine().device(":md_scan_timer")->time_elapsed(); if (time_elapsed_since_megadriv_scanline_timer.attoseconds() < (ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines)) { - value4 = (UINT16)(MAX_HPOSITION*((double)(time_elapsed_since_megadriv_scanline_timer.attoseconds()) / (double)(ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines))); + value4 = (uint16_t)(MAX_HPOSITION*((double)(time_elapsed_since_megadriv_scanline_timer.attoseconds()) / (double)(ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines))); } else /* in some cases (probably due to rounding errors) we get some stupid results (the odd huge value where the time elapsed is much higher than the scanline time??!).. hopefully by clamping the result to the maximum we limit errors */ { @@ -996,8 +996,8 @@ READ16_MEMBER( sega_32x_device::_32x_common_vdp_regs_r ) return m_32x_autofill_data; case 0x0a/2: - UINT16 retdata = m_32x_a1518a_reg; - UINT16 hpos = get_hposition(); + uint16_t retdata = m_32x_a1518a_reg; + uint16_t hpos = get_hposition(); int megadrive_hblank_flag = 0; if (m_32x_vblank_flag) retdata |= 0x8000; @@ -1173,7 +1173,7 @@ P = PWM Interrupt Mask (0 masked, 1 allowed) /* MASTER */ READ16_MEMBER( sega_32x_device::_32x_sh2_master_4000_r ) { - UINT16 retvalue = 0x0200; + uint16_t retvalue = 0x0200; retvalue |= m_32x_access_auth << 15; retvalue |= m_sh2_hint_in_vbl; @@ -1211,7 +1211,7 @@ WRITE16_MEMBER( sega_32x_device::_32x_sh2_master_4000_w ) READ16_MEMBER( sega_32x_device::_32x_sh2_slave_4000_r ) { - UINT16 retvalue = 0x0200; + uint16_t retvalue = 0x0200; retvalue |= m_32x_access_auth << 15; retvalue |= m_sh2_hint_in_vbl; retvalue |= m_sh2_slave_vint_enable; @@ -1424,15 +1424,15 @@ WRITE16_MEMBER( sega_32x_device::_32x_sh2_slave_401e_w ) #define _32X_MAP_READHANDLERS(NAMEA,NAMEB) \ READ32_MEMBER( sega_32x_device::_32x_sh2_##NAMEA##_##NAMEB##_r ) \ { \ - UINT32 retvalue = 0x00000000; \ + uint32_t retvalue = 0x00000000; \ if (ACCESSING_BITS_16_31) \ { \ - UINT16 ret = _32x_sh2_##NAMEA##_r(space,0,(mem_mask>>16)&0xffff); \ + uint16_t ret = _32x_sh2_##NAMEA##_r(space,0,(mem_mask>>16)&0xffff); \ retvalue |= ret << 16; \ } \ if (ACCESSING_BITS_0_15) \ { \ - UINT16 ret = _32x_sh2_##NAMEB##_r(space,0,(mem_mask>>0)&0xffff); \ + uint16_t ret = _32x_sh2_##NAMEB##_r(space,0,(mem_mask>>0)&0xffff); \ retvalue |= ret << 0; \ } \ \ @@ -1608,7 +1608,7 @@ void sega_32x_device::_32x_render_videobuffer_to_screenbuffer_helper(int scanlin { if (m_32x_displaymode==1) { - UINT32 lineoffs; + uint32_t lineoffs; int start; lineoffs = m_32x_display_dram[scanline]; @@ -1618,7 +1618,7 @@ void sega_32x_device::_32x_render_videobuffer_to_screenbuffer_helper(int scanlin for (x=start;x<320;x++) { - UINT16 coldata; + uint16_t coldata; coldata = m_32x_display_dram[lineoffs]; { @@ -1641,7 +1641,7 @@ void sega_32x_device::_32x_render_videobuffer_to_screenbuffer_helper(int scanlin } else if (m_32x_displaymode==3) // mode 3 = RLE (used by BRUTAL intro) { - UINT32 lineoffs; + uint32_t lineoffs; int start; lineoffs = m_32x_display_dram[scanline]; @@ -1652,7 +1652,7 @@ void sega_32x_device::_32x_render_videobuffer_to_screenbuffer_helper(int scanlin x = start; while (x<320) { - UINT16 coldata, length, l; + uint16_t coldata, length, l; coldata = m_32x_display_dram[lineoffs]; length = ((coldata & 0xff00)>>8)+1; coldata = (coldata & 0x00ff)>>0; @@ -1671,7 +1671,7 @@ void sega_32x_device::_32x_render_videobuffer_to_screenbuffer_helper(int scanlin } else // MODE 2 - 15bpp mode, not used by any commercial games? { - UINT32 lineoffs; + uint32_t lineoffs; int start; lineoffs = m_32x_display_dram[scanline]; @@ -1682,7 +1682,7 @@ void sega_32x_device::_32x_render_videobuffer_to_screenbuffer_helper(int scanlin x = start; while (x<320) { - UINT16 coldata; + uint16_t coldata; coldata = m_32x_display_dram[lineoffs&0xffff]; // need to swap red and blue around for MAME @@ -1706,7 +1706,7 @@ void sega_32x_device::_32x_render_videobuffer_to_screenbuffer_helper(int scanlin } } -void sega_32x_device::_32x_render_videobuffer_to_screenbuffer(int x, UINT32 priority, UINT16 &lineptr) +void sega_32x_device::_32x_render_videobuffer_to_screenbuffer(int x, uint32_t priority, uint16_t &lineptr) { if (m_32x_displaymode != 0) { @@ -1827,14 +1827,14 @@ void sega_32x_device::device_start() m_32x_pwm_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega_32x_device::handle_pwm_callback), this)); m_32x_pwm_timer->adjust(attotime::never); - m_32x_dram0 = std::make_unique(0x40000/2); - m_32x_dram1 = std::make_unique(0x40000/2); + m_32x_dram0 = std::make_unique(0x40000/2); + m_32x_dram1 = std::make_unique(0x40000/2); memset(m_32x_dram0.get(), 0x00, 0x40000); memset(m_32x_dram1.get(), 0x00, 0x40000); - m_32x_palette_lookup = std::make_unique(0x200/2); - m_32x_palette = std::make_unique(0x200/2); + m_32x_palette_lookup = std::make_unique(0x200/2); + m_32x_palette = std::make_unique(0x200/2); memset(m_32x_palette_lookup.get(), 0x00, 0x200); memset(m_32x_palette.get(), 0x00, 0x200); @@ -1920,7 +1920,7 @@ void sega_32x_device::device_reset() m_master_cpu->sh2drc_set_options(SH2DRC_COMPATIBLE_OPTIONS); m_slave_cpu->sh2drc_set_options(SH2DRC_COMPATIBLE_OPTIONS); - UINT32 *cart = (UINT32 *)memregion(":gamecart_sh2")->base(); + uint32_t *cart = (uint32_t *)memregion(":gamecart_sh2")->base(); m_master_cpu->sh2drc_add_fastram(0x06000000, 0x0603ffff, 0, &m_sh2_shared[0]); m_master_cpu->sh2drc_add_fastram(0x02000000, 0x023fffff, 0, cart); @@ -1933,8 +1933,8 @@ void sega_32x_device::device_reset() // install these now, otherwise we'll get the following (incorrect) warnings on startup.. // SH-2 device ':sega32x:32x_slave_sh2': program space memory map entry 0-3FFF references non-existant region ':slave' // SH-2 device ':sega32x:32x_master_sh2': program space memory map entry 0-3FFF references non-existant region ':master' - UINT8* masterbios = (UINT8*)machine().root_device().memregion(":master")->base(); - UINT8* slavebios = (UINT8*)machine().root_device().memregion(":slave")->base(); + uint8_t* masterbios = (uint8_t*)machine().root_device().memregion(":master")->base(); + uint8_t* slavebios = (uint8_t*)machine().root_device().memregion(":slave")->base(); membank("masterbios")->configure_entries(0, 1, masterbios, 0x4000); membank("slavebios")->configure_entries(0, 1, slavebios, 0x4000); membank("masterbios")->set_entry(0); diff --git a/src/mame/machine/mega32x.h b/src/mame/machine/mega32x.h index 92e51c20187..6615af0da98 100644 --- a/src/mame/machine/mega32x.h +++ b/src/mame/machine/mega32x.h @@ -31,14 +31,14 @@ class sega_32x_device : public device_t { public: - sega_32x_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); + sega_32x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); required_device m_master_cpu; required_device m_slave_cpu; required_device m_ldac; required_device m_rdac; - required_shared_ptr m_sh2_shared; + required_shared_ptr m_sh2_shared; void pause_cpu(); @@ -119,7 +119,7 @@ public: SH2_DMA_FIFO_DATA_AVAILABLE_CB(_32x_fifo_available_callback); void _32x_render_videobuffer_to_screenbuffer_helper(int scanline); - void _32x_render_videobuffer_to_screenbuffer(int x, UINT32 priority, UINT16 &lineptr); + void _32x_render_videobuffer_to_screenbuffer(int x, uint32_t priority, uint16_t &lineptr); int sh2_master_pwmint_enable, sh2_slave_pwmint_enable; void _32x_check_framebuffer_swap(bool enabled); @@ -131,19 +131,19 @@ public: int m_32x_vblank_flag; int m_sh2_are_running; int m_32x_240mode; - UINT16 m_32x_a1518a_reg; + uint16_t m_32x_a1518a_reg; TIMER_CALLBACK_MEMBER(handle_pwm_callback); void calculate_pwm_timer(); - UINT16 m_pwm_ctrl, m_pwm_cycle, m_pwm_tm_reg; - UINT16 m_cur_lch[0x10],m_cur_rch[0x10]; - UINT16 m_pwm_cycle_reg; //used for latching - UINT8 m_pwm_timer_tick; - UINT8 m_lch_index_r, m_rch_index_r, m_lch_index_w, m_rch_index_w; - UINT16 m_lch_fifo_state, m_rch_fifo_state; + uint16_t m_pwm_ctrl, m_pwm_cycle, m_pwm_tm_reg; + uint16_t m_cur_lch[0x10],m_cur_rch[0x10]; + uint16_t m_pwm_cycle_reg; //used for latching + uint8_t m_pwm_timer_tick; + uint8_t m_lch_index_r, m_rch_index_r, m_lch_index_w, m_rch_index_w; + uint16_t m_lch_fifo_state, m_rch_fifo_state; - UINT16 get_hposition(void); + uint16_t get_hposition(void); emu_timer *m_32x_pwm_timer; @@ -159,14 +159,14 @@ private: int m_32x_displaymode; int m_32x_videopriority; - UINT32 m_32x_linerender[320+258]; // tmp buffer (bigger than it needs to be to simplify RLE decode) + uint32_t m_32x_linerender[320+258]; // tmp buffer (bigger than it needs to be to simplify RLE decode) // virtual void device_config_complete(); int m_32x_adapter_enabled; int m_32x_access_auth; int m_32x_screenshift; - UINT16 m_32x_68k_a15104_reg; + uint16_t m_32x_68k_a15104_reg; int m_sh2_master_vint_enable, m_sh2_slave_vint_enable; int m_sh2_master_hint_enable, m_sh2_slave_hint_enable; int m_sh2_master_cmdint_enable, m_sh2_slave_cmdint_enable; @@ -176,14 +176,14 @@ private: int m_32x_fb_swap; int m_32x_hcount_reg; - UINT16 m_32x_autofill_length; - UINT16 m_32x_autofill_address; - UINT16 m_32x_autofill_data; - UINT16 m_a15106_reg; - UINT16 m_dreq_src_addr[2],m_dreq_dst_addr[2],m_dreq_size; - UINT8 m_sega_tv; - UINT16 m_hint_vector[2]; - UINT16 m_a15100_reg; + uint16_t m_32x_autofill_length; + uint16_t m_32x_autofill_address; + uint16_t m_32x_autofill_data; + uint16_t m_a15106_reg; + uint16_t m_dreq_src_addr[2],m_dreq_dst_addr[2],m_dreq_size; + uint8_t m_sega_tv; + uint16_t m_hint_vector[2]; + uint16_t m_a15100_reg; int m_32x_68k_a15102_reg; int m_32x_pal; @@ -191,18 +191,18 @@ private: int m_base_total_scanlines; int m_total_scanlines; - UINT16 m_commsram[8]; + uint16_t m_commsram[8]; - std::unique_ptr m_32x_dram0; - std::unique_ptr m_32x_dram1; - UINT16 *m_32x_display_dram, *m_32x_access_dram; - std::unique_ptr m_32x_palette; - std::unique_ptr m_32x_palette_lookup; + std::unique_ptr m_32x_dram0; + std::unique_ptr m_32x_dram1; + uint16_t *m_32x_display_dram, *m_32x_access_dram; + std::unique_ptr m_32x_palette; + std::unique_ptr m_32x_palette_lookup; - UINT16 m_fifo_block_a[4]; - UINT16 m_fifo_block_b[4]; - UINT16* m_current_fifo_block; - UINT16* m_current_fifo_readblock; + uint16_t m_fifo_block_a[4]; + uint16_t m_fifo_block_b[4]; + uint16_t* m_current_fifo_block; + uint16_t* m_current_fifo_readblock; int m_current_fifo_write_pos; int m_current_fifo_read_pos; int m_fifo_block_a_full; @@ -215,14 +215,14 @@ private: class sega_32x_ntsc_device : public sega_32x_device { public: - sega_32x_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_32x_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sega_32x_pal_device : public sega_32x_device { public: - sega_32x_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_32x_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; }; diff --git a/src/mame/machine/megacd.cpp b/src/mame/machine/megacd.cpp index b393a11a2cc..42caa03fc38 100644 --- a/src/mame/machine/megacd.cpp +++ b/src/mame/machine/megacd.cpp @@ -289,7 +289,7 @@ machine_config_constructor sega_segacd_device::device_mconfig_additions() const } -sega_segacd_device::sega_segacd_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) +sega_segacd_device::sega_segacd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_gfx_interface(mconfig, *this, GFXDECODE_NAME( segacd )), m_scdcpu(*this, "segacd_68k"), @@ -305,26 +305,26 @@ sega_segacd_device::sega_segacd_device(const machine_config &mconfig, device_typ { } -sega_segacd_us_device::sega_segacd_us_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_segacd_us_device::sega_segacd_us_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega_segacd_device(mconfig, SEGA_SEGACD_US, "sega_segacd_us", tag, owner, clock, "sega_segacd_us", __FILE__) { } -sega_segacd_japan_device::sega_segacd_japan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_segacd_japan_device::sega_segacd_japan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega_segacd_device(mconfig, SEGA_SEGACD_JAPAN, "sega_segacd_japan", tag, owner, clock, "sega_segacd_japan", __FILE__) { } -sega_segacd_europe_device::sega_segacd_europe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_segacd_europe_device::sega_segacd_europe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega_segacd_device(mconfig, SEGA_SEGACD_EUROPE, "sega_segacd_europe", tag, owner, clock, "sega_segacd_europe", __FILE__) { } -inline void sega_segacd_device::write_pixel(UINT8 pix, int pixeloffset) +inline void sega_segacd_device::write_pixel(uint8_t pix, int pixeloffset) { int shift = 12-(4*(pixeloffset&0x3)); - UINT16 datamask = (0x000f) << shift; + uint16_t datamask = (0x000f) << shift; int offset = pixeloffset>>3; if (pixeloffset&4) offset++; @@ -368,7 +368,7 @@ inline void sega_segacd_device::write_pixel(UINT8 pix, int pixeloffset) // Wily Beamish and Citizen X appear to rely on this // however, it breaks the megacdj bios (megacd2j still works!) // (maybe that's a timing issue instead?) -UINT16 sega_segacd_device::segacd_1meg_mode_word_read(int offset, UINT16 mem_mask) +uint16_t sega_segacd_device::segacd_1meg_mode_word_read(int offset, uint16_t mem_mask) { offset *= 2; @@ -381,7 +381,7 @@ UINT16 sega_segacd_device::segacd_1meg_mode_word_read(int offset, UINT16 mem_mas } -void sega_segacd_device::segacd_1meg_mode_word_write(int offset, UINT16 data, UINT16 mem_mask, int use_pm) +void sega_segacd_device::segacd_1meg_mode_word_write(int offset, uint16_t data, uint16_t mem_mask, int use_pm) { offset *= 2; @@ -444,7 +444,7 @@ void sega_segacd_device::segacd_1meg_mode_word_write(int offset, UINT16 data, UI WRITE16_MEMBER( sega_segacd_device::scd_a12000_halt_reset_w ) { - UINT16 old_halt = m_a12000_halt_reset_reg; + uint16_t old_halt = m_a12000_halt_reset_reg; COMBINE_DATA(&m_a12000_halt_reset_reg); @@ -714,14 +714,14 @@ WRITE16_MEMBER( sega_segacd_device::segacd_comms_flags_maincpu_w ) READ16_MEMBER( sega_segacd_device::scd_4m_prgbank_ram_r ) { - UINT16 realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset; + uint16_t realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset; return m_prgram[realoffset]; } WRITE16_MEMBER( sega_segacd_device::scd_4m_prgbank_ram_w ) { - UINT16 realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset; + uint16_t realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset; // todo: // check for write protection? (or does that only apply to writes on the SubCPU side? @@ -1032,7 +1032,7 @@ TILE_GET_INFO_MEMBER( sega_segacd_device::get_stampmap_32x32_16x16_tile_info ) // non-tilemap functions to get a pixel from a 'tilemap' based on the above, but looking up each pixel, as to avoid the heavy cache bitmap -inline UINT8 sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos) +inline uint8_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos) { const int tilesize = 4; // 0xf pixels const int tilemapsize = 0x0f; @@ -1066,11 +1066,11 @@ inline UINT8 sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos if (tileno==0) return 0x00; - const UINT8* srcdata = gfx(tile_region)->get_data(tileno); + const uint8_t* srcdata = gfx(tile_region)->get_data(tileno); return srcdata[((ypos&((1<get_data(tileno); + const uint8_t* srcdata = gfx(tile_region)->get_data(tileno); return srcdata[((ypos&((1<get_data(tileno); + const uint8_t* srcdata = gfx(tile_region)->get_data(tileno); return srcdata[((ypos&((1<get_data(tileno); + const uint8_t* srcdata = gfx(tile_region)->get_data(tileno); return srcdata[((ypos&((1<time_elapsed() * ATTOSECONDS_TO_HZ(ATTOSECONDS_IN_USEC(30.72))).as_double(); + int32_t result = (m_stopwatch_timer->time_elapsed() * ATTOSECONDS_TO_HZ(ATTOSECONDS_IN_USEC(30.72))).as_double(); return result & 0xfff; } @@ -1209,7 +1209,7 @@ READ16_MEMBER( sega_segacd_device::segacd_stopwatch_timer_r ) READ16_MEMBER( sega_segacd_device::segacd_sub_led_ready_r ) { - UINT16 retdata = 0x0000; + uint16_t retdata = 0x0000; if (ACCESSING_BITS_0_7) { @@ -1265,7 +1265,7 @@ READ16_MEMBER( sega_segacd_device::segacd_sub_dataram_part1_r ) else if ((scd_rammode&2)==RAM_MODE_1MEG) { // printf("Unspported: segacd_sub_dataram_part1_r in mode 1 (Word RAM Expander - 1 Byte Per Pixel)\n"); - UINT16 data; + uint16_t data; if (scd_rammode&1) { @@ -1388,7 +1388,7 @@ WRITE16_MEMBER( sega_segacd_device::segacd_sub_dataram_part2_w ) READ16_MEMBER( sega_segacd_device::segacd_stampsize_r ) { - UINT16 retdata = 0x0000; + uint16_t retdata = 0x0000; retdata |= segacd_conversion_active<<15; @@ -1428,7 +1428,7 @@ WRITE16_MEMBER( sega_segacd_device::segacd_stampsize_w ) // the lower 3 bits of segacd_imagebuffer_hdot_size are set // this really needs to be doing it's own lookups rather than depending on the inefficient MAME cache.. -inline UINT8 sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y) +inline uint8_t sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y) { /* if (!srcbitmap) @@ -1439,7 +1439,7 @@ inline UINT8 sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitma if (x >= srcbitmap->width) return 0; if (y >= srcbitmap->height) return 0; - UINT16* cacheptr = &srcbitmap->pix16(y, x); + uint16_t* cacheptr = &srcbitmap->pix16(y, x); return cacheptr[0] & 0xf; */ @@ -1487,15 +1487,15 @@ WRITE16_MEMBER( sega_segacd_device::segacd_trace_vector_base_address_w ) int line; //bitmap_ind16 *srcbitmap = segacd_stampmap[segacd_get_active_stampmap_tilemap(->pixmap()]); bitmap_ind16 *srcbitmap = nullptr; - UINT32 bufferstart = ((segacd_imagebuffer_start_address&0xfff8)*2)<<3; + uint32_t bufferstart = ((segacd_imagebuffer_start_address&0xfff8)*2)<<3; for (line=0;line>1]; tilemapyoffs = m_dataram[(currbase+0x2)>>1]; @@ -1511,7 +1511,7 @@ WRITE16_MEMBER( sega_segacd_device::segacd_trace_vector_base_address_w ) for (count=0;count<(segacd_imagebuffer_hdot_size);count++) { //int i; - UINT8 pix = 0x0; + uint8_t pix = 0x0; pix = read_pixel_from_stampmap(srcbitmap, xbase>>(3+8), ybase>>(3+8)); @@ -1524,7 +1524,7 @@ WRITE16_MEMBER( sega_segacd_device::segacd_trace_vector_base_address_w ) int countx = count + (segacd_imagebuffer_offset&0x7); - UINT32 offset; + uint32_t offset; offset = bufferstart+((((segacd_imagebuffer_vcell_size+1)*0x10)*(countx>>3))<<3); @@ -1670,7 +1670,7 @@ READ16_MEMBER( sega_segacd_device::font_converted_r ) { int scbg = (m_font_color & 0x0f); int scfg = (m_font_color & 0xf0)>>4; - UINT16 retdata = 0; + uint16_t retdata = 0; int bit; for (bit=0;bit<4;bit++) @@ -1812,10 +1812,10 @@ TIMER_DEVICE_CALLBACK_MEMBER( sega_segacd_device::dma_timer_callback ) } // todo: tidy up, too many CDC internals here -void sega_segacd_device::SegaCD_CDC_Do_DMA(int &dmacount, UINT8 *CDC_BUFFER, UINT16 &dma_addrc, UINT16 &destination ) +void sega_segacd_device::SegaCD_CDC_Do_DMA(int &dmacount, uint8_t *CDC_BUFFER, uint16_t &dma_addrc, uint16_t &destination ) { int length = dmacount; - UINT16 *dest; + uint16_t *dest; int srcoffset = 0; int dstoffset = 0; address_space& space = m_scdcpu->space(AS_PROGRAM); @@ -1835,7 +1835,7 @@ void sega_segacd_device::SegaCD_CDC_Do_DMA(int &dmacount, UINT8 *CDC_BUFFER, UIN while (dmacount--) { - UINT16 data = (CDC_BUFFER[dma_addrc+srcoffset]<<8) | CDC_BUFFER[dma_addrc+srcoffset+1]; + uint16_t data = (CDC_BUFFER[dma_addrc+srcoffset]<<8) | CDC_BUFFER[dma_addrc+srcoffset+1]; if (destination==DMA_PRG) { diff --git a/src/mame/machine/megacd.h b/src/mame/machine/megacd.h index 5823c0bd02c..2b96d96417f 100644 --- a/src/mame/machine/megacd.h +++ b/src/mame/machine/megacd.h @@ -42,7 +42,7 @@ class sega_segacd_device : public device_t, public device_gfx_interface { public: - sega_segacd_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); + sega_segacd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); required_device m_scdcpu; required_device m_rfsnd; @@ -53,59 +53,59 @@ public: required_device m_dma_timer; //required_device m_hock_timer; - required_shared_ptr m_prgram; - required_shared_ptr m_dataram; - required_shared_ptr m_font_bits; + required_shared_ptr m_prgram; + required_shared_ptr m_dataram; + required_shared_ptr m_font_bits; // can't use a memshare because it's 8-bit RAM in a 16-bit address space - std::vector m_backupram; + std::vector m_backupram; - UINT8 m_font_color; + uint8_t m_font_color; - UINT16 scd_rammode; - UINT32 scd_mode_dmna_ret_flags ; + uint16_t scd_rammode; + uint32_t scd_mode_dmna_ret_flags ; tilemap_t *segacd_stampmap[4]; - UINT8 segacd_ram_writeprotect_bits; + uint8_t segacd_ram_writeprotect_bits; int segacd_4meg_prgbank;// = 0; // which bank the MainCPU can see of the SubCPU PrgRAM int segacd_memory_priority_mode;// = 0; int segacd_stampsize; - UINT16 segacd_hint_register; - UINT16 segacd_imagebuffer_vdot_size; - UINT16 segacd_imagebuffer_vcell_size; - UINT16 segacd_imagebuffer_hdot_size; + uint16_t segacd_hint_register; + uint16_t segacd_imagebuffer_vdot_size; + uint16_t segacd_imagebuffer_vcell_size; + uint16_t segacd_imagebuffer_hdot_size; int segacd_conversion_active;// = 0; - UINT16 segacd_stampmap_base_address; - UINT16 segacd_imagebuffer_start_address; - UINT16 segacd_imagebuffer_offset; + uint16_t segacd_stampmap_base_address; + uint16_t segacd_imagebuffer_start_address; + uint16_t segacd_imagebuffer_offset; - UINT16 segacd_comms_flags;// = 0x0000; - UINT16 segacd_comms_part1[0x8]; - UINT16 segacd_comms_part2[0x8]; + uint16_t segacd_comms_flags;// = 0x0000; + uint16_t segacd_comms_part1[0x8]; + uint16_t segacd_comms_part2[0x8]; int segacd_redled;// = 0; int segacd_greenled;// = 0; int segacd_ready;// = 1; // actually set 100ms after startup? - UINT8 m_irq3_timer_reg; + uint8_t m_irq3_timer_reg; TIMER_DEVICE_CALLBACK_MEMBER( irq3_timer_callback ); TIMER_DEVICE_CALLBACK_MEMBER( stamp_timer_callback ); - inline void write_pixel(UINT8 pix, int pixeloffset); - UINT16 segacd_1meg_mode_word_read(int offset, UINT16 mem_mask); - void segacd_1meg_mode_word_write(int offset, UINT16 data, UINT16 mem_mask, int use_pm); + inline void write_pixel(uint8_t pix, int pixeloffset); + uint16_t segacd_1meg_mode_word_read(int offset, uint16_t mem_mask); + void segacd_1meg_mode_word_write(int offset, uint16_t data, uint16_t mem_mask, int use_pm); DECLARE_READ16_MEMBER( segacd_dmaaddr_r ); DECLARE_WRITE16_MEMBER( segacd_dmaaddr_w ); - UINT16 m_dmaaddr; + uint16_t m_dmaaddr; - UINT16 m_a12000_halt_reset_reg; + uint16_t m_a12000_halt_reset_reg; int m_framerate; int m_base_total_scanlines; @@ -129,10 +129,10 @@ public: TILE_GET_INFO_MEMBER( get_stampmap_16x16_16x16_tile_info ); TILE_GET_INFO_MEMBER( get_stampmap_32x32_16x16_tile_info ); - UINT8 get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos); - UINT8 get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos); - UINT8 get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos); - UINT8 get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos); + uint8_t get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos); + uint8_t get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos); + uint8_t get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos); + uint8_t get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos); WRITE16_MEMBER( scd_a12000_halt_reset_w ); READ16_MEMBER( scd_a12000_halt_reset_r ); @@ -182,7 +182,7 @@ public: READ16_MEMBER( segacd_stampsize_r ); WRITE16_MEMBER( segacd_stampsize_w ); - UINT8 read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y); + uint8_t read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y); WRITE16_MEMBER( segacd_trace_vector_base_address_w ); READ16_MEMBER( segacd_imagebuffer_vdot_size_r ); @@ -207,7 +207,7 @@ public: TIMER_DEVICE_CALLBACK_MEMBER( dma_timer_callback ); IRQ_CALLBACK_MEMBER(segacd_sub_int_callback); - void SegaCD_CDC_Do_DMA( int &dmacount, UINT8 *CDC_BUFFER, UINT16 &dma_addrc, UINT16 &destination ); + void SegaCD_CDC_Do_DMA( int &dmacount, uint8_t *CDC_BUFFER, uint16_t &dma_addrc, uint16_t &destination ); protected: virtual void device_start() override; @@ -225,7 +225,7 @@ private: class sega_segacd_us_device : public sega_segacd_device { public: - sega_segacd_us_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_segacd_us_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: }; @@ -233,7 +233,7 @@ class sega_segacd_us_device : public sega_segacd_device class sega_segacd_japan_device : public sega_segacd_device { public: - sega_segacd_japan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_segacd_japan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // virtual machine_config_constructor device_mconfig_additions() const; }; @@ -241,7 +241,7 @@ class sega_segacd_japan_device : public sega_segacd_device class sega_segacd_europe_device : public sega_segacd_device { public: - sega_segacd_europe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_segacd_europe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // virtual machine_config_constructor device_mconfig_additions() const; }; diff --git a/src/mame/machine/megacdcd.cpp b/src/mame/machine/megacdcd.cpp index ca63439541e..2c49485424e 100644 --- a/src/mame/machine/megacdcd.cpp +++ b/src/mame/machine/megacdcd.cpp @@ -12,7 +12,7 @@ const device_type LC89510_TEMP = &device_creator; -lc89510_temp_device::lc89510_temp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lc89510_temp_device::lc89510_temp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LC89510_TEMP, "lc89510_temp_device", tag, owner, clock, "lc89510_temp", __FILE__) { segacd_dma_callback = segacd_dma_delegate(FUNC(lc89510_temp_device::Fake_CDC_Do_DMA), this); @@ -71,7 +71,7 @@ void lc89510_temp_device::set_is_neoCD(device_t &device, bool is_neoCD) } // HACK for DMA handling, this gets replaced -void lc89510_temp_device::Fake_CDC_Do_DMA(int &dmacount, UINT8 *CDC_BUFFER, UINT16 &dma_addrc, UINT16 &destination ) +void lc89510_temp_device::Fake_CDC_Do_DMA(int &dmacount, uint8_t *CDC_BUFFER, uint16_t &dma_addrc, uint16_t &destination ) { fatalerror("Fake_CDC_Do_DMA\n"); } @@ -192,7 +192,7 @@ void lc89510_temp_device::CDD_Export(bool neocd_hack) void lc89510_temp_device::CDD_GetStatus(void) { - UINT16 s = (CDD_STATUS & 0x0f00); + uint16_t s = (CDD_STATUS & 0x0f00); if ((s == 0x0200) || (s == 0x0700) || (s == 0x0e00)) CDD_STATUS = (SCD_STATUS & 0xff00) | (CDD_STATUS & 0x00ff); @@ -218,7 +218,7 @@ void lc89510_temp_device::CDD_Stop(running_machine &machine) void lc89510_temp_device::CDD_GetPos(void) { CLEAR_CDD_RESULT - UINT32 msf; + uint32_t msf; CDD_STATUS &= 0xFF; if(segacd.cd == nullptr) // no CD is there, bail out return; @@ -233,9 +233,9 @@ void lc89510_temp_device::CDD_GetTrackPos(void) { CLEAR_CDD_RESULT int elapsedlba; - UINT32 msf; + uint32_t msf; CDD_STATUS &= 0xFF; - // UINT32 end_msf = ; + // uint32_t end_msf = ; if(segacd.cd == nullptr) // no CD is there, bail out return; CDD_STATUS |= SCD_STATUS; @@ -266,8 +266,8 @@ void lc89510_temp_device::CDD_Length(void) return; CDD_STATUS |= SCD_STATUS; - UINT32 startlba = (segacd.toc->tracks[cdrom_get_last_track(segacd.cd)].logframeofs); - UINT32 startmsf = lba_to_msf_alt( startlba ); + uint32_t startlba = (segacd.toc->tracks[cdrom_get_last_track(segacd.cd)].logframeofs); + uint32_t startmsf = lba_to_msf_alt( startlba ); CDD_MIN = to_bcd((startmsf&0x00ff0000)>>16,false); CDD_SEC = to_bcd((startmsf&0x0000ff00)>>8,false); @@ -304,8 +304,8 @@ void lc89510_temp_device::CDD_GetTrackAdr(void) if (track < 1) track = 1; - UINT32 startlba = (segacd.toc->tracks[track-1].logframeofs); - UINT32 startmsf = lba_to_msf_alt( startlba+150 ); + uint32_t startlba = (segacd.toc->tracks[track-1].logframeofs); + uint32_t startmsf = lba_to_msf_alt( startlba+150 ); CDD_MIN = to_bcd((startmsf&0x00ff0000)>>16,false); CDD_SEC = to_bcd((startmsf&0x0000ff00)>>8,false); @@ -346,9 +346,9 @@ void lc89510_temp_device::CDD_GetTrackType(void) } -UINT32 lc89510_temp_device::getmsf_from_regs(void) +uint32_t lc89510_temp_device::getmsf_from_regs(void) { - UINT32 msf = 0; + uint32_t msf = 0; msf = ((CDD_TX[3] & 0xF) + (CDD_TX[2] & 0xF) * 10) << 16; msf |= ((CDD_TX[5] & 0xF) + (CDD_TX[4] & 0xF) * 10) << 8; @@ -360,11 +360,11 @@ UINT32 lc89510_temp_device::getmsf_from_regs(void) void lc89510_temp_device::CDD_Play(running_machine &machine) { CLEAR_CDD_RESULT - UINT32 msf = getmsf_from_regs(); + uint32_t msf = getmsf_from_regs(); SCD_CURLBA = msf_to_lba(msf)-150; if(segacd.cd == nullptr) // no CD is there, bail out return; - UINT32 end_msf = segacd.toc->tracks[ cdrom_get_track(segacd.cd, SCD_CURLBA) + 1 ].logframeofs; + uint32_t end_msf = segacd.toc->tracks[ cdrom_get_track(segacd.cd, SCD_CURLBA) + 1 ].logframeofs; SCD_CURTRK = cdrom_get_track(segacd.cd, SCD_CURLBA)+1; LC8951UpdateHeader(); SCD_STATUS = CDD_PLAYINGCDDA; @@ -385,7 +385,7 @@ void lc89510_temp_device::CDD_Play(running_machine &machine) void lc89510_temp_device::CDD_Seek(void) { CLEAR_CDD_RESULT - UINT32 msf = getmsf_from_regs(); + uint32_t msf = getmsf_from_regs(); SCD_CURLBA = msf_to_lba(msf)-150; if(segacd.cd == nullptr) // no CD is there, bail out return; @@ -524,9 +524,9 @@ void lc89510_temp_device::lc89510_Reset(void) void lc89510_temp_device::CDC_Do_DMA(running_machine& machine, int rate) { - UINT32 length; + uint32_t length; - UINT16 destination = CDC_REG0 & 0x0700; + uint16_t destination = CDC_REG0 & 0x0700; if (!(SCD_DMA_ENABLED)) return; @@ -550,7 +550,7 @@ void lc89510_temp_device::CDC_Do_DMA(running_machine& machine, int rate) int dmacount = length; - UINT16 dma_addrc = LC8951RegistersW[REG_W_DACL] | (LC8951RegistersW[REG_W_DACH]<<8); + uint16_t dma_addrc = LC8951RegistersW[REG_W_DACL] | (LC8951RegistersW[REG_W_DACH]<<8); // HACK segacd_dma_callback(dmacount, CDC_BUFFER, dma_addrc, destination ); @@ -571,9 +571,9 @@ void lc89510_temp_device::CDC_Do_DMA(running_machine& machine, int rate) -UINT16 lc89510_temp_device::CDC_Host_r(running_machine& machine, UINT16 type) +uint16_t lc89510_temp_device::CDC_Host_r(running_machine& machine, uint16_t type) { - UINT16 destination = CDC_REG0 & 0x0700; + uint16_t destination = CDC_REG0 & 0x0700; if (SCD_DMA_ENABLED) { @@ -592,9 +592,9 @@ UINT16 lc89510_temp_device::CDC_Host_r(running_machine& machine, UINT16 type) LC8951RegistersW[REG_W_DBCL] = dma_count_register & 0xff; LC8951RegistersW[REG_W_DBCH] = (dma_count_register>>8) & 0xff; - UINT16 dma_addrc = LC8951RegistersW[REG_W_DACL] | (LC8951RegistersW[REG_W_DACH]<<8); + uint16_t dma_addrc = LC8951RegistersW[REG_W_DACL] | (LC8951RegistersW[REG_W_DACH]<<8); - UINT16 data = (CDC_BUFFER[dma_addrc]<<8) | CDC_BUFFER[dma_addrc+1]; + uint16_t data = (CDC_BUFFER[dma_addrc]<<8) | CDC_BUFFER[dma_addrc+1]; dma_addrc += 2; LC8951RegistersW[REG_W_DACL] = dma_addrc & 0xff; LC8951RegistersW[REG_W_DACH] = (dma_addrc >> 8) & 0xff; @@ -610,13 +610,13 @@ UINT16 lc89510_temp_device::CDC_Host_r(running_machine& machine, UINT16 type) -UINT8 lc89510_temp_device::CDC_Reg_r(void) +uint8_t lc89510_temp_device::CDC_Reg_r(void) { int reg = CDC_REG0 & 0xF; - UINT8 ret = 0; + uint8_t ret = 0; - UINT16 decoderegs = 0x73F2; + uint16_t decoderegs = 0x73F2; if ((decoderegs>>reg)&1) CDC_DECODE |= (1 << reg); @@ -665,7 +665,7 @@ UINT8 lc89510_temp_device::CDC_Reg_r(void) return ret; } -void lc89510_temp_device::CDC_Reg_w(UINT8 data) +void lc89510_temp_device::CDC_Reg_w(uint8_t data) { int reg = CDC_REG0 & 0xF; @@ -843,7 +843,7 @@ WRITE16_MEMBER( lc89510_temp_device::segacd_cdc_data_w ) READ16_MEMBER( lc89510_temp_device::segacd_cdc_data_r ) { - UINT16 retdat = 0x0000; + uint16_t retdat = 0x0000; if (ACCESSING_BITS_0_7) retdat |= CDC_Reg_r(); @@ -874,7 +874,7 @@ WRITE16_MEMBER( lc89510_temp_device::segacd_irq_mask_w ) { if (ACCESSING_BITS_0_7) { - UINT16 control = CDD_CONTROL; + uint16_t control = CDD_CONTROL; // printf("segacd_irq_mask_w %04x %04x (CDD control is %04x)\n",data, mem_mask, control); @@ -910,7 +910,7 @@ WRITE16_MEMBER( lc89510_temp_device::segacd_cdd_ctrl_w ) { if (ACCESSING_BITS_0_7) { - UINT16 control = CDD_CONTROL; + uint16_t control = CDD_CONTROL; //printf("segacd_cdd_ctrl_w %04x %04x (control %04x irq %04x\n", data, mem_mask, control, segacd_irq_mask); @@ -938,9 +938,9 @@ WRITE16_MEMBER( lc89510_temp_device::segacd_cdd_ctrl_w ) // mapped as serial -UINT8 lc89510_temp_device::neocd_cdd_rx_r() +uint8_t lc89510_temp_device::neocd_cdd_rx_r() { - UINT8 ret = 0; + uint8_t ret = 0; if (NeoCDCommsWordCount >= 0 && NeoCDCommsWordCount < 10) { ret = CDD_RX[NeoCDCommsWordCount] & 0x0F; @@ -960,7 +960,7 @@ READ8_MEMBER( lc89510_temp_device::segacd_cdd_rx_r ) } // mapped as serial -void lc89510_temp_device::neocd_cdd_tx_w(UINT8 data) +void lc89510_temp_device::neocd_cdd_tx_w(uint8_t data) { //printf("neocd_cdd_tx_w %d, %02x\n", NeoCDCommsWordCount, data); @@ -1107,7 +1107,7 @@ void lc89510_temp_device::NeoCDCommsReset() -void lc89510_temp_device::NeoCDCommsControl(UINT8 clock, UINT8 send) +void lc89510_temp_device::NeoCDCommsControl(uint8_t clock, uint8_t send) { if (clock && !bNeoCDCommsClock) { NeoCDCommsWordCount++; @@ -1144,7 +1144,7 @@ void lc89510_temp_device::LC8951UpdateHeader() // neocd } else { // HEAD registers have header - UINT32 msf = lba_to_msf_alt(SCD_CURLBA+150); + uint32_t msf = lba_to_msf_alt(SCD_CURLBA+150); LC8951RegistersR[REG_R_HEAD0] = to_bcd (((msf & 0x00ff0000)>>16), true); // HEAD0 LC8951RegistersR[REG_R_HEAD1] = to_bcd (((msf & 0x0000ff00)>>8), true); // HEAD1 @@ -1319,14 +1319,14 @@ int lc89510_temp_device::Read_LBA_To_Buffer(running_machine& machine) -void lc89510_temp_device::nff0002_set(UINT16 wordValue) +void lc89510_temp_device::nff0002_set(uint16_t wordValue) { nff0002 = wordValue; } -void lc89510_temp_device::nff0016_set(UINT16 wordValue) +void lc89510_temp_device::nff0016_set(uint16_t wordValue) { nff0016 = wordValue; } -UINT16 lc89510_temp_device::nff0016_r(void) { return nff0016; } +uint16_t lc89510_temp_device::nff0016_r(void) { return nff0016; } diff --git a/src/mame/machine/megacdcd.h b/src/mame/machine/megacdcd.h index 743c7d1c5af..35f5cfc7e7f 100644 --- a/src/mame/machine/megacdcd.h +++ b/src/mame/machine/megacdcd.h @@ -5,7 +5,7 @@ #include "imagedev/chd_cd.h" -typedef device_delegate segacd_dma_delegate; +typedef device_delegate segacd_dma_delegate; typedef device_delegate interrupt_delegate; @@ -147,7 +147,7 @@ typedef device_delegate interrupt_delegate; class lc89510_temp_device : public device_t { public: - lc89510_temp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lc89510_temp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // HACK for DMA handling segacd_dma_delegate segacd_dma_callback; @@ -155,7 +155,7 @@ public: interrupt_delegate type2_interrupt_callback; interrupt_delegate type3_interrupt_callback; - void Fake_CDC_Do_DMA(int &dmacount, UINT8 *CDC_BUFFER, UINT16 &dma_addrc, UINT16 &destination ); + void Fake_CDC_Do_DMA(int &dmacount, uint8_t *CDC_BUFFER, uint16_t &dma_addrc, uint16_t &destination ); static void set_CDC_Do_DMA(device_t &device,segacd_dma_delegate new_segacd_dma_callback); void dummy_interrupt_callback(void); @@ -175,39 +175,39 @@ public: { cdrom_file *cd; const cdrom_toc *toc; - UINT32 current_frame; + uint32_t current_frame; }; segacd_t segacd; - UINT8 SCD_BUFFER[2560]; + uint8_t SCD_BUFFER[2560]; - UINT32 SCD_STATUS; - UINT32 SCD_STATUS_CDC; - INT32 SCD_CURLBA; - UINT8 SCD_CURTRK; + uint32_t SCD_STATUS; + uint32_t SCD_STATUS_CDC; + int32_t SCD_CURLBA; + uint8_t SCD_CURTRK; - UINT16 CDC_DECODE; - UINT16 CDC_REG0; - UINT16 CDC_REG1; + uint16_t CDC_DECODE; + uint16_t CDC_REG0; + uint16_t CDC_REG1; - UINT8 CDC_BUFFER[LC89510_EXTERNAL_BUFFER_SIZE]; + uint8_t CDC_BUFFER[LC89510_EXTERNAL_BUFFER_SIZE]; - UINT8 CDD_RX[10]; - UINT8 CDD_TX[10]; + uint8_t CDD_RX[10]; + uint8_t CDD_TX[10]; - UINT32 CDD_STATUS; - UINT32 CDD_MIN; - UINT32 CDD_SEC; - UINT32 CDD_FRAME; - UINT32 CDD_EXT; + uint32_t CDD_STATUS; + uint32_t CDD_MIN; + uint32_t CDD_SEC; + uint32_t CDD_FRAME; + uint32_t CDD_EXT; - UINT16 CDD_CONTROL; + uint16_t CDD_CONTROL; - INT16 CDD_DONE; + int16_t CDD_DONE; inline int to_bcd(int val, bool byte); void set_data_audio_mode(void); @@ -226,7 +226,7 @@ public: void CDD_FirstLast(void); void CDD_GetTrackAdr(void); void CDD_GetTrackType(void); - UINT32 getmsf_from_regs(void); + uint32_t getmsf_from_regs(void); void CDD_Play(running_machine &machine); void CDD_Seek(void); void CDD_Pause(running_machine &machine); @@ -242,9 +242,9 @@ public: void lc89510_Reset(void); void CDC_End_Transfer(running_machine& machine); void CDC_Do_DMA(running_machine& machine, int rate); - UINT16 CDC_Host_r(running_machine& machine, UINT16 type); - UINT8 CDC_Reg_r(void); - void CDC_Reg_w(UINT8 data); + uint16_t CDC_Host_r(running_machine& machine, uint16_t type); + uint8_t CDC_Reg_r(void); + void CDC_Reg_w(uint8_t data); void CDD_Process(running_machine& machine, int reason); void CDD_Handle_TOC_Commands(void); bool CDD_Import(running_machine& machine); @@ -268,42 +268,42 @@ public: TIMER_DEVICE_CALLBACK_MEMBER( segacd_access_timer_callback ); - UINT16 get_segacd_irq_mask(void) { return segacd_irq_mask; } - UINT16 segacd_irq_mask; + uint16_t get_segacd_irq_mask(void) { return segacd_irq_mask; } + uint16_t segacd_irq_mask; cdda_device* m_cdda; /* NeoCD */ - UINT16 nff0002; - UINT16 nff0016; + uint16_t nff0002; + uint16_t nff0016; - INT32 LC8951RegistersR[16]; - INT32 LC8951RegistersW[16]; + int32_t LC8951RegistersR[16]; + int32_t LC8951RegistersW[16]; bool bNeoCDCommsClock; - INT32 NeoCDCommsWordCount; + int32_t NeoCDCommsWordCount; - INT32 NeoCD_StatusHack; + int32_t NeoCD_StatusHack; - void NeoCDCommsControl(UINT8 clock, UINT8 send); + void NeoCDCommsControl(uint8_t clock, uint8_t send); void LC8951UpdateHeader(); char* LC8915InitTransfer(int NeoCDDMACount); void LC8915EndTransfer(); - void neocd_cdd_tx_w(UINT8 data); - UINT8 neocd_cdd_rx_r(); + void neocd_cdd_tx_w(uint8_t data); + uint8_t neocd_cdd_rx_r(); void NeoCDCommsReset(); - UINT16 nff0016_r(void); - void nff0016_set(UINT16 wordValue); - void nff0002_set(UINT16 wordValue); + uint16_t nff0016_r(void); + void nff0016_set(uint16_t wordValue); + void nff0002_set(uint16_t wordValue); protected: virtual void device_start() override; diff --git a/src/mame/machine/megadriv.cpp b/src/mame/machine/megadriv.cpp index 25449375a16..6f811e4f439 100644 --- a/src/mame/machine/megadriv.cpp +++ b/src/mame/machine/megadriv.cpp @@ -42,7 +42,7 @@ void megadriv_z80_clear(running_machine &machine) state->m_z80snd->set_input_line(0, CLEAR_LINE); } -void md_base_state::megadriv_z80_bank_w(UINT16 data) +void md_base_state::megadriv_z80_bank_w(uint16_t data) { m_genz80.z80_bank_addr = ((m_genz80.z80_bank_addr >> 1) | (data << 23)) & 0xff8000; } @@ -206,7 +206,7 @@ void md_base_state::megadrive_reset_io() READ8_MEMBER(md_base_state::megadrive_io_read_data_port_6button) { int portnum = offset; - UINT8 retdata, helper = (m_megadrive_io_ctrl_regs[portnum] & 0x3f) | 0xc0; // bits 6 & 7 always come from m_megadrive_io_data_regs + uint8_t retdata, helper = (m_megadrive_io_ctrl_regs[portnum] & 0x3f) | 0xc0; // bits 6 & 7 always come from m_megadrive_io_data_regs if (m_megadrive_io_data_regs[portnum] & 0x40) { @@ -257,7 +257,7 @@ READ8_MEMBER(md_base_state::megadrive_io_read_data_port_6button) READ8_MEMBER(md_base_state::megadrive_io_read_data_port_3button) { int portnum = offset; - UINT8 retdata, helper = (m_megadrive_io_ctrl_regs[portnum] & 0x7f) | 0x80; // bit 7 always comes from m_megadrive_io_data_regs + uint8_t retdata, helper = (m_megadrive_io_ctrl_regs[portnum] & 0x7f) | 0x80; // bit 7 always comes from m_megadrive_io_data_regs if (m_megadrive_io_data_regs[portnum] & 0x40) { @@ -276,28 +276,28 @@ READ8_MEMBER(md_base_state::megadrive_io_read_data_port_3button) return retdata; } -UINT8 md_base_state::megadrive_io_read_ctrl_port(int portnum) +uint8_t md_base_state::megadrive_io_read_ctrl_port(int portnum) { - UINT8 retdata; + uint8_t retdata; retdata = m_megadrive_io_ctrl_regs[portnum]; //osd_printf_debug("read io ctrl port %d %02x\n",portnum,retdata); return retdata | (retdata << 8); } -UINT8 md_base_state::megadrive_io_read_tx_port(int portnum) +uint8_t md_base_state::megadrive_io_read_tx_port(int portnum) { - UINT8 retdata; + uint8_t retdata; retdata = m_megadrive_io_tx_regs[portnum]; return retdata | (retdata << 8); } -UINT8 md_base_state::megadrive_io_read_rx_port(int portnum) +uint8_t md_base_state::megadrive_io_read_rx_port(int portnum) { return 0x00; } -UINT8 md_base_state::megadrive_io_read_sctrl_port(int portnum) +uint8_t md_base_state::megadrive_io_read_sctrl_port(int portnum) { return 0x00; } @@ -305,7 +305,7 @@ UINT8 md_base_state::megadrive_io_read_sctrl_port(int portnum) READ16_MEMBER(md_base_state::megadriv_68k_io_read ) { - UINT8 retdata; + uint8_t retdata; retdata = 0; /* Charles MacDonald ( http://cgfm2.emuviews.com/ ) @@ -394,22 +394,22 @@ WRITE16_MEMBER(md_base_state::megadrive_io_write_data_port_6button) /*************************** 3 buttons version ****************************/ -void md_base_state::megadrive_io_write_ctrl_port(int portnum, UINT16 data) +void md_base_state::megadrive_io_write_ctrl_port(int portnum, uint16_t data) { m_megadrive_io_ctrl_regs[portnum] = data; // osd_printf_debug("Setting IO Control Register #%d data %04x\n",portnum,data); } -void md_base_state::megadrive_io_write_tx_port(int portnum, UINT16 data) +void md_base_state::megadrive_io_write_tx_port(int portnum, uint16_t data) { m_megadrive_io_tx_regs[portnum] = data; } -void md_base_state::megadrive_io_write_rx_port(int portnum, UINT16 data) +void md_base_state::megadrive_io_write_rx_port(int portnum, uint16_t data) { } -void md_base_state::megadrive_io_write_sctrl_port(int portnum, UINT16 data) +void md_base_state::megadrive_io_write_sctrl_port(int portnum, uint16_t data) { } @@ -532,7 +532,7 @@ WRITE16_MEMBER(md_base_state::megadriv_68k_write_z80_ram ) READ16_MEMBER(md_base_state::megadriv_68k_check_z80_bus ) { - UINT16 retvalue; + uint16_t retvalue; /* Double Dragon, Shadow of the Beast, Super Off Road, and Time Killers have buggy sound programs. They request the bus, then have a loop which waits for the bus @@ -541,7 +541,7 @@ READ16_MEMBER(md_base_state::megadriv_68k_check_z80_bus ) the value is never zero. Time Killers is the most fussy, and doesn't like the read_next_instruction function from system16, so I just return a random value in the unused bits */ - UINT16 nextvalue = space.machine().rand();//read_next_instruction(space)&0xff00; + uint16_t nextvalue = space.machine().rand();//read_next_instruction(space)&0xff00; /* Check if the 68k has the z80 bus */ @@ -694,7 +694,7 @@ WRITE16_MEMBER(md_base_state::megadriv_68k_req_z80_reset ) READ8_MEMBER(md_base_state::z80_read_68k_banked_data ) { address_space &space68k = m_maincpu->space(); - UINT8 ret = space68k.read_byte(m_genz80.z80_bank_addr+offset); + uint8_t ret = space68k.read_byte(m_genz80.z80_bank_addr+offset); return ret; } @@ -755,13 +755,13 @@ static ADDRESS_MAP_START( megadriv_z80_io_map, AS_IO, 8, md_base_state ) AM_RANGE(0x0000, 0xff) AM_NOP ADDRESS_MAP_END -UINT32 md_base_state::screen_update_megadriv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t md_base_state::screen_update_megadriv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { /* Copy our screen buffer here */ for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - UINT32* desty = &bitmap.pix32(y, 0); - UINT16* srcy; + uint32_t* desty = &bitmap.pix32(y, 0); + uint16_t* srcy; if (!m_vdp->m_use_alt_timing) srcy = &m_vdp->m_render_bitmap->pix(y, 0); @@ -770,7 +770,7 @@ UINT32 md_base_state::screen_update_megadriv(screen_device &screen, bitmap_rgb32 for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - UINT16 src = srcy[x]; + uint16_t src = srcy[x]; desty[x] = rgb_t(pal5bit(src >> 10), pal5bit(src >> 5), pal5bit(src >> 0)); } } @@ -997,7 +997,7 @@ void md_base_state::megadriv_init_common() if (m_z80snd) { //printf("GENESIS Sound Z80 cpu found '%s'\n", machine().device("genesis_snd_z80")->tag()); - m_genz80.z80_prgram = std::make_unique(0x2000); + m_genz80.z80_prgram = std::make_unique(0x2000); membank("bank1")->set_base(m_genz80.z80_prgram.get()); save_item(NAME(m_genz80.z80_is_reset)); save_item(NAME(m_genz80.z80_has_bus)); diff --git a/src/mame/machine/meters.cpp b/src/mame/machine/meters.cpp index c948d0f77bf..178a08ed853 100644 --- a/src/mame/machine/meters.cpp +++ b/src/mame/machine/meters.cpp @@ -17,7 +17,7 @@ const device_type METERS = &device_creator; -meters_device::meters_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +meters_device::meters_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, METERS, "Electro mechanical meters", tag, owner, clock, "meters", __FILE__), m_number_mtr(0) { @@ -42,7 +42,7 @@ void meters_device::device_start() m_meter_info[i].meter_timer = timer_alloc(i); m_meter_info[i].meter_timer->reset(); - //save_item(NAME(m_meter_info[i].reacttime), i); //enable if void ReactTime(int id, INT32 cycles) gets used + //save_item(NAME(m_meter_info[i].reacttime), i); //enable if void ReactTime(int id, int32_t cycles) gets used save_item(NAME(m_meter_info[i].state), i); save_item(NAME(m_meter_info[i].count), i); save_item(NAME(m_meter_info[i].on), i); @@ -79,7 +79,7 @@ int meters_device::GetNumberMeters(void) // currently unused /////////////////////////////////////////////////////////////////////////// -void meters_device::Setcount(int id, INT32 count) // currently unused +void meters_device::Setcount(int id, int32_t count) // currently unused { if ( id >= m_number_mtr ) return; @@ -89,9 +89,9 @@ void meters_device::Setcount(int id, INT32 count) // currently unused /////////////////////////////////////////////////////////////////////////// -INT32 meters_device::Getcount(int id) // currently unused +int32_t meters_device::Getcount(int id) // currently unused { - INT32 result = 0; + int32_t result = 0; if ( id < m_number_mtr ) result = m_meter_info[id].count; @@ -101,7 +101,7 @@ INT32 meters_device::Getcount(int id) // currently unused /////////////////////////////////////////////////////////////////////////// -void meters_device::ReactTime(int id, INT32 cycles) // currently unused +void meters_device::ReactTime(int id, int32_t cycles) // currently unused { if ( id >= m_number_mtr ) return; diff --git a/src/mame/machine/meters.h b/src/mame/machine/meters.h index 99e440d8c39..3233789a481 100644 --- a/src/mame/machine/meters.h +++ b/src/mame/machine/meters.h @@ -26,7 +26,7 @@ class meters_device : public device_t { public: - meters_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + meters_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~meters_device() {} static void static_set_number_meters(device_t &device, int number) { downcast(device).m_number_mtr = number; } @@ -35,9 +35,9 @@ public: int GetActivity(int id); int GetNumberMeters(void); // currently unused - void Setcount(int id, INT32 count); // currently unused - INT32 Getcount(int id); // currently unused - void ReactTime(int id, INT32 cycles); // currently unused + void Setcount(int id, int32_t count); // currently unused + int32_t Getcount(int id); // currently unused + void ReactTime(int id, int32_t cycles); // currently unused protected: // device-level overrides @@ -50,8 +50,8 @@ private: struct meter_info { bool on; // Activity of reel - INT32 reacttime; - INT32 count; // mechmeter value + int32_t reacttime; + int32_t count; // mechmeter value bool state; // state 0/1 emu_timer *meter_timer; }; diff --git a/src/mame/machine/mexico86.cpp b/src/mame/machine/mexico86.cpp index 8c2cb1a5605..52bc00b8a43 100644 --- a/src/mame/machine/mexico86.cpp +++ b/src/mame/machine/mexico86.cpp @@ -65,7 +65,7 @@ void mexico86_state::mcu_simulate( ) { int i; bool coin_curr; - UINT8 coin_in_read = ioport("IN0")->read() & 3; + uint8_t coin_in_read = ioport("IN0")->read() & 3; // TODO: still needs Coinage B into account for(int coin_idx = 0; coin_idx < 2; coin_idx++) @@ -73,7 +73,7 @@ void mexico86_state::mcu_simulate( ) coin_curr = (coin_in_read & (1 << coin_idx)) == 0; if (coin_curr && m_coin_last[coin_idx] == false) { - UINT8 coinage_setting = (ioport("DSW0")->read() >> (coin_idx*2 + 4)) & 3; + uint8_t coinage_setting = (ioport("DSW0")->read() >> (coin_idx*2 + 4)) & 3; // increase credits counter switch(coinage_setting) @@ -132,7 +132,7 @@ void mexico86_state::mcu_simulate( ) if (m_protection_ram[0xe0] > 0 && m_protection_ram[0xe0] < 4) { - static const UINT8 answers[3][16] = + static const uint8_t answers[3][16] = { { 0x00,0x40,0x48,0x50,0x58,0x60,0x68,0x70,0x78,0x80,0x88,0x00,0x00,0x00,0x00,0x00 }, { 0x00,0x04,0x08,0x0C,0x10,0x14,0x18,0x1C,0x20,0x31,0x2B,0x35,0x00,0x00,0x00,0x00 }, @@ -155,20 +155,20 @@ void mexico86_state::mcu_simulate( ) // The following is missing from Knight Boy // this should be equivalent to the obfuscated kiki_clogic() below { - static const UINT8 db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; - UINT16 sy = m_protection_ram[0xa0] + ((0x18) >> 1); - UINT16 sx = m_protection_ram[0xa1] + ((0x18) >> 1); + static const uint8_t db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; + uint16_t sy = m_protection_ram[0xa0] + ((0x18) >> 1); + uint16_t sx = m_protection_ram[0xa1] + ((0x18) >> 1); for (i = 0; i < 0x38; i += 8) { - UINT8 hw = db[m_protection_ram[0x20 + i] & 0xf]; + uint8_t hw = db[m_protection_ram[0x20 + i] & 0xf]; if (hw) { - UINT16 xdiff = sx - ((UINT16)m_protection_ram[0x20 + i + 6] << 8 | m_protection_ram[0x20 + i + 7]); + uint16_t xdiff = sx - ((uint16_t)m_protection_ram[0x20 + i + 6] << 8 | m_protection_ram[0x20 + i + 7]); if (xdiff < hw) { - UINT16 ydiff = sy - ((UINT16)m_protection_ram[0x20 + i + 4] << 8 | m_protection_ram[0x20 + i + 5]); + uint16_t ydiff = sy - ((uint16_t)m_protection_ram[0x20 + i + 4] << 8 | m_protection_ram[0x20 + i + 5]); if (ydiff < hw) m_protection_ram[0xa2] = 1; // we have a collision } @@ -203,7 +203,7 @@ INTERRUPT_GEN_MEMBER(mexico86_state::kikikai_interrupt) void mexico86_state::kiki_clogic(int address, int latch) { - static const UINT8 db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; + static const uint8_t db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; int sy, sx, hw, i, qptr, diff1, diff2; if (address != KIKI_CL_TRIGGER) // m_queue latched data diff --git a/src/mame/machine/micro3d.cpp b/src/mame/machine/micro3d.cpp index 5b0ac44f06f..d5d6d4c13f2 100644 --- a/src/mame/machine/micro3d.cpp +++ b/src/mame/machine/micro3d.cpp @@ -214,19 +214,19 @@ READ32_MEMBER(micro3d_state::micro3d_scc_r) * *************************************/ -static inline INT64 dot_product(micro3d_vtx *v1, micro3d_vtx *v2) +static inline int64_t dot_product(micro3d_vtx *v1, micro3d_vtx *v2) { - INT64 result = ((INT64)v1->x * (INT64)v2->x) + - ((INT64)v1->y * (INT64)v2->y) + - ((INT64)v1->z * (INT64)v2->z); + int64_t result = ((int64_t)v1->x * (int64_t)v2->x) + + ((int64_t)v1->y * (int64_t)v2->y) + + ((int64_t)v1->z * (int64_t)v2->z); return result; } -static inline INT64 normalised_multiply(INT32 a, INT32 b) +static inline int64_t normalised_multiply(int32_t a, int32_t b) { - INT64 result; + int64_t result; - result = (INT64)a * (INT64)b; + result = (int64_t)a * (int64_t)b; return result >> 14; } @@ -264,15 +264,15 @@ READ32_MEMBER(micro3d_state::micro3d_mac2_r) WRITE32_MEMBER(micro3d_state::micro3d_mac2_w) { - UINT32 cnt = data & 0xff; - UINT32 inst = (data >> 8) & 0x1f; - UINT32 mac_cycles = 1; + uint32_t cnt = data & 0xff; + uint32_t inst = (data >> 8) & 0x1f; + uint32_t mac_cycles = 1; - UINT32 mrab11; - UINT32 vtx_addr; - UINT32 sram_r_addr; - UINT32 sram_w_addr; - UINT32 *mac_sram; + uint32_t mrab11; + uint32_t vtx_addr; + uint32_t sram_r_addr; + uint32_t sram_w_addr; + uint32_t *mac_sram; m_mac_stat = BIT(data, 13); m_mac_inst = inst & 0x7; @@ -299,11 +299,11 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w) case 0x08: { int i; - const UINT16 *rom = (UINT16*)m_vertex->base(); + const uint16_t *rom = (uint16_t*)m_vertex->base(); for (i = 0; i <= cnt; ++i) { - INT64 acc; + int64_t acc; micro3d_vtx v1; v1.x = VTXROM_FMT(rom[vtx_addr]); vtx_addr++; @@ -338,11 +338,11 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w) case 0x0c: { int i; - const UINT16 *rom = (UINT16*)m_vertex->base(); + const uint16_t *rom = (uint16_t*)m_vertex->base(); for (i = 0; i <= cnt; ++i) { - INT64 acc; + int64_t acc; micro3d_vtx v1; v1.x = VTXROM_FMT(rom[vtx_addr]); vtx_addr++; @@ -371,7 +371,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w) case 0x0f: { int i; - const UINT16 *rom = (UINT16*)m_vertex->base(); + const uint16_t *rom = (uint16_t*)m_vertex->base(); for (i = 0; i <= cnt; ++i, vtx_addr += 4) { @@ -398,7 +398,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w) for (i = 0; i <= cnt; ++i) { micro3d_vtx v1; - INT64 dp; + int64_t dp; v1.x = mac_sram[sram_r_addr++]; v1.y = mac_sram[sram_r_addr++]; @@ -424,7 +424,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w) { micro3d_vtx v1; micro3d_vtx v2; - INT64 dp; + int64_t dp; v1.x = mac_sram[sram_r_addr++]; v1.y = mac_sram[sram_r_addr++]; @@ -467,16 +467,16 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w) READ16_MEMBER(micro3d_state::micro3d_encoder_h_r) { - UINT16 x_encoder = m_joystick_x.read_safe(0); - UINT16 y_encoder = m_joystick_y.read_safe(0); + uint16_t x_encoder = m_joystick_x.read_safe(0); + uint16_t y_encoder = m_joystick_y.read_safe(0); return (y_encoder & 0xf00) | ((x_encoder & 0xf00) >> 8); } READ16_MEMBER(micro3d_state::micro3d_encoder_l_r) { - UINT16 x_encoder = m_joystick_x.read_safe(0); - UINT16 y_encoder = m_joystick_y.read_safe(0); + uint16_t x_encoder = m_joystick_x.read_safe(0); + uint16_t y_encoder = m_joystick_y.read_safe(0); return ((y_encoder & 0xff) << 8) | (x_encoder & 0xff); } @@ -487,7 +487,7 @@ TIMER_CALLBACK_MEMBER(micro3d_state::adc_done_callback) { case 0: m_adc_val = m_throttle.read_safe(0); break; - case 1: m_adc_val = (UINT8)((255.0/100.0) * m_volume->read() + 0.5); + case 1: m_adc_val = (uint8_t)((255.0/100.0) * m_volume->read() + 0.5); break; case 2: break; case 3: break; diff --git a/src/mame/machine/microdrv.cpp b/src/mame/machine/microdrv.cpp index 3edc60ea527..c55f305f0f1 100644 --- a/src/mame/machine/microdrv.cpp +++ b/src/mame/machine/microdrv.cpp @@ -43,7 +43,7 @@ const device_type MICRODRIVE = &device_creator; // microdrive_image_device - constructor //------------------------------------------------- -microdrive_image_device::microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +microdrive_image_device::microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MICRODRIVE, "Microdrive", tag, owner, clock, "microdrive_image", __FILE__), device_image_interface(mconfig, *this), m_write_comms_out(*this) @@ -77,8 +77,8 @@ void microdrive_image_device::device_start() m_write_comms_out.resolve_safe(); // allocate track buffers - m_left = std::make_unique(MDV_IMAGE_LENGTH / 2); - m_right = std::make_unique(MDV_IMAGE_LENGTH / 2); + m_left = std::make_unique(MDV_IMAGE_LENGTH / 2); + m_right = std::make_unique(MDV_IMAGE_LENGTH / 2); // allocate timers m_bit_timer = timer_alloc(); diff --git a/src/mame/machine/microdrv.h b/src/mame/machine/microdrv.h index e7d98d8e838..f81a311baac 100644 --- a/src/mame/machine/microdrv.h +++ b/src/mame/machine/microdrv.h @@ -43,7 +43,7 @@ class microdrive_image_device : public device_t, { public: // construction/destruction - microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~microdrive_image_device(); template static devcb_base &set_comms_out_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_comms_out.set_callback(object); } @@ -86,8 +86,8 @@ private: int m_erase; int m_read_write; - std::unique_ptr m_left; - std::unique_ptr m_right; + std::unique_ptr m_left; + std::unique_ptr m_right; int m_bit_offset; int m_byte_offset; diff --git a/src/mame/machine/micropolis.cpp b/src/mame/machine/micropolis.cpp index 0508f22fe5e..06f82ac9e02 100644 --- a/src/mame/machine/micropolis.cpp +++ b/src/mame/machine/micropolis.cpp @@ -49,7 +49,7 @@ BE02 and BE03 - read data, write data #define TRKSIZE_SD 16*270 #if 0 -static const UINT8 track_SD[][2] = { +static const uint8_t track_SD[][2] = { { 1, 0xff}, /* 1 * FF (marker) */ { 1, 0x00}, /* 1 byte, track number (00-4C) */ { 1, 0x01}, /* 1 byte, sector number (00-0F) */ @@ -65,7 +65,7 @@ static const UINT8 track_SD[][2] = { const device_type MICROPOLIS = &device_creator; -micropolis_device::micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +micropolis_device::micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MICROPOLIS, "MICROPOLIS", tag, owner, clock, "micropolis", __FILE__), m_read_dden(*this), m_write_intrq(*this), @@ -183,7 +183,7 @@ void micropolis_device::write_sector() ***************************************************************************/ /* select a drive */ -void micropolis_device::set_drive(UINT8 drive) +void micropolis_device::set_drive(uint8_t drive) { if (VERBOSE) logerror("micropolis_set_drive: $%02x\n", drive); @@ -313,7 +313,7 @@ WRITE8_MEMBER( micropolis_device::data_w ) READ8_MEMBER( micropolis_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x03) { diff --git a/src/mame/machine/micropolis.h b/src/mame/machine/micropolis.h index 76e1664c9ea..12e9bea0431 100644 --- a/src/mame/machine/micropolis.h +++ b/src/mame/machine/micropolis.h @@ -41,7 +41,7 @@ class micropolis_device : public device_t { public: - micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~micropolis_device() {} template static devcb_base &set_dden_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_dden.set_callback(object); } @@ -57,7 +57,7 @@ public: dev.m_floppy_drive_tags[3] = tag4; } - void set_drive(UINT8 drive); // set current drive (0-3) + void set_drive(uint8_t drive); // set current drive (0-3) DECLARE_READ8_MEMBER( status_r ); DECLARE_READ8_MEMBER( data_r ); @@ -83,20 +83,20 @@ private: const char *m_floppy_drive_tags[4]; /* register */ - UINT8 m_data; - UINT8 m_drive_num; - UINT8 m_track; - UINT8 m_sector; - UINT8 m_command; - UINT8 m_status; + uint8_t m_data; + uint8_t m_drive_num; + uint8_t m_track; + uint8_t m_sector; + uint8_t m_command; + uint8_t m_status; - UINT8 m_write_cmd; /* last write command issued */ + uint8_t m_write_cmd; /* last write command issued */ - UINT8 m_buffer[6144]; /* I/O buffer (holds up to a whole track) */ - UINT32 m_data_offset; /* offset into I/O buffer */ - INT32 m_data_count; /* transfer count from/into I/O buffer */ + uint8_t m_buffer[6144]; /* I/O buffer (holds up to a whole track) */ + uint32_t m_data_offset; /* offset into I/O buffer */ + int32_t m_data_count; /* transfer count from/into I/O buffer */ - UINT32 m_sector_length; /* sector length (byte) */ + uint32_t m_sector_length; /* sector length (byte) */ /* this is the drive currently selected */ legacy_floppy_image_device *m_drive; diff --git a/src/mame/machine/microtan.cpp b/src/mame/machine/microtan.cpp index 70e50fa87d5..191f833705c 100644 --- a/src/mame/machine/microtan.cpp +++ b/src/mame/machine/microtan.cpp @@ -129,9 +129,9 @@ static const char keyboard[8][9][8] = { }, }; -UINT8 microtan_state::read_dsw() +uint8_t microtan_state::read_dsw() { - UINT8 result; + uint8_t result; switch(machine().phase()) { case MACHINE_PHASE_RESET: @@ -417,7 +417,7 @@ INTERRUPT_GEN_MEMBER(microtan_state::microtan_interrupt) DRIVER_INIT_MEMBER(microtan_state,microtan) { - UINT8 *dst = memregion("gfx2")->base(); + uint8_t *dst = memregion("gfx2")->base(); int i; address_space &space = m_maincpu->space(AS_PROGRAM); @@ -522,7 +522,7 @@ void microtan_state::machine_reset() output().set_led_value(1, (m_keyrows[3] & 0x80) ? 0 : 1); } -image_verify_result microtan_state::microtan_verify_snapshot(UINT8 *data, int size) +image_verify_result microtan_state::microtan_verify_snapshot(uint8_t *data, int size) { if (size == 8263) { @@ -541,7 +541,7 @@ image_verify_result microtan_state::microtan_verify_snapshot(UINT8 *data, int si return image_verify_result::FAIL; } -image_init_result microtan_state::parse_intel_hex(UINT8 *snapshot_buff, char *src) +image_init_result microtan_state::parse_intel_hex(uint8_t *snapshot_buff, char *src) { char line[128]; int /*row = 0,*/ column = 0, last_addr = 0, last_size = 0; @@ -622,7 +622,7 @@ image_init_result microtan_state::parse_intel_hex(UINT8 *snapshot_buff, char *sr return image_init_result::PASS; } -image_init_result microtan_state::parse_zillion_hex(UINT8 *snapshot_buff, char *src) +image_init_result microtan_state::parse_zillion_hex(uint8_t *snapshot_buff, char *src) { char line[128]; int parsing = 0, /*row = 0,*/ column = 0; @@ -705,7 +705,7 @@ image_init_result microtan_state::parse_zillion_hex(UINT8 *snapshot_buff, char * return image_init_result::PASS; } -void microtan_state::microtan_set_cpu_regs(const UINT8 *snapshot_buff, int base) +void microtan_state::microtan_set_cpu_regs(const uint8_t *snapshot_buff, int base) { logerror("microtan_snapshot_copy: PC:%02X%02X P:%02X A:%02X X:%02X Y:%02X SP:1%02X", snapshot_buff[base+1], snapshot_buff[base+0], snapshot_buff[base+2], snapshot_buff[base+3], @@ -718,9 +718,9 @@ void microtan_state::microtan_set_cpu_regs(const UINT8 *snapshot_buff, int base) m_maincpu->set_state_int(M6502_S, snapshot_buff[base+6]); } -void microtan_state::microtan_snapshot_copy(UINT8 *snapshot_buff, int snapshot_size) +void microtan_state::microtan_snapshot_copy(uint8_t *snapshot_buff, int snapshot_size) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); address_space &space = m_maincpu->space(AS_PROGRAM); ay8910_device *ay8910 = machine().device("ay8910.1"); @@ -821,9 +821,9 @@ void microtan_state::microtan_snapshot_copy(UINT8 *snapshot_buff, int snapshot_s SNAPSHOT_LOAD_MEMBER( microtan_state, microtan ) { - UINT8 *snapshot_buff; + uint8_t *snapshot_buff; - snapshot_buff = (UINT8*)image.ptr(); + snapshot_buff = (uint8_t*)image.ptr(); if (!snapshot_buff) return image_init_result::FAIL; @@ -837,7 +837,7 @@ SNAPSHOT_LOAD_MEMBER( microtan_state, microtan ) QUICKLOAD_LOAD_MEMBER( microtan_state, microtan ) { int snapshot_size = 8263; /* magic size */ - std::vector snapshot_buff(snapshot_size, 0); + std::vector snapshot_buff(snapshot_size, 0); std::vector buff(quickload_size + 1); image_init_result rc; diff --git a/src/mame/machine/midikbd.cpp b/src/mame/machine/midikbd.cpp index a45e6179a3d..e0b8ce8478c 100644 --- a/src/mame/machine/midikbd.cpp +++ b/src/mame/machine/midikbd.cpp @@ -4,7 +4,7 @@ const device_type MIDI_KBD = &device_creator; -midi_keyboard_device::midi_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +midi_keyboard_device::midi_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDI_KBD, "Generic MIDI Keyboard", tag, owner, clock, "midi_kbd", __FILE__), device_serial_interface(mconfig, *this), m_out_tx_func(*this), @@ -50,7 +50,7 @@ void midi_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, in int i; - UINT32 kbstate = m_keyboard->read(); + uint32_t kbstate = m_keyboard->read(); if(kbstate != m_keyboard_state) { for (i=0; i < 24; i++) diff --git a/src/mame/machine/midikbd.h b/src/mame/machine/midikbd.h index c5272cf2e33..e2862f8bd93 100644 --- a/src/mame/machine/midikbd.h +++ b/src/mame/machine/midikbd.h @@ -13,7 +13,7 @@ class midi_keyboard_device : public device_t, public device_serial_interface { public: - midi_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midi_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ioport_constructor device_input_ports() const override; template static devcb_base &static_set_tx_callback(device_t &device, _Object object) { return downcast(device).m_out_tx_func.set_callback(object); } @@ -25,14 +25,14 @@ protected: void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - void push_tx(UINT8 data) { ++m_head %= 16; m_buffer[m_head] = data; } + void push_tx(uint8_t data) { ++m_head %= 16; m_buffer[m_head] = data; } devcb_write_line m_out_tx_func; emu_timer *m_keyboard_timer; required_ioport m_keyboard; - UINT32 m_keyboard_state; - UINT8 m_buffer[16]; - UINT8 m_head, m_tail; + uint32_t m_keyboard_state; + uint8_t m_buffer[16]; + uint8_t m_head, m_tail; }; extern const device_type MIDI_KBD; diff --git a/src/mame/machine/midtunit.cpp b/src/mame/machine/midtunit.cpp index 0be5b22609e..283ccdca76a 100644 --- a/src/mame/machine/midtunit.cpp +++ b/src/mame/machine/midtunit.cpp @@ -78,7 +78,7 @@ READ16_MEMBER(midtunit_state::midtunit_cmos_r) * *************************************/ -static const UINT8 mk_prot_values[] = +static const uint8_t mk_prot_values[] = { 0x13, 0x27, 0x0f, 0x1f, 0x3e, 0x3d, 0x3b, 0x37, 0x2e, 0x1c, 0x38, 0x31, 0x22, 0x05, 0x0a, 0x15, @@ -181,7 +181,7 @@ WRITE16_MEMBER(midtunit_state::mk2_prot_w) * *************************************/ -static const UINT32 nbajam_prot_values[128] = +static const uint32_t nbajam_prot_values[128] = { 0x21283b3b, 0x2439383b, 0x31283b3b, 0x302b3938, 0x31283b3b, 0x302b3938, 0x232f2f2f, 0x26383b3b, 0x21283b3b, 0x2439383b, 0x312a1224, 0x302b1120, 0x312a1224, 0x302b1120, 0x232d283b, 0x26383b3b, @@ -201,7 +201,7 @@ static const UINT32 nbajam_prot_values[128] = 0x0b31283b, 0x0e26383b, 0x19322e06, 0x18312a12, 0x1b332f05, 0x1a302b11, 0x0b31283b, 0x0e26383b }; -static const UINT32 nbajamte_prot_values[128] = +static const uint32_t nbajamte_prot_values[128] = { 0x00000000, 0x04081020, 0x08102000, 0x0c183122, 0x10200000, 0x14281020, 0x18312204, 0x1c393326, 0x20000001, 0x24081021, 0x28102000, 0x2c183122, 0x30200001, 0x34281021, 0x38312204, 0x3c393326, @@ -232,7 +232,7 @@ READ16_MEMBER(midtunit_state::nbajam_prot_r) WRITE16_MEMBER(midtunit_state::nbajam_prot_w) { int table_index = (offset >> 6) & 0x7f; - UINT32 protval = m_nbajam_prot_table[table_index]; + uint32_t protval = m_nbajam_prot_table[table_index]; m_nbajam_prot_queue[0] = data; m_nbajam_prot_queue[1] = ((protval >> 24) & 0xff) << 9; @@ -250,7 +250,7 @@ WRITE16_MEMBER(midtunit_state::nbajam_prot_w) * *************************************/ -static const UINT8 jdredd_prot_values_10740[] = +static const uint8_t jdredd_prot_values_10740[] = { 0x14,0x2A,0x15,0x0A,0x25,0x32,0x39,0x1C, 0x2E,0x37,0x3B,0x1D,0x2E,0x37,0x1B,0x0D, @@ -260,17 +260,17 @@ static const UINT8 jdredd_prot_values_10740[] = 0x2B,0x15,0x0A,0x05,0x22,0x00 }; -static const UINT8 jdredd_prot_values_13240[] = +static const uint8_t jdredd_prot_values_13240[] = { 0x28 }; -static const UINT8 jdredd_prot_values_76540[] = +static const uint8_t jdredd_prot_values_76540[] = { 0x04,0x08 }; -static const UINT8 jdredd_prot_values_77760[] = +static const uint8_t jdredd_prot_values_77760[] = { 0x14,0x2A,0x14,0x2A,0x35,0x2A,0x35,0x1A, 0x35,0x1A,0x2D,0x1A,0x2D,0x36,0x2D,0x36, @@ -286,7 +286,7 @@ static const UINT8 jdredd_prot_values_77760[] = 0x20,0x00,0x00 }; -static const UINT8 jdredd_prot_values_80020[] = +static const uint8_t jdredd_prot_values_80020[] = { 0x3A,0x1D,0x2E,0x37,0x00,0x00,0x2C,0x1C, 0x39,0x33,0x00,0x00,0x00,0x00,0x00,0x00 @@ -337,7 +337,7 @@ WRITE16_MEMBER(midtunit_state::jdredd_prot_w) READ16_MEMBER(midtunit_state::jdredd_prot_r) { - UINT16 result = 0xffff; + uint16_t result = 0xffff; if (m_jdredd_prot_table && m_jdredd_prot_index < m_jdredd_prot_max) result = m_jdredd_prot_table[m_jdredd_prot_index++] << 9; @@ -446,7 +446,7 @@ DRIVER_INIT_MEMBER(midtunit_state,jdreddp) /* sound chip protection (hidden RAM) */ machine().device("adpcm:cpu")->memory().space(AS_PROGRAM).install_read_bank(0xfbcf, 0xfbf9, "bank7"); machine().device("adpcm:cpu")->memory().space(AS_PROGRAM).install_write_bank(0xfbcf, 0xfbf9, "bank9"); - membank("adpcm:bank9")->set_base(auto_alloc_array(machine(), UINT8, 0x80)); + membank("adpcm:bank9")->set_base(auto_alloc_array(machine(), uint8_t, 0x80)); } diff --git a/src/mame/machine/midwayic.cpp b/src/mame/machine/midwayic.cpp index 92c1e4cbc77..d5c9256b3a1 100644 --- a/src/mame/machine/midwayic.cpp +++ b/src/mame/machine/midwayic.cpp @@ -35,8 +35,8 @@ void midway_serial_pic_device::generate_serial_data(int upper) { int year = atoi(machine().system().year), month = 12, day = 11; - UINT32 serial_number, temp; - UINT8 serial_digit[9]; + uint32_t serial_number, temp; + uint8_t serial_digit[9]; serial_number = 123456; serial_number += upper * 1000000; @@ -112,7 +112,7 @@ const device_type MIDWAY_SERIAL_PIC = &device_creator; // midway_serial_pic2_device - constructor //------------------------------------------------- -midway_serial_pic_device::midway_serial_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +midway_serial_pic_device::midway_serial_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDWAY_SERIAL_PIC2, "Midway Serial Pic", tag, owner, clock, "midway_serial_pic", __FILE__), m_upper(0), m_buff(0), @@ -124,7 +124,7 @@ midway_serial_pic_device::midway_serial_pic_device(const machine_config &mconfig memset(m_data,0,sizeof(m_data)); } -midway_serial_pic_device::midway_serial_pic_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +midway_serial_pic_device::midway_serial_pic_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), m_upper(0), m_buff(0), @@ -202,7 +202,7 @@ WRITE8_MEMBER(midway_serial_pic_device::write) * *************************************/ -static inline UINT8 make_bcd(UINT8 data) +static inline uint8_t make_bcd(uint8_t data) { return ((data / 10) << 4) | (data % 10); } @@ -214,7 +214,7 @@ const device_type MIDWAY_SERIAL_PIC2 = &device_creator; // midway_serial_pic2_device - constructor //------------------------------------------------- -midway_ioasic_device::midway_ioasic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +midway_ioasic_device::midway_ioasic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : midway_serial_pic2_device(mconfig, MIDWAY_IOASIC, "Midway IOASIC", tag, owner, clock, "midway_ioasic", __FILE__), m_has_dcs(0), m_has_cage(0), @@ -624,7 +624,7 @@ midway_ioasic_device::midway_ioasic_device(const machine_config &mconfig, const void midway_ioasic_device::device_start() //void midway_ioasic_init(running_machine &machine, int shuffle, int upper, int yearoffs, void (*irq_callback)(running_machine &, int)) { - static const UINT8 shuffle_maps[][16] = + static const uint8_t shuffle_maps[][16] = { { 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xa,0xb,0xc,0xd,0xe,0xf }, /* WarGods, WG3DH, SFRush, MK4 */ { 0x4,0x5,0x6,0x7,0xb,0xa,0x9,0x8,0x3,0x2,0x1,0x0,0xf,0xe,0xd,0xc }, /* Blitz, Blitz99 */ @@ -700,9 +700,9 @@ void midway_ioasic_device::ioasic_reset() void midway_ioasic_device::update_ioasic_irq() { - UINT16 fifo_state = fifo_status_r(machine().driver_data()->generic_space(),0); - UINT16 irqbits = 0x2000; - UINT8 new_state; + uint16_t fifo_state = fifo_status_r(machine().driver_data()->generic_space(),0); + uint16_t irqbits = 0x2000; + uint8_t new_state; irqbits |= m_sound_irq_state; if (m_reg[IOASIC_UARTIN] & 0x1000) @@ -767,7 +767,7 @@ WRITE_LINE_MEMBER(midway_ioasic_device::ioasic_output_full) READ16_MEMBER(midway_ioasic_device::fifo_r) { - UINT16 result = 0; + uint16_t result = 0; /* we can only read data if there's some to read! */ if (m_fifo_bytes != 0) @@ -802,7 +802,7 @@ READ16_MEMBER(midway_ioasic_device::fifo_r) READ16_MEMBER(midway_ioasic_device::fifo_status_r) { - UINT16 result = 0; + uint16_t result = 0; if (m_fifo_bytes == 0 && !m_force_fifo_full) result |= 0x08; @@ -846,7 +846,7 @@ WRITE_LINE_MEMBER(midway_ioasic_device::fifo_reset_w) } -void midway_ioasic_device::fifo_w(UINT16 data) +void midway_ioasic_device::fifo_w(uint16_t data) { /* if we have room, add it to the FIFO buffer */ if (m_fifo_bytes < FIFO_SIZE) @@ -866,7 +866,7 @@ void midway_ioasic_device::fifo_w(UINT16 data) } -void midway_ioasic_device::fifo_full_w(UINT16 data) +void midway_ioasic_device::fifo_full_w(uint16_t data) { if (LOG_FIFO) logerror("fifo_full_w(%04X)\n", data); @@ -877,12 +877,12 @@ void midway_ioasic_device::fifo_full_w(UINT16 data) /* need to check if device callback is required instead of hardcode here */ -void midway_ioasic_device::output_w(UINT32 data) +void midway_ioasic_device::output_w(uint32_t data) { /* two writes in pairs. flag off first, on second. arg remains the same. */ - UINT8 flag = (data >> 8) & 0x8; - UINT8 op = (data >> 8) & 0x7; - UINT8 arg = data & 0xFF; + uint8_t flag = (data >> 8) & 0x8; + uint8_t op = (data >> 8) & 0x7; + uint8_t arg = data & 0xFF; switch (op) { @@ -900,7 +900,7 @@ void midway_ioasic_device::output_w(UINT32 data) case 0x4: if (flag) { - for (UINT8 bit = 0; bit < 8; bit++) + for (uint8_t bit = 0; bit < 8; bit++) machine().output().set_lamp_value(bit, (arg >> bit) & 0x1); } break; @@ -908,7 +908,7 @@ void midway_ioasic_device::output_w(UINT32 data) case 0x5: if (flag) { - for (UINT8 bit = 0; bit < 8; bit++) + for (uint8_t bit = 0; bit < 8; bit++) machine().output().set_lamp_value(8 + bit, (arg >> bit) & 0x1); } break; @@ -925,7 +925,7 @@ void midway_ioasic_device::output_w(UINT32 data) READ32_MEMBER( midway_ioasic_device::packed_r ) { - UINT32 result = 0; + uint32_t result = 0; if (ACCESSING_BITS_0_15) result |= read(space, offset*2, 0x0000ffff) & 0xffff; if (ACCESSING_BITS_16_31) @@ -936,7 +936,7 @@ READ32_MEMBER( midway_ioasic_device::packed_r ) READ32_MEMBER( midway_ioasic_device::read ) { - UINT32 result; + uint32_t result; offset = m_shuffle_active ? m_shuffle_map[offset & 15] : offset; result = m_reg[offset]; @@ -1000,7 +1000,7 @@ READ32_MEMBER( midway_ioasic_device::read ) result = m_cage->main_r(); else { - static UINT16 val = 0; + static uint16_t val = 0; result = val = ~val; } break; @@ -1031,7 +1031,7 @@ WRITE32_MEMBER( midway_ioasic_device::packed_w ) WRITE32_MEMBER( midway_ioasic_device::write ) { - UINT32 oldreg, newreg; + uint32_t oldreg, newreg; offset = m_shuffle_active ? m_shuffle_map[offset & 15] : offset; oldreg = m_reg[offset]; diff --git a/src/mame/machine/midwayic.h b/src/mame/machine/midwayic.h index d815cd1ab4f..707988ce60e 100644 --- a/src/mame/machine/midwayic.h +++ b/src/mame/machine/midwayic.h @@ -18,8 +18,8 @@ class midway_serial_pic_device : public device_t { public: // construction/destruction - midway_serial_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - midway_serial_pic_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + midway_serial_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + midway_serial_pic_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); static void static_set_upper(device_t &device, int upper) { downcast(device).m_upper = upper; } @@ -35,14 +35,14 @@ protected: void generate_serial_data(int upper); void serial_register_state(); - UINT8 m_data[16]; // reused by other devices + uint8_t m_data[16]; // reused by other devices int m_upper; private: - UINT8 m_buff; - UINT8 m_idx; - UINT8 m_status; - UINT8 m_bits; - UINT8 m_ormask; + uint8_t m_buff; + uint8_t m_idx; + uint8_t m_status; + uint8_t m_bits; + uint8_t m_ormask; }; @@ -61,8 +61,8 @@ class midway_serial_pic2_device : public midway_serial_pic_device, { public: // construction/destruction - midway_serial_pic2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - midway_serial_pic2_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); + midway_serial_pic2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + midway_serial_pic2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); static void static_set_yearoffs(device_t &device, int yearoffs) { downcast(device).m_yearoffs = yearoffs; } @@ -70,7 +70,7 @@ public: DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( status_r ); - void set_default_nvram(const UINT8 *nvram); + void set_default_nvram(const uint8_t *nvram); protected: // device-level overrides @@ -86,19 +86,19 @@ private: void pic_register_state(); TIMER_CALLBACK_MEMBER( reset_timer ); - UINT16 m_latch; + uint16_t m_latch; attotime m_latch_expire_time; - UINT8 m_state; - UINT8 m_index; - UINT8 m_total; - UINT8 m_nvram_addr; - UINT8 m_buffer[0x10]; - UINT8 m_nvram[0x100]; - UINT8 m_default_nvram[0x100]; - UINT8 m_time_buf[8]; - UINT8 m_time_index; - UINT8 m_time_just_written; - UINT16 m_yearoffs; + uint8_t m_state; + uint8_t m_index; + uint8_t m_total; + uint8_t m_nvram_addr; + uint8_t m_buffer[0x10]; + uint8_t m_nvram[0x100]; + uint8_t m_default_nvram[0x100]; + uint8_t m_time_buf[8]; + uint8_t m_time_index; + uint8_t m_time_just_written; + uint16_t m_yearoffs; emu_timer *m_time_write_timer; }; @@ -119,17 +119,17 @@ class midway_ioasic_device : public midway_serial_pic2_device { public: // construction/destruction - midway_ioasic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midway_ioasic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_shuffle(device_t &device, UINT8 shuffle) { downcast(device).m_shuffle_type = shuffle; } - static void static_set_shuffle_default(device_t &device, UINT8 shuffle) { downcast(device).m_shuffle_default = shuffle; } - static void static_set_auto_ack(device_t &device, UINT8 auto_ack) { downcast(device).m_auto_ack = auto_ack; } + static void static_set_shuffle(device_t &device, uint8_t shuffle) { downcast(device).m_shuffle_type = shuffle; } + static void static_set_shuffle_default(device_t &device, uint8_t shuffle) { downcast(device).m_shuffle_default = shuffle; } + static void static_set_auto_ack(device_t &device, uint8_t auto_ack) { downcast(device).m_auto_ack = auto_ack; } template static devcb_base &set_irqhandler_callback(device_t &device, _Object object) { return downcast(device).m_irq_callback.set_callback(object); } void set_shuffle_state(int state); - void fifo_w(UINT16 data); - void fifo_full_w(UINT16 data); - void output_w(UINT32 data); + void fifo_w(uint16_t data); + void fifo_full_w(uint16_t data); + void output_w(uint32_t data); DECLARE_WRITE_LINE_MEMBER(fifo_reset_w); DECLARE_READ16_MEMBER(fifo_r); @@ -156,24 +156,24 @@ private: void update_ioasic_irq(); - UINT32 m_reg[16]; - UINT8 m_has_dcs; - UINT8 m_has_cage; + uint32_t m_reg[16]; + uint8_t m_has_dcs; + uint8_t m_has_cage; device_t *m_dcs_cpu; - UINT8 m_shuffle_type; - UINT8 m_shuffle_default; - UINT8 m_shuffle_active; - const UINT8 * m_shuffle_map; + uint8_t m_shuffle_type; + uint8_t m_shuffle_default; + uint8_t m_shuffle_active; + const uint8_t * m_shuffle_map; devcb_write8 m_irq_callback; - UINT8 m_irq_state; - UINT16 m_sound_irq_state; - UINT8 m_auto_ack; - UINT8 m_force_fifo_full; - - UINT16 m_fifo[512]; - UINT16 m_fifo_in; - UINT16 m_fifo_out; - UINT16 m_fifo_bytes; + uint8_t m_irq_state; + uint16_t m_sound_irq_state; + uint8_t m_auto_ack; + uint8_t m_force_fifo_full; + + uint16_t m_fifo[512]; + uint16_t m_fifo_in; + uint16_t m_fifo_out; + uint16_t m_fifo_bytes; offs_t m_fifo_force_buffer_empty_pc; atari_cage_device *m_cage; diff --git a/src/mame/machine/midyunit.cpp b/src/mame/machine/midyunit.cpp index e3a00f1047a..3ca36e5a485 100644 --- a/src/mame/machine/midyunit.cpp +++ b/src/mame/machine/midyunit.cpp @@ -242,8 +242,8 @@ WRITE8_MEMBER(midyunit_state::cvsd_protection_w) void midyunit_state::init_generic(int bpp, int sound, int prot_start, int prot_end) { offs_t gfx_chunk = m_gfx_rom.bytes() / 4; - UINT8 d1, d2, d3, d4, d5, d6; - UINT8 *base; + uint8_t d1, d2, d3, d4, d5, d6; + uint8_t *base; int i; /* load graphics ROMs */ diff --git a/src/mame/machine/mie.cpp b/src/mame/machine/mie.cpp index c0c95483e77..b06fe6d64f0 100644 --- a/src/mame/machine/mie.cpp +++ b/src/mame/machine/mie.cpp @@ -87,12 +87,12 @@ machine_config_constructor mie_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME(mie); } -mie_jvs_device::mie_jvs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mie_jvs_device::mie_jvs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jvs_host(mconfig, MIE_JVS, "JVS (MIE)", tag, owner, clock, "mie_jvs", __FILE__) { } -mie_device::mie_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mie_device::mie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : maple_device(mconfig, MIE, "Sega 315-6146 MIE", tag, owner, clock, "mie", __FILE__) { memset(gpio_name, 0, sizeof(gpio_name)); @@ -121,7 +121,7 @@ void mie_device::device_start() // patch out MIE RAM test // TODO: figure out why SH4 code doesn't wait long enough for internal firmware's RAM test completed in the case of reset - UINT32 *rom = (UINT32*)memregion("mie")->base(); + uint32_t *rom = (uint32_t*)memregion("mie")->base(); rom[0x144/4] = 0x0001d8c3; } @@ -148,7 +148,7 @@ READ8_MEMBER(mie_device::control_r) WRITE8_MEMBER(mie_device::control_w) { - UINT32 prev_control = control; + uint32_t prev_control = control; int shift = offset*8; control = (control & ~(255 << shift)) | (data << shift); @@ -189,7 +189,7 @@ void mie_device::device_timer(emu_timer &_timer, device_timer_id id, int param, } } -void mie_device::maple_w(const UINT32 *data, UINT32 in_size) +void mie_device::maple_w(const uint32_t *data, uint32_t in_size) { memcpy(tbuf, data, in_size*4); lreg = in_size-1; @@ -337,8 +337,8 @@ READ8_MEMBER(mie_device::jvs_r) if (jvs_lcr & 0x80) return 0; - const UINT8 *buf; - UINT32 size; + const uint8_t *buf; + uint32_t size; jvs->get_encoded_reply(buf, size); if(jvs_rpos >= size) return 0; @@ -363,8 +363,8 @@ READ8_MEMBER(mie_device::jvs_status_r) // 01 = ready for reading // 20 = ready for writing // 40 = sending done - const UINT8 *buf; - UINT32 size; + const uint8_t *buf; + uint32_t size; jvs->get_encoded_reply(buf, size); return 0x60 | (jvs_rpos < size ? 1 : 0); } diff --git a/src/mame/machine/mie.h b/src/mame/machine/mie.h index f03e20be65d..348cc2a329d 100644 --- a/src/mame/machine/mie.h +++ b/src/mame/machine/mie.h @@ -28,7 +28,7 @@ class mie_jvs_device; class mie_device : public maple_device { public: - mie_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_gpio_name(device_t &device, int entry, const char *name); static void static_set_jvs_name(device_t &device, const char *name); @@ -71,7 +71,7 @@ public: IRQ_CALLBACK_MEMBER(irq_callback); - void maple_w(const UINT32 *data, UINT32 in_size) override; + void maple_w(const uint32_t *data, uint32_t in_size) override; virtual void maple_reset() override; protected: @@ -105,12 +105,12 @@ private: mie_jvs_device *jvs; ioport_port *gpio_port[8]; - UINT32 tbuf[TBUF_SIZE]; - UINT32 control, lreg, jvs_rpos; - UINT8 gpiodir, gpio_val[8]; - UINT8 irq_enable, irq_pending, maple_irqlevel; - UINT8 jvs_control, jvs_dest; - UINT8 jvs_lcr; + uint32_t tbuf[TBUF_SIZE]; + uint32_t control, lreg, jvs_rpos; + uint8_t gpiodir, gpio_val[8]; + uint8_t irq_enable, irq_pending, maple_irqlevel; + uint8_t jvs_control, jvs_dest; + uint8_t jvs_lcr; void raise_irq(int level); void recalc_irq(); @@ -123,7 +123,7 @@ public: friend class mie_device; // construction/destruction - mie_jvs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mie_jvs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/mame/machine/mikro80.cpp b/src/mame/machine/mikro80.cpp index 0d0b6d927ff..47977753419 100644 --- a/src/mame/machine/mikro80.cpp +++ b/src/mame/machine/mikro80.cpp @@ -17,7 +17,7 @@ DRIVER_INIT_MEMBER(mikro80_state,mikro80) { /* set initialy ROM to be visible on first bank */ - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); memset(RAM,0x0000,0x0800); // make frist page empty by default m_bank1->configure_entries(1, 2, RAM, 0x0000); m_bank1->configure_entries(0, 2, RAM, 0xf800); @@ -32,7 +32,7 @@ DRIVER_INIT_MEMBER(mikro80_state,radio99) READ8_MEMBER(mikro80_state::mikro80_8255_portb_r) { - UINT8 key = 0xff; + uint8_t key = 0xff; if ((m_keyboard_mask & 0x01)!=0) { key &= m_io_line0->read(); } if ((m_keyboard_mask & 0x02)!=0) { key &= m_io_line1->read(); } if ((m_keyboard_mask & 0x04)!=0) { key &= m_io_line2->read(); } diff --git a/src/mame/machine/mm1kb.cpp b/src/mame/machine/mm1kb.cpp index 6cc417ca184..3eefba9bf7d 100644 --- a/src/mame/machine/mm1kb.cpp +++ b/src/mame/machine/mm1kb.cpp @@ -205,7 +205,7 @@ ioport_constructor mm1_keyboard_t::device_input_ports() const // mm1_keyboard_t - constructor //------------------------------------------------- -mm1_keyboard_t::mm1_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mm1_keyboard_t::mm1_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MM1_KEYBOARD, "MikroMikko 1 keyboard", tag, owner, clock, "mm1kb", __FILE__), m_write_kbst(*this), m_samples(*this, "keyboard_and_chassis_sounds"), @@ -257,17 +257,17 @@ void mm1_keyboard_t::shut_down_mm1() void mm1_keyboard_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { // handle scan timer - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_drive < 10) { data = m_y[m_drive]->read(); } - UINT8 special = m_special->read(); + uint8_t special = m_special->read(); int ctrl = BIT(special, 0); int shift = BIT(special, 2) & BIT(special, 1); - UINT8 keydata = 0xff; + uint8_t keydata = 0xff; if (!BIT(data, m_sense)) { diff --git a/src/mame/machine/mm1kb.h b/src/mame/machine/mm1kb.h index e06f11d038c..c81bac4fa58 100644 --- a/src/mame/machine/mm1kb.h +++ b/src/mame/machine/mm1kb.h @@ -35,7 +35,7 @@ class mm1_keyboard_t : public device_t { public: // construction/destruction - mm1_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mm1_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_kbst_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_kbst.set_callback(object); } @@ -76,7 +76,7 @@ private: int m_sense; int m_drive; - UINT8 m_data; + uint8_t m_data; static bool first_time; // for power switch sound emu_timer *m_scan_timer; // scan timer diff --git a/src/mame/machine/model1.cpp b/src/mame/machine/model1.cpp index a9a4473bcc2..f763ab83701 100644 --- a/src/mame/machine/model1.cpp +++ b/src/mame/machine/model1.cpp @@ -13,19 +13,19 @@ #define TGP_FUNCTION(name) void name() -UINT32 model1_state::fifoout_pop() +uint32_t model1_state::fifoout_pop() { if(m_fifoout_wpos == m_fifoout_rpos) { fatalerror("TGP FIFOOUT underflow (%x)\n", safe_pc()); } - UINT32 v = m_fifoout_data[m_fifoout_rpos++]; + uint32_t v = m_fifoout_data[m_fifoout_rpos++]; if(m_fifoout_rpos == FIFO_SIZE) m_fifoout_rpos = 0; return v; } -void model1_state::fifoout_push(UINT32 data) +void model1_state::fifoout_push(uint32_t data) { if(!m_puuu) logerror("TGP: Push %d\n", data); @@ -46,17 +46,17 @@ void model1_state::fifoout_push_f(float data) fifoout_push(f2u(data)); } -UINT32 model1_state::fifoin_pop() +uint32_t model1_state::fifoin_pop() { if(m_fifoin_wpos == m_fifoin_rpos) logerror("TGP FIFOIN underflow\n"); - UINT32 v = m_fifoin_data[m_fifoin_rpos++]; + uint32_t v = m_fifoin_data[m_fifoin_rpos++]; if(m_fifoin_rpos == FIFO_SIZE) m_fifoin_rpos = 0; return v; } -void model1_state::fifoin_push(UINT32 data) +void model1_state::fifoin_push(uint32_t data) { // logerror("TGP FIFOIN write %08x (%x)\n", data, safe_pc()); m_fifoin_data[m_fifoin_wpos++] = data; @@ -80,7 +80,7 @@ void model1_state::next_fn() m_fifoin_cb = m_swa ? &model1_state::function_get_swa : &model1_state::function_get_vf; } -static float tcos(INT16 a) +static float tcos(int16_t a) { if(a == 16384 || a == -16384) return 0; @@ -92,7 +92,7 @@ static float tcos(INT16 a) return cos(a*(2*M_PI/65536.0)); } -static float tsin(INT16 a) +static float tsin(int16_t a) { if(a == 0 || a == -32768) return 0; @@ -104,7 +104,7 @@ static float tsin(INT16 a) return sin(a*(2*M_PI/65536.0)); } -UINT16 model1_state::ram_get_i() +uint16_t model1_state::ram_get_i() { return m_ram_data[m_ram_scanadr++]; } @@ -236,14 +236,14 @@ TGP_FUNCTION( model1_state::anglev ) if(a>=0) fifoout_push(0); else - fifoout_push((UINT32)-32768); + fifoout_push((uint32_t)-32768); } else if(!a) { if(b>=0) fifoout_push(16384); else - fifoout_push((UINT32)-16384); + fifoout_push((uint32_t)-16384); } else - fifoout_push((INT16)(atan2(b, a)*32768/M_PI)); + fifoout_push((int16_t)(atan2(b, a)*32768/M_PI)); next_fn(); } @@ -295,7 +295,7 @@ TGP_FUNCTION( model1_state::normalize ) TGP_FUNCTION( model1_state::acc_seti ) { - INT32 a = fifoin_pop(); + int32_t a = fifoin_pop(); m_dump = true; logerror("TGP acc_seti %d (%x)\n", a, m_pushpc); m_acc = a; @@ -304,7 +304,7 @@ TGP_FUNCTION( model1_state::acc_seti ) TGP_FUNCTION( model1_state::track_select ) { - INT32 a = fifoin_pop(); + int32_t a = fifoin_pop(); logerror("TGP track_select %d (%x)\n", a, m_pushpc); m_tgp_vr_select = a; next_fn(); @@ -346,14 +346,14 @@ TGP_FUNCTION( model1_state::anglep ) if(c>=0) fifoout_push(0); else - fifoout_push((UINT32)-32768); + fifoout_push((uint32_t)-32768); } else if(!c) { if(d>=0) fifoout_push(16384); else - fifoout_push((UINT32)-16384); + fifoout_push((uint32_t)-16384); } else - fifoout_push((INT16)(atan2(d, c)*32768/M_PI)); + fifoout_push((int16_t)(atan2(d, c)*32768/M_PI)); next_fn(); } @@ -411,7 +411,7 @@ TGP_FUNCTION( model1_state::matrix_scale ) TGP_FUNCTION( model1_state::matrix_rotx ) { - INT16 a = fifoin_pop(); + int16_t a = fifoin_pop(); float s = tsin(a); float c = tcos(a); float t1, t2; @@ -433,7 +433,7 @@ TGP_FUNCTION( model1_state::matrix_rotx ) TGP_FUNCTION( model1_state::matrix_roty ) { - INT16 a = fifoin_pop(); + int16_t a = fifoin_pop(); float s = tsin(a); float c = tcos(a); float t1, t2; @@ -456,7 +456,7 @@ TGP_FUNCTION( model1_state::matrix_roty ) TGP_FUNCTION( model1_state::matrix_rotz ) { - INT16 a = fifoin_pop(); + int16_t a = fifoin_pop(); float s = tsin(a); float c = tcos(a); float t1, t2; @@ -479,8 +479,8 @@ TGP_FUNCTION( model1_state::matrix_rotz ) TGP_FUNCTION( model1_state::track_read_quad ) { - const UINT32 *tgp_data = (const UINT32 *)memregion("user2")->base(); - UINT32 a = fifoin_pop(); + const uint32_t *tgp_data = (const uint32_t *)memregion("user2")->base(); + uint32_t a = fifoin_pop(); int offd; logerror("TGP track_read_quad %d (%x)\n", a, m_pushpc); @@ -503,7 +503,7 @@ TGP_FUNCTION( model1_state::track_read_quad ) TGP_FUNCTION( model1_state::intercept ) { - const UINT32 *tgp_data = (const UINT32 *)memregion("user2")->base(); + const uint32_t *tgp_data = (const uint32_t *)memregion("user2")->base(); float x1 = fifoin_pop_f(); float y1 = fifoin_pop_f(); @@ -511,7 +511,7 @@ TGP_FUNCTION( model1_state::intercept ) float x2 = fifoin_pop_f(); float y2 = fifoin_pop_f(); float z2 = fifoin_pop_f(); - UINT32 idx = fifoin_pop(); + uint32_t idx = fifoin_pop(); logerror("TGP intercept %f, %f, %f, %f, %f, %f, %x (%x)\n", x1, y1, z1, x2, y2, z2, idx, m_pushpc); @@ -520,9 +520,9 @@ TGP_FUNCTION( model1_state::intercept ) float dz = z2-z1; idx = tgp_data[0x10] + 2*idx; - UINT32 count = tgp_data[idx]; - UINT32 adr = tgp_data[idx+1]; - UINT32 ret = 1; + uint32_t count = tgp_data[idx]; + uint32_t adr = tgp_data[idx+1]; + uint32_t ret = 1; for(unsigned int j=0; j=0) fifoout_push(0); else - fifoout_push((UINT32)-32768); + fifoout_push((uint32_t)-32768); } else if(!a) { if(c>=0) fifoout_push(16384); else - fifoout_push((UINT32)-16384); + fifoout_push((uint32_t)-16384); } else - fifoout_push((INT16)(atan2(c, a)*32768/M_PI)); + fifoout_push((int16_t)(atan2(c, a)*32768/M_PI)); if(!b) fifoout_push(0); @@ -748,9 +748,9 @@ TGP_FUNCTION( model1_state::xyz2rqf ) if(b>=0) fifoout_push(16384); else - fifoout_push((UINT32)-16384); + fifoout_push((uint32_t)-16384); } else - fifoout_push((INT16)(atan2(b, norm)*32768/M_PI)); + fifoout_push((int16_t)(atan2(b, norm)*32768/M_PI)); next_fn(); } @@ -794,8 +794,8 @@ TGP_FUNCTION( model1_state::f43_swa ) TGP_FUNCTION( model1_state::track_read_tri ) { - const UINT32 *tgp_data = (const UINT32 *)memregion("user2")->base(); - UINT32 a = fifoin_pop(); + const uint32_t *tgp_data = (const uint32_t *)memregion("user2")->base(); + uint32_t a = fifoin_pop(); int offd; logerror("TGP track_read_tri %d (%x)\n", a, m_pushpc); @@ -892,8 +892,8 @@ TGP_FUNCTION( model1_state::f47 ) TGP_FUNCTION( model1_state::track_read_info ) { - const UINT32 *tgp_data = (const UINT32 *)memregion("user2")->base(); - UINT16 a = fifoin_pop(); + const uint32_t *tgp_data = (const uint32_t *)memregion("user2")->base(); + uint16_t a = fifoin_pop(); int offd; logerror("TGP track_read_info %d (%x)\n", a, m_pushpc); @@ -1039,15 +1039,15 @@ static void tri_calc_pq(float ax, float ay, float bx, float by, float cx, float TGP_FUNCTION( model1_state::track_lookup ) { - const UINT32 *tgp_data = (const UINT32 *)memregion("user2")->base(); + const uint32_t *tgp_data = (const uint32_t *)memregion("user2")->base(); float a = fifoin_pop_f(); - UINT32 b = fifoin_pop(); + uint32_t b = fifoin_pop(); float c = fifoin_pop_f(); float d = fifoin_pop_f(); int offi, offd, len; float dist; int i; - UINT32 entry; + uint32_t entry; float height; logerror("TGP track_lookup %f, 0x%x, %f, %f (%x)\n", a, b, c, d, m_pushpc); @@ -1103,7 +1103,7 @@ TGP_FUNCTION( model1_state::f56 ) float d = fifoin_pop_f(); float e = fifoin_pop_f(); float f = fifoin_pop_f(); - UINT32 g = fifoin_pop(); + uint32_t g = fifoin_pop(); (void)a; (void)b; (void)c; @@ -1119,7 +1119,7 @@ TGP_FUNCTION( model1_state::f56 ) TGP_FUNCTION( model1_state::int_normal ) { - const UINT32 *tgp_data = (const UINT32 *)memregion("user2")->base(); + const uint32_t *tgp_data = (const uint32_t *)memregion("user2")->base(); logerror("TGP int_normal (%x)\n", m_pushpc); fifoout_push_f(u2f(tgp_data[m_tgp_int_adr+12])); fifoout_push_f(u2f(tgp_data[m_tgp_int_adr+13])); @@ -1239,7 +1239,7 @@ TGP_FUNCTION( model1_state::distance ) TGP_FUNCTION( model1_state::car_move ) { - INT16 a = fifoin_pop(); + int16_t a = fifoin_pop(); float b = fifoin_pop_f(); float c = fifoin_pop_f(); float d = fifoin_pop_f(); @@ -1302,7 +1302,7 @@ TGP_FUNCTION( model1_state::cpa ) TGP_FUNCTION( model1_state::vmat_store ) { - UINT32 a = fifoin_pop(); + uint32_t a = fifoin_pop(); if(a<21) memcpy(m_mat_vector[a], m_cmat, sizeof(m_cmat)); else @@ -1313,7 +1313,7 @@ TGP_FUNCTION( model1_state::vmat_store ) TGP_FUNCTION( model1_state::vmat_restore ) { - UINT32 a = fifoin_pop(); + uint32_t a = fifoin_pop(); if(a<21) memcpy(m_cmat, m_mat_vector[a], sizeof(m_cmat)); else @@ -1324,8 +1324,8 @@ TGP_FUNCTION( model1_state::vmat_restore ) TGP_FUNCTION( model1_state::vmat_mul ) { - UINT32 a = fifoin_pop(); - UINT32 b = fifoin_pop(); + uint32_t a = fifoin_pop(); + uint32_t b = fifoin_pop(); if(a<21 && b<21) { m_mat_vector[b][0] = m_mat_vector[a][ 0]*m_cmat[0] + m_mat_vector[a][ 1]*m_cmat[3] + m_mat_vector[a][ 2]*m_cmat[6]; m_mat_vector[b][1] = m_mat_vector[a][ 0]*m_cmat[1] + m_mat_vector[a][ 1]*m_cmat[4] + m_mat_vector[a][ 2]*m_cmat[7]; @@ -1347,7 +1347,7 @@ TGP_FUNCTION( model1_state::vmat_mul ) TGP_FUNCTION( model1_state::vmat_read ) { - UINT32 a = fifoin_pop(); + uint32_t a = fifoin_pop(); logerror("TGP vmat_read %d (%x)\n", a, m_pushpc); if(a<21) { int i; @@ -1390,7 +1390,7 @@ TGP_FUNCTION( model1_state::f80 ) TGP_FUNCTION( model1_state::vmat_save ) { - UINT32 a = fifoin_pop(); + uint32_t a = fifoin_pop(); int i; logerror("TGP vmat_save 0x%x (%x)\n", a, m_pushpc); for(i=0; i<16; i++) @@ -1400,7 +1400,7 @@ TGP_FUNCTION( model1_state::vmat_save ) TGP_FUNCTION( model1_state::vmat_load ) { - UINT32 a = fifoin_pop(); + uint32_t a = fifoin_pop(); int i; logerror("TGP vmat_load 0x%x (%x)\n", a, m_pushpc); for(i=0; i<16; i++) @@ -1440,10 +1440,10 @@ TGP_FUNCTION( model1_state::groundbox_test ) TGP_FUNCTION( model1_state::f89 ) { - UINT32 a = fifoin_pop(); - UINT32 b = fifoin_pop(); - UINT32 c = fifoin_pop(); - UINT32 d = fifoin_pop(); + uint32_t a = fifoin_pop(); + uint32_t b = fifoin_pop(); + uint32_t c = fifoin_pop(); + uint32_t d = fifoin_pop(); (void)a; (void)b; (void)c; @@ -1476,7 +1476,7 @@ TGP_FUNCTION( model1_state::f93 ) TGP_FUNCTION( model1_state::f94 ) { - UINT32 a = fifoin_pop(); + uint32_t a = fifoin_pop(); (void)a; logerror("TGP f94 %d (%x)\n", a, m_pushpc); next_fn(); @@ -1510,7 +1510,7 @@ TGP_FUNCTION( model1_state::vmat_flatten ) TGP_FUNCTION( model1_state::vmat_load1 ) { - UINT32 a = fifoin_pop(); + uint32_t a = fifoin_pop(); logerror("TGP vmat_load1 0x%x (%x)\n", a, m_pushpc); memcpy(m_cmat, m_ram_data.get()+a, sizeof(m_cmat)); next_fn(); @@ -1541,7 +1541,7 @@ TGP_FUNCTION( model1_state::f98_load ) TGP_FUNCTION( model1_state::f98 ) { - UINT32 a = fifoin_pop(); + uint32_t a = fifoin_pop(); (void)a; logerror("TGP load list start %d (%x)\n", a, m_pushpc); m_fifoin_cbcount = m_list_length; @@ -1592,9 +1592,9 @@ TGP_FUNCTION( model1_state::f102 ) float c = fifoin_pop_f(); float d = fifoin_pop_f(); float e = fifoin_pop_f(); - UINT32 f = fifoin_pop(); - UINT32 g = fifoin_pop(); - UINT32 h = fifoin_pop(); + uint32_t f = fifoin_pop(); + uint32_t g = fifoin_pop(); + uint32_t h = fifoin_pop(); m_ccount++; @@ -1846,7 +1846,7 @@ TGP_FUNCTION( model1_state::dump ) TGP_FUNCTION( model1_state::function_get_vf ) { - UINT32 f = fifoin_pop() >> 23; + uint32_t f = fifoin_pop() >> 23; if(m_fifoout_rpos != m_fifoout_wpos) { int count = m_fifoout_wpos - m_fifoout_rpos; @@ -1869,7 +1869,7 @@ TGP_FUNCTION( model1_state::function_get_vf ) TGP_FUNCTION( model1_state::function_get_swa ) { - UINT32 f = fifoin_pop(); + uint32_t f = fifoin_pop(); if(m_fifoout_rpos != m_fifoout_wpos) { int count = m_fifoout_wpos - m_fifoout_rpos; @@ -1932,7 +1932,7 @@ WRITE16_MEMBER(model1_state::model1_tgp_copro_ram_w) { COMBINE_DATA(m_ram_latch+offset); if(offset) { - UINT32 v = m_ram_latch[0]|(m_ram_latch[1]<<16); + uint32_t v = m_ram_latch[0]|(m_ram_latch[1]<<16); logerror("TGP f0 ram write %04x, %08x (%f) (%x)\n", m_ram_adr, v, u2f(v), space.device().safe_pc()); m_ram_data[m_ram_adr] = v; m_ram_adr++; @@ -1941,7 +1941,7 @@ WRITE16_MEMBER(model1_state::model1_tgp_copro_ram_w) MACHINE_START_MEMBER(model1_state,model1) { - m_ram_data = std::make_unique(0x10000); + m_ram_data = std::make_unique(0x10000); save_pointer(NAME(m_ram_data.get()), 0x10000); save_item(NAME(m_ram_adr)); @@ -2012,7 +2012,7 @@ READ_LINE_MEMBER(model1_state::copro_fifoin_pop_ok) READ32_MEMBER(model1_state::copro_fifoin_pop) { - UINT32 r = m_copro_fifoin_data[m_copro_fifoin_rpos++]; + uint32_t r = m_copro_fifoin_data[m_copro_fifoin_rpos++]; if (m_copro_fifoin_rpos == FIFO_SIZE) { @@ -2025,7 +2025,7 @@ READ32_MEMBER(model1_state::copro_fifoin_pop) } -void model1_state::copro_fifoin_push(UINT32 data) +void model1_state::copro_fifoin_push(uint32_t data) { if (m_copro_fifoin_num == FIFO_SIZE) { @@ -2042,7 +2042,7 @@ void model1_state::copro_fifoin_push(UINT32 data) m_copro_fifoin_num++; } -UINT32 model1_state::copro_fifoout_pop() +uint32_t model1_state::copro_fifoout_pop() { if (m_copro_fifoout_num == 0) { @@ -2054,7 +2054,7 @@ UINT32 model1_state::copro_fifoout_pop() return 0; } - UINT32 r = m_copro_fifoout_data[m_copro_fifoout_rpos++]; + uint32_t r = m_copro_fifoout_data[m_copro_fifoout_rpos++]; if (m_copro_fifoout_rpos == FIFO_SIZE) { @@ -2111,7 +2111,7 @@ WRITE16_MEMBER(model1_state::model1_tgp_vr_adr_w) READ16_MEMBER(model1_state::model1_vr_tgp_ram_r) { - UINT16 r; + uint16_t r; if (!offset) { @@ -2140,7 +2140,7 @@ WRITE16_MEMBER(model1_state::model1_vr_tgp_ram_w) if (offset) { - UINT32 v = m_ram_latch[0]|(m_ram_latch[1]<<16); + uint32_t v = m_ram_latch[0]|(m_ram_latch[1]<<16); m_ram_data[m_ram_adr&0x7fff] = v; if ( m_ram_adr & 0x8000 ) m_ram_adr++; diff --git a/src/mame/machine/model3.cpp b/src/mame/machine/model3.cpp index 1cfb25e48f8..385c87e4535 100644 --- a/src/mame/machine/model3.cpp +++ b/src/mame/machine/model3.cpp @@ -23,7 +23,7 @@ #define NEXT(new_state) fsm[m_tap_state][new_state] -static const INT32 fsm[][2] = { +static const int32_t fsm[][2] = { { 1, 0 }, // 0 Test-Logic/Reset { 1, 2 }, // 1 Run-Test/Idle { 3, 9 }, // 2 Select-DR-Scan @@ -50,9 +50,9 @@ static const INT32 fsm[][2] = { * the MSB of the first byte in the buffer. */ -static void insert_bit(UINT8 *buf, INT32 bit_num, INT32 bit) +static void insert_bit(uint8_t *buf, int32_t bit_num, int32_t bit) { - INT32 bit_in_byte; + int32_t bit_in_byte; bit_in_byte = 7 - (bit_num & 7); @@ -66,7 +66,7 @@ static void insert_bit(UINT8 *buf, INT32 bit_num, INT32 bit) * Inserts a 32-bit ID code into the ID bit field. */ -void model3_state::insert_id(UINT32 id, INT32 start_bit) +void model3_state::insert_id(uint32_t id, int32_t start_bit) { for (int i = 31; i >= 0; i--) insert_bit(m_id_data, start_bit++, (id >> i) & 1); @@ -80,9 +80,9 @@ void model3_state::insert_id(UINT32 id, INT32 start_bit) * returned. */ -static int shift(UINT8 *data, INT32 num_bits) +static int shift(uint8_t *data, int32_t num_bits) { - INT32 i; + int32_t i; int shift_out, shift_in; /* @@ -150,7 +150,7 @@ void model3_state::tap_write(int tck, int tms, int tdi, int trst) switch (m_tap_state) { case 3: // Capture-DR - //printf("capture dr (IR = %08X%08X\n", (UINT32)(m_ir >> 32),(UINT32)(m_ir)); + //printf("capture dr (IR = %08X%08X\n", (uint32_t)(m_ir >> 32),(uint32_t)(m_ir)); if (m_ir == U64(0x000023fffffffffe)) { @@ -161,11 +161,11 @@ void model3_state::tap_write(int tck, int tms, int tdi, int trst) m_id_size = 41; - UINT64 res = 0x0040000000; + uint64_t res = 0x0040000000; int start_bit = 0; for (int i = 41; i >= 0; i--) - insert_bit(m_id_data, start_bit++, ((UINT64)(1 << i) & res) ? 1 : 0); + insert_bit(m_id_data, start_bit++, ((uint64_t)(1 << i) & res) ? 1 : 0); } else if (m_ir == U64(0x00000c631f8c7ffe)) { @@ -195,7 +195,7 @@ void model3_state::tap_write(int tck, int tms, int tdi, int trst) m_tdo = m_ir & 1; // shift LSB to output m_ir >>= 1; - m_ir |= ((UINT64) tdi << 45); + m_ir |= ((uint64_t) tdi << 45); break; case 15: // Update-IR @@ -290,7 +290,7 @@ void model3_state::tap_reset() /*****************************************************************************/ /* Epson RTC-72421 */ -static UINT8 rtc_get_reg(running_machine &machine, int reg) +static uint8_t rtc_get_reg(running_machine &machine, int reg) { system_time systime; @@ -354,7 +354,7 @@ static UINT8 rtc_get_reg(running_machine &machine, int reg) READ32_MEMBER(model3_state::rtc72421_r) { int reg = offset; - UINT32 data; + uint32_t data; data = rtc_get_reg(machine(), reg) << 24; data |= 0x30000; /* these bits are set to pass the battery voltage test */ return data; diff --git a/src/mame/machine/ms7004.cpp b/src/mame/machine/ms7004.cpp index f93c5854431..8f3ed681309 100644 --- a/src/mame/machine/ms7004.cpp +++ b/src/mame/machine/ms7004.cpp @@ -354,7 +354,7 @@ ioport_constructor ms7004_device::device_input_ports() const // ms7004_device - constructor //------------------------------------------------- -ms7004_device::ms7004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ms7004_device::ms7004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MS7004, "MS7004 keyboard", tag, owner, clock, "ms7004", __FILE__), m_maincpu(*this, MS7004_CPU_TAG), m_speaker(*this, MS7004_SPK_TAG), diff --git a/src/mame/machine/ms7004.h b/src/mame/machine/ms7004.h index 563dce2da51..6453b9dfc90 100644 --- a/src/mame/machine/ms7004.h +++ b/src/mame/machine/ms7004.h @@ -36,7 +36,7 @@ class ms7004_device : public device_t //, public device_serial_interface { public: // construction/destruction - ms7004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ms7004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_tx_handler(device_t &device, _Object wr) { return downcast(device).m_tx_handler.set_callback(wr); } template static devcb_base &set_rts_handler(device_t &device, _Object wr) { return downcast(device).m_rts_handler.set_callback(wr); } @@ -64,8 +64,8 @@ private: required_ioport_array<16> m_kbd; int m_keylatch; // keyboard row latch - UINT8 m_p1; - UINT8 m_p2; + uint8_t m_p1; + uint8_t m_p2; devcb_write_line m_tx_handler; devcb_write_line m_rts_handler; diff --git a/src/mame/machine/msx.cpp b/src/mame/machine/msx.cpp index f55a90394f3..de154116dbd 100644 --- a/src/mame/machine/msx.cpp +++ b/src/mame/machine/msx.cpp @@ -61,7 +61,7 @@ void msx_state::machine_start() } -static const UINT8 cc_op[0x100] = { +static const uint8_t cc_op[0x100] = { 4+1,10+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, 4+1,11+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, 8+1,10+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1,12+1,11+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, 7+1,10+1,16+1, 6+1, 4+1, 4+1, 7+1, 4+1, 7+1,11+1,16+1, 6+1, 4+1, 4+1, 7+1, 4+1, @@ -80,7 +80,7 @@ static const UINT8 cc_op[0x100] = { 5+1,10+1,10+1, 4+1,10+1,11+1, 7+1,11+1, 5+1, 6+1,10+1, 4+1,10+1, 0 , 7+1,11+1 }; -static const UINT8 cc_cb[0x100] = { +static const uint8_t cc_cb[0x100] = { 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, @@ -99,7 +99,7 @@ static const UINT8 cc_cb[0x100] = { 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2 }; -static const UINT8 cc_ed[0x100] = { +static const uint8_t cc_ed[0x100] = { 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, @@ -118,7 +118,7 @@ static const UINT8 cc_ed[0x100] = { 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2 }; -static const UINT8 cc_xy[0x100] = { +static const uint8_t cc_xy[0x100] = { 4+4+2,10+4+2, 7+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, 4+4+2,11+4+2, 7+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, 8+4+2,10+4+2, 7+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2,12+4+2,11+4+2, 7+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, 7+4+2,10+4+2,16+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, 7+4+2,11+4+2,16+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, @@ -137,7 +137,7 @@ static const UINT8 cc_xy[0x100] = { 5+4+2,10+4+2,10+4+2, 4+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 6+4+2,10+4+2, 4+4+2,10+4+2, 4 +1, 7+4+2,11+4+2 }; -static const UINT8 cc_xycb[0x100] = { +static const uint8_t cc_xycb[0x100] = { 23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, 23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, 23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, @@ -157,7 +157,7 @@ static const UINT8 cc_xycb[0x100] = { }; /* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ -static const UINT8 cc_ex[0x100] = { +static const uint8_t cc_ex[0x100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* DJNZ */ 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, /* JR NZ/JR Z */ @@ -227,14 +227,14 @@ INTERRUPT_GEN_MEMBER(msx_state::msx_interrupt) READ8_MEMBER(msx_state::msx_psg_port_a_r) { - UINT8 data; + uint8_t data; data = (m_cassette->input() > 0.0038 ? 0x80 : 0); if ( (m_psg_b ^ m_io_dsw->read() ) & 0x40) { /* game port 2 */ - UINT8 inp = m_io_joy1->read(); + uint8_t inp = m_io_joy1->read(); if ( !(inp & 0x80) ) { /* joystick */ @@ -253,7 +253,7 @@ READ8_MEMBER(msx_state::msx_psg_port_a_r) else { /* game port 1 */ - UINT8 inp = m_io_joy0->read(); + uint8_t inp = m_io_joy0->read(); if ( !(inp & 0x80) ) { /* joystick */ @@ -359,7 +359,7 @@ WRITE8_MEMBER( msx_state::msx_ppi_port_c_w ) READ8_MEMBER( msx_state::msx_ppi_port_b_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; int row, data; row = m_keylatch; @@ -380,7 +380,7 @@ READ8_MEMBER( msx_state::msx_ppi_port_b_r ) * ***********************************************************************/ -void msx_state::install_slot_pages(device_t &owner, UINT8 prim, UINT8 sec, UINT8 page, UINT8 numpages, device_t *device) +void msx_state::install_slot_pages(device_t &owner, uint8_t prim, uint8_t sec, uint8_t page, uint8_t numpages, device_t *device) { msx_state &msx = downcast(owner); msx_internal_slot_interface *internal_slot = dynamic_cast(device); @@ -433,7 +433,7 @@ void msx_state::msx_memory_reset () } } -void msx_state::msx_memory_map_page (UINT8 page) +void msx_state::msx_memory_map_page (uint8_t page) { int slot_primary = (m_primary_slot >> (page * 2)) & 3; int slot_secondary = (m_secondary_slot[slot_primary] >> (page * 2)) & 3; @@ -443,7 +443,7 @@ void msx_state::msx_memory_map_page (UINT8 page) void msx_state::msx_memory_map_all () { - for (UINT8 i=0; i<4; i++) + for (uint8_t i=0; i<4; i++) msx_memory_map_page (i); } @@ -488,7 +488,7 @@ READ8_MEMBER( msx_state::msx_sec_slot_r ) READ8_MEMBER( msx_state::msx_kanji_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; if (offset && m_region_kanji) { diff --git a/src/mame/machine/msx_matsushita.cpp b/src/mame/machine/msx_matsushita.cpp index dd00841f5eb..8d1d6523ab6 100644 --- a/src/mame/machine/msx_matsushita.cpp +++ b/src/mame/machine/msx_matsushita.cpp @@ -7,7 +7,7 @@ const device_type MSX_MATSUSHITA = &device_creator; -msx_matsushita_device::msx_matsushita_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_matsushita_device::msx_matsushita_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_switched_device(mconfig, MSX_MATSUSHITA, "Matsushita switched device", tag, owner, clock, "msx_matsushita", __FILE__) , m_io_config(*this, "CONFIG") , m_nvram(*this, "nvram") @@ -20,7 +20,7 @@ msx_matsushita_device::msx_matsushita_device(const machine_config &mconfig, cons } -UINT8 msx_matsushita_device::get_id() +uint8_t msx_matsushita_device::get_id() { return 0x08; } @@ -76,7 +76,7 @@ READ8_MEMBER(msx_matsushita_device::io_read) case 0x03: { - UINT8 result = (((m_pattern & 0x80) ? m_nibble1 : m_nibble2) << 4) | ((m_pattern & 0x40) ? m_nibble1 : m_nibble2); + uint8_t result = (((m_pattern & 0x80) ? m_nibble1 : m_nibble2) << 4) | ((m_pattern & 0x40) ? m_nibble1 : m_nibble2); m_pattern = (m_pattern << 2) | (m_pattern >> 6); return result; } diff --git a/src/mame/machine/msx_matsushita.h b/src/mame/machine/msx_matsushita.h index 8f9d6a3479c..86d8c6d55af 100644 --- a/src/mame/machine/msx_matsushita.h +++ b/src/mame/machine/msx_matsushita.h @@ -21,7 +21,7 @@ extern const device_type MSX_MATSUSHITA; class msx_matsushita_device : public msx_switched_device { public: - msx_matsushita_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_matsushita_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_turbo_callback(device_t &device, _Object object) { return downcast(device).m_turbo_out_cb.set_callback(object); } @@ -29,7 +29,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const override; virtual ioport_constructor device_input_ports() const override; - virtual UINT8 get_id() override; + virtual uint8_t get_id() override; virtual DECLARE_READ8_MEMBER(io_read) override; virtual DECLARE_WRITE8_MEMBER(io_write) override; @@ -38,11 +38,11 @@ private: required_ioport m_io_config; required_device m_nvram; devcb_write_line m_turbo_out_cb; - UINT16 m_address; - std::vector m_sram; - UINT8 m_nibble1; - UINT8 m_nibble2; - UINT8 m_pattern; + uint16_t m_address; + std::vector m_sram; + uint8_t m_nibble1; + uint8_t m_nibble2; + uint8_t m_pattern; }; #endif diff --git a/src/mame/machine/msx_s1985.cpp b/src/mame/machine/msx_s1985.cpp index 762b82afa8f..00a09fc0850 100644 --- a/src/mame/machine/msx_s1985.cpp +++ b/src/mame/machine/msx_s1985.cpp @@ -7,7 +7,7 @@ const device_type MSX_S1985 = &device_creator; -msx_s1985_device::msx_s1985_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_s1985_device::msx_s1985_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_switched_device(mconfig, MSX_S1985, "MSX-Engine S1985", tag, owner, clock, "msx_s1985", __FILE__) , m_6_1(0) , m_6_2(0) @@ -16,7 +16,7 @@ msx_s1985_device::msx_s1985_device(const machine_config &mconfig, const char *ta } -UINT8 msx_s1985_device::get_id() +uint8_t msx_s1985_device::get_id() { return 0xFE; } @@ -31,7 +31,7 @@ READ8_MEMBER(msx_s1985_device::io_read) case 7: { - UINT8 data = (m_7 & 0x80) ? m_6_2 : m_6_1; + uint8_t data = (m_7 & 0x80) ? m_6_2 : m_6_1; m_7 = ( m_7 << 1 ) | ( m_7 >> 7 ); return data; } diff --git a/src/mame/machine/msx_s1985.h b/src/mame/machine/msx_s1985.h index 0a741ce5071..352e9a22692 100644 --- a/src/mame/machine/msx_s1985.h +++ b/src/mame/machine/msx_s1985.h @@ -17,17 +17,17 @@ extern const device_type MSX_S1985; class msx_s1985_device : public msx_switched_device { public: - msx_s1985_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_s1985_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT8 get_id() override; + virtual uint8_t get_id() override; virtual DECLARE_READ8_MEMBER(io_read) override; virtual DECLARE_WRITE8_MEMBER(io_write) override; private: - UINT8 m_6_1; - UINT8 m_6_2; - UINT8 m_7; + uint8_t m_6_1; + uint8_t m_6_2; + uint8_t m_7; }; #endif diff --git a/src/mame/machine/msx_switched.cpp b/src/mame/machine/msx_switched.cpp index f810f2c2dc2..160f4564ee0 100644 --- a/src/mame/machine/msx_switched.cpp +++ b/src/mame/machine/msx_switched.cpp @@ -4,7 +4,7 @@ #include "msx_switched.h" -msx_switched_device::msx_switched_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) +msx_switched_device::msx_switched_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -15,8 +15,8 @@ void msx_switched_device::device_start() address_space &space = dynamic_cast(owner())->space(); // Install IO read/write handlers - UINT16 start = ( get_id() << 8 ) | 0x00; - UINT16 end = ( get_id() << 8 ) | 0x0f; + uint16_t start = ( get_id() << 8 ) | 0x00; + uint16_t end = ( get_id() << 8 ) | 0x0f; space.install_read_handler(start, end, read8_delegate(FUNC(msx_switched_device::io_read), this)); space.install_write_handler(start, end, write8_delegate(FUNC(msx_switched_device::io_write), this)); } diff --git a/src/mame/machine/msx_switched.h b/src/mame/machine/msx_switched.h index 2b3c3c02c17..401787068f8 100644 --- a/src/mame/machine/msx_switched.h +++ b/src/mame/machine/msx_switched.h @@ -7,9 +7,9 @@ class msx_switched_device : public device_t { public: - msx_switched_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); + msx_switched_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); - virtual UINT8 get_id() = 0; + virtual uint8_t get_id() = 0; virtual DECLARE_READ8_MEMBER(io_read) = 0; virtual DECLARE_WRITE8_MEMBER(io_write) = 0; diff --git a/src/mame/machine/msx_systemflags.cpp b/src/mame/machine/msx_systemflags.cpp index ee443f79471..4ff1a5b2b42 100644 --- a/src/mame/machine/msx_systemflags.cpp +++ b/src/mame/machine/msx_systemflags.cpp @@ -7,7 +7,7 @@ const device_type MSX_SYSTEMFLAGS = &device_creator; -msx_systemflags_device::msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_systemflags_device::msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_SYSTEMFLAGS, "MSX System Flags", tag, owner, clock, "msx_systemflags", __FILE__) , m_initial_value(0xff) , m_system_flags(0xff) diff --git a/src/mame/machine/msx_systemflags.h b/src/mame/machine/msx_systemflags.h index 65e7bdb87ba..c91f8e9b364 100644 --- a/src/mame/machine/msx_systemflags.h +++ b/src/mame/machine/msx_systemflags.h @@ -20,10 +20,10 @@ extern const device_type MSX_SYSTEMFLAGS; class msx_systemflags_device : public device_t { public: - msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - static void set_initial_value(device_t &device, UINT8 initial_value) { dynamic_cast(device).m_initial_value = initial_value; } + static void set_initial_value(device_t &device, uint8_t initial_value) { dynamic_cast(device).m_initial_value = initial_value; } DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); @@ -32,8 +32,8 @@ protected: virtual void device_start() override; private: - UINT8 m_initial_value; - UINT8 m_system_flags; + uint8_t m_initial_value; + uint8_t m_system_flags; }; #endif diff --git a/src/mame/machine/mtx.cpp b/src/mame/machine/mtx.cpp index 6f6fb8acc17..0df25eedd63 100644 --- a/src/mame/machine/mtx.cpp +++ b/src/mame/machine/mtx.cpp @@ -56,7 +56,7 @@ READ8_MEMBER(mtx_state::mtx_strobe_r) by RAM in this mode. */ -void mtx_state::bankswitch(UINT8 data) +void mtx_state::bankswitch(uint8_t data) { /* @@ -75,9 +75,9 @@ void mtx_state::bankswitch(UINT8 data) address_space &program = m_maincpu->space(AS_PROGRAM); ram_device *messram = m_ram; -// UINT8 cbm_mode = data >> 7 & 0x01; - UINT8 rom_page = data >> 4 & 0x07; - UINT8 ram_page = data >> 0 & 0x0f; +// uint8_t cbm_mode = data >> 7 & 0x01; + uint8_t rom_page = data >> 4 & 0x07; + uint8_t ram_page = data >> 0 & 0x0f; /* set rom bank (switches between basic and assembler rom or cartridges) */ membank("bank2")->set_entry(rom_page); @@ -177,7 +177,7 @@ READ8_MEMBER(mtx_state::mtx_prt_r) */ - UINT8 data = 0; + uint8_t data = 0; /* reset STROBE to high */ m_centronics->write_strobe( TRUE); @@ -205,7 +205,7 @@ WRITE8_MEMBER(mtx_state::mtx_sense_w) READ8_MEMBER(mtx_state::mtx_key_lo_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!(m_key_sense & 0x01)) data &= ioport("ROW0")->read(); if (!(m_key_sense & 0x02)) data &= ioport("ROW1")->read(); @@ -225,7 +225,7 @@ READ8_MEMBER(mtx_state::mtx_key_lo_r) READ8_MEMBER(mtx_state::mtx_key_hi_r) { - UINT8 data = ioport("country_code")->read(); + uint8_t data = ioport("country_code")->read(); if (!(m_key_sense & 0x01)) data &= ioport("ROW0")->read() >> 8; if (!(m_key_sense & 0x02)) data &= ioport("ROW1")->read() >> 8; @@ -339,7 +339,7 @@ SNAPSHOT_LOAD_MEMBER( mtx_state, mtx ) { address_space &program = m_maincpu->space(AS_PROGRAM); void *ptr; - UINT8 header[18]; + uint8_t header[18]; // read header image.fread(&header, sizeof(header)); @@ -358,10 +358,10 @@ SNAPSHOT_LOAD_MEMBER( mtx_state, mtx ) image.message("Loading '%s'", tape_name); // start of system variables area - UINT16 system_variables_base = pick_integer_le(header, 16, 2); + uint16_t system_variables_base = pick_integer_le(header, 16, 2); // write system variables - UINT16 system_variables_size = 0; + uint16_t system_variables_size = 0; if (system_variables_base != 0) { @@ -371,7 +371,7 @@ SNAPSHOT_LOAD_MEMBER( mtx_state, mtx ) } // write actual image data - UINT16 data_size = snapshot_size - 18 - system_variables_size; + uint16_t data_size = snapshot_size - 18 - system_variables_size; ptr = program.get_write_ptr(0x4000); image.fread(ptr, 0x4000); diff --git a/src/mame/machine/mw8080bw.cpp b/src/mame/machine/mw8080bw.cpp index f9a2db214dd..1d081aa551f 100644 --- a/src/mame/machine/mw8080bw.cpp +++ b/src/mame/machine/mw8080bw.cpp @@ -16,10 +16,10 @@ * *************************************/ -UINT8 mw8080bw_state::vpos_to_vysnc_chain_counter( int vpos ) +uint8_t mw8080bw_state::vpos_to_vysnc_chain_counter( int vpos ) { /* convert from a vertical position to the actual values on the vertical sync counters */ - UINT8 counter; + uint8_t counter; int vblank = (vpos >= MW8080BW_VBSTART); if (vblank) @@ -31,7 +31,7 @@ UINT8 mw8080bw_state::vpos_to_vysnc_chain_counter( int vpos ) } -int mw8080bw_state::vysnc_chain_counter_to_vpos( UINT8 counter, int vblank ) +int mw8080bw_state::vysnc_chain_counter_to_vpos( uint8_t counter, int vblank ) { /* convert from the vertical sync counters to an actual vertical position */ int vpos; @@ -47,14 +47,14 @@ int mw8080bw_state::vysnc_chain_counter_to_vpos( UINT8 counter, int vblank ) TIMER_CALLBACK_MEMBER(mw8080bw_state::mw8080bw_interrupt_callback) { - UINT8 next_counter; + uint8_t next_counter; int next_vpos; int next_vblank; /* compute vector and set the interrupt line */ int vpos = m_screen->vpos(); - UINT8 counter = vpos_to_vysnc_chain_counter(vpos); - UINT8 vector = 0xc7 | ((counter & 0x40) >> 2) | ((~counter & 0x40) >> 3); + uint8_t counter = vpos_to_vysnc_chain_counter(vpos); + uint8_t vector = 0xc7 | ((counter & 0x40) >> 2) | ((~counter & 0x40) >> 3); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, vector); /* set up for next interrupt */ diff --git a/src/mame/machine/mz700.cpp b/src/mame/machine/mz700.cpp index 9d8e9fa0a85..8ffa62e528d 100644 --- a/src/mame/machine/mz700.cpp +++ b/src/mame/machine/mz700.cpp @@ -42,13 +42,13 @@ DRIVER_INIT_MEMBER(mz_state,mz700) m_mz700 = TRUE; m_mz700_mode = TRUE; - m_videoram = std::make_unique(0x1000); - memset(m_videoram.get(), 0, sizeof(UINT8) * 0x1000); + m_videoram = std::make_unique(0x1000); + memset(m_videoram.get(), 0, sizeof(uint8_t) * 0x1000); m_colorram = m_videoram.get() + 0x800; m_p_chargen = memregion("cgrom")->base(); - UINT8 *rom = memregion("monitor")->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *rom = memregion("monitor")->base(); + uint8_t *ram = m_ram->pointer(); membank("bankr0")->configure_entry(0, &ram[0]); // ram membank("bankr0")->configure_entry(1, &rom[0]); // rom membank("bankw0")->configure_entry(0, &ram[0]); // ram @@ -62,20 +62,20 @@ DRIVER_INIT_MEMBER(mz_state,mz800) m_mz700_mode = true;//FALSE; /* video ram */ - m_videoram = std::make_unique(0x4000); - memset(m_videoram.get(), 0, sizeof(UINT8) * 0x4000); + m_videoram = std::make_unique(0x4000); + memset(m_videoram.get(), 0, sizeof(uint8_t) * 0x4000); m_colorram = m_videoram.get() + 0x800; /* character generator ram */ - m_cgram = std::make_unique(0x1000); - memset(m_cgram.get(), 0, sizeof(UINT8) * 0x1000); + m_cgram = std::make_unique(0x1000); + memset(m_cgram.get(), 0, sizeof(uint8_t) * 0x1000); if (memregion("cgrom")) m_p_chargen = memregion("cgrom")->base(); else m_p_chargen = m_cgram.get(); - UINT8 *rom = memregion("monitor")->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *rom = memregion("monitor")->base(); + uint8_t *ram = m_ram->pointer(); // configure banks (0 = RAM in all cases) membank("bankr0")->configure_entry(0, &ram[0]); // ram membank("bankr0")->configure_entry(1, &rom[0]); // rom @@ -123,7 +123,7 @@ MACHINE_RESET_MEMBER( mz_state, mz800 ) READ8_MEMBER(mz_state::mz700_e008_r) { - UINT8 data = 0; + uint8_t data = 0; data |= m_other_timer; data |= ioport("JOY")->read(); @@ -478,7 +478,7 @@ READ8_MEMBER(mz_state::pio_port_b_r) int key_line = dynamic_cast(device)->read(); const char *const keynames[10] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" }; int i; - UINT8 res = 0; + uint8_t res = 0; for(i=0;i<10;i++) { @@ -497,7 +497,7 @@ READ8_MEMBER(mz_state::pio_port_b_r) */ READ8_MEMBER(mz_state::pio_port_c_r) { - UINT8 data = 0; + uint8_t data = 0; /* note: this is actually connected to Q output of the motor-control flip-flop (see below) */ if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) @@ -539,8 +539,8 @@ WRITE8_MEMBER(mz_state::pio_port_c_w) * bit 0 out unused */ -// UINT8 state = cassette_get_state(m_cassette); -// UINT8 action = ((~pio_port_c_output & 8) & (data & 8)); /* detect low-to-high transition */ +// uint8_t state = cassette_get_state(m_cassette); +// uint8_t action = ((~pio_port_c_output & 8) & (data & 8)); /* detect low-to-high transition */ /* The motor control circuit consists of a resistor, capacitor, invertor, nand-gate, and D flip-flop. The sense input from the cassette player goes low whenever play, rewind or fast-forward is pressed. @@ -570,8 +570,8 @@ WRITE8_MEMBER(mz_state::pio_port_c_w) * ******************************************************************************/ -//static UINT8 mz800_display_mode = 0; -//static UINT8 mz800_port_e8 = 0; +//static uint8_t mz800_display_mode = 0; +//static uint8_t mz800_port_e8 = 0; /*************************************************************************** @@ -595,7 +595,7 @@ WRITE_LINE_MEMBER(mz_state::write_centronics_perror) READ8_MEMBER(mz_state::mz800_z80pio_port_a_r) { - UINT8 result = 0; + uint8_t result = 0; result |= m_centronics_busy; result |= m_centronics_perror << 1; @@ -613,7 +613,7 @@ WRITE8_MEMBER(mz_state::mz800_z80pio_port_a_w) /* port CE */ READ8_MEMBER(mz_state::mz800_crtc_r) { - UINT8 data = 0x00; + uint8_t data = 0x00; LOG(1,"mz800_crtc_r",("%02X\n",data),machine()); return data; } @@ -622,8 +622,8 @@ READ8_MEMBER(mz_state::mz800_crtc_r) /* port EA */ READ8_MEMBER(mz_state::mz800_ramdisk_r) { - UINT8 *mem = memregion("user1")->base(); - UINT8 data = mem[m_mz800_ramaddr]; + uint8_t *mem = memregion("user1")->base(); + uint8_t data = mem[m_mz800_ramaddr]; LOG(2,"mz800_ramdisk_r",("[%04X] -> %02X\n", m_mz800_ramaddr, data),machine()); if (m_mz800_ramaddr++ == 0) LOG(1,"mz800_ramdisk_r",("address wrap 0000\n"),machine()); @@ -672,7 +672,7 @@ WRITE8_MEMBER(mz_state::mz800_scroll_border_w) /* port EA */ WRITE8_MEMBER(mz_state::mz800_ramdisk_w) { - UINT8 *mem = memregion("user1")->base(); + uint8_t *mem = memregion("user1")->base(); LOG(2,"mz800_ramdisk_w",("[%04X] <- %02X\n", m_mz800_ramaddr, data),machine()); mem[m_mz800_ramaddr] = data; if (m_mz800_ramaddr++ == 0) diff --git a/src/mame/machine/mz80.cpp b/src/mame/machine/mz80.cpp index 66abbff2e00..9b2b1f09807 100644 --- a/src/mame/machine/mz80.cpp +++ b/src/mame/machine/mz80.cpp @@ -37,7 +37,7 @@ READ8_MEMBER( mz80_state::mz80k_8255_portb_r ) READ8_MEMBER( mz80_state::mz80k_8255_portc_r ) { - UINT8 val = 0; + uint8_t val = 0; val |= m_mz80k_vertical ? 0x80 : 0x00; val |= ((m_mz80k_cursor_cnt & 0x3f) > 31) ? 0x40 : 0x00; val |= (m_cassette->get_state() & CASSETTE_MASK_UISTATE)== CASSETTE_PLAY ? 0x10 : 0x00; @@ -75,7 +75,7 @@ WRITE_LINE_MEMBER( mz80_state::pit_out2_changed ) READ8_MEMBER( mz80_state::mz80k_strobe_r ) { - return 0x7e | (UINT8)m_mz80k_tempo_strobe; + return 0x7e | (uint8_t)m_mz80k_tempo_strobe; } WRITE8_MEMBER( mz80_state::mz80k_strobe_w ) diff --git a/src/mame/machine/n64.cpp b/src/mame/machine/n64.cpp index 3feebf44431..4c81a8e427e 100644 --- a/src/mame/machine/n64.cpp +++ b/src/mame/machine/n64.cpp @@ -12,7 +12,7 @@ // device type definition const device_type N64PERIPH = &device_creator; -n64_periphs::n64_periphs(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +n64_periphs::n64_periphs(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, N64PERIPH, "N64 Periphal Chips", tag, owner, clock, "n64_periphs", __FILE__) , device_video_interface(mconfig, *this) , m_nvram_image(nullptr) @@ -20,13 +20,13 @@ n64_periphs::n64_periphs(const machine_config &mconfig, const char *tag, device_ , disk_present(false) , cart_present(false) { - for (INT32 i = 0; i < 256; i++) + for (int32_t i = 0; i < 256; i++) { m_gamma_table[i] = sqrt((float)(i << 6)); m_gamma_table[i] <<= 1; } - for (INT32 i = 0; i < 0x4000; i++) + for (int32_t i = 0; i < 0x4000; i++) { m_gamma_dither_table[i] = sqrt((float)i); m_gamma_dither_table[i] <<= 1; @@ -120,7 +120,7 @@ void n64_periphs::device_start() void n64_periphs::device_reset() { - UINT32 *cart = (UINT32*)machine().root_device().memregion("user2")->base(); + uint32_t *cart = (uint32_t*)machine().root_device().memregion("user2")->base(); m_vr4300 = machine().device("maincpu"); m_rsp = machine().device("rsp"); @@ -225,7 +225,7 @@ void n64_periphs::device_reset() reset_timer->adjust(attotime::never); // bootcode differs between CIC-chips, so we can use its checksum to detect the CIC-chip - UINT64 boot_checksum = 0; + uint64_t boot_checksum = 0; for(int i = 0x40; i < 0x1000; i+=4) { boot_checksum += cart[i/4]+i; @@ -308,7 +308,7 @@ void n64_periphs::device_reset() READ32_MEMBER( n64_periphs::mi_reg_r ) { - UINT32 ret = 0; + uint32_t ret = 0; switch (offset) { case 0x00/4: // MI_MODE_REG @@ -501,7 +501,7 @@ WRITE32_MEMBER( n64_periphs::is64_w ) READ32_MEMBER( n64_periphs::open_r ) { - UINT32 retval = (offset << 2) & 0x0000ffff; + uint32_t retval = (offset << 2) & 0x0000ffff; retval = ((retval + 2) << 16) | retval; return retval; } @@ -548,7 +548,7 @@ WRITE32_MEMBER( n64_periphs::rdram_reg_w ) void n64_periphs::sp_dma(int direction) { - UINT32 length = sp_dma_length + 1; + uint32_t length = sp_dma_length + 1; if ((length & 7) != 0) { @@ -569,15 +569,15 @@ void n64_periphs::sp_dma(int direction) length = 0x1000 - (sp_mem_addr & 0xfff); } - UINT32 *sp_mem[2] = { m_rsp_dmem, m_rsp_imem }; + uint32_t *sp_mem[2] = { m_rsp_dmem, m_rsp_imem }; int sp_mem_page = (sp_mem_addr >> 12) & 1; if(direction == 0)// RDRAM -> I/DMEM { for(int c = 0; c <= sp_dma_count; c++) { - UINT32 src = (sp_dram_addr & 0x007fffff) >> 2; - UINT32 dst = (sp_mem_addr & 0xfff) >> 2; + uint32_t src = (sp_dram_addr & 0x007fffff) >> 2; + uint32_t dst = (sp_mem_addr & 0xfff) >> 2; for(int i = 0; i < length / 4; i++) { @@ -594,8 +594,8 @@ void n64_periphs::sp_dma(int direction) { for(int c = 0; c <= sp_dma_count; c++) { - UINT32 src = (sp_mem_addr & 0xfff) >> 2; - UINT32 dst = (sp_dram_addr & 0x007fffff) >> 2; + uint32_t src = (sp_mem_addr & 0xfff) >> 2; + uint32_t dst = (sp_dram_addr & 0x007fffff) >> 2; for(int i = 0; i < length / 4; i++) { @@ -731,8 +731,8 @@ WRITE32_MEMBER(n64_periphs::sp_reg_w ) case 0x10/4: // RSP_STATUS_REG { - UINT32 oldstatus = m_rsp->state_int(RSP_SR); - UINT32 newstatus = oldstatus; + uint32_t oldstatus = m_rsp->state_int(RSP_SR); + uint32_t newstatus = oldstatus; if (data & 0x00000001) // clear halt { @@ -921,7 +921,7 @@ READ32_MEMBER( n64_periphs::dp_reg_r ) WRITE32_MEMBER( n64_periphs::dp_reg_w ) { - UINT32 status = m_n64->rdp()->get_status(); + uint32_t status = m_n64->rdp()->get_status(); switch (offset) { @@ -959,7 +959,7 @@ WRITE32_MEMBER( n64_periphs::dp_reg_w ) case 0x0c/4: // DP_STATUS_REG { - UINT32 current_status = m_n64->rdp()->get_status(); + uint32_t current_status = m_n64->rdp()->get_status(); if (data & 0x00000001) current_status &= ~DP_STATUS_XBUS_DMA; if (data & 0x00000002) current_status |= DP_STATUS_XBUS_DMA; if (data & 0x00000004) current_status &= ~DP_STATUS_FREEZE; @@ -1024,7 +1024,7 @@ void n64_periphs::vi_recalculate_resolution() READ32_MEMBER( n64_periphs::vi_reg_r ) { - UINT32 ret = 0; + uint32_t ret = 0; switch (offset) { case 0x00/4: // VI_CONTROL_REG @@ -1180,7 +1180,7 @@ WRITE32_MEMBER( n64_periphs::vi_reg_w ) // Audio Interface -void n64_periphs::ai_fifo_push(UINT32 address, UINT32 length) +void n64_periphs::ai_fifo_push(uint32_t address, uint32_t length) { if (ai_fifo_num == AUDIO_DMA_DEPTH) { @@ -1248,7 +1248,7 @@ n64_periphs::AUDIO_DMA *n64_periphs::ai_fifo_get_top() void n64_periphs::ai_dma() { - INT16 *ram = (INT16*)m_rdram; + int16_t *ram = (int16_t*)m_rdram; AUDIO_DMA *current = ai_fifo_get_top(); attotime period; @@ -1295,7 +1295,7 @@ void n64_periphs::ai_timer_tick() READ32_MEMBER( n64_periphs::ai_reg_r ) { - UINT32 ret = 0; + uint32_t ret = 0; switch (offset) { case 0x04/4: // AI_LEN_REG @@ -1307,7 +1307,7 @@ READ32_MEMBER( n64_periphs::ai_reg_r ) else if (ai_status & 0x40000000) { double secs_left = (ai_timer->expire() - machine().time()).as_double(); - unsigned int samples_left = (UINT32)(secs_left * (double)DACRATE_NTSC / (double)(ai_dacrate + 1)); + unsigned int samples_left = (uint32_t)(secs_left * (double)DACRATE_NTSC / (double)(ai_dacrate + 1)); ret = samples_left * 4; } else @@ -1380,43 +1380,43 @@ TIMER_CALLBACK_MEMBER(n64_periphs::pi_dma_callback) void n64_periphs::pi_dma_tick() { bool update_bm = false; - UINT16 *cart16; - UINT16 *dram16 = (UINT16*)m_rdram; + uint16_t *cart16; + uint16_t *dram16 = (uint16_t*)m_rdram; - UINT32 cart_addr = (pi_cart_addr & 0x0fffffff) >> 1; - UINT32 dram_addr = (pi_dram_addr & 0x007fffff) >> 1; + uint32_t cart_addr = (pi_cart_addr & 0x0fffffff) >> 1; + uint32_t dram_addr = (pi_dram_addr & 0x007fffff) >> 1; if(pi_cart_addr == 0x05000000 && dd_present) { update_bm = true; - cart16 = (UINT16*)dd_buffer; + cart16 = (uint16_t*)dd_buffer; cart_addr = (pi_cart_addr & 0x000003ff) >> 1; } else if(pi_cart_addr == 0x05000400 && dd_present) { update_bm = true; - cart16 = (UINT16*)dd_sector_data; + cart16 = (uint16_t*)dd_sector_data; cart_addr = (pi_cart_addr & 0x000000ff) >> 1; } else if((cart_addr & 0x04000000) == 0x04000000) { - cart16 = (UINT16*)m_sram; + cart16 = (uint16_t*)m_sram; cart_addr = (pi_cart_addr & 0x0001ffff) >> 1; } else if((cart_addr & 0x03000000) == 0x03000000 && dd_present) { - cart16 = (UINT16*)machine().root_device().memregion("ddipl")->base(); + cart16 = (uint16_t*)machine().root_device().memregion("ddipl")->base(); cart_addr = (pi_cart_addr & 0x003fffff) >> 1; } else { - cart16 = (UINT16*)machine().root_device().memregion("user2")->base(); + cart16 = (uint16_t*)machine().root_device().memregion("user2")->base(); cart_addr &= ((machine().root_device().memregion("user2")->bytes() >> 1) - 1); } if(pi_dma_dir == 1) { - UINT32 dma_length = pi_wr_len + 1 + 1; //Round Up Nearest 2 + uint32_t dma_length = pi_wr_len + 1 + 1; //Round Up Nearest 2 //logerror("PI Write, %X, %X, %X\n", pi_cart_addr, pi_dram_addr, pi_wr_len); if (pi_dram_addr != 0xffffffff) @@ -1432,7 +1432,7 @@ void n64_periphs::pi_dma_tick() } else { - UINT32 dma_length = pi_rd_len + 1 + 1; //Round Up Nearest 2 + uint32_t dma_length = pi_rd_len + 1 + 1; //Round Up Nearest 2 //logerror("PI Read, %X, %X, %X\n", pi_cart_addr, pi_dram_addr, pi_rd_len); if (pi_dram_addr != 0xffffffff) @@ -1460,7 +1460,7 @@ void n64_periphs::pi_dma_tick() READ32_MEMBER( n64_periphs::pi_reg_r ) { - UINT32 ret = 0; + uint32_t ret = 0; switch (offset) { case 0x00/4: // PI_DRAM_ADDR_REG @@ -1659,10 +1659,10 @@ WRITE32_MEMBER( n64_periphs::ri_reg_w ) } // Serial Interface -UINT8 n64_periphs::calc_mempak_crc(UINT8 *buffer, int length) +uint8_t n64_periphs::calc_mempak_crc(uint8_t *buffer, int length) { - UINT32 crc = 0; - UINT32 temp2 = 0; + uint32_t crc = 0; + uint32_t temp2 = 0; for(int i = 0; i <= length; i++) { @@ -1698,14 +1698,14 @@ UINT8 n64_periphs::calc_mempak_crc(UINT8 *buffer, int length) return crc; } -static inline UINT8 convert_to_bcd(int val) +static inline uint8_t convert_to_bcd(int val) { return ((val / 10) << 4) | (val % 10); } -int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sdata, int rlength, UINT8 *rdata) +int n64_periphs::pif_channel_handle_command(int channel, int slength, uint8_t *sdata, int rlength, uint8_t *rdata) { - UINT8 command = sdata[0]; + uint8_t command = sdata[0]; switch (command) { @@ -1760,7 +1760,7 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda case 0x01: // Read button values { - UINT16 buttons = 0; + uint16_t buttons = 0; int x = 0, y = 0; static const char *const portnames[] = { "P1", "P1_ANALOG_X", "P1_ANALOG_Y", "P1_MOUSE_X", "P1_MOUSE_Y", "P2", "P2_ANALOG_X", "P2_ANALOG_Y", "P2_MOUSE_X", "P2_MOUSE_Y", @@ -1792,14 +1792,14 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda rdata[0] = (buttons >> 8) & 0xff; rdata[1] = (buttons >> 0) & 0xff; - rdata[2] = (UINT8)(x); - rdata[3] = (UINT8)(y); + rdata[2] = (uint8_t)(x); + rdata[3] = (uint8_t)(y); return 0; case 2: //MOUSE buttons = machine().root_device().ioport(portnames[(channel*5) + 0])->read(); - x = (INT16)machine().root_device().ioport(portnames[(channel*5) + 1 + 2])->read();// - 128; - y = (INT16)machine().root_device().ioport(portnames[(channel*5) + 2 + 2])->read();// - 128; + x = (int16_t)machine().root_device().ioport(portnames[(channel*5) + 1 + 2])->read();// - 128; + y = (int16_t)machine().root_device().ioport(portnames[(channel*5) + 2 + 2])->read();// - 128; int mouse_dx = 0; int mouse_dy = 0; @@ -1846,8 +1846,8 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda rdata[0] = (buttons >> 8) & 0xff; rdata[1] = (buttons >> 0) & 0xff; - rdata[2] = (UINT8)(mouse_dx); - rdata[3] = (UINT8)(mouse_dy); + rdata[2] = (uint8_t)(mouse_dx); + rdata[3] = (uint8_t)(mouse_dy); return 0; } @@ -1859,7 +1859,7 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda case 0x02: // Read mempak { - UINT32 address; + uint32_t address; address = (sdata[1] << 8) | (sdata[2]); address &= ~0x1f; @@ -1889,7 +1889,7 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda } case 0x03: // Write mempak { - UINT32 address = (sdata[1] << 8) | (sdata[2]); + uint32_t address = (sdata[1] << 8) | (sdata[2]); address &= ~0x1f; if (address < 0x8000) @@ -1917,7 +1917,7 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda fatalerror("handle_pif: write EEPROM (bytes to send %d, bytes to receive %d)\n", slength, rlength); } - UINT16 block_offset = sdata[1] * 8; + uint16_t block_offset = sdata[1] * 8; for(int i=0; i < 8; i++) { @@ -1939,7 +1939,7 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda fatalerror("handle_pif: write EEPROM (bytes to send %d, bytes to receive %d)\n", slength, rlength); } - UINT16 block_offset = sdata[1] * 8; + uint16_t block_offset = sdata[1] * 8; for(int i = 0; i < 8; i++) { @@ -1999,7 +1999,7 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda void n64_periphs::handle_pif() { - UINT8 *ram = (UINT8*)pif_ram; + uint8_t *ram = (uint8_t*)pif_ram; if(pif_cmd[0x3f] == 0x1) // only handle the command if the last byte is 1 { int channel = 0; @@ -2008,7 +2008,7 @@ void n64_periphs::handle_pif() while(cmd_ptr < 0x3f && !end) { - INT8 bytes_to_send = (INT8)pif_cmd[cmd_ptr++]; + int8_t bytes_to_send = (int8_t)pif_cmd[cmd_ptr++]; if (bytes_to_send == -2) { @@ -2022,10 +2022,10 @@ void n64_periphs::handle_pif() { if(bytes_to_send > 0 && (bytes_to_send & 0xc0) == 0) { - UINT8 recv_buffer[0x40]; - UINT8 send_buffer[0x40]; + uint8_t recv_buffer[0x40]; + uint8_t send_buffer[0x40]; - INT8 bytes_to_recv = pif_cmd[cmd_ptr++]; + int8_t bytes_to_recv = pif_cmd[cmd_ptr++]; if (bytes_to_recv == -2) { @@ -2098,11 +2098,11 @@ void n64_periphs::pif_dma(int direction) if (direction) // RDRAM -> PIF RAM { - UINT32 *src = m_rdram + ((si_dram_addr & 0x1fffffff) / 4); + uint32_t *src = m_rdram + ((si_dram_addr & 0x1fffffff) / 4); for(int i = 0; i < 64; i+=4) { - UINT32 d = *src++; + uint32_t d = *src++; pif_ram[i+0] = (d >> 24) & 0xff; pif_ram[i+1] = (d >> 16) & 0xff; pif_ram[i+2] = (d >> 8) & 0xff; @@ -2115,11 +2115,11 @@ void n64_periphs::pif_dma(int direction) { handle_pif(); - UINT32 *dst = m_rdram + ((si_dram_addr & 0x1fffffff) / 4); + uint32_t *dst = m_rdram + ((si_dram_addr & 0x1fffffff) / 4); for(int i = 0; i < 64; i+=4) { - UINT32 d = 0; + uint32_t d = 0; d |= pif_ram[i+0] << 24; d |= pif_ram[i+1] << 16; d |= pif_ram[i+2] << 8; @@ -2132,7 +2132,7 @@ void n64_periphs::pif_dma(int direction) READ32_MEMBER( n64_periphs::si_reg_r ) { - UINT32 ret = 0; + uint32_t ret = 0; switch (offset) { //case 0x00/4: // SI_DRAM_ADDR_REG @@ -2194,9 +2194,9 @@ WRITE32_MEMBER( n64_periphs::si_reg_w ) void n64_periphs::dd_set_zone_and_track_offset() { - UINT16 head = (dd_track_reg & 0x1000) >> 9; // Head * 8 - UINT16 track = dd_track_reg & 0xFFF; - UINT16 tr_off = 0; + uint16_t head = (dd_track_reg & 0x1000) >> 9; // Head * 8 + uint16_t track = dd_track_reg & 0xFFF; + uint16_t tr_off = 0; if(track >= 0x425) { @@ -2336,9 +2336,9 @@ void n64_periphs::dd_update_bm() void n64_periphs::dd_write_sector() { - UINT8* sector; + uint8_t* sector; - sector = (UINT8*)machine().root_device().memregion("disk")->base(); + sector = (uint8_t*)machine().root_device().memregion("disk")->base(); sector += dd_track_offset; sector += dd_start_block * SECTORS_PER_BLOCK * ddZoneSecSize[dd_zone]; sector += (dd_current_reg - 1) * ddZoneSecSize[dd_zone]; @@ -2357,9 +2357,9 @@ void n64_periphs::dd_write_sector() void n64_periphs::dd_read_sector() { - UINT8* sector; + uint8_t* sector; - sector = (UINT8*)machine().root_device().memregion("disk")->base(); + sector = (uint8_t*)machine().root_device().memregion("disk")->base(); sector += dd_track_offset; sector += dd_start_block * SECTORS_PER_BLOCK * ddZoneSecSize[dd_zone]; sector += (dd_current_reg) * (dd_sector_size + 1); @@ -2401,7 +2401,7 @@ READ32_MEMBER( n64_periphs::dd_reg_r ) offset -= 0x500/4; - UINT32 ret = 0; + uint32_t ret = 0; switch(offset) { case 0x00/4: // DD Data @@ -2711,7 +2711,7 @@ void n64_state::n64_machine_stop() device_image_interface *image = dynamic_cast(periphs->m_nvram_image); - UINT8 data[0x30800]; + uint8_t data[0x30800]; if (m_sram != nullptr) { memset(data, 0, 0x20000); diff --git a/src/mame/machine/namco06.cpp b/src/mame/machine/namco06.cpp index ac41626fac3..40bf97858e5 100644 --- a/src/mame/machine/namco06.cpp +++ b/src/mame/machine/namco06.cpp @@ -102,7 +102,7 @@ TIMER_CALLBACK_MEMBER( namco_06xx_device::nmi_generate ) READ8_MEMBER( namco_06xx_device::data_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; LOG(("%s: 06XX '%s' read offset %d\n",machine().describe_context(),tag(),offset)); @@ -176,7 +176,7 @@ WRITE8_MEMBER( namco_06xx_device::ctrl_w ) const device_type NAMCO_06XX = &device_creator; -namco_06xx_device::namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_06xx_device::namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_06XX, "Namco 06xx", tag, owner, clock, "namco06xx", __FILE__) , m_control(0) , m_nmicpu(*this, finder_base::DUMMY_TAG) diff --git a/src/mame/machine/namco06.h b/src/mame/machine/namco06.h index 446009dbcec..04f4e56af28 100644 --- a/src/mame/machine/namco06.h +++ b/src/mame/machine/namco06.h @@ -63,7 +63,7 @@ struct namco_06xx_config class namco_06xx_device : public device_t { public: - namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_maincpu(device_t &device, const char *tag) { downcast(device).m_nmicpu.set_tag(tag); } @@ -97,7 +97,7 @@ private: TIMER_CALLBACK_MEMBER( nmi_generate ); // internal state - UINT8 m_control; + uint8_t m_control; emu_timer *m_nmi_timer; required_device m_nmicpu; diff --git a/src/mame/machine/namco50.cpp b/src/mame/machine/namco50.cpp index 21b592fa99c..62280849c39 100644 --- a/src/mame/machine/namco50.cpp +++ b/src/mame/machine/namco50.cpp @@ -163,7 +163,7 @@ READ8_MEMBER( namco_50xx_device::R2_r ) WRITE8_MEMBER( namco_50xx_device::O_w ) { - UINT8 out = (data & 0x0f); + uint8_t out = (data & 0x0f); if (data & 0x10) m_portO = (m_portO & 0x0f) | (out << 4); else @@ -205,7 +205,7 @@ WRITE_LINE_MEMBER(namco_50xx_device::read_request) READ8_MEMBER( namco_50xx_device::read ) { - UINT8 res = m_portO; + uint8_t res = m_portO; read_request(0); @@ -239,7 +239,7 @@ ROM_END const device_type NAMCO_50XX = &device_creator; -namco_50xx_device::namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_50xx_device::namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_50XX, "Namco 50xx", tag, owner, clock, "namco50", __FILE__), m_cpu(*this, "mcu"), m_latched_cmd(0), diff --git a/src/mame/machine/namco50.h b/src/mame/machine/namco50.h index dcf41eab22b..565bb4320b4 100644 --- a/src/mame/machine/namco50.h +++ b/src/mame/machine/namco50.h @@ -13,7 +13,7 @@ class namco_50xx_device : public device_t { public: - namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); WRITE8_MEMBER( write ); WRITE_LINE_MEMBER(read_request); @@ -37,9 +37,9 @@ protected: private: // internal state required_device m_cpu; - UINT8 m_latched_cmd; - UINT8 m_latched_rw; - UINT8 m_portO; + uint8_t m_latched_cmd; + uint8_t m_latched_rw; + uint8_t m_portO; }; extern const device_type NAMCO_50XX; diff --git a/src/mame/machine/namco51.cpp b/src/mame/machine/namco51.cpp index 8cfe739ad70..e9bc2dba237 100644 --- a/src/mame/machine/namco51.cpp +++ b/src/mame/machine/namco51.cpp @@ -342,7 +342,7 @@ ROM_END const device_type NAMCO_51XX = &device_creator; -namco_51xx_device::namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_51xx_device::namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_51XX, "Namco 51xx", tag, owner, clock, "namco51", __FILE__), m_cpu(*this, "mcu"), m_in_0(*this), diff --git a/src/mame/machine/namco51.h b/src/mame/machine/namco51.h index 2b46b3b8392..56c11d3d788 100644 --- a/src/mame/machine/namco51.h +++ b/src/mame/machine/namco51.h @@ -30,7 +30,7 @@ class namco_51xx_device : public device_t { public: - namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_input_0_callback(device_t &device, _Object object) { return downcast(device).m_in_0.set_callback(object); } template static devcb_base &set_input_1_callback(device_t &device, _Object object) { return downcast(device).m_in_1.set_callback(object); } @@ -59,16 +59,16 @@ private: devcb_write8 m_out_0; devcb_write8 m_out_1; - INT32 m_lastcoins; - INT32 m_lastbuttons; - INT32 m_credits; - INT32 m_coins[2]; - INT32 m_coins_per_cred[2]; - INT32 m_creds_per_coin[2]; - INT32 m_in_count; - INT32 m_mode; - INT32 m_coincred_mode; - INT32 m_remap_joy; + int32_t m_lastcoins; + int32_t m_lastbuttons; + int32_t m_credits; + int32_t m_coins[2]; + int32_t m_coins_per_cred[2]; + int32_t m_creds_per_coin[2]; + int32_t m_in_count; + int32_t m_mode; + int32_t m_coincred_mode; + int32_t m_remap_joy; }; extern const device_type NAMCO_51XX; diff --git a/src/mame/machine/namco53.cpp b/src/mame/machine/namco53.cpp index e94b9a867ec..4b1b29173db 100644 --- a/src/mame/machine/namco53.cpp +++ b/src/mame/machine/namco53.cpp @@ -80,7 +80,7 @@ READ8_MEMBER( namco_53xx_device::Rx_r ) WRITE8_MEMBER( namco_53xx_device::O_w ) { - UINT8 out = (data & 0x0f); + uint8_t out = (data & 0x0f); if (data & 0x10) m_portO = (m_portO & 0x0f) | (out << 4); else @@ -112,7 +112,7 @@ WRITE_LINE_MEMBER(namco_53xx_device::read_request) READ8_MEMBER( namco_53xx_device::read ) { - UINT8 res = m_portO; + uint8_t res = m_portO; read_request(0); @@ -145,7 +145,7 @@ ROM_END const device_type NAMCO_53XX = &device_creator; -namco_53xx_device::namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_53xx_device::namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_53XX, "Namco 53xx", tag, owner, clock, "namco53", __FILE__), m_cpu(*this, "mcu"), m_portO(0), diff --git a/src/mame/machine/namco53.h b/src/mame/machine/namco53.h index d74d335a6ed..ba23efe4123 100644 --- a/src/mame/machine/namco53.h +++ b/src/mame/machine/namco53.h @@ -30,7 +30,7 @@ class namco_53xx_device : public device_t { public: - namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_input_0_callback(device_t &device, _Object object) { return downcast(device).m_in_0.set_callback(object); } template static devcb_base &set_input_1_callback(device_t &device, _Object object) { return downcast(device).m_in_1.set_callback(object); } @@ -58,7 +58,7 @@ protected: private: // internal state required_device m_cpu; - UINT8 m_portO; + uint8_t m_portO; devcb_read8 m_k; devcb_read8 m_in_0; devcb_read8 m_in_1; diff --git a/src/mame/machine/namco62.cpp b/src/mame/machine/namco62.cpp index 99a7f647ef8..fbb676015f2 100644 --- a/src/mame/machine/namco62.cpp +++ b/src/mame/machine/namco62.cpp @@ -44,7 +44,7 @@ ROM_END const device_type NAMCO_62XX = &device_creator; -namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_62XX, "Namco 62xx", tag, owner, clock, "namco62", __FILE__), m_cpu(*this, "mcu"), m_in_0(*this), diff --git a/src/mame/machine/namco62.h b/src/mame/machine/namco62.h index 196866683c2..e41af64a221 100644 --- a/src/mame/machine/namco62.h +++ b/src/mame/machine/namco62.h @@ -30,7 +30,7 @@ class namco_62xx_device : public device_t { public: - namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_input_0_callback(device_t &device, _Object object) { return downcast(device).m_in_0.set_callback(object); } template static devcb_base &set_input_1_callback(device_t &device, _Object object) { return downcast(device).m_in_1.set_callback(object); } diff --git a/src/mame/machine/namco_settings.cpp b/src/mame/machine/namco_settings.cpp index ba028892786..24415e62684 100644 --- a/src/mame/machine/namco_settings.cpp +++ b/src/mame/machine/namco_settings.cpp @@ -5,7 +5,7 @@ const device_type NAMCO_SETTINGS = &device_creator; -namco_settings_device::namco_settings_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +namco_settings_device::namco_settings_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_SETTINGS, "Namco Settings", tag, owner, clock, "namco_settings", __FILE__) { } diff --git a/src/mame/machine/namco_settings.h b/src/mame/machine/namco_settings.h index 8bd18ad4346..7f8c8b4826b 100644 --- a/src/mame/machine/namco_settings.h +++ b/src/mame/machine/namco_settings.h @@ -11,7 +11,7 @@ class namco_settings_device : public device_t { public: - namco_settings_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_settings_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( ce_w ); DECLARE_WRITE_LINE_MEMBER( clk_w ); @@ -24,7 +24,7 @@ protected: private: int ce, clk, data; int cur_bit; - UINT8 adr, value; + uint8_t adr, value; }; extern const device_type NAMCO_SETTINGS; diff --git a/src/mame/machine/namcoic.cpp b/src/mame/machine/namcoic.cpp index 4925f3b142f..2fc579d8a0d 100644 --- a/src/mame/machine/namcoic.cpp +++ b/src/mame/machine/namcoic.cpp @@ -8,7 +8,7 @@ /**************************************************************************************/ static struct { - UINT16 control[0x40/2]; + uint16_t control[0x40/2]; /** * [0x1] 0x02/2 tilemap#0.scrollx * [0x3] 0x06/2 tilemap#0.scrolly @@ -22,10 +22,10 @@ static struct * 0x30/2 color */ tilemap_t *tmap[6]; - std::unique_ptr videoram; + std::unique_ptr videoram; int gfxbank; - UINT8 *maskBaseAddr; - void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask); + uint8_t *maskBaseAddr; + void (*cb)( running_machine &machine, uint16_t code, int *gfx, int *mask); } mTilemapInfo; void namco_tilemap_invalidate( void ) @@ -37,7 +37,7 @@ void namco_tilemap_invalidate( void ) } } /* namco_tilemap_invalidate */ -inline void namcos2_shared_state::namcoic_get_tile_info(tile_data &tileinfo,int tile_index,UINT16 *vram) +inline void namcos2_shared_state::namcoic_get_tile_info(tile_data &tileinfo,int tile_index,uint16_t *vram) { int tile, mask; mTilemapInfo.cb( machine(), vram[tile_index], &tile, &mask ); @@ -53,13 +53,13 @@ TILE_GET_INFO_MEMBER( namcos2_shared_state::get_tile_info4 ) { namcoic_get_tile_ TILE_GET_INFO_MEMBER( namcos2_shared_state::get_tile_info5 ) { namcoic_get_tile_info(tileinfo,tile_index,&mTilemapInfo.videoram[0x4408]); } void namcos2_shared_state::namco_tilemap_init( int gfxbank, void *maskBaseAddr, - void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask) ) + void (*cb)( running_machine &machine, uint16_t code, int *gfx, int *mask) ) { int i; mTilemapInfo.gfxbank = gfxbank; - mTilemapInfo.maskBaseAddr = (UINT8 *)maskBaseAddr; + mTilemapInfo.maskBaseAddr = (uint8_t *)maskBaseAddr; mTilemapInfo.cb = cb; - mTilemapInfo.videoram = std::make_unique( 0x10000 ); + mTilemapInfo.videoram = std::make_unique( 0x10000 ); /* four scrolling tilemaps */ mTilemapInfo.tmap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namcos2_shared_state::get_tile_info0),this),TILEMAP_SCAN_ROWS,8,8,64,64); @@ -101,7 +101,7 @@ namco_tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle } /* namco_tilemap_draw */ static void -SetTilemapVideoram( int offset, UINT16 newword ) +SetTilemapVideoram( int offset, uint16_t newword ) { mTilemapInfo.videoram[offset] = newword; if( offset<0x4000 ) @@ -122,7 +122,7 @@ SetTilemapVideoram( int offset, UINT16 newword ) WRITE16_MEMBER( namcos2_shared_state::c123_tilemap_videoram_w ) { - UINT16 newword = mTilemapInfo.videoram[offset]; + uint16_t newword = mTilemapInfo.videoram[offset]; COMBINE_DATA( &newword ); SetTilemapVideoram( offset, newword ); } @@ -133,7 +133,7 @@ READ16_MEMBER( namcos2_shared_state::c123_tilemap_videoram_r ) } static void -SetTilemapControl( int offset, UINT16 newword ) +SetTilemapControl( int offset, uint16_t newword ) { mTilemapInfo.control[offset] = newword; if( offset<0x20/2 ) @@ -185,7 +185,7 @@ SetTilemapControl( int offset, UINT16 newword ) WRITE16_MEMBER( namcos2_shared_state::c123_tilemap_control_w ) { - UINT16 newword = mTilemapInfo.control[offset]; + uint16_t newword = mTilemapInfo.control[offset]; COMBINE_DATA( &newword ); SetTilemapControl( offset, newword ); } @@ -201,7 +201,7 @@ READ16_MEMBER( namcos2_shared_state::c123_tilemap_control_r ) void namcos2_shared_state::zdrawgfxzoom( screen_device &screen, bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx, - UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, + uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy, int scalex, int scaley, int zpos ) { if (!scalex || !scaley) return; @@ -211,7 +211,7 @@ void namcos2_shared_state::zdrawgfxzoom( { int shadow_offset = (m_palette->shadows_enabled())?m_palette->entries():0; const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const UINT8 *source_base = gfx->get_data(code % gfx->elements()); + const uint8_t *source_base = gfx->get_data(code % gfx->elements()); int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16; int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16; if (sprite_screen_width && sprite_screen_height) @@ -277,9 +277,9 @@ void namcos2_shared_state::zdrawgfxzoom( { for( y=sy; y>16) * gfx->rowbytes(); - UINT16 *dest = &dest_bmp.pix16(y); - UINT8 *pri = &priority_bitmap.pix8(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint16_t *dest = &dest_bmp.pix16(y); + uint8_t *pri = &priority_bitmap.pix8(y); int x, x_index = x_index_base; if( m_c355_obj_palxor ) { @@ -344,7 +344,7 @@ void namcos2_shared_state::zdrawgfxzoom( void namcos2_shared_state::zdrawgfxzoom( screen_device &screen, bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, - UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, + uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy, int scalex, int scaley, int zpos ) { /* nop */ @@ -463,7 +463,7 @@ void namcos2_state::draw_sprites_metalhawk(screen_device &screen, bitmap_ind16 & * --------xxxx---- color * x--------------- unknown */ - const UINT16 *pSource = m_spriteram; + const uint16_t *pSource = m_spriteram; rectangle rect; int loop; if( pri==0 ) @@ -564,10 +564,10 @@ READ16_MEMBER( namcos2_shared_state::c355_obj_position_r ) return m_c355_obj_position[offset]; } -static inline UINT8 -nth_byte16( const UINT16 *pSource, int which ) +static inline uint8_t +nth_byte16( const uint16_t *pSource, int which ) { - UINT16 data = pSource[which/2]; + uint16_t data = pSource[which/2]; if( which&1 ) { return data&0xff; @@ -582,10 +582,10 @@ nth_byte16( const UINT16 *pSource, int which ) * read from 32-bit aligned memory as if it were an array of 16 bit words. */ #ifdef UNUSED_FUNCTION -static inline UINT16 -nth_word32( const UINT32 *pSource, int which ) +static inline uint16_t +nth_word32( const uint32_t *pSource, int which ) { - UINT32 data = pSource[which/2]; + uint32_t data = pSource[which/2]; if( which&1 ) { return data&0xffff; @@ -601,10 +601,10 @@ nth_word32( const UINT32 *pSource, int which ) * read from 32-bit aligned memory as if it were an array of bytes. */ #ifdef UNUSED_FUNCTION -static inline UINT8 -nth_byte32( const UINT32 *pSource, int which ) +static inline uint8_t +nth_byte32( const uint32_t *pSource, int which ) { - UINT32 data = pSource[which/4]; + uint32_t data = pSource[which/4]; switch( which&3 ) { case 0: return data>>24; @@ -628,30 +628,30 @@ nth_byte32( const UINT32 *pSource, int which ) * 0x14000 sprite list (page1) */ template -void namcos2_shared_state::c355_obj_draw_sprite(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, const UINT16 *pSource, int pri, int zpos ) +void namcos2_shared_state::c355_obj_draw_sprite(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, const uint16_t *pSource, int pri, int zpos ) { - UINT16 *spriteram16 = m_c355_obj_ram; + uint16_t *spriteram16 = m_c355_obj_ram; unsigned screen_height_remaining, screen_width_remaining; unsigned source_height_remaining, source_width_remaining; int hpos,vpos; - UINT16 hsize,vsize; - UINT16 palette; - UINT16 linkno; - UINT16 offset; - UINT16 format; + uint16_t hsize,vsize; + uint16_t palette; + uint16_t linkno; + uint16_t offset; + uint16_t format; int tile_index; int num_cols,num_rows; int dx,dy; int row,col; int sx,sy,tile; int flipx,flipy; - UINT32 zoomx, zoomy; + uint32_t zoomx, zoomy; int tile_screen_width; int tile_screen_height; - const UINT16 *spriteformat16 = &spriteram16[0x4000/2]; - const UINT16 *spritetile16 = &spriteram16[0x8000/2]; + const uint16_t *spriteformat16 = &spriteram16[0x4000/2]; + const uint16_t *spritetile16 = &spriteram16[0x8000/2]; int color; - const UINT16 *pWinAttr; + const uint16_t *pWinAttr; rectangle clip; int xscroll, yscroll; @@ -677,8 +677,8 @@ void namcos2_shared_state::c355_obj_draw_sprite(screen_device &screen, _BitmapCl if( linkno*4>=0x4000/2 ) return; /* avoid garbage memory reads */ - xscroll = (INT16)m_c355_obj_position[1]; - yscroll = (INT16)m_c355_obj_position[0]; + xscroll = (int16_t)m_c355_obj_position[1]; + yscroll = (int16_t)m_c355_obj_position[0]; // xscroll &= 0x3ff; if( xscroll & 0x200 ) xscroll |= ~0x3ff; xscroll &= 0x1ff; if( xscroll & 0x100 ) xscroll |= ~0x1ff; @@ -686,7 +686,7 @@ void namcos2_shared_state::c355_obj_draw_sprite(screen_device &screen, _BitmapCl if( bitmap.width() > 384 ) { /* Medium Resolution: System21 adjust */ - xscroll = (INT16)m_c355_obj_position[1]; + xscroll = (int16_t)m_c355_obj_position[1]; xscroll &= 0x3ff; if( xscroll & 0x200 ) xscroll |= ~0x3ff; if( yscroll<0 ) { /* solvalou */ @@ -829,13 +829,13 @@ void namcos2_shared_state::c355_obj_init(int gfxbank, int pal_xor, c355_obj_code } template -void namcos2_shared_state::c355_obj_draw_list(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, const UINT16 *pSpriteList16, const UINT16 *pSpriteTable) +void namcos2_shared_state::c355_obj_draw_list(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, const uint16_t *pSpriteList16, const uint16_t *pSpriteTable) { int i; /* draw the sprites */ for( i=0; i<256; i++ ) { - UINT16 which = pSpriteList16[i]; + uint16_t which = pSpriteList16[i]; c355_obj_draw_sprite(screen, bitmap, cliprect, &pSpriteTable[(which&0xff)*8], pri, i ); if( which&0x100 ) break; } @@ -894,7 +894,7 @@ READ16_MEMBER( namcos2_shared_state::c355_obj_ram_r ) */ void namcos2_shared_state::c169_roz_get_info(tile_data &tileinfo, int tile_index, int which) { - UINT16 tile = m_c169_roz_videoram[tile_index]; + uint16_t tile = m_c169_roz_videoram[tile_index]; int bank, mangle; switch (m_gametype) @@ -997,7 +997,7 @@ void namcos2_shared_state::c169_roz_init(int gfxbank, const char *maskregion) save_item(NAME(m_c169_roz_control)); } -void namcos2_shared_state::c169_roz_unpack_params(const UINT16 *source, roz_parameters ¶ms) +void namcos2_shared_state::c169_roz_unpack_params(const uint16_t *source, roz_parameters ¶ms) { const int xoffset = 36, yoffset = 3; @@ -1009,7 +1009,7 @@ void namcos2_shared_state::c169_roz_unpack_params(const UINT16 *source, roz_para * --------.----xxxx color */ - UINT16 temp = source[1]; + uint16_t temp = source[1]; params.size = 512 << ((temp & 0x0300) >> 8); if (m_gametype == NAMCOFL_SPEED_RACER || m_gametype == NAMCOFL_FINAL_LAP_R) params.color = (temp & 0x0007) * 256; @@ -1020,23 +1020,23 @@ void namcos2_shared_state::c169_roz_unpack_params(const UINT16 *source, roz_para temp = source[2]; params.left = (temp & 0x7000) >> 3; if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend - params.incxx = INT16(temp); + params.incxx = int16_t(temp); temp = source[3]; params.top = (temp&0x7000)>>3; if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend - params.incxy = INT16(temp); + params.incxy = int16_t(temp); temp = source[4]; if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend - params.incyx = INT16(temp); + params.incyx = int16_t(temp); temp = source[5]; if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend - params.incyy = INT16(temp); + params.incyy = int16_t(temp); - params.startx = INT16(source[6]); - params.starty = INT16(source[7]); + params.startx = int16_t(source[6]); + params.starty = int16_t(source[7]); params.startx <<= 4; params.starty <<= 4; @@ -1056,23 +1056,23 @@ void namcos2_shared_state::c169_roz_draw_helper(screen_device &screen, bitmap_in { if (m_gametype != NAMCOFL_SPEED_RACER && m_gametype != NAMCOFL_FINAL_LAP_R) { - UINT32 size_mask = params.size - 1; + uint32_t size_mask = params.size - 1; bitmap_ind16 &srcbitmap = tmap.pixmap(); bitmap_ind8 &flagsbitmap = tmap.flagsmap(); - UINT32 startx = params.startx + clip.min_x * params.incxx + clip.min_y * params.incyx; - UINT32 starty = params.starty + clip.min_x * params.incxy + clip.min_y * params.incyy; + uint32_t startx = params.startx + clip.min_x * params.incxx + clip.min_y * params.incyx; + uint32_t starty = params.starty + clip.min_x * params.incxy + clip.min_y * params.incyy; int sx = clip.min_x; int sy = clip.min_y; while (sy <= clip.max_y) { int x = sx; - UINT32 cx = startx; - UINT32 cy = starty; - UINT16 *dest = &bitmap.pix(sy, sx); + uint32_t cx = startx; + uint32_t cy = starty; + uint16_t *dest = &bitmap.pix(sy, sx); while (x <= clip.max_x) { - UINT32 xpos = (((cx >> 16) & size_mask) + params.left) & 0xfff; - UINT32 ypos = (((cy >> 16) & size_mask) + params.top) & 0xfff; + uint32_t xpos = (((cx >> 16) & size_mask) + params.left) & 0xfff; + uint32_t ypos = (((cy >> 16) & size_mask) + params.top) & 0xfff; if (flagsbitmap.pix(ypos, xpos) & TILEMAP_PIXEL_LAYER0) *dest = srcbitmap.pix(ypos, xpos) + params.color; cx += params.incxx; @@ -1105,7 +1105,7 @@ void namcos2_shared_state::c169_roz_draw_scanline(screen_device &screen, bitmap_ { int row = line / 8; int offs = row * 0x100 + (line & 7) * 0x10 + 0xe080; - UINT16 *source = &m_c169_roz_videoram[offs / 2]; + uint16_t *source = &m_c169_roz_videoram[offs / 2]; // if enabled if ((source[1] & 0x8000) == 0) @@ -1131,8 +1131,8 @@ void namcos2_shared_state::c169_roz_draw(screen_device &screen, bitmap_ind16 &bi for (int which = 1; which >= 0; which--) { - const UINT16 *source = &m_c169_roz_control[which * 8]; - UINT16 attrs = source[1]; + const uint16_t *source = &m_c169_roz_control[which * 8]; + uint16_t attrs = source[1]; // if enabled if ((attrs & 0x8000) == 0) @@ -1171,7 +1171,7 @@ READ16_MEMBER( namcos2_shared_state::c169_roz_bank_r ) WRITE16_MEMBER( namcos2_shared_state::c169_roz_bank_w ) { - UINT16 old_data = m_c169_roz_bank[offset]; + uint16_t old_data = m_c169_roz_bank[offset]; COMBINE_DATA(&m_c169_roz_bank[offset]); if (m_c169_roz_bank[offset] != old_data) for (auto & elem : m_c169_roz_tilemap) diff --git a/src/mame/machine/namcoio.cpp b/src/mame/machine/namcoio.cpp index 4ac534279ce..335fe4ea84f 100644 --- a/src/mame/machine/namcoio.cpp +++ b/src/mame/machine/namcoio.cpp @@ -122,7 +122,7 @@ const device_type NAMCO56XX = &device_creator; const device_type NAMCO58XX = &device_creator; const device_type NAMCO59XX = &device_creator; -namcoio_device::namcoio_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +namcoio_device::namcoio_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, uint32_t clock, const char *shortname) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), m_in_0_cb(*this), m_in_1_cb(*this), @@ -133,19 +133,19 @@ namcoio_device::namcoio_device(const machine_config &mconfig, device_type type, { } -namco56xx_device::namco56xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco56xx_device::namco56xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : namcoio_device(mconfig, NAMCO56XX, "Namco 56xx", tag, owner, clock, "56xx") { m_device_type = TYPE_NAMCO56XX; } -namco58xx_device::namco58xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco58xx_device::namco58xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : namcoio_device(mconfig, NAMCO58XX, "Namco 58xx", tag, owner, clock, "58xx") { m_device_type = TYPE_NAMCO58XX; } -namco59xx_device::namco59xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco59xx_device::namco59xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : namcoio_device(mconfig, NAMCO59XX, "Namco 59xx", tag, owner, clock, "59xx") { m_device_type = TYPE_NAMCO59XX; diff --git a/src/mame/machine/namcoio.h b/src/mame/machine/namcoio.h index b28b2a9117d..40b8ac15b76 100644 --- a/src/mame/machine/namcoio.h +++ b/src/mame/machine/namcoio.h @@ -11,7 +11,7 @@ class namcoio_device : public device_t { public: - namcoio_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + namcoio_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); template static devcb_base &set_in_0_callback(device_t &device, _Object object) { return downcast(device).m_in_0_cb.set_callback(object); } template static devcb_base &set_in_1_callback(device_t &device, _Object object) { return downcast(device).m_in_1_cb.set_callback(object); } @@ -41,7 +41,7 @@ protected: }; // internal state - UINT8 m_ram[16]; + uint8_t m_ram[16]; devcb_read8 m_in_0_cb; devcb_read8 m_in_1_cb; @@ -51,12 +51,12 @@ protected: devcb_write8 m_out_1_cb; int m_reset; - INT32 m_lastcoins, m_lastbuttons; - INT32 m_credits; - INT32 m_coins[2]; - INT32 m_coins_per_cred[2]; - INT32 m_creds_per_coin[2]; - INT32 m_in_count; + int32_t m_lastcoins, m_lastbuttons; + int32_t m_credits; + int32_t m_coins[2]; + int32_t m_coins_per_cred[2]; + int32_t m_creds_per_coin[2]; + int32_t m_in_count; void handle_coins( int swap ); @@ -69,7 +69,7 @@ private: class namco56xx_device : public namcoio_device { public: - namco56xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco56xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void customio_run() override; }; @@ -77,7 +77,7 @@ public: class namco58xx_device : public namcoio_device { public: - namco58xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco58xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void customio_run() override; }; @@ -85,7 +85,7 @@ public: class namco59xx_device : public namcoio_device { public: - namco59xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco59xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void customio_run() override; }; diff --git a/src/mame/machine/namcomcu.cpp b/src/mame/machine/namcomcu.cpp index 803e1e53b58..307d2ac3ab6 100644 --- a/src/mame/machine/namcomcu.cpp +++ b/src/mame/machine/namcomcu.cpp @@ -53,27 +53,27 @@ ROM_START( c76 ) ROM_END -namco_c69_device::namco_c69_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_c69_device::namco_c69_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m37702m2_device(mconfig, NAMCO_C69, "C69 (M37702)", tag, owner, clock, "namcoc69", __FILE__) { } -namco_c70_device::namco_c70_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_c70_device::namco_c70_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m37702m2_device(mconfig, NAMCO_C70, "C70 (M37702)", tag, owner, clock, "namcoc70", __FILE__) { } -namco_c74_device::namco_c74_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_c74_device::namco_c74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m37702m2_device(mconfig, NAMCO_C74, "C74 (M37702)", tag, owner, clock, "namcoc74", __FILE__) { } -namco_c75_device::namco_c75_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_c75_device::namco_c75_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m37702m2_device(mconfig, NAMCO_C75, "C75 (M37702)", tag, owner, clock, "namcoc75", __FILE__) { } -namco_c76_device::namco_c76_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_c76_device::namco_c76_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m37702m2_device(mconfig, NAMCO_C76, "C76 (M37702)", tag, owner, clock, "namcoc76", __FILE__) { } diff --git a/src/mame/machine/namcomcu.h b/src/mame/machine/namcomcu.h index be4c4ab088e..31ae1e5dc28 100644 --- a/src/mame/machine/namcomcu.h +++ b/src/mame/machine/namcomcu.h @@ -11,7 +11,7 @@ class namco_c69_device : public m37702m2_device { public: - namco_c69_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_c69_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -20,7 +20,7 @@ protected: class namco_c70_device : public m37702m2_device { public: - namco_c70_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_c70_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -29,7 +29,7 @@ protected: class namco_c74_device : public m37702m2_device { public: - namco_c74_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_c74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -38,7 +38,7 @@ protected: class namco_c75_device : public m37702m2_device { public: - namco_c75_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_c75_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -47,7 +47,7 @@ protected: class namco_c76_device : public m37702m2_device { public: - namco_c76_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_c76_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/mame/machine/namcond1.cpp b/src/mame/machine/namcond1.cpp index be45ced175d..0c5fd6d7fab 100644 --- a/src/mame/machine/namcond1.cpp +++ b/src/mame/machine/namcond1.cpp @@ -27,8 +27,8 @@ void namcond1_state::machine_start() void namcond1_state::machine_reset() { #ifdef MAME_DEBUG - /*UINT8 *ROM = memregion(REGION_CPU1)->base();*/ - /*UINT32 debug_trigger_addr;*/ + /*uint8_t *ROM = memregion(REGION_CPU1)->base();*/ + /*uint32_t debug_trigger_addr;*/ /*int i;*/ #if 0 diff --git a/src/mame/machine/namcos1.cpp b/src/mame/machine/namcos1.cpp index 2e35f03beae..1a4b061884c 100644 --- a/src/mame/machine/namcos1.cpp +++ b/src/mame/machine/namcos1.cpp @@ -602,7 +602,7 @@ void namcos1_state::driver_init() { if ((i & 0x010000) == 0) { - UINT8 t = m_rom[i]; + uint8_t t = m_rom[i]; m_rom[i] = m_rom[i + 0x010000]; m_rom[i + 0x010000] = t; } diff --git a/src/mame/machine/namcos2.cpp b/src/mame/machine/namcos2.cpp index ab3b0662b6e..993157854aa 100644 --- a/src/mame/machine/namcos2.cpp +++ b/src/mame/machine/namcos2.cpp @@ -23,9 +23,9 @@ void (*namcos2_kickstart)(running_machine &machine, int internal); READ16_MEMBER( namcos2_state::namcos2_finallap_prot_r ) { - static const UINT16 table0[8] = { 0x0000,0x0040,0x0440,0x2440,0x2480,0xa080,0x8081,0x8041 }; - static const UINT16 table1[8] = { 0x0040,0x0060,0x0060,0x0860,0x0864,0x08e4,0x08e5,0x08a5 }; - UINT16 data; + static const uint16_t table0[8] = { 0x0000,0x0040,0x0440,0x2440,0x2480,0xa080,0x8081,0x8041 }; + static const uint16_t table1[8] = { 0x0040,0x0060,0x0060,0x0860,0x0864,0x08e4,0x08e5,0x08a5 }; + uint16_t data; switch( offset ) { @@ -102,7 +102,7 @@ void namcos2_shared_state::reset_all_subcpus(int state) MACHINE_START_MEMBER(namcos2_shared_state,namcos2) { namcos2_kickstart = nullptr; - m_eeprom = std::make_unique(m_eeprom_size); + m_eeprom = std::make_unique(m_eeprom_size); machine().device("nvram")->set_base(m_eeprom.get(), m_eeprom_size); m_posirq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos2_shared_state::namcos2_posirq_tick),this)); } @@ -163,7 +163,7 @@ WRITE16_MEMBER( namcos2_state::serial_comms_ram_w ){ READ16_MEMBER( namcos2_state::serial_comms_ctrl_r ) { - UINT16 retval = m_serial_comms_ctrl[offset]; + uint16_t retval = m_serial_comms_ctrl[offset]; switch(offset){ case 0x00: @@ -445,13 +445,13 @@ void namcos2_shared_state::init_c148() } } -UINT16 namcos2_shared_state::readwrite_c148( address_space &space, offs_t offset, UINT16 data, int bWrite ) +uint16_t namcos2_shared_state::readwrite_c148( address_space &space, offs_t offset, uint16_t data, int bWrite ) { offs_t addr = ((offset * 2) + 0x1c0000) & 0x1fe000; device_t *altcpu = nullptr; - UINT16 *pC148Reg = nullptr; - UINT16 *pC148RegAlt = nullptr; - UINT16 result = 0; + uint16_t *pC148Reg = nullptr; + uint16_t *pC148RegAlt = nullptr; + uint16_t result = 0; if (&space.device() == m_maincpu) { @@ -675,7 +675,7 @@ INTERRUPT_GEN_MEMBER(namcos2_shared_state::namcos2_68k_gpu_vblank) { /* only used by namcos21 */ //int scanline = get_posirq_scanline(); - INT32 scanline = 0x50+0x89; /* HACK for Winning Run */ + int32_t scanline = 0x50+0x89; /* HACK for Winning Run */ //printf( "namcos2_68k_gpu_vblank(%d)\n",m_68k_gpu_C148[NAMCOS2_C148_POSIRQ] ); adjust_posirq_timer(scanline); @@ -688,8 +688,8 @@ INTERRUPT_GEN_MEMBER(namcos2_shared_state::namcos2_68k_gpu_vblank) WRITE8_MEMBER( namcos2_shared_state::namcos2_sound_bankselect_w ) { - UINT8 *RAM= memregion("audiocpu")->base(); - UINT32 max = (memregion("audiocpu")->bytes() - 0x10000) / 0x4000; + uint8_t *RAM= memregion("audiocpu")->base(); + uint32_t max = (memregion("audiocpu")->bytes() - 0x10000) / 0x4000; int bank = ( data >> 4 ) % max; /* 991104.CAB */ membank(BANKED_SOUND_ROM)->set_base(&RAM[ 0x10000 + ( 0x4000 * bank ) ] ); } diff --git a/src/mame/machine/naomi.cpp b/src/mame/machine/naomi.cpp index a95a6302306..ce88e041838 100644 --- a/src/mame/machine/naomi.cpp +++ b/src/mame/machine/naomi.cpp @@ -57,7 +57,7 @@ READ64_MEMBER(naomi_state::naomi2_biose_idle_skip_r ) return dc_ram[0x2b0600/8]; } -UINT8 naomi_state::asciihex_to_dec(UINT8 in) +uint8_t naomi_state::asciihex_to_dec(uint8_t in) { if (in>=0x30 && in<=0x39) { @@ -94,8 +94,8 @@ void naomi_state::create_pic_from_retdat() if (rgn_hexregion && rgn_newregion) { - UINT8* hexregion = rgn_hexregion->base(); - UINT8* newregion = rgn_newregion->base(); + uint8_t* hexregion = rgn_hexregion->base(); + uint8_t* newregion = rgn_newregion->base(); int hexoffs = 0; @@ -112,11 +112,11 @@ void naomi_state::create_pic_from_retdat() for (offs2=0;offs2<0x20;offs2++) { - UINT8 ascii1 = hexregion[hexoffs+0]; - UINT8 ascii2 = hexregion[hexoffs+1]; - UINT8 dec1 = asciihex_to_dec(ascii1); - UINT8 dec2 = asciihex_to_dec(ascii2); - UINT8 val = dec1 << 4 | dec2; + uint8_t ascii1 = hexregion[hexoffs+0]; + uint8_t ascii2 = hexregion[hexoffs+1]; + uint8_t dec1 = asciihex_to_dec(ascii1); + uint8_t dec2 = asciihex_to_dec(ascii2); + uint8_t val = dec1 << 4 | dec2; //printf("%02x%02x", ascii1, ascii2); @@ -137,8 +137,8 @@ void naomi_state::create_pic_from_retdat() if (rgn_retregion && rgn_newregion) { - UINT8* retregion = rgn_retregion->base(); - UINT8* newregion = rgn_newregion->base(); + uint8_t* retregion = rgn_retregion->base(); + uint8_t* newregion = rgn_newregion->base(); int i; @@ -177,7 +177,7 @@ void naomi_state::create_pic_from_retdat() if (rgn_newregion) { - UINT8* newregion = rgn_newregion->base(); + uint8_t* newregion = rgn_newregion->base(); FILE *fp; char filename[256]; @@ -223,7 +223,7 @@ INPUT_CHANGED_MEMBER(naomi_state::naomi_mp_w) CUSTOM_INPUT_MEMBER(naomi_state::naomi_mp_r) { const char *tagptr = (const char *)param; - UINT8 retval = 0; + uint8_t retval = 0; for (int i = 0x80; i >= 0x08; i >>= 1) { diff --git a/src/mame/machine/naomibd.cpp b/src/mame/machine/naomibd.cpp index b5c0c093181..2ea0d246a80 100644 --- a/src/mame/machine/naomibd.cpp +++ b/src/mame/machine/naomibd.cpp @@ -70,7 +70,7 @@ DEVICE_ADDRESS_MAP_START(submap, 16, naomi_board) AM_RANGE(0x00, 0xff) AM_READ(default_r) ADDRESS_MAP_END -naomi_board::naomi_board(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +naomi_board::naomi_board(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : naomi_g1_device(mconfig, type, name, tag, owner, clock, shortname, source) { eeprom_tag = nullptr; @@ -110,7 +110,7 @@ void naomi_board::device_reset() dma_ready = false; } -void naomi_board::dma_get_position(UINT8 *&base, UINT32 &limit, bool to_mainram) +void naomi_board::dma_get_position(uint8_t *&base, uint32_t &limit, bool to_mainram) { if(!to_mainram) { base = nullptr; @@ -127,12 +127,12 @@ void naomi_board::dma_get_position(UINT8 *&base, UINT32 &limit, bool to_mainram) } board_get_buffer(base, limit); - UINT32 blimit = 0x20*dma_count - dma_cur_offset; + uint32_t blimit = 0x20*dma_count - dma_cur_offset; if(0 && limit > blimit) limit = blimit; } -void naomi_board::dma_advance(UINT32 size) +void naomi_board::dma_advance(uint32_t size) { dma_cur_offset += size; board_advance(size); @@ -157,9 +157,9 @@ READ16_MEMBER(naomi_board::rom_data_r) pio_ready = true; } - UINT8 *buffer; - UINT32 size; - UINT16 res; + uint8_t *buffer; + uint32_t size; + uint16_t res; board_get_buffer(buffer, size); assert(size > 1); res = buffer[0] | (buffer[1] << 8); @@ -212,7 +212,7 @@ READ16_MEMBER(naomi_board::default_r) return 0xffff; } -void naomi_board::board_write(offs_t offset, UINT16 data) +void naomi_board::board_write(offs_t offset, uint16_t data) { logerror("NAOMIBD: unhandled board write %08x, %04x\n", offset, data); } diff --git a/src/mame/machine/naomibd.h b/src/mame/machine/naomibd.h index a965833d3c2..6b087c66798 100644 --- a/src/mame/machine/naomibd.h +++ b/src/mame/machine/naomibd.h @@ -13,7 +13,7 @@ class naomi_board : public naomi_g1_device { public: - naomi_board(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + naomi_board(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); static void static_set_eeprom_tag(device_t &device, const char *_eeprom_tag); @@ -37,21 +37,21 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void dma_get_position(UINT8 *&base, UINT32 &limit, bool to_mainram) override; - virtual void dma_advance(UINT32 size) override; + virtual void dma_get_position(uint8_t *&base, uint32_t &limit, bool to_mainram) override; + virtual void dma_advance(uint32_t size) override; // To be defined in the underlying class - virtual void board_setup_address(UINT32 address, bool is_dma) = 0; - virtual void board_get_buffer(UINT8 *&base, UINT32 &limit) = 0; - virtual void board_advance(UINT32 size) = 0; + virtual void board_setup_address(uint32_t address, bool is_dma) = 0; + virtual void board_get_buffer(uint8_t *&base, uint32_t &limit) = 0; + virtual void board_advance(uint32_t size) = 0; // To be optionally defined in the underlying class - virtual void board_write(offs_t offset, UINT16 data); + virtual void board_write(offs_t offset, uint16_t data); - UINT32 rom_offset; + uint32_t rom_offset; private: - UINT32 dma_offset, dma_cur_offset; - UINT16 dma_count; + uint32_t dma_offset, dma_cur_offset; + uint16_t dma_count; bool pio_ready, dma_ready; const char *eeprom_tag; diff --git a/src/mame/machine/naomig1.cpp b/src/mame/machine/naomig1.cpp index 1a4cea48b13..c96a1afc6fc 100644 --- a/src/mame/machine/naomig1.cpp +++ b/src/mame/machine/naomig1.cpp @@ -25,7 +25,7 @@ DEVICE_ADDRESS_MAP_START(amap, 32, naomi_g1_device) AM_RANGE(0xf8, 0xfb) AM_READ(sb_gdlend_r) ADDRESS_MAP_END -naomi_g1_device::naomi_g1_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) +naomi_g1_device::naomi_g1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), irq_cb(*this) { @@ -114,15 +114,15 @@ READ32_MEMBER(naomi_g1_device::sb_gdst_r) WRITE32_MEMBER(naomi_g1_device::sb_gdst_w) { - UINT32 old = gdst; + uint32_t old = gdst; COMBINE_DATA(&gdst); gdst &= 1; logerror("G1: gdst_w %08x @ %08x\n", data, mem_mask); if(!old && gdst && gden) { // DMA starts - UINT32 adr = gdstar; - UINT32 len = gdlen; + uint32_t adr = gdstar; + uint32_t len = gdlen; // Deunan says round up to 32, doc says complete with zeroes. // Virtua Tennis requires one of the two to boot @@ -133,13 +133,13 @@ WRITE32_MEMBER(naomi_g1_device::sb_gdst_w) bool to_mainram = true; while(len) { - UINT8 *base; - UINT32 limit = len; + uint8_t *base; + uint32_t limit = len; dma_get_position(base, limit, to_mainram); if(!limit) break; - UINT32 tlen = limit > len ? len : limit; + uint32_t tlen = limit > len ? len : limit; dma(base, adr, tlen, to_mainram); adr += tlen; len -= tlen; @@ -149,7 +149,7 @@ WRITE32_MEMBER(naomi_g1_device::sb_gdst_w) while(len && to_mainram) { unsigned char zero[32]; memset(zero, 0, sizeof(zero)); - UINT32 tlen = len > 32 ? 32 : len; + uint32_t tlen = len > 32 ? 32 : len; dma(zero, adr, tlen, to_mainram); adr += tlen; len -= tlen; @@ -229,7 +229,7 @@ READ32_MEMBER(naomi_g1_device::sb_gdlend_r) return 0; } -void naomi_g1_device::dma(void *dma_ptr, UINT32 main_adr, UINT32 size, bool to_mainram) +void naomi_g1_device::dma(void *dma_ptr, uint32_t main_adr, uint32_t size, bool to_mainram) { if(!_dma_cb.isnull()) _dma_cb(main_adr, dma_ptr, size >> 5, 32, to_mainram); diff --git a/src/mame/machine/naomig1.h b/src/mame/machine/naomig1.h index 0ab82cf134f..c833bb114d3 100644 --- a/src/mame/machine/naomig1.h +++ b/src/mame/machine/naomig1.h @@ -16,9 +16,9 @@ public: DMA_GDROM_IRQ }; - typedef delegate dma_cb; + typedef delegate dma_cb; - naomi_g1_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); + naomi_g1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); template void set_irq_cb(_cb cb) { irq_cb.set_callback(cb); } void set_dma_cb(dma_cb _cb) { _dma_cb = _cb; } @@ -57,17 +57,17 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void dma_get_position(UINT8 *&base, UINT32 &limit, bool to_maincpu) = 0; - virtual void dma_advance(UINT32 size) = 0; + virtual void dma_get_position(uint8_t *&base, uint32_t &limit, bool to_maincpu) = 0; + virtual void dma_advance(uint32_t size) = 0; private: - UINT32 gdstar, gdlen, gddir, gden, gdst; + uint32_t gdstar, gdlen, gddir, gden, gdst; emu_timer *timer; devcb_write8 irq_cb; dma_cb _dma_cb; - void dma(void *dma_ptr, UINT32 main_adr, UINT32 size, bool to_mainram); + void dma(void *dma_ptr, uint32_t main_adr, uint32_t size, bool to_mainram); }; #endif diff --git a/src/mame/machine/naomigd.cpp b/src/mame/machine/naomigd.cpp index 0362448e1ce..128d21f7509 100644 --- a/src/mame/machine/naomigd.cpp +++ b/src/mame/machine/naomigd.cpp @@ -26,17 +26,17 @@ const device_type NAOMI_GDROM_BOARD = &device_creator; -const UINT32 naomi_gdrom_board::DES_LEFTSWAP[] = { +const uint32_t naomi_gdrom_board::DES_LEFTSWAP[] = { 0x00000000, 0x00000001, 0x00000100, 0x00000101, 0x00010000, 0x00010001, 0x00010100, 0x00010101, 0x01000000, 0x01000001, 0x01000100, 0x01000101, 0x01010000, 0x01010001, 0x01010100, 0x01010101 }; -const UINT32 naomi_gdrom_board::DES_RIGHTSWAP[] = { +const uint32_t naomi_gdrom_board::DES_RIGHTSWAP[] = { 0x00000000, 0x01000000, 0x00010000, 0x01010000, 0x00000100, 0x01000100, 0x00010100, 0x01010100, 0x00000001, 0x01000001, 0x00010001, 0x01010001, 0x00000101, 0x01000101, 0x00010101, 0x01010101, }; -const UINT32 naomi_gdrom_board::DES_SBOX1[] = { +const uint32_t naomi_gdrom_board::DES_SBOX1[] = { 0x00808200, 0x00000000, 0x00008000, 0x00808202, 0x00808002, 0x00008202, 0x00000002, 0x00008000, 0x00000200, 0x00808200, 0x00808202, 0x00000200, 0x00800202, 0x00808002, 0x00800000, 0x00000002, 0x00000202, 0x00800200, 0x00800200, 0x00008200, 0x00008200, 0x00808000, 0x00808000, 0x00800202, @@ -47,7 +47,7 @@ const UINT32 naomi_gdrom_board::DES_SBOX1[] = { 0x00000202, 0x00800200, 0x00800200, 0x00000000, 0x00008002, 0x00008200, 0x00000000, 0x00808002 }; -const UINT32 naomi_gdrom_board::DES_SBOX2[] = { +const uint32_t naomi_gdrom_board::DES_SBOX2[] = { 0x40084010, 0x40004000, 0x00004000, 0x00084010, 0x00080000, 0x00000010, 0x40080010, 0x40004010, 0x40000010, 0x40084010, 0x40084000, 0x40000000, 0x40004000, 0x00080000, 0x00000010, 0x40080010, 0x00084000, 0x00080010, 0x40004010, 0x00000000, 0x40000000, 0x00004000, 0x00084010, 0x40080000, @@ -58,7 +58,7 @@ const UINT32 naomi_gdrom_board::DES_SBOX2[] = { 0x00084000, 0x00000000, 0x40004000, 0x00004010, 0x40000000, 0x40080010, 0x40084010, 0x00084000 }; -const UINT32 naomi_gdrom_board::DES_SBOX3[] = { +const uint32_t naomi_gdrom_board::DES_SBOX3[] = { 0x00000104, 0x04010100, 0x00000000, 0x04010004, 0x04000100, 0x00000000, 0x00010104, 0x04000100, 0x00010004, 0x04000004, 0x04000004, 0x00010000, 0x04010104, 0x00010004, 0x04010000, 0x00000104, 0x04000000, 0x00000004, 0x04010100, 0x00000100, 0x00010100, 0x04010000, 0x04010004, 0x00010104, @@ -69,7 +69,7 @@ const UINT32 naomi_gdrom_board::DES_SBOX3[] = { 0x04010000, 0x04000104, 0x00000104, 0x04010000, 0x00010104, 0x00000004, 0x04010004, 0x00010100 }; -const UINT32 naomi_gdrom_board::DES_SBOX4[] = { +const uint32_t naomi_gdrom_board::DES_SBOX4[] = { 0x80401000, 0x80001040, 0x80001040, 0x00000040, 0x00401040, 0x80400040, 0x80400000, 0x80001000, 0x00000000, 0x00401000, 0x00401000, 0x80401040, 0x80000040, 0x00000000, 0x00400040, 0x80400000, 0x80000000, 0x00001000, 0x00400000, 0x80401000, 0x00000040, 0x00400000, 0x80001000, 0x00001040, @@ -80,7 +80,7 @@ const UINT32 naomi_gdrom_board::DES_SBOX4[] = { 0x80001000, 0x00001040, 0x00400000, 0x80401000, 0x00000040, 0x00400000, 0x00001000, 0x00401040 }; -const UINT32 naomi_gdrom_board::DES_SBOX5[] = { +const uint32_t naomi_gdrom_board::DES_SBOX5[] = { 0x00000080, 0x01040080, 0x01040000, 0x21000080, 0x00040000, 0x00000080, 0x20000000, 0x01040000, 0x20040080, 0x00040000, 0x01000080, 0x20040080, 0x21000080, 0x21040000, 0x00040080, 0x20000000, 0x01000000, 0x20040000, 0x20040000, 0x00000000, 0x20000080, 0x21040080, 0x21040080, 0x01000080, @@ -91,7 +91,7 @@ const UINT32 naomi_gdrom_board::DES_SBOX5[] = { 0x00040080, 0x01000080, 0x20000080, 0x00040000, 0x00000000, 0x20040000, 0x01040080, 0x20000080 }; -const UINT32 naomi_gdrom_board::DES_SBOX6[] = { +const uint32_t naomi_gdrom_board::DES_SBOX6[] = { 0x10000008, 0x10200000, 0x00002000, 0x10202008, 0x10200000, 0x00000008, 0x10202008, 0x00200000, 0x10002000, 0x00202008, 0x00200000, 0x10000008, 0x00200008, 0x10002000, 0x10000000, 0x00002008, 0x00000000, 0x00200008, 0x10002008, 0x00002000, 0x00202000, 0x10002008, 0x00000008, 0x10200008, @@ -102,7 +102,7 @@ const UINT32 naomi_gdrom_board::DES_SBOX6[] = { 0x00002000, 0x00200008, 0x10002008, 0x00000000, 0x10202000, 0x10000000, 0x00200008, 0x10002008 }; -const UINT32 naomi_gdrom_board::DES_SBOX7[] = { +const uint32_t naomi_gdrom_board::DES_SBOX7[] = { 0x00100000, 0x02100001, 0x02000401, 0x00000000, 0x00000400, 0x02000401, 0x00100401, 0x02100400, 0x02100401, 0x00100000, 0x00000000, 0x02000001, 0x00000001, 0x02000000, 0x02100001, 0x00000401, 0x02000400, 0x00100401, 0x00100001, 0x02000400, 0x02000001, 0x02100000, 0x02100400, 0x00100001, @@ -113,7 +113,7 @@ const UINT32 naomi_gdrom_board::DES_SBOX7[] = { 0x00000000, 0x00100401, 0x02100000, 0x00000400, 0x02000001, 0x02000400, 0x00000400, 0x00100001 }; -const UINT32 naomi_gdrom_board::DES_SBOX8[] = { +const uint32_t naomi_gdrom_board::DES_SBOX8[] = { 0x08000820, 0x00000800, 0x00020000, 0x08020820, 0x08000000, 0x08000820, 0x00000020, 0x08000000, 0x00020020, 0x08020000, 0x08020820, 0x00020800, 0x08020800, 0x00020820, 0x00000800, 0x00000020, 0x08020000, 0x08000020, 0x08000800, 0x00000820, 0x00020800, 0x00020020, 0x08020020, 0x08020800, @@ -124,7 +124,7 @@ const UINT32 naomi_gdrom_board::DES_SBOX8[] = { 0x08020820, 0x00020800, 0x00020800, 0x00000820, 0x00000820, 0x00020020, 0x08000000, 0x08020800 }; -const UINT32 naomi_gdrom_board::DES_MASK_TABLE[] = { +const uint32_t naomi_gdrom_board::DES_MASK_TABLE[] = { 0x24000000, 0x10000000, 0x08000000, 0x02080000, 0x01000000, 0x00200000, 0x00100000, 0x00040000, 0x00020000, 0x00010000, 0x00002000, 0x00001000, 0x00000800, 0x00000400, 0x00000200, @@ -136,22 +136,22 @@ const UINT32 naomi_gdrom_board::DES_MASK_TABLE[] = { 0x00000020, 0x00000011, 0x00000004, 0x00000002 }; -const UINT8 naomi_gdrom_board::DES_ROTATE_TABLE[16] = { +const uint8_t naomi_gdrom_board::DES_ROTATE_TABLE[16] = { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 }; -void naomi_gdrom_board::permutate(UINT32 &a, UINT32 &b, UINT32 m, int shift) +void naomi_gdrom_board::permutate(uint32_t &a, uint32_t &b, uint32_t m, int shift) { - UINT32 temp; + uint32_t temp; temp = ((a>>shift) ^ b) & m; a ^= temp<> 32; - UINT32 r = key; + uint32_t l = key >> 32; + uint32_t r = key; permutate(r, l, 0x0f0f0f0f, 4); permutate(r, l, 0x10101010, 0); @@ -232,10 +232,10 @@ void naomi_gdrom_board::des_generate_subkeys(const UINT64 key, UINT32 *subkeys) } } -UINT64 naomi_gdrom_board::des_encrypt_decrypt(bool decrypt, UINT64 src, const UINT32 *des_subkeys) +uint64_t naomi_gdrom_board::des_encrypt_decrypt(bool decrypt, uint64_t src, const uint32_t *des_subkeys) { - UINT32 r = (src & 0x00000000ffffffffULL) >> 0; - UINT32 l = (src & 0xffffffff00000000ULL) >> 32; + uint32_t r = (src & 0x00000000ffffffffULL) >> 0; + uint32_t l = (src & 0xffffffff00000000ULL) >> 32; permutate(l, r, 0x0f0f0f0f, 4); permutate(l, r, 0x0000ffff, 16); @@ -250,7 +250,7 @@ UINT64 naomi_gdrom_board::des_encrypt_decrypt(bool decrypt, UINT64 src, const UI subkey = 0; for(int i = 0; i < 32 ; i+=4) { - UINT32 temp; + uint32_t temp; temp = ((r<<1) | (r>>31)) ^ des_subkeys[subkey]; l ^= DES_SBOX8[ (temp>>0) & 0x3f ]; @@ -291,12 +291,12 @@ UINT64 naomi_gdrom_board::des_encrypt_decrypt(bool decrypt, UINT64 src, const UI permutate(r, l, 0x0000ffff, 16); permutate(r, l, 0x0f0f0f0f, 4); - return (UINT64(r) << 32) | UINT64(l); + return (uint64_t(r) << 32) | uint64_t(l); } -UINT64 naomi_gdrom_board::rev64(UINT64 src) +uint64_t naomi_gdrom_board::rev64(uint64_t src) { - UINT64 ret; + uint64_t ret; ret = ((src & 0x00000000000000ffULL) << 56) | ((src & 0x000000000000ff00ULL) << 40) @@ -310,23 +310,23 @@ UINT64 naomi_gdrom_board::rev64(UINT64 src) return ret; } -UINT64 naomi_gdrom_board::read_to_qword(const UINT8 *region) +uint64_t naomi_gdrom_board::read_to_qword(const uint8_t *region) { - UINT64 ret = 0; + uint64_t ret = 0; for(int i=0;i<8;i++) - ret |= UINT64(region[i]) << (56-(8*i)); + ret |= uint64_t(region[i]) << (56-(8*i)); return ret; } -void naomi_gdrom_board::write_from_qword(UINT8 *region, UINT64 qword) +void naomi_gdrom_board::write_from_qword(uint8_t *region, uint64_t qword) { for(int i=0;i<8;i++) region[i] = qword >> (56-(i*8)); } -naomi_gdrom_board::naomi_gdrom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +naomi_gdrom_board::naomi_gdrom_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : naomi_board(mconfig, NAOMI_GDROM_BOARD, "Sega NAOMI GDROM Board", tag, owner, clock, "naomi_gdrom_board", __FILE__) { image_tag = nullptr; @@ -340,12 +340,12 @@ void naomi_gdrom_board::static_set_tags(device_t &device, const char *_image_tag dev.pic_tag = _pic_tag; } -void naomi_gdrom_board::find_file(const char *name, const UINT8 *dir_sector, UINT32 &file_start, UINT32 &file_size) +void naomi_gdrom_board::find_file(const char *name, const uint8_t *dir_sector, uint32_t &file_start, uint32_t &file_size) { file_start = 0; file_size = 0; logerror("Looking for file [%s]\n", name); - for(UINT32 pos = 0; pos < 2048; pos += dir_sector[pos]) { + for(uint32_t pos = 0; pos < 2048; pos += dir_sector[pos]) { int fnlen = 0; if(!(dir_sector[pos+25] & 2)) { int len = dir_sector[pos+32]; @@ -394,11 +394,11 @@ void naomi_gdrom_board::device_start() char name[128]; memset(name,'\0',128); - UINT64 key; - UINT8 netpic = 0; + uint64_t key; + uint8_t netpic = 0; memory_region *mr = memregion(pic_tag); - const UINT8 *picdata = mr->base(); + const uint8_t *picdata = mr->base(); if(picdata) { if(memregion(pic_tag)->bytes() >= 0x4000) { @@ -410,7 +410,7 @@ void naomi_gdrom_board::device_start() key = 0; for(int i=0;i<7;i++) - key |= UINT64(picdata[0x780+i*2]) << (56 - i*8); + key |= uint64_t(picdata[0x780+i*2]) << (56 - i*8); key |= picdata[0x7a0]; @@ -421,25 +421,25 @@ void naomi_gdrom_board::device_start() memcpy(name, picdata+33, 7); memcpy(name+7, picdata+25, 7); - key =((UINT64(picdata[0x31]) << 56) | - (UINT64(picdata[0x32]) << 48) | - (UINT64(picdata[0x33]) << 40) | - (UINT64(picdata[0x34]) << 32) | - (UINT64(picdata[0x35]) << 24) | - (UINT64(picdata[0x36]) << 16) | - (UINT64(picdata[0x37]) << 8) | - (UINT64(picdata[0x29]) << 0)); + key =((uint64_t(picdata[0x31]) << 56) | + (uint64_t(picdata[0x32]) << 48) | + (uint64_t(picdata[0x33]) << 40) | + (uint64_t(picdata[0x34]) << 32) | + (uint64_t(picdata[0x35]) << 24) | + (uint64_t(picdata[0x36]) << 16) | + (uint64_t(picdata[0x37]) << 8) | + (uint64_t(picdata[0x29]) << 0)); } - logerror("key is %08x%08x\n", (UINT32)((key & 0xffffffff00000000ULL)>>32), (UINT32)(key & 0x00000000ffffffffULL)); + logerror("key is %08x%08x\n", (uint32_t)((key & 0xffffffff00000000ULL)>>32), (uint32_t)(key & 0x00000000ffffffffULL)); - UINT8 buffer[2048]; + uint8_t buffer[2048]; cdrom_file *gdromfile = cdrom_open(machine().rom_load().get_disk_handle(image_tag)); // primary volume descriptor // read frame 0xb06e (frame=sector+150) // dimm board firmware starts straight from this frame cdrom_read_data(gdromfile, (netpic ? 0 : 45000) + 16, buffer, CD_TRACK_MODE1); - UINT32 path_table = ((buffer[0x8c+0] << 0) | + uint32_t path_table = ((buffer[0x8c+0] << 0) | (buffer[0x8c+1] << 8) | (buffer[0x8c+2] << 16) | (buffer[0x8c+3] << 24)); @@ -447,12 +447,12 @@ void naomi_gdrom_board::device_start() cdrom_read_data(gdromfile, path_table, buffer, CD_TRACK_MODE1); // directory - UINT8 dir_sector[2048]; + uint8_t dir_sector[2048]; // find data of file - UINT32 file_start, file_size; + uint32_t file_start, file_size; if (netpic == 0) { - UINT32 dir = ((buffer[0x2 + 0] << 0) | + uint32_t dir = ((buffer[0x2 + 0] << 0) | (buffer[0x2 + 1] << 8) | (buffer[0x2 + 2] << 16) | (buffer[0x2 + 3] << 24)); @@ -468,12 +468,12 @@ void naomi_gdrom_board::device_start() memcpy(name, buffer + 0xc0, FILENAME_LENGTH - 1); } } else { - UINT32 i = 0; + uint32_t i = 0; while (i < 2048 && buffer[i] != 0) { if (buffer[i] == 3 && buffer[i + 8] == 'R' && buffer[i + 9] == 'O' && buffer[i + 10] == 'M') // find ROM dir { - UINT32 dir = ((buffer[i + 2] << 0) | + uint32_t dir = ((buffer[i + 2] << 0) | (buffer[i + 3] << 8) | (buffer[i + 4] << 16) | (buffer[i + 5] << 24)); @@ -488,18 +488,18 @@ void naomi_gdrom_board::device_start() find_file(name, dir_sector, file_start, file_size); if (file_start) { - UINT32 file_rounded_size = (file_size + 2047) & -2048; + uint32_t file_rounded_size = (file_size + 2047) & -2048; for (dimm_data_size = 4096; dimm_data_size < file_rounded_size; dimm_data_size <<= 1); - dimm_data = auto_alloc_array(machine(), UINT8, dimm_data_size); + dimm_data = auto_alloc_array(machine(), uint8_t, dimm_data_size); if (dimm_data_size != file_rounded_size) memset(dimm_data + file_rounded_size, 0, dimm_data_size - file_rounded_size); // read encrypted data into dimm_data - UINT32 sectors = file_rounded_size / 2048; - for (UINT32 sec = 0; sec != sectors; sec++) + uint32_t sectors = file_rounded_size / 2048; + for (uint32_t sec = 0; sec != sectors; sec++) cdrom_read_data(gdromfile, file_start + sec, dimm_data + 2048 * sec, CD_TRACK_MODE1); - UINT32 des_subkeys[32]; + uint32_t des_subkeys[32]; des_generate_subkeys(rev64(key), des_subkeys); for (int i = 0; i < file_rounded_size; i += 8) @@ -523,18 +523,18 @@ void naomi_gdrom_board::device_reset() dimm_cur_address = 0; } -void naomi_gdrom_board::board_setup_address(UINT32 address, bool is_dma) +void naomi_gdrom_board::board_setup_address(uint32_t address, bool is_dma) { dimm_cur_address = address & (dimm_data_size-1); } -void naomi_gdrom_board::board_get_buffer(UINT8 *&base, UINT32 &limit) +void naomi_gdrom_board::board_get_buffer(uint8_t *&base, uint32_t &limit) { base = dimm_data + dimm_cur_address; limit = dimm_data_size - dimm_cur_address; } -void naomi_gdrom_board::board_advance(UINT32 size) +void naomi_gdrom_board::board_advance(uint32_t size) { dimm_cur_address += size; if(dimm_cur_address >= dimm_data_size) diff --git a/src/mame/machine/naomigd.h b/src/mame/machine/naomigd.h index 3590beb827c..cba137ef25b 100644 --- a/src/mame/machine/naomigd.h +++ b/src/mame/machine/naomigd.h @@ -12,52 +12,52 @@ class naomi_gdrom_board : public naomi_board { public: - naomi_gdrom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + naomi_gdrom_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_tags(device_t &device, const char *_image_tag, const char *_pic_tag); - UINT8 *memory(UINT32 &size) { size = dimm_data_size; return dimm_data; } + uint8_t *memory(uint32_t &size) { size = dimm_data_size; return dimm_data; } protected: virtual void device_start() override; virtual void device_reset() override; - virtual void board_setup_address(UINT32 address, bool is_dma) override; - virtual void board_get_buffer(UINT8 *&base, UINT32 &limit) override; - virtual void board_advance(UINT32 size) override; + virtual void board_setup_address(uint32_t address, bool is_dma) override; + virtual void board_get_buffer(uint8_t *&base, uint32_t &limit) override; + virtual void board_advance(uint32_t size) override; private: enum { FILENAME_LENGTH=24 }; const char *image_tag, *pic_tag; - UINT32 dimm_cur_address; + uint32_t dimm_cur_address; // Note: voluntarily not saved into the state - UINT8 *dimm_data; - UINT32 dimm_data_size; - - static const UINT32 DES_LEFTSWAP[]; - static const UINT32 DES_RIGHTSWAP[]; - static const UINT32 DES_SBOX1[]; - static const UINT32 DES_SBOX2[]; - static const UINT32 DES_SBOX3[]; - static const UINT32 DES_SBOX4[]; - static const UINT32 DES_SBOX5[]; - static const UINT32 DES_SBOX6[]; - static const UINT32 DES_SBOX7[]; - static const UINT32 DES_SBOX8[]; - static const UINT32 DES_MASK_TABLE[]; - static const UINT8 DES_ROTATE_TABLE[16]; - - void find_file(const char *name, const UINT8 *dir_sector, UINT32 &file_start, UINT32 &file_size); - - inline void permutate(UINT32 &a, UINT32 &b, UINT32 m, int shift); - void des_generate_subkeys(const UINT64 key, UINT32 *subkeys); - UINT64 des_encrypt_decrypt(bool decrypt, UINT64 src, const UINT32 *des_subkeys); - UINT64 rev64(UINT64 src); - UINT64 read_to_qword(const UINT8 *region); - void write_from_qword(UINT8 *region, UINT64 qword); + uint8_t *dimm_data; + uint32_t dimm_data_size; + + static const uint32_t DES_LEFTSWAP[]; + static const uint32_t DES_RIGHTSWAP[]; + static const uint32_t DES_SBOX1[]; + static const uint32_t DES_SBOX2[]; + static const uint32_t DES_SBOX3[]; + static const uint32_t DES_SBOX4[]; + static const uint32_t DES_SBOX5[]; + static const uint32_t DES_SBOX6[]; + static const uint32_t DES_SBOX7[]; + static const uint32_t DES_SBOX8[]; + static const uint32_t DES_MASK_TABLE[]; + static const uint8_t DES_ROTATE_TABLE[16]; + + void find_file(const char *name, const uint8_t *dir_sector, uint32_t &file_start, uint32_t &file_size); + + inline void permutate(uint32_t &a, uint32_t &b, uint32_t m, int shift); + void des_generate_subkeys(const uint64_t key, uint32_t *subkeys); + uint64_t des_encrypt_decrypt(bool decrypt, uint64_t src, const uint32_t *des_subkeys); + uint64_t rev64(uint64_t src); + uint64_t read_to_qword(const uint8_t *region); + void write_from_qword(uint8_t *region, uint64_t qword); }; extern const device_type NAOMI_GDROM_BOARD; diff --git a/src/mame/machine/naomim1.cpp b/src/mame/machine/naomim1.cpp index 68282faf8d9..2068bfcaca0 100644 --- a/src/mame/machine/naomim1.cpp +++ b/src/mame/machine/naomim1.cpp @@ -12,7 +12,7 @@ DEVICE_ADDRESS_MAP_START(submap, 16, naomi_m1_board) AM_INHERIT_FROM(naomi_board::submap) ADDRESS_MAP_END -naomi_m1_board::naomi_m1_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +naomi_m1_board::naomi_m1_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : naomi_board(mconfig, NAOMI_M1_BOARD, "Sega NAOMI M1 Board", tag, owner, clock, "naomi_m1_board", __FILE__), m_region(*this, DEVICE_SELF) { @@ -45,7 +45,7 @@ void naomi_m1_board::device_start() actel_id = 0; } - buffer = std::make_unique(BUFFER_SIZE); + buffer = std::make_unique(BUFFER_SIZE); save_pointer(NAME(buffer.get()), BUFFER_SIZE); save_item(NAME(dict)); @@ -74,7 +74,7 @@ void naomi_m1_board::device_reset() avail_bits = 0; } -void naomi_m1_board::board_setup_address(UINT32 address, bool is_dma) +void naomi_m1_board::board_setup_address(uint32_t address, bool is_dma) { rom_cur_address = address & 0x1fffffff; encryption = (!(address & 0x20000000)) && is_dma; @@ -85,7 +85,7 @@ void naomi_m1_board::board_setup_address(UINT32 address, bool is_dma) } } -void naomi_m1_board::board_get_buffer(UINT8 *&base, UINT32 &limit) +void naomi_m1_board::board_get_buffer(uint8_t *&base, uint32_t &limit) { if(encryption) { base = buffer.get(); @@ -97,7 +97,7 @@ void naomi_m1_board::board_get_buffer(UINT8 *&base, UINT32 &limit) } } -void naomi_m1_board::board_advance(UINT32 size) +void naomi_m1_board::board_advance(uint32_t size) { if(encryption) { if(size < buffer_actual_size) { @@ -115,17 +115,17 @@ void naomi_m1_board::board_advance(UINT32 size) rom_cur_address += size; } -UINT32 naomi_m1_board::get_decrypted_32b() +uint32_t naomi_m1_board::get_decrypted_32b() { - UINT8 *base = m_region->base() + rom_cur_address; - UINT8 a = base[0]; - UINT8 b = base[1]; - UINT8 c = base[2]; - UINT8 d = base[3]; + uint8_t *base = m_region->base() + rom_cur_address; + uint8_t a = base[0]; + uint8_t b = base[1]; + uint8_t c = base[2]; + uint8_t d = base[3]; rom_cur_address += 4; - UINT32 res = key ^ (((b^d) << 24) | ((a^c) << 16) | (b << 8) | a); + uint32_t res = key ^ (((b^d) << 24) | ((a^c) << 16) | (b << 8) | a); return res; } @@ -135,7 +135,7 @@ void naomi_m1_board::gb_reset() avail_bits = 0; } -inline UINT32 naomi_m1_board::lookb(int bits) +inline uint32_t naomi_m1_board::lookb(int bits) { if(bits > avail_bits) { avail_val = (avail_val << 32) | get_decrypted_32b(); @@ -149,9 +149,9 @@ inline void naomi_m1_board::skipb(int bits) avail_bits -= bits; } -inline UINT32 naomi_m1_board::getb(int bits) +inline uint32_t naomi_m1_board::getb(int bits) { - UINT32 res = lookb(bits); + uint32_t res = lookb(bits); skipb(bits); return res; } @@ -167,7 +167,7 @@ void naomi_m1_board::enc_reset() elem = getb(8); } -void naomi_m1_board::wb(UINT8 byte) +void naomi_m1_board::wb(uint8_t byte) { if(dict[0] & 64) if(buffer_actual_size < 2) diff --git a/src/mame/machine/naomim1.h b/src/mame/machine/naomim1.h index 126648e378c..9ce67ce3565 100644 --- a/src/mame/machine/naomim1.h +++ b/src/mame/machine/naomim1.h @@ -11,7 +11,7 @@ class naomi_m1_board : public naomi_board { public: - naomi_m1_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + naomi_m1_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(submap, 16) override; @@ -21,34 +21,34 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void board_setup_address(UINT32 address, bool is_dma) override; - virtual void board_get_buffer(UINT8 *&base, UINT32 &limit) override; - virtual void board_advance(UINT32 size) override; + virtual void board_setup_address(uint32_t address, bool is_dma) override; + virtual void board_get_buffer(uint8_t *&base, uint32_t &limit) override; + virtual void board_advance(uint32_t size) override; private: enum { BUFFER_SIZE = 32768 }; - UINT32 key; - UINT16 actel_id; + uint32_t key; + uint16_t actel_id; - std::unique_ptr buffer; - UINT8 dict[111], hist[2]; - UINT64 avail_val; - UINT32 rom_cur_address, buffer_actual_size, avail_bits; + std::unique_ptr buffer; + uint8_t dict[111], hist[2]; + uint64_t avail_val; + uint32_t rom_cur_address, buffer_actual_size, avail_bits; bool encryption, stream_ended, has_history; required_memory_region m_region; void gb_reset(); - UINT32 lookb(int bits); + uint32_t lookb(int bits); void skipb(int bits); - UINT32 getb(int bits); + uint32_t getb(int bits); void enc_reset(); void enc_fill(); - UINT32 get_decrypted_32b(); + uint32_t get_decrypted_32b(); - void wb(UINT8 byte); + void wb(uint8_t byte); }; extern const device_type NAOMI_M1_BOARD; diff --git a/src/mame/machine/naomim2.cpp b/src/mame/machine/naomim2.cpp index 6e288d62d1d..2074625a17e 100644 --- a/src/mame/machine/naomim2.cpp +++ b/src/mame/machine/naomim2.cpp @@ -111,7 +111,7 @@ note: if ROM is not mounted its area readed as 0xFF const device_type NAOMI_M2_BOARD = &device_creator; -naomi_m2_board::naomi_m2_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +naomi_m2_board::naomi_m2_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : naomi_board(mconfig, NAOMI_M2_BOARD, "Sega NAOMI M2 Board", tag, owner, clock, "naomi_m2_board", __FILE__), m_cryptdevice(*this, "segam2crypt"), m_region(*this, DEVICE_SELF) @@ -122,7 +122,7 @@ void naomi_m2_board::device_start() { naomi_board::device_start(); - ram = std::make_unique(RAM_SIZE); + ram = std::make_unique(RAM_SIZE); save_item(NAME(rom_cur_address)); save_pointer(NAME(ram.get()), RAM_SIZE); @@ -137,12 +137,12 @@ void naomi_m2_board::device_reset() rom_cur_address = 0; } -void naomi_m2_board::board_setup_address(UINT32 address, bool is_dma) +void naomi_m2_board::board_setup_address(uint32_t address, bool is_dma) { rom_cur_address = address; } -void naomi_m2_board::board_get_buffer(UINT8 *&base, UINT32 &limit) +void naomi_m2_board::board_get_buffer(uint8_t *&base, uint32_t &limit) { if(rom_cur_address & 0x40000000) { if(rom_cur_address == 0x4001fffe) { @@ -157,19 +157,19 @@ void naomi_m2_board::board_get_buffer(UINT8 *&base, UINT32 &limit) base = m_region->base() + (rom_cur_address & 0x1fffffff); limit = m_region->bytes() - (rom_cur_address & 0x1fffffff); } else { - UINT32 offset4mb = (rom_cur_address & 0x103FFFFF) | ((rom_cur_address & 0x07C00000) << 1); + uint32_t offset4mb = (rom_cur_address & 0x103FFFFF) | ((rom_cur_address & 0x07C00000) << 1); base = m_region->base() + offset4mb; limit = std::min(m_region->bytes() - offset4mb, 0x00400000 - (offset4mb & 0x003FFFFF)); } } } -void naomi_m2_board::board_advance(UINT32 size) +void naomi_m2_board::board_advance(uint32_t size) { rom_cur_address += size; } -void naomi_m2_board::board_write(offs_t offset, UINT16 data) +void naomi_m2_board::board_write(offs_t offset, uint16_t data) { if(offset & 0x40000000) { if(offset & 0x00020000) { @@ -187,7 +187,7 @@ void naomi_m2_board::board_write(offs_t offset, UINT16 data) logerror("NAOMIM2: unhandled board write %08x, %04x\n", offset, data); } -UINT16 naomi_m2_board::read_callback(UINT32 addr) +uint16_t naomi_m2_board::read_callback(uint32_t addr) { if ((addr & 0xffff0000) == 0x01000000) { int base = 2*(addr & 0x7fff); @@ -195,7 +195,7 @@ UINT16 naomi_m2_board::read_callback(UINT32 addr) } else { - const UINT8 *base = &m_region->u8(2*addr); + const uint8_t *base = &m_region->u8(2*addr); return base[1] | (base[0] << 8); } } diff --git a/src/mame/machine/naomim2.h b/src/mame/machine/naomim2.h index 21ca305be6e..c51de4e90a6 100644 --- a/src/mame/machine/naomim2.h +++ b/src/mame/machine/naomim2.h @@ -13,22 +13,22 @@ class naomi_m2_board : public naomi_board { public: - naomi_m2_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - UINT32 rom_cur_address; + naomi_m2_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + uint32_t rom_cur_address; static const int RAM_SIZE = 65536; - std::unique_ptr ram; + std::unique_ptr ram; - UINT16 read_callback(UINT32 addr); + uint16_t read_callback(uint32_t addr); protected: virtual void device_start() override; virtual void device_reset() override; virtual machine_config_constructor device_mconfig_additions() const override; - virtual void board_setup_address(UINT32 address, bool is_dma) override; - virtual void board_get_buffer(UINT8 *&base, UINT32 &limit) override; - virtual void board_advance(UINT32 size) override; - virtual void board_write(offs_t offset, UINT16 data) override; + virtual void board_setup_address(uint32_t address, bool is_dma) override; + virtual void board_get_buffer(uint8_t *&base, uint32_t &limit) override; + virtual void board_advance(uint32_t size) override; + virtual void board_write(offs_t offset, uint16_t data) override; private: required_device m_cryptdevice; diff --git a/src/mame/machine/naomim4.cpp b/src/mame/machine/naomim4.cpp index 1f91039d113..f0799c9a770 100644 --- a/src/mame/machine/naomim4.cpp +++ b/src/mame/machine/naomim4.cpp @@ -23,7 +23,7 @@ const device_type NAOMI_M4_BOARD = &device_creator; -const UINT8 naomi_m4_board::k_sboxes[4][16] = { +const uint8_t naomi_m4_board::k_sboxes[4][16] = { {9,8,2,11,1,14,5,15,12,6,0,3,7,13,10,4}, {2,10,0,15,14,1,11,3,7,12,13,8,4,9,5,6}, {4,11,3,8,7,2,15,13,1,5,14,9,6,12,0,10}, @@ -31,7 +31,7 @@ const UINT8 naomi_m4_board::k_sboxes[4][16] = { }; // from S29GL512N datasheet -static UINT8 cfidata[] = { +static uint8_t cfidata[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x51,0x00,0x52,0x00,0x59,0x00,0x02,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x07,0x00, 0x07,0x00,0x0a,0x00,0x00,0x00,0x01,0x00,0x05,0x00,0x04,0x00,0x00,0x00,0x1a,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0xff,0x00,0x01,0x00,0x00,0x00, @@ -46,7 +46,7 @@ DEVICE_ADDRESS_MAP_START(submap, 16, naomi_m4_board) AM_INHERIT_FROM(naomi_board::submap) ADDRESS_MAP_END -naomi_m4_board::naomi_m4_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +naomi_m4_board::naomi_m4_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : naomi_board(mconfig, NAOMI_M4_BOARD, "Sega NAOMI M4 Board", tag, owner, clock, "naomi_m4_board", __FILE__) , m_region(*this, DEVICE_SELF) , m_key_data(*this, finder_base::DUMMY_TAG) @@ -75,7 +75,7 @@ void naomi_m4_board::device_start() subkey1 = (m_key_data[0x5e2] << 8) | m_key_data[0x5e0]; subkey2 = (m_key_data[0x5e6] << 8) | m_key_data[0x5e4]; - buffer = std::make_unique(BUFFER_SIZE); + buffer = std::make_unique(BUFFER_SIZE); enc_init(); save_pointer(NAME(buffer.get()), BUFFER_SIZE); @@ -88,25 +88,25 @@ void naomi_m4_board::device_start() void naomi_m4_board::enc_init() { - one_round = std::make_unique(0x10000); + one_round = std::make_unique(0x10000); for(int round_input = 0; round_input < 0x10000; round_input++) { - UINT8 input_nibble[4]; - UINT8 output_nibble[4]; + uint8_t input_nibble[4]; + uint8_t output_nibble[4]; for (int nibble_idx = 0; nibble_idx < 4; ++nibble_idx) { input_nibble[nibble_idx] = (round_input >> (nibble_idx*4)) & 0xf; output_nibble[nibble_idx] = 0; } - UINT8 aux_nibble = input_nibble[3]; + uint8_t aux_nibble = input_nibble[3]; for (int nibble_idx = 0; nibble_idx < 4; ++nibble_idx) { // 4 s-boxes per round aux_nibble ^= k_sboxes[nibble_idx][input_nibble[nibble_idx]]; for (int i = 0; i < 4; ++i) // diffusion of the bits output_nibble[(nibble_idx - i) & 3] |= aux_nibble & (1 << i); } - UINT16 result = 0; + uint16_t result = 0; for (int nibble_idx = 0; nibble_idx < 4; ++nibble_idx) result |= (output_nibble[nibble_idx] << (4 * nibble_idx)); @@ -125,7 +125,7 @@ void naomi_m4_board::device_reset() iv = 0; } -void naomi_m4_board::board_setup_address(UINT32 address, bool is_dma) +void naomi_m4_board::board_setup_address(uint32_t address, bool is_dma) { rom_cur_address = address & 0x1ffffffe; encryption = rom_offset & 0x40000000; @@ -136,9 +136,9 @@ void naomi_m4_board::board_setup_address(UINT32 address, bool is_dma) } } -void naomi_m4_board::board_get_buffer(UINT8 *&base, UINT32 &limit) +void naomi_m4_board::board_get_buffer(uint8_t *&base, uint32_t &limit) { - static UINT8 retzero[2] = { 0, 0 }; + static uint8_t retzero[2] = { 0, 0 }; if (cfi_mode) { int fpr_num = m4id & 0x7f; @@ -155,7 +155,7 @@ void naomi_m4_board::board_get_buffer(UINT8 *&base, UINT32 &limit) limit = BUFFER_SIZE; } else { - UINT32 size = m_region->bytes(); + uint32_t size = m_region->bytes(); if (rom_cur_address < size) { base = m_region->base() + rom_cur_address; @@ -167,7 +167,7 @@ void naomi_m4_board::board_get_buffer(UINT8 *&base, UINT32 &limit) } } -void naomi_m4_board::board_advance(UINT32 size) +void naomi_m4_board::board_advance(uint32_t size) { if(encryption) { if(size < buffer_actual_size) { @@ -188,17 +188,17 @@ void naomi_m4_board::enc_reset() counter = 0; } -UINT16 naomi_m4_board::decrypt_one_round(UINT16 word, UINT16 subkey) +uint16_t naomi_m4_board::decrypt_one_round(uint16_t word, uint16_t subkey) { return one_round[word ^ subkey] ^ subkey ; } void naomi_m4_board::enc_fill() { - const UINT8 *base = m_region->base() + rom_cur_address; + const uint8_t *base = m_region->base() + rom_cur_address; while(buffer_actual_size < BUFFER_SIZE) { - UINT16 enc = base[0] | (base[1] << 8); - UINT16 dec = iv; + uint16_t enc = base[0] | (base[1] << 8); + uint16_t dec = iv; iv = decrypt_one_round(enc ^ iv, subkey1); dec ^= decrypt_one_round(iv, subkey2); @@ -221,7 +221,7 @@ READ16_MEMBER(naomi_m4_board::m4_id_r) return m4id & 0xff80; } -void naomi_m4_board::board_write(offs_t offset, UINT16 data) +void naomi_m4_board::board_write(offs_t offset, uint16_t data) { if (((offset&0xffff) == 0x00aa) && (data == 0x0098)) cfi_mode = true; diff --git a/src/mame/machine/naomim4.h b/src/mame/machine/naomim4.h index 0d340b3cab5..7fb81fa333d 100644 --- a/src/mame/machine/naomim4.h +++ b/src/mame/machine/naomim4.h @@ -12,7 +12,7 @@ class naomi_m4_board : public naomi_board { public: - naomi_m4_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + naomi_m4_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_tags(device_t &device, const char *key_tag); @@ -23,33 +23,33 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void board_setup_address(UINT32 address, bool is_dma) override; - virtual void board_get_buffer(UINT8 *&base, UINT32 &limit) override; - virtual void board_advance(UINT32 size) override; - virtual void board_write(offs_t offset, UINT16 data) override; + virtual void board_setup_address(uint32_t address, bool is_dma) override; + virtual void board_get_buffer(uint8_t *&base, uint32_t &limit) override; + virtual void board_advance(uint32_t size) override; + virtual void board_write(offs_t offset, uint16_t data) override; private: enum { BUFFER_SIZE = 32768 }; - static const UINT8 k_sboxes[4][16]; + static const uint8_t k_sboxes[4][16]; - UINT16 m4id; + uint16_t m4id; required_memory_region m_region; - required_region_ptr m_key_data; - UINT16 subkey1, subkey2; - std::unique_ptr one_round; - - std::unique_ptr buffer; - UINT32 rom_cur_address, buffer_actual_size; - UINT16 iv; - UINT8 counter; + required_region_ptr m_key_data; + uint16_t subkey1, subkey2; + std::unique_ptr one_round; + + std::unique_ptr buffer; + uint32_t rom_cur_address, buffer_actual_size; + uint16_t iv; + uint8_t counter; bool encryption; bool cfi_mode; void enc_init(); void enc_reset(); void enc_fill(); - UINT16 decrypt_one_round(UINT16 word, UINT16 subkey); + uint16_t decrypt_one_round(uint16_t word, uint16_t subkey); }; extern const device_type NAOMI_M4_BOARD; diff --git a/src/mame/machine/naomirom.cpp b/src/mame/machine/naomirom.cpp index ad356dd46e6..6c92ae377ba 100644 --- a/src/mame/machine/naomirom.cpp +++ b/src/mame/machine/naomirom.cpp @@ -5,7 +5,7 @@ const device_type NAOMI_ROM_BOARD = &device_creator; -naomi_rom_board::naomi_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +naomi_rom_board::naomi_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : naomi_board(mconfig, NAOMI_ROM_BOARD, "Sega NAOMI ROM Board", tag, owner, clock, "naomi_rom_board", __FILE__), m_region(*this, DEVICE_SELF) { @@ -23,18 +23,18 @@ void naomi_rom_board::device_reset() rom_cur_address = 0; } -void naomi_rom_board::board_setup_address(UINT32 address, bool is_dma) +void naomi_rom_board::board_setup_address(uint32_t address, bool is_dma) { rom_cur_address = address & 0x1fffffff; } -void naomi_rom_board::board_get_buffer(UINT8 *&base, UINT32 &limit) +void naomi_rom_board::board_get_buffer(uint8_t *&base, uint32_t &limit) { base = m_region->base() + rom_cur_address; limit = m_region->bytes() - rom_cur_address; } -void naomi_rom_board::board_advance(UINT32 size) +void naomi_rom_board::board_advance(uint32_t size) { rom_cur_address += size; } diff --git a/src/mame/machine/naomirom.h b/src/mame/machine/naomirom.h index f1303dcdd82..a1261b35717 100644 --- a/src/mame/machine/naomirom.h +++ b/src/mame/machine/naomirom.h @@ -11,18 +11,18 @@ class naomi_rom_board : public naomi_board { public: - naomi_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + naomi_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; virtual void device_reset() override; - virtual void board_setup_address(UINT32 address, bool is_dma) override; - virtual void board_get_buffer(UINT8 *&base, UINT32 &limit) override; - virtual void board_advance(UINT32 size) override; + virtual void board_setup_address(uint32_t address, bool is_dma) override; + virtual void board_get_buffer(uint8_t *&base, uint32_t &limit) override; + virtual void board_advance(uint32_t size) override; private: - UINT32 rom_cur_address; + uint32_t rom_cur_address; required_memory_region m_region; }; diff --git a/src/mame/machine/nb1413m3.cpp b/src/mame/machine/nb1413m3.cpp index b8992261f2c..2ceb65ddc1b 100644 --- a/src/mame/machine/nb1413m3.cpp +++ b/src/mame/machine/nb1413m3.cpp @@ -23,7 +23,7 @@ Memo: const device_type NB1413M3 = &device_creator; -nb1413m3_device::nb1413m3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nb1413m3_device::nb1413m3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NB1413M3, "NB1413M3 Mahjong Custom", tag, owner, clock, "nb1413m3", __FILE__), m_sndromrgntag("voice"), m_sndrombank1(0), @@ -312,7 +312,7 @@ WRITE8_MEMBER( nb1413m3_device::sndrombank2_w ) READ8_MEMBER( nb1413m3_device::gfxrom_r ) { - UINT8 *GFXROM = space.machine().root_device().memregion("gfx1")->base(); + uint8_t *GFXROM = space.machine().root_device().memregion("gfx1")->base(); return GFXROM[(0x20000 * (m_gfxrombank | ((m_sndrombank1 & 0x02) << 3))) + ((0x0200 * m_gfxradr_h) + (0x0002 * m_gfxradr_l)) + (offset & 0x01)]; } diff --git a/src/mame/machine/nb1414m4.cpp b/src/mame/machine/nb1414m4.cpp index 5b9b9ea8e36..22f758012ae 100644 --- a/src/mame/machine/nb1414m4.cpp +++ b/src/mame/machine/nb1414m4.cpp @@ -32,7 +32,7 @@ Notes: const device_type NB1414M4 = &device_creator; -nb1414m4_device::nb1414m4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nb1414m4_device::nb1414m4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NB1414M4, "NB1414M4 Mahjong Custom", tag, owner, clock, "nb1414m4", __FILE__), device_video_interface(mconfig, *this), m_data(*this, DEVICE_SELF) @@ -60,7 +60,7 @@ void nb1414m4_device::device_reset() DEVICE HANDLERS *****************************************************************************/ -void nb1414m4_device::dma(UINT16 src, UINT16 dst, UINT16 size, UINT8 condition, UINT8 *vram) +void nb1414m4_device::dma(uint16_t src, uint16_t dst, uint16_t size, uint8_t condition, uint8_t *vram) { int i; @@ -75,7 +75,7 @@ void nb1414m4_device::dma(UINT16 src, UINT16 dst, UINT16 size, UINT8 condition, } } -void nb1414m4_device::fill(UINT16 dst, UINT8 tile, UINT8 pal, UINT8 *vram) +void nb1414m4_device::fill(uint16_t dst, uint8_t tile, uint8_t pal, uint8_t *vram) { int i; @@ -89,11 +89,11 @@ void nb1414m4_device::fill(UINT16 dst, UINT8 tile, UINT8 pal, UINT8 *vram) } } -void nb1414m4_device::insert_coin_msg(UINT8 *vram) +void nb1414m4_device::insert_coin_msg(uint8_t *vram) { int credit_count = (vram[0xf] & 0xff); - UINT8 fl_cond = m_screen->frame_number() & 0x10; /* for insert coin "flickering" */ - UINT16 dst; + uint8_t fl_cond = m_screen->frame_number() & 0x10; /* for insert coin "flickering" */ + uint16_t dst; if(credit_count == 0) { @@ -109,11 +109,11 @@ void nb1414m4_device::insert_coin_msg(UINT8 *vram) } } -void nb1414m4_device::credit_msg(UINT8 *vram) +void nb1414m4_device::credit_msg(uint8_t *vram) { int credit_count = (vram[0xf] & 0xff); - UINT8 fl_cond = m_screen->frame_number() & 0x10; /* for insert coin "flickering" */ - UINT16 dst; + uint8_t fl_cond = m_screen->frame_number() & 0x10; /* for insert coin "flickering" */ + uint16_t dst; dst = ((m_data[0x023]<<8)|(m_data[0x024]&0xff)) & 0x3fff; dma(0x0025,dst,0x10,1,vram); /* credit */ @@ -135,11 +135,11 @@ void nb1414m4_device::credit_msg(UINT8 *vram) } } -void nb1414m4_device::kozure_score_msg(UINT16 dst, UINT8 src_base, UINT8 *vram) +void nb1414m4_device::kozure_score_msg(uint16_t dst, uint8_t src_base, uint8_t *vram) { int i; - UINT8 first_digit; - UINT8 res; + uint8_t first_digit; + uint8_t res; first_digit = 0; @@ -165,9 +165,9 @@ void nb1414m4_device::kozure_score_msg(UINT16 dst, UINT8 src_base, UINT8 *vram) } -void nb1414m4_device::_0200(UINT16 mcu_cmd, UINT8 *vram) +void nb1414m4_device::_0200(uint16_t mcu_cmd, uint8_t *vram) { - UINT16 dst; + uint16_t dst; dst = (m_data[0x330+((mcu_cmd & 0xf)*2)]<<8)|(m_data[0x331+((mcu_cmd & 0xf)*2)]&0xff); @@ -209,9 +209,9 @@ void nb1414m4_device::_0200(UINT16 mcu_cmd, UINT8 *vram) [0x10] coinage B [0x11] sound test num */ -void nb1414m4_device::_0600(UINT8 is2p, UINT8 *vram) +void nb1414m4_device::_0600(uint8_t is2p, uint8_t *vram) { - UINT16 dst; + uint16_t dst; int i; dst = ((m_data[0x1f5]<<8)|(m_data[0x1f6]&0xff)) & 0x3fff; @@ -264,9 +264,9 @@ void nb1414m4_device::_0600(UINT8 is2p, UINT8 *vram) dma(0x310 + (((vram[0x06] >> (7-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); } -void nb1414m4_device::_0e00(UINT16 mcu_cmd, UINT8 *vram) +void nb1414m4_device::_0e00(uint16_t mcu_cmd, uint8_t *vram) { - UINT16 dst; + uint16_t dst; dst = ((m_data[0xdf]<<8)|(m_data[0xe0]&0xff)) & 0x3fff; dma(0x00e1,dst,8,1,vram); /* hi-score */ @@ -295,7 +295,7 @@ void nb1414m4_device::_0e00(UINT16 mcu_cmd, UINT8 *vram) } } -void nb1414m4_device::exec(UINT16 mcu_cmd, UINT8 *vram, UINT16 &scrollx, UINT16 &scrolly, tilemap_t *tilemap) +void nb1414m4_device::exec(uint16_t mcu_cmd, uint8_t *vram, uint16_t &scrollx, uint16_t &scrolly, tilemap_t *tilemap) { /* latch fg scroll values */ scrollx = (vram[0x0d] & 0xff) | ((vram[0x0e] & 0xff) << 8); diff --git a/src/mame/machine/nc.cpp b/src/mame/machine/nc.cpp index 3f5ba19fbce..2288347e151 100644 --- a/src/mame/machine/nc.cpp +++ b/src/mame/machine/nc.cpp @@ -48,7 +48,7 @@ int nc_state::card_calculate_mask(int size) // load pcmcia card data DEVICE_IMAGE_LOAD_MEMBER( nc_state, nc_pcmcia_card ) { - UINT32 size = m_card->common_get_size("rom"); + uint32_t 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"); diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp index 65479795398..97f6070c020 100644 --- a/src/mame/machine/nes.cpp +++ b/src/mame/machine/nes.cpp @@ -47,7 +47,7 @@ void nes_state::machine_start() // NES has 2KB of internal RAM which can be used to fill the 4x1KB banks of PPU RAM at $2000-$2fff // Line A10 is exposed to the carts, so that games can change CIRAM mapping in PPU (we emulate this with the set_nt_mirroring // function). CIRAM can also be disabled by the game (if e.g. VROM or cart RAM has to be used in PPU... - m_ciram = std::make_unique(0x800); + m_ciram = std::make_unique(0x800); // other pointers got set in the loading routine, because they 'belong' to the cart itself m_io_disksel = ioport("FLIPDISK"); @@ -114,7 +114,7 @@ void nes_state::machine_start() READ8_MEMBER(nes_state::nes_in0_r) { - UINT8 ret = 0x40; + uint8_t ret = 0x40; ret |= m_ctrl1->read_bit0(); ret |= m_ctrl1->read_bit34(); return ret; @@ -122,7 +122,7 @@ READ8_MEMBER(nes_state::nes_in0_r) READ8_MEMBER(nes_state::nes_in1_r) { - UINT8 ret = 0x40; + uint8_t ret = 0x40; ret |= m_ctrl2->read_bit0(); ret |= m_ctrl2->read_bit34(); return ret; @@ -137,7 +137,7 @@ WRITE8_MEMBER(nes_state::nes_in0_w) READ8_MEMBER(nes_state::fc_in0_r) { - UINT8 ret = 0x40; + uint8_t ret = 0x40; // bit 0 to controller port ret |= m_ctrl1->read_bit0(); @@ -158,7 +158,7 @@ READ8_MEMBER(nes_state::fc_in0_r) READ8_MEMBER(nes_state::fc_in1_r) { - UINT8 ret = 0x40; + uint8_t ret = 0x40; // bit 0 to controller port ret |= m_ctrl2->read_bit0(); @@ -194,10 +194,10 @@ DRIVER_INIT_MEMBER(nes_state,famicom) NESCTRL_BRIGHTPIXEL_CB(nes_state::bright_pixel) { // get the pixel at the gun position - UINT32 pix = m_ppu->get_pixel(x, y); + uint32_t pix = m_ppu->get_pixel(x, y); // get the color base from the ppu - UINT32 color_base = m_ppu->get_colorbase(); + uint32_t color_base = m_ppu->get_colorbase(); // check if the cursor is over a bright pixel if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || diff --git a/src/mame/machine/nextkbd.cpp b/src/mame/machine/nextkbd.cpp index 0fc545050ca..f742dd2a43e 100644 --- a/src/mame/machine/nextkbd.cpp +++ b/src/mame/machine/nextkbd.cpp @@ -14,7 +14,7 @@ DEVICE_ADDRESS_MAP_START(amap, 32, nextkbd_device) AM_RANGE(0x8, 0xb) AM_READWRITE(kmdata_r, kmdata_w) ADDRESS_MAP_END -nextkbd_device::nextkbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nextkbd_device::nextkbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEXTKBD, "NEXTKBD", tag, owner, clock, "nextkbd", __FILE__), int_change_cb(*this), int_power_cb(*this), @@ -85,15 +85,15 @@ void nextkbd_device::send() void nextkbd_device::update_mouse(bool force_update) { - UINT32 cur_mousex = mousex->read(); - UINT32 cur_mousey = mousey->read(); - UINT32 cur_mousebtn = mousebtn->read(); + uint32_t cur_mousex = mousex->read(); + uint32_t cur_mousey = mousey->read(); + uint32_t cur_mousebtn = mousebtn->read(); if(!force_update && cur_mousex == prev_mousex && cur_mousey == prev_mousey && cur_mousebtn == prev_mousebtn) return; - INT32 deltax = -(cur_mousex - prev_mousex); - INT32 deltay = -(cur_mousey - prev_mousey); + int32_t deltax = -(cur_mousex - prev_mousex); + int32_t deltay = -(cur_mousey - prev_mousey); if(deltax >= 128) deltax -= 256; @@ -117,7 +117,7 @@ void nextkbd_device::update_mouse(bool force_update) if(deltay > 0x3f) deltay = 0x3f; - UINT32 base = ((deltax & 0x7f) << 1) | ((deltay & 0x7f) << 9) | cur_mousebtn; + uint32_t base = ((deltax & 0x7f) << 1) | ((deltay & 0x7f) << 9) | cur_mousebtn; fifo_push(km_address | D_SECONDARY | base); send(); } @@ -130,7 +130,7 @@ void nextkbd_device::device_timer(emu_timer &timer, device_timer_id id, int para update_mouse(false); } -void nextkbd_device::fifo_push(UINT32 val) +void nextkbd_device::fifo_push(uint32_t val) { if(fifo_size == FIFO_SIZE) return; @@ -141,13 +141,13 @@ void nextkbd_device::fifo_push(UINT32 val) fifo_iw = 0; } -UINT32 nextkbd_device::fifo_pop() +uint32_t nextkbd_device::fifo_pop() { if(fifo_size == 0) return 0; fifo_size--; - UINT32 res = fifo[fifo_ir++]; + uint32_t res = fifo[fifo_ir++]; if(fifo_ir == FIFO_SIZE) fifo_ir = 0; @@ -191,7 +191,7 @@ READ32_MEMBER( nextkbd_device::cdata_r ) READ32_MEMBER( nextkbd_device::kmdata_r ) { - UINT8 old = ctrl_kms; + uint8_t old = ctrl_kms; ctrl_kms &= ~(C_KBD_INTERRUPT|C_KBD_DATA); if(old & C_KBD_INTERRUPT) int_change_cb(false); @@ -201,27 +201,27 @@ READ32_MEMBER( nextkbd_device::kmdata_r ) WRITE8_MEMBER( nextkbd_device::ctrl_snd_w ) { - UINT8 old = ctrl_snd; + uint8_t old = ctrl_snd; ctrl_snd = (ctrl_snd & ~C_SOUND_WMASK) | (data & C_SOUND_WMASK); - UINT8 diff = old ^ ctrl_snd; + uint8_t diff = old ^ ctrl_snd; logerror("%s: ctrl_snd_w %02x | %02x (%08x)\n", tag(), ctrl_snd, diff, (unsigned int)space.device().safe_pc()); } WRITE8_MEMBER( nextkbd_device::ctrl_kms_w ) { - UINT8 old = ctrl_kms; + uint8_t old = ctrl_kms; ctrl_kms = (ctrl_kms & ~C_KMS_WMASK) | (data & C_KMS_WMASK); - UINT8 diff = old ^ ctrl_kms; + uint8_t diff = old ^ ctrl_kms; logerror("%s: ctrl_kms_w %02x | %02x (%08x)\n", tag(), ctrl_kms, diff, (unsigned int)space.device().safe_pc()); } WRITE8_MEMBER( nextkbd_device::ctrl_dma_w ) { - UINT8 old = ctrl_dma; + uint8_t old = ctrl_dma; ctrl_dma = (ctrl_dma & ~C_WMASK) | (data & C_WMASK); - UINT8 diff = old ^ ctrl_dma; + uint8_t diff = old ^ ctrl_dma; logerror("%s: ctrl_dma_w %02x | %02x (%08x)\n", tag(), ctrl_dma, diff, (unsigned int)space.device().safe_pc()); } @@ -255,7 +255,7 @@ INPUT_CHANGED_MEMBER( nextkbd_device::update ) break; assert(index != 32); index += bank*32; - UINT16 val = index | modifiers_state | D_KBD_VALID; + uint16_t val = index | modifiers_state | D_KBD_VALID; if(!newval) val |= D_KBD_KEYDOWN; if(val == 0x8826 || val == 0x884a) { diff --git a/src/mame/machine/nextkbd.h b/src/mame/machine/nextkbd.h index ed233dd8ecd..4d0ed219178 100644 --- a/src/mame/machine/nextkbd.h +++ b/src/mame/machine/nextkbd.h @@ -16,7 +16,7 @@ class nextkbd_device : public device_t { public: - nextkbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nextkbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_int_change_wr_callback(device_t &device, _Object object) { return downcast(device).int_change_cb.set_callback(object); } template static devcb_base &set_int_power_wr_callback(device_t &device, _Object object) { return downcast(device).int_power_cb.set_callback(object); } @@ -96,15 +96,15 @@ private: emu_timer *poll_timer; bool nmi_active; - UINT32 cdata, kmdata, fifo_ir, fifo_iw, fifo_size; - UINT32 fifo[FIFO_SIZE]; - UINT32 km_address; - UINT32 prev_mousex, prev_mousey, prev_mousebtn; - UINT16 modifiers_state; - UINT8 ctrl_snd, ctrl_kms, ctrl_dma, ctrl_cmd; + uint32_t cdata, kmdata, fifo_ir, fifo_iw, fifo_size; + uint32_t fifo[FIFO_SIZE]; + uint32_t km_address; + uint32_t prev_mousex, prev_mousey, prev_mousebtn; + uint16_t modifiers_state; + uint8_t ctrl_snd, ctrl_kms, ctrl_dma, ctrl_cmd; - void fifo_push(UINT32 val); - UINT32 fifo_pop(); + void fifo_push(uint32_t val); + uint32_t fifo_pop(); bool fifo_empty() const; void update_mouse(bool force_update); diff --git a/src/mame/machine/nextmo.cpp b/src/mame/machine/nextmo.cpp index 20cfba9aa6c..25341374c25 100644 --- a/src/mame/machine/nextmo.cpp +++ b/src/mame/machine/nextmo.cpp @@ -18,7 +18,7 @@ DEVICE_ADDRESS_MAP_START(map, 8, nextmo_device) AM_RANGE(0x10, 0x17) AM_READWRITE(r10_r, r10_w) ADDRESS_MAP_END -nextmo_device::nextmo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nextmo_device::nextmo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEXTMO, "NeXT Magneto-optical drive", tag, owner, clock, "nextmo", __FILE__), r4(0), irq_cb(*this), @@ -92,16 +92,16 @@ WRITE8_MEMBER(nextmo_device::r7_w) } } -UINT8 nextmo_device::dma_r() +uint8_t nextmo_device::dma_r() { - UINT8 r = 0; + uint8_t r = 0; if(r7 & 0x80) r = sector[sector_pos++]; check_dma_end(); return r; } -void nextmo_device::dma_w(UINT8 data) +void nextmo_device::dma_w(uint8_t data) { if(r7 & 0x40) sector[sector_pos++] = data; diff --git a/src/mame/machine/nextmo.h b/src/mame/machine/nextmo.h index a219f159be2..31b4627e74e 100644 --- a/src/mame/machine/nextmo.h +++ b/src/mame/machine/nextmo.h @@ -12,7 +12,7 @@ class nextmo_device : public device_t { public: - nextmo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nextmo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).irq_cb.set_callback(object); } template static devcb_base &set_drq_wr_callback(device_t &device, _Object object) { return downcast(device).drq_cb.set_callback(object); } @@ -38,16 +38,16 @@ public: DECLARE_READ8_MEMBER(r10_r); DECLARE_WRITE8_MEMBER(r10_w); - UINT8 dma_r(); - void dma_w(UINT8 data); + uint8_t dma_r(); + void dma_w(uint8_t data); protected: virtual void device_start() override; virtual void device_reset() override; private: - UINT8 sector[0x510]; - UINT8 r4, r5, r6, r7; + uint8_t sector[0x510]; + uint8_t r4, r5, r6, r7; devcb_write_line irq_cb, drq_cb; int sector_pos; diff --git a/src/mame/machine/ng_memcard.cpp b/src/mame/machine/ng_memcard.cpp index f9c1ea10843..720306fab95 100644 --- a/src/mame/machine/ng_memcard.cpp +++ b/src/mame/machine/ng_memcard.cpp @@ -19,7 +19,7 @@ const device_type NG_MEMCARD = &device_creator; // ng_memcard_device - constructor //------------------------------------------------- -ng_memcard_device::ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ng_memcard_device::ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NG_MEMCARD, "NeoGeo Memory Card", tag, owner, clock, "ng_memcard", __FILE__), device_image_interface(mconfig, *this) { diff --git a/src/mame/machine/ng_memcard.h b/src/mame/machine/ng_memcard.h index 62b602fc1b0..655a2e7affc 100644 --- a/src/mame/machine/ng_memcard.h +++ b/src/mame/machine/ng_memcard.h @@ -31,7 +31,7 @@ class ng_memcard_device : public device_t, { public: // construction/destruction - ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual iodevice_t image_type() const override { return IO_MEMCARD; } @@ -56,7 +56,7 @@ public: /* returns the index of the current memory card, or -1 if none */ int present() { return is_loaded() ? 0 : -1; } private: - UINT8 m_memcard_data[0x800]; + uint8_t m_memcard_data[0x800]; }; diff --git a/src/mame/machine/ngen_kb.cpp b/src/mame/machine/ngen_kb.cpp index 0d9532f1286..c42f2b72e64 100644 --- a/src/mame/machine/ngen_kb.cpp +++ b/src/mame/machine/ngen_kb.cpp @@ -10,7 +10,7 @@ #include "ngen_kb.h" -ngen_keyboard_device::ngen_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) +ngen_keyboard_device::ngen_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : serial_keyboard_device(mconfig, NGEN_KEYBOARD, "NGEN Keyboard", tag, owner, 0, "ngen_keyboard", __FILE__) , m_keys_down(0U) , m_last_reset(0U) @@ -18,7 +18,7 @@ ngen_keyboard_device::ngen_keyboard_device(const machine_config& mconfig, const } -void ngen_keyboard_device::write(UINT8 data) +void ngen_keyboard_device::write(uint8_t data) { // To be figured out // Code 0x92 is sent on startup, perhaps resets the keyboard MCU @@ -78,7 +78,7 @@ void ngen_keyboard_device::device_reset() { serial_keyboard_device::device_reset(); - m_keys_down = UINT8(~0U); + m_keys_down = uint8_t(~0U); m_last_reset = 0U; } @@ -88,19 +88,19 @@ void ngen_keyboard_device::rcv_complete() write(get_received_char()); } -void ngen_keyboard_device::key_make(UINT8 row, UINT8 column) +void ngen_keyboard_device::key_make(uint8_t row, uint8_t column) { serial_keyboard_device::key_make(row, column); - m_keys_down = UINT8((row << 4) | column); + m_keys_down = uint8_t((row << 4) | column); m_last_reset = 0U; } -void ngen_keyboard_device::key_break(UINT8 row, UINT8 column) +void ngen_keyboard_device::key_break(uint8_t row, uint8_t column) { serial_keyboard_device::key_break(row, column); - if (m_keys_down == UINT8((row << 4) | column)) + if (m_keys_down == uint8_t((row << 4) | column)) { - m_keys_down = UINT8(~0U); + m_keys_down = uint8_t(~0U); send_key(0xc0U); } } diff --git a/src/mame/machine/ngen_kb.h b/src/mame/machine/ngen_kb.h index 5b181cd0db6..f2a9f8923ab 100644 --- a/src/mame/machine/ngen_kb.h +++ b/src/mame/machine/ngen_kb.h @@ -10,21 +10,21 @@ class ngen_keyboard_device : public serial_keyboard_device { public: - ngen_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ngen_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; protected: virtual void device_start() override; virtual void device_reset() override; virtual void rcv_complete() override; - virtual void key_make(UINT8 row, UINT8 column) override; - virtual void key_break(UINT8 row, UINT8 column) override; + virtual void key_make(uint8_t row, uint8_t column) override; + virtual void key_break(uint8_t row, uint8_t column) override; private: - void write(UINT8 data); + void write(uint8_t data); - UINT8 m_keys_down; - UINT8 m_last_reset; + uint8_t m_keys_down; + uint8_t m_last_reset; }; extern const device_type NGEN_KEYBOARD; diff --git a/src/mame/machine/nmk004.cpp b/src/mame/machine/nmk004.cpp index 3ff6d37c69f..08c579fce3d 100644 --- a/src/mame/machine/nmk004.cpp +++ b/src/mame/machine/nmk004.cpp @@ -92,7 +92,7 @@ ROM_END const device_type NMK004 = &device_creator; -nmk004_device::nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nmk004_device::nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NMK004, "NMK004", tag, owner, clock, "nmk004", __FILE__), m_cpu(*this, "mcu"), m_systemcpu(*this, ":maincpu"), diff --git a/src/mame/machine/nmk004.h b/src/mame/machine/nmk004.h index d0cbc0e7319..2851d4a6056 100644 --- a/src/mame/machine/nmk004.h +++ b/src/mame/machine/nmk004.h @@ -21,7 +21,7 @@ class nmk004_device : public device_t { public: - nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); WRITE8_MEMBER( write ); READ8_MEMBER( read ); @@ -44,8 +44,8 @@ protected: private: // internal state required_device m_systemcpu; - UINT8 to_nmk004; - UINT8 to_main; + uint8_t to_nmk004; + uint8_t to_main; }; diff --git a/src/mame/machine/nmk112.cpp b/src/mame/machine/nmk112.cpp index afe6588c000..547fdff5a27 100644 --- a/src/mame/machine/nmk112.cpp +++ b/src/mame/machine/nmk112.cpp @@ -19,7 +19,7 @@ const device_type NMK112 = &device_creator; -nmk112_device::nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nmk112_device::nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NMK112, "NMK112", tag, owner, clock, "nmk112", __FILE__), m_page_mask(0xff), m_tag0(nullptr), @@ -71,7 +71,7 @@ void nmk112_device::do_bankswitch( int offset, int data ) int banknum = offset & 3; int paged = (m_page_mask & (1 << chip)); - UINT8 *rom = chip ? m_rom1 : m_rom0; + uint8_t *rom = chip ? m_rom1 : m_rom0; int size = chip ? m_size1 : m_size0; m_current_bank[offset] = data; diff --git a/src/mame/machine/nmk112.h b/src/mame/machine/nmk112.h index c65e244e53a..31724490a7a 100644 --- a/src/mame/machine/nmk112.h +++ b/src/mame/machine/nmk112.h @@ -16,13 +16,13 @@ class nmk112_device : public device_t { public: - nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~nmk112_device() {} // static configuration static void set_rom0_tag(device_t &device, const char *tag) { downcast(device).m_tag0 = tag; } static void set_rom1_tag(device_t &device, const char *tag) { downcast(device).m_tag1 = tag; } - static void set_page_mask(device_t &device, UINT8 mask) { downcast(device).m_page_mask = ~mask; } + static void set_page_mask(device_t &device, uint8_t mask) { downcast(device).m_page_mask = ~mask; } DECLARE_WRITE8_MEMBER( okibank_w ); @@ -38,12 +38,12 @@ private: // internal state /* which chips have their sample address table divided into pages */ - UINT8 m_page_mask; + uint8_t m_page_mask; - UINT8 m_current_bank[8]; + uint8_t m_current_bank[8]; const char *m_tag0, *m_tag1; - UINT8 *m_rom0, *m_rom1; + uint8_t *m_rom0, *m_rom1; int m_size0, m_size1; }; diff --git a/src/mame/machine/ns10crypt.cpp b/src/mame/machine/ns10crypt.cpp index f13afc1e914..19ed7f809ef 100644 --- a/src/mame/machine/ns10crypt.cpp +++ b/src/mame/machine/ns10crypt.cpp @@ -219,7 +219,7 @@ ns10_type2_decrypter_device::ns10_type2_decrypter_device(device_type type, const { } -uint16_t ns10_type2_decrypter_device::decrypt(UINT16 cipherword) +uint16_t ns10_type2_decrypter_device::decrypt(uint16_t cipherword) { uint16_t plainword = cipherword ^ _mask; @@ -274,7 +274,7 @@ gf2_reducer::gf2_reducer() } } -int gf2_reducer::gf2_reduce(UINT64 num)const +int gf2_reducer::gf2_reduce(uint64_t num)const { return _gf2Reduction[num & 0xffff] ^ diff --git a/src/mame/machine/ns10crypt.h b/src/mame/machine/ns10crypt.h index 9f02335c469..7fce2aaadc6 100644 --- a/src/mame/machine/ns10crypt.h +++ b/src/mame/machine/ns10crypt.h @@ -27,7 +27,7 @@ public: virtual ~ns10_decrypter_device(); protected: - ns10_decrypter_device(device_type type, const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ns10_decrypter_device(device_type type, const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void init(int iv)=0; virtual void device_start()override=0; @@ -43,7 +43,7 @@ public: uint16_t decrypt(uint16_t cipherword)override; protected: - ns10_type1_decrypter_device(device_type type, const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ns10_type1_decrypter_device(device_type type, const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); private: uint16_t _mask; @@ -73,7 +73,7 @@ public: protected: ns10_type2_decrypter_device( device_type type, const ns10_type2_decrypter_device::ns10_crypto_logic &logic, - const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); private: uint16_t _mask; diff --git a/src/mame/machine/ns11prot.cpp b/src/mame/machine/ns11prot.cpp index ef3296bcc6d..c357b8d82eb 100644 --- a/src/mame/machine/ns11prot.cpp +++ b/src/mame/machine/ns11prot.cpp @@ -7,7 +7,7 @@ #include "ns11prot.h" -ns11_keycus_device::ns11_keycus_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) : +ns11_keycus_device::ns11_keycus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -28,7 +28,7 @@ void ns11_keycus_device::device_reset() /* tekken 2 */ -keycus_c406_device::keycus_c406_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c406_device::keycus_c406_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C406, "Namco C406 KEYCUS", tag, owner, clock, "keycus_c406", __FILE__) { } @@ -68,7 +68,7 @@ const device_type KEYCUS_C406 = &device_creator; /* soul edge */ -keycus_c409_device::keycus_c409_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c409_device::keycus_c409_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C409, "Namco C409 KEYCUS", tag, owner, clock, "keycus_c409", __FILE__) { } @@ -108,7 +108,7 @@ const device_type KEYCUS_C409 = &device_creator; /* dunk mania */ -keycus_c410_device::keycus_c410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c410_device::keycus_c410_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C410, "Namco C410 KEYCUS", tag, owner, clock, "keycus_c410", __FILE__) { } @@ -117,7 +117,7 @@ READ16_MEMBER(keycus_c410_device::read) { if( m_p2 == 0 ) { - UINT16 value = m_p1; + uint16_t value = m_p1; if( value == 0xfffe ) { value = 410; @@ -162,7 +162,7 @@ const device_type KEYCUS_C410 = &device_creator; /* prime goal ex */ -keycus_c411_device::keycus_c411_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c411_device::keycus_c411_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C411, "Namco C411 KEYCUS", tag, owner, clock, "keycus_c411", __FILE__) { } @@ -171,7 +171,7 @@ READ16_MEMBER(keycus_c411_device::read) { if( m_p2 == 0x0000 && ( ( ( m_p1 == 0x0000 || m_p1 == 0x100 ) && m_p3 == 0xff7f ) || ( m_p1 == 0x7256 ) ) ) { - UINT16 value = m_p3; + uint16_t value = m_p3; if( m_p1 != 0x7256 ) { value = 411; @@ -218,7 +218,7 @@ const device_type KEYCUS_C411 = &device_creator; /* xevious 3d/g */ -keycus_c430_device::keycus_c430_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c430_device::keycus_c430_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C430, "Namco C430 KEYCUS", tag, owner, clock, "keycus_c430", __FILE__) { } @@ -227,7 +227,7 @@ READ16_MEMBER(keycus_c430_device::read) { if( m_p2 == 0x0000 && ( ( m_p1 == 0xbfff && m_p3 == 0x0000 ) || m_p3 == 0xe296 ) ) { - UINT16 value = m_p1; + uint16_t value = m_p1; if( m_p3 != 0xe296 ) { @@ -277,7 +277,7 @@ const device_type KEYCUS_C430 = &device_creator; /* dancing eyes */ -keycus_c431_device::keycus_c431_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c431_device::keycus_c431_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C431, "Namco C431 KEYCUS", tag, owner, clock, "keycus_c431", __FILE__) { } @@ -286,7 +286,7 @@ READ16_MEMBER(keycus_c431_device::read) { if( m_p2 == 0x0000 && ( ( ( m_p1 == 0x0000 || m_p1 == 0xab50 ) && m_p3 == 0x7fff ) || m_p1 == 0x9e61 ) ) { - UINT16 value = m_p3; + uint16_t value = m_p3; if( m_p1 != 0x9e61 ) { @@ -335,7 +335,7 @@ const device_type KEYCUS_C431 = &device_creator; /* pocket racer */ -keycus_c432_device::keycus_c432_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c432_device::keycus_c432_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C432, "Namco C432 KEYCUS", tag, owner, clock, "keycus_c432", __FILE__) { } @@ -344,7 +344,7 @@ READ16_MEMBER(keycus_c432_device::read) { if( m_p1 == 0x0000 && ( ( ( m_p3 == 0x0000 || m_p3 == 0x00dc ) && m_p2 == 0xefff ) || m_p3 == 0x2f15 ) ) { - UINT16 value = m_p2; + uint16_t value = m_p2; if( m_p3 != 0x00002f15 ) { @@ -395,7 +395,7 @@ const device_type KEYCUS_C432 = &device_creator; /* star sweep */ -keycus_c442_device::keycus_c442_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c442_device::keycus_c442_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C442, "Namco C442 KEYCUS", tag, owner, clock, "keycus_c442", __FILE__) { } @@ -443,7 +443,7 @@ const device_type KEYCUS_C442 = &device_creator; /* kosodate quiz my angel 3 / point blank 2 */ -keycus_c443_device::keycus_c443_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +keycus_c443_device::keycus_c443_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ns11_keycus_device(mconfig, KEYCUS_C443, "Namco C443 KEYCUS", tag, owner, clock, "keycus_c443", __FILE__) { } diff --git a/src/mame/machine/ns11prot.h b/src/mame/machine/ns11prot.h index 3a3d0109978..b548fd19871 100644 --- a/src/mame/machine/ns11prot.h +++ b/src/mame/machine/ns11prot.h @@ -10,15 +10,15 @@ class ns11_keycus_device : public device_t { protected: - ns11_keycus_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); + ns11_keycus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock,const char *shortname, const char *source); virtual void device_start() override; virtual void device_reset() override; protected: - UINT16 m_p1; - UINT16 m_p2; - UINT16 m_p3; + uint16_t m_p1; + uint16_t m_p2; + uint16_t m_p3; public: virtual DECLARE_READ16_MEMBER( read ) = 0; @@ -30,7 +30,7 @@ public: class keycus_c406_device : public ns11_keycus_device { public: - keycus_c406_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c406_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; @@ -43,7 +43,7 @@ extern const device_type KEYCUS_C406; class keycus_c409_device : public ns11_keycus_device { public: - keycus_c409_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c409_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; @@ -56,7 +56,7 @@ extern const device_type KEYCUS_C409; class keycus_c410_device : public ns11_keycus_device { public: - keycus_c410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c410_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; @@ -69,7 +69,7 @@ extern const device_type KEYCUS_C410; class keycus_c411_device : public ns11_keycus_device { public: - keycus_c411_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c411_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; @@ -82,7 +82,7 @@ extern const device_type KEYCUS_C411; class keycus_c430_device : public ns11_keycus_device { public: - keycus_c430_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c430_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; @@ -95,7 +95,7 @@ extern const device_type KEYCUS_C430; class keycus_c431_device : public ns11_keycus_device { public: - keycus_c431_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c431_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; @@ -108,7 +108,7 @@ extern const device_type KEYCUS_C431; class keycus_c432_device : public ns11_keycus_device { public: - keycus_c432_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c432_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; @@ -121,7 +121,7 @@ extern const device_type KEYCUS_C432; class keycus_c442_device : public ns11_keycus_device { public: - keycus_c442_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c442_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; @@ -134,7 +134,7 @@ extern const device_type KEYCUS_C442; class keycus_c443_device : public ns11_keycus_device { public: - keycus_c443_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + keycus_c443_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER( read ) override; virtual DECLARE_WRITE16_MEMBER( write ) override; diff --git a/src/mame/machine/octo_kbd.cpp b/src/mame/machine/octo_kbd.cpp index f1867ac77bc..dc5dbfb7269 100644 --- a/src/mame/machine/octo_kbd.cpp +++ b/src/mame/machine/octo_kbd.cpp @@ -5,20 +5,20 @@ #include "machine/keyboard.ipp" -octopus_keyboard_device::octopus_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) +octopus_keyboard_device::octopus_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : buffered_rs232_device(mconfig, OCTOPUS_KEYBOARD, "Octopus Keyboard", tag, owner, 0, "octopus_kb", __FILE__) , device_matrix_keyboard_interface(mconfig, *this, "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9", "LINEA", "LINEB", "LINEC", "LINED", "LINEE", "LINEF") { } -void octopus_keyboard_device::received_byte(UINT8 data) +void octopus_keyboard_device::received_byte(uint8_t data) { // TODO: figure out received data format (used for Shift Lock and Caps Lock LEDs) printf("KBD: Received byte %02x\n",data); } -void octopus_keyboard_device::key_make(UINT8 row, UINT8 column) +void octopus_keyboard_device::key_make(uint8_t row, uint8_t column) { if (row != 0x0eU) typematic_start(row, column, attotime::from_msec(m_delay), attotime::from_msec(m_repeat)); @@ -28,12 +28,12 @@ void octopus_keyboard_device::key_make(UINT8 row, UINT8 column) transmit_byte((row << 3) | column); } -void octopus_keyboard_device::key_repeat(UINT8 row, UINT8 column) +void octopus_keyboard_device::key_repeat(uint8_t row, uint8_t column) { transmit_byte((row << 3) | column); } -void octopus_keyboard_device::key_break(UINT8 row, UINT8 column) +void octopus_keyboard_device::key_break(uint8_t row, uint8_t column) { device_matrix_keyboard_interface::key_break(row, column); transmit_byte(0x80U | (row << 3) | column); diff --git a/src/mame/machine/octo_kbd.h b/src/mame/machine/octo_kbd.h index b7ec54aff82..c51fe7b62f2 100644 --- a/src/mame/machine/octo_kbd.h +++ b/src/mame/machine/octo_kbd.h @@ -8,23 +8,23 @@ class octopus_keyboard_device : public buffered_rs232_device<16U>, protected device_matrix_keyboard_interface<16U> { public: - octopus_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + octopus_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; protected: virtual void device_start() override; virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void key_make(UINT8 row, UINT8 column) override; - virtual void key_repeat(UINT8 row, UINT8 column) override; - virtual void key_break(UINT8 row, UINT8 column) override; + virtual void key_make(uint8_t row, uint8_t column) override; + virtual void key_repeat(uint8_t row, uint8_t column) override; + virtual void key_break(uint8_t row, uint8_t column) override; private: - virtual void received_byte(UINT8 data) override; + virtual void received_byte(uint8_t data) override; int m_delay; // keypress delay after initial press int m_repeat; // keypress repeat rate - UINT8 m_enabled; // keyboard enabled? + uint8_t m_enabled; // keyboard enabled? }; extern const device_type OCTOPUS_KEYBOARD; diff --git a/src/mame/machine/ondra.cpp b/src/mame/machine/ondra.cpp index ca9d927217d..7bced52ddb8 100644 --- a/src/mame/machine/ondra.cpp +++ b/src/mame/machine/ondra.cpp @@ -16,7 +16,7 @@ READ8_MEMBER(ondra_state::ondra_keyboard_r) { - UINT8 retVal = 0x00; + uint8_t retVal = 0x00; double valcas = m_cassette->input(); if ( valcas < 0.00) { @@ -44,7 +44,7 @@ READ8_MEMBER(ondra_state::ondra_keyboard_r) void ondra_state::ondra_update_banks() { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *mem = m_region_maincpu->base(); + uint8_t *mem = m_region_maincpu->base(); if (m_bank1_status==0) { space.unmap_write(0x0000, 0x3fff); diff --git a/src/mame/machine/opwolf.cpp b/src/mame/machine/opwolf.cpp index 5f738556857..730749fe763 100644 --- a/src/mame/machine/opwolf.cpp +++ b/src/mame/machine/opwolf.cpp @@ -120,7 +120,7 @@ enum { OPWOLF_REGION_OTHER }; -static const UINT16 level_data_00[] = { +static const uint16_t level_data_00[] = { 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x0020, @@ -158,7 +158,7 @@ static const UINT16 level_data_00[] = { 0xffff }; -static const UINT16 level_data_01[] = { +static const uint16_t level_data_01[] = { 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0010, 0x0780, 0x0209, 0x0300, 0x4c01, 0x4004, 0x0020, 0x0780, 0x0309, 0x0300, 0x4d01, 0xe003, 0x0030, @@ -196,7 +196,7 @@ static const UINT16 level_data_01[] = { 0xffff }; -static const UINT16 level_data_02[] = { +static const uint16_t level_data_02[] = { 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0018, 0x0480, 0x000b, 0x0300, 0x4501, 0x2001, 0x0030, 0x0780, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0010, @@ -234,7 +234,7 @@ static const UINT16 level_data_02[] = { 0xffff }; -static const UINT16 level_data_03[] = { +static const uint16_t level_data_03[] = { 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0018, 0x0480, 0x000b, 0x0300, 0x4501, 0x2001, 0x002b, 0x0780, 0x010c, 0x0300, 0x4601, 0x0004, 0x000d, @@ -272,7 +272,7 @@ static const UINT16 level_data_03[] = { 0xffff }; -static const UINT16 level_data_04[] = { +static const uint16_t level_data_04[] = { 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0010, 0x0780, 0x0209, 0x0300, 0x4c01, 0x4004, 0x0020, 0x0780, 0x0309, 0x0300, 0x4d01, 0xe003, 0x0030, @@ -310,7 +310,7 @@ static const UINT16 level_data_04[] = { 0xffff }; -static const UINT16 level_data_05[] = { +static const uint16_t level_data_05[] = { 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x0020, @@ -348,7 +348,7 @@ static const UINT16 level_data_05[] = { 0xffff }; -static const UINT16 level_data_06[] = { +static const uint16_t level_data_06[] = { 0x0000, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, 0x0000, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -386,7 +386,7 @@ static const UINT16 level_data_06[] = { 0xffff }; -static const UINT16 level_data_07[] = { +static const uint16_t level_data_07[] = { 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, 0x0780, 0x0109, 0x0300, 0x4a01, 0x0004, 0x0004, @@ -422,11 +422,11 @@ static const UINT16 level_data_07[] = { 0xffff }; -static const UINT16 level_data_08[] = { +static const uint16_t level_data_08[] = { 0xffff }; -static const UINT16 level_data_09[] = { +static const uint16_t level_data_09[] = { 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, 0x0780, 0x0109, 0x0300, 0x4a01, 0x8003, 0x8003, @@ -462,7 +462,7 @@ static const UINT16 level_data_09[] = { 0xffff }; -static const UINT16 *const level_data_lookup[] = +static const uint16_t *const level_data_lookup[] = { level_data_00, level_data_01, @@ -499,7 +499,7 @@ TIMER_CALLBACK_MEMBER(opwolf_state::opwolf_timer_callback) if (m_current_cmd == 0xf5) { int const level = m_cchip_ram[0x1b] % 10; - UINT16 const *const level_data = level_data_lookup[level]; + uint16_t const *const level_data = level_data_lookup[level]; // The c-chip data is stored as a series of 3 word sets, delimited by 0xffff memset(m_cchip_ram + 0x200, 0, 0x200); @@ -660,9 +660,9 @@ WRITE16_MEMBER(opwolf_state::opwolf_cchip_data_w) if (offset == 0x14) { #if OPWOLF_READ_COINAGE_FROM_ROM - UINT16* rom = (UINT16*)memregion("maincpu")->base(); - UINT32 coin_table[2] = {0, 0}; - UINT8 coin_offset[2]; + uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); + uint32_t coin_table[2] = {0, 0}; + uint8_t coin_offset[2]; int slot; if ((m_opwolf_region == OPWOLF_REGION_JAPAN) || (m_opwolf_region == OPWOLF_REGION_US)) diff --git a/src/mame/machine/orion.cpp b/src/mame/machine/orion.cpp index 4556778597b..0146f95a2b5 100644 --- a/src/mame/machine/orion.cpp +++ b/src/mame/machine/orion.cpp @@ -24,7 +24,7 @@ READ8_MEMBER(orion_state::orion_romdisk_porta_r) { - UINT16 addr = (m_romdisk_msb << 8) | m_romdisk_lsb; + uint16_t addr = (m_romdisk_msb << 8) | m_romdisk_lsb; if (m_cart->exists() && addr < m_cart->get_rom_size()) return m_cart->read_rom(space, addr); else @@ -245,8 +245,8 @@ WRITE8_MEMBER(orion_state::orionz80_sound_fe_w) void orion_state::orionz80_switch_bank() { - UINT8 bank_select; - UINT8 segment_select; + uint8_t bank_select; + uint8_t segment_select; address_space &space = m_maincpu->space(AS_PROGRAM); bank_select = (m_orionz80_dispatcher & 0x0c) >> 2; @@ -393,7 +393,7 @@ void orion_state::orionpro_bank_switch() address_space &space = m_maincpu->space(AS_PROGRAM); int page = m_orionpro_page & 7; // we have only 8 pages int is128 = (m_orionpro_dispatcher & 0x80) ? 1 : 0; - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); if (is128==1) { diff --git a/src/mame/machine/osborne1.cpp b/src/mame/machine/osborne1.cpp index aaa06ae9c3b..26fbcb8b9a2 100644 --- a/src/mame/machine/osborne1.cpp +++ b/src/mame/machine/osborne1.cpp @@ -32,7 +32,7 @@ READ8_MEMBER( osborne1_state::bank_2xxx_3xxx_r ) // Since each peripheral only checks two bits, many addresses will // result in multiple peripherals attempting to drive the bus. This is // simulated by ANDing all the values together. - UINT8 data = 0xFF; + uint8_t data = 0xFF; if ((offset & 0x900) == 0x100) // Floppy data &= m_fdc->read(space, offset & 0x03); if ((offset & 0x900) == 0x900) // IEEE488 PIA @@ -97,7 +97,7 @@ WRITE8_MEMBER( osborne1_state::videoram_w ) data |= 0x7F; else m_tilemap->mark_tile_dirty(offset); - reinterpret_cast(m_bank_fxxx->base())[offset] = data; + reinterpret_cast(m_bank_fxxx->base())[offset] = data; } READ8_MEMBER( osborne1_state::opcode_r ) @@ -105,7 +105,7 @@ READ8_MEMBER( osborne1_state::opcode_r ) if (!space.debugger_access()) { // Update the flipflops that control bank selection and NMI - UINT8 const new_ub6a_q = (m_btn_reset->read() & 0x80) ? 1 : 0; + uint8_t const new_ub6a_q = (m_btn_reset->read() & 0x80) ? 1 : 0; if (!m_rom_mode) { set_rom_mode(m_ub4a_q ? 0 : 1); @@ -119,7 +119,7 @@ READ8_MEMBER( osborne1_state::opcode_r ) address_space &program_space(m_maincpu->space(AS_PROGRAM)); bool const prev_debugger_access(program_space.debugger_access()); program_space.set_debugger_access(space.debugger_access()); - UINT8 const data(program_space.read_byte(offset)); + uint8_t const data(program_space.read_byte(offset)); program_space.set_debugger_access(prev_debugger_access); return data; } @@ -171,7 +171,7 @@ READ8_MEMBER( osborne1_state::ieee_pia_pb_r ) 6 NDAC 7 NRFD */ - UINT8 data = 0; + uint8_t data = 0; data |= m_ieee->eoi_r() << 3; data |= m_ieee->dav_r() << 5; @@ -345,7 +345,7 @@ void osborne1_state::video_start() m_video_timer->adjust(machine().first_screen()->time_until_pos(1, 0)); } -UINT32 osborne1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t osborne1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -371,8 +371,8 @@ void osborne1_state::device_timer(emu_timer &timer, device_timer_id id, int para TIMER_CALLBACK_MEMBER(osborne1_state::video_callback) { int const y = machine().first_screen()->vpos(); - UINT8 const ra = y % 10; - UINT8 const port_b = m_pia1->b_output(); + uint8_t const ra = y % 10; + uint8_t const port_b = m_pia1->b_output(); // Check for start/end of visible area and clear/set CA1 on video PIA if (y == 0) @@ -388,9 +388,9 @@ TIMER_CALLBACK_MEMBER(osborne1_state::video_callback) if (y < 240) { // Draw a line of the display - UINT16 *p = &m_bitmap.pix16(y); + uint16_t *p = &m_bitmap.pix16(y); bool const hires = m_screen_pac & m_resolution; - UINT16 const row = ((m_scroll_y + (y / 10)) << 7) & 0xF80; + uint16_t const row = ((m_scroll_y + (y / 10)) << 7) & 0xF80; // The derivation of the initial column is not obvious. The 7-bit // column counter is preloaded near the beginning of the horizontal @@ -409,15 +409,15 @@ TIMER_CALLBACK_MEMBER(osborne1_state::video_callback) // signal (set by bit 1 of the value written to 0x2400). Of course // it depends on the value wrapping around to zero when it counts // past 0x7F - UINT16 const col = hires ? ((m_scroll_x & 0x60) + (m_hc_left ? 0x09 : 0x01) + 0x17) : (m_scroll_x + 0x0B); + uint16_t const col = hires ? ((m_scroll_x & 0x60) + (m_hc_left ? 0x09 : 0x01) + 0x17) : (m_scroll_x + 0x0B); - for (UINT16 x = 0; x < (hires ? 104 : 52); x++) + for (uint16_t x = 0; x < (hires ? 104 : 52); x++) { - UINT16 const offs = row | ((col + x) & 0x7F); - UINT8 const chr = m_ram->pointer()[0xF000 + offs]; - UINT8 const clr = (m_ram->pointer()[0x10000 + offs] & 0x80) ? 2 : 1; + uint16_t const offs = row | ((col + x) & 0x7F); + uint8_t const chr = m_ram->pointer()[0xF000 + offs]; + uint8_t const clr = (m_ram->pointer()[0x10000 + offs] & 0x80) ? 2 : 1; - UINT8 const gfx = ((chr & 0x80) && (ra == 9)) ? 0xFF : m_p_chargen[(ra << 7) | (chr & 0x7F)]; + uint8_t const gfx = ((chr & 0x80) && (ra == 9)) ? 0xFF : m_p_chargen[(ra << 7) | (chr & 0x7F)]; // Display a scanline of a character *p++ = BIT(gfx, 7) ? clr : 0; @@ -458,7 +458,7 @@ TILE_GET_INFO_MEMBER(osborne1_state::get_tile_info) } -bool osborne1_state::set_rom_mode(UINT8 value) +bool osborne1_state::set_rom_mode(uint8_t value) { if (value != m_rom_mode) { @@ -473,7 +473,7 @@ bool osborne1_state::set_rom_mode(UINT8 value) } } -bool osborne1_state::set_bit_9(UINT8 value) +bool osborne1_state::set_bit_9(uint8_t value) { if (value != m_bit_9) { diff --git a/src/mame/machine/pacplus.cpp b/src/mame/machine/pacplus.cpp index c30ab05f63e..981ab9af96c 100644 --- a/src/mame/machine/pacplus.cpp +++ b/src/mame/machine/pacplus.cpp @@ -4,9 +4,9 @@ #include "includes/pacman.h" -UINT8 pacman_state::pacplus_decrypt(int addr, UINT8 e) +uint8_t pacman_state::pacplus_decrypt(int addr, uint8_t e) { - static const UINT8 swap_xor_table[6][9] = + static const uint8_t swap_xor_table[6][9] = { { 7,6,5,4,3,2,1,0, 0x00 }, { 7,6,5,4,3,2,1,0, 0x28 }, @@ -20,8 +20,8 @@ UINT8 pacman_state::pacplus_decrypt(int addr, UINT8 e) 0,2,4,2,4,0,4,2,2,0,2,2,4,0,4,2, 2,2,4,0,4,2,4,0,0,4,0,4,4,2,4,2 }; - UINT32 method = 0; - const UINT8 *tbl; + uint32_t method = 0; + const uint8_t *tbl; /* pick method from bits 0 2 5 7 9 of the address */ @@ -44,7 +44,7 @@ UINT8 pacman_state::pacplus_decrypt(int addr, UINT8 e) void pacman_state::pacplus_decode() { int i; - UINT8 *RAM; + uint8_t *RAM; /* CPU ROMs */ diff --git a/src/mame/machine/partner.cpp b/src/mame/machine/partner.cpp index a336ad83c9b..67293d2f7ea 100644 --- a/src/mame/machine/partner.cpp +++ b/src/mame/machine/partner.cpp @@ -24,7 +24,7 @@ DRIVER_INIT_MEMBER(partner_state,partner) m_tape_value = 0x80; } -void partner_state::partner_window_1(UINT8 bank_num, UINT16 offset,UINT8 *rom) +void partner_state::partner_window_1(uint8_t bank_num, uint16_t offset,uint8_t *rom) { char bank[10]; sprintf(bank,"bank%d",bank_num); @@ -41,7 +41,7 @@ void partner_state::partner_window_1(UINT8 bank_num, UINT16 offset,UINT8 *rom) } } -void partner_state::partner_window_2(UINT8 bank_num, UINT16 offset,UINT8 *rom) +void partner_state::partner_window_2(uint8_t bank_num, uint16_t offset,uint8_t *rom) { char bank[10]; sprintf(bank,"bank%d",bank_num); @@ -99,7 +99,7 @@ WRITE8_MEMBER(partner_state::partner_floppy_w){ } } -void partner_state::partner_iomap_bank(UINT8 *rom) +void partner_state::partner_iomap_bank(uint8_t *rom) { address_space &space = m_maincpu->space(AS_PROGRAM); switch(m_win_mem_page) { @@ -119,8 +119,8 @@ void partner_state::partner_iomap_bank(UINT8 *rom) void partner_state::partner_bank_switch() { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *rom = memregion("maincpu")->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *rom = memregion("maincpu")->base(); + uint8_t *ram = m_ram->pointer(); space.install_write_bank(0x0000, 0x07ff, "bank1"); space.install_write_bank(0x0800, 0x3fff, "bank2"); @@ -336,8 +336,8 @@ I8275_DRAW_CHARACTER_MEMBER(partner_state::display_pixels) { int i; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - const UINT8 *charmap = m_charmap + 0x400 * (gpa * 2 + hlgt); - UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; + const uint8_t *charmap = m_charmap + 0x400 * (gpa * 2 + hlgt); + uint8_t pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; if(linecount == 8) pixels = 0; if (vsp) { diff --git a/src/mame/machine/pc1251.cpp b/src/mame/machine/pc1251.cpp index bd0cd4ff25e..126d1810d94 100644 --- a/src/mame/machine/pc1251.cpp +++ b/src/mame/machine/pc1251.cpp @@ -89,8 +89,8 @@ READ_LINE_MEMBER(pc1251_state::pc1251_reset) void pc1251_state::machine_start() { - UINT8 *ram = memregion("maincpu")->base() + 0x8000; - UINT8 *cpu = m_maincpu->internal_ram(); + uint8_t *ram = memregion("maincpu")->base() + 0x8000; + uint8_t *cpu = m_maincpu->internal_ram(); machine().device("cpu_nvram")->set_base(cpu, 96); machine().device("ram_nvram")->set_base(ram, 0x4800); @@ -98,8 +98,8 @@ void pc1251_state::machine_start() MACHINE_START_MEMBER(pc1251_state,pc1260 ) { - UINT8 *ram = memregion("maincpu")->base() + 0x4000; - UINT8 *cpu = m_maincpu->internal_ram(); + uint8_t *ram = memregion("maincpu")->base() + 0x4000; + uint8_t *cpu = m_maincpu->internal_ram(); machine().device("cpu_nvram")->set_base(cpu, 96); machine().device("ram_nvram")->set_base(ram, 0x2800); @@ -120,7 +120,7 @@ void pc1251_state::device_timer(emu_timer &timer, device_timer_id id, int param, DRIVER_INIT_MEMBER(pc1251_state,pc1251) { int i; - UINT8 *gfx = memregion("gfx1")->base(); + uint8_t *gfx = memregion("gfx1")->base(); for (i=0; i<128; i++) gfx[i]=i; m_power = 1; diff --git a/src/mame/machine/pc1350.cpp b/src/mame/machine/pc1350.cpp index 6559e08041e..ad439a3e523 100644 --- a/src/mame/machine/pc1350.cpp +++ b/src/mame/machine/pc1350.cpp @@ -127,8 +127,8 @@ void pc1350_state::machine_start() space.nop_readwrite(0x2000, 0x3fff); } - UINT8 *ram = memregion("maincpu")->base() + 0x2000; - UINT8 *cpu = m_maincpu->internal_ram(); + uint8_t *ram = memregion("maincpu")->base() + 0x2000; + uint8_t *cpu = m_maincpu->internal_ram(); machine().device("cpu_nvram")->set_base(cpu, 96); machine().device("ram_nvram")->set_base(ram, 0x5000); diff --git a/src/mame/machine/pc1401.cpp b/src/mame/machine/pc1401.cpp index 7cb7fb08308..64f28f77b12 100644 --- a/src/mame/machine/pc1401.cpp +++ b/src/mame/machine/pc1401.cpp @@ -113,8 +113,8 @@ READ_LINE_MEMBER(pc1401_state::pc1401_reset) void pc1401_state::machine_start() { - UINT8 *ram = memregion("maincpu")->base() + 0x2000; - UINT8 *cpu = m_maincpu->internal_ram(); + uint8_t *ram = memregion("maincpu")->base() + 0x2000; + uint8_t *cpu = m_maincpu->internal_ram(); machine().device("cpu_nvram")->set_base(cpu, 96); machine().device("ram_nvram")->set_base(ram, 0x2800); @@ -135,7 +135,7 @@ void pc1401_state::device_timer(emu_timer &timer, device_timer_id id, int param, DRIVER_INIT_MEMBER(pc1401_state,pc1401) { int i; - UINT8 *gfx=memregion("gfx1")->base(); + uint8_t *gfx=memregion("gfx1")->base(); #if 0 static const char sucker[]={ /* this routine dump the memory (start 0) diff --git a/src/mame/machine/pc1403.cpp b/src/mame/machine/pc1403.cpp index a8f667e0a1e..f477573c43a 100644 --- a/src/mame/machine/pc1403.cpp +++ b/src/mame/machine/pc1403.cpp @@ -40,7 +40,7 @@ WRITE8_MEMBER(pc1403_state::pc1403_asic_write) READ8_MEMBER(pc1403_state::pc1403_asic_read) { - UINT8 data=m_asic[offset>>9]; + uint8_t data=m_asic[offset>>9]; switch( (offset>>9) ){ case 0: case 1: case 2: logerror ("asic read %.4x %.2x\n",offset, data); @@ -56,7 +56,7 @@ WRITE8_MEMBER(pc1403_state::pc1403_outa) READ8_MEMBER(pc1403_state::pc1403_ina) { - UINT8 data=m_outa; + uint8_t data=m_outa; if (m_asic[3] & 0x01) data |= ioport("KEY0")->read(); @@ -140,8 +140,8 @@ READ_LINE_MEMBER(pc1403_state::pc1403_reset) void pc1403_state::machine_start() { - UINT8 *ram = memregion("maincpu")->base() + 0x8000; - UINT8 *cpu = m_maincpu->internal_ram(); + uint8_t *ram = memregion("maincpu")->base() + 0x8000; + uint8_t *cpu = m_maincpu->internal_ram(); machine().device("cpu_nvram")->set_base(cpu, 96); machine().device("ram_nvram")->set_base(ram, 0x8000); @@ -162,7 +162,7 @@ void pc1403_state::device_timer(emu_timer &timer, device_timer_id id, int param, DRIVER_INIT_MEMBER(pc1403_state,pc1403) { int i; - UINT8 *gfx=memregion("gfx1")->base(); + uint8_t *gfx=memregion("gfx1")->base(); for (i=0; i<128; i++) gfx[i]=i; diff --git a/src/mame/machine/pc1512kb.cpp b/src/mame/machine/pc1512kb.cpp index ede64bda48c..4e0a4db6e20 100644 --- a/src/mame/machine/pc1512kb.cpp +++ b/src/mame/machine/pc1512kb.cpp @@ -217,7 +217,7 @@ ioport_constructor pc1512_keyboard_t::device_input_ports() const // pc1512_keyboard_t - constructor //------------------------------------------------- -pc1512_keyboard_t::pc1512_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc1512_keyboard_t::pc1512_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC1512_KEYBOARD, "Amstrad PC1512 Keyboard", tag, owner, clock, "pc1512kb", __FILE__), m_maincpu(*this, I8048_TAG), m_joy(*this, "joy"), @@ -353,7 +353,7 @@ READ8_MEMBER( pc1512_keyboard_t::kb_bus_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(m_kb_y, 0)) data &= m_y[0]->read(); if (!BIT(m_kb_y, 1)) data &= m_y[1]->read(); @@ -421,7 +421,7 @@ READ8_MEMBER( pc1512_keyboard_t::kb_p2_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_data_in; data |= m_clock_in << 1; diff --git a/src/mame/machine/pc1512kb.h b/src/mame/machine/pc1512kb.h index d1fe04cfac0..9dccac573e3 100644 --- a/src/mame/machine/pc1512kb.h +++ b/src/mame/machine/pc1512kb.h @@ -48,7 +48,7 @@ class pc1512_keyboard_t : public device_t { public: // construction/destruction - pc1512_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc1512_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_clock_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_clock.set_callback(object); } template static devcb_base &set_data_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_data.set_callback(object); } diff --git a/src/mame/machine/pc9801_118.cpp b/src/mame/machine/pc9801_118.cpp index c5cf627e423..7737582a209 100644 --- a/src/mame/machine/pc9801_118.cpp +++ b/src/mame/machine/pc9801_118.cpp @@ -117,7 +117,7 @@ const tiny_rom_entry *pc9801_118_device::device_rom_region() const // pc9801_118_device - constructor //------------------------------------------------- -pc9801_118_device::pc9801_118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pc9801_118_device::pc9801_118_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC9801_118, "pc9801_118", tag, owner, clock, "pc9801_118", __FILE__), // m_maincpu(*this, "^maincpu"), m_opn3(*this, "opn3") @@ -169,7 +169,7 @@ void pc9801_118_device::device_start() void pc9801_118_device::device_reset() { - UINT16 port_base = (ioport("OPN3_DSW")->read() & 1) << 8; + uint16_t port_base = (ioport("OPN3_DSW")->read() & 1) << 8; install_device(port_base + 0x0088, port_base + 0x008f, read8_delegate(FUNC(pc9801_118_device::pc9801_118_r), this), write8_delegate(FUNC(pc9801_118_device::pc9801_118_w), this) ); install_device(0xa460, 0xa463, read8_delegate(FUNC(pc9801_118_device::pc9801_118_ext_r), this), write8_delegate(FUNC(pc9801_118_device::pc9801_118_ext_w), this) ); m_ext_reg = 1; // TODO: enabled or disabled? diff --git a/src/mame/machine/pc9801_118.h b/src/mame/machine/pc9801_118.h index 40575a839f7..87bc44cb7db 100644 --- a/src/mame/machine/pc9801_118.h +++ b/src/mame/machine/pc9801_118.h @@ -26,7 +26,7 @@ class pc9801_118_device : public device_t { public: // construction/destruction - pc9801_118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc9801_118_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -51,8 +51,8 @@ protected: void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); private: - UINT8 m_joy_sel; - UINT8 m_ext_reg; + uint8_t m_joy_sel; + uint8_t m_ext_reg; }; diff --git a/src/mame/machine/pc9801_26.cpp b/src/mame/machine/pc9801_26.cpp index d421e0f40ce..ec01035bba3 100644 --- a/src/mame/machine/pc9801_26.cpp +++ b/src/mame/machine/pc9801_26.cpp @@ -109,7 +109,7 @@ ioport_constructor pc9801_26_device::device_input_ports() const // pc9801_26_device - constructor //------------------------------------------------- -pc9801_26_device::pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pc9801_26_device::pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC9801_26, "pc9801_26", tag, owner, clock, "pc9801_26", __FILE__), // m_maincpu(*this, "^maincpu"), m_opn(*this, "opn") @@ -161,7 +161,7 @@ void pc9801_26_device::device_start() void pc9801_26_device::device_reset() { - UINT16 port_base = (ioport("OPN_DSW")->read() & 1) << 8; + uint16_t port_base = (ioport("OPN_DSW")->read() & 1) << 8; install_device(port_base + 0x0088, port_base + 0x008b, read8_delegate(FUNC(pc9801_26_device::pc9801_26_r), this), write8_delegate(FUNC(pc9801_26_device::pc9801_26_w), this) ); } diff --git a/src/mame/machine/pc9801_26.h b/src/mame/machine/pc9801_26.h index d48596c8834..4239891c7f2 100644 --- a/src/mame/machine/pc9801_26.h +++ b/src/mame/machine/pc9801_26.h @@ -26,7 +26,7 @@ class pc9801_26_device : public device_t { public: // construction/destruction - pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -48,7 +48,7 @@ protected: void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); private: - UINT8 m_joy_sel; + uint8_t m_joy_sel; }; diff --git a/src/mame/machine/pc9801_86.cpp b/src/mame/machine/pc9801_86.cpp index 3a354dcdb92..a60accde274 100644 --- a/src/mame/machine/pc9801_86.cpp +++ b/src/mame/machine/pc9801_86.cpp @@ -127,7 +127,7 @@ ioport_constructor pc9801_86_device::device_input_ports() const // pc9801_86_device - constructor //------------------------------------------------- -pc9801_86_device::pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pc9801_86_device::pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC9801_86, "pc9801_86", tag, owner, clock, "pc9801_86", __FILE__), m_opna(*this, "opna"), m_ldac(*this, "ldac"), @@ -182,7 +182,7 @@ void pc9801_86_device::device_start() void pc9801_86_device::device_reset() { - UINT16 port_base = (ioport("OPNA_DSW")->read() & 1) << 8; + uint16_t port_base = (ioport("OPNA_DSW")->read() & 1) << 8; install_device(port_base + 0x0088, port_base + 0x008f, read8_delegate(FUNC(pc9801_86_device::opn_r), this), write8_delegate(FUNC(pc9801_86_device::opn_w), this) ); install_device(0xa460, 0xa463, read8_delegate(FUNC(pc9801_86_device::id_r), this), write8_delegate(FUNC(pc9801_86_device::mask_w), this)); install_device(0xa464, 0xa46f, read8_delegate(FUNC(pc9801_86_device::pcm_r), this), write8_delegate(FUNC(pc9801_86_device::pcm_w), this)); @@ -305,11 +305,11 @@ int pc9801_86_device::queue_count() return m_count; } -UINT8 pc9801_86_device::queue_pop() +uint8_t pc9801_86_device::queue_pop() { if(!queue_count()) return 0; - UINT8 ret = m_queue[m_tail++]; + uint8_t ret = m_queue[m_tail++]; m_tail %= QUEUE_SIZE; m_count--; return ret; @@ -317,7 +317,7 @@ UINT8 pc9801_86_device::queue_pop() void pc9801_86_device::device_timer(emu_timer& timer, device_timer_id id, int param, void* ptr) { - INT16 lsample, rsample; + int16_t lsample, rsample; if((m_pcm_ctrl & 0x40) || !(m_pcm_ctrl & 0x80) || !queue_count()) return; diff --git a/src/mame/machine/pc9801_86.h b/src/mame/machine/pc9801_86.h index b29e74f43af..0e99f90fc10 100644 --- a/src/mame/machine/pc9801_86.h +++ b/src/mame/machine/pc9801_86.h @@ -26,7 +26,7 @@ class pc9801_86_device : public device_t { public: // construction/destruction - pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -52,15 +52,15 @@ protected: private: int queue_count(); - UINT8 queue_pop(); + uint8_t queue_pop(); - UINT8 m_joy_sel, m_mask, m_pcm_mode, m_vol[7], m_pcm_ctrl, m_pcm_mute; - UINT16 m_head, m_tail, m_count, m_irq_rate; + uint8_t m_joy_sel, m_mask, m_pcm_mode, m_vol[7], m_pcm_ctrl, m_pcm_mute; + uint16_t m_head, m_tail, m_count, m_irq_rate; bool m_pcmirq, m_fmirq; required_device m_opna; required_device m_ldac; required_device m_rdac; - std::vector m_queue; + std::vector m_queue; emu_timer *m_dac_timer; }; diff --git a/src/mame/machine/pc9801_cbus.cpp b/src/mame/machine/pc9801_cbus.cpp index 2e3f6b59670..25e99e56742 100644 --- a/src/mame/machine/pc9801_cbus.cpp +++ b/src/mame/machine/pc9801_cbus.cpp @@ -51,7 +51,7 @@ device_pc9801cbus_card_interface::~device_pc9801cbus_card_interface() // pc9801_slot_device - constructor //------------------------------------------------- -pc9801_slot_device::pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc9801_slot_device::pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC9801CBUS_SLOT, "PC-9801 sound cbus slot", tag, owner, clock, "pc9801_slot", __FILE__), device_slot_interface(mconfig, *this) { diff --git a/src/mame/machine/pc9801_cbus.h b/src/mame/machine/pc9801_cbus.h index 2a7ca5e33e1..408fcd414ad 100644 --- a/src/mame/machine/pc9801_cbus.h +++ b/src/mame/machine/pc9801_cbus.h @@ -58,7 +58,7 @@ class pc9801_slot_device : public device_t, { public: // construction/destruction - pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; diff --git a/src/mame/machine/pc9801_cd.cpp b/src/mame/machine/pc9801_cd.cpp index c3def9ba118..a47c9103971 100644 --- a/src/mame/machine/pc9801_cd.cpp +++ b/src/mame/machine/pc9801_cd.cpp @@ -5,7 +5,7 @@ // device type definition const device_type PC9801_CD = &device_creator; -pc9801_cd_device::pc9801_cd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc9801_cd_device::pc9801_cd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atapi_cdrom_device(mconfig, PC9801_CD, "PC9801 CD-ROM Drive", tag, owner, clock, "pc9801_cd", __FILE__) { } diff --git a/src/mame/machine/pc9801_cd.h b/src/mame/machine/pc9801_cd.h index 35a2d223bd8..5fdc19eaf21 100644 --- a/src/mame/machine/pc9801_cd.h +++ b/src/mame/machine/pc9801_cd.h @@ -9,7 +9,7 @@ class pc9801_cd_device : public atapi_cdrom_device { public: - pc9801_cd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc9801_cd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void fill_buffer() override; diff --git a/src/mame/machine/pc9801_kbd.cpp b/src/mame/machine/pc9801_kbd.cpp index 520b73c31e4..90a0cbd7957 100644 --- a/src/mame/machine/pc9801_kbd.cpp +++ b/src/mame/machine/pc9801_kbd.cpp @@ -34,7 +34,7 @@ const device_type PC9801_KBD = &device_creator; // pc9801_kbd_device - constructor //------------------------------------------------- -pc9801_kbd_device::pc9801_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc9801_kbd_device::pc9801_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC9801_KBD, "pc9801_kbd", tag, owner, clock, "pc9801_kbd_", __FILE__), m_write_irq(*this) { @@ -47,10 +47,10 @@ pc9801_kbd_device::pc9801_kbd_device(const machine_config &mconfig, const char * INPUT_CHANGED_MEMBER(pc9801_kbd_device::key_stroke) { if(newval && !oldval) - m_rx_buf[(UINT8)(uintptr_t)(param) & 0x7f] = 1; + m_rx_buf[(uint8_t)(uintptr_t)(param) & 0x7f] = 1; if(oldval && !newval) - m_rx_buf[(UINT8)(uintptr_t)(param) & 0x7f] = 2; + m_rx_buf[(uint8_t)(uintptr_t)(param) & 0x7f] = 2; } static INPUT_PORTS_START( pc9801_kbd ) diff --git a/src/mame/machine/pc9801_kbd.h b/src/mame/machine/pc9801_kbd.h index 6de22f9fe94..547dca96f64 100644 --- a/src/mame/machine/pc9801_kbd.h +++ b/src/mame/machine/pc9801_kbd.h @@ -30,7 +30,7 @@ class pc9801_kbd_device : public device_t { public: // construction/destruction - pc9801_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc9801_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } @@ -52,9 +52,9 @@ protected: static const device_timer_id RX_TIMER = 1; emu_timer * m_rxtimer; - UINT8 m_rx_buf[0x80]; - UINT8 m_keyb_tx; - UINT8 m_keyb_rx; + uint8_t m_rx_buf[0x80]; + uint8_t m_keyb_tx; + uint8_t m_keyb_rx; bool m_key_avail; }; diff --git a/src/mame/machine/pcd_kbd.cpp b/src/mame/machine/pcd_kbd.cpp index 6b4e0078b00..704e71b5c58 100644 --- a/src/mame/machine/pcd_kbd.cpp +++ b/src/mame/machine/pcd_kbd.cpp @@ -221,7 +221,7 @@ ioport_constructor pcd_keyboard_device::device_input_ports() const return INPUT_PORTS_NAME( pcd_keyboard ); } -pcd_keyboard_device::pcd_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pcd_keyboard_device::pcd_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCD_KEYBOARD, "PC-D Keyboard", tag, owner, clock, "pcd_kbd", __FILE__) , m_rows(*this, "ROW.%u", 0) , m_p1(0) diff --git a/src/mame/machine/pcd_kbd.h b/src/mame/machine/pcd_kbd.h index 833f83fec64..e44e38bbec9 100644 --- a/src/mame/machine/pcd_kbd.h +++ b/src/mame/machine/pcd_kbd.h @@ -13,7 +13,7 @@ class pcd_keyboard_device : public device_t { public: - pcd_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pcd_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_tx_handler(device_t &device, _Object object) { return downcast(device).m_out_tx_handler.set_callback(object); } @@ -30,7 +30,7 @@ public: DECLARE_WRITE_LINE_MEMBER( t0_w ); private: required_ioport_array<17> m_rows; - UINT8 m_p1; + uint8_t m_p1; bool m_t0; devcb_write_line m_out_tx_handler; }; diff --git a/src/mame/machine/pce.cpp b/src/mame/machine/pce.cpp index ad5d712367c..661a8f1b71c 100644 --- a/src/mame/machine/pce.cpp +++ b/src/mame/machine/pce.cpp @@ -134,7 +134,7 @@ MACHINE_RESET_MEMBER(pce_state,mess_pce) WRITE8_MEMBER(pce_state::mess_pce_joystick_w) { int joy_i; - UINT8 joy_type = m_joy_type->read(); + uint8_t joy_type = m_joy_type->read(); m_maincpu->io_set_buffer(data); @@ -162,8 +162,8 @@ WRITE8_MEMBER(pce_state::mess_pce_joystick_w) READ8_MEMBER(pce_state::mess_pce_joystick_r) { - UINT8 joy_type = m_joy_type->read(); - UINT8 ret, data; + uint8_t joy_type = m_joy_type->read(); + uint8_t ret, data; if (m_joystick_port_select <= 4) { diff --git a/src/mame/machine/pce220_ser.cpp b/src/mame/machine/pce220_ser.cpp index 6cd59aaa4bd..2fd629a37bf 100644 --- a/src/mame/machine/pce220_ser.cpp +++ b/src/mame/machine/pce220_ser.cpp @@ -43,7 +43,7 @@ const device_type PCE220SERIAL = &device_creator; // pce220_serial_device - constructor //------------------------------------------------- -pce220_serial_device::pce220_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pce220_serial_device::pce220_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCE220SERIAL, "Sharp PC-E220 serial", tag, owner, clock, "pce220_serial", __FILE__), device_image_interface(mconfig, *this) { @@ -144,7 +144,7 @@ void pce220_serial_device::device_timer(emu_timer &timer, device_timer_id id, in { //next byte m_bytes_count++; - popmessage("Send %d/%d bytes\n", m_bytes_count , (UINT32)length()); + popmessage("Send %d/%d bytes\n", m_bytes_count , (uint32_t)length()); m_state = SIO_WAIT; if (m_bytes_count < length()) fread(&m_current_byte, 1); @@ -269,9 +269,9 @@ void pce220_serial_device::call_unload() calculate the byte parity -------------------------------------------------*/ -int pce220_serial_device::calc_parity(UINT8 data) +int pce220_serial_device::calc_parity(uint8_t data) { - UINT8 count = 0; + uint8_t count = 0; while(data != 0) { diff --git a/src/mame/machine/pce220_ser.h b/src/mame/machine/pce220_ser.h index 27cc66cbcd8..f375c45ee18 100644 --- a/src/mame/machine/pce220_ser.h +++ b/src/mame/machine/pce220_ser.h @@ -23,7 +23,7 @@ class pce220_serial_device : public device_t, { public: // construction/destruction - pce220_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pce220_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~pce220_serial_device(); // image-level overrides @@ -41,17 +41,17 @@ public: virtual const char *file_extensions() const override { return "txt,ihx"; } // specific implementation - UINT8 in_xin(void) { return m_xin & 0x01; } - UINT8 in_din(void) { return m_din & 0x01; } - UINT8 in_ack(void) { return m_ack & 0x01; } - void out_busy(UINT8 state) { m_busy = state & 0x01; } - void out_dout(UINT8 state) { m_dout = state & 0x01; } - void out_xout(UINT8 state) { m_xout = state & 0x01; } - void enable_interface(UINT8 state) { m_enabled = state & 0x01; } + uint8_t in_xin(void) { return m_xin & 0x01; } + uint8_t in_din(void) { return m_din & 0x01; } + uint8_t in_ack(void) { return m_ack & 0x01; } + void out_busy(uint8_t state) { m_busy = state & 0x01; } + void out_dout(uint8_t state) { m_dout = state & 0x01; } + void out_xout(uint8_t state) { m_xout = state & 0x01; } + void enable_interface(uint8_t state) { m_enabled = state & 0x01; } protected: // internal helpers - int calc_parity(UINT8 data); + int calc_parity(uint8_t data); int get_next_state(); // device-level overrides @@ -67,17 +67,17 @@ private: emu_timer* m_send_timer; // timer for send data emu_timer* m_receive_timer; // timer for receive data - UINT8 m_state; // transfer status - UINT32 m_bytes_count; // number of bytes transferred - UINT8 m_current_byte; // byte in transfer - UINT8 m_enabled; // enable/disable - - UINT8 m_busy; // CTS - UINT8 m_dout; // DTR - UINT8 m_xout; // TXD - UINT8 m_xin; // RXD - UINT8 m_din; // DSR - UINT8 m_ack; // RTS + uint8_t m_state; // transfer status + uint32_t m_bytes_count; // number of bytes transferred + uint8_t m_current_byte; // byte in transfer + uint8_t m_enabled; // enable/disable + + uint8_t m_busy; // CTS + uint8_t m_dout; // DTR + uint8_t m_xout; // TXD + uint8_t m_xin; // RXD + uint8_t m_din; // DSR + uint8_t m_ack; // RTS }; // device type definition diff --git a/src/mame/machine/pce_cd.cpp b/src/mame/machine/pce_cd.cpp index 20e4b60cf23..5248a48fcbd 100644 --- a/src/mame/machine/pce_cd.cpp +++ b/src/mame/machine/pce_cd.cpp @@ -78,7 +78,7 @@ CD Interface Register 0x0f - ADPCM fade in/out register const device_type PCE_CD = &device_creator; -pce_cd_device::pce_cd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pce_cd_device::pce_cd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCE_CD, "PCE CD Add-on", tag, owner, clock, "pcecd", __FILE__), m_maincpu(*this, ":maincpu"), m_msm(*this, "msm5205"), @@ -91,7 +91,7 @@ pce_cd_device::pce_cd_device(const machine_config &mconfig, const char *tag, dev void pce_cd_device::device_start() { /* Initialize BRAM */ - m_bram = std::make_unique(PCE_BRAM_SIZE * 2); + m_bram = std::make_unique(PCE_BRAM_SIZE * 2); memset(m_bram.get(), 0, PCE_BRAM_SIZE); memset(m_bram.get() + PCE_BRAM_SIZE, 0xff, PCE_BRAM_SIZE); m_bram_locked = 1; @@ -99,21 +99,21 @@ void pce_cd_device::device_start() m_nvram->set_base(m_bram.get(), PCE_BRAM_SIZE); /* set up adpcm related things */ - m_adpcm_ram = make_unique_clear(PCE_ADPCM_RAM_SIZE); + m_adpcm_ram = make_unique_clear(PCE_ADPCM_RAM_SIZE); m_adpcm_clock_divider = 1; /* Set up cd command buffer */ - m_command_buffer = make_unique_clear(PCE_CD_COMMAND_BUFFER_SIZE); + m_command_buffer = make_unique_clear(PCE_CD_COMMAND_BUFFER_SIZE); m_command_buffer_index = 0; /* Set up Arcade Card RAM buffer */ - m_acard_ram = make_unique_clear(PCE_ACARD_RAM_SIZE); + m_acard_ram = make_unique_clear(PCE_ACARD_RAM_SIZE); - m_data_buffer = make_unique_clear(8192); + m_data_buffer = make_unique_clear(8192); m_data_buffer_size = 0; m_data_buffer_index = 0; - m_subcode_buffer = std::make_unique(96); + m_subcode_buffer = std::make_unique(96); m_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::data_timer_callback),this)); m_data_timer->adjust(attotime::never); @@ -234,7 +234,7 @@ void pce_cd_device::late_setup() void pce_cd_device::nvram_init(nvram_device &nvram, void *data, size_t size) { - static const UINT8 init[8] = { 0x48, 0x55, 0x42, 0x4d, 0x00, 0xa0, 0x10, 0x80 }; + static const uint8_t init[8] = { 0x48, 0x55, 0x42, 0x4d, 0x00, 0xa0, 0x10, 0x80 }; memset(data, 0x00, size); memcpy(data, init, sizeof(init)); @@ -265,7 +265,7 @@ machine_config_constructor pce_cd_device::device_mconfig_additions() const } -void pce_cd_device::adpcm_stop(UINT8 irq_flag) +void pce_cd_device::adpcm_stop(uint8_t irq_flag) { m_regs[0x0c] |= PCE_CD_ADPCM_STOP_FLAG; m_regs[0x0c] &= ~PCE_CD_ADPCM_PLAY_FLAG; @@ -293,7 +293,7 @@ void pce_cd_device::adpcm_play() */ WRITE_LINE_MEMBER( pce_cd_device::msm5205_int ) { - UINT8 msm_data; + uint8_t msm_data; // popmessage("%08x %08x %08x %02x %02x",m_msm_start_addr,m_msm_end_addr,m_msm_half_addr,m_regs[0x0c],m_regs[0x0d]); @@ -329,7 +329,7 @@ WRITE_LINE_MEMBER( pce_cd_device::msm5205_int ) #define SCSI_STATUS_OK 0x00 #define SCSI_CHECK_CONDITION 0x02 -void pce_cd_device::reply_status_byte(UINT8 status) +void pce_cd_device::reply_status_byte(uint8_t status) { logerror("Setting CD in reply_status_byte\n"); m_scsi_CD = m_scsi_IO = m_scsi_REQ = 1; @@ -366,8 +366,8 @@ void pce_cd_device::test_unit_ready() /* 0x08 - READ (6) */ void pce_cd_device::read_6() { - UINT32 frame = ((m_command_buffer[1] & 0x1f) << 16) | (m_command_buffer[2] << 8) | m_command_buffer[3]; - UINT32 frame_count = m_command_buffer[4]; + uint32_t frame = ((m_command_buffer[1] & 0x1f) << 16) | (m_command_buffer[2] << 8) | m_command_buffer[3]; + uint32_t frame_count = m_command_buffer[4]; printf("%08x %08x\n",frame,frame_count); /* Check for presence of a CD */ @@ -405,7 +405,7 @@ void pce_cd_device::read_6() /* 0xD8 - SET AUDIO PLAYBACK START POSITION (NEC) */ void pce_cd_device::nec_set_audio_start_position() { - UINT32 frame = 0; + uint32_t frame = 0; if (!m_cd_file) { @@ -422,7 +422,7 @@ void pce_cd_device::nec_set_audio_start_position() break; case 0x40: { - UINT8 m,s,f; + uint8_t m,s,f; m = bcd_2_dec(m_command_buffer[2]); s = bcd_2_dec(m_command_buffer[3]); @@ -479,7 +479,7 @@ void pce_cd_device::nec_set_audio_start_position() /* 0xD9 - SET AUDIO PLAYBACK END POSITION (NEC) */ void pce_cd_device::nec_set_audio_stop_position() { - UINT32 frame = 0; + uint32_t frame = 0; if (!m_cd_file) { @@ -496,7 +496,7 @@ void pce_cd_device::nec_set_audio_stop_position() break; case 0x40: { - UINT8 m,s,f; + uint8_t m,s,f; m = bcd_2_dec(m_command_buffer[2]); s = bcd_2_dec(m_command_buffer[3]); @@ -573,7 +573,7 @@ void pce_cd_device::nec_pause() void pce_cd_device::nec_get_subq() { /* WP - I do not have access to chds with subchannel information yet, so I'm faking something here */ - UINT32 msf_abs, msf_rel, track, frame; + uint32_t msf_abs, msf_rel, track, frame; if (!m_cd_file) { @@ -623,7 +623,7 @@ void pce_cd_device::nec_get_subq() /* 0xDE - GET DIR INFO (NEC) */ void pce_cd_device::nec_get_dir_info() { - UINT32 frame, msf, track = 0; + uint32_t frame, msf, track = 0; const cdrom_toc *toc; logerror("nec get dir info\n"); @@ -697,8 +697,8 @@ typedef void (pce_cd_device::*command_handler_func)(); void pce_cd_device::handle_data_output() { static const struct { - UINT8 command_byte; - UINT8 command_size; + uint8_t command_byte; + uint8_t command_size; command_handler_func command_handler; } pce_cd_commands[] = { { 0x00, 6, &pce_cd_device::test_unit_ready }, /* TEST UNIT READY */ @@ -988,7 +988,7 @@ READ8_MEMBER(pce_cd_device::bram_r) return m_bram[(offset & (PCE_BRAM_SIZE - 1)) + m_bram_locked * PCE_BRAM_SIZE]; } -void pce_cd_device::set_adpcm_ram_byte(UINT8 val) +void pce_cd_device::set_adpcm_ram_byte(uint8_t val) { if (m_adpcm_write_buf > 0) { @@ -1260,9 +1260,9 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::clear_ack) } } -UINT8 pce_cd_device::get_cd_data_byte() +uint8_t pce_cd_device::get_cd_data_byte() { - UINT8 data = m_regs[0x01]; + uint8_t data = m_regs[0x01]; if (m_scsi_REQ && !m_scsi_ACK && !m_scsi_CD) { if (m_scsi_IO) @@ -1286,7 +1286,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_dma_timer_callback) } } -UINT8 pce_cd_device::get_adpcm_ram_byte() +uint8_t pce_cd_device::get_adpcm_ram_byte() { if (m_adpcm_read_buf > 0) { @@ -1295,7 +1295,7 @@ UINT8 pce_cd_device::get_adpcm_ram_byte() } else { - UINT8 res; + uint8_t res; res = m_adpcm_ram[m_adpcm_read_ptr]; m_adpcm_read_ptr = ((m_adpcm_read_ptr + 1) & 0xffff); @@ -1306,7 +1306,7 @@ UINT8 pce_cd_device::get_adpcm_ram_byte() READ8_MEMBER(pce_cd_device::intf_r) { - UINT8 data = m_regs[offset & 0x0F]; + uint8_t data = m_regs[offset & 0x0F]; logerror("%04X: read from CD interface offset %02X\n", space.device().safe_pc(), offset ); @@ -1377,7 +1377,7 @@ PC Engine Arcade Card emulation READ8_MEMBER(pce_cd_device::acard_r) { - UINT8 r_num; + uint8_t r_num; if ((offset & 0x2e0) == 0x2e0) { @@ -1403,7 +1403,7 @@ READ8_MEMBER(pce_cd_device::acard_r) case 0x00: case 0x01: { - UINT8 res; + uint8_t res; if (m_acard_ctrl[r_num] & 2) res = m_acard_ram[(m_acard_base_addr[r_num] + m_acard_addr_offset[r_num]) & 0x1fffff]; else @@ -1438,7 +1438,7 @@ READ8_MEMBER(pce_cd_device::acard_r) WRITE8_MEMBER(pce_cd_device::acard_w) { - UINT8 w_num; + uint8_t w_num; if ((offset & 0x2e0) == 0x2e0) { diff --git a/src/mame/machine/pce_cd.h b/src/mame/machine/pce_cd.h index ebb39aeb680..504dacc2b36 100644 --- a/src/mame/machine/pce_cd.h +++ b/src/mame/machine/pce_cd.h @@ -42,7 +42,7 @@ class pce_cd_device : public device_t { public: // construction/destruction - pce_cd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pce_cd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~pce_cd_device() {} // device-level overrides @@ -65,9 +65,9 @@ public: void nvram_init(nvram_device &nvram, void *data, size_t size); private: - void adpcm_stop(UINT8 irq_flag); + void adpcm_stop(uint8_t irq_flag); void adpcm_play(); - void reply_status_byte(UINT8 status); + void reply_status_byte(uint8_t status); void test_unit_ready(); void read_6(); void nec_set_audio_start_position(); @@ -81,9 +81,9 @@ private: void handle_message_output(); void handle_message_input(); void set_irq_line(int num, int state); - void set_adpcm_ram_byte(UINT8 val); - UINT8 get_cd_data_byte(); - UINT8 get_adpcm_ram_byte(); + void set_adpcm_ram_byte(uint8_t val); + uint8_t get_cd_data_byte(); + uint8_t get_adpcm_ram_byte(); TIMER_CALLBACK_MEMBER(data_timer_callback); TIMER_CALLBACK_MEMBER(cdda_fadeout_callback); @@ -95,22 +95,22 @@ private: required_device m_maincpu; - UINT8 m_regs[16]; - std::unique_ptr m_bram; - std::unique_ptr m_adpcm_ram; + uint8_t m_regs[16]; + std::unique_ptr m_bram; + std::unique_ptr m_adpcm_ram; int m_bram_locked; int m_adpcm_read_ptr; - UINT8 m_adpcm_read_buf; + uint8_t m_adpcm_read_buf; int m_adpcm_write_ptr; - UINT8 m_adpcm_write_buf; + uint8_t m_adpcm_write_buf; int m_adpcm_length; int m_adpcm_clock_divider; - UINT32 m_msm_start_addr; - UINT32 m_msm_end_addr; - UINT32 m_msm_half_addr; - UINT8 m_msm_nibble; - UINT8 m_msm_idle; - UINT8 m_msm_repeat; + uint32_t m_msm_start_addr; + uint32_t m_msm_end_addr; + uint32_t m_msm_half_addr; + uint8_t m_msm_nibble; + uint8_t m_msm_idle; + uint8_t m_msm_repeat; /* SCSI signals */ int m_scsi_BSY; /* Busy. Bus in use */ @@ -125,33 +125,33 @@ private: int m_scsi_last_RST; /* To catch setting of RST signal */ int m_cd_motor_on; int m_selected; - std::unique_ptr m_command_buffer; + std::unique_ptr m_command_buffer; int m_command_buffer_index; int m_status_sent; int m_message_after_status; int m_message_sent; - std::unique_ptr m_data_buffer; + std::unique_ptr m_data_buffer; int m_data_buffer_size; int m_data_buffer_index; int m_data_transferred; /* Arcade Card specific */ - std::unique_ptr m_acard_ram; - UINT8 m_acard_latch; - UINT8 m_acard_ctrl[4]; - UINT32 m_acard_base_addr[4]; - UINT16 m_acard_addr_offset[4]; - UINT16 m_acard_addr_inc[4]; - UINT32 m_acard_shift; - UINT8 m_acard_shift_reg; - - UINT32 m_current_frame; - UINT32 m_end_frame; - UINT32 m_last_frame; - UINT8 m_cdda_status; - UINT8 m_cdda_play_mode; - std::unique_ptr m_subcode_buffer; - UINT8 m_end_mark; + std::unique_ptr m_acard_ram; + uint8_t m_acard_latch; + uint8_t m_acard_ctrl[4]; + uint32_t m_acard_base_addr[4]; + uint16_t m_acard_addr_offset[4]; + uint16_t m_acard_addr_inc[4]; + uint32_t m_acard_shift; + uint8_t m_acard_shift_reg; + + uint32_t m_current_frame; + uint32_t m_end_frame; + uint32_t m_last_frame; + uint8_t m_cdda_status; + uint8_t m_cdda_play_mode; + std::unique_ptr m_subcode_buffer; + uint8_t m_end_mark; required_device m_msm; required_device m_cdda; diff --git a/src/mame/machine/pcecommn.cpp b/src/mame/machine/pcecommn.cpp index 68a0ce4476a..38c0fe071e4 100644 --- a/src/mame/machine/pcecommn.cpp +++ b/src/mame/machine/pcecommn.cpp @@ -37,14 +37,14 @@ WRITE8_MEMBER(pce_common_state::pce_joystick_w) } } -UINT8 pce_common_state::joy_read() +uint8_t pce_common_state::joy_read() { return ioport("JOY")->read(); } READ8_MEMBER(pce_common_state::pce_joystick_r) { - UINT8 ret; + uint8_t ret; int data = joy_read(); if (m_joystick_data_select) data >>= 4; ret = (data & 0x0F) | m_io_port_options; @@ -59,7 +59,7 @@ DRIVER_INIT_MEMBER(pce_common_state,pce_common) m_io_port_options = PCE_JOY_SIG | CONST_SIG; } -UINT32 pce_common_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pce_common_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_huc6260->video_update( bitmap, cliprect ); return 0; diff --git a/src/mame/machine/pcecommn.h b/src/mame/machine/pcecommn.h index c4318f80230..891f8ac7271 100644 --- a/src/mame/machine/pcecommn.h +++ b/src/mame/machine/pcecommn.h @@ -30,12 +30,12 @@ public: required_device m_maincpu; - virtual UINT8 joy_read(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual uint8_t joy_read(); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_huc6260; private: - UINT8 m_io_port_options; /*driver-specific options for the PCE*/ + uint8_t m_io_port_options; /*driver-specific options for the PCE*/ int m_joystick_port_select; /* internal index of joystick ports */ int m_joystick_data_select; /* which nibble of joystick data we want */ }; diff --git a/src/mame/machine/pcshare.cpp b/src/mame/machine/pcshare.cpp index c1fbf64b961..73e1a14cbbd 100644 --- a/src/mame/machine/pcshare.cpp +++ b/src/mame/machine/pcshare.cpp @@ -52,7 +52,7 @@ WRITE8_MEMBER(pcat_base_state::pc_dma_write_byte) READ8_MEMBER(pcat_base_state::dma_page_select_r) { - UINT8 data = m_at_pages[offset % 0x10]; + uint8_t data = m_at_pages[offset % 0x10]; switch(offset % 8) { diff --git a/src/mame/machine/pcshare.h b/src/mame/machine/pcshare.h index b413d2bc42c..d8f6a11a3e3 100644 --- a/src/mame/machine/pcshare.h +++ b/src/mame/machine/pcshare.h @@ -44,8 +44,8 @@ public: DECLARE_READ8_MEMBER( get_slave_ack ); DECLARE_WRITE_LINE_MEMBER( at_pit8254_out2_changed ); int m_dma_channel; - UINT8 m_dma_offset[2][4]; - UINT8 m_at_pages[0x10]; + uint8_t m_dma_offset[2][4]; + uint8_t m_at_pages[0x10]; int m_pit_out2; }; diff --git a/src/mame/machine/pecom.cpp b/src/mame/machine/pecom.cpp index ecf002799f0..fe7cba9bc21 100644 --- a/src/mame/machine/pecom.cpp +++ b/src/mame/machine/pecom.cpp @@ -36,7 +36,7 @@ void pecom_state::machine_start() void pecom_state::machine_reset() { - UINT8 *rom = memregion(CDP1802_TAG)->base(); + uint8_t *rom = memregion(CDP1802_TAG)->base(); address_space &space = m_cdp1802->space(AS_PROGRAM); @@ -79,7 +79,7 @@ WRITE8_MEMBER(pecom_state::pecom_cdp1869_pageram_w) WRITE8_MEMBER(pecom_state::pecom_bank_w) { address_space &space2 = m_cdp1802->space(AS_PROGRAM); - UINT8 *rom = memregion(CDP1802_TAG)->base(); + uint8_t *rom = memregion(CDP1802_TAG)->base(); m_cdp1802->space(AS_PROGRAM).install_write_bank(0x0000, 0x3fff, "bank1"); m_bank1->set_base(m_ram->pointer() + 0x0000); @@ -109,7 +109,7 @@ READ8_MEMBER(pecom_state::pecom_keyboard_r) Address is available on address bus during reading of value from port, and that is used to determine keyboard line reading */ - UINT16 addr = m_cdp1802->state_int(COSMAC_R0 + m_cdp1802->state_int(COSMAC_X)); + uint16_t addr = m_cdp1802->state_int(COSMAC_R0 + m_cdp1802->state_int(COSMAC_X)); /* just in case somone is reading non existing ports */ if (addr<0x7cca || addr>0x7ce3) return 0; return m_io_ports[addr - 0x7cca]->read() & 0x03; @@ -135,7 +135,7 @@ static COSMAC_EF_READ( pecom64_ef_r ) { int flags = 0x0f; double valcas = (cassette_device_image(device->machine()));->input() - UINT8 val = device->machine().root_device().ioport("CNT")->read(); + uint8_t val = device->machine().root_device().ioport("CNT")->read(); if ((val & 0x04)==0x04 && pecom_prev_caps_state==0) { diff --git a/src/mame/machine/pgmcrypt.cpp b/src/mame/machine/pgmcrypt.cpp index 44a2781fafd..9d38e10ca86 100644 --- a/src/mame/machine/pgmcrypt.cpp +++ b/src/mame/machine/pgmcrypt.cpp @@ -65,7 +65,7 @@ #define IGS27_CRYPT8_ALT \ if ((i & 0x000820) == 0x000820) x ^= 0x0080; -static const UINT8 kov_tab[256] = { +static const uint8_t kov_tab[256] = { 0x17, 0x1c, 0xe3, 0x02, 0x62, 0x59, 0x97, 0x4a, 0x67, 0x4d, 0x1f, 0x11, 0x76, 0x64, 0xc1, 0xe1, 0xd2, 0x41, 0x9f, 0xfd, 0xfa, 0x04, 0xfe, 0xab, 0x89, 0xeb, 0xc0, 0xf5, 0xac, 0x2b, 0x64, 0x22, 0x90, 0x7d, 0x88, 0xc5, 0x8c, 0xe0, 0xd9, 0x70, 0x3c, 0xf4, 0x7d, 0x31, 0x1c, 0xca, 0xe2, 0xf1, @@ -87,12 +87,12 @@ static const UINT8 kov_tab[256] = { void pgm_kov_decrypt(running_machine &machine) { int i; - UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()+0x100000); int rom_size = 0x400000; for(i=0; ibase()+0x100000); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()+0x100000); int rom_size = 0x400000; for(i=0; ibase()+0x100000); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()+0x100000); int rom_size = 0x400000; for(i=0; ibase()+0x100000); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()+0x100000); int rom_size = 0x100000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x400000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x200000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x200000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x200000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x200000; for(i=0; ibase()+0x100000); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()+0x100000); int rom_size = 0x100000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x200000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x200000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x800000; for(i=0; ibase()); + uint16_t *src = (uint16_t *)(machine.root_device().memregion("user1")->base()); int rom_size = 0x800000; for (i = 0; i < rom_size/2; i++) { - UINT16 x = src[i]; + uint16_t x = src[i]; IGS27_CRYPT1_ALT; // ok? IGS27_CRYPT2 // ok? @@ -756,7 +756,7 @@ void pgm_svgpcb_decrypt(running_machine &machine) } -static const UINT8 py2k2_tab[256] = { +static const uint8_t py2k2_tab[256] = { 0x74, 0xe8, 0xa8, 0x64, 0x26, 0x44, 0xa6, 0x9a, 0xa5, 0x69, 0xa2, 0xd3, 0x6d, 0xba, 0xff, 0xf3, 0xeb, 0x6e, 0xe3, 0x70, 0x72, 0x58, 0x27, 0xd9, 0xe4, 0x9f, 0x50, 0xa2, 0xdd, 0xce, 0x6e, 0xf6, 0x44, 0x72, 0x0c, 0x7e, 0x4d, 0x41, 0x77, 0x2d, 0x00, 0xad, 0x1a, 0x5f, 0x6b, 0xc0, 0x1d, 0x4e, @@ -778,13 +778,13 @@ static const UINT8 py2k2_tab[256] = { void pgm_py2k2_decrypt(running_machine &machine) // and ddpdoj/ddpdojbl { int i; - UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base()+0x100000); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()+0x100000); int rom_size = 0x400000; for(i=0; ibase()); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()); int rom_size = 0x400000; for(i=0; ibase()); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()); int rom_size = 0x400000; for(i=0; ibase()); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("user1")->base()); int rom_size = 0x400000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x080000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase()+0x100000); + uint16_t *src = (uint16_t *) (machine.root_device().memregion("maincpu")->base()+0x100000); int rom_size = 0x400000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x200000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; // not 100% verified for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase(); + uint16_t *src = (uint16_t *) machine.root_device().memregion("user1")->base(); int rom_size = 0x80000; for(i=0; ibase()+0x100000); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()+0x100000); int rom_size = 0x80000; for (i = 0; i < rom_size / 2; i++) { - UINT16 x = src[i]; + uint16_t x = src[i]; if (((i & 0x20890) == 0) || ((i & 0x20000) == 0x20000 && (i & 0x01500) != 0x01400)) x ^= 0x0002; @@ -46,7 +46,7 @@ void pgm_012_025_state::pgm_drgw2_decrypt() // All tables all xored by 'warning' information at $1354ee (drgw2) // tables are the same as drgw3 and olds -static const UINT8 drgw2_source_data[0x08][0xec] = +static const uint8_t drgw2_source_data[0x08][0xec] = { { 0, }, // Region 0, not used { // Region 1, $13A886 @@ -148,7 +148,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2) { /* incomplete? */ - UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); drgw2_common_init(); @@ -163,7 +163,7 @@ DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2) DRIVER_INIT_MEMBER(pgm_012_025_state,dw2v100x) { - UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); drgw2_common_init(); @@ -178,7 +178,7 @@ DRIVER_INIT_MEMBER(pgm_012_025_state,dw2v100x) DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2c) { - UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); drgw2_common_init(); @@ -193,7 +193,7 @@ DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2c) DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2j) { - UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); drgw2_common_init(); @@ -215,7 +215,7 @@ DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2hk) m_igs025->m_kb_region = region; m_igs025->m_kb_game_id = region | (region << 8) | (region << 16) | (region << 24); - UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); mem16[0x12f520 / 2] = 0x4e93; mem16[0x12f5c6 / 2] = 0x4e93; mem16[0x12f656 / 2] = 0x4e93; diff --git a/src/mame/machine/pgmprot_igs025_igs022.cpp b/src/mame/machine/pgmprot_igs025_igs022.cpp index 7c31b2358c3..403f8ee35a2 100644 --- a/src/mame/machine/pgmprot_igs025_igs022.cpp +++ b/src/mame/machine/pgmprot_igs025_igs022.cpp @@ -37,12 +37,12 @@ void pgm_022_025_state::pgm_dw3_decrypt() { int i; - UINT16 *src = (UINT16 *) (memregion("maincpu")->base()+0x100000); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()+0x100000); int rom_size = 0x100000; for(i=0; ibase()+0x100000); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()+0x100000); int rom_size = 0x200000; for(i=0; i m_sharedprotram; + required_shared_ptr m_sharedprotram; DECLARE_DRIVER_INIT(killbld); DECLARE_DRIVER_INIT(drgw3); diff --git a/src/mame/machine/pgmprot_igs025_igs028.cpp b/src/mame/machine/pgmprot_igs025_igs028.cpp index ea8c77acb39..84fcfbe731e 100644 --- a/src/mame/machine/pgmprot_igs025_igs028.cpp +++ b/src/mame/machine/pgmprot_igs025_igs028.cpp @@ -26,7 +26,7 @@ // tables are xored by table at $1998dc // tables are the same as drgw3 and drgw2 -static const UINT8 m_olds_source_data[8][0xec] = // table addresses $2951CA +static const uint8_t m_olds_source_data[8][0xec] = // table addresses $2951CA { { // region 0, unused... 0, diff --git a/src/mame/machine/pgmprot_igs025_igs028.h b/src/mame/machine/pgmprot_igs025_igs028.h index ec3739399ca..3e7ce244517 100644 --- a/src/mame/machine/pgmprot_igs025_igs028.h +++ b/src/mame/machine/pgmprot_igs025_igs028.h @@ -13,7 +13,7 @@ public: { } - required_shared_ptr m_sharedprotram; + required_shared_ptr m_sharedprotram; required_device m_igs025; required_device m_igs028; diff --git a/src/mame/machine/pgmprot_igs027a_type1.cpp b/src/mame/machine/pgmprot_igs027a_type1.cpp index 46f642d80b6..39a8a76e753 100644 --- a/src/mame/machine/pgmprot_igs027a_type1.cpp +++ b/src/mame/machine/pgmprot_igs027a_type1.cpp @@ -117,7 +117,7 @@ WRITE16_MEMBER(pgm_arm_type1_state::pgm_arm7_type1_68k_protlatch_w ) READ16_MEMBER(pgm_arm_type1_state::pgm_arm7_type1_ram_r ) { - UINT16 *share16 = reinterpret_cast(m_arm7_shareram.target()); + uint16_t *share16 = reinterpret_cast(m_arm7_shareram.target()); if (PGMARM7LOGERROR) logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, space.device().safe_pc()); @@ -126,7 +126,7 @@ READ16_MEMBER(pgm_arm_type1_state::pgm_arm7_type1_ram_r ) WRITE16_MEMBER(pgm_arm_type1_state::pgm_arm7_type1_ram_w ) { - UINT16 *share16 = reinterpret_cast(m_arm7_shareram.target()); + uint16_t *share16 = reinterpret_cast(m_arm7_shareram.target()); if (PGMARM7LOGERROR) logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, space.device().safe_pc()); @@ -261,7 +261,7 @@ READ16_MEMBER(pgm_arm_type1_state::kovsh_fake_region_r ) if (regionhack != 0xff) return regionhack; offset = 0x4; - UINT16 *share16 = reinterpret_cast(m_arm7_shareram.target()); + uint16_t *share16 = reinterpret_cast(m_arm7_shareram.target()); return share16[BYTE_XOR_LE(offset << 1)]; } @@ -368,8 +368,8 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,kovshxas) void pgm_arm_type1_state::pgm_decode_kovlsqh2_tiles() { int i, j; - UINT16 *src = (UINT16 *)(memregion("tiles")->base() + 0x180000); - std::vector dst(0x800000); + uint16_t *src = (uint16_t *)(memregion("tiles")->base() + 0x180000); + std::vector dst(0x800000); for (i = 0; i < 0x800000 / 2; i++) { @@ -381,10 +381,10 @@ void pgm_arm_type1_state::pgm_decode_kovlsqh2_tiles() memcpy( src, &dst[0], 0x800000 ); } -void pgm_arm_type1_state::pgm_decode_kovlsqh2_sprites( UINT8 *src ) +void pgm_arm_type1_state::pgm_decode_kovlsqh2_sprites( uint8_t *src ) { int i, j; - std::vector dst(0x800000); + std::vector dst(0x800000); for (i = 0; i < 0x800000; i++) { @@ -399,7 +399,7 @@ void pgm_arm_type1_state::pgm_decode_kovlsqh2_sprites( UINT8 *src ) void pgm_arm_type1_state::pgm_decode_kovlsqh2_samples() { int i; - UINT8 *src = (UINT8 *)(memregion("ics")->base() + 0x400000); + uint8_t *src = (uint8_t *)(memregion("ics")->base() + 0x400000); for (i = 0; i < 0x400000; i+=2) { src[i + 0x000001] = src[i + 0x400001]; @@ -411,8 +411,8 @@ void pgm_arm_type1_state::pgm_decode_kovlsqh2_samples() void pgm_arm_type1_state::pgm_decode_kovqhsgs_program() { int i; - UINT16 *src = (UINT16 *)(memregion("maincpu")->base() + 0x100000); - std::vector dst(0x400000); + uint16_t *src = (uint16_t *)(memregion("maincpu")->base() + 0x100000); + std::vector dst(0x400000); for (i = 0; i < 0x400000 / 2; i++) { @@ -427,8 +427,8 @@ void pgm_arm_type1_state::pgm_decode_kovqhsgs_program() void pgm_arm_type1_state::pgm_decode_kovqhsgs2_program() { int i; - UINT16 *src = (UINT16 *)(memregion("maincpu")->base() + 0x100000); - std::vector dst(0x400000); + uint16_t *src = (uint16_t *)(memregion("maincpu")->base() + 0x100000); + std::vector dst(0x400000); for (i = 0; i < 0x400000 / 2; i++) { @@ -496,8 +496,8 @@ READ16_MEMBER(pgm_arm_type1_state::pgm_arm7_type1_sim_r ) { if (offset == 0) { - UINT16 d = m_valueresponse & 0xffff; - UINT16 realkey = m_valuekey >> 8; + uint16_t d = m_valueresponse & 0xffff; + uint16_t realkey = m_valuekey >> 8; realkey |= m_valuekey; d ^= realkey; @@ -506,8 +506,8 @@ READ16_MEMBER(pgm_arm_type1_state::pgm_arm7_type1_sim_r ) } else if (offset == 1) { - UINT16 d = m_valueresponse >> 16; - UINT16 realkey = m_valuekey >> 8; + uint16_t d = m_valueresponse >> 16; + uint16_t realkey = m_valuekey >> 8; realkey |= m_valuekey; d ^= realkey; return d; @@ -565,7 +565,7 @@ void pgm_arm_type1_state::command_handler_ddp3(int pc) /* preliminary */ // should be correct, note each value only appears once -UINT8 puzzli2_level_decode[256] = { +uint8_t puzzli2_level_decode[256] = { // 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , a , b , c , d , e , f , 0x32, 0x3e, 0xb2, 0x37, 0x31, 0x22, 0xd6, 0x0d, 0x35, 0x5c, 0x8d, 0x3c, 0x7a, 0x5f, 0xd7, 0xac, // 0x0 // 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , x , x , @@ -703,8 +703,8 @@ void pgm_arm_type1_state::command_handler_puzzli2(int pc) // but different for the writes on startup? m_valueresponse = 0x00d20000; - //UINT8 tableaddr = (hack_31_table_offset + (hack_31_table_offset2&0xf))&0xff; - //UINT8 xoredval = m_value0 ^ puzzli2_level_decode[tableaddr]; + //uint8_t tableaddr = (hack_31_table_offset + (hack_31_table_offset2&0xf))&0xff; + //uint8_t xoredval = m_value0 ^ puzzli2_level_decode[tableaddr]; //puzzli2_printf("value %02x, after xor is %02x (table address,value %02x,%02x)\n", m_value0, xoredval, tableaddr, puzzli2_level_decode[tableaddr]); hackcount2++; @@ -717,8 +717,8 @@ void pgm_arm_type1_state::command_handler_puzzli2(int pc) // when the ARM detects the end of the stream has been reached it returns a 0x63 status with the number of columns in the data word m_valueresponse = 0x00630000 | numbercolumns; - //UINT8 tableaddr = (hack_31_table_offset + (hack_31_table_offset2&0xf))&0xff; - //UINT8 xoredval = m_value0 ^ puzzli2_level_decode[tableaddr]; + //uint8_t tableaddr = (hack_31_table_offset + (hack_31_table_offset2&0xf))&0xff; + //uint8_t xoredval = m_value0 ^ puzzli2_level_decode[tableaddr]; //puzzli2_printf("value %02x, after xor is %02x (table address,value %02x,%02x) (end, returning %02x as playfield width)\n", m_value0, xoredval, tableaddr, puzzli2_level_decode[tableaddr], m_valueresponse); @@ -748,7 +748,7 @@ void pgm_arm_type1_state::command_handler_puzzli2(int pc) // this is the how to play screen, correctly returned with current code /* - UINT16 retvals[61] = + uint16_t retvals[61] = { 0x0008, // depth (-2?) 0x0103, 0x0101, 0x0102, 0x0102, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // first column 0x0103, 0x0100, 0x0101, 0x0105, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -760,7 +760,7 @@ void pgm_arm_type1_state::command_handler_puzzli2(int pc) */ - UINT16* leveldata = &level_structure[0][0]; + uint16_t* leveldata = &level_structure[0][0]; if (hackcount==0) { m_valueresponse = 0x002d0000 | ((depth>>4)+1); // this *seems* to come from upper bits of the first real value written to the device during the level stream (verify, seems wrong for some levels because you get a black bar on the bottom of the screen, but might be bad xors) @@ -1267,13 +1267,13 @@ void pgm_arm_type1_state::command_handler_pstars(int pc) /* Old KOV and bootlegs sim ... really these should be read out... */ -static const UINT8 kov_BATABLE[0x40] = { +static const uint8_t kov_BATABLE[0x40] = { 0x00,0x29,0x2c,0x35,0x3a,0x41,0x4a,0x4e,0x57,0x5e,0x77,0x79,0x7a,0x7b,0x7c,0x7d, 0x7e,0x7f,0x80,0x81,0x82,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x90, 0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9e,0xa3,0xd4,0xa9,0xaf,0xb5,0xbb,0xc1 }; -static const UINT8 kov_B0TABLE[16] = { 2, 0, 1, 4, 3 }; // Maps char portraits to tables +static const uint8_t kov_B0TABLE[16] = { 2, 0, 1, 4, 3 }; // Maps char portraits to tables void pgm_arm_type1_state::command_handler_kov(int pc) @@ -1364,7 +1364,7 @@ void pgm_arm_type1_state::command_handler_kov(int pc) { m_valueresponse = 0x880000; - INT32 sel = (m_curslots >> 12) & 0x0f; + int32_t sel = (m_curslots >> 12) & 0x0f; m_slots[sel] = (m_slots[sel] & 0x00ff0000) | ((m_value0 & 0xffff) << 0); } break; @@ -1374,7 +1374,7 @@ void pgm_arm_type1_state::command_handler_kov(int pc) m_valueresponse = 0x880000; m_curslots = m_value0; - INT32 sel = (m_curslots >> 12) & 0x0f; + int32_t sel = (m_curslots >> 12) & 0x0f; m_slots[sel] = (m_slots[sel] & 0x0000ffff) | ((m_value0 & 0x00ff) << 16); } break; @@ -1744,7 +1744,7 @@ WRITE16_MEMBER(pgm_arm_type1_state::pgm_arm7_type1_sim_w ) } else if (offset == 1) { - UINT16 realkey; + uint16_t realkey; if ((data >> 8) == 0xff) m_valuekey = 0xff00; realkey = m_valuekey >> 8; @@ -1814,7 +1814,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,espgal) } -int count_bits(UINT16 value) +int count_bits(uint16_t value) { int count = 0; for (int i=0;i<16;i++) @@ -1827,7 +1827,7 @@ int count_bits(UINT16 value) return count; } -int get_position_of_bit(UINT16 value, int bit_wanted) +int get_position_of_bit(uint16_t value, int bit_wanted) { int count = 0; for (int i=0;i<16;i++) @@ -1843,7 +1843,7 @@ int get_position_of_bit(UINT16 value, int bit_wanted) return -1; } -int pgm_arm_type1_state::puzzli2_take_leveldata_value(UINT8 datvalue) +int pgm_arm_type1_state::puzzli2_take_leveldata_value(uint8_t datvalue) { if (stage==-1) { @@ -1864,8 +1864,8 @@ int pgm_arm_type1_state::puzzli2_take_leveldata_value(UINT8 datvalue) } else { - UINT8 rawvalue = datvalue; - UINT8 tableloc = (tableoffs+tableoffs2)&0xff; + uint8_t rawvalue = datvalue; + uint8_t tableloc = (tableoffs+tableoffs2)&0xff; rawvalue ^= puzzli2_level_decode[tableloc]; tableoffs2++; @@ -2001,7 +2001,7 @@ int pgm_arm_type1_state::puzzli2_take_leveldata_value(UINT8 datvalue) } else if (stage==3) { - UINT16 object_value; + uint16_t object_value; // return values // 0x0100 = normal fish @@ -2116,7 +2116,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,puzzli2) //#define PUZZLI2_LEVEL_STRUCTURE_LOG #ifdef PUZZLI2_LEVEL_STRUCTURE_LOG - UINT8 *src2 = (UINT8 *) (machine().root_device().memregion("maincpu")->base()); + uint8_t *src2 = (uint8_t *) (machine().root_device().memregion("maincpu")->base()); int offset; int limit; @@ -2139,9 +2139,9 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,puzzli2) for (int i=0;ibase()); + uint8_t *src3 = (uint8_t *) (machine().root_device().memregion("maincpu")->base()); printf("how to play data pointer %02x %02x %02x %02x\n", src3[0x17b28e ^1], src3[0x17b28f ^1], src3[0x17b290 ^1], src3[0x17b291 ^1]); src3[0x17b28e ^1] = 0x00; src3[0x17b28f ^1] = 0x11; @@ -2212,7 +2212,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,puzzli2) pgm_puzzli2_decrypt(machine()); { - UINT8 *ROM = (UINT8*)memregion("maincpu")->base(); + uint8_t *ROM = (uint8_t*)memregion("maincpu")->base(); FILE *fp; char filename[256]; @@ -2261,7 +2261,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,pstar) m_extra_ram[0] = 0; m_extra_ram[1] = 0; m_extra_ram[2] = 0; - memset(m_slots, 0, 16 * sizeof(UINT32)); + memset(m_slots, 0, 16 * sizeof(uint32_t)); arm_sim_handler = &pgm_arm_type1_state::command_handler_pstars; m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x500000, 0x500005, read16_delegate(FUNC(pgm_arm_type1_state::pgm_arm7_type1_sim_r),this), write16_delegate(FUNC(pgm_arm_type1_state::pgm_arm7_type1_sim_w),this)); @@ -2307,8 +2307,8 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,oldsplus) pgm_basic_init(); pgm_oldsplus_decrypt(machine()); pgm_arm7_type1_latch_init(); - memset(m_extra_ram, 0, 0x100 * sizeof(UINT16)); - memset(m_slots, 0, 0x100 * sizeof(UINT32)); + memset(m_extra_ram, 0, 0x100 * sizeof(uint16_t)); + memset(m_slots, 0, 0x100 * sizeof(uint32_t)); arm_sim_handler = &pgm_arm_type1_state::command_handler_oldsplus; m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x500000, 0x500005, read16_delegate(FUNC(pgm_arm_type1_state::pgm_arm7_type1_sim_r),this), write16_delegate(FUNC(pgm_arm_type1_state::pgm_arm7_type1_sim_w),this)); m_maincpu->space(AS_PROGRAM).install_read_handler(0x4f0000, 0x4f003f, read16_delegate(FUNC(pgm_arm_type1_state::pgm_arm7_type1_sim_protram_r),this)); diff --git a/src/mame/machine/pgmprot_igs027a_type1.h b/src/mame/machine/pgmprot_igs027a_type1.h index 988926c1d65..91d1818e104 100644 --- a/src/mame/machine/pgmprot_igs027a_type1.h +++ b/src/mame/machine/pgmprot_igs027a_type1.h @@ -13,36 +13,36 @@ public: } /////////////// simulations - UINT16 m_value0; - UINT16 m_value1; - UINT16 m_valuekey; - UINT16 m_ddp3lastcommand; - UINT32 m_valueresponse; + uint16_t m_value0; + uint16_t m_value1; + uint16_t m_valuekey; + uint16_t m_ddp3lastcommand; + uint32_t m_valueresponse; int m_curslots; - UINT32 m_slots[0x100]; + uint32_t m_slots[0x100]; // pstars / oldsplus / kov - UINT16 m_pstar_e7_value; - UINT16 m_pstar_b1_value; - UINT16 m_pstar_ce_value; - UINT16 m_kov_c0_value; - UINT16 m_kov_cb_value; - UINT16 m_kov_fe_value; - UINT16 m_extra_ram[0x100]; + uint16_t m_pstar_e7_value; + uint16_t m_pstar_b1_value; + uint16_t m_pstar_ce_value; + uint16_t m_kov_c0_value; + uint16_t m_kov_cb_value; + uint16_t m_kov_fe_value; + uint16_t m_extra_ram[0x100]; // puzzli2 - INT32 m_puzzli_54_trigger; + int32_t m_puzzli_54_trigger; typedef void (pgm_arm_type1_state::*pgm_arm_sim_command_handler)(int pc); pgm_arm_sim_command_handler arm_sim_handler; /////////////// emulation - UINT16 m_pgm_arm_type1_highlatch_arm_w; - UINT16 m_pgm_arm_type1_lowlatch_arm_w; - UINT16 m_pgm_arm_type1_highlatch_68k_w; - UINT16 m_pgm_arm_type1_lowlatch_68k_w; - UINT32 m_pgm_arm_type1_counter; - optional_shared_ptr m_arm7_shareram; + uint16_t m_pgm_arm_type1_highlatch_arm_w; + uint16_t m_pgm_arm_type1_lowlatch_arm_w; + uint16_t m_pgm_arm_type1_highlatch_68k_w; + uint16_t m_pgm_arm_type1_lowlatch_68k_w; + uint32_t m_pgm_arm_type1_counter; + optional_shared_ptr m_arm7_shareram; optional_device m_prot; @@ -78,7 +78,7 @@ public: DECLARE_READ16_MEMBER( kovsh_fake_region_r ); DECLARE_WRITE16_MEMBER( kovshp_asic27a_write_word ); void pgm_decode_kovlsqh2_tiles(); - void pgm_decode_kovlsqh2_sprites(UINT8 *src ); + void pgm_decode_kovlsqh2_sprites(uint8_t *src ); void pgm_decode_kovlsqh2_samples(); void pgm_decode_kovqhsgs_program(); void pgm_decode_kovqhsgs2_program(); @@ -106,7 +106,7 @@ public: int prev_tablloc; int numbercolumns; int depth; - UINT16 m_row_bitmask; + uint16_t m_row_bitmask; int hackcount; int hackcount2; int hack_47_value; @@ -114,16 +114,16 @@ public: int hack_31_table_offset2; int p2_31_retcounter; - UINT8 coverage[256]; // coverage is how much of the table we've managed to verify using known facts about the table structure + uint8_t coverage[256]; // coverage is how much of the table we've managed to verify using known facts about the table structure int command_31_write_type; // the maximum level size returned or read by the device appears to be this size - UINT16 level_structure[8][10]; + uint16_t level_structure[8][10]; - int puzzli2_take_leveldata_value(UINT8 datvalue); + int puzzli2_take_leveldata_value(uint8_t datvalue); }; MACHINE_CONFIG_EXTERN( pgm_arm_type1 ); diff --git a/src/mame/machine/pgmprot_igs027a_type2.cpp b/src/mame/machine/pgmprot_igs027a_type2.cpp index cad9702edc8..7f7e72565e2 100644 --- a/src/mame/machine/pgmprot_igs027a_type2.cpp +++ b/src/mame/machine/pgmprot_igs027a_type2.cpp @@ -85,7 +85,7 @@ WRITE16_MEMBER(pgm_arm_type2_state::arm7_latch_68k_w ) READ16_MEMBER(pgm_arm_type2_state::arm7_ram_r ) { - UINT16 *share16 = reinterpret_cast(m_arm7_shareram.target()); + uint16_t *share16 = reinterpret_cast(m_arm7_shareram.target()); if (PGMARM7LOGERROR) logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, space.device().safe_pc()); @@ -94,7 +94,7 @@ READ16_MEMBER(pgm_arm_type2_state::arm7_ram_r ) WRITE16_MEMBER(pgm_arm_type2_state::arm7_ram_w ) { - UINT16 *share16 = reinterpret_cast(m_arm7_shareram.target()); + uint16_t *share16 = reinterpret_cast(m_arm7_shareram.target()); if (PGMARM7LOGERROR) logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, space.device().safe_pc()); @@ -222,7 +222,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type2_state,martmast) READ32_MEMBER(pgm_arm_type2_state::ddp2_speedup_r ) { int pc = space.device().safe_pc(); - UINT32 data = m_arm_ram[0x300c/4]; + uint32_t data = m_arm_ram[0x300c/4]; if (pc==0x080109b4) { @@ -232,7 +232,7 @@ READ32_MEMBER(pgm_arm_type2_state::ddp2_speedup_r ) if (r4==0x18002f9e) { - UINT32 data2 = m_arm_ram[0x2F9C/4]&0xffff0000; + uint32_t data2 = m_arm_ram[0x2F9C/4]&0xffff0000; if ((data==0x00000000) && (data2==0x00000000)) space.device().execute().spin_until_interrupt(); } } @@ -242,7 +242,7 @@ READ32_MEMBER(pgm_arm_type2_state::ddp2_speedup_r ) READ16_MEMBER(pgm_arm_type2_state::ddp2_main_speedup_r ) { - UINT16 data = m_mainram[0x0ee54/2]; + uint16_t data = m_mainram[0x0ee54/2]; int pc = space.device().safe_pc(); if (pc == 0x149dce) space.device().execute().spin_until_interrupt(); diff --git a/src/mame/machine/pgmprot_igs027a_type2.h b/src/mame/machine/pgmprot_igs027a_type2.h index 994ffb63443..0985b9f495a 100644 --- a/src/mame/machine/pgmprot_igs027a_type2.h +++ b/src/mame/machine/pgmprot_igs027a_type2.h @@ -11,11 +11,11 @@ public: m_prot(*this, "prot") { } // kov2 - UINT32 m_kov2_latchdata_68k_w; - UINT32 m_kov2_latchdata_arm_w; + uint32_t m_kov2_latchdata_68k_w; + uint32_t m_kov2_latchdata_arm_w; - required_shared_ptr m_arm_ram; - required_shared_ptr m_arm7_shareram; + required_shared_ptr m_arm_ram; + required_shared_ptr m_arm7_shareram; optional_device m_prot; diff --git a/src/mame/machine/pgmprot_igs027a_type3.cpp b/src/mame/machine/pgmprot_igs027a_type3.cpp index 3c86c76cbd1..0aab879fc9b 100644 --- a/src/mame/machine/pgmprot_igs027a_type3.cpp +++ b/src/mame/machine/pgmprot_igs027a_type3.cpp @@ -56,7 +56,7 @@ WRITE32_MEMBER(pgm_arm_type3_state::svg_arm7_ram_sel_w ) READ32_MEMBER(pgm_arm_type3_state::svg_arm7_shareram_r ) { - UINT32 retdata = m_svg_shareram[m_svg_ram_sel & 1][offset]; + uint32_t retdata = m_svg_shareram[m_svg_ram_sel & 1][offset]; // printf("(%08x) ARM7: shared read (bank %02x) offset - %08x retdata - %08x mask - %08x\n", space.device().safe_pc(), m_svg_ram_sel, offset*4, retdata, mem_mask ); return retdata; } @@ -70,7 +70,7 @@ WRITE32_MEMBER(pgm_arm_type3_state::svg_arm7_shareram_w ) READ16_MEMBER(pgm_arm_type3_state::svg_m68k_ram_r ) { int ram_sel = (m_svg_ram_sel & 1) ^ 1; - UINT16 *share16 = (UINT16 *)(m_svg_shareram[ram_sel & 1].get()); + uint16_t *share16 = (uint16_t *)(m_svg_shareram[ram_sel & 1].get()); return share16[BYTE_XOR_LE(offset)]; } @@ -78,7 +78,7 @@ READ16_MEMBER(pgm_arm_type3_state::svg_m68k_ram_r ) WRITE16_MEMBER(pgm_arm_type3_state::svg_m68k_ram_w ) { int ram_sel = (m_svg_ram_sel & 1) ^ 1; - UINT16 *share16 = (UINT16 *)(m_svg_shareram[ram_sel & 1].get()); + uint16_t *share16 = (uint16_t *)(m_svg_shareram[ram_sel & 1].get()); COMBINE_DATA(&share16[BYTE_XOR_LE(offset)]); } @@ -155,7 +155,7 @@ ADDRESS_MAP_END MACHINE_RESET_MEMBER(pgm_arm_type3_state, pgm_arm_type3_reset) { // internal roms aren't fully dumped - UINT16 *temp16 = (UINT16 *)memregion("prot")->base(); + uint16_t *temp16 = (uint16_t *)memregion("prot")->base(); int base = -1; if (!strcmp(machine().system().name, "theglad")) base = 0x3316; @@ -208,8 +208,8 @@ MACHINE_CONFIG_END void pgm_arm_type3_state::svg_basic_init() { pgm_basic_init(); - m_svg_shareram[0] = std::make_unique(0x20000 / 4); - m_svg_shareram[1] = std::make_unique(0x20000 / 4); + m_svg_shareram[0] = std::make_unique(0x20000 / 4); + m_svg_shareram[1] = std::make_unique(0x20000 / 4); m_svg_ram_sel = 0; save_pointer(NAME(m_svg_shareram[0].get()), 0x20000 / 4); @@ -219,7 +219,7 @@ void pgm_arm_type3_state::svg_basic_init() void pgm_arm_type3_state::pgm_create_dummy_internal_arm_region(int size) { - UINT16 *temp16 = (UINT16 *)memregion("prot")->base(); + uint16_t *temp16 = (uint16_t *)memregion("prot")->base(); // fill with RX 14 int i; @@ -285,7 +285,7 @@ READ32_MEMBER(pgm_arm_type3_state::svgpcb_speedup_r ) void pgm_arm_type3_state::pgm_create_dummy_internal_arm_region_theglad(int is_svg) { - UINT16 *temp16 = (UINT16 *)memregion("prot")->base(); + uint16_t *temp16 = (uint16_t *)memregion("prot")->base(); int i; for (i=0;i<0x188/2;i+=2) { @@ -525,7 +525,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type3_state,theglad) void pgm_arm_type3_state::pgm_patch_external_arm_rom_jumptable_theglada(int base) { // we don't have the correct internal ROM for this version, so insead we use the one we have and patch the jump table in the external ROM - UINT32 subroutine_addresses[] = + uint32_t subroutine_addresses[] = { 0x00FC, 0x00E8, 0x0110, 0x0150, 0x0194, 0x06C8, 0x071C, 0x0728, 0x0734, 0x0740, 0x0784, 0x0794, 0x07FC, 0x0840, 0x086C, 0x0988, @@ -545,7 +545,7 @@ void pgm_arm_type3_state::pgm_patch_external_arm_rom_jumptable_theglada(int base 0x3050, 0x30A4, 0x30F8, 0x3120, 0x249C, 0x24C0, 0x27BC, 0x2B40, 0x2BF4, 0x2CD8, 0x2E2C }; - UINT16 *extprot = (UINT16 *)memregion("user1")->base(); + uint16_t *extprot = (uint16_t *)memregion("user1")->base(); /* 0x00C8,0x00B4,0x00DC,0x011C,0x0160,0x02DC,0x0330,0x033C, 0x0348,0x0354,0x0398,0x03A8,0x0410,0x0454,0x0480,0x059C, @@ -569,7 +569,7 @@ void pgm_arm_type3_state::pgm_patch_external_arm_rom_jumptable_theglada(int base for (auto & subroutine_addresse : subroutine_addresses) { -// UINT32 addr = extprot[(base/2)] | (extprot[(base/2) + 1] << 16); +// uint32_t addr = extprot[(base/2)] | (extprot[(base/2) + 1] << 16); extprot[(base / 2)] = subroutine_addresse; base += 4; @@ -636,7 +636,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type3_state,svg) pgm_svg_decrypt(machine()); svg_latch_init(); pgm_create_dummy_internal_arm_region_theglad(1); - m_armrom = (UINT32 *)memregion("prot")->base(); + m_armrom = (uint32_t *)memregion("prot")->base(); machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0xB90, 0xB93, read32_delegate(FUNC(pgm_arm_type3_state::svg_speedup_r),this)); @@ -648,7 +648,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type3_state,svgpcb) pgm_svgpcb_decrypt(machine()); svg_latch_init(); pgm_create_dummy_internal_arm_region_theglad(0); - m_armrom = (UINT32 *)memregion("prot")->base(); + m_armrom = (uint32_t *)memregion("prot")->base(); machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x9e0, 0x9e3, read32_delegate(FUNC(pgm_arm_type3_state::svgpcb_speedup_r),this)); } @@ -670,7 +670,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type3_state,killbldp) machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::killbldp_speedup_r),this)); -// UINT16 *temp16 = (UINT16 *)memregion("prot")->base(); +// uint16_t *temp16 = (uint16_t *)memregion("prot")->base(); // int base = 0xfc; // startup table uploads // temp16[(base) /2] = 0x0000; base += 2; // temp16[(base) /2] = 0xE1A0; base += 2; @@ -695,7 +695,7 @@ READ32_MEMBER(pgm_arm_type3_state::dmnfrnt_speedup_r ) READ16_MEMBER(pgm_arm_type3_state::dmnfrnt_main_speedup_r ) { - UINT16 data = m_mainram[0xa03c/2]; + uint16_t data = m_mainram[0xa03c/2]; int pc = space.device().safe_pc(); if (pc == 0x10193a) space.device().execute().spin_until_interrupt(); else if (pc == 0x1019a4) space.device().execute().spin_until_interrupt(); @@ -719,10 +719,10 @@ DRIVER_INIT_MEMBER(pgm_arm_type3_state,dmnfrnt) // the internal rom probably also supplies the region here // we have to copy it to both shared ram regions because it reads from a different one before the attract story? // could be a timing error? or shared ram behavior isn't how we think it is? - UINT16 *share16; - share16 = (UINT16 *)(m_svg_shareram[1].get()); + uint16_t *share16; + share16 = (uint16_t *)(m_svg_shareram[1].get()); share16[0x158/2] = 0x0005; - share16 = (UINT16 *)(m_svg_shareram[0].get()); + share16 = (uint16_t *)(m_svg_shareram[0].get()); share16[0x158/2] = 0x0005; } @@ -731,9 +731,9 @@ DRIVER_INIT_MEMBER(pgm_arm_type3_state,dmnfrnt) // buffer[i] = src[j] // todo, collapse these to an address swap -void pgm_arm_type3_state::pgm_descramble_happy6(UINT8* src) +void pgm_arm_type3_state::pgm_descramble_happy6(uint8_t* src) { - std::vector buffer(0x800000); + std::vector buffer(0x800000); int writeaddress = 0; for (int j = 0; j < 0x800; j += 0x200) @@ -749,9 +749,9 @@ void pgm_arm_type3_state::pgm_descramble_happy6(UINT8* src) -void pgm_arm_type3_state::pgm_descramble_happy6_2(UINT8* src) +void pgm_arm_type3_state::pgm_descramble_happy6_2(uint8_t* src) { - std::vector buffer(0x800000); + std::vector buffer(0x800000); int writeaddress = 0; for (int k = 0; k < 0x800000; k += 0x100000) { @@ -782,25 +782,25 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER(pgm_arm_type3_state,happy6) { - UINT8 *src; + uint8_t *src; - src = (UINT8 *)(machine().root_device().memregion("tiles")->base()) + 0x180000; + src = (uint8_t *)(machine().root_device().memregion("tiles")->base()) + 0x180000; pgm_descramble_happy6(src); pgm_descramble_happy6_2(src); - src = (UINT8 *)(machine().root_device().memregion("sprcol")->base()) + 0x000000; + src = (uint8_t *)(machine().root_device().memregion("sprcol")->base()) + 0x000000; pgm_descramble_happy6(src); pgm_descramble_happy6_2(src); - src = (UINT8 *)(machine().root_device().memregion("sprcol")->base()) + 0x0800000; + src = (uint8_t *)(machine().root_device().memregion("sprcol")->base()) + 0x0800000; pgm_descramble_happy6(src); pgm_descramble_happy6_2(src); - src = (UINT8 *)(machine().root_device().memregion("sprmask")->base()); + src = (uint8_t *)(machine().root_device().memregion("sprmask")->base()); pgm_descramble_happy6(src); pgm_descramble_happy6_2(src); - src = (UINT8 *)(machine().root_device().memregion("ics")->base()) + 0x400000; + src = (uint8_t *)(machine().root_device().memregion("ics")->base()) + 0x400000; pgm_descramble_happy6(src); pgm_descramble_happy6_2(src); diff --git a/src/mame/machine/pgmprot_igs027a_type3.h b/src/mame/machine/pgmprot_igs027a_type3.h index 2586b9fb248..5cb3a6d647f 100644 --- a/src/mame/machine/pgmprot_igs027a_type3.h +++ b/src/mame/machine/pgmprot_igs027a_type3.h @@ -12,14 +12,14 @@ public: } // svg int m_svg_ram_sel; - std::unique_ptr m_svg_shareram[2]; //for 5585G MACHINE + std::unique_ptr m_svg_shareram[2]; //for 5585G MACHINE - UINT32 m_svg_latchdata_68k_w; - UINT32 m_svg_latchdata_arm_w; - required_shared_ptr m_arm_ram; - required_shared_ptr m_arm_ram2; + uint32_t m_svg_latchdata_68k_w; + uint32_t m_svg_latchdata_arm_w; + required_shared_ptr m_arm_ram; + required_shared_ptr m_arm_ram2; - UINT32* m_armrom; + uint32_t* m_armrom; optional_device m_prot; @@ -46,8 +46,8 @@ public: void pgm_create_dummy_internal_arm_region(int size); void pgm_patch_external_arm_rom_jumptable_theglada(int base); void pgm_create_dummy_internal_arm_region_theglad(int is_svg); - void pgm_descramble_happy6(UINT8* src); - void pgm_descramble_happy6_2(UINT8* src); + void pgm_descramble_happy6(uint8_t* src); + void pgm_descramble_happy6_2(uint8_t* src); void svg_latch_init(); DECLARE_READ32_MEMBER( dmnfrnt_speedup_r ); DECLARE_READ16_MEMBER( dmnfrnt_main_speedup_r ); diff --git a/src/mame/machine/pgmprot_orlegend.h b/src/mame/machine/pgmprot_orlegend.h index 9c9f945fdaf..92d511343a6 100644 --- a/src/mame/machine/pgmprot_orlegend.h +++ b/src/mame/machine/pgmprot_orlegend.h @@ -10,11 +10,11 @@ public: } // ASIC 3 (oriental legends protection) - UINT8 m_asic3_reg; - UINT8 m_asic3_latch[3]; - UINT8 m_asic3_x; - UINT16 m_asic3_hilo; - UINT16 m_asic3_hold; + uint8_t m_asic3_reg; + uint8_t m_asic3_latch[3]; + uint8_t m_asic3_x; + uint16_t m_asic3_hilo; + uint16_t m_asic3_hold; DECLARE_DRIVER_INIT(orlegend); void asic3_compute_hold(int,int); diff --git a/src/mame/machine/pk8020.cpp b/src/mame/machine/pk8020.cpp index ef70113fdcb..d89591a8cd3 100644 --- a/src/mame/machine/pk8020.cpp +++ b/src/mame/machine/pk8020.cpp @@ -18,8 +18,8 @@ READ8_MEMBER(pk8020_state::keyboard_r) { - UINT8 retVal=0x00; - UINT8 line = 0; + uint8_t retVal=0x00; + uint8_t line = 0; if (offset & 0x100) line=8; if (offset & 0x0001) retVal|=m_io_port[line]->read(); @@ -55,12 +55,12 @@ WRITE8_MEMBER(pk8020_state::sysreg_w) m_color = data; } else if (BIT(offset,2)==0) { // Palette set - UINT8 number = data & 0x0f; - UINT8 color = data >> 4; - UINT8 i = (color & 0x08) ? 0x3F : 0; - UINT8 r = ((color & 0x04) ? 0xC0 : 0) + i; - UINT8 g = ((color & 0x02) ? 0xC0 : 0) + i; - UINT8 b = ((color & 0x01) ? 0xC0 : 0) + i; + uint8_t number = data & 0x0f; + uint8_t color = data >> 4; + uint8_t i = (color & 0x08) ? 0x3F : 0; + uint8_t r = ((color & 0x04) ? 0xC0 : 0) + i; + uint8_t g = ((color & 0x02) ? 0xC0 : 0) + i; + uint8_t b = ((color & 0x01) ? 0xC0 : 0) + i; m_palette->set_pen_color( number, rgb_t(r,g,b) ); } } @@ -73,7 +73,7 @@ READ8_MEMBER(pk8020_state::text_r) WRITE8_MEMBER(pk8020_state::text_w) { - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); ram[0x40000+offset] = data; switch (m_attr) { case 0: break; @@ -85,11 +85,11 @@ WRITE8_MEMBER(pk8020_state::text_w) READ8_MEMBER(pk8020_state::gzu_r) { - UINT8 *addr = m_ram->pointer() + 0x10000 + (m_video_page_access * 0xC000); - UINT8 p0 = addr[offset]; - UINT8 p1 = addr[offset + 0x4000]; - UINT8 p2 = addr[offset + 0x8000]; - UINT8 retVal = 0; + uint8_t *addr = m_ram->pointer() + 0x10000 + (m_video_page_access * 0xC000); + uint8_t p0 = addr[offset]; + uint8_t p1 = addr[offset + 0x4000]; + uint8_t p2 = addr[offset + 0x8000]; + uint8_t retVal = 0; if(m_color & 0x80) { // Color mode if (!(m_color & 0x10)) { @@ -119,10 +119,10 @@ READ8_MEMBER(pk8020_state::gzu_r) WRITE8_MEMBER(pk8020_state::gzu_w) { - UINT8 *addr = m_ram->pointer() + 0x10000 + (m_video_page_access * 0xC000); - UINT8 *plane_0 = addr; - UINT8 *plane_1 = addr + 0x4000; - UINT8 *plane_2 = addr + 0x8000; + uint8_t *addr = m_ram->pointer() + 0x10000 + (m_video_page_access * 0xC000); + uint8_t *plane_0 = addr; + uint8_t *plane_1 = addr + 0x4000; + uint8_t *plane_2 = addr + 0x8000; if(m_color & 0x80) { @@ -132,7 +132,7 @@ WRITE8_MEMBER(pk8020_state::gzu_w) plane_2[offset] = (plane_2[offset] & ~data) | ((m_color & 8) ? data : 0); } else { // Plane mode - UINT8 mask = (m_color & 1) ? data : 0; + uint8_t mask = (m_color & 1) ? data : 0; if (!(m_color & 0x02)) { plane_0[offset] = (plane_0[offset] & ~data) | mask; } @@ -194,11 +194,11 @@ WRITE8_MEMBER(pk8020_state::devices_w) } } -void pk8020_state::pk8020_set_bank(UINT8 data) +void pk8020_state::pk8020_set_bank(uint8_t data) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *mem = m_region_maincpu->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *mem = m_region_maincpu->base(); + uint8_t *ram = m_ram->pointer(); switch(data & 0x1F) { case 0x00 : diff --git a/src/mame/machine/playch10.cpp b/src/mame/machine/playch10.cpp index 89d21e15212..c6ef69d0149 100644 --- a/src/mame/machine/playch10.cpp +++ b/src/mame/machine/playch10.cpp @@ -42,7 +42,7 @@ void playch10_state::machine_start() /* allocate 4K of nametable ram here */ /* move to individual boards as documentation of actual boards allows */ - m_nt_ram = std::make_unique(0x1000); + m_nt_ram = std::make_unique(0x1000); machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(playch10_state::pc10_chr_r),this), write8_delegate(FUNC(playch10_state::pc10_chr_w),this)); machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(playch10_state::pc10_nt_r),this),write8_delegate(FUNC(playch10_state::pc10_nt_w),this)); @@ -62,10 +62,10 @@ MACHINE_START_MEMBER(playch10_state,playch10_hboard) /* allocate 4K of nametable ram here */ /* move to individual boards as documentation of actual boards allows */ - m_nt_ram = std::make_unique(0x1000); + m_nt_ram = std::make_unique(0x1000); /* allocate vram */ - m_vram = std::make_unique(0x2000); + m_vram = std::make_unique(0x2000); machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(playch10_state::pc10_chr_r),this), write8_delegate(FUNC(playch10_state::pc10_chr_w),this)); machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(playch10_state::pc10_nt_r),this), write8_delegate(FUNC(playch10_state::pc10_nt_w),this)); @@ -230,7 +230,7 @@ READ8_MEMBER(playch10_state::pc10_in1_r) int trigger = ioport("P1")->read(); int x = ioport("GUNX")->read(); int y = ioport("GUNY")->read(); - UINT32 pix, color_base; + uint32_t pix, color_base; /* no sprite hit (yet) */ ret |= 0x08; @@ -520,7 +520,7 @@ WRITE8_MEMBER(playch10_state::mmc1_rom_switch_w) case 3: /* program banking */ { int bank = (m_mmc1_shiftreg & m_mmc1_rom_mask) * 0x4000; - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); if (!size16k) { @@ -576,14 +576,14 @@ DRIVER_INIT_MEMBER(playch10_state,pcaboard) WRITE8_MEMBER(playch10_state::bboard_rom_switch_w) { int bankoffset = 0x10000 + ((data & 7) * 0x4000); - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); memcpy(&prg[0x08000], &prg[bankoffset], 0x4000); } DRIVER_INIT_MEMBER(playch10_state,pcbboard) { - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); /* We do manual banking, in case the code falls through */ /* Copy the initial banks */ @@ -596,7 +596,7 @@ DRIVER_INIT_MEMBER(playch10_state,pcbboard) DRIVER_INIT_CALL(playch10); /* allocate vram */ - m_vram = std::make_unique(0x2000); + m_vram = std::make_unique(0x2000); /* set the mirroring here */ m_mirroring = PPU_MIRROR_VERT; @@ -629,7 +629,7 @@ DRIVER_INIT_MEMBER(playch10_state,pccboard) DRIVER_INIT_MEMBER(playch10_state,pcdboard) { - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); /* We do manual banking, in case the code falls through */ /* Copy the initial banks */ @@ -644,7 +644,7 @@ DRIVER_INIT_MEMBER(playch10_state,pcdboard) /* common init */ DRIVER_INIT_CALL(playch10); /* allocate vram */ - m_vram = std::make_unique(0x2000); + m_vram = std::make_unique(0x2000); /* special init */ set_videoram_bank(0, 8, 0, 8); } @@ -660,7 +660,7 @@ DRIVER_INIT_MEMBER(playch10_state,pcdboard_2) DRIVER_INIT_CALL(pcdboard); /* allocate vram */ - m_vram = std::make_unique(0x2000); + m_vram = std::make_unique(0x2000); /* special init */ set_videoram_bank(0, 8, 0, 8); } @@ -701,7 +701,7 @@ WRITE8_MEMBER(playch10_state::eboard_rom_switch_w) case 0x2000: /* code bank switching */ { int bankoffset = 0x10000 + (data & 0x0f) * 0x2000; - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); memcpy(&prg[0x08000], &prg[bankoffset], 0x2000); } break; @@ -739,7 +739,7 @@ WRITE8_MEMBER(playch10_state::eboard_rom_switch_w) DRIVER_INIT_MEMBER(playch10_state,pceboard) { - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); /* we have no vram, make sure switching games doesn't point to an old allocation */ m_vram = nullptr; @@ -766,8 +766,8 @@ DRIVER_INIT_MEMBER(playch10_state,pceboard) DRIVER_INIT_MEMBER(playch10_state,pcfboard) { - UINT8 *prg = memregion("cart")->base(); - UINT32 len = memregion("cart")->bytes(); + uint8_t *prg = memregion("cart")->base(); + uint32_t len = memregion("cart")->bytes(); /* we have no vram, make sure switching games doesn't point to an old allocation */ m_vram = nullptr; @@ -831,7 +831,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w) if (m_gboard_last_bank != (data & 0xc0)) { int bank; - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); /* reset the banks */ if (m_gboard_command & 0x40) @@ -861,7 +861,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w) case 0x0001: { - UINT8 cmd = m_gboard_command & 0x07; + uint8_t cmd = m_gboard_command & 0x07; int page = (m_gboard_command & 0x80) >> 5; int bank; @@ -884,7 +884,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w) case 6: /* program banking */ { - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); if (m_gboard_command & 0x40) { /* high bank */ @@ -909,7 +909,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w) case 7: /* program banking */ { /* mid bank */ - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); m_gboard_banks[1] = data & 0x1f; bank = m_gboard_banks[1] * 0x2000 + 0x10000; @@ -954,7 +954,7 @@ WRITE8_MEMBER(playch10_state::gboard_rom_switch_w) DRIVER_INIT_MEMBER(playch10_state,pcgboard) { - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); m_vram = nullptr; /* We do manual banking, in case the code falls through */ @@ -998,7 +998,7 @@ DRIVER_INIT_MEMBER(playch10_state,pcgboard_type2) WRITE8_MEMBER(playch10_state::iboard_rom_switch_w) { int bank = data & 7; - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); if (data & 0x10) pc10_set_mirroring(PPU_MIRROR_HIGH); @@ -1010,7 +1010,7 @@ WRITE8_MEMBER(playch10_state::iboard_rom_switch_w) DRIVER_INIT_MEMBER(playch10_state,pciboard) { - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); /* We do manual banking, in case the code falls through */ /* Copy the initial banks */ @@ -1023,7 +1023,7 @@ DRIVER_INIT_MEMBER(playch10_state,pciboard) DRIVER_INIT_CALL(playch10); /* allocate vram */ - m_vram = std::make_unique(0x2000); + m_vram = std::make_unique(0x2000); /* special init */ set_videoram_bank(0, 8, 0, 8); } @@ -1037,7 +1037,7 @@ WRITE8_MEMBER(playch10_state::hboard_rom_switch_w) { case 0x0001: { - UINT8 cmd = m_gboard_command & 0x07; + uint8_t cmd = m_gboard_command & 0x07; int page = (m_gboard_command & 0x80) >> 5; switch (cmd) @@ -1079,7 +1079,7 @@ WRITE8_MEMBER(playch10_state::hboard_rom_switch_w) DRIVER_INIT_MEMBER(playch10_state,pchboard) { - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); memcpy(&prg[0x08000], &prg[0x4c000], 0x4000); memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000); @@ -1107,7 +1107,7 @@ DRIVER_INIT_MEMBER(playch10_state,pchboard) DRIVER_INIT_MEMBER(playch10_state,pckboard) { - UINT8 *prg = memregion("cart")->base(); + uint8_t *prg = memregion("cart")->base(); /* We do manual banking, in case the code falls through */ /* Copy the initial banks */ @@ -1125,7 +1125,7 @@ DRIVER_INIT_MEMBER(playch10_state,pckboard) DRIVER_INIT_CALL(playch10); /* allocate vram */ - m_vram = std::make_unique(0x2000); + m_vram = std::make_unique(0x2000); /* special init */ set_videoram_bank(0, 8, 0, 8); } diff --git a/src/mame/machine/pmd85.cpp b/src/mame/machine/pmd85.cpp index b66163a119e..7ce7b4ef4a5 100644 --- a/src/mame/machine/pmd85.cpp +++ b/src/mame/machine/pmd85.cpp @@ -25,11 +25,11 @@ enum {PMD85_1, PMD85_2, PMD85_2A, PMD85_2B, PMD85_3, ALFA, MATO, C2717}; void pmd85_state::pmd851_update_memory() { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); if (m_startup_mem_map) { - UINT8 *mem = m_region_maincpu->base(); + uint8_t *mem = m_region_maincpu->base(); space.unmap_write(0x0000, 0x0fff); space.nop_write(0x1000, 0x1fff); @@ -69,11 +69,11 @@ void pmd85_state::pmd851_update_memory() void pmd85_state::pmd852a_update_memory() { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); if (m_startup_mem_map) { - UINT8 *mem = m_region_maincpu->base(); + uint8_t *mem = m_region_maincpu->base(); space.unmap_write(0x0000, 0x0fff); space.unmap_write(0x2000, 0x2fff); @@ -105,8 +105,8 @@ void pmd85_state::pmd852a_update_memory() void pmd85_state::pmd853_update_memory() { - UINT8 *mem = m_region_maincpu->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *mem = m_region_maincpu->base(); + uint8_t *ram = m_ram->pointer(); if (m_startup_mem_map) { @@ -143,11 +143,11 @@ void pmd85_state::pmd853_update_memory() void pmd85_state::alfa_update_memory() { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); if (m_startup_mem_map) { - UINT8 *mem = m_region_maincpu->base(); + uint8_t *mem = m_region_maincpu->base(); space.unmap_write(0x0000, 0x0fff); space.unmap_write(0x1000, 0x33ff); @@ -176,11 +176,11 @@ void pmd85_state::alfa_update_memory() void pmd85_state::mato_update_memory() { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); if (m_startup_mem_map) { - UINT8 *mem = m_region_maincpu->base(); + uint8_t *mem = m_region_maincpu->base(); space.unmap_write(0x0000, 0x3fff); @@ -201,8 +201,8 @@ void pmd85_state::mato_update_memory() void pmd85_state::c2717_update_memory() { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8 *mem = m_region_maincpu->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *mem = m_region_maincpu->base(); + uint8_t *ram = m_ram->pointer(); if (m_startup_mem_map) { @@ -272,7 +272,7 @@ WRITE8_MEMBER(pmd85_state::pmd85_ppi_0_portc_w) READ8_MEMBER(pmd85_state::mato_ppi_0_portb_r) { int i; - UINT8 data = 0xff; + uint8_t data = 0xff; for (i = 0; i < 8; i++) { diff --git a/src/mame/machine/poly88.cpp b/src/mame/machine/poly88.cpp index c6421608fab..6f499517821 100644 --- a/src/mame/machine/poly88.cpp +++ b/src/mame/machine/poly88.cpp @@ -47,7 +47,7 @@ WRITE8_MEMBER(poly88_state::poly88_baud_rate_w) } -UINT8 poly88_state::row_number(UINT8 code) { +uint8_t poly88_state::row_number(uint8_t code) { if (BIT(code,0)) return 0; if (BIT(code,1)) return 1; if (BIT(code,2)) return 2; @@ -62,10 +62,10 @@ UINT8 poly88_state::row_number(UINT8 code) { TIMER_CALLBACK_MEMBER(poly88_state::keyboard_callback) { int i; - UINT8 code; - UINT8 key_code = 0; - UINT8 shift = m_linec->read() & 0x02 ? 1 : 0; - UINT8 ctrl = m_linec->read() & 0x01 ? 1 : 0; + uint8_t code; + uint8_t key_code = 0; + uint8_t shift = m_linec->read() & 0x02 ? 1 : 0; + uint8_t ctrl = m_linec->read() & 0x01 ? 1 : 0; for(i = 0; i < 7; i++) { @@ -246,7 +246,7 @@ WRITE_LINE_MEMBER(poly88_state::poly88_usart_rxready) READ8_MEMBER(poly88_state::poly88_keyboard_r) { - UINT8 retVal = m_last_code; + uint8_t retVal = m_last_code; m_maincpu->set_input_line(0, CLEAR_LINE); m_last_code = 0x00; return retVal; @@ -260,11 +260,11 @@ WRITE8_MEMBER(poly88_state::poly88_intr_w) SNAPSHOT_LOAD_MEMBER( poly88_state, poly88 ) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8* data= auto_alloc_array(machine(), UINT8, snapshot_size); - UINT16 recordNum; - UINT16 recordLen; - UINT16 address; - UINT8 recordType; + uint8_t* data= auto_alloc_array(machine(), uint8_t, snapshot_size); + uint16_t recordNum; + uint16_t recordLen; + uint16_t address; + uint8_t recordType; int pos = 0x300; char name[9]; diff --git a/src/mame/machine/pp01.cpp b/src/mame/machine/pp01.cpp index be3b6899c2a..ade836c627a 100644 --- a/src/mame/machine/pp01.cpp +++ b/src/mame/machine/pp01.cpp @@ -17,10 +17,10 @@ WRITE8_MEMBER(pp01_state::pp01_video_write_mode_w) m_video_write_mode = data & 0x0f; } -void pp01_state::pp01_video_w(UINT8 block,UINT16 offset,UINT8 data,UINT8 part) +void pp01_state::pp01_video_w(uint8_t block,uint16_t offset,uint8_t data,uint8_t part) { - UINT16 addroffset = part ? 0x1000 : 0x0000; - UINT8 *ram = m_ram->pointer(); + uint16_t addroffset = part ? 0x1000 : 0x0000; + uint8_t *ram = m_ram->pointer(); if (BIT(m_video_write_mode,3)) { // Copy mode @@ -79,13 +79,13 @@ WRITE8_MEMBER(pp01_state::pp01_video_b_2_w) } -void pp01_state::pp01_set_memory(UINT8 block, UINT8 data) +void pp01_state::pp01_set_memory(uint8_t block, uint8_t data) { - UINT8 *mem = memregion("maincpu")->base(); + uint8_t *mem = memregion("maincpu")->base(); address_space &space = m_maincpu->space(AS_PROGRAM); - UINT16 startaddr = block*0x1000; - UINT16 endaddr = ((block+1)*0x1000)-1; - UINT8 blocknum = block + 1; + uint16_t startaddr = block*0x1000; + uint16_t endaddr = ((block+1)*0x1000)-1; + uint8_t blocknum = block + 1; char bank[10]; sprintf(bank,"bank%d",blocknum); if (data>=0xE0 && data<=0xEF) { diff --git a/src/mame/machine/primo.cpp b/src/mame/machine/primo.cpp index 4820a9a92a4..34bc2fd66b4 100644 --- a/src/mame/machine/primo.cpp +++ b/src/mame/machine/primo.cpp @@ -77,7 +77,7 @@ void primo_state::primo_update_memory() READ8_MEMBER(primo_state::primo_be_1_r) { - UINT8 data = 0x00; + uint8_t data = 0x00; static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; // bit 7, 6 - not used @@ -103,7 +103,7 @@ READ8_MEMBER(primo_state::primo_be_1_r) READ8_MEMBER(primo_state::primo_be_2_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; // bit 7, 6 - not used @@ -268,7 +268,7 @@ MACHINE_RESET_MEMBER(primo_state,primob) *******************************************************************************/ -void primo_state::primo_setup_pss (UINT8* snapshot_data, UINT32 snapshot_size) +void primo_state::primo_setup_pss (uint8_t* snapshot_data, uint32_t snapshot_size) { /* Z80 registers */ m_maincpu->set_state_int(Z80_BC, snapshot_data[4] + snapshot_data[5]*256); @@ -303,7 +303,7 @@ void primo_state::primo_setup_pss (UINT8* snapshot_data, UINT32 snapshot_size) SNAPSHOT_LOAD_MEMBER( primo_state, primo ) { - std::vector snapshot_data(snapshot_size); + std::vector snapshot_data(snapshot_size); if (image.fread(&snapshot_data[0], snapshot_size) != snapshot_size) { @@ -327,10 +327,10 @@ SNAPSHOT_LOAD_MEMBER( primo_state, primo ) *******************************************************************************/ -void primo_state::primo_setup_pp(UINT8* quickload_data, UINT32 quickload_size) +void primo_state::primo_setup_pp(uint8_t* quickload_data, uint32_t quickload_size) { - UINT16 load_addr; - UINT16 start_addr; + uint16_t load_addr; + uint16_t start_addr; load_addr = quickload_data[0] + quickload_data[1]*256; start_addr = quickload_data[2] + quickload_data[3]*256; @@ -345,7 +345,7 @@ void primo_state::primo_setup_pp(UINT8* quickload_data, UINT32 quickload_size) QUICKLOAD_LOAD_MEMBER( primo_state, primo ) { - std::vector quickload_data(quickload_size); + std::vector quickload_data(quickload_size); if (image.fread(&quickload_data[0], quickload_size) != quickload_size) { diff --git a/src/mame/machine/prof80mmu.cpp b/src/mame/machine/prof80mmu.cpp index 68bdabb7237..a981d08c3e9 100644 --- a/src/mame/machine/prof80mmu.cpp +++ b/src/mame/machine/prof80mmu.cpp @@ -34,7 +34,7 @@ ADDRESS_MAP_END // prof80_mmu_device - constructor //------------------------------------------------- -prof80_mmu_device::prof80_mmu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +prof80_mmu_device::prof80_mmu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PROF80_MMU, "PROF80_MMU", tag, owner, clock, "prof80_mmu", __FILE__), device_memory_interface(mconfig, *this), m_program_space_config("program", ENDIANNESS_LITTLE, 8, 20, 0, *ADDRESS_MAP_NAME(program_map)) diff --git a/src/mame/machine/prof80mmu.h b/src/mame/machine/prof80mmu.h index db0352fa913..5820b31ca66 100644 --- a/src/mame/machine/prof80mmu.h +++ b/src/mame/machine/prof80mmu.h @@ -35,7 +35,7 @@ class prof80_mmu_device : public device_t, public device_memory_interface { public: - prof80_mmu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + prof80_mmu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(z80_program_map, 8); @@ -55,7 +55,7 @@ protected: private: const address_space_config m_program_space_config; - UINT8 m_blk[16]; + uint8_t m_blk[16]; bool m_enabled; }; diff --git a/src/mame/machine/psion_pack.cpp b/src/mame/machine/psion_pack.cpp index 5f9550dde73..45c2d4977e9 100644 --- a/src/mame/machine/psion_pack.cpp +++ b/src/mame/machine/psion_pack.cpp @@ -60,7 +60,7 @@ const device_type PSION_DATAPACK = &device_creator; // datapack_device - constructor //------------------------------------------------- -datapack_device::datapack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +datapack_device::datapack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSION_DATAPACK, "Psion Datapack", tag, owner, clock, "datapack", __FILE__), device_image_interface(mconfig, *this) { @@ -117,7 +117,7 @@ const util::option_guide &datapack_device::create_option_guide() const void datapack_device::update() { - UINT32 pack_addr = m_counter + ((m_id & DP_ID_PAGED) ? (m_page << 8) : 0); + uint32_t pack_addr = m_counter + ((m_id & DP_ID_PAGED) ? (m_page << 8) : 0); // if the datapack is 128k or more is treated as segmented if (m_size >= 0x10) @@ -177,7 +177,7 @@ void datapack_device::update() read datapack data lines -------------------------------------------------*/ -UINT8 datapack_device::data_r() +uint8_t datapack_device::data_r() { return (!(m_control & DP_LINE_SLOT_SELECT)) ? m_data : 0; } @@ -187,7 +187,7 @@ UINT8 datapack_device::data_r() write datapack data lines -------------------------------------------------*/ -void datapack_device::data_w(UINT8 data) +void datapack_device::data_w(uint8_t data) { if (is_loaded()) { @@ -204,7 +204,7 @@ void datapack_device::data_w(UINT8 data) read datapack control lines -------------------------------------------------*/ -UINT8 datapack_device::control_r() +uint8_t datapack_device::control_r() { return m_control; } @@ -214,7 +214,7 @@ UINT8 datapack_device::control_r() write datapack control lines -------------------------------------------------*/ -void datapack_device::control_w(UINT8 data) +void datapack_device::control_w(uint8_t data) { if (is_loaded()) { @@ -258,7 +258,7 @@ void datapack_device::control_w(UINT8 data) image_init_result datapack_device::call_load() { - UINT8 data[0x10]; + uint8_t data[0x10]; fread(data, 0x10); @@ -280,7 +280,7 @@ image_init_result datapack_device::call_load() image_init_result datapack_device::call_create(int format_type, util::option_resolution *create_args) { - static const UINT8 opk_head[6] = {'O', 'P', 'K', 0x00, 0x00, 0x00}; + static const uint8_t opk_head[6] = {'O', 'P', 'K', 0x00, 0x00, 0x00}; if (create_args != nullptr) { diff --git a/src/mame/machine/psion_pack.h b/src/mame/machine/psion_pack.h index b5335420f41..24516a93341 100644 --- a/src/mame/machine/psion_pack.h +++ b/src/mame/machine/psion_pack.h @@ -23,7 +23,7 @@ class datapack_device : public device_t, { public: // construction/destruction - datapack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + datapack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~datapack_device(); // image-level overrides @@ -43,10 +43,10 @@ public: virtual const util::option_guide &create_option_guide() const override; // specific implementation - UINT8 data_r(); - void data_w(UINT8 data); - UINT8 control_r(); - void control_w(UINT8 data); + uint8_t data_r(); + void data_w(uint8_t data); + uint8_t control_r(); + void control_w(uint8_t data); protected: // internal helper @@ -58,13 +58,13 @@ protected: private: // internal device state - UINT8 m_id; //datapack ID - UINT8 m_size; //size in 8k blocks - UINT8 m_data; //data lines - UINT8 m_control; //control lines - UINT16 m_counter; //address counter - UINT8 m_page; //active page (only for paged Datapack) - UINT8 m_segment; //active segment (only for segmented Datapack) + uint8_t m_id; //datapack ID + uint8_t m_size; //size in 8k blocks + uint8_t m_data; //data lines + uint8_t m_control; //control lines + uint16_t m_counter; //address counter + uint8_t m_page; //active page (only for paged Datapack) + uint8_t m_segment; //active segment (only for segmented Datapack) }; diff --git a/src/mame/machine/psxcd.cpp b/src/mame/machine/psxcd.cpp index dd653525dfa..eafd7ed2562 100644 --- a/src/mame/machine/psxcd.cpp +++ b/src/mame/machine/psxcd.cpp @@ -64,7 +64,7 @@ enum status_f struct subheader { - UINT8 file, channel, submode, coding; + uint8_t file, channel, submode, coding; }; enum submode_flags @@ -85,7 +85,7 @@ enum submode_flags const device_type PSXCD = &device_creator; -psxcd_device::psxcd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psxcd_device::psxcd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cdrom_image_device(mconfig, PSXCD, "PSX Cdrom", tag, owner, clock, "psx_cd", __FILE__), m_irq_handler(*this) { @@ -212,7 +212,7 @@ void psxcd_device::call_unload() READ8_MEMBER( psxcd_device::read ) { - UINT8 ret = 0; + uint8_t ret = 0; switch (offset & 3) { /* @@ -423,7 +423,7 @@ const psxcd_device::cdcmd psxcd_device::cmd_table[]= &psxcd_device::cdcmd_readtoc }; -void psxcd_device::write_command(UINT8 byte) +void psxcd_device::write_command(uint8_t byte) { if(byte > 31) illegalcmd(byte); @@ -600,7 +600,7 @@ void psxcd_device::cdcmd_getparam() send_result(intr_complete,data,6); } -UINT32 psxcd_device::sub_loc(CDPOS src1, CDPOS src2) +uint32_t psxcd_device::sub_loc(CDPOS src1, CDPOS src2) { CDPOS dst; int f=src1.b[F]-src2.b[F], @@ -631,7 +631,7 @@ void psxcd_device::cdcmd_getlocl() void psxcd_device::cdcmd_getlocp() { CDPOS tloc, start; - UINT8 track = cdrom_get_track(m_cdrom_handle, msf_to_lba_ps(loc.w)) + 1; + uint8_t track = cdrom_get_track(m_cdrom_handle, msf_to_lba_ps(loc.w)) + 1; start.w = (track == 1) ? 0x000200 : lba_to_msf_ps(cdrom_get_track_start(m_cdrom_handle, track - 1)); tloc.w = sub_loc(loc, start); @@ -677,8 +677,8 @@ void psxcd_device::cdcmd_gettn() void psxcd_device::cdcmd_gettd() { - UINT8 track = bcd_to_decimal(cmdbuf[0]); - UINT8 last = cdrom_get_last_track(m_cdrom_handle); + uint8_t track = bcd_to_decimal(cmdbuf[0]); + uint8_t last = cdrom_get_last_track(m_cdrom_handle); if(track <= last) { CDPOS trkstart; @@ -730,7 +730,7 @@ void psxcd_device::cdcmd_test() { case 0x20: { - static UINT8 data[4]= + static uint8_t data[4]= { 0x95, 0x07, @@ -755,7 +755,7 @@ void psxcd_device::cdcmd_id() if (!open) { - UINT8 cdid[8]; + uint8_t cdid[8]; int irq; memset(cdid, '\0', 8); @@ -837,7 +837,7 @@ void psxcd_device::cdcmd_illegal1d() illegalcmd(0x1d); // read q subchannel } -void psxcd_device::illegalcmd(UINT8 cmd) +void psxcd_device::illegalcmd(uint8_t cmd) { verboselog(*this, 0, "psxcd: unimplemented cd command %02x\n", cmd); @@ -866,7 +866,7 @@ void psxcd_device::cmd_complete(command_result *res) res->next = nullptr; } -psxcd_device::command_result *psxcd_device::prepare_result(UINT8 res, UINT8 *data, int sz, UINT8 errcode) +psxcd_device::command_result *psxcd_device::prepare_result(uint8_t res, uint8_t *data, int sz, uint8_t errcode) { auto cr=global_alloc(command_result); @@ -895,24 +895,24 @@ psxcd_device::command_result *psxcd_device::prepare_result(UINT8 res, UINT8 *dat return cr; } -void psxcd_device::send_result(UINT8 res, UINT8 *data, int sz, int delay, UINT8 errcode) +void psxcd_device::send_result(uint8_t res, uint8_t *data, int sz, int delay, uint8_t errcode) { // Avoid returning results after sector read results - // delay the sector read slightly if necessary - UINT64 systime = m_maincpu->total_cycles(); + uint64_t systime = m_maincpu->total_cycles(); if ((next_read_event != -1) && ((systime+delay)>(next_sector_t))) { - UINT32 hz = m_sysclock / (delay + 2000); + uint32_t hz = m_sysclock / (delay + 2000); m_timers[next_read_event]->adjust(attotime::from_hz(hz), 0, attotime::never); } add_system_event(event_cmd_complete, delay, prepare_result(res, data, sz, errcode)); } -void psxcd_device::start_dma(UINT8 *mainram, UINT32 size) +void psxcd_device::start_dma(uint8_t *mainram, uint32_t size) { - UINT32 sector_size; + uint32_t sector_size; verboselog(*this, 1, "psxcd: start dma %d bytes at %d\n", size, m_transcurr); if(!m_dmaload) @@ -952,8 +952,8 @@ void psxcd_device::read_sector() if (status & status_reading) { bool isend = false; - UINT32 sector = msf_to_lba_ps(curpos.w); - UINT8 *buf = secbuf[sectail]; + uint32_t sector = msf_to_lba_ps(curpos.w); + uint8_t *buf = secbuf[sectail]; if (cdrom_read_data(m_cdrom_handle, sector, buf, CD_TRACK_RAW_DONTCARE)) { subheader *sub=(subheader *)(buf+16); @@ -1025,7 +1025,7 @@ void psxcd_device::play_sector() if (status&status_playing) { - UINT32 sector = msf_to_lba_ps(curpos.w); + uint32_t sector = msf_to_lba_ps(curpos.w); if(cdrom_read_data(m_cdrom_handle, sector, secbuf[sectail], CD_TRACK_AUDIO)) { @@ -1074,7 +1074,7 @@ void psxcd_device::play_sector() if ((mode&mode_report) && !(sector & 15)) // slow the int rate { auto res=global_alloc(command_result); - UINT8 track = cdrom_get_track(m_cdrom_handle, sector) + 1; + uint8_t track = cdrom_get_track(m_cdrom_handle, sector) + 1; res->res=intr_dataready; res->data[0]=status; @@ -1111,7 +1111,7 @@ void psxcd_device::play_sector() void psxcd_device::start_read() { - UINT32 sector = msf_to_lba_ps(curpos.w); + uint32_t sector = msf_to_lba_ps(curpos.w); assert((status&(status_reading|status_playing))==0); @@ -1129,7 +1129,7 @@ void psxcd_device::start_read() unsigned int cyc=read_sector_cycles; if (mode&mode_double_speed) cyc>>=1; - INT64 systime=m_maincpu->total_cycles(); + int64_t systime=m_maincpu->total_cycles(); systime+=start_read_delay; @@ -1139,7 +1139,7 @@ void psxcd_device::start_read() void psxcd_device::start_play() { - UINT8 track = cdrom_get_track(m_cdrom_handle, msf_to_lba_ps(curpos.w) + 150); + uint8_t track = cdrom_get_track(m_cdrom_handle, msf_to_lba_ps(curpos.w) + 150); if(cdrom_get_track_type(m_cdrom_handle, track) != CD_TRACK_AUDIO) verboselog(*this, 0, "psxcd: playing data track\n"); @@ -1177,7 +1177,7 @@ void psxcd_device::stop_read() next_read_event = -1; } - UINT32 sector=msf_to_lba_ps(curpos.w); + uint32_t sector=msf_to_lba_ps(curpos.w); m_spu->flush_xa(sector); m_spu->flush_cdda(sector); } @@ -1216,10 +1216,10 @@ void psxcd_device::device_timer(emu_timer &timer, device_timer_id tid, int param } } -int psxcd_device::add_system_event(int type, UINT64 t, command_result *ptr) +int psxcd_device::add_system_event(int type, uint64_t t, command_result *ptr) { // t is in maincpu clock cycles - UINT32 hz = m_sysclock / t; + uint32_t hz = m_sysclock / t; for(int i = 0; i < MAX_PSXCD_TIMERS; i++) { if(!m_timerinuse[i]) diff --git a/src/mame/machine/psxcd.h b/src/mame/machine/psxcd.h index 4049cdf1d3a..509817eab1e 100644 --- a/src/mame/machine/psxcd.h +++ b/src/mame/machine/psxcd.h @@ -21,7 +21,7 @@ class psxcd_device : public cdrom_image_device { public: - psxcd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxcd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } @@ -30,7 +30,7 @@ public: DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( read ); - void start_dma(UINT8 *mainram, UINT32 size); + void start_dma(uint8_t *mainram, uint32_t size); protected: virtual void device_start() override; @@ -40,17 +40,17 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; private: - void write_command(UINT8 byte); + void write_command(uint8_t byte); typedef void (psxcd_device::*cdcmd)(); struct command_result { - UINT8 data[32], sz, res; + uint8_t data[32], sz, res; command_result *next; }; union CDPOS { - UINT8 b[4]; - UINT32 w; + uint8_t b[4]; + uint32_t w; }; void cdcmd_sync(); @@ -86,40 +86,40 @@ private: void cdcmd_illegal1d(); static const cdcmd cmd_table[31]; - void illegalcmd(UINT8 cmd); + void illegalcmd(uint8_t cmd); void cmd_complete(command_result *res); - void send_result(UINT8 res, UINT8 *data=nullptr, int sz=0, int delay=default_irq_delay, UINT8 errcode = 0); - command_result *prepare_result(UINT8 res, UINT8 *data=nullptr, int sz=0, UINT8 errcode = 0); + void send_result(uint8_t res, uint8_t *data=nullptr, int sz=0, int delay=default_irq_delay, uint8_t errcode = 0); + command_result *prepare_result(uint8_t res, uint8_t *data=nullptr, int sz=0, uint8_t errcode = 0); void start_read(); void start_play(); void stop_read(); void read_sector(); void play_sector(); - UINT32 sub_loc(CDPOS src1, CDPOS src2); - int add_system_event(int type, UINT64 t, command_result *ptr); + uint32_t sub_loc(CDPOS src1, CDPOS src2); + int add_system_event(int type, uint64_t t, command_result *ptr); - UINT8 bcd_to_decimal(const UINT8 bcd) { return ((bcd>>4)*10)+(bcd&0xf); } - UINT8 decimal_to_bcd(const UINT8 dec) { return ((dec/10)<<4)|(dec%10); } - UINT32 msf_to_lba_ps(UINT32 msf) { msf = msf_to_lba(msf); return (msf>150)?(msf-150):msf; } - UINT32 lba_to_msf_ps(UINT32 lba) { return lba_to_msf_alt(lba+150); } + uint8_t bcd_to_decimal(const uint8_t bcd) { return ((bcd>>4)*10)+(bcd&0xf); } + uint8_t decimal_to_bcd(const uint8_t dec) { return ((dec/10)<<4)|(dec%10); } + uint32_t msf_to_lba_ps(uint32_t msf) { msf = msf_to_lba(msf); return (msf>150)?(msf-150):msf; } + uint32_t lba_to_msf_ps(uint32_t lba) { return lba_to_msf_alt(lba+150); } static const unsigned int sector_buffer_size=16, default_irq_delay=16000; //480; //8000; //2000<<2; static const unsigned int raw_sector_size=2352; - UINT8 cmdbuf[64], mode, secbuf[sector_buffer_size][raw_sector_size]; - UINT8 filter_file, filter_channel, lastsechdr[8], status; + uint8_t cmdbuf[64], mode, secbuf[sector_buffer_size][raw_sector_size]; + uint8_t filter_file, filter_channel, lastsechdr[8], status; int rdp; - UINT8 m_cursec, sectail; - UINT16 m_transcurr; - UINT8 m_transbuf[raw_sector_size]; + uint8_t m_cursec, sectail; + uint16_t m_transcurr; + uint8_t m_transbuf[raw_sector_size]; command_result *res_queue, *m_int1; struct { - UINT8 sr, ir, imr; + uint8_t sr, ir, imr; struct { - UINT8 ll, lr, rl, rr; + uint8_t ll, lr, rl, rr; } vol; } m_regs; @@ -141,11 +141,11 @@ private: bool open, m_mute, m_dmaload; device_timer_id next_read_event; - INT64 next_sector_t; + int64_t next_sector_t; unsigned int autopause_sector, start_read_delay, read_sector_cycles, preread_delay; - UINT32 m_param_count; - UINT32 m_sysclock; + uint32_t m_param_count; + uint32_t m_sysclock; emu_timer *m_timers[MAX_PSXCD_TIMERS]; bool m_timerinuse[MAX_PSXCD_TIMERS]; diff --git a/src/mame/machine/pxa255.h b/src/mame/machine/pxa255.h index fae87a1aa40..75f20c103a6 100644 --- a/src/mame/machine/pxa255.h +++ b/src/mame/machine/pxa255.h @@ -167,22 +167,22 @@ struct PXA255_DMA_Regs { - UINT32 dcsr[16]; + uint32_t dcsr[16]; - UINT32 pad0[44]; + uint32_t pad0[44]; - UINT32 dint; + uint32_t dint; - UINT32 pad1[3]; + uint32_t pad1[3]; - UINT32 drcmr[40]; + uint32_t drcmr[40]; - UINT32 pad2[24]; + uint32_t pad2[24]; - UINT32 ddadr[16]; - UINT32 dsadr[16]; - UINT32 dtadr[16]; - UINT32 dcmd[16]; + uint32_t ddadr[16]; + uint32_t dsadr[16]; + uint32_t dtadr[16]; + uint32_t dcmd[16]; emu_timer* timer[16]; }; @@ -234,25 +234,25 @@ struct PXA255_DMA_Regs struct PXA255_I2S_Regs { - UINT32 sacr0; - UINT32 sacr1; + uint32_t sacr0; + uint32_t sacr1; - UINT32 pad0; + uint32_t pad0; - UINT32 sasr0; + uint32_t sasr0; - UINT32 pad1; + uint32_t pad1; - UINT32 saimr; - UINT32 saicr; + uint32_t saimr; + uint32_t saicr; - UINT32 pad2[17]; + uint32_t pad2[17]; - UINT32 sadiv; + uint32_t sadiv; - UINT32 pad3[6]; + uint32_t pad3[6]; - UINT32 sadr; + uint32_t sadr; }; /* @@ -283,11 +283,11 @@ struct PXA255_I2S_Regs struct PXA255_OSTMR_Regs { - UINT32 osmr[4]; - UINT32 oscr; - UINT32 ossr; - UINT32 ower; - UINT32 oier; + uint32_t osmr[4]; + uint32_t oscr; + uint32_t ossr; + uint32_t ower; + uint32_t oier; emu_timer* timer[4]; }; @@ -335,12 +335,12 @@ struct PXA255_OSTMR_Regs struct PXA255_INTC_Regs { - UINT32 icip; - UINT32 icmr; - UINT32 iclr; - UINT32 icfp; - UINT32 icpr; - UINT32 iccr; + uint32_t icip; + uint32_t icmr; + uint32_t iclr; + uint32_t icfp; + uint32_t icpr; + uint32_t iccr; }; /* @@ -382,40 +382,40 @@ struct PXA255_INTC_Regs struct PXA255_GPIO_Regs { - UINT32 gplr0; // GPIO Pin-Leve - UINT32 gplr1; - UINT32 gplr2; - - UINT32 gpdr0; - UINT32 gpdr1; - UINT32 gpdr2; - - UINT32 gpsr0; - UINT32 gpsr1; - UINT32 gpsr2; - - UINT32 gpcr0; - UINT32 gpcr1; - UINT32 gpcr2; - - UINT32 grer0; - UINT32 grer1; - UINT32 grer2; - - UINT32 gfer0; - UINT32 gfer1; - UINT32 gfer2; - - UINT32 gedr0; - UINT32 gedr1; - UINT32 gedr2; - - UINT32 gafr0l; - UINT32 gafr0u; - UINT32 gafr1l; - UINT32 gafr1u; - UINT32 gafr2l; - UINT32 gafr2u; + uint32_t gplr0; // GPIO Pin-Leve + uint32_t gplr1; + uint32_t gplr2; + + uint32_t gpdr0; + uint32_t gpdr1; + uint32_t gpdr2; + + uint32_t gpsr0; + uint32_t gpsr1; + uint32_t gpsr2; + + uint32_t gpcr0; + uint32_t gpcr1; + uint32_t gpcr2; + + uint32_t grer0; + uint32_t grer1; + uint32_t grer2; + + uint32_t gfer0; + uint32_t gfer1; + uint32_t gfer2; + + uint32_t gedr0; + uint32_t gedr1; + uint32_t gedr2; + + uint32_t gafr0l; + uint32_t gafr0u; + uint32_t gafr1l; + uint32_t gafr1u; + uint32_t gafr2l; + uint32_t gafr2u; }; /* @@ -480,32 +480,32 @@ struct PXA255_GPIO_Regs struct PXA255_LCD_DMA_Regs { - UINT32 fdadr; - UINT32 fsadr; - UINT32 fidr; - UINT32 ldcmd; + uint32_t fdadr; + uint32_t fsadr; + uint32_t fidr; + uint32_t ldcmd; emu_timer *eof; }; struct PXA255_LCD_Regs { - UINT32 lccr0; - UINT32 lccr1; - UINT32 lccr2; - UINT32 lccr3; + uint32_t lccr0; + uint32_t lccr1; + uint32_t lccr2; + uint32_t lccr3; - UINT32 pad0[4]; + uint32_t pad0[4]; - UINT32 fbr[2]; + uint32_t fbr[2]; - UINT32 pad1[4]; + uint32_t pad1[4]; - UINT32 lcsr; - UINT32 liidr; - UINT32 trgbr; - UINT32 tcr; + uint32_t lcsr; + uint32_t liidr; + uint32_t trgbr; + uint32_t tcr; - UINT32 pad2[110]; + uint32_t pad2[110]; PXA255_LCD_DMA_Regs dma[2]; }; diff --git a/src/mame/machine/qimi.cpp b/src/mame/machine/qimi.cpp index e1a55134b69..c49de90a854 100644 --- a/src/mame/machine/qimi.cpp +++ b/src/mame/machine/qimi.cpp @@ -102,7 +102,7 @@ ioport_constructor qimi_t::device_input_ports() const // qimi_t - constructor //------------------------------------------------- -qimi_t::qimi_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +qimi_t::qimi_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, QIMI, "QL Internal Mouse Interface", tag, owner, clock, "qimi", __FILE__), m_write_extint(*this), m_buttons(*this, "mouse_buttons"), @@ -138,7 +138,7 @@ void qimi_t::device_reset() // read - //------------------------------------------------- -UINT8 qimi_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t qimi_t::read(address_space &space, offs_t offset, uint8_t data) { switch (offset) { diff --git a/src/mame/machine/qimi.h b/src/mame/machine/qimi.h index ffa3caf0fe1..8ec534509ab 100644 --- a/src/mame/machine/qimi.h +++ b/src/mame/machine/qimi.h @@ -34,14 +34,14 @@ class qimi_t : public device_t { public: // construction/destruction - qimi_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + qimi_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_exting_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_extint.set_callback(object); } // optional information overrides virtual ioport_constructor device_input_ports() const override; - UINT8 read(address_space &space, offs_t offset, UINT8 data); + uint8_t read(address_space &space, offs_t offset, uint8_t data); DECLARE_WRITE8_MEMBER( write ); DECLARE_INPUT_CHANGED_MEMBER( mouse_x_changed ); @@ -65,7 +65,7 @@ private: required_ioport m_buttons; - UINT8 m_status; + uint8_t m_status; bool m_extint_en; }; diff --git a/src/mame/machine/qix.cpp b/src/mame/machine/qix.cpp index e15e409a8ad..e15a52459a8 100644 --- a/src/mame/machine/qix.cpp +++ b/src/mame/machine/qix.cpp @@ -181,9 +181,9 @@ WRITE8_MEMBER(qix_state::qixmcu_coinctrl_w) READ8_MEMBER(qix_state::qix_68705_portA_r) { - UINT8 ddr = m_68705_ddr[0]; - UINT8 out = m_68705_port_out[0]; - UINT8 in = m_68705_port_in[0]; + uint8_t ddr = m_68705_ddr[0]; + uint8_t out = m_68705_port_out[0]; + uint8_t in = m_68705_port_in[0]; logerror("68705:portA_r = %02X (%02X)\n", (out & ddr) | (in & ~ddr), in); return (out & ddr) | (in & ~ddr); } @@ -191,18 +191,18 @@ READ8_MEMBER(qix_state::qix_68705_portA_r) READ8_MEMBER(qix_state::qix_68705_portB_r) { - UINT8 ddr = m_68705_ddr[1]; - UINT8 out = m_68705_port_out[1]; - UINT8 in = (ioport("COIN")->read() & 0x0f) | ((ioport("COIN")->read() & 0x80) >> 3); + uint8_t ddr = m_68705_ddr[1]; + uint8_t out = m_68705_port_out[1]; + uint8_t in = (ioport("COIN")->read() & 0x0f) | ((ioport("COIN")->read() & 0x80) >> 3); return (out & ddr) | (in & ~ddr); } READ8_MEMBER(qix_state::qix_68705_portC_r) { - UINT8 ddr = m_68705_ddr[2]; - UINT8 out = m_68705_port_out[2]; - UINT8 in = (m_coinctrl & 0x08) | ((ioport("COIN")->read() & 0x70) >> 4); + uint8_t ddr = m_68705_ddr[2]; + uint8_t out = m_68705_port_out[2]; + uint8_t in = (m_coinctrl & 0x08) | ((ioport("COIN")->read() & 0x70) >> 4); return (out & ddr) | (in & ~ddr); } diff --git a/src/mame/machine/qx10kbd.cpp b/src/mame/machine/qx10kbd.cpp index e1eb21574d2..59fac18aedc 100644 --- a/src/mame/machine/qx10kbd.cpp +++ b/src/mame/machine/qx10kbd.cpp @@ -7,7 +7,7 @@ #include "machine/keyboard.ipp" -qx10_keyboard_device::qx10_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) +qx10_keyboard_device::qx10_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : buffered_rs232_device(mconfig, QX10_KEYBOARD, "QX10 Keyboard", tag, owner, 0, "qx10_keyboard", __FILE__) , device_matrix_keyboard_interface(mconfig, *this, "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9", "LINEA", "LINEB", "LINEC", "LINED", "LINEE", "LINEF") { @@ -42,13 +42,13 @@ void qx10_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, in } -void qx10_keyboard_device::key_make(UINT8 row, UINT8 column) +void qx10_keyboard_device::key_make(uint8_t row, uint8_t column) { transmit_byte((column << 4) | row); } -void qx10_keyboard_device::received_byte(UINT8 data) +void qx10_keyboard_device::received_byte(uint8_t data) { switch (data & 0xe0) { diff --git a/src/mame/machine/qx10kbd.h b/src/mame/machine/qx10kbd.h index f77b1b06c31..61c0f40d7cb 100644 --- a/src/mame/machine/qx10kbd.h +++ b/src/mame/machine/qx10kbd.h @@ -8,16 +8,16 @@ class qx10_keyboard_device : public buffered_rs232_device<16U>, protected device_matrix_keyboard_interface<16U> { public: - qx10_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + qx10_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void key_make(UINT8 row, UINT8 column) override; + virtual void key_make(uint8_t row, uint8_t column) override; private: - virtual void received_byte(UINT8 data) override; + virtual void received_byte(uint8_t data) override; }; extern const device_type QX10_KEYBOARD; diff --git a/src/mame/machine/r2crypt.cpp b/src/mame/machine/r2crypt.cpp index 46f2cf5eac0..3101c690f8c 100644 --- a/src/mame/machine/r2crypt.cpp +++ b/src/mame/machine/r2crypt.cpp @@ -43,7 +43,7 @@ the suggested one for zero team), but, of course, it should be taken just as what it is: a guess. */ -static const UINT8 rotate_r2[512] = { +static const uint8_t rotate_r2[512] = { 0x11, 0x17, 0x0d, 0x03, 0x17, 0x1f, 0x08, 0x1a, 0x0f, 0x04, 0x1e, 0x13, 0x19, 0x0e, 0x0e, 0x05, 0x06, 0x07, 0x08, 0x08, 0x0d, 0x18, 0x11, 0x1a, 0x0b, 0x06, 0x12, 0x0c, 0x1f, 0x0b, 0x1c, 0x19, 0x00, 0x1b, 0x0c, 0x09, 0x1d, 0x18, 0x1a, 0x16, 0x1a, 0x08, 0x03, 0x04, 0x0f, 0x1d, 0x16, 0x07, @@ -79,7 +79,7 @@ static const UINT8 rotate_r2[512] = { 0x08, 0x19, 0x18, 0x15, 0x1f, 0x05, 0x00, 0x09, 0x0e, 0x05, 0x16, 0x1b, 0x01, 0x08, 0x08, 0x1f, }; -static const UINT8 x5_r2[256] = { +static const uint8_t x5_r2[256] = { 0x08, 0x09, 0x1f, 0x0f, 0x09, 0x09, 0x0b, 0x1d, 0x06, 0x13, 0x02, 0x15, 0x02, 0x0c, 0x0d, 0x19, 0x03, 0x13, 0x0c, 0x1f, 0x1a, 0x18, 0x17, 0x10, 0x0a, 0x19, 0x15, 0x04, 0x1f, 0x11, 0x1c, 0x02, 0x0e, 0x08, 0x06, 0x0a, 0x07, 0x1c, 0x10, 0x04, 0x11, 0x0c, 0x0a, 0x19, 0x0a, 0x04, 0x17, 0x07, @@ -98,7 +98,7 @@ static const UINT8 x5_r2[256] = { 0x05, 0x15, 0x11, 0x0a, 0x1c, 0x00, 0x1e, 0x1f, 0x17, 0x12, 0x0a, 0x1c, 0x07, 0x04, 0x1f, 0x1a, }; -static const UINT16 x11_r2[256] = { +static const uint16_t x11_r2[256] = { 0x347, 0x0f2, 0x182, 0x58f, 0x1f4, 0x42c, 0x407, 0x5f0, 0x6df, 0x2db, 0x585, 0x5fe, 0x394, 0x542, 0x3e8, 0x574, 0x4ea, 0x6d3, 0x6b7, 0x65b, 0x324, 0x143, 0x22a, 0x11d, 0x124, 0x365, 0x7ca, 0x3d6, 0x1d2, 0x7cd, 0x6b1, 0x4f1, 0x1de, 0x674, 0x685, 0x779, 0x264, 0x6d8, 0x379, 0x7ce, 0x201, 0x73b, 0x5c9, 0x025, 0x338, 0x4b2, 0x697, 0x567, @@ -117,7 +117,7 @@ static const UINT16 x11_r2[256] = { 0x1c1, 0x7de, 0x106, 0x275, 0x1e1, 0x503, 0x30a, 0x271, 0x4f8, 0x52b, 0x266, 0x375, 0x024, 0x399, 0x672, 0x6f8, }; -static const UINT8 rotate_zt[256] = { +static const uint8_t rotate_zt[256] = { 0x0a, 0x0a, 0x0b, 0x0e, 0x02, 0x12, 0x0d, 0x16, 0x01, 0x1b, 0x08, 0x15, 0x03, 0x14, 0x0f, 0x1f, 0x10, 0x1d, 0x03, 0x0b, 0x16, 0x07, 0x10, 0x19, 0x1f, 0x1c, 0x03, 0x0b, 0x15, 0x0d, 0x00, 0x14, 0x15, 0x0d, 0x0c, 0x1b, 0x18, 0x18, 0x0b, 0x1b, 0x16, 0x17, 0x01, 0x0e, 0x14, 0x0c, 0x1e, 0x13, @@ -136,7 +136,7 @@ static const UINT8 rotate_zt[256] = { 0x14, 0x0a, 0x0c, 0x16, 0x02, 0x0a, 0x0f, 0x0d, 0x0c, 0x1d, 0x1e, 0x13, 0x0a, 0x08, 0x12, 0x0b, }; -static const UINT8 x5_zt[256] = { +static const uint8_t x5_zt[256] = { 0x0d, 0x14, 0x13, 0x1b, 0x1a, 0x05, 0x1a, 0x05, 0x1b, 0x17, 0x0d, 0x0f, 0x00, 0x17, 0x09, 0x04, 0x13, 0x0f, 0x14, 0x17, 0x14, 0x0f, 0x1b, 0x0a, 0x0a, 0x15, 0x07, 0x0b, 0x0e, 0x05, 0x18, 0x12, 0x1c, 0x01, 0x17, 0x02, 0x04, 0x00, 0x06, 0x12, 0x00, 0x0a, 0x1c, 0x19, 0x10, 0x1b, 0x16, 0x03, @@ -155,7 +155,7 @@ static const UINT8 x5_zt[256] = { 0x05, 0x16, 0x11, 0x06, 0x12, 0x0c, 0x0c, 0x0f, 0x1c, 0x18, 0x08, 0x1e, 0x1c, 0x16, 0x15, 0x03, }; -static const UINT16 x11_zt[512] = { +static const uint16_t x11_zt[512] = { 0x7e9, 0x625, 0x625, 0x006, 0x006, 0x14a, 0x14a, 0x7e9, 0x657, 0x417, 0x417, 0x1a7, 0x1a7, 0x22f, 0x22f, 0x657, 0x37e, 0x447, 0x447, 0x117, 0x117, 0x735, 0x735, 0x37e, 0x3be, 0x487, 0x487, 0x724, 0x724, 0x6e3, 0x6e3, 0x3be, 0x646, 0x035, 0x035, 0x57e, 0x57e, 0x134, 0x134, 0x646, 0x09a, 0x4d1, 0x4d1, 0x511, 0x511, 0x5d5, 0x5d5, 0x09a, @@ -191,14 +191,14 @@ static const UINT16 x11_zt[512] = { }; -static UINT32 yrot(UINT32 v, int r) +static uint32_t yrot(uint32_t v, int r) { return (v << r) | (v >> (32-r)); } -static UINT16 gm(int i4) +static uint16_t gm(int i4) { - UINT16 x=0; + uint16_t x=0; for (int i=0; i<4; ++i) { @@ -209,20 +209,20 @@ static UINT16 gm(int i4) return x; } -static UINT32 core_decrypt(UINT32 ciphertext, int i1, int i2, int i3, int i4, - const UINT8 *rotate, const UINT8 *x5, const UINT16 *x11, UINT32 preXor, UINT32 carryMask, UINT32 postXor) +static uint32_t core_decrypt(uint32_t ciphertext, int i1, int i2, int i3, int i4, + const uint8_t *rotate, const uint8_t *x5, const uint16_t *x11, uint32_t preXor, uint32_t carryMask, uint32_t postXor) { - UINT32 v1 = BITSWAP32(yrot(ciphertext, rotate[i1]), 25,28,15,19, 6,0,3,24, 11,1,2,30, 16,7,22,17, 31,14,23,9, 27,18,4,10, 13,20,5,12, 8,29,26,21); + uint32_t v1 = BITSWAP32(yrot(ciphertext, rotate[i1]), 25,28,15,19, 6,0,3,24, 11,1,2,30, 16,7,22,17, 31,14,23,9, 27,18,4,10, 13,20,5,12, 8,29,26,21); - UINT16 x1Low = (x5[i2]<<11) ^ x11[i3] ^ gm(i4); - UINT32 x1 = x1Low | (BITSWAP16(x1Low, 0,8,1,9, 2,10,3,11, 4,12,5,13, 6,14,7,15)<<16); + uint16_t x1Low = (x5[i2]<<11) ^ x11[i3] ^ gm(i4); + uint32_t x1 = x1Low | (BITSWAP16(x1Low, 0,8,1,9, 2,10,3,11, 4,12,5,13, 6,14,7,15)<<16); return partial_carry_sum32(v1, x1^preXor, carryMask) ^ postXor; } void raiden2_decrypt_sprites(running_machine &machine) { - UINT32 *data = (UINT32 *)machine.root_device().memregion("gfx3")->base(); + uint32_t *data = (uint32_t *)machine.root_device().memregion("gfx3")->base(); for(int i=0; i<0x800000/4; i++) { data[i] = core_decrypt(data[i], @@ -242,7 +242,7 @@ void raiden2_decrypt_sprites(running_machine &machine) void zeroteam_decrypt_sprites(running_machine &machine) { - UINT32 *data = (UINT32 *)machine.root_device().memregion("gfx3")->base(); + uint32_t *data = (uint32_t *)machine.root_device().memregion("gfx3")->base(); for(int i=0; i<0x400000/4; i++) { data[i] = core_decrypt(data[i], diff --git a/src/mame/machine/radio86.cpp b/src/mame/machine/radio86.cpp index ef097a1dc48..6c2cd63ae29 100644 --- a/src/mame/machine/radio86.cpp +++ b/src/mame/machine/radio86.cpp @@ -26,7 +26,7 @@ void radio86_state::radio86_init_keyboard() DRIVER_INIT_MEMBER(radio86_state,radio86) { /* set initialy ROM to be visible on first bank */ - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); memset(RAM,0x0000,0x1000); // make frist page empty by default m_bank1->configure_entries(1, 2, RAM, 0x0000); m_bank1->configure_entries(0, 2, RAM, 0xf800); @@ -36,12 +36,12 @@ DRIVER_INIT_MEMBER(radio86_state,radio86) DRIVER_INIT_MEMBER(radio86_state,radioram) { DRIVER_INIT_CALL(radio86); - m_radio_ram_disk = std::make_unique(0x20000); + m_radio_ram_disk = std::make_unique(0x20000); memset(m_radio_ram_disk.get(),0,0x20000); } READ8_MEMBER(radio86_state::radio86_8255_portb_r2) { - UINT8 key = 0xff; + uint8_t key = 0xff; if ((m_keyboard_mask & 0x01)!=0) { key &= m_io_line0->read(); } if ((m_keyboard_mask & 0x02)!=0) { key &= m_io_line1->read(); } if ((m_keyboard_mask & 0x04)!=0) { key &= m_io_line2->read(); } @@ -56,7 +56,7 @@ READ8_MEMBER(radio86_state::radio86_8255_portb_r2) READ8_MEMBER(radio86_state::radio86_8255_portc_r2) { double level = m_cassette->input(); - UINT8 dat = m_io_line8->read(); + uint8_t dat = m_io_line8->read(); if (level < 0) { dat ^= m_tape_value; } @@ -77,7 +77,7 @@ WRITE8_MEMBER(radio86_state::radio86_8255_portc_w2) READ8_MEMBER(radio86_state::rk7007_8255_portc_r) { double level = m_cassette->input(); - UINT8 key = 0xff; + uint8_t key = 0xff; if ((m_keyboard_mask & 0x01)!=0) { key &= m_io_cline0->read(); } if ((m_keyboard_mask & 0x02)!=0) { key &= m_io_cline1->read(); } if ((m_keyboard_mask & 0x04)!=0) { key &= m_io_cline2->read(); } @@ -159,7 +159,7 @@ WRITE8_MEMBER(radio86_state::radio86_pagesel) READ8_MEMBER(radio86_state::radio86rom_romdisk_porta_r) { - UINT16 addr = (m_romdisk_msb << 8) | m_romdisk_lsb; + uint16_t addr = (m_romdisk_msb << 8) | m_romdisk_lsb; if (m_cart->exists() && addr < m_cart->get_rom_size()) return m_cart->read_rom(space, addr); else @@ -168,7 +168,7 @@ READ8_MEMBER(radio86_state::radio86rom_romdisk_porta_r) READ8_MEMBER(radio86_state::radio86ram_romdisk_porta_r) { - UINT8 *romdisk = m_region_maincpu->base() + 0x10000; + uint8_t *romdisk = m_region_maincpu->base() + 0x10000; if ((m_disk_sel & 0x0f) ==0) { return romdisk[m_romdisk_msb*256+m_romdisk_lsb]; } else { @@ -199,8 +199,8 @@ I8275_DRAW_CHARACTER_MEMBER(radio86_state::display_pixels) { int i; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - const UINT8 *charmap = m_charmap; - UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; + const uint8_t *charmap = m_charmap; + uint8_t pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; if(linecount == 8) pixels = 0; if (vsp) { diff --git a/src/mame/machine/rbisland.cpp b/src/mame/machine/rbisland.cpp index 951b97225f8..7b1baf800b9 100644 --- a/src/mame/machine/rbisland.cpp +++ b/src/mame/machine/rbisland.cpp @@ -61,11 +61,11 @@ struct CBANK { - const UINT8* data; + const uint8_t* data; size_t size; }; -static const UINT8 CROM_BANK1[] = +static const uint8_t CROM_BANK1[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x0A, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, @@ -96,7 +96,7 @@ static const UINT8 CROM_BANK1[] = 0x82, 0x86, 0x86, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A }; -static const UINT8 CROM_BANK2[] = +static const uint8_t CROM_BANK2[] = { 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, @@ -109,7 +109,7 @@ static const UINT8 CROM_BANK2[] = 0x22, 0x22 }; -static const UINT8 CROM_BANK4_WORLD0[] = +static const uint8_t CROM_BANK4_WORLD0[] = { 0x28, 0x00, 0x2C, 0x00, 0x30, 0x00, 0x34, 0x00, 0x38, 0x00, 0x3C, 0x00, 0x40, 0x00, 0x44, 0x00, 0x48, 0x00, 0x54, 0x00, 0x58, 0x00, 0x5C, 0x00, @@ -125,7 +125,7 @@ static const UINT8 CROM_BANK4_WORLD0[] = 0xC9, 0x02, 0xC8, 0x02 }; -static const UINT8 CROM_BANK4_WORLD1[] = +static const uint8_t CROM_BANK4_WORLD1[] = { 0x24, 0x00, 0x28, 0x00, 0x2C, 0x00, 0x30, 0x00, 0x34, 0x00, 0x38, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x4C, 0x00, 0x50, 0x00, 0x54, 0x00, @@ -138,7 +138,7 @@ static const UINT8 CROM_BANK4_WORLD1[] = 0x28, 0x10, 0x28, 0x10, 0x8E, 0x02, 0x90, 0x02 }; -static const UINT8 CROM_BANK4_WORLD2[] = +static const uint8_t CROM_BANK4_WORLD2[] = { 0x2A, 0x00, 0x32, 0x00, 0x3A, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4E, 0x00, 0x52, 0x00, 0x56, 0x00, 0x5A, 0x00, 0x5E, 0x00, 0x60, 0x00, 0x62, 0x00, @@ -154,7 +154,7 @@ static const UINT8 CROM_BANK4_WORLD2[] = 0xAD, 0x03, 0xAF, 0x03, 0xC1, 0x03, 0xC5, 0x03, 0xC3, 0x03 }; -static const UINT8 CROM_BANK4_WORLD3[] = +static const uint8_t CROM_BANK4_WORLD3[] = { 0x30, 0x00, 0x34, 0x00, 0x38, 0x00, 0x3C, 0x00, 0x40, 0x00, 0x44, 0x00, 0x48, 0x00, 0x4A, 0x00, 0x4C, 0x00, 0x50, 0x00, 0x54, 0x00, 0x58, 0x00, @@ -174,7 +174,7 @@ static const UINT8 CROM_BANK4_WORLD3[] = 0xDF, 0x04, 0xE0, 0x04, 0xE1, 0x04, 0xE2, 0x04, 0x12, 0x05, 0x11, 0x05 }; -static const UINT8 CROM_BANK4_WORLD4[] = +static const uint8_t CROM_BANK4_WORLD4[] = { 0x24, 0x00, 0x24, 0x00, 0x34, 0x00, 0x38, 0x00, 0x38, 0x00, 0x60, 0x00, 0x64, 0x00, 0x64, 0x00, 0x7C, 0x00, 0x80, 0x00, 0x80, 0x00, 0x90, 0x00, @@ -194,7 +194,7 @@ static const UINT8 CROM_BANK4_WORLD4[] = 0x82, 0x05 }; -static const UINT8 CROM_BANK4_WORLD5[] = +static const uint8_t CROM_BANK4_WORLD5[] = { 0x24, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, 0x00, 0x60, 0x00, 0x64, 0x00, 0x68, 0x00, @@ -211,7 +211,7 @@ static const UINT8 CROM_BANK4_WORLD5[] = 0xE5, 0x06, 0xE3, 0x06 }; -static const UINT8 CROM_BANK4_WORLD6[] = +static const uint8_t CROM_BANK4_WORLD6[] = { 0x2A, 0x00, 0x32, 0x00, 0x3A, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4E, 0x00, 0x52, 0x00, 0x5A, 0x00, 0x62, 0x00, 0x66, 0x00, 0x6A, 0x00, 0x6E, 0x00, @@ -228,7 +228,7 @@ static const UINT8 CROM_BANK4_WORLD6[] = 0xDF, 0x08, 0xE1, 0x08, 0xC7, 0x08, 0xC7, 0x08 }; -static const UINT8 CROM_BANK4_WORLD7[] = +static const uint8_t CROM_BANK4_WORLD7[] = { 0x2A, 0x00, 0x32, 0x00, 0x3A, 0x00, 0x3E, 0x00, 0x42, 0x00, 0x46, 0x00, 0x4A, 0x00, 0x4E, 0x00, 0x52, 0x00, 0x56, 0x00, 0x5E, 0x00, 0x66, 0x00, @@ -244,7 +244,7 @@ static const UINT8 CROM_BANK4_WORLD7[] = 0x9D, 0x05, 0x78, 0x10, 0x9D, 0x05 }; -static const UINT8 CROM_BANK4_WORLD8[] = +static const uint8_t CROM_BANK4_WORLD8[] = { 0x30, 0x00, 0x34, 0x00, 0x38, 0x00, 0x3C, 0x00, 0x3E, 0x00, 0x40, 0x00, 0x42, 0x00, 0x46, 0x00, 0x4A, 0x00, 0x4E, 0x00, 0x5C, 0x00, 0x6A, 0x00, @@ -262,7 +262,7 @@ static const UINT8 CROM_BANK4_WORLD8[] = 0x36, 0x0A }; -static const UINT8 CROM_BANK4_WORLD9[] = +static const uint8_t CROM_BANK4_WORLD9[] = { 0x30, 0x00, 0x34, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x68, 0x00, 0x70, 0x00, 0x78, 0x00, 0x80, 0x00, @@ -285,7 +285,7 @@ static const UINT8 CROM_BANK4_WORLD9[] = 0xFB, 0x0F, 0xFC, 0x0F, 0xDC, 0x02, 0xDD, 0x02 }; -static const UINT8 CROM_BANK5_WORLD0[] = +static const uint8_t CROM_BANK5_WORLD0[] = { 0x1C, 0x00, 0x1C, 0x00, 0x32, 0x00, 0x32, 0x00, 0x48, 0x00, 0x48, 0x00, 0xB6, 0x00, 0x5E, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x74, 0x00, 0x74, 0x00, @@ -306,7 +306,7 @@ static const UINT8 CROM_BANK5_WORLD0[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0x3C, 0x00, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD1[] = +static const uint8_t CROM_BANK5_WORLD1[] = { 0x0C, 0x00, 0x22, 0x00, 0x38, 0x00, 0x4E, 0x00, 0x64, 0x00, 0x7A, 0x00, 0x01, 0x08, 0xC4, 0x19, 0x49, 0x08, 0xC4, 0x19, 0x84, 0x08, 0xC7, 0x18, @@ -322,7 +322,7 @@ static const UINT8 CROM_BANK5_WORLD1[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0x58, 0x02, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD2[] = +static const uint8_t CROM_BANK5_WORLD2[] = { 0x0E, 0x00, 0x24, 0x00, 0x3A, 0x00, 0x50, 0x00, 0x66, 0x00, 0x7C, 0x00, 0x92, 0x00, 0x01, 0x18, 0xC7, 0x39, 0x49, 0x18, 0xC5, 0x39, 0x84, 0x08, @@ -340,7 +340,7 @@ static const UINT8 CROM_BANK5_WORLD2[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0xE0, 0x01, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD3[] = +static const uint8_t CROM_BANK5_WORLD3[] = { 0x10, 0x00, 0x26, 0x00, 0x3C, 0x00, 0x52, 0x00, 0x68, 0x00, 0x7E, 0x00, 0x94, 0x00, 0xAA, 0x00, 0x01, 0x08, 0xC1, 0x39, 0x49, 0x08, 0xC1, 0x39, @@ -360,7 +360,7 @@ static const UINT8 CROM_BANK5_WORLD3[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0x68, 0x01, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD4[] = +static const uint8_t CROM_BANK5_WORLD4[] = { 0x0C, 0x00, 0x22, 0x00, 0x38, 0x00, 0x4E, 0x00, 0x64, 0x00, 0x7A, 0x00, 0x00, 0x38, 0xC6, 0x18, 0x48, 0x38, 0xC6, 0x18, 0x84, 0x08, 0xC7, 0x18, @@ -376,7 +376,7 @@ static const UINT8 CROM_BANK5_WORLD4[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0x68, 0x01, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD5[] = +static const uint8_t CROM_BANK5_WORLD5[] = { 0x0C, 0x00, 0x22, 0x00, 0x38, 0x00, 0x4E, 0x00, 0x64, 0x00, 0x7A, 0x00, 0x01, 0x18, 0x43, 0x39, 0x49, 0x18, 0x43, 0x39, 0x85, 0x08, 0xC7, 0x18, @@ -392,7 +392,7 @@ static const UINT8 CROM_BANK5_WORLD5[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0x68, 0x01, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD6[] = +static const uint8_t CROM_BANK5_WORLD6[] = { 0x0E, 0x00, 0x24, 0x00, 0x3A, 0x00, 0x50, 0x00, 0x66, 0x00, 0x7C, 0x00, 0x92, 0x00, 0x01, 0x18, 0x45, 0x39, 0x49, 0x18, 0x43, 0x39, 0x85, 0x08, @@ -410,7 +410,7 @@ static const UINT8 CROM_BANK5_WORLD6[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0x68, 0x01, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD7[] = +static const uint8_t CROM_BANK5_WORLD7[] = { 0x0E, 0x00, 0x24, 0x00, 0x3A, 0x00, 0x50, 0x00, 0x66, 0x00, 0x7C, 0x00, 0x92, 0x00, 0x01, 0x18, 0xC5, 0x41, 0x49, 0x18, 0xC3, 0x41, 0x85, 0x08, @@ -428,7 +428,7 @@ static const UINT8 CROM_BANK5_WORLD7[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0xE0, 0x01, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD8[] = +static const uint8_t CROM_BANK5_WORLD8[] = { 0x10, 0x00, 0x26, 0x00, 0x3C, 0x00, 0x52, 0x00, 0x68, 0x00, 0x7E, 0x00, 0x94, 0x00, 0xAA, 0x00, 0x01, 0x08, 0x43, 0x49, 0x49, 0x08, 0x43, 0x49, @@ -448,7 +448,7 @@ static const UINT8 CROM_BANK5_WORLD8[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0x68, 0x01, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK5_WORLD9[] = +static const uint8_t CROM_BANK5_WORLD9[] = { 0x10, 0x00, 0x26, 0x00, 0x3C, 0x00, 0x52, 0x00, 0x68, 0x00, 0x7E, 0x00, 0x94, 0x00, 0xAA, 0x00, 0x01, 0x08, 0x03, 0x1A, 0x49, 0x08, 0x03, 0x1A, @@ -468,7 +468,7 @@ static const UINT8 CROM_BANK5_WORLD9[] = 0xC7, 0x18, 0xC3, 0x5A, 0xB7, 0x6E, 0x00, 0x05, 0x00, 0x01, 0xFF, 0xFF }; -static const UINT8 CROM_BANK6[] = +static const uint8_t CROM_BANK6[] = { 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x30, 0x05, 0x00, 0x00, @@ -499,7 +499,7 @@ static const UINT8 CROM_BANK6[] = 0x30, 0x00, 0x02, 0x11, 0x00, 0x00, 0x00, 0x00 }; -static const UINT8 CROM_BANK6_EXTRA[] = +static const uint8_t CROM_BANK6_EXTRA[] = { 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, @@ -530,16 +530,16 @@ static const UINT8 CROM_BANK6_EXTRA[] = 0x30, 0x00, 0x02, 0x11, 0x00, 0x00, 0x00, 0x00 }; -static const UINT8 CROM_BANK7_WORLD0[] = { 0x03, 0x03, 0x03, 0x03, 0x0C, 0x0C, 0x0A, 0x07, 0x0A, 0x0A, 0x08, 0x08, 0x08, 0x08 }; -static const UINT8 CROM_BANK7_WORLD1[] = { 0x03, 0x05, 0x01, 0x02, 0x04, 0x04 }; -static const UINT8 CROM_BANK7_WORLD2[] = { 0x03, 0x05, 0x07, 0x07, 0x08, 0x08, 0x01 }; -static const UINT8 CROM_BANK7_WORLD3[] = { 0x07, 0x07, 0x07, 0x08, 0x05, 0x08, 0x07, 0x0B }; -static const UINT8 CROM_BANK7_WORLD4[] = { 0x0A, 0x0B, 0x0A, 0x0A, 0x10, 0x10 }; -static const UINT8 CROM_BANK7_WORLD5[] = { 0x05, 0x08, 0x04, 0x08, 0x08, 0x07 }; -static const UINT8 CROM_BANK7_WORLD6[] = { 0x04, 0x07, 0x05, 0x08, 0x06, 0x08, 0x03 }; -static const UINT8 CROM_BANK7_WORLD7[] = { 0x07, 0x06, 0x06, 0x05, 0x08, 0x07, 0x0A }; -static const UINT8 CROM_BANK7_WORLD8[] = { 0x06, 0x05, 0x01, 0x08, 0x05, 0x05, 0x06, 0x08 }; -static const UINT8 CROM_BANK7_WORLD9[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; +static const uint8_t CROM_BANK7_WORLD0[] = { 0x03, 0x03, 0x03, 0x03, 0x0C, 0x0C, 0x0A, 0x07, 0x0A, 0x0A, 0x08, 0x08, 0x08, 0x08 }; +static const uint8_t CROM_BANK7_WORLD1[] = { 0x03, 0x05, 0x01, 0x02, 0x04, 0x04 }; +static const uint8_t CROM_BANK7_WORLD2[] = { 0x03, 0x05, 0x07, 0x07, 0x08, 0x08, 0x01 }; +static const uint8_t CROM_BANK7_WORLD3[] = { 0x07, 0x07, 0x07, 0x08, 0x05, 0x08, 0x07, 0x0B }; +static const uint8_t CROM_BANK7_WORLD4[] = { 0x0A, 0x0B, 0x0A, 0x0A, 0x10, 0x10 }; +static const uint8_t CROM_BANK7_WORLD5[] = { 0x05, 0x08, 0x04, 0x08, 0x08, 0x07 }; +static const uint8_t CROM_BANK7_WORLD6[] = { 0x04, 0x07, 0x05, 0x08, 0x06, 0x08, 0x03 }; +static const uint8_t CROM_BANK7_WORLD7[] = { 0x07, 0x06, 0x06, 0x05, 0x08, 0x07, 0x0A }; +static const uint8_t CROM_BANK7_WORLD8[] = { 0x06, 0x05, 0x01, 0x08, 0x05, 0x05, 0x06, 0x08 }; +static const uint8_t CROM_BANK7_WORLD9[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; static const struct CBANK CROM_BANK4[] = { @@ -589,7 +589,7 @@ static const struct CBANK CROM_BANK7[] = * *************************************/ -static const UINT16 cchip_extra_patch[][8] = +static const uint16_t cchip_extra_patch[][8] = { { 0x0168, 0x0078, 0x0168, 0x0168, 0x0168, 0x02D0, 0x0168, 0x003C }, { 0x0258, 0x0258, 0x0258, 0x0258, 0x0258, 0x0258, 0x0000, 0x0000 }, @@ -603,7 +603,7 @@ static const UINT16 cchip_extra_patch[][8] = { 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500 } }; -static const UINT8 cchip_goalin[15][6] = +static const uint8_t cchip_goalin[15][6] = { { 0x00, 0x00, 0x28, 0x28, 0x50, 0x50 }, { 0x00, 0x00, 0x00, 0x00, 0x50, 0x50 }, @@ -622,7 +622,7 @@ static const UINT8 cchip_goalin[15][6] = { 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 } }; -static const UINT16 cchip_round_height[] = +static const uint16_t cchip_round_height[] = { 0x02DC, 0x03B4, 0x0444, 0x04BC, 0x03B4, 0x0444, 0x05DC, 0x050C, 0x0594, 0x06B4, 0x06B4, 0x0894, 0x065C, 0x06CC, 0x07BC, 0x08BC, @@ -633,7 +633,7 @@ static const UINT16 cchip_round_height[] = 0x0999, 0x0999 }; -static const UINT32 cchip_round_address[] = +static const uint32_t cchip_round_address[] = { 0x030000, 0x030360, 0x030798, 0x030CA8, 0x0311B8, 0x0315F0, 0x031B00, 0x0321C0, 0x032880, 0x032E68, 0x033600, 0x033D98, 0x0347B8, 0x034E78, 0x035610, 0x035E80, @@ -672,7 +672,7 @@ void rbisland_state::request_world_data( ) if (m_extra_version) { - static const UINT8 world_swap[] = + static const uint8_t world_swap[] = { 8, 7, 6, 4, 0, 2, 3, 5, 1, 9 }; @@ -694,7 +694,7 @@ void rbisland_state::request_world_data( ) for (i = 0; i < 8; i++) { - UINT16 patch = cchip_extra_patch[world][i]; + uint16_t patch = cchip_extra_patch[world][i]; if (patch != 0) { @@ -821,7 +821,7 @@ void rbisland_state::rbisland_cchip_init( int version ) for (i = 0; i < 8; i++) { - m_CRAM[i] = std::make_unique(0x400); + m_CRAM[i] = std::make_unique(0x400); save_pointer(m_CRAM[i].get(), "cchip/m_CRAM[i]", 0x400, i); } diff --git a/src/mame/machine/rm380z.cpp b/src/mame/machine/rm380z.cpp index 68636e54262..47209eeee98 100644 --- a/src/mame/machine/rm380z.cpp +++ b/src/mame/machine/rm380z.cpp @@ -74,7 +74,7 @@ WRITE8_MEMBER( rm380z_state::port_write ) READ8_MEMBER( rm380z_state::port_read ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; switch ( offset ) { @@ -261,8 +261,8 @@ void rm380z_state::machine_reset() void rm380z_state::config_memory_map() { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *rom = memregion(RM380Z_MAINCPU_TAG)->base(); - UINT8* m_ram_p = m_messram->pointer(); + uint8_t *rom = memregion(RM380Z_MAINCPU_TAG)->base(); + uint8_t* m_ram_p = m_messram->pointer(); if ( RM380Z_PORTS_ENABLED_HIGH ) { diff --git a/src/mame/machine/rmnimbus.cpp b/src/mame/machine/rmnimbus.cpp index ba7342a06db..e4824cd2faa 100644 --- a/src/mame/machine/rmnimbus.cpp +++ b/src/mame/machine/rmnimbus.cpp @@ -144,48 +144,48 @@ enum struct t_area_params { - UINT16 ofs_brush; - UINT16 seg_brush; - UINT16 ofs_data; - UINT16 seg_data; - UINT16 count; + uint16_t ofs_brush; + uint16_t seg_brush; + uint16_t ofs_data; + uint16_t seg_data; + uint16_t count; }; struct t_plot_string_params { - UINT16 ofs_font; - UINT16 seg_font; - UINT16 ofs_data; - UINT16 seg_data; - UINT16 x; - UINT16 y; - UINT16 length; + uint16_t ofs_font; + uint16_t seg_font; + uint16_t ofs_data; + uint16_t seg_data; + uint16_t x; + uint16_t y; + uint16_t length; }; struct t_nimbus_brush { - UINT16 style; - UINT16 style_index; - UINT16 colour1; - UINT16 colour2; - UINT16 transparency; - UINT16 boundary_spec; - UINT16 boundary_colour; - UINT16 save_colour; + uint16_t style; + uint16_t style_index; + uint16_t colour1; + uint16_t colour2; + uint16_t transparency; + uint16_t boundary_spec; + uint16_t boundary_colour; + uint16_t save_colour; }; static int instruction_hook(device_t &device, offs_t curpc); -static void decode_subbios(device_t *device,offs_t pc, UINT8 raw_flag); +static void decode_subbios(device_t *device,offs_t pc, uint8_t raw_flag); static void decode_dos21(device_t *device,offs_t pc); -static void decode_dssi_generic(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag); -static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag); -static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag); -static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag); -static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag); -static void decode_dssi_f_rw_sectors(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag); +static void decode_dssi_generic(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag); +static void decode_dssi_f_fill_area(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag); +static void decode_dssi_f_plot_character_string(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag); +static void decode_dssi_f_set_new_clt(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag); +static void decode_dssi_f_plonk_char(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag); +static void decode_dssi_f_rw_sectors(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag); -void rmnimbus_state::external_int(UINT8 vector, bool state) +void rmnimbus_state::external_int(uint8_t vector, bool state) { if(!state && (vector != m_vector)) return; @@ -264,9 +264,9 @@ static int instruction_hook(device_t &device, offs_t curpc) { rmnimbus_state *state = device.machine().driver_data(); address_space &space = device.memory().space(AS_PROGRAM); - UINT8 *addr_ptr; + uint8_t *addr_ptr; - addr_ptr = (UINT8*)space.get_read_ptr(curpc); + addr_ptr = (uint8_t*)space.get_read_ptr(curpc); if ((addr_ptr !=nullptr) && (addr_ptr[0]==0xCD)) { @@ -289,21 +289,21 @@ static int instruction_hook(device_t &device, offs_t curpc) #define set_drv(drv_name) sprintf(drv_str,drv_name) #define set_func(func_name) sprintf(func_str,func_name) -static void decode_subbios(device_t *device,offs_t pc, UINT8 raw_flag) +static void decode_subbios(device_t *device,offs_t pc, uint8_t raw_flag) { char type_str[80]; char drv_str[80]; char func_str[80]; - void (*dump_dssi)(device_t *,UINT16, UINT16 ,UINT8) = nullptr; + void (*dump_dssi)(device_t *,uint16_t, uint16_t ,uint8_t) = nullptr; device_t *cpu = device->machine().device(MAINCPU_TAG); - UINT16 ax = cpu->state().state_int(I8086_AX); - UINT16 bx = cpu->state().state_int(I8086_BX); - UINT16 cx = cpu->state().state_int(I8086_CX); - UINT16 ds = cpu->state().state_int(I8086_DS); - UINT16 si = cpu->state().state_int(I8086_SI); + uint16_t ax = cpu->state().state_int(I8086_AX); + uint16_t bx = cpu->state().state_int(I8086_BX); + uint16_t cx = cpu->state().state_int(I8086_CX); + uint16_t ds = cpu->state().state_int(I8086_DS); + uint16_t si = cpu->state().state_int(I8086_SI); // *** TEMP Don't show f_enquire_display_line calls ! if((cx==6) && (ax==43)) @@ -629,7 +629,7 @@ static void decode_subbios(device_t *device,offs_t pc, UINT8 raw_flag) } } -static inline void *get_dssi_ptr(address_space &space, UINT16 ds, UINT16 si) +static inline void *get_dssi_ptr(address_space &space, uint16_t ds, uint16_t si) { int addr; @@ -639,17 +639,17 @@ static inline void *get_dssi_ptr(address_space &space, UINT16 ds, UINT16 si) return space.get_read_ptr(addr); } -static void decode_dssi_generic(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) +static void decode_dssi_generic(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag) { rmnimbus_state *state = device->machine().driver_data(); address_space &space = state->m_maincpu->space(AS_PROGRAM); - UINT16 *params; + uint16_t *params; int count; if(raw_flag) return; - params=(UINT16 *)get_dssi_ptr(space,ds,si); + params=(uint16_t *)get_dssi_ptr(space,ds,si); for(count=0; count<10; count++) device->logerror("%04X ",params[count]); @@ -658,12 +658,12 @@ static void decode_dssi_generic(device_t *device,UINT16 ds, UINT16 si, UINT8 ra } -static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) +static void decode_dssi_f_fill_area(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag) { rmnimbus_state *state = device->machine().driver_data(); address_space &space = state->m_maincpu->space(AS_PROGRAM); - UINT16 *addr_ptr; + uint16_t *addr_ptr; t_area_params *area_params; t_nimbus_brush *brush; int cocount; @@ -694,7 +694,7 @@ static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT OUTPUT_SEGOFS("SegData:OfsData",area_params->seg_data,area_params->ofs_data); } - addr_ptr = (UINT16 *)space.get_read_ptr(LINEAR_ADDR(area_params->seg_data,area_params->ofs_data)); + addr_ptr = (uint16_t *)space.get_read_ptr(LINEAR_ADDR(area_params->seg_data,area_params->ofs_data)); for(cocount=0; cocount < area_params->count; cocount++) { if(raw_flag) @@ -712,12 +712,12 @@ static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT device->logerror("\n"); } -static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) +static void decode_dssi_f_plot_character_string(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag) { rmnimbus_state *state = device->machine().driver_data(); address_space &space = state->m_maincpu->space(AS_PROGRAM); - UINT8 *char_ptr; + uint8_t *char_ptr; t_plot_string_params *plot_string_params; int charno; @@ -731,7 +731,7 @@ static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UIN device->logerror("x=%d, y=%d, length=%d\n",plot_string_params->x,plot_string_params->y,plot_string_params->length); - char_ptr=(UINT8*)space.get_read_ptr(LINEAR_ADDR(plot_string_params->seg_data,plot_string_params->ofs_data)); + char_ptr=(uint8_t*)space.get_read_ptr(LINEAR_ADDR(plot_string_params->seg_data,plot_string_params->ofs_data)); if (plot_string_params->length==0xFFFF) device->logerror("%s",char_ptr); @@ -742,13 +742,13 @@ static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UIN device->logerror("\n"); } -static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) +static void decode_dssi_f_set_new_clt(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag) { rmnimbus_state *state = device->machine().driver_data(); address_space &space = state->m_maincpu->space(AS_PROGRAM); - UINT16 *new_colours; + uint16_t *new_colours; int colour; - new_colours=(UINT16 *)get_dssi_ptr(space,ds,si); + new_colours=(uint16_t *)get_dssi_ptr(space,ds,si); if(raw_flag) return; @@ -760,12 +760,12 @@ static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si, UI } -static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) +static void decode_dssi_f_plonk_char(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag) { rmnimbus_state *state = device->machine().driver_data(); address_space &space = state->m_maincpu->space(AS_PROGRAM); - UINT16 *params; - params=(UINT16 *)get_dssi_ptr(space,ds,si); + uint16_t *params; + params=(uint16_t *)get_dssi_ptr(space,ds,si); if(raw_flag) return; @@ -775,17 +775,17 @@ static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UIN device->logerror("plonked_char=%c\n",params[0]); } -static void decode_dssi_f_rw_sectors(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) +static void decode_dssi_f_rw_sectors(device_t *device,uint16_t ds, uint16_t si, uint8_t raw_flag) { rmnimbus_state *state = device->machine().driver_data(); address_space &space = state->m_maincpu->space(AS_PROGRAM); - UINT16 *params; + uint16_t *params; int param_no; if(raw_flag) return; - params=(UINT16 *)get_dssi_ptr(space,ds,si); + params=(uint16_t *)get_dssi_ptr(space,ds,si); for(param_no=0;param_no<16;param_no++) device->logerror("%04X ",params[param_no]); @@ -797,18 +797,18 @@ static void decode_dos21(device_t *device,offs_t pc) { device_t *cpu = device->machine().device(MAINCPU_TAG); - UINT16 ax = cpu->state().state_int(I8086_AX); - UINT16 bx = cpu->state().state_int(I8086_BX); - UINT16 cx = cpu->state().state_int(I8086_CX); - UINT16 dx = cpu->state().state_int(I8086_DX); - UINT16 cs = cpu->state().state_int(I8086_CS); - UINT16 ds = cpu->state().state_int(I8086_DS); - UINT16 es = cpu->state().state_int(I8086_ES); - UINT16 ss = cpu->state().state_int(I8086_SS); + uint16_t ax = cpu->state().state_int(I8086_AX); + uint16_t bx = cpu->state().state_int(I8086_BX); + uint16_t cx = cpu->state().state_int(I8086_CX); + uint16_t dx = cpu->state().state_int(I8086_DX); + uint16_t cs = cpu->state().state_int(I8086_CS); + uint16_t ds = cpu->state().state_int(I8086_DS); + uint16_t es = cpu->state().state_int(I8086_ES); + uint16_t ss = cpu->state().state_int(I8086_SS); - UINT16 si = cpu->state().state_int(I8086_SI); - UINT16 di = cpu->state().state_int(I8086_DI); - UINT16 bp = cpu->state().state_int(I8086_BP); + uint16_t si = cpu->state().state_int(I8086_SI); + uint16_t di = cpu->state().state_int(I8086_DI); + uint16_t bp = cpu->state().state_int(I8086_BP); device->logerror("=======================================================================\n"); device->logerror("DOS Int 0x21 call at %05X\n",pc); @@ -915,13 +915,13 @@ void rmnimbus_state::nimbus_bank_memory() int ramblock = 0; int blockno; char bank[10]; - UINT8 *ram = &m_ram->pointer()[0]; - UINT8 *map_blocks[3]; - UINT8 *map_base; + uint8_t *ram = &m_ram->pointer()[0]; + uint8_t *map_blocks[3]; + uint8_t *map_base; int map_blockno; int block_ofs; - UINT8 ramsel = (m_mcu_reg080 & 0x1F); + uint8_t ramsel = (m_mcu_reg080 & 0x1F); // Invalid ramsel, return. if((ramsel & 0x07)!=0x07) @@ -1039,7 +1039,7 @@ WRITE_LINE_MEMBER(rmnimbus_state::nimbus_fdc_drq_w) m_maincpu->drq1_w(state && FDC_DRQ_ENABLED()); } -UINT8 rmnimbus_state::fdc_driveno(UINT8 drivesel) +uint8_t rmnimbus_state::fdc_driveno(uint8_t drivesel) { switch (drivesel) { @@ -1121,7 +1121,7 @@ READ8_MEMBER(rmnimbus_state::scsi_r) */ WRITE8_MEMBER(rmnimbus_state::fdc_ctl_w) { - UINT8 reg400_old = m_nimbus_drives.reg400; + uint8_t reg400_old = m_nimbus_drives.reg400; char drive[5]; floppy_image_device *floppy; @@ -1272,7 +1272,7 @@ void rmnimbus_state::ipc_dumpregs() READ8_MEMBER(rmnimbus_state::nimbus_pc8031_r) { int pc=space.device().safe_pc(); - UINT8 result; + uint8_t result; switch(offset*2) { @@ -1322,7 +1322,7 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_pc8031_w) READ8_MEMBER(rmnimbus_state::nimbus_pc8031_iou_r) { int pc=space.device().safe_pc(); - UINT8 result = 0; + uint8_t result = 0; switch (offset & 0x01) { @@ -1386,7 +1386,7 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_pc8031_iou_w) READ8_MEMBER(rmnimbus_state::nimbus_pc8031_port_r) { int pc=space.device().safe_pc(); - UINT8 result = 0; + uint8_t result = 0; if(LOG_PC8031_PORT) logerror("8031: PCPORTR %04X read of %04X returns %02X\n",pc,offset,result); @@ -1435,7 +1435,7 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_pc8031_port_w) READ8_MEMBER(rmnimbus_state::nimbus_iou_r) { int pc=space.device().safe_pc(); - UINT8 result=0; + uint8_t result=0; if(offset==0) { @@ -1539,12 +1539,12 @@ void rmnimbus_state::mouse_js_reset() void rmnimbus_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - UINT8 x = 0; - UINT8 y = 0; + uint8_t x = 0; + uint8_t y = 0; // int pc=m_maincpu->pc(); - UINT8 intstate_x; - UINT8 intstate_y; + uint8_t intstate_x; + uint8_t intstate_y; int xint; int yint; @@ -1552,10 +1552,10 @@ void rmnimbus_state::device_timer(emu_timer &timer, device_timer_id id, int para x = m_io_mousex->read(); y = m_io_mousey->read(); - UINT8 mxa; - UINT8 mxb; - UINT8 mya; - UINT8 myb; + uint8_t mxa; + uint8_t mxb; + uint8_t mya; + uint8_t myb; //logerror("poll_mouse()\n"); @@ -1682,7 +1682,7 @@ READ8_MEMBER(rmnimbus_state::nimbus_mouse_js_r) 7 ?? always reads 1 */ - UINT8 result; + uint8_t result; //int pc=m_maincpu->_pc(); if (m_io_config->read() & 0x01) diff --git a/src/mame/machine/rmnkbd.cpp b/src/mame/machine/rmnkbd.cpp index 71d73fe3a7d..f12f4aea91f 100644 --- a/src/mame/machine/rmnkbd.cpp +++ b/src/mame/machine/rmnkbd.cpp @@ -117,7 +117,7 @@ INPUT_PORTS_END } // anonymous namespace -rmnimbus_keyboard_device::rmnimbus_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) +rmnimbus_keyboard_device::rmnimbus_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : buffered_rs232_device(mconfig, RMNIMBUS_KEYBOARD, "RM Nimbus Keyboard", tag, owner, 0, "rmnimbus_keyboard", __FILE__) , device_matrix_keyboard_interface(mconfig, *this, "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9", "LINEA") { @@ -158,19 +158,19 @@ void rmnimbus_keyboard_device::device_timer(emu_timer &timer, device_timer_id id } -void rmnimbus_keyboard_device::key_make(UINT8 row, UINT8 column) +void rmnimbus_keyboard_device::key_make(uint8_t row, uint8_t column) { transmit_byte((row << 3) | column); } -void rmnimbus_keyboard_device::key_break(UINT8 row, UINT8 column) +void rmnimbus_keyboard_device::key_break(uint8_t row, uint8_t column) { transmit_byte(0x80U | (row << 3) | column); } -void rmnimbus_keyboard_device::received_byte(UINT8 byte) +void rmnimbus_keyboard_device::received_byte(uint8_t byte) { logerror("received command %02x", byte); } diff --git a/src/mame/machine/rmnkbd.h b/src/mame/machine/rmnkbd.h index 01cbce7f7ea..7398cf0d211 100644 --- a/src/mame/machine/rmnkbd.h +++ b/src/mame/machine/rmnkbd.h @@ -9,17 +9,17 @@ class rmnimbus_keyboard_device : public buffered_rs232_device<16U>, protected device_matrix_keyboard_interface<11U> { public: - rmnimbus_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rmnimbus_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void key_make(UINT8 row, UINT8 column) override; - virtual void key_break(UINT8 row, UINT8 column) override; + virtual void key_make(uint8_t row, uint8_t column) override; + virtual void key_break(uint8_t row, uint8_t column) override; private: - virtual void received_byte(UINT8 byte) override; + virtual void received_byte(uint8_t byte) override; }; extern const device_type RMNIMBUS_KEYBOARD; diff --git a/src/mame/machine/rx01.cpp b/src/mame/machine/rx01.cpp index 75b4edb0eab..263e7f94a37 100644 --- a/src/mame/machine/rx01.cpp +++ b/src/mame/machine/rx01.cpp @@ -48,7 +48,7 @@ const device_type RX01 = &device_creator; // rx01_device - constructor //------------------------------------------------- -rx01_device::rx01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rx01_device::rx01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RX01, "RX01", tag, owner, clock, "rx01", __FILE__) { } @@ -117,7 +117,7 @@ WRITE16_MEMBER( rx01_device::write ) } } -void rx01_device::command_write(UINT16 data) +void rx01_device::command_write(uint16_t data) { printf("command_write %04x\n",data); m_unit = BIT(data,4); @@ -166,13 +166,13 @@ void rx01_device::command_write(UINT16 data) machine().scheduler().timer_set(attotime::from_msec(100), timer_expired_delegate(FUNC(rx01_device::service_command),this)); } -UINT16 rx01_device::status_read() +uint16_t rx01_device::status_read() { //printf("status_read %04x\n",m_rxcs); return m_rxcs; } -void rx01_device::data_write(UINT16 data) +void rx01_device::data_write(uint16_t data) { // printf("data_write %04x\n",data); // data can be written only if TR is set @@ -180,7 +180,7 @@ void rx01_device::data_write(UINT16 data) machine().scheduler().timer_set(attotime::from_msec(100), timer_expired_delegate(FUNC(rx01_device::service_command),this)); } -UINT16 rx01_device::data_read() +uint16_t rx01_device::data_read() { if (m_state==RX01_EMPTY && BIT(m_rxcs,7)) m_rxcs &= (1<<7); // clear TR bit; // printf("data_read %04x\n",m_rxdb); diff --git a/src/mame/machine/rx01.h b/src/mame/machine/rx01.h index 386a7d983fd..81bebf2bac9 100644 --- a/src/mame/machine/rx01.h +++ b/src/mame/machine/rx01.h @@ -30,7 +30,7 @@ class rx01_device : public device_t { public: // construction/destruction - rx01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rx01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( read ); DECLARE_WRITE16_MEMBER( write ); @@ -42,11 +42,11 @@ protected: virtual void device_start() override; virtual void device_reset() override; - void command_write(UINT16 data); - UINT16 status_read(); + void command_write(uint16_t data); + uint16_t status_read(); - void data_write(UINT16 data); - UINT16 data_read(); + void data_write(uint16_t data); + uint16_t data_read(); TIMER_CALLBACK_MEMBER(service_command); @@ -65,14 +65,14 @@ private: }; legacy_floppy_image_device *m_image[2]; - UINT8 m_buffer[128]; + uint8_t m_buffer[128]; int m_buf_pos; - UINT16 m_rxcs; // Command and Status Register - UINT16 m_rxdb; // Data Buffer Register - UINT16 m_rxta; // RX Track Address - UINT16 m_rxsa; // RX Sector Address - UINT16 m_rxes; // RX Error and Status + uint16_t m_rxcs; // Command and Status Register + uint16_t m_rxdb; // Data Buffer Register + uint16_t m_rxta; // RX Track Address + uint16_t m_rxsa; // RX Sector Address + uint16_t m_rxes; // RX Error and Status int m_unit; int m_interrupt; rx01_state m_state; diff --git a/src/mame/machine/s32comm.cpp b/src/mame/machine/s32comm.cpp index ef958624d03..793f3600187 100644 --- a/src/mame/machine/s32comm.cpp +++ b/src/mame/machine/s32comm.cpp @@ -99,7 +99,7 @@ machine_config_constructor s32comm_device::device_mconfig_additions() const // s32comm_device - constructor //------------------------------------------------- -s32comm_device::s32comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s32comm_device::s32comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S32COMM, "SYSTEM32 COMMUNICATION BD", tag, owner, clock, "s32comm", __FILE__), m_line_rx(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE ), m_line_tx(OPEN_FLAG_READ) @@ -140,7 +140,7 @@ void s32comm_device::device_reset() READ8_MEMBER(s32comm_device::zfg_r) { - UINT8 result = m_zfg | 0xFE; + uint8_t result = m_zfg | 0xFE; #ifdef __S32COMM_VERBOSE__ osd_printf_verbose("s32comm-zfg_r: read register %02x for value %02x\n", offset, result); #endif @@ -157,7 +157,7 @@ WRITE8_MEMBER(s32comm_device::zfg_w) READ8_MEMBER(s32comm_device::share_r) { - UINT8 result = m_shared[offset]; + uint8_t result = m_shared[offset]; #ifdef __S32COMM_VERBOSE__ osd_printf_verbose("s32comm-share_r: read shared memory %02x for value %02x\n", offset, result); #endif @@ -228,7 +228,7 @@ void s32comm_device::check_vint_irq() } #ifdef __S32COMM_SIMULATION__ -void s32comm_device::set_linktype(UINT16 linktype) +void s32comm_device::set_linktype(uint16_t linktype) { m_linktype = linktype; diff --git a/src/mame/machine/s32comm.h b/src/mame/machine/s32comm.h index 9c0ef0eae88..ffd82ffafa4 100644 --- a/src/mame/machine/s32comm.h +++ b/src/mame/machine/s32comm.h @@ -18,7 +18,7 @@ class s32comm_device : public device_t { public: // construction/destruction - s32comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s32comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -46,7 +46,7 @@ public: // IRQ logic - 5 = VINT, 7 = DLC void check_vint_irq(); #ifdef __S32COMM_SIMULATION__ - void set_linktype(UINT16 linktype); + void set_linktype(uint16_t linktype); #endif protected: @@ -55,25 +55,25 @@ protected: virtual void device_reset() override; private: - UINT8 m_shared[0x800]; // 2k shared memory - UINT8 m_zfg; // z80 flip gate? purpose unknown, bit0 is stored - UINT8 m_cn; // bit0 is used to enable/disable the comm board - UINT8 m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 + uint8_t m_shared[0x800]; // 2k shared memory + uint8_t m_zfg; // z80 flip gate? purpose unknown, bit0 is stored + uint8_t m_cn; // bit0 is used to enable/disable the comm board + uint8_t m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink emu_file m_line_tx; // tx line - is differential, simple serial and toslink char m_localhost[256]; char m_remotehost[256]; - UINT8 m_buffer[0x800]; + uint8_t m_buffer[0x800]; #ifdef __S32COMM_SIMULATION__ - UINT8 m_linkenable; - UINT16 m_linktimer; - UINT8 m_linkalive; - UINT8 m_linkid; - UINT8 m_linkcount; + uint8_t m_linkenable; + uint16_t m_linktimer; + uint8_t m_linkalive; + uint8_t m_linkid; + uint8_t m_linkcount; - UINT16 m_linktype; + uint16_t m_linktype; void comm_tick(); diff --git a/src/mame/machine/samcoupe.cpp b/src/mame/machine/samcoupe.cpp index f538a4909b9..a8a62c357d7 100644 --- a/src/mame/machine/samcoupe.cpp +++ b/src/mame/machine/samcoupe.cpp @@ -81,7 +81,7 @@ WRITE8_MEMBER(samcoupe_state::sam_bank4_w) sam_bank_write_ptr[3][offset] = data; } -void samcoupe_state::samcoupe_update_bank(address_space &space, int bank_num, UINT8 *memory, int is_readonly) +void samcoupe_state::samcoupe_update_bank(address_space &space, int bank_num, uint8_t *memory, int is_readonly) { sam_bank_read_ptr[bank_num-1] = memory; if (!is_readonly) @@ -111,7 +111,7 @@ void samcoupe_state::samcoupe_update_bank(address_space &space, int bank_num, UI void samcoupe_state::samcoupe_install_ext_mem(address_space &space) { - UINT8 *mem; + uint8_t *mem; /* bank 3 */ if (m_lext >> 6 < m_ram->size() >> 20) @@ -134,8 +134,8 @@ void samcoupe_state::samcoupe_install_ext_mem(address_space &space) void samcoupe_state::samcoupe_update_memory(address_space &space) { const int page_mask = ((m_ram->size() & 0xfffff) / 0x4000) - 1; - UINT8 *rom = m_region_maincpu->base(); - UINT8 *memory; + uint8_t *rom = m_region_maincpu->base(); + uint8_t *memory; int is_readonly; /* BANK1 */ @@ -246,9 +246,9 @@ TIMER_CALLBACK_MEMBER(samcoupe_state::samcoupe_mouse_reset) m_mouse_index = 0; } -UINT8 samcoupe_state::samcoupe_mouse_r() +uint8_t samcoupe_state::samcoupe_mouse_r() { - UINT8 result; + uint8_t result; /* on a read, reset the timer */ m_mouse_reset->adjust(attotime::from_usec(50)); diff --git a/src/mame/machine/saturn.cpp b/src/mame/machine/saturn.cpp index 16f69fbdc96..85aae0cbb1b 100644 --- a/src/mame/machine/saturn.cpp +++ b/src/mame/machine/saturn.cpp @@ -181,7 +181,7 @@ DMA TODO: #define WORK_RAM_H(var) (var & 0x07000000) == 0x06000000 #define SOUND_RAM(_lv_) ((scu_##_lv_ & 0x07ffffff) >= 0x05a00000) && ((scu_##_lv_ & 0x07ffffff) <= 0x05afffff) -void saturn_state::scu_do_transfer(UINT8 event) +void saturn_state::scu_do_transfer(uint8_t event) { address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); int i; @@ -225,7 +225,7 @@ void saturn_state::scu_test_pending_irq() READ32_MEMBER(saturn_state::saturn_scu_r) { - UINT32 res; + uint32_t res; /*TODO: write only registers must return 0 or open bus */ switch(offset) @@ -382,9 +382,9 @@ TIMER_CALLBACK_MEMBER(saturn_state::dma_lv2_ended) DnMV_0(2); } -void saturn_state::scu_single_transfer(address_space &space, UINT32 src, UINT32 dst,UINT8 *src_shift) +void saturn_state::scu_single_transfer(address_space &space, uint32_t src, uint32_t dst,uint8_t *src_shift) { - UINT32 src_data; + uint32_t src_data; if(src & 1) { @@ -401,10 +401,10 @@ void saturn_state::scu_single_transfer(address_space &space, UINT32 src, UINT32 *src_shift ^= 1; } -void saturn_state::scu_dma_direct(address_space &space, UINT8 dma_ch) +void saturn_state::scu_dma_direct(address_space &space, uint8_t dma_ch) { - UINT32 tmp_src,tmp_dst,total_size; - UINT8 cd_transfer_flag; + uint32_t tmp_src,tmp_dst,total_size; + uint8_t cd_transfer_flag; if(m_scu.src_add[dma_ch] == 0 || (m_scu.dst_add[dma_ch] != 2 && m_scu.dst_add[dma_ch] != 4)) { @@ -459,7 +459,7 @@ void saturn_state::scu_dma_direct(address_space &space, UINT8 dma_ch) else { int i; - UINT8 src_shift; + uint8_t src_shift; src_shift = ((m_scu.src[dma_ch] & 2) >> 1) ^ 1; @@ -491,15 +491,15 @@ void saturn_state::scu_dma_direct(address_space &space, UINT8 dma_ch) } } -void saturn_state::scu_dma_indirect(address_space &space,UINT8 dma_ch) +void saturn_state::scu_dma_indirect(address_space &space,uint8_t dma_ch) { /*Helper to get out of the cycle*/ - UINT8 job_done = 0; + uint8_t job_done = 0; /*temporary storage for the transfer data*/ - UINT32 tmp_src; - UINT32 indirect_src,indirect_dst; - INT32 indirect_size; - UINT32 total_size = 0; + uint32_t tmp_src; + uint32_t indirect_src,indirect_dst; + int32_t indirect_size; + uint32_t total_size = 0; DnMV_1(dma_ch); @@ -531,7 +531,7 @@ void saturn_state::scu_dma_indirect(address_space &space,UINT8 dma_ch) { int i; - UINT8 src_shift; + uint8_t src_shift; src_shift = ((indirect_src & 2) >> 1) ^ 1; @@ -675,7 +675,7 @@ void saturn_state::scu_reset(void) TIMER_CALLBACK_MEMBER(saturn_state::stv_rtc_increment) { - static const UINT8 dpm[12] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; + static const uint8_t dpm[12] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; static int year_num, year_count; /* diff --git a/src/mame/machine/scramble.cpp b/src/mame/machine/scramble.cpp index 820d82399a8..5fffd91625c 100644 --- a/src/mame/machine/scramble.cpp +++ b/src/mame/machine/scramble.cpp @@ -25,7 +25,7 @@ MACHINE_RESET_MEMBER(scramble_state,scramble) MACHINE_RESET_MEMBER(scramble_state,explorer) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); RAM[0x47ff] = 0; /* If not set, it doesn't reset after the 1st time */ MACHINE_RESET_CALL_MEMBER(galaxold); @@ -34,7 +34,7 @@ MACHINE_RESET_MEMBER(scramble_state,explorer) CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_custom_r) { - static const UINT8 remap[] = {0x03, 0x02, 0x00, 0x01, 0x21, 0x20, 0x22, 0x23, + static const uint8_t remap[] = {0x03, 0x02, 0x00, 0x01, 0x21, 0x20, 0x22, 0x23, 0x33, 0x32, 0x30, 0x31, 0x11, 0x10, 0x12, 0x13, 0x17, 0x16, 0x14, 0x15, 0x35, 0x34, 0x36, 0x37, 0x3f, 0x3e, 0x3c, 0x3d, 0x1d, 0x1c, 0x1e, 0x1f, @@ -42,7 +42,7 @@ CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_custom_r) 0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b, 0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f, 0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 }; - UINT8 val = ioport((const char *)param)->read(); + uint8_t val = ioport((const char *)param)->read(); return remap[val >> 2]; } @@ -178,7 +178,7 @@ DRIVER_INIT_MEMBER(scramble_state,mariner) DRIVER_INIT_MEMBER(scramble_state,frogger) { offs_t A; - UINT8 *ROM; + uint8_t *ROM; /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */ ROM = memregion("audiocpu")->base(); @@ -194,7 +194,7 @@ DRIVER_INIT_MEMBER(scramble_state,frogger) DRIVER_INIT_MEMBER(scramble_state,froggers) { offs_t A; - UINT8 *ROM; + uint8_t *ROM; /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */ ROM = memregion("audiocpu")->base(); @@ -206,7 +206,7 @@ DRIVER_INIT_MEMBER(scramble_state,froggers) DRIVER_INIT_MEMBER(scramble_state,devilfsh) { offs_t i; - UINT8 *RAM; + uint8_t *RAM; /* Address lines are scrambled on the main CPU */ @@ -219,7 +219,7 @@ DRIVER_INIT_MEMBER(scramble_state,devilfsh) for (i = 0; i < 0x10000; i += 16) { offs_t j; - UINT8 swapbuffer[16]; + uint8_t swapbuffer[16]; for (j = 0; j < 16; j++) { @@ -246,7 +246,7 @@ DRIVER_INIT_MEMBER(scramble_state,hotshock) DRIVER_INIT_MEMBER(scramble_state,cavelon) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* banked ROM */ m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1"); @@ -271,7 +271,7 @@ DRIVER_INIT_MEMBER(scramble_state,darkplnt) DRIVER_INIT_MEMBER(scramble_state,mimonkey) { - static const UINT8 xortable[16][16] = + static const uint8_t xortable[16][16] = { { 0x03,0x03,0x05,0x07,0x85,0x00,0x85,0x85,0x80,0x80,0x06,0x03,0x03,0x00,0x00,0x81 }, { 0x83,0x87,0x03,0x87,0x06,0x00,0x06,0x04,0x02,0x00,0x84,0x84,0x04,0x00,0x01,0x83 }, @@ -291,7 +291,7 @@ DRIVER_INIT_MEMBER(scramble_state,mimonkey) { 0x80,0x87,0x81,0x87,0x83,0x00,0x84,0x01,0x01,0x86,0x86,0x80,0x86,0x00,0x86,0x86 } }; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int A, ctr = 0, line, col; for( A = 0; A < 0x4000; A++ ) @@ -325,8 +325,8 @@ inline int scramble_state::bit(int i,int n) DRIVER_INIT_MEMBER(scramble_state,anteater) { offs_t i, len; - UINT8 *RAM; - UINT8 *scratch; + uint8_t *RAM; + uint8_t *scratch; DRIVER_INIT_CALL(scobra); @@ -339,7 +339,7 @@ DRIVER_INIT_MEMBER(scramble_state,anteater) RAM = memregion("gfx1")->base(); len = memregion("gfx1")->bytes(); - scratch = alloc_array_or_die(UINT8, len); + scratch = alloc_array_or_die(uint8_t, len); memcpy(scratch, RAM, len); @@ -363,7 +363,7 @@ DRIVER_INIT_MEMBER(scramble_state,anteater) DRIVER_INIT_MEMBER(scramble_state,rescue) { offs_t i, len; - UINT8 *RAM; + uint8_t *RAM; DRIVER_INIT_CALL(scobra); @@ -376,7 +376,7 @@ DRIVER_INIT_MEMBER(scramble_state,rescue) RAM = memregion("gfx1")->base(); len = memregion("gfx1")->bytes(); - std::vector scratch(len); + std::vector scratch(len); memcpy(&scratch[0], RAM, len); @@ -397,7 +397,7 @@ DRIVER_INIT_MEMBER(scramble_state,rescue) DRIVER_INIT_MEMBER(scramble_state,minefld) { offs_t i, len; - UINT8 *RAM; + uint8_t *RAM; DRIVER_INIT_CALL(scobra); @@ -409,7 +409,7 @@ DRIVER_INIT_MEMBER(scramble_state,minefld) RAM = memregion("gfx1")->base(); len = memregion("gfx1")->bytes(); - std::vector scratch(len); + std::vector scratch(len); memcpy(&scratch[0], RAM, len); @@ -432,8 +432,8 @@ DRIVER_INIT_MEMBER(scramble_state,minefld) DRIVER_INIT_MEMBER(scramble_state,losttomb) { offs_t i, len; - UINT8 *RAM; - UINT8 *scratch; + uint8_t *RAM; + uint8_t *scratch; DRIVER_INIT_CALL(scramble); @@ -446,7 +446,7 @@ DRIVER_INIT_MEMBER(scramble_state,losttomb) RAM = memregion("gfx1")->base(); len = memregion("gfx1")->bytes(); - scratch = alloc_array_or_die(UINT8, len); + scratch = alloc_array_or_die(uint8_t, len); memcpy(scratch, RAM, len); @@ -470,12 +470,12 @@ DRIVER_INIT_MEMBER(scramble_state,losttomb) DRIVER_INIT_MEMBER(scramble_state,hustler) { offs_t A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0;A < 0x4000;A++) { - UINT8 xormask; + uint8_t xormask; int bits[8]; int i; @@ -510,7 +510,7 @@ DRIVER_INIT_MEMBER(scramble_state,hustlerd) { /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */ offs_t A; - UINT8 *rom = memregion("audiocpu")->base(); + uint8_t *rom = memregion("audiocpu")->base(); for (A = 0;A < 0x0800;A++) @@ -520,12 +520,12 @@ DRIVER_INIT_MEMBER(scramble_state,hustlerd) DRIVER_INIT_MEMBER(scramble_state,billiard) { offs_t A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0;A < 0x4000;A++) { - UINT8 xormask; + uint8_t xormask; int bits[8]; int i; @@ -577,9 +577,9 @@ DRIVER_INIT_MEMBER(scramble_state,mrkougb) DRIVER_INIT_MEMBER(scramble_state,ad2083) { - UINT8 c; + uint8_t c; int i, len = memregion("maincpu")->bytes(); - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i=0; ibase() + 0x8000; + uint8_t *ROM = memregion("maincpu")->base() + 0x8000; size_t size = 0x2000; - m_harem_decrypted_data = std::make_unique(size * 3); - UINT8 *data = m_harem_decrypted_data.get(); - m_harem_decrypted_opcodes = std::make_unique(size * 3); - UINT8 *opcodes = m_harem_decrypted_opcodes.get(); + m_harem_decrypted_data = std::make_unique(size * 3); + uint8_t *data = m_harem_decrypted_data.get(); + m_harem_decrypted_opcodes = std::make_unique(size * 3); + uint8_t *opcodes = m_harem_decrypted_opcodes.get(); // decryption 03 for (int i = 0; i < size; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; opcodes[size * 0 + i] = BITSWAP8(x, 7,0,5,2,3,4,1,6); data [size * 0 + i] = BITSWAP8(x, 7,6,5,0,3,4,1,2); } @@ -661,7 +661,7 @@ DRIVER_INIT_MEMBER(scramble_state,harem) // decryption 09 for (int i = 0; i < size; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; opcodes[size * 1 + i] = BITSWAP8(x, 7,0,5,6,3,2,1,4); data [size * 1 + i] = BITSWAP8(x, 7,4,5,0,3,6,1,2); } @@ -669,7 +669,7 @@ DRIVER_INIT_MEMBER(scramble_state,harem) // decryption 0a for (int i = 0; i < size; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; opcodes[size * 2 + i] = BITSWAP8(x, 7,2,5,6,3,0,1,4); data [size * 2 + i] = BITSWAP8(x, 7,2,5,4,3,0,1,6); } @@ -687,7 +687,7 @@ DRIVER_INIT_MEMBER(scramble_state,newsin7a) { DRIVER_INIT_CALL(devilfsh); // decrypt -// UINT8 *ROM = memregion("maincpu")->base(); +// uint8_t *ROM = memregion("maincpu")->base(); // ROM[0x0067] ^= 0x22; /* rst $00 - should be push hl - the NMI routine is corrupt in this set, but the IRQ routine bypasses it? intentional? */ // attempts to access port at c20x instead of 820x in one location, mirror or bitrot? diff --git a/src/mame/machine/sec.cpp b/src/mame/machine/sec.cpp index b8fa54abe24..4f4b66097b7 100644 --- a/src/mame/machine/sec.cpp +++ b/src/mame/machine/sec.cpp @@ -13,7 +13,7 @@ void SEC::reset(void) m_curbyte = m_clks = n_reqpos = m_rxclk = m_rxlen = m_rxpos = 0; } -void SEC::write_cs_line(UINT8 bit) +void SEC::write_cs_line(uint8_t bit) { if ( bit ) { @@ -35,17 +35,17 @@ void SEC::write_cs_line(UINT8 bit) } } -void SEC::write_data_line(UINT8 bit) +void SEC::write_data_line(uint8_t bit) { m_data = bit ? 1 : 0; } -UINT8 SEC::read_data_line(void) +uint8_t SEC::read_data_line(void) { return m_rxdat; } -void SEC::write_clock_line(UINT8 bit) +void SEC::write_clock_line(uint8_t bit) { bit = bit ? 1 : 0; @@ -132,9 +132,9 @@ void SEC::Do_Command(void) } } -UINT8 SEC::CalcByteSum(int length) +uint8_t SEC::CalcByteSum(int length) { - UINT8 csum = 0; + uint8_t csum = 0; for ( int i = 0; i < 3 + length; i++ ) { csum += m_reply[i]; @@ -294,7 +294,7 @@ void SEC::Cmd_Set_Mrk(void) void SEC::Cmd_Set_Txt(void) { char valbuf[8]; - UINT8 meter = m_request[3]; + uint8_t meter = m_request[3]; memcpy( valbuf, &m_request[4], 7); valbuf[7] = 0; strcpy(m_strings[meter], valbuf); @@ -311,8 +311,8 @@ void SEC::Cmd_Set_Txt(void) void SEC::Cmd_Inc_Sml(void) { - UINT8 meter = m_request[3]; - UINT8 value = m_request[4] & 0xf; + uint8_t meter = m_request[3]; + uint8_t value = m_request[4] & 0xf; m_counters[meter] += value; m_reply[0] = SEC_ACK; @@ -326,8 +326,8 @@ void SEC::Cmd_Inc_Sml(void) void SEC::Cmd_Inc_Med(void) { - UINT8 meter = m_request[3]; - UINT8 value = m_request[4]; + uint8_t meter = m_request[3]; + uint8_t value = m_request[4]; m_counters[meter] += value; m_reply[0] = SEC_ACK; @@ -341,8 +341,8 @@ void SEC::Cmd_Inc_Med(void) void SEC::Cmd_Inc_Lrg(void) { - UINT8 meter = m_request[3]; - UINT8 value = m_request[4] + 256 * m_request[5]; + uint8_t meter = m_request[3]; + uint8_t value = m_request[4] + 256 * m_request[5]; m_counters[meter] += value; m_reply[0] = SEC_ACK; diff --git a/src/mame/machine/sec.h b/src/mame/machine/sec.h index e5e97ee2a6c..bd198b0b11a 100644 --- a/src/mame/machine/sec.h +++ b/src/mame/machine/sec.h @@ -49,27 +49,27 @@ private: // stuff the SEC stores int m_counters[MAX_COUNTERS]; char m_strings[MAX_COUNTERS][8]; - UINT8 m_market; - UINT8 m_nocnt; - UINT8 m_last; + uint8_t m_market; + uint8_t m_nocnt; + uint8_t m_last; // serial comms - UINT8 m_curbyte; - UINT8 m_data; + uint8_t m_curbyte; + uint8_t m_data; - UINT8 m_clk; - UINT8 m_clks; - UINT8 m_rxpos; - UINT8 m_rxclk; - UINT8 m_rxdat; - UINT8 m_rxlen; - UINT8 chars_left; + uint8_t m_clk; + uint8_t m_clks; + uint8_t m_rxpos; + uint8_t m_rxclk; + uint8_t m_rxdat; + uint8_t m_rxlen; + uint8_t chars_left; - UINT8 n_reqpos; + uint8_t n_reqpos; // communication buffer - UINT8 m_request[12]; - UINT8 m_reply[8]; + uint8_t m_request[12]; + uint8_t m_reply[8]; bool enabled; @@ -91,14 +91,14 @@ private: void Cmd_Get_Ver(void); void Cmd_Get_Cnt(void); - UINT8 CalcByteSum(int length); + uint8_t CalcByteSum(int length); public: void reset(void); /* serial interface */ - void write_clock_line(UINT8 bit); - void write_data_line(UINT8 bit); - void write_cs_line(UINT8 bit); - UINT8 read_data_line(void); + void write_clock_line(uint8_t bit); + void write_data_line(uint8_t bit); + void write_cs_line(uint8_t bit); + uint8_t read_data_line(void); }; diff --git a/src/mame/machine/segabb.cpp b/src/mame/machine/segabb.cpp index 8adbf5dc809..dc62f67f6e0 100644 --- a/src/mame/machine/segabb.cpp +++ b/src/mame/machine/segabb.cpp @@ -13,7 +13,7 @@ ADDRESS_MAP_END DEVICE_ADDRESS_MAP_START(map3, 32, sega_lindbergh_baseboard_device) ADDRESS_MAP_END -sega_lindbergh_baseboard_device::sega_lindbergh_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_lindbergh_baseboard_device::sega_lindbergh_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, SEGA_LINDBERGH_BASEBOARD, "Sega Lindbergh Baseboard", tag, owner, clock, "sega_lindbergh_baseboard", __FILE__) { } diff --git a/src/mame/machine/segabb.h b/src/mame/machine/segabb.h index 93f42833fea..4dfc922a63a 100644 --- a/src/mame/machine/segabb.h +++ b/src/mame/machine/segabb.h @@ -12,7 +12,7 @@ class sega_lindbergh_baseboard_device : public pci_device { public: - sega_lindbergh_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_lindbergh_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/mame/machine/segacrp2_device.cpp b/src/mame/machine/segacrp2_device.cpp index 729a363e95e..9df96b7bb7c 100644 --- a/src/mame/machine/segacrp2_device.cpp +++ b/src/mame/machine/segacrp2_device.cpp @@ -47,10 +47,10 @@ #include "emu.h" #include "segacrp2_device.h" -static void decode(UINT8 *rom, UINT8 *decrypted, - const UINT8 xor_table[128],const int swap_table[128]) +static void decode(uint8_t *rom, uint8_t *decrypted, + const uint8_t xor_table[128],const int swap_table[128]) { - static const UINT8 swaptable[24][4] = + static const uint8_t swaptable[24][4] = { { 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 }, { 6,2,4,0 }, { 6,0,2,4 }, { 6,4,0,2 }, { 2,6,4,0 }, @@ -64,8 +64,8 @@ static void decode(UINT8 *rom, UINT8 *decrypted, for (int A = 0x0000;A < 0x8000;A++) { int row; - UINT8 src; - const UINT8 *tbl; + uint8_t src; + const uint8_t *tbl; src = rom[A]; @@ -100,7 +100,7 @@ const device_type SEGA_317_0007 = &device_creator; -segacrp2_z80_device::segacrp2_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : z80_device(mconfig, SEGACRP2_Z80, "Z80 SegaCrypt2", tag, owner, clock, "z80_sega2", __FILE__) {} +segacrp2_z80_device::segacrp2_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, SEGACRP2_Z80, "Z80 SegaCrypt2", tag, owner, clock, "z80_sega2", __FILE__) {} void segacrp2_z80_device::device_start() { z80_device::device_start(); decrypt(); } void segacrp2_z80_device::device_reset() { z80_device::device_reset(); } void segacrp2_z80_device::decrypt() { } @@ -112,11 +112,11 @@ void segacrp2_z80_device::set_decrypted_tag(device_t &device, const char* decryp } -sega_315_5177_device::sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_315_5177_device::sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_315_5177_device::decrypt() { // 315-5177 - static const UINT8 xor_table[128] = + static const uint8_t xor_table[128] = { 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, @@ -165,11 +165,11 @@ void sega_315_5177_device::decrypt() 20,20,20,20,20, 21,21, }; - decode(memregion(tag())->base(), (UINT8*)memshare(m_decrypted_tag)->ptr(), xor_table, swap_table); + decode(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), xor_table, swap_table); } -sega_315_5176_device::sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_315_5176_device::sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_315_5176_device::decrypt() { // 315-5176 @@ -177,11 +177,11 @@ void sega_315_5176_device::decrypt() } -sega_315_5162_device::sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_315_5162_device::sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_315_5162_device::decrypt() { // 315-5162 - static const UINT8 xor_table[128] = + static const uint8_t xor_table[128] = { 0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55, @@ -207,16 +207,16 @@ void sega_315_5162_device::decrypt() 12, }; - decode(memregion(tag())->base(), (UINT8*)memshare(m_decrypted_tag)->ptr(), xor_table, swap_table); + decode(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), xor_table, swap_table); } -sega_315_5178_device::sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_315_5178_device::sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_315_5178_device::decrypt() { // 315-5178 - static const UINT8 xor_table[128] = + static const uint8_t xor_table[128] = { 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10, 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10, @@ -256,15 +256,15 @@ void sega_315_5178_device::decrypt() 14, 8,10,12,14, 8,10, }; - decode(memregion(tag())->base(), (UINT8*)memshare(m_decrypted_tag)->ptr(), xor_table, swap_table); + decode(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), xor_table, swap_table); } -sega_315_5179_device::sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_315_5179_device::sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_315_5179_device::decrypt() { // 315-5179 - static const UINT8 xor_table[128] = + static const uint8_t xor_table[128] = { 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04,0x40,0x45,0x11,0x14,0x50, 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04, @@ -300,7 +300,7 @@ void sega_315_5179_device::decrypt() 7, }; - decode(memregion(tag())->base(), (UINT8*)memshare(m_decrypted_tag)->ptr(), xor_table, swap_table); + decode(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), xor_table, swap_table); } @@ -311,9 +311,9 @@ void sega_315_5179_device::decrypt() ******************************************************************************/ -void _sega_decode_317(UINT8 *rom, UINT8 *decrypted, int shift) +void _sega_decode_317(uint8_t *rom, uint8_t *decrypted, int shift) { - static const UINT8 xor_table[128+3] = + static const uint8_t xor_table[128+3] = { 0x04,0x54,0x44,0x14,0x15,0x15,0x51,0x41,0x41,0x14,0x10,0x50,0x15,0x55,0x54,0x05, 0x04,0x41,0x51,0x01,0x05,0x10,0x55,0x51,0x05,0x05,0x54,0x11,0x45,0x05,0x04,0x14, @@ -343,29 +343,29 @@ void _sega_decode_317(UINT8 *rom, UINT8 *decrypted, int shift) } -sega_317_0004_device::sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_317_0004_device::sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_317_0004_device::decrypt() { // 317-0004 - _sega_decode_317(memregion(tag())->base(), (UINT8*)memshare(m_decrypted_tag)->ptr(), 0); + _sega_decode_317(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), 0); } -sega_317_0005_device::sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_317_0005_device::sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_317_0005_device::decrypt() { // 317-0005 - _sega_decode_317(memregion(tag())->base(), (UINT8*)memshare(m_decrypted_tag)->ptr(), 1); + _sega_decode_317(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), 1); } -sega_317_0006_device::sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_317_0006_device::sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_317_0006_device::decrypt() { // 317-0006 - _sega_decode_317(memregion(tag())->base(), (UINT8*)memshare(m_decrypted_tag)->ptr(), 2); + _sega_decode_317(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), 2); } -sega_317_0007_device::sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} +sega_317_0007_device::sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {} void sega_317_0007_device::decrypt() { // 317-0006 - _sega_decode_317(memregion(tag())->base(), (UINT8*)memshare(m_decrypted_tag)->ptr(), 3); + _sega_decode_317(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), 3); } diff --git a/src/mame/machine/segacrp2_device.h b/src/mame/machine/segacrp2_device.h index dca1c0aeae2..624252880bb 100644 --- a/src/mame/machine/segacrp2_device.h +++ b/src/mame/machine/segacrp2_device.h @@ -17,7 +17,7 @@ class segacrp2_z80_device : public z80_device { public: - segacrp2_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + segacrp2_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); static void set_decrypted_tag(device_t &device, const char* decrypted_tag); const char* m_decrypted_tag; @@ -33,7 +33,7 @@ protected: class sega_315_5179_device : public segacrp2_z80_device { public: - sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -42,7 +42,7 @@ protected: class sega_315_5178_device : public segacrp2_z80_device { public: - sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -50,7 +50,7 @@ protected: class sega_315_5177_device : public segacrp2_z80_device { public: - sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -58,7 +58,7 @@ protected: class sega_315_5176_device : public segacrp2_z80_device { public: - sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -66,7 +66,7 @@ protected: class sega_315_5162_device : public segacrp2_z80_device { public: - sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -74,7 +74,7 @@ protected: class sega_317_0004_device : public segacrp2_z80_device { public: - sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -83,7 +83,7 @@ protected: class sega_317_0005_device : public segacrp2_z80_device { public: - sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -92,7 +92,7 @@ protected: class sega_317_0006_device : public segacrp2_z80_device { public: - sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -100,7 +100,7 @@ protected: class sega_317_0007_device : public segacrp2_z80_device { public: - sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; diff --git a/src/mame/machine/segacrpt_device.cpp b/src/mame/machine/segacrpt_device.cpp index ba2da69d7fd..d889e4045cb 100644 --- a/src/mame/machine/segacrpt_device.cpp +++ b/src/mame/machine/segacrpt_device.cpp @@ -160,7 +160,7 @@ static void lfkp(int mask) { int A; - UINT8 *RAM = machine.root_device().memregion("maincpu")->base(); + uint8_t *RAM = machine.root_device().memregion("maincpu")->base(); for (A = 0x0000;A < 0x8000-14;A++) @@ -214,13 +214,13 @@ static void look_for_known_plaintext(void) } #endif -static void decode(UINT8 *data, UINT8 *opcodes, int size, const UINT8 convtable[32][4], int bank_count, int bank_size) +static void decode(uint8_t *data, uint8_t *opcodes, int size, const uint8_t convtable[32][4], int bank_count, int bank_size) { for (int A = 0x0000;A < size + bank_count*bank_size;A++) { int xorval = 0; - UINT8 src = data[A]; + uint8_t src = data[A]; int adr; if(A < size || !bank_count) adr = A; @@ -288,7 +288,7 @@ const device_type SEGA_CPU_PBACTIO4 = &device_creator -segacrpt_z80_device::segacrpt_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +segacrpt_z80_device::segacrpt_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, SEGACRPT_Z80, "Z80 SegaCrypt", tag, owner, clock, "z80_sega", __FILE__), m_decrypted_ptr(nullptr), m_region_ptr(nullptr), @@ -304,12 +304,12 @@ void segacrpt_z80_device::device_reset() // actual CPU would be decrypting in realtime anyway if (m_decrypted_ptr == nullptr) { - m_decrypted_ptr = (UINT8*)memshare(m_decrypted_tag)->ptr(); + m_decrypted_ptr = (uint8_t*)memshare(m_decrypted_tag)->ptr(); } if (m_region_ptr == nullptr) { - m_region_ptr = (UINT8*)memregion(tag())->base(); + m_region_ptr = (uint8_t*)memregion(tag())->base(); } if (m_decryption_done == false) @@ -328,18 +328,18 @@ void segacrpt_z80_device::set_decrypted_tag(device_t &device, const char* decryp dev.m_decrypted_tag = decrypted_tag; } -void segacrpt_z80_device::set_decrypted_ptr(device_t &device, UINT8* ptr) +void segacrpt_z80_device::set_decrypted_ptr(device_t &device, uint8_t* ptr) { segacrpt_z80_device &dev = downcast(device); dev.m_decrypted_ptr = ptr; } -void segacrpt_z80_device::set_region_p(UINT8* ptr) +void segacrpt_z80_device::set_region_p(uint8_t* ptr) { m_region_ptr = ptr; } -void segacrpt_z80_device::set_decrypted_p(UINT8* ptr) +void segacrpt_z80_device::set_decrypted_p(uint8_t* ptr) { m_decrypted_ptr = ptr; } @@ -365,10 +365,10 @@ void segacrpt_z80_device::set_banksize(device_t &device, int banksize) -sega_315_5132_device::sega_315_5132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5132_device::sega_315_5132_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5132_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -396,10 +396,10 @@ void sega_315_5132_device::decrypt() -sega_315_5155_device::sega_315_5155_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5155_device::sega_315_5155_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5155_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -427,10 +427,10 @@ void sega_315_5155_device::decrypt() -sega_315_5110_device::sega_315_5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5110_device::sega_315_5110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5110_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -457,10 +457,10 @@ void sega_315_5110_device::decrypt() -sega_315_5135_device::sega_315_5135_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5135_device::sega_315_5135_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5135_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -488,10 +488,10 @@ void sega_315_5135_device::decrypt() -sega_315_5051_device::sega_315_5051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5051_device::sega_315_5051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5051_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -518,11 +518,11 @@ void sega_315_5051_device::decrypt() -sega_315_5098_device::sega_315_5098_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5098_device::sega_315_5098_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5098_device::decrypt() { // also 315-5030 ? - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -550,10 +550,10 @@ void sega_315_5098_device::decrypt() -sega_315_5102_device::sega_315_5102_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5102_device::sega_315_5102_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5102_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -579,10 +579,10 @@ void sega_315_5102_device::decrypt() } -sega_315_5065_device::sega_315_5065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5065_device::sega_315_5065_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5065_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -608,10 +608,10 @@ void sega_315_5065_device::decrypt() } -sega_315_5064_device::sega_315_5064_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5064_device::sega_315_5064_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5064_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -638,10 +638,10 @@ void sega_315_5064_device::decrypt() -sega_315_5033_device::sega_315_5033_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5033_device::sega_315_5033_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5033_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -667,10 +667,10 @@ void sega_315_5033_device::decrypt() } -sega_315_5041_device::sega_315_5041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5041_device::sega_315_5041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5041_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -697,10 +697,10 @@ void sega_315_5041_device::decrypt() -sega_315_5048_device::sega_315_5048_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5048_device::sega_315_5048_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5048_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -726,10 +726,10 @@ void sega_315_5048_device::decrypt() } -sega_315_5093_device::sega_315_5093_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5093_device::sega_315_5093_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5093_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -756,10 +756,10 @@ void sega_315_5093_device::decrypt() -sega_315_5099_device::sega_315_5099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5099_device::sega_315_5099_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5099_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -787,10 +787,10 @@ void sega_315_5099_device::decrypt() -sega_315_spat_device::sega_315_spat_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_spat_device::sega_315_spat_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_spat_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -815,10 +815,10 @@ void sega_315_spat_device::decrypt() decode(m_region_ptr, m_decrypted_ptr, m_decode_size, convtable, m_numbanks, m_banksize); } -sega_315_5015_device::sega_315_5015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5015_device::sega_315_5015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5015_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -845,7 +845,7 @@ void sega_315_5015_device::decrypt() } -sega_315_5133_device::sega_315_5133_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5133_device::sega_315_5133_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5133_device::decrypt() { // TODO @@ -853,10 +853,10 @@ void sega_315_5133_device::decrypt() -sega_315_5014_device::sega_315_5014_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5014_device::sega_315_5014_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5014_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -882,10 +882,10 @@ void sega_315_5014_device::decrypt() -sega_315_5013_device::sega_315_5013_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5013_device::sega_315_5013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5013_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -911,10 +911,10 @@ void sega_315_5013_device::decrypt() } -sega_315_5061_device::sega_315_5061_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5061_device::sega_315_5061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5061_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -941,10 +941,10 @@ void sega_315_5061_device::decrypt() -sega_315_5018_device::sega_315_5018_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5018_device::sega_315_5018_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5018_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -971,10 +971,10 @@ void sega_315_5018_device::decrypt() } -sega_315_5010_device::sega_315_5010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5010_device::sega_315_5010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5010_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -1002,10 +1002,10 @@ void sega_315_5010_device::decrypt() -sega_cpu_pbactio4_device::sega_cpu_pbactio4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_cpu_pbactio4_device::sega_cpu_pbactio4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_cpu_pbactio4_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -1031,10 +1031,10 @@ void sega_cpu_pbactio4_device::decrypt() } -sega_315_5028_device::sega_315_5028_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5028_device::sega_315_5028_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5028_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ @@ -1060,10 +1060,10 @@ void sega_315_5028_device::decrypt() } -sega_315_5084_device::sega_315_5084_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} +sega_315_5084_device::sega_315_5084_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrpt_z80_device(mconfig, tag, owner, clock) {} void sega_315_5084_device::decrypt() { - static const UINT8 convtable[32][4] = + static const uint8_t convtable[32][4] = { /* opcode data address */ /* A B C D A B C D */ diff --git a/src/mame/machine/segacrpt_device.h b/src/mame/machine/segacrpt_device.h index 12b057918b1..0e2a289f6fa 100644 --- a/src/mame/machine/segacrpt_device.h +++ b/src/mame/machine/segacrpt_device.h @@ -30,24 +30,24 @@ class segacrpt_z80_device : public z80_device { public: - segacrpt_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + segacrpt_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); static void set_decrypted_tag(device_t &device, const char* decrypted_tag); - static void set_decrypted_ptr(device_t &device, UINT8* ptr); // toprollr + static void set_decrypted_ptr(device_t &device, uint8_t* ptr); // toprollr static void set_size(device_t &device, int size); static void set_numbanks(device_t &device, int _numbanks); static void set_banksize(device_t &device, int _banksize); const char* m_decrypted_tag; - UINT8* m_decrypted_ptr; - UINT8* m_region_ptr; + uint8_t* m_decrypted_ptr; + uint8_t* m_region_ptr; int m_decode_size; int m_numbanks; int m_banksize; bool m_decryption_done; - void set_decrypted_p(UINT8* ptr); - void set_region_p(UINT8* ptr); + void set_decrypted_p(uint8_t* ptr); + void set_region_p(uint8_t* ptr); protected: virtual void device_start() override; @@ -60,7 +60,7 @@ protected: class sega_315_5132_device : public segacrpt_z80_device { public: - sega_315_5132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5132_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -68,7 +68,7 @@ protected: class sega_315_5155_device : public segacrpt_z80_device { public: - sega_315_5155_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5155_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -76,7 +76,7 @@ protected: class sega_315_5110_device : public segacrpt_z80_device { public: - sega_315_5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -84,7 +84,7 @@ protected: class sega_315_5135_device : public segacrpt_z80_device { public: - sega_315_5135_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5135_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -92,7 +92,7 @@ protected: class sega_315_5051_device : public segacrpt_z80_device { public: - sega_315_5051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -100,7 +100,7 @@ protected: class sega_315_5098_device : public segacrpt_z80_device { public: - sega_315_5098_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5098_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -108,7 +108,7 @@ protected: class sega_315_5102_device : public segacrpt_z80_device { public: - sega_315_5102_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5102_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -116,7 +116,7 @@ protected: class sega_315_5065_device : public segacrpt_z80_device { public: - sega_315_5065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5065_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -125,7 +125,7 @@ protected: class sega_315_5064_device : public segacrpt_z80_device { public: - sega_315_5064_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5064_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -134,7 +134,7 @@ protected: class sega_315_5033_device : public segacrpt_z80_device { public: - sega_315_5033_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5033_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -142,7 +142,7 @@ protected: class sega_315_5041_device : public segacrpt_z80_device { public: - sega_315_5041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -150,7 +150,7 @@ protected: class sega_315_5048_device : public segacrpt_z80_device { public: - sega_315_5048_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5048_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -158,7 +158,7 @@ protected: class sega_315_5093_device : public segacrpt_z80_device { public: - sega_315_5093_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5093_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -166,7 +166,7 @@ protected: class sega_315_5099_device : public segacrpt_z80_device { public: - sega_315_5099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5099_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -174,7 +174,7 @@ protected: class sega_315_spat_device : public segacrpt_z80_device { public: - sega_315_spat_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_spat_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -182,7 +182,7 @@ protected: class sega_315_5015_device : public segacrpt_z80_device { public: - sega_315_5015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -191,7 +191,7 @@ protected: class sega_315_5133_device : public segacrpt_z80_device { public: - sega_315_5133_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5133_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -199,7 +199,7 @@ protected: class sega_315_5014_device : public segacrpt_z80_device { public: - sega_315_5014_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5014_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -207,7 +207,7 @@ protected: class sega_315_5013_device : public segacrpt_z80_device { public: - sega_315_5013_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -215,7 +215,7 @@ protected: class sega_315_5061_device : public segacrpt_z80_device { public: - sega_315_5061_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -225,7 +225,7 @@ protected: class sega_315_5018_device : public segacrpt_z80_device { public: - sega_315_5018_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5018_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -233,7 +233,7 @@ protected: class sega_315_5010_device : public segacrpt_z80_device { public: - sega_315_5010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -243,7 +243,7 @@ protected: class sega_cpu_pbactio4_device : public segacrpt_z80_device { public: - sega_cpu_pbactio4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_cpu_pbactio4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -251,7 +251,7 @@ protected: class sega_315_5028_device : public segacrpt_z80_device { public: - sega_315_5028_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5028_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; @@ -259,7 +259,7 @@ protected: class sega_315_5084_device : public segacrpt_z80_device { public: - sega_315_5084_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + sega_315_5084_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); protected: virtual void decrypt() override; }; diff --git a/src/mame/machine/segag80.cpp b/src/mame/machine/segag80.cpp index b2e7d4ce8c5..42ed293f056 100644 --- a/src/mame/machine/segag80.cpp +++ b/src/mame/machine/segag80.cpp @@ -13,10 +13,10 @@ /****************************************************************************/ /* MB 971025 - Emulate Sega G80 security chip 315-0062 */ /****************************************************************************/ -static UINT8 sega_decrypt62(offs_t pc, UINT8 lo) +static uint8_t sega_decrypt62(offs_t pc, uint8_t lo) { - UINT32 i = 0; - UINT32 b = lo; + uint32_t i = 0; + uint32_t b = lo; switch (pc & 0x03) { @@ -62,10 +62,10 @@ static UINT8 sega_decrypt62(offs_t pc, UINT8 lo) /****************************************************************************/ /* MB 971025 - Emulate Sega G80 security chip 315-0063 */ /****************************************************************************/ -static UINT8 sega_decrypt63(offs_t pc, UINT8 lo) +static uint8_t sega_decrypt63(offs_t pc, uint8_t lo) { - UINT32 i = 0; - UINT32 b = lo; + uint32_t i = 0; + uint32_t b = lo; switch (pc & 0x09) { @@ -111,10 +111,10 @@ static UINT8 sega_decrypt63(offs_t pc, UINT8 lo) /****************************************************************************/ /* MB 971025 - Emulate Sega G80 security chip 315-0064 */ /****************************************************************************/ -static UINT8 sega_decrypt64(offs_t pc, UINT8 lo) +static uint8_t sega_decrypt64(offs_t pc, uint8_t lo) { - UINT32 i = 0; - UINT32 b = lo; + uint32_t i = 0; + uint32_t b = lo; switch (pc & 0x03) { @@ -161,10 +161,10 @@ static UINT8 sega_decrypt64(offs_t pc, UINT8 lo) /****************************************************************************/ /* MB 971025 - Emulate Sega G80 security chip 315-0070 */ /****************************************************************************/ -static UINT8 sega_decrypt70(offs_t pc, UINT8 lo) +static uint8_t sega_decrypt70(offs_t pc, uint8_t lo) { - UINT32 i = 0; - UINT32 b = lo; + uint32_t i = 0; + uint32_t b = lo; switch (pc & 0x09) { @@ -210,10 +210,10 @@ static UINT8 sega_decrypt70(offs_t pc, UINT8 lo) /****************************************************************************/ /* MB 971025 - Emulate Sega G80 security chip 315-0076 */ /****************************************************************************/ -static UINT8 sega_decrypt76(offs_t pc, UINT8 lo) +static uint8_t sega_decrypt76(offs_t pc, uint8_t lo) { - UINT32 i = 0; - UINT32 b = lo; + uint32_t i = 0; + uint32_t b = lo; switch (pc & 0x09) { @@ -259,10 +259,10 @@ static UINT8 sega_decrypt76(offs_t pc, UINT8 lo) /****************************************************************************/ /* MB 971025 - Emulate Sega G80 security chip 315-0082 */ /****************************************************************************/ -static UINT8 sega_decrypt82(offs_t pc, UINT8 lo) +static uint8_t sega_decrypt82(offs_t pc, uint8_t lo) { - UINT32 i = 0; - UINT32 b = lo; + uint32_t i = 0; + uint32_t b = lo; switch (pc & 0x11) { @@ -308,7 +308,7 @@ static UINT8 sega_decrypt82(offs_t pc, UINT8 lo) /****************************************************************************/ /* MB 971031 - Emulate no Sega G80 security chip */ /****************************************************************************/ -static UINT8 sega_decrypt0(offs_t pc, UINT8 lo) +static uint8_t sega_decrypt0(offs_t pc, uint8_t lo) { return lo; } diff --git a/src/mame/machine/segag80.h b/src/mame/machine/segag80.h index c2cee5ea5d3..c8b4a165ac2 100644 --- a/src/mame/machine/segag80.h +++ b/src/mame/machine/segag80.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause // copyright-holders:Aaron Giles -typedef UINT8 (*segag80_decrypt_func)(offs_t, UINT8); +typedef uint8_t (*segag80_decrypt_func)(offs_t, uint8_t); segag80_decrypt_func segag80_security(int chip); diff --git a/src/mame/machine/segaic16.cpp b/src/mame/machine/segaic16.cpp index 784368bcca4..fac72484c8a 100644 --- a/src/mame/machine/segaic16.cpp +++ b/src/mame/machine/segaic16.cpp @@ -75,7 +75,7 @@ READ16_MEMBER( sega_16bit_common_base::open_bus_r ) // read original encrypted memory at that address m_open_bus_recurse = true; - UINT16 result = space.read_word(space.device().safe_pc()); + uint16_t result = space.read_word(space.device().safe_pc()); m_open_bus_recurse = false; return result; } @@ -147,7 +147,7 @@ WRITE16_MEMBER( sega_16bit_common_base::paletteram_w ) m_palette_entries = memshare("paletteram")->bytes() / 2; // get the new value - UINT16 newval = m_paletteram[offset]; + uint16_t newval = m_paletteram[offset]; COMBINE_DATA(&newval); m_paletteram[offset] = newval; @@ -171,7 +171,7 @@ WRITE16_MEMBER( sega_16bit_common_base::philko_paletteram_w ) m_palette_entries = memshare("paletteram")->bytes() / 2; // get the new value - UINT16 newval = m_paletteram[offset]; + uint16_t newval = m_paletteram[offset]; COMBINE_DATA(&newval); m_paletteram[offset] = newval; @@ -198,7 +198,7 @@ WRITE16_MEMBER( sega_16bit_common_base::philko_paletteram_w ) // sega_315_5195_mapper_device - constructor //------------------------------------------------- -sega_315_5195_mapper_device::sega_315_5195_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_315_5195_mapper_device::sega_315_5195_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_315_5195_MEM_MAPPER, "Sega 315-5195 Memory Mapper", tag, owner, clock, "sega_315_5195", __FILE__) , m_cpu(*this, finder_base::DUMMY_TAG) , m_cpuregion(*this, finder_base::DUMMY_TAG) @@ -259,7 +259,7 @@ WRITE8_MEMBER( sega_315_5195_mapper_device::write ) if (LOG_MEMORY_MAP) osd_printf_debug("(Write %02X = %02X)\n", offset, data); // remember the previous value and swap in the new one - UINT8 oldval = m_regs[offset]; + uint8_t oldval = m_regs[offset]; m_regs[offset] = data; // switch off the offset @@ -301,7 +301,7 @@ if (LOG_MEMORY_MAP) osd_printf_debug("(Write %02X = %02X)\n", offset, data); else if (data == 0x02) { offs_t addr = (m_regs[0x07] << 17) | (m_regs[0x08] << 9) | (m_regs[0x09] << 1); - UINT16 result = m_space->read_word(addr); + uint16_t result = m_space->read_word(addr); m_regs[0x00] = result >> 8; m_regs[0x01] = result; } @@ -380,7 +380,7 @@ READ8_MEMBER( sega_315_5195_mapper_device::read ) // map_as_rom - map a region as ROM data //------------------------------------------------- -void sega_315_5195_mapper_device::map_as_rom(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_name, const char *decrypted_bank_name, offs_t rgnoffset, write16_delegate whandler) +void sega_315_5195_mapper_device::map_as_rom(uint32_t offset, uint32_t length, offs_t mirror, const char *bank_name, const char *decrypted_bank_name, offs_t rgnoffset, write16_delegate whandler) { // determine parameters region_info info; @@ -409,7 +409,7 @@ void sega_315_5195_mapper_device::map_as_rom(UINT32 offset, UINT32 length, offs_ // configure the bank memory_bank *bank = owner()->membank(bank_name); memory_bank *decrypted_bank = owner()->membank(decrypted_bank_name); - UINT8 *memptr = m_cpuregion->base() + rgnoffset; + uint8_t *memptr = m_cpuregion->base() + rgnoffset; bank->set_base(memptr); // remember this bank, and decrypt if necessary @@ -433,7 +433,7 @@ void sega_315_5195_mapper_device::map_as_rom(UINT32 offset, UINT32 length, offs_ // optional write handler //------------------------------------------------- -void sega_315_5195_mapper_device::map_as_ram(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_share_name, write16_delegate whandler) +void sega_315_5195_mapper_device::map_as_ram(uint32_t offset, uint32_t length, offs_t mirror, const char *bank_share_name, write16_delegate whandler) { // determine parameters region_info info; @@ -468,7 +468,7 @@ void sega_315_5195_mapper_device::map_as_ram(UINT32 offset, UINT32 length, offs_ // read write handlers //------------------------------------------------- -void sega_315_5195_mapper_device::map_as_handler(UINT32 offset, UINT32 length, offs_t mirror, read16_delegate rhandler, write16_delegate whandler) +void sega_315_5195_mapper_device::map_as_handler(uint32_t offset, uint32_t length, offs_t mirror, read16_delegate rhandler, write16_delegate whandler) { // determine parameters region_info info; @@ -497,7 +497,7 @@ void sega_315_5195_mapper_device::map_as_handler(UINT32 offset, UINT32 length, o // memory map //------------------------------------------------- -void sega_315_5195_mapper_device::configure_explicit(const UINT8 *map_data) +void sega_315_5195_mapper_device::configure_explicit(const uint8_t *map_data) { memcpy(&m_regs[0x10], map_data, 0x10); update_mapping(); @@ -509,7 +509,7 @@ void sega_315_5195_mapper_device::configure_explicit(const UINT8 *map_data) // of state changes //------------------------------------------------- -void sega_315_5195_mapper_device::fd1094_state_change(UINT8 state) +void sega_315_5195_mapper_device::fd1094_state_change(uint8_t state) { // iterate over regions and set the decrypted address of any ROM banks for (auto & elem : m_banks) @@ -579,7 +579,7 @@ void sega_315_5195_mapper_device::device_reset() // actual underlying bus connections //------------------------------------------------- -void sega_315_5195_mapper_device::compute_region(region_info &info, UINT8 index, UINT32 length, UINT32 mirror, UINT32 offset) +void sega_315_5195_mapper_device::compute_region(region_info &info, uint8_t index, uint32_t length, uint32_t mirror, uint32_t offset) { static const offs_t region_size_map[4] = { 0x00ffff, 0x01ffff, 0x07ffff, 0x1fffff }; info.size_mask = region_size_map[m_regs[0x10 + 2 * index] & 3]; @@ -674,7 +674,7 @@ void sega_315_5195_mapper_device::decrypt_bank::set_decrypt(fd1094_device *fd109 // a change //------------------------------------------------- -void sega_315_5195_mapper_device::decrypt_bank::set(memory_bank *bank, memory_bank *decrypted_bank, offs_t start, offs_t end, offs_t rgnoffs, UINT8 *src) +void sega_315_5195_mapper_device::decrypt_bank::set(memory_bank *bank, memory_bank *decrypted_bank, offs_t start, offs_t end, offs_t rgnoffs, uint8_t *src) { // ignore if not encrypted if (m_fd1089 == nullptr && m_fd1094_cache == nullptr) @@ -719,7 +719,7 @@ void sega_315_5195_mapper_device::decrypt_bank::update() if (m_fd1089 != nullptr) { m_fd1089_decrypted.resize((m_end + 1 - m_start) / 2); - m_fd1089->decrypt(m_start, m_end + 1 - m_start, m_rgnoffs, &m_fd1089_decrypted[0], reinterpret_cast(m_srcptr)); + m_fd1089->decrypt(m_start, m_end + 1 - m_start, m_rgnoffs, &m_fd1089_decrypted[0], reinterpret_cast(m_srcptr)); m_decrypted_bank->set_base(&m_fd1089_decrypted[0]); } @@ -738,7 +738,7 @@ void sega_315_5195_mapper_device::decrypt_bank::update() // sega_315_5248_multiplier_device - constructor //------------------------------------------------- -sega_315_5248_multiplier_device::sega_315_5248_multiplier_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_315_5248_multiplier_device::sega_315_5248_multiplier_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_315_5248_MULTIPLIER, "Sega 315-5248 Multiplier", tag, owner, clock, "sega_315_5248", __FILE__) { } @@ -757,8 +757,8 @@ READ16_MEMBER( sega_315_5248_multiplier_device::read ) case 1: return m_regs[1]; // if bit 1 is 1, return ther results - case 2: return (INT16(m_regs[0]) * INT16(m_regs[1])) >> 16; - case 3: return (INT16(m_regs[0]) * INT16(m_regs[1])) & 0xffff; + case 2: return (int16_t(m_regs[0]) * int16_t(m_regs[1])) >> 16; + case 3: return (int16_t(m_regs[0]) * int16_t(m_regs[1])) & 0xffff; } // should never get here @@ -806,7 +806,7 @@ void sega_315_5248_multiplier_device::device_reset() // sega_315_5249_divider_device - constructor //------------------------------------------------- -sega_315_5249_divider_device::sega_315_5249_divider_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_315_5249_divider_device::sega_315_5249_divider_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_315_5248_MULTIPLIER, "Sega 315-5249 Divider", tag, owner, clock, "sega_315_5249", __FILE__) { } @@ -888,14 +888,14 @@ void sega_315_5249_divider_device::execute(int mode) if (mode == 0) { // perform signed divide - INT32 dividend = INT32((m_regs[0] << 16) | m_regs[1]); - INT32 divisor = INT16(m_regs[2]); - INT32 quotient; + int32_t dividend = int32_t((m_regs[0] << 16) | m_regs[1]); + int32_t divisor = int16_t(m_regs[2]); + int32_t quotient; // check for divide by 0, signal if we did if (divisor == 0) { - quotient = dividend;//((INT32)(dividend ^ divisor) < 0) ? 0x8000 : 0x7fff; + quotient = dividend;//((int32_t)(dividend ^ divisor) < 0) ? 0x8000 : 0x7fff; m_regs[6] |= 0x4000; } else @@ -914,17 +914,17 @@ void sega_315_5249_divider_device::execute(int mode) } // store quotient and remainder - m_regs[4] = INT16(quotient); - m_regs[5] = INT16(dividend - quotient * divisor); + m_regs[4] = int16_t(quotient); + m_regs[5] = int16_t(dividend - quotient * divisor); } // mode 1: unsigned divide, 32-bit quotient only else { // perform unsigned divide - UINT32 dividend = UINT32((m_regs[0] << 16) | m_regs[1]); - UINT32 divisor = UINT16(m_regs[2]); - UINT32 quotient; + uint32_t dividend = uint32_t((m_regs[0] << 16) | m_regs[1]); + uint32_t divisor = uint16_t(m_regs[2]); + uint32_t quotient; // check for divide by 0, signal if we did if (divisor == 0) @@ -951,7 +951,7 @@ void sega_315_5249_divider_device::execute(int mode) // constructor //------------------------------------------------- -sega_315_5250_compare_timer_device::sega_315_5250_compare_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_315_5250_compare_timer_device::sega_315_5250_compare_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_315_5250_COMPARE_TIMER, "Sega 315-5250 Compare/Timer", tag, owner, clock, "sega_315_5250", __FILE__) { } @@ -1092,12 +1092,12 @@ void sega_315_5250_compare_timer_device::device_reset() void sega_315_5250_compare_timer_device::execute(bool update_history) { - INT16 bound1 = INT16(m_regs[0]); - INT16 bound2 = INT16(m_regs[1]); - INT16 value = INT16(m_regs[2]); + int16_t bound1 = int16_t(m_regs[0]); + int16_t bound2 = int16_t(m_regs[1]); + int16_t value = int16_t(m_regs[2]); - INT16 min = (bound1 < bound2) ? bound1 : bound2; - INT16 max = (bound1 > bound2) ? bound1 : bound2; + int16_t min = (bound1 < bound2) ? bound1 : bound2; + int16_t max = (bound1 > bound2) ? bound1 : bound2; if (value < min) { diff --git a/src/mame/machine/segaic16.h b/src/mame/machine/segaic16.h index 627a49fca0d..25205c34985 100644 --- a/src/mame/machine/segaic16.h +++ b/src/mame/machine/segaic16.h @@ -66,15 +66,15 @@ protected: public: // -- stupid system16.c // memory pointers - required_shared_ptr m_paletteram; + required_shared_ptr m_paletteram; protected: // internal state bool m_open_bus_recurse; // flag to track recursion through open_bus_r - UINT32 m_palette_entries; // number of palette entries - UINT8 m_palette_normal[32]; // RGB translations for normal pixels - UINT8 m_palette_shadow[32]; // RGB translations for shadowed pixels - UINT8 m_palette_hilight[32]; // RGB translations for hilighted pixels + uint32_t m_palette_entries; // number of palette entries + uint8_t m_palette_normal[32]; // RGB translations for normal pixels + uint8_t m_palette_shadow[32]; // RGB translations for shadowed pixels + uint8_t m_palette_hilight[32]; // RGB translations for hilighted pixels required_device m_screen; required_device m_palette; }; @@ -85,12 +85,12 @@ protected: class sega_315_5195_mapper_device : public device_t { public: - typedef device_delegate mapper_delegate; - typedef device_delegate sound_read_delegate; - typedef device_delegate sound_write_delegate; + typedef device_delegate mapper_delegate; + typedef device_delegate sound_read_delegate; + typedef device_delegate sound_write_delegate; // construction/destruction - sega_315_5195_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5195_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void static_set_cputag(device_t &device, const char *cpu); @@ -102,12 +102,12 @@ public: DECLARE_WRITE8_MEMBER( write ); // mapping helpers - void map_as_rom(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_name, const char *decrypted_bank_name, offs_t rgnoffset, write16_delegate whandler); - void map_as_ram(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_share_name, write16_delegate whandler); - void map_as_handler(UINT32 offset, UINT32 length, offs_t mirror, read16_delegate rhandler, write16_delegate whandler); + void map_as_rom(uint32_t offset, uint32_t length, offs_t mirror, const char *bank_name, const char *decrypted_bank_name, offs_t rgnoffset, write16_delegate whandler); + void map_as_ram(uint32_t offset, uint32_t length, offs_t mirror, const char *bank_share_name, write16_delegate whandler); + void map_as_handler(uint32_t offset, uint32_t length, offs_t mirror, read16_delegate rhandler, write16_delegate whandler); // perform an explicit configuration (for bootlegs with hard-coded mappings) - void configure_explicit(const UINT8 *map_data); + void configure_explicit(const uint8_t *map_data); protected: // device-level overrides @@ -137,7 +137,7 @@ private: void set_decrypt(fd1089_base_device *fd1089); void set_decrypt(fd1094_device *fd1094); void clear() { set(nullptr, nullptr, 0, 0, ~0, nullptr); } - void set(memory_bank *bank, memory_bank *decrypted_bank, offs_t start, offs_t end, offs_t rgnoffs, UINT8 *src); + void set(memory_bank *bank, memory_bank *decrypted_bank, offs_t start, offs_t end, offs_t rgnoffs, uint8_t *src); // updating void update(); @@ -150,16 +150,16 @@ private: offs_t m_start; offs_t m_end; offs_t m_rgnoffs; - UINT8 * m_srcptr; + uint8_t * m_srcptr; fd1089_base_device * m_fd1089; - std::vector m_fd1089_decrypted; + std::vector m_fd1089_decrypted; std::unique_ptr m_fd1094_cache; }; // internal helpers - void compute_region(region_info &info, UINT8 index, UINT32 length, UINT32 mirror, UINT32 offset = 0); + void compute_region(region_info &info, uint8_t index, uint32_t length, uint32_t mirror, uint32_t offset = 0); void update_mapping(); - void fd1094_state_change(UINT8 state); + void fd1094_state_change(uint8_t state); // configuration required_device m_cpu; @@ -171,8 +171,8 @@ private: // internal state address_space * m_space; address_space * m_decrypted_space; - UINT8 m_regs[0x20]; - UINT8 m_curregion; + uint8_t m_regs[0x20]; + uint8_t m_curregion; decrypt_bank m_banks[8]; }; @@ -183,7 +183,7 @@ class sega_315_5248_multiplier_device : public device_t { public: // construction/destruction - sega_315_5248_multiplier_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5248_multiplier_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // public interface DECLARE_READ16_MEMBER( read ); @@ -196,7 +196,7 @@ protected: private: // internal state - UINT16 m_regs[4]; + uint16_t m_regs[4]; }; @@ -206,7 +206,7 @@ class sega_315_5249_divider_device : public device_t { public: // construction/destruction - sega_315_5249_divider_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5249_divider_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // public interface DECLARE_READ16_MEMBER( read ); @@ -222,7 +222,7 @@ private: void execute(int mode); // internal state - UINT16 m_regs[8]; + uint16_t m_regs[8]; }; @@ -231,11 +231,11 @@ private: class sega_315_5250_compare_timer_device : public device_t { public: - typedef device_delegate sound_write_delegate; + typedef device_delegate sound_write_delegate; typedef device_delegate timer_ack_delegate; // construction/destruction - sega_315_5250_compare_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5250_compare_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void static_set_timer_ack(device_t &device, timer_ack_delegate callback); @@ -261,9 +261,9 @@ private: sound_write_delegate m_sound_write; // internal state - UINT16 m_regs[16]; - UINT16 m_counter; - UINT8 m_bit; + uint16_t m_regs[16]; + uint16_t m_counter; + uint8_t m_bit; }; diff --git a/src/mame/machine/segas32.cpp b/src/mame/machine/segas32.cpp index 61db4618073..12286b9e8a3 100644 --- a/src/mame/machine/segas32.cpp +++ b/src/mame/machine/segas32.cpp @@ -14,7 +14,7 @@ #define xxxx 0x00 -const UINT8 ga2_v25_opcode_table[256] = { +const uint8_t ga2_v25_opcode_table[256] = { xxxx,xxxx,0xEA,xxxx,xxxx,0x8B,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xFA, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x49,xxxx,xxxx,xxxx, @@ -38,8 +38,8 @@ const UINT8 ga2_v25_opcode_table[256] = { void segas32_state::decrypt_ga2_protrom() { int i; - UINT8 *rom = memregion("mcu")->base(); - std::vector temp(0x100000); + uint8_t *rom = memregion("mcu")->base(); + std::vector temp(0x100000); // make copy of ROM so original can be overwritten memcpy(&temp[0], rom, 0x10000); @@ -63,7 +63,7 @@ READ16_MEMBER(segas32_state::ga2_dpram_r) #if 0 // simulation READ16_MEMBER(segas32_state::ga2_sprite_protection_r) { - static const UINT16 prot[16] = + static const uint16_t prot[16] = { 0x0a, 0, 0xc5, 0, @@ -102,7 +102,7 @@ READ16_MEMBER(segas32_state::ga2_wakeup_protection_r) WRITE16_MEMBER(segas32_state::sonic_level_load_protection) { - UINT16 level; + uint16_t level; //Perform write COMBINE_DATA(&m_system32_workram[CLEARED_LEVELS / 2]); @@ -113,7 +113,7 @@ WRITE16_MEMBER(segas32_state::sonic_level_load_protection) } else { - const UINT8 *ROM = memregion("maincpu")->base(); + const uint8_t *ROM = memregion("maincpu")->base(); level = *((ROM + LEVEL_ORDER_ARRAY) + (m_system32_workram[CLEARED_LEVELS / 2] * 2) - 1); level |= *((ROM + LEVEL_ORDER_ARRAY) + (m_system32_workram[CLEARED_LEVELS / 2] * 2) - 2) << 8; } @@ -163,7 +163,7 @@ WRITE16_MEMBER(segas32_state::brival_protection_w) }; char ret[32]; int curProtType; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); switch (offset) { @@ -248,7 +248,7 @@ void segas32_state::f1lap_fd1149_vblank() space.write_byte(0x20F7C6, 0); // needed to start a game - UINT8 val = space.read_byte(0x20EE81); + uint8_t val = space.read_byte(0x20EE81); if (val == 0xff) space.write_byte(0x20EE81,0); } diff --git a/src/mame/machine/seibucop/seibucop.cpp b/src/mame/machine/seibucop/seibucop.cpp index 280093b0835..985bba66742 100644 --- a/src/mame/machine/seibucop/seibucop.cpp +++ b/src/mame/machine/seibucop/seibucop.cpp @@ -114,7 +114,7 @@ const device_type RAIDEN2COP = &device_creator; -raiden2cop_device::raiden2cop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +raiden2cop_device::raiden2cop_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RAIDEN2COP, "Seibu COP (Raiden 2)", tag, owner, clock, "raiden2cop", __FILE__), cop_latch_addr(0), cop_latch_trigger(0), @@ -166,18 +166,18 @@ raiden2cop_device::raiden2cop_device(const machine_config &mconfig, const char * m_videoramout_cb(*this), m_palette(*this, ":palette") { - memset(cop_func_trigger, 0, sizeof(UINT16)*(0x100/8)); - 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_func_trigger, 0, sizeof(uint16_t)*(0x100/8)); + memset(cop_func_value, 0, sizeof(uint16_t)*(0x100/8)); + memset(cop_func_mask, 0, sizeof(uint16_t)*(0x100/8)); + memset(cop_program, 0, sizeof(uint16_t)*(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)); + memset(cop_dma_src, 0, sizeof(uint16_t)*(0x200)); + memset(cop_dma_dst, 0, sizeof(uint16_t)*(0x200)); + memset(cop_dma_size, 0, sizeof(uint16_t)*(0x200)); - memset(cop_itoa_digits, 0, sizeof(UINT8)*10); + memset(cop_itoa_digits, 0, sizeof(uint8_t)*10); - memset(cop_regs, 0, sizeof(UINT32)*8); + memset(cop_regs, 0, sizeof(uint32_t)*8); memset(cop_collision_info, 0, sizeof(colinfo)*2); @@ -282,22 +282,22 @@ void raiden2cop_device::device_start() m_word_endian_val = m_host_endian ? 2 : 0; } -UINT16 raiden2cop_device::cop_read_word(int address) +uint16_t raiden2cop_device::cop_read_word(int address) { return m_host_space->read_word(address ^ m_word_endian_val); } -UINT8 raiden2cop_device::cop_read_byte(int address) +uint8_t raiden2cop_device::cop_read_byte(int address) { return m_host_space->read_byte(address ^ m_byte_endian_val); } -void raiden2cop_device::cop_write_word(int address, UINT16 data) +void raiden2cop_device::cop_write_word(int address, uint16_t data) { m_host_space->write_word(address ^ m_word_endian_val, data); } -void raiden2cop_device::cop_write_byte(int address, UINT8 data) +void raiden2cop_device::cop_write_byte(int address, uint8_t data) { m_host_space->write_byte(address ^ m_byte_endian_val, data); } @@ -453,7 +453,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_pgm_trigger_w) // currently only used by legionna.c implementation -int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask) +int raiden2cop_device::find_trigger_match(uint16_t triggerval, uint16_t 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! */ @@ -652,7 +652,7 @@ int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask) } // only used by legionna.c implementation -int raiden2cop_device::check_command_matches(int command, UINT16 seq0, UINT16 seq1, UINT16 seq2, UINT16 seq3, UINT16 seq4, UINT16 seq5, UINT16 seq6, UINT16 seq7, UINT16 _funcval_, UINT16 _funcmask_) +int raiden2cop_device::check_command_matches(int command, uint16_t seq0, uint16_t seq1, uint16_t seq2, uint16_t seq3, uint16_t seq4, uint16_t seq5, uint16_t seq6, uint16_t seq7, uint16_t _funcval_, uint16_t _funcmask_) { command *= 8; @@ -718,7 +718,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_pal_brightness_mode_w) } /* RE from Seibu Cup Soccer bootleg */ -UINT8 raiden2cop_device::fade_table(int v) +uint8_t raiden2cop_device::fade_table(int v) { int low = v & 0x001f; int high = v & 0x03e0; @@ -771,7 +771,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w) /********************************************************************************************************************/ case 0x09: { - UINT32 src, dst, size; + uint32_t src, dst, size; int i; src = (cop_dma_src[cop_dma_mode] << 6); @@ -792,7 +792,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w) /********************************************************************************************************************/ case 0x0e: // Godzilla / Seibu Cup Soccer { - UINT32 src, dst, size, i; + uint32_t src, dst, size, i; src = (cop_dma_src[cop_dma_mode] << 6); dst = (cop_dma_dst[cop_dma_mode] << 6); @@ -810,7 +810,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w) /********************************************************************************************************************/ case 0x116: // Godzilla { - UINT32 length, address; + uint32_t length, address; int i; //if(cop_dma_dst[cop_dma_mode] != 0x0000) // Invalid? @@ -846,7 +846,7 @@ WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w) void raiden2cop_device::bcd_update() { //int digits = 1 << cop_itoa_mode*2; - UINT32 val = cop_itoa; + uint32_t val = cop_itoa; //if(digits > 9) int digits = 9; @@ -873,7 +873,7 @@ void raiden2cop_device::bcd_update() WRITE16_MEMBER(raiden2cop_device::cop_itoa_low_w) { - cop_itoa = (cop_itoa & ~UINT32(mem_mask)) | (data & mem_mask); + cop_itoa = (cop_itoa & ~uint32_t(mem_mask)) | (data & mem_mask); bcd_update(); } @@ -949,7 +949,7 @@ READ16_MEMBER( raiden2cop_device::cop_reg_low_r) WRITE16_MEMBER( raiden2cop_device::cop_reg_low_w) { - cop_regs[offset] = (cop_regs[offset] & ~UINT32(mem_mask)) | (data & mem_mask); + cop_regs[offset] = (cop_regs[offset] & ~uint32_t(mem_mask)) | (data & mem_mask); } WRITE16_MEMBER( raiden2cop_device::cop_hitbox_baseadr_w) @@ -957,7 +957,7 @@ WRITE16_MEMBER( raiden2cop_device::cop_hitbox_baseadr_w) COMBINE_DATA(&cop_hit_baseadr); } -void raiden2cop_device::cop_collision_read_pos(int slot, UINT32 spradr, bool allow_swap) +void raiden2cop_device::cop_collision_read_pos(int slot, uint32_t spradr, bool allow_swap) { cop_collision_info[slot].allow_swap = allow_swap; cop_collision_info[slot].flags_swap = cop_read_word(spradr+2); @@ -986,9 +986,9 @@ Y = collides between 0xd0 and 0x30 (not inclusive) 0x588 bits 2 & 3 = 0x580 bits 0 & 1 */ -void raiden2cop_device::cop_collision_update_hitbox(UINT16 data, int slot, UINT32 hitadr) +void raiden2cop_device::cop_collision_update_hitbox(uint16_t data, int slot, uint32_t hitadr) { - UINT32 hitadr2 = m_host_space->read_word(hitadr) | (cop_hit_baseadr << 16); // DON'T use cop_read_word here, doesn't need endian fixing?! + uint32_t hitadr2 = m_host_space->read_word(hitadr) | (cop_hit_baseadr << 16); // DON'T use cop_read_word here, doesn't need endian fixing?! int num_axis = 2; int extraxor = 0; if (m_host_endian) extraxor = 1; @@ -1009,19 +1009,19 @@ void raiden2cop_device::cop_collision_update_hitbox(UINT16 data, int slot, UINT cop_collision_info[slot].size[i] = m_host_space->read_byte(extraxor^ (hitadr2++)); } - INT16 dx[3],size[3]; + int16_t dx[3],size[3]; for (i = 0; i < num_axis; i++) { - size[i] = UINT8(cop_collision_info[slot].size[i]); - dx[i] = INT8(cop_collision_info[slot].dx[i]); + size[i] = uint8_t(cop_collision_info[slot].size[i]); + dx[i] = int8_t(cop_collision_info[slot].dx[i]); } - //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]); + //printf("%02x %02x %02x %02x %02x %02x\n", (uint8_t)size[i], (uint8_t)dx[i], (uint8_t)size[1], (uint8_t)dx[1], (uint8_t)size[2], (uint8_t)dx[2]); int j = slot; - UINT8 res; + uint8_t res; if (num_axis==3) res = 7; else res = 3; @@ -1355,7 +1355,7 @@ WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w) { return; } - UINT16 funcval, funcmask; + uint16_t funcval, funcmask; // this is pointless.. all we use it for is comparing against the same value funcval = get_func_value(command); funcmask = get_func_mask(command); diff --git a/src/mame/machine/seibucop/seibucop.h b/src/mame/machine/seibucop/seibucop.h index 7802f791f3a..da7eea7731a 100644 --- a/src/mame/machine/seibucop/seibucop.h +++ b/src/mame/machine/seibucop/seibucop.h @@ -29,14 +29,14 @@ class raiden2cop_device : public device_t { public: - raiden2cop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + raiden2cop_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // Command Table - UINT16 cop_func_trigger[0x100/8]; /* function trigger */ - UINT16 cop_func_value[0x100/8]; /* function value (?) */ - UINT16 cop_func_mask[0x100/8]; /* function mask (?) */ - UINT16 cop_program[0x100]; /* program "code" */ - UINT16 cop_latch_addr, cop_latch_trigger, cop_latch_value, cop_latch_mask; + uint16_t cop_func_trigger[0x100/8]; /* function trigger */ + uint16_t cop_func_value[0x100/8]; /* function value (?) */ + uint16_t cop_func_mask[0x100/8]; /* function mask (?) */ + uint16_t cop_program[0x100]; /* program "code" */ + uint16_t cop_latch_addr, cop_latch_trigger, cop_latch_value, cop_latch_mask; DECLARE_WRITE16_MEMBER( cop_pgm_data_w ); DECLARE_WRITE16_MEMBER( cop_pgm_addr_w ); @@ -46,18 +46,18 @@ public: // these are used by legionna.c to find the command based on trigger value // legionna/seicop implementation then looks up the command based on hardcoded sequences in the driver rather than actually using the trigger value (should be changed) - UINT16 get_func_value(int command) { return cop_func_value[command]; } - UINT16 get_func_mask(int command) { return cop_func_mask[command]; } - int find_trigger_match(UINT16 triggerval, UINT16 mask); - int check_command_matches(int command, UINT16 seq0, UINT16 seq1, UINT16 seq2, UINT16 seq3, UINT16 seq4, UINT16 seq5, UINT16 seq6, UINT16 seq7, UINT16 _funcval_, UINT16 _funcmask_); + uint16_t get_func_value(int command) { return cop_func_value[command]; } + uint16_t get_func_mask(int command) { return cop_func_mask[command]; } + int find_trigger_match(uint16_t triggerval, uint16_t mask); + int check_command_matches(int command, uint16_t seq0, uint16_t seq1, uint16_t seq2, uint16_t seq3, uint16_t seq4, uint16_t seq5, uint16_t seq6, uint16_t seq7, uint16_t _funcval_, uint16_t _funcmask_); // DMA - UINT16 cop_dma_v1, cop_dma_v2, cop_dma_mode; - UINT16 cop_dma_src[0x200], cop_dma_dst[0x200], cop_dma_size[0x200]; - UINT16 cop_dma_adr_rel; + uint16_t cop_dma_v1, cop_dma_v2, cop_dma_mode; + uint16_t cop_dma_src[0x200], cop_dma_dst[0x200], cop_dma_size[0x200]; + uint16_t cop_dma_adr_rel; - UINT16 pal_brightness_val; - UINT16 pal_brightness_mode; + uint16_t pal_brightness_val; + uint16_t pal_brightness_mode; DECLARE_WRITE16_MEMBER( cop_dma_v1_w ); DECLARE_WRITE16_MEMBER( cop_dma_v2_w ); @@ -74,7 +74,7 @@ public: DECLARE_WRITE16_MEMBER ( cop_dma_trigger_w ); - UINT8 fade_table(int v); + uint8_t fade_table(int v); template static devcb_base &set_m_videoramout_cb(device_t &device, _Object object) { return downcast(device).m_videoramout_cb.set_callback(object); } @@ -85,9 +85,9 @@ public: DECLARE_WRITE16_MEMBER( cop_itoa_mode_w ); DECLARE_READ16_MEMBER ( cop_itoa_digits_r ); - UINT32 cop_itoa; - UINT16 cop_itoa_mode; - UINT8 cop_itoa_digits[10]; + uint32_t cop_itoa; + uint16_t cop_itoa_mode; + uint8_t cop_itoa_digits[10]; // Main COP functionality @@ -112,12 +112,12 @@ public: DECLARE_WRITE16_MEMBER(cop_hitbox_baseadr_w); - UINT32 cop_regs[8]; - UINT16 cop_status, cop_scale, cop_angle, cop_dist; + uint32_t cop_regs[8]; + uint16_t cop_status, cop_scale, cop_angle, cop_dist; - UINT16 cop_angle_target; - UINT16 cop_angle_step; + uint16_t cop_angle_target; + uint16_t cop_angle_step; struct colinfo { @@ -135,27 +135,27 @@ public: } - INT16 pos[3]; - INT8 dx[3]; - UINT8 size[3]; + int16_t pos[3]; + int8_t dx[3]; + uint8_t size[3]; bool allow_swap; - UINT16 flags_swap; - UINT32 spradr; - INT16 min[3], max[3]; + uint16_t flags_swap; + uint32_t spradr; + int16_t min[3], max[3]; }; colinfo cop_collision_info[2]; - UINT16 cop_hit_status, cop_hit_baseadr; - INT16 cop_hit_val[3]; - UINT16 cop_hit_val_stat; + uint16_t cop_hit_status, cop_hit_baseadr; + int16_t cop_hit_val[3]; + uint16_t cop_hit_val_stat; // Sort DMA (zeroteam, cupsoc) - UINT32 cop_sort_ram_addr, cop_sort_lookup; - UINT16 cop_sort_param; + uint32_t cop_sort_ram_addr, cop_sort_lookup; + uint16_t cop_sort_param; DECLARE_WRITE16_MEMBER(cop_sort_lookup_hi_w); DECLARE_WRITE16_MEMBER(cop_sort_lookup_lo_w); @@ -165,14 +165,14 @@ public: DECLARE_WRITE16_MEMBER(cop_sort_dma_trig_w); // RNG (cupsoc) - UINT16 m_cop_rng_max_value; + uint16_t m_cop_rng_max_value; DECLARE_READ16_MEMBER(cop_prng_r); DECLARE_WRITE16_MEMBER(cop_prng_maxvalue_w); DECLARE_READ16_MEMBER(cop_prng_maxvalue_r); // misc 68k (grainbow) - UINT32 m_cop_sprite_dma_param; - UINT32 m_cop_sprite_dma_src; + uint32_t m_cop_sprite_dma_param; + uint32_t m_cop_sprite_dma_src; DECLARE_WRITE16_MEMBER(cop_sprite_dma_param_hi_w); DECLARE_WRITE16_MEMBER(cop_sprite_dma_param_lo_w); @@ -183,11 +183,11 @@ public: int m_cop_sprite_dma_size; // misc 68k - UINT16 m_cop_unk_param_a,m_cop_unk_param_b; + uint16_t m_cop_unk_param_a,m_cop_unk_param_b; DECLARE_WRITE16_MEMBER(cop_unk_param_a_w); DECLARE_WRITE16_MEMBER(cop_unk_param_b_w); - UINT16 m_cop_rom_addr_lo,m_cop_rom_addr_hi,m_cop_precmd; + uint16_t m_cop_rom_addr_lo,m_cop_rom_addr_hi,m_cop_precmd; DECLARE_WRITE16_MEMBER(cop_precmd_w); DECLARE_WRITE16_MEMBER(cop_rom_addr_lo_w); DECLARE_WRITE16_MEMBER(cop_rom_addr_hi_w); @@ -215,63 +215,63 @@ private: cpu_device *m_host_cpu; /**< reference to the host cpu */ address_space *m_host_space; /**< reference to the host cpu space */ bool m_host_endian; /**< reference to the host cpu endianness, some commands cares! */ - UINT8 m_byte_endian_val; /**< 2 if m_host_endian is big (68k) else 0 */ - UINT8 m_word_endian_val; /**< 3 if m_host_endian is big (68k) else 0 */ + uint8_t m_byte_endian_val; /**< 2 if m_host_endian is big (68k) else 0 */ + uint8_t m_word_endian_val; /**< 3 if m_host_endian is big (68k) else 0 */ - void cop_collision_read_pos(int slot, UINT32 spradr, bool allow_swap); + void cop_collision_read_pos(int slot, uint32_t spradr, bool allow_swap); // commands, TODO: needs commenting! - void execute_8100(int offset, UINT16 data); - void execute_8900(int offset, UINT16 data); - - void execute_42c2(int offset, UINT16 data); - void execute_4aa0(int offset, UINT16 data); - void execute_6200(int offset, UINT16 data); - - void execute_338e(int offset, UINT16 data); - void execute_2288(int offset, UINT16 data); - void execute_0205(int offset, UINT16 data); - void execute_3b30(int offset, UINT16 data); - void execute_130e(int offset, UINT16 data); - void execute_0904(int offset, UINT16 data); - void execute_2a05(int offset, UINT16 data); - void execute_7e05(int offset, UINT16 data); - void execute_5205(int offset, UINT16 data); - void execute_5a05(int offset, UINT16 data); - - void execute_f205(int offset, UINT16 data); - void execute_a100(int offset, UINT16 data); - void execute_a900(int offset, UINT16 data); - void execute_b100(int offset, UINT16 data); - void execute_b900(int offset, UINT16 data); - void execute_f105(int offset, UINT16 data); + void execute_8100(int offset, uint16_t data); + void execute_8900(int offset, uint16_t data); + + void execute_42c2(int offset, uint16_t data); + void execute_4aa0(int offset, uint16_t data); + void execute_6200(int offset, uint16_t data); + + void execute_338e(int offset, uint16_t data); + void execute_2288(int offset, uint16_t data); + void execute_0205(int offset, uint16_t data); + void execute_3b30(int offset, uint16_t data); + void execute_130e(int offset, uint16_t data); + void execute_0904(int offset, uint16_t data); + void execute_2a05(int offset, uint16_t data); + void execute_7e05(int offset, uint16_t data); + void execute_5205(int offset, uint16_t data); + void execute_5a05(int offset, uint16_t data); + + void execute_f205(int offset, uint16_t data); + void execute_a100(int offset, uint16_t data); + void execute_a900(int offset, uint16_t data); + void execute_b100(int offset, uint16_t data); + void execute_b900(int offset, uint16_t data); + void execute_f105(int offset, uint16_t data); // TODO: remove/rename these - //void LEGACY_execute_130e(int offset, UINT16 data); - void LEGACY_execute_130e_cupsoc(int offset, UINT16 data); - //void LEGACY_execute_3b30(int offset, UINT16 data); - //void LEGACY_execute_42c2(int offset, UINT16 data); - void LEGACY_execute_e30e(int offset, UINT16 data); - void LEGACY_execute_6200(int offset, UINT16 data); - void LEGACY_execute_dde5(int offset, UINT16 data); - void LEGACY_execute_d104(int offset, UINT16 data); - void LEGACY_execute_6980(int offset, UINT16 data); - void LEGACY_execute_c480(int offset, UINT16 data); - - void cop_collision_update_hitbox(UINT16 data, int slot, UINT32 hitadr); + //void LEGACY_execute_130e(int offset, uint16_t data); + void LEGACY_execute_130e_cupsoc(int offset, uint16_t data); + //void LEGACY_execute_3b30(int offset, uint16_t data); + //void LEGACY_execute_42c2(int offset, uint16_t data); + void LEGACY_execute_e30e(int offset, uint16_t data); + void LEGACY_execute_6200(int offset, uint16_t data); + void LEGACY_execute_dde5(int offset, uint16_t data); + void LEGACY_execute_d104(int offset, uint16_t data); + void LEGACY_execute_6980(int offset, uint16_t data); + void LEGACY_execute_c480(int offset, uint16_t data); + + void cop_collision_update_hitbox(uint16_t data, int slot, uint32_t hitadr); void bcd_update(); - UINT16 cop_read_word(int address); - UINT8 cop_read_byte(int address); - void cop_write_word(int address, UINT16 data); - void cop_write_byte(int address, UINT8 data); + uint16_t cop_read_word(int address); + uint8_t cop_read_byte(int address); + void cop_write_word(int address, uint16_t data); + void cop_write_byte(int address, uint8_t data); void dma_tilemap_buffer(); void dma_palette_buffer(); void dma_fill(); void dma_palette_brightness(); - void dma_zsorting(UINT16 data); + void dma_zsorting(uint16_t data); }; extern const device_type RAIDEN2COP; diff --git a/src/mame/machine/seibucop/seibucop_cmd.hxx b/src/mame/machine/seibucop/seibucop_cmd.hxx index d699e7a3026..94a7bbe7edd 100644 --- a/src/mame/machine/seibucop/seibucop_cmd.hxx +++ b/src/mame/machine/seibucop/seibucop_cmd.hxx @@ -19,7 +19,7 @@ 00 - 0205 ( 00) ( 205) : (188, 282, 082, b8e, 98e, 000, 000, 000) 6 ffeb (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) 00 - 0105 ( 00) ( 105) : (180, 2e0, 0a0, 000, 000, 000, 000, 000) 6 fffb (zeroteamsr) */ -void raiden2cop_device::execute_0205(int offset, UINT16 data) +void raiden2cop_device::execute_0205(int offset, uint16_t data) { int ppos = m_host_space->read_dword(cop_regs[0] + 0x04 + offset * 4); int npos = ppos + m_host_space->read_dword(cop_regs[0] + 0x10 + offset * 4); @@ -39,7 +39,7 @@ void raiden2cop_device::execute_0205(int offset, UINT16 data) // triggered with 0904 0905 -void raiden2cop_device::execute_0904(int offset, UINT16 data) +void raiden2cop_device::execute_0904(int offset, uint16_t data) { #if LOG_Move0905 printf("cmd %04x: %08x %08x [%08x]\n",data, m_host_space->read_dword(cop_regs[0] + 16 + offset * 4),m_host_space->read_dword(cop_regs[0] + 0x28 + offset * 4),cop_regs[0]); @@ -62,13 +62,13 @@ void raiden2cop_device::execute_0904(int offset, UINT16 data) */ // triggered with 130e, 138e -void raiden2cop_device::execute_130e(int offset, UINT16 data) +void raiden2cop_device::execute_130e(int offset, uint16_t data) { // this can't be right, or bits 15-12 from mask have different meaning ... execute_338e(offset, data); } -void raiden2cop_device::LEGACY_execute_130e_cupsoc(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_130e_cupsoc(int offset, uint16_t data) { int dy = m_host_space->read_dword(cop_regs[1] + 4) - m_host_space->read_dword(cop_regs[0] + 4); int dx = m_host_space->read_dword(cop_regs[1] + 8) - m_host_space->read_dword(cop_regs[0] + 8); @@ -110,7 +110,7 @@ void raiden2cop_device::LEGACY_execute_130e_cupsoc(int offset, UINT16 data) */ // also triggered with 0x2208 -void raiden2cop_device::execute_2288(int offset, UINT16 data) +void raiden2cop_device::execute_2288(int offset, uint16_t data) { int dx = m_host_space->read_word(cop_regs[0] + 0x12); int dy = m_host_space->read_word(cop_regs[0] + 0x16); @@ -135,7 +135,7 @@ void raiden2cop_device::execute_2288(int offset, UINT16 data) 05 - 2a05 ( 05) ( 205) : (9af, a82, 082, a8f, 18e, 000, 000, 000) 6 ebeb (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) */ -void raiden2cop_device::execute_2a05(int offset, UINT16 data) +void raiden2cop_device::execute_2a05(int offset, uint16_t data) { int delta = m_host_space->read_word(cop_regs[1] + 0x1e + offset * 4); m_host_space->write_dword(cop_regs[0] + 4 + 2 + offset * 4, m_host_space->read_word(cop_regs[0] + 4 + 2 + offset * 4) + delta); @@ -148,7 +148,7 @@ void raiden2cop_device::execute_2a05(int offset, UINT16 data) 06 - 338e ( 06) ( 38e) : (984, aa4, d82, aa2, 39c, b9c, b9c, a9a) 5 bf7f (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx) 06 - 330e ( 06) ( 30e) : (984, aa4, d82, aa2, 39c, b9c, b9c, a9a) 5 bf7f (zeroteam, xsedae) */ -void raiden2cop_device::execute_338e(int offset, UINT16 data) +void raiden2cop_device::execute_338e(int offset, uint16_t data) { int dx = m_host_space->read_dword(cop_regs[1] + 4) - m_host_space->read_dword(cop_regs[0] + 4); int dy = m_host_space->read_dword(cop_regs[1] + 8) - m_host_space->read_dword(cop_regs[0] + 8); @@ -185,7 +185,7 @@ void raiden2cop_device::execute_338e(int offset, UINT16 data) // triggered with 0x39b0, 0x3b30, 0x3bb0 -void raiden2cop_device::execute_3b30(int offset, UINT16 data) +void raiden2cop_device::execute_3b30(int offset, uint16_t data) { /* TODO: these are actually internally loaded via 0x130e command */ int dx, dy; @@ -209,7 +209,7 @@ void raiden2cop_device::execute_3b30(int offset, UINT16 data) ## - trig (up5) (low11) : (sq0, sq1, sq2, sq3, sq4, sq5, sq6, sq7) valu mask 08 - 42c2 ( 08) ( 2c2) : (f9a, b9a, b9c, b9c, b9c, 29c, 000, 000) 5 fcdd (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) */ -void raiden2cop_device::execute_42c2(int offset, UINT16 data) +void raiden2cop_device::execute_42c2(int offset, uint16_t data) { int div = cop_read_word(cop_regs[0] + (0x36)); @@ -241,7 +241,7 @@ void raiden2cop_device::execute_42c2(int offset, UINT16 data) ## - trig (up5) (low11) : (sq0, sq1, sq2, sq3, sq4, sq5, sq6, sq7) valu mask 09 - 4aa0 ( 09) ( 2a0) : (f9a, b9a, b9c, b9c, b9c, 99b, 000, 000) 5 fcdd (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) */ -void raiden2cop_device::execute_4aa0(int offset, UINT16 data) +void raiden2cop_device::execute_4aa0(int offset, uint16_t data) { int div = m_host_space->read_word(cop_regs[0] + (0x38)); if (!div) @@ -259,7 +259,7 @@ void raiden2cop_device::execute_4aa0(int offset, UINT16 data) 0a - 5205 ( 0a) ( 205) : (180, 2e0, 3a0, 0a0, 3a0, 000, 000, 000) 6 fff7 (raiden2, raidendx) 0a - 5105 ( 0a) ( 105) : (180, 2e0, 0a0, 000, 000, 000, 000, 000) 6 fffb (zeroteam, xsedae) */ -void raiden2cop_device::execute_5205(int offset, UINT16 data) +void raiden2cop_device::execute_5205(int offset, uint16_t data) { m_host_space->write_dword(cop_regs[1], m_host_space->read_dword(cop_regs[0])); } @@ -269,7 +269,7 @@ void raiden2cop_device::execute_5205(int offset, UINT16 data) 0b - 5a05 ( 0b) ( 205) : (180, 2e0, 3a0, 0a0, 3a0, 000, 000, 000) 6 fff7 (raiden2, raidendx) 0b - 5a85 ( 0b) ( 285) : (180, 2e0, 0a0, 182, 2e0, 0c0, 3c0, 3c0) 6 ffdb (zeroteam, xsedae) */ -void raiden2cop_device::execute_5a05(int offset, UINT16 data) +void raiden2cop_device::execute_5a05(int offset, uint16_t data) { m_host_space->write_dword(cop_regs[1], m_host_space->read_dword(cop_regs[0])); } @@ -279,13 +279,13 @@ void raiden2cop_device::execute_5a05(int offset, UINT16 data) 0c - 6200 ( 0c) ( 200) : (380, 39a, 380, a80, 29a, 000, 000, 000) 8 f3e7 (legionn, heatbrla, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) 0c - 6200 ( 0c) ( 200) : (3a0, 3a6, 380, aa0, 2a6, 000, 000, 000) 8 f3e7 (cupsoc) */ -void raiden2cop_device::execute_6200(int offset, UINT16 data) +void raiden2cop_device::execute_6200(int offset, uint16_t data) { int primary_reg = 0; int primary_offset = 0x34; - UINT8 angle = cop_read_byte(cop_regs[primary_reg] + primary_offset); - UINT16 flags = cop_read_word(cop_regs[primary_reg]); + uint8_t angle = cop_read_byte(cop_regs[primary_reg] + primary_offset); + uint16_t flags = cop_read_word(cop_regs[primary_reg]); cop_angle_target &= 0xff; cop_angle_step &= 0xff; flags &= ~0x0004; @@ -321,13 +321,13 @@ void raiden2cop_device::execute_6200(int offset, UINT16 data) } -void raiden2cop_device::LEGACY_execute_6200(int offset, UINT16 data) // this is for cupsoc, different sequence, works on different registers +void raiden2cop_device::LEGACY_execute_6200(int offset, uint16_t data) // this is for cupsoc, different sequence, works on different registers { int primary_reg = 1; int primary_offset = 0xc; - UINT8 angle = cop_read_byte(cop_regs[primary_reg] + primary_offset); - UINT16 flags = cop_read_word(cop_regs[primary_reg]); + uint8_t angle = cop_read_byte(cop_regs[primary_reg] + primary_offset); + uint16_t flags = cop_read_word(cop_regs[primary_reg]); cop_angle_target &= 0xff; cop_angle_step &= 0xff; flags &= ~0x0004; @@ -366,9 +366,9 @@ void raiden2cop_device::LEGACY_execute_6200(int offset, UINT16 data) // this is 0d - 6880 ( 0d) ( 080) : (b80, ba0, 000, 000, 000, 000, 000, 000) a fff3 (legionna, heatbrl, cupsoc, godzilla, denjinmk) 0d - 6980 ( 0d) ( 180) : (b80, ba0, 000, 000, 000, 000, 000, 000) a fff3 (grainbow, zeroteam, xsedae) */ -void raiden2cop_device::LEGACY_execute_6980(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_6980(int offset, uint16_t data) { - UINT8 offs; + uint8_t offs; int abs_x, abs_y, rel_xy; offs = (offset & 3) * 4; @@ -400,7 +400,7 @@ void raiden2cop_device::LEGACY_execute_6980(int offset, UINT16 data) 0f - 7e05 ( 0f) ( 605) : (180, 282, 080, 180, 282, 000, 000, 000) 6 fffb (raidendx) */ -void raiden2cop_device::execute_7e05(int offset, UINT16 data) // raidendx +void raiden2cop_device::execute_7e05(int offset, uint16_t data) // raidendx { m_host_space->write_byte(0x470, m_host_space->read_byte(cop_regs[4])); } @@ -410,7 +410,7 @@ void raiden2cop_device::execute_7e05(int offset, UINT16 data) // raidendx 10 - 8100 ( 10) ( 100) : (b9a, b88, 888, 000, 000, 000, 000, 000) 7 fdfb (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) */ -void raiden2cop_device::execute_8100(int offset, UINT16 data) +void raiden2cop_device::execute_8100(int offset, uint16_t data) { int raw_angle = (cop_read_word(cop_regs[0] + (0x34)) & 0xff); double angle = raw_angle * M_PI / 128; @@ -427,7 +427,7 @@ void raiden2cop_device::execute_8100(int offset, UINT16 data) ## - trig (up5) (low11) : (sq0, sq1, sq2, sq3, sq4, sq5, sq6, sq7) valu mask 11 - 8900 ( 11) ( 100) : (b9a, b8a, 88a, 000, 000, 000, 000, 000) 7 fdfb (legionna, heatbrl, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) */ -void raiden2cop_device::execute_8900(int offset, UINT16 data) +void raiden2cop_device::execute_8900(int offset, uint16_t data) { int raw_angle = (cop_read_word(cop_regs[0] + (0x34)) & 0xff); double angle = raw_angle * M_PI / 128; @@ -466,7 +466,7 @@ void raiden2cop_device::execute_8900(int offset, UINT16 data) */ // the last value (ffff / 02ff / 00ff depending on game) might be important here as they've been intentionally changed for the different games -void raiden2cop_device::execute_a100(int offset, UINT16 data) +void raiden2cop_device::execute_a100(int offset, uint16_t data) { cop_collision_read_pos(0, cop_regs[0], data & 0x0080); } @@ -477,7 +477,7 @@ void raiden2cop_device::execute_a100(int offset, UINT16 data) 15 - a900 ( 15) ( 100) : (ba0, ba2, ba4, ba6, 000, 000, 000, 000) f ffff (heatbrl, zeroteam), xsedae 15 - a980 ( 15) ( 180) : (ba0, ba2, ba4, ba6, 000, 000, 000, 000) f 02ff (grainbow) 15 - a900 ( 15) ( 100) : (ba0, ba2, ba4, ba6, 000, 000, 000, 000) f 00ff (raiden2, raidendx)*/ -void raiden2cop_device::execute_a900(int offset, UINT16 data) +void raiden2cop_device::execute_a900(int offset, uint16_t data) { cop_collision_read_pos(1, cop_regs[1], data & 0x0080); } @@ -488,7 +488,7 @@ void raiden2cop_device::execute_a900(int offset, UINT16 data) 16 - b100 ( 16) ( 100) : (b40, bc0, bc2, 000, 000, 000, 000, 000) 9 ffff (legionna, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) 16 - b080 ( 16) ( 080) : (b40, bc0, bc2, 000, 000, 000, 000, 000) 9 ffff (heatbrl) */ -void raiden2cop_device::execute_b100(int offset, UINT16 data) +void raiden2cop_device::execute_b100(int offset, uint16_t data) { cop_collision_update_hitbox(data, 0, cop_regs[2]); } @@ -501,7 +501,7 @@ void raiden2cop_device::execute_b100(int offset, UINT16 data) 17 - b900 ( 17) ( 100) : (b60, be0, be2, 000, 000, 000, 000, 000) 6 ffff (legionna, cupsoc, grainbow, godzilla, denjinmk, raiden2, raidendx, zeroteam, xsedae) 17 - b880 ( 17) ( 080) : (b60, be0, be2, 000, 000, 000, 000, 000) 6 ffff (heatbrl) */ -void raiden2cop_device::execute_b900(int offset, UINT16 data) +void raiden2cop_device::execute_b900(int offset, uint16_t data) { cop_collision_update_hitbox(data, 1, cop_regs[3]); } @@ -514,9 +514,9 @@ void raiden2cop_device::execute_b900(int offset, UINT16 data) 18 - 7c80 ( 0f) ( 480) : (080, 882, 000, 000, 000, 000, 000, 000) a ff00 (zeroteam, xsedae) */ -void raiden2cop_device::LEGACY_execute_c480(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_c480(int offset, uint16_t data) { - UINT8 offs; + uint8_t offs; offs = (offset & 3) * 4; @@ -534,11 +534,11 @@ void raiden2cop_device::LEGACY_execute_c480(int offset, UINT16 data) ## - trig (up5) (low11) : (sq0, sq1, sq2, sq3, sq4, sq5, sq6, sq7) valu mask 1a - d104 ( 1a) ( 104) : (ac2, 9e0, 0a2, 000, 000, 000, 000, 000) 5 fffb (cupsoc, grainbow) */ -void raiden2cop_device::LEGACY_execute_d104(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_d104(int offset, uint16_t data) { - UINT16 *ROM = (UINT16 *)m_host_space->machine().root_device().memregion("maincpu")->base(); - UINT32 rom_addr = (m_cop_rom_addr_hi << 16 | m_cop_rom_addr_lo); - UINT16 rom_data = ROM[rom_addr / 2]; + uint16_t *ROM = (uint16_t *)m_host_space->machine().root_device().memregion("maincpu")->base(); + uint32_t rom_addr = (m_cop_rom_addr_hi << 16 | m_cop_rom_addr_lo); + uint16_t rom_data = ROM[rom_addr / 2]; /* writes to some unemulated COP registers, then puts the result in here, adding a parameter taken from ROM */ //m_host_space->write_word(cop_regs[0]+(0x44 + offset * 4), rom_data); @@ -550,12 +550,12 @@ void raiden2cop_device::LEGACY_execute_d104(int offset, UINT16 data) 1b - dde5 ( 1b) ( 5e5) : (f80, aa2, 984, 0c2, 000, 000, 000, 000) 5 7ff7 (cupsoc, grainbow) */ -void raiden2cop_device::LEGACY_execute_dde5(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_dde5(int offset, uint16_t data) { - UINT8 offs; + uint8_t offs; int div; - INT16 dir_offset; - // INT16 offs_val; + int16_t dir_offset; + // int16_t offs_val; /* TODO: [4-7] could be mirrors of [0-3] (this is the only command so far that uses 4-7 actually)*/ /* ? 0 + [4] */ @@ -591,7 +591,7 @@ void raiden2cop_device::LEGACY_execute_dde5(int offset, UINT16 data) 1c - e105 ( 1c) ( 105) : (a88, 994, 088, 000, 000, 000, 000, 000) 5 06fb (zeroteam, xsedae) */ // controls GK position, aligned to the ball position -void raiden2cop_device::LEGACY_execute_e30e(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_e30e(int offset, uint16_t data) { int dy = m_host_space->read_dword(cop_regs[2] + 4) - m_host_space->read_dword(cop_regs[0] + 4); int dx = m_host_space->read_dword(cop_regs[2] + 8) - m_host_space->read_dword(cop_regs[0] + 8); @@ -633,7 +633,7 @@ void raiden2cop_device::LEGACY_execute_e30e(int offset, UINT16 data) 1e - f790 ( 1e) ( 790) : (f80, b84, b84, b84, b84, b84, b84, b84) 4 00ff (zeroteam, xsedae) */ -void raiden2cop_device::execute_f205(int offset, UINT16 data) +void raiden2cop_device::execute_f205(int offset, uint16_t data) { m_host_space->write_dword(cop_regs[2], m_host_space->read_dword(cop_regs[0]+4)); } @@ -650,7 +650,7 @@ void raiden2cop_device::execute_f205(int offset, UINT16 data) [:raiden2cop] COPDIS: f105 s=f0 f1=0 l=3 f2=05 5 fefb f2 088 01.0.08 [:raiden2cop] addmem32 10(r0) */ // seibu cup soccer, before cosine (ball dribbling actually?) -void raiden2cop_device::execute_f105(int offset, UINT16 data) +void raiden2cop_device::execute_f105(int offset, uint16_t data) { // ... } @@ -659,7 +659,7 @@ void raiden2cop_device::execute_f105(int offset, UINT16 data) // For reference only, will be nuked at some point -void raiden2cop_device::LEGACY_execute_130e(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_130e(int offset, uint16_t data) { int dy = m_host_space->read_dword(cop_regs[1] + 4) - m_host_space->read_dword(cop_regs[0] + 4); int dx = m_host_space->read_dword(cop_regs[1] + 8) - m_host_space->read_dword(cop_regs[0] + 8); @@ -682,7 +682,7 @@ void raiden2cop_device::LEGACY_execute_130e(int offset, UINT16 data) m_host_space->write_word(cop_regs[0] + (0x34 ^ 2), cop_angle); } -void raiden2cop_device::LEGACY_execute_3b30(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_3b30(int offset, uint16_t data) { int dy = m_LEGACY_r0; int dx = m_LEGACY_r1; @@ -695,7 +695,7 @@ void raiden2cop_device::LEGACY_execute_3b30(int offset, UINT16 data) m_host_space->write_word(cop_regs[0] + (0x38), cop_dist); } -void raiden2cop_device::LEGACY_execute_42c2(int offset, UINT16 data) +void raiden2cop_device::LEGACY_execute_42c2(int offset, uint16_t data) { int dy = m_LEGACY_r0; int dx = m_LEGACY_r1; @@ -731,7 +731,7 @@ void raiden2cop_device::LEGACY_execute_42c2(int offset, UINT16 data) } // used by seibu cup soccer, not sure if right so left out -void raiden2cop_device::execute_5105(int offset, UINT16 data) +void raiden2cop_device::execute_5105(int offset, uint16_t data) { int res = m_host_space->read_dword(cop_regs[0]) + m_host_space->read_dword(cop_regs[0]+8); m_host_space->write_dword(cop_regs[0]+4, res); @@ -742,7 +742,7 @@ void raiden2cop_device::execute_5105(int offset, UINT16 data) [:raiden2cop] COPDIS: 5905 s=58 f1=0 l=3 f2=05 5 fffb 59 a84 15.0.04 [:raiden2cop] sub32 8(r0) [:raiden2cop] COPDIS: 5905 s=58 f1=0 l=3 f2=05 5 fffb 5a 0a2 01.1.02 [:raiden2cop] addmem32 4(r1) */ -void raiden2cop_device::execute_5905(int offset, UINT16 data) +void raiden2cop_device::execute_5905(int offset, uint16_t data) { int res = m_host_space->read_dword(cop_regs[2]+10 + offset*4) - m_host_space->read_dword(cop_regs[0]+8 + offset*4); m_host_space->write_dword(cop_regs[1]+4 + offset *4, res); diff --git a/src/mame/machine/seibucop/seibucop_dma.hxx b/src/mame/machine/seibucop/seibucop_dma.hxx index eb0a24338c1..c409bf54b90 100644 --- a/src/mame/machine/seibucop/seibucop_dma.hxx +++ b/src/mame/machine/seibucop/seibucop_dma.hxx @@ -7,7 +7,7 @@ void raiden2cop_device::dma_tilemap_buffer() for (int i = 0; i < 0x2800 / 2; i++) { - UINT16 tileval = m_host_space->read_word(src); + uint16_t tileval = m_host_space->read_word(src); src += 2; m_videoramout_cb(i, tileval, 0xffff); } @@ -20,7 +20,7 @@ void raiden2cop_device::dma_palette_buffer() for (int i = 0; i < 0x1000 / 2; i++) // todo, use length register { - UINT16 palval = m_host_space->read_word(src); + uint16_t palval = m_host_space->read_word(src); src += 2; m_palette->set_pen_color(i, pal5bit(palval >> 0), pal5bit(palval >> 5), pal5bit(palval >> 10)); } @@ -29,7 +29,7 @@ void raiden2cop_device::dma_palette_buffer() // these are typically used to transfer palette data from one RAM buffer to another, applying fade values to it prior to the 0x15 transfer void raiden2cop_device::dma_palette_brightness() { - UINT32 src, dst, size, i; + uint32_t src, dst, size, i; /* Apparently all of those are just different DMA channels, brightness effects are done through a RAM table and the pal_brightness_val / mode @@ -54,7 +54,7 @@ void raiden2cop_device::dma_palette_brightness() for (i = 0; i < size; i++) { - UINT16 pal_val; + uint16_t pal_val; int r, g, b; int rt, gt, bt; @@ -80,8 +80,8 @@ void raiden2cop_device::dma_palette_brightness() { // mode 4 swaps endianness between two words, likely that DMA works in dword steps and bit 0. // TODO: check on V30 flavour - UINT16 targetpaldata = m_host_space->read_word((src + (cop_dma_adr_rel * 0x400)) ^ 2); - UINT16 paldata = m_host_space->read_word(src ^ 2); + uint16_t targetpaldata = m_host_space->read_word((src + (cop_dma_adr_rel * 0x400)) ^ 2); + uint16_t paldata = m_host_space->read_word(src ^ 2); bt = (targetpaldata & 0x7c00) >> 10; b = (paldata & 0x7c00) >> 10; @@ -121,7 +121,7 @@ void raiden2cop_device::dma_palette_brightness() void raiden2cop_device::dma_fill() { - UINT32 length, address; + uint32_t length, address; int i; if (cop_dma_dst[cop_dma_mode] != 0x0000) // Invalid? return; @@ -135,7 +135,7 @@ void raiden2cop_device::dma_fill() m_host_space->write_dword(i, (cop_dma_v1) | (cop_dma_v2 << 16)); /* - UINT32 length, address; + uint32_t length, address; int i; if(cop_dma_dst[cop_dma_mode] != 0x0000) // Invalid? return; @@ -152,11 +152,11 @@ void raiden2cop_device::dma_fill() */ } -void raiden2cop_device::dma_zsorting(UINT16 data) +void raiden2cop_device::dma_zsorting(uint16_t data) { struct sort_entry { - INT32 sorting_key; - UINT16 val; + int32_t sorting_key; + uint16_t val; }; std::vector entries(data); diff --git a/src/mame/machine/seibuspi.cpp b/src/mame/machine/seibuspi.cpp index 08cf66386a8..316e73384ae 100644 --- a/src/mame/machine/seibuspi.cpp +++ b/src/mame/machine/seibuspi.cpp @@ -6,7 +6,7 @@ // add two numbers generating carry from one bit to the next only if // the corresponding bit in carry_mask is 1 -static UINT32 partial_carry_sum(UINT32 add1,UINT32 add2,UINT32 carry_mask,int bits) +static uint32_t partial_carry_sum(uint32_t add1,uint32_t add2,uint32_t carry_mask,int bits) { int i,res,carry; @@ -32,17 +32,17 @@ static UINT32 partial_carry_sum(UINT32 add1,UINT32 add2,UINT32 carry_mask,int bi return res; } -UINT32 partial_carry_sum32(UINT32 add1,UINT32 add2,UINT32 carry_mask) +uint32_t partial_carry_sum32(uint32_t add1,uint32_t add2,uint32_t carry_mask) { return partial_carry_sum(add1,add2,carry_mask,32); } -UINT32 partial_carry_sum24(UINT32 add1,UINT32 add2,UINT32 carry_mask) +uint32_t partial_carry_sum24(uint32_t add1,uint32_t add2,uint32_t carry_mask) { return partial_carry_sum(add1,add2,carry_mask,24); } -static UINT32 partial_carry_sum16(UINT32 add1,UINT32 add2,UINT32 carry_mask) +static uint32_t partial_carry_sum16(uint32_t add1,uint32_t add2,uint32_t carry_mask) { return partial_carry_sum(add1,add2,carry_mask,16); } @@ -70,7 +70,7 @@ Bits 0-3 select the permutation on 16 bits of the source data. Bits 4-14 are added to the source data, with partial carry. Bit 15 is still unknown. */ -static const UINT16 key_table[256]= +static const uint16_t key_table[256]= { 0x3ad7,0x54b1,0x2d41,0x8ca0,0xa69b,0x9018,0x9db9,0x6559, 0xe9a7,0xb087,0x8a5e,0x821c,0xaafc,0x2ae7,0x557b,0xcd80, @@ -121,7 +121,7 @@ static const UINT16 key_table[256]= #endif -static const UINT8 spi_bitswap[16][16] = +static const uint8_t spi_bitswap[16][16] = { { 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, }, { 7, 6, 5,14, 0,15, 4, 3, 2, 8, 9,10,11,12,13, 1, }, @@ -149,7 +149,7 @@ static int key(int table,int addr) } -void seibuspi_sprite_decrypt(UINT8 *src, int rom_size) +void seibuspi_sprite_decrypt(uint8_t *src, int rom_size) { int i; @@ -162,7 +162,7 @@ void seibuspi_sprite_decrypt(UINT8 *src, int rom_size) int s1,s2; int add1,add2; int plane0,plane1,plane2,plane3,plane4,plane5; - const UINT8 *bs; + const uint8_t *bs; y1 = src[2*i+0*rom_size+0] + (src[2*i+0*rom_size+1] << 8); y2 = src[2*i+1*rom_size+0] + (src[2*i+1*rom_size+1] << 8); @@ -328,10 +328,10 @@ CPU 'main' (PC=002A0709): unmapped program memory dword write to 0000054C = 0000 ******************************************************************************************/ -static void sprite_reorder(UINT8 *buffer) +static void sprite_reorder(uint8_t *buffer) { int j; - UINT8 temp[64]; + uint8_t temp[64]; for( j=0; j < 16; j++ ) { temp[2*(j*2)+0] = buffer[2*j+0]; temp[2*(j*2)+1] = buffer[2*j+1]; @@ -341,13 +341,13 @@ static void sprite_reorder(UINT8 *buffer) memcpy(buffer, temp, 64); } -void seibuspi_rise10_sprite_decrypt(UINT8 *rom, int size) +void seibuspi_rise10_sprite_decrypt(uint8_t *rom, int size) { int i; for (i = 0; i < size/2; i++) { - UINT32 plane54,plane3210; + uint32_t plane54,plane3210; plane54 = rom[0*size+2*i] + (rom[0*size+2*i+1] << 8); plane3210 = BITSWAP32( @@ -424,15 +424,15 @@ CPU 'main' (PC=00021C74): unmapped program memory dword write to 0601004C = 0300 ******************************************************************************************/ -static void seibuspi_rise11_sprite_decrypt(UINT8 *rom, int size, - UINT32 k1, UINT32 k2, UINT32 k3, UINT32 k4, UINT32 k5, int feversoc_kludge) +static void seibuspi_rise11_sprite_decrypt(uint8_t *rom, int size, + uint32_t k1, uint32_t k2, uint32_t k3, uint32_t k4, uint32_t k5, int feversoc_kludge) { int i; for (i = 0; i < size/2; i++) { - UINT16 b1,b2,b3; - UINT32 plane543,plane210; + uint16_t b1,b2,b3; + uint32_t plane543,plane210; b1 = rom[0*size+2*i] + (rom[0*size+2*i+1] << 8); b2 = rom[1*size+2*i] + (rom[1*size+2*i+1] << 8); @@ -510,13 +510,13 @@ static void seibuspi_rise11_sprite_decrypt(UINT8 *rom, int size, } -void seibuspi_rise11_sprite_decrypt_rfjet(UINT8 *rom, int size) +void seibuspi_rise11_sprite_decrypt_rfjet(uint8_t *rom, int size) { seibuspi_rise11_sprite_decrypt(rom, size, 0xabcb64, 0x55aadd, 0xab6a4c, 0xd6375b, 0x8bf23b, 0); } -void seibuspi_rise11_sprite_decrypt_feversoc(UINT8 *rom, int size) +void seibuspi_rise11_sprite_decrypt_feversoc(uint8_t *rom, int size) { seibuspi_rise11_sprite_decrypt(rom, size, 0x9df5b2, 0x9ae999, 0x4a32e9, 0x968bd5, 0x1d97ac, 1); } diff --git a/src/mame/machine/seibuspi.h b/src/mame/machine/seibuspi.h index c17a8013881..53e089ab604 100644 --- a/src/mame/machine/seibuspi.h +++ b/src/mame/machine/seibuspi.h @@ -3,10 +3,10 @@ // TODO: modernize code -UINT32 partial_carry_sum32(UINT32 add1,UINT32 add2,UINT32 carry_mask); -UINT32 partial_carry_sum24(UINT32 add1,UINT32 add2,UINT32 carry_mask); +uint32_t partial_carry_sum32(uint32_t add1,uint32_t add2,uint32_t carry_mask); +uint32_t partial_carry_sum24(uint32_t add1,uint32_t add2,uint32_t carry_mask); -void seibuspi_sprite_decrypt(UINT8 *src, int romsize); -void seibuspi_rise10_sprite_decrypt(UINT8 *rom, int romsize); -void seibuspi_rise11_sprite_decrypt_rfjet(UINT8 *rom, int romsize); -void seibuspi_rise11_sprite_decrypt_feversoc(UINT8 *rom, int romsize); +void seibuspi_sprite_decrypt(uint8_t *src, int romsize); +void seibuspi_rise10_sprite_decrypt(uint8_t *rom, int romsize); +void seibuspi_rise11_sprite_decrypt_rfjet(uint8_t *rom, int romsize); +void seibuspi_rise11_sprite_decrypt_feversoc(uint8_t *rom, int romsize); diff --git a/src/mame/machine/seicop.cpp b/src/mame/machine/seicop.cpp index 99e0a97daef..f92468ec712 100644 --- a/src/mame/machine/seicop.cpp +++ b/src/mame/machine/seicop.cpp @@ -43,7 +43,7 @@ WRITE16_MEMBER(seibu_cop_bootleg_device::reg_hi_addr_w) WRITE16_MEMBER(seibu_cop_bootleg_device::cmd_trigger_w) { //printf("%04x %08x %08x\n",data,m_reg[0],m_reg[1]); - UINT8 offs; + uint8_t offs; offs = (offset & 3) * 4; @@ -61,7 +61,7 @@ WRITE16_MEMBER(seibu_cop_bootleg_device::cmd_trigger_w) case 0xdde5: { int div; - INT16 dir_offset; + int16_t dir_offset; div = m_host_space->read_word(m_reg[4] + offs); dir_offset = m_host_space->read_word(m_reg[4] + offs + 8); @@ -157,7 +157,7 @@ WRITE16_MEMBER(seibu_cop_bootleg_device::cmd_trigger_w) */ case 0x8100: { - UINT16 sin_offs; //= m_host_space->read_dword(m_reg[0]+(0x34)); + uint16_t sin_offs; //= m_host_space->read_dword(m_reg[0]+(0x34)); sin_offs = m_host_space->read_byte(m_reg[0]+(0x35)); sin_offs |= m_host_space->read_byte(m_reg[0]+(0x37)) << 8; int raw_angle = (m_host_space->read_word(m_reg[0]+(0x34^2)) & 0xff); @@ -245,7 +245,7 @@ static ADDRESS_MAP_START( seibucopbl_map, AS_0, 16, seibu_cop_bootleg_device ) AM_RANGE(0x1b4, 0x1b5) AM_READ(angle_r) ADDRESS_MAP_END -seibu_cop_bootleg_device::seibu_cop_bootleg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +seibu_cop_bootleg_device::seibu_cop_bootleg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEIBU_COP_BOOTLEG, "Seibu COP (Bootleg)", tag, owner, clock, "seibu_cop_boot", __FILE__), device_memory_interface(mconfig, *this), m_space_config("regs", ENDIANNESS_LITTLE, 16, 9, 0, nullptr, *ADDRESS_MAP_NAME(seibucopbl_map)) @@ -275,7 +275,7 @@ void seibu_cop_bootleg_device::device_config_complete() void seibu_cop_bootleg_device::device_start() { -// m_cop_mcu_ram = reinterpret_cast(machine().root_device().memshare("cop_mcu_ram")->ptr()); +// m_cop_mcu_ram = reinterpret_cast(machine().root_device().memshare("cop_mcu_ram")->ptr()); } @@ -289,7 +289,7 @@ void seibu_cop_bootleg_device::device_reset() m_host_space = &m_host_cpu->space(AS_PROGRAM); } -inline UINT16 seibu_cop_bootleg_device::read_word(offs_t address) +inline uint16_t seibu_cop_bootleg_device::read_word(offs_t address) { return space().read_word(address << 1); } @@ -298,7 +298,7 @@ inline UINT16 seibu_cop_bootleg_device::read_word(offs_t address) // write_word - write a word at the given address //------------------------------------------------- -inline void seibu_cop_bootleg_device::write_word(offs_t address, UINT16 data) +inline void seibu_cop_bootleg_device::write_word(offs_t address, uint16_t data) { space().write_word(address << 1, data); } diff --git a/src/mame/machine/seicop.h b/src/mame/machine/seicop.h index ec771f96edf..3c3659e5828 100644 --- a/src/mame/machine/seicop.h +++ b/src/mame/machine/seicop.h @@ -9,7 +9,7 @@ class seibu_cop_bootleg_device : public device_t, public device_memory_interface { public: - seibu_cop_bootleg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + seibu_cop_bootleg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( copdxbl_0_r ); DECLARE_WRITE16_MEMBER( copdxbl_0_w ); @@ -36,13 +36,13 @@ private: cpu_device *m_host_cpu; /**< reference to the host cpu */ address_space *m_host_space; /**< reference to the host cpu space */ const address_space_config m_space_config; - inline UINT16 read_word(offs_t address); - inline void write_word(offs_t address, UINT16 data); + inline uint16_t read_word(offs_t address); + inline void write_word(offs_t address, uint16_t data); - UINT32 m_reg[8]; - UINT16 m_angle,m_dist,m_status; + uint32_t m_reg[8]; + uint16_t m_angle,m_dist,m_status; int m_dx,m_dy; - UINT32 m_d104_move_offset; + uint32_t m_d104_move_offset; //required_device m_raiden2cop; }; diff --git a/src/mame/machine/sgi.cpp b/src/mame/machine/sgi.cpp index d9b6e8b8887..c190315041c 100644 --- a/src/mame/machine/sgi.cpp +++ b/src/mame/machine/sgi.cpp @@ -30,7 +30,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_ const device_type SGI_MC = &device_creator; -sgi_mc_device::sgi_mc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sgi_mc_device::sgi_mc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SGI_MC, "SGI Memory Controller", tag, owner, clock, "sgi_mc", __FILE__), m_tUpdateTimer(nullptr), m_nCPUControl0(0), diff --git a/src/mame/machine/sgi.h b/src/mame/machine/sgi.h index 9cebd996873..f164879d21e 100644 --- a/src/mame/machine/sgi.h +++ b/src/mame/machine/sgi.h @@ -14,7 +14,7 @@ class sgi_mc_device : public device_t { public: - sgi_mc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sgi_mc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~sgi_mc_device() {} DECLARE_READ32_MEMBER(read); @@ -27,47 +27,47 @@ protected: private: // internal state emu_timer *m_tUpdateTimer; - UINT32 m_nCPUControl0; - UINT32 m_nCPUControl1; - UINT32 m_nWatchdog; - UINT32 m_nSysID; - UINT32 m_nRPSSDiv; - UINT32 m_nRefCntPreload; - UINT32 m_nRefCnt; - UINT32 m_nGIO64ArbParam; - UINT32 m_nArbCPUTime; - UINT32 m_nArbBurstTime; - UINT32 m_nMemCfg0; - UINT32 m_nMemCfg1; - UINT32 m_nCPUMemAccCfg; - UINT32 m_nGIOMemAccCfg; - UINT32 m_nCPUErrorAddr; - UINT32 m_nCPUErrorStatus; - UINT32 m_nGIOErrorAddr; - UINT32 m_nGIOErrorStatus; - UINT32 m_nSysSemaphore; - UINT32 m_nGIOLock; - UINT32 m_nEISALock; - UINT32 m_nGIO64TransMask; - UINT32 m_nGIO64Subst; - UINT32 m_nDMAIntrCause; - UINT32 m_nDMAControl; - UINT32 m_nDMATLBEntry0Hi; - UINT32 m_nDMATLBEntry0Lo; - UINT32 m_nDMATLBEntry1Hi; - UINT32 m_nDMATLBEntry1Lo; - UINT32 m_nDMATLBEntry2Hi; - UINT32 m_nDMATLBEntry2Lo; - UINT32 m_nDMATLBEntry3Hi; - UINT32 m_nDMATLBEntry3Lo; - UINT32 m_nRPSSCounter; - UINT32 m_nDMAMemAddr; - UINT32 m_nDMALineCntWidth; - UINT32 m_nDMALineZoomStride; - UINT32 m_nDMAGIO64Addr; - UINT32 m_nDMAMode; - UINT32 m_nDMAZoomByteCnt; - UINT32 m_nDMARunning; + uint32_t m_nCPUControl0; + uint32_t m_nCPUControl1; + uint32_t m_nWatchdog; + uint32_t m_nSysID; + uint32_t m_nRPSSDiv; + uint32_t m_nRefCntPreload; + uint32_t m_nRefCnt; + uint32_t m_nGIO64ArbParam; + uint32_t m_nArbCPUTime; + uint32_t m_nArbBurstTime; + uint32_t m_nMemCfg0; + uint32_t m_nMemCfg1; + uint32_t m_nCPUMemAccCfg; + uint32_t m_nGIOMemAccCfg; + uint32_t m_nCPUErrorAddr; + uint32_t m_nCPUErrorStatus; + uint32_t m_nGIOErrorAddr; + uint32_t m_nGIOErrorStatus; + uint32_t m_nSysSemaphore; + uint32_t m_nGIOLock; + uint32_t m_nEISALock; + uint32_t m_nGIO64TransMask; + uint32_t m_nGIO64Subst; + uint32_t m_nDMAIntrCause; + uint32_t m_nDMAControl; + uint32_t m_nDMATLBEntry0Hi; + uint32_t m_nDMATLBEntry0Lo; + uint32_t m_nDMATLBEntry1Hi; + uint32_t m_nDMATLBEntry1Lo; + uint32_t m_nDMATLBEntry2Hi; + uint32_t m_nDMATLBEntry2Lo; + uint32_t m_nDMATLBEntry3Hi; + uint32_t m_nDMATLBEntry3Lo; + uint32_t m_nRPSSCounter; + uint32_t m_nDMAMemAddr; + uint32_t m_nDMALineCntWidth; + uint32_t m_nDMALineZoomStride; + uint32_t m_nDMAGIO64Addr; + uint32_t m_nDMAMode; + uint32_t m_nDMAZoomByteCnt; + uint32_t m_nDMARunning; void update(); TIMER_CALLBACK_MEMBER(update_callback); diff --git a/src/mame/machine/simpsons.cpp b/src/mame/machine/simpsons.cpp index 420f65bef31..19fc05c50d5 100644 --- a/src/mame/machine/simpsons.cpp +++ b/src/mame/machine/simpsons.cpp @@ -63,7 +63,7 @@ WRITE8_MEMBER( simpsons_state::banking_callback ) void simpsons_state::machine_start() { - m_spriteram = make_unique_clear(0x1000 / 2); + m_spriteram = make_unique_clear(0x1000 / 2); membank("bank1")->configure_entries(0, 64, memregion("maincpu")->base(), 0x2000); diff --git a/src/mame/machine/slapfght.cpp b/src/mame/machine/slapfght.cpp index fe63b1aad1f..8da2d772189 100644 --- a/src/mame/machine/slapfght.cpp +++ b/src/mame/machine/slapfght.cpp @@ -37,7 +37,7 @@ WRITE8_MEMBER(slapfght_state::tigerh_mcu_w) READ8_MEMBER(slapfght_state::tigerh_mcu_status_r) { // d0 is vblank - UINT8 res = m_screen->vblank() ? 1 : 0; + uint8_t res = m_screen->vblank() ? 1 : 0; if (!m_main_sent) res |= 0x02; @@ -221,11 +221,11 @@ READ8_MEMBER(slapfght_state::getstar_mcusim_status_r) READ8_MEMBER(slapfght_state::getstar_mcusim_r) { - UINT16 tmp = 0; /* needed for values computed on 16 bits */ - UINT8 getstar_val = 0; - UINT8 phase_lookup_table[] = {0x00, 0x01, 0x03, 0xff, 0xff, 0x02, 0x05, 0xff, 0xff, 0x05}; /* table at 0x0e05 in 'getstarb1' */ - UINT8 lives_lookup_table[] = {0x03, 0x05, 0x01, 0x02}; /* table at 0x0e62 in 'getstarb1' */ - UINT8 lgsb2_lookup_table[] = {0x00, 0x03, 0x04, 0x05}; /* fake tanle for "test mode" in 'getstarb2' */ + uint16_t tmp = 0; /* needed for values computed on 16 bits */ + uint8_t getstar_val = 0; + uint8_t phase_lookup_table[] = {0x00, 0x01, 0x03, 0xff, 0xff, 0x02, 0x05, 0xff, 0xff, 0x05}; /* table at 0x0e05 in 'getstarb1' */ + uint8_t lives_lookup_table[] = {0x03, 0x05, 0x01, 0x02}; /* table at 0x0e62 in 'getstarb1' */ + uint8_t lgsb2_lookup_table[] = {0x00, 0x03, 0x04, 0x05}; /* fake tanle for "test mode" in 'getstarb2' */ switch (m_getstar_id) { @@ -793,7 +793,7 @@ WRITE8_MEMBER(slapfght_state::getstar_mcusim_w) READ8_MEMBER(slapfght_state::tigerhb1_prot_r) { - UINT8 tigerhb_val = 0; + uint8_t tigerhb_val = 0; switch (m_tigerhb_cmd) { case 0x73: /* avoid "BAD HW" message */ diff --git a/src/mame/machine/slapstic.cpp b/src/mame/machine/slapstic.cpp index 50d14f2e4c2..373bfdc5cd0 100644 --- a/src/mame/machine/slapstic.cpp +++ b/src/mame/machine/slapstic.cpp @@ -186,7 +186,7 @@ extern const device_type SLAPSTIC = &device_creator; -atari_slapstic_device::atari_slapstic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_slapstic_device::atari_slapstic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SLAPSTIC, "Atari Slapstic", tag, owner, clock, "slapstic", __FILE__), state(0), current_bank(0), @@ -821,12 +821,12 @@ int atari_slapstic_device::alt2_kludge(address_space &space, offs_t offset) if (MATCHES_MASK_VALUE(space.device().safe_pc() >> 1, slapstic.alt1)) { /* now look for a move.w (An),(An) or cmpm.w (An)+,(An)+ */ - UINT16 opcode = space.direct().read_word(space.device().safe_pcbase() & 0xffffff); + uint16_t opcode = space.direct().read_word(space.device().safe_pcbase() & 0xffffff); if ((opcode & 0xf1f8) == 0x3090 || (opcode & 0xf1f8) == 0xb148) { /* fetch the value of the register for the second operand, and see */ /* if it matches the third alternate */ - UINT32 regval = space.device().state().state_int(M68K_A0 + ((opcode >> 9) & 7)) >> 1; + uint32_t regval = space.device().state().state_int(M68K_A0 + ((opcode >> 9) & 7)) >> 1; if (MATCHES_MASK_VALUE(regval, slapstic.alt3)) { alt_bank = (regval >> slapstic.altshift) & 3; diff --git a/src/mame/machine/sms.cpp b/src/mame/machine/sms.cpp index 1f8f770eae4..f92098e5ab6 100644 --- a/src/mame/machine/sms.cpp +++ b/src/mame/machine/sms.cpp @@ -78,8 +78,8 @@ WRITE_LINE_MEMBER(sms_state::gg_ext_th_input) void sms_state::sms_get_inputs() { - UINT8 data1 = 0xff; - UINT8 data2 = 0xff; + uint8_t data1 = 0xff; + uint8_t data2 = 0xff; m_port_dc_reg = 0xff; m_port_dd_reg = 0xff; @@ -125,8 +125,8 @@ void sms_state::sms_get_inputs() WRITE8_MEMBER(sms_state::sms_io_control_w) { bool latch_hcount = false; - UINT8 ctrl1_port_data = 0xff; - UINT8 ctrl2_port_data = 0xff; + uint8_t ctrl1_port_data = 0xff; + uint8_t ctrl2_port_data = 0xff; if (m_is_gamegear && !(m_cartslot->exists() && m_cartslot->m_cart->get_sms_mode())) { @@ -254,7 +254,7 @@ WRITE_LINE_MEMBER(sms_state::sms_csync_callback) { if (m_port_rapid.found()) { - UINT8 rapid_previous_mode = m_rapid_mode; + uint8_t rapid_previous_mode = m_rapid_mode; m_csync_counter++; // counter is 12 bits wide (for 4096 pulses) @@ -479,7 +479,7 @@ WRITE8_MEMBER(sms_state::smsj_audio_control_w) READ8_MEMBER(sms_state::smsj_audio_control_r) { - UINT8 data; + uint8_t data; /* Charles MacDonald discovered an internal 12-bit counter that is incremented on each pulse of the C-Sync line that connects the VDP @@ -547,7 +547,7 @@ READ8_MEMBER(sms_state::gg_input_port_00_r) else { // bit 6 is NJAP (0=domestic/1=overseas); bit 7 is STT (START button) - UINT8 data = (m_ioctrl_region_is_japan ? 0x00 : 0x40) | (m_port_start->read() & 0x80); + uint8_t data = (m_ioctrl_region_is_japan ? 0x00 : 0x40) | (m_port_start->read() & 0x80); // According to GG official docs, bits 0-4 are meaningless and bit 5 // is NNTS (0=NTSC, 1=PAL). All games run in NTSC and no original GG @@ -606,7 +606,7 @@ READ8_MEMBER(sms_state::read_ram) { if (m_mem_device_enabled & ENABLE_EXT_RAM) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_mem_device_enabled & ENABLE_CART) data &= m_cartslot->read_ram(space, offset); @@ -704,7 +704,7 @@ WRITE8_MEMBER(sms_state::sms_mapper_w) } -UINT8 sms_state::read_bus(address_space &space, unsigned int page, UINT16 base_addr, UINT16 offset) +uint8_t sms_state::read_bus(address_space &space, unsigned int page, uint16_t base_addr, uint16_t offset) { if (m_is_gamegear) { @@ -722,7 +722,7 @@ UINT8 sms_state::read_bus(address_space &space, unsigned int page, UINT16 base_a } else if (m_mem_device_enabled != ENABLE_NONE) { - UINT8 data = 0xff; + uint8_t data = 0xff; // SMS2 behavior described by Charles MacDonald's SMS notes: // "If the BIOS is enabled at the same time the cartridge slot is, @@ -780,7 +780,7 @@ READ8_MEMBER(smssdisp_state::store_cart_peek) { if (m_mem_device_enabled != ENABLE_NONE) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_mem_device_enabled & ENABLE_CART) data &= m_cartslot->read_cart(space, 0x6000 + (offset & 0x1fff)); @@ -1028,7 +1028,7 @@ MACHINE_START_MEMBER(sms_state,sms) if (m_mainram == nullptr) { - m_mainram = make_unique_clear(0x2000); + m_mainram = make_unique_clear(0x2000); save_pointer(NAME(m_mainram.get()), 0x2000); // alibaba and blockhol are ports of games for the MSX system. The @@ -1190,10 +1190,10 @@ void sms_state::store_post_load() // that seems to change the active cart/card slot pair or, for the 4th // game switch onward of the 16-3 model, the active cart slot only. -void sms_state::store_select_cart(UINT8 data) +void sms_state::store_select_cart(uint8_t data) { - UINT8 slot = data >> 4; - UINT8 slottype = data & 0x08; + uint8_t slot = data >> 4; + uint8_t slottype = data & 0x08; // The SMS Store Display Unit only uses the logical cartridge slot to // map the active cartridge or card slot, of its multiple ones. @@ -1338,7 +1338,7 @@ VIDEO_RESET_MEMBER(sms_state,sms1) { if (m_port_scope->read()) { - UINT8 sscope_binocular_hack = m_port_scope_binocular->read(); + uint8_t sscope_binocular_hack = m_port_scope_binocular->read(); if (sscope_binocular_hack & 0x01) m_prevleft_bitmap.fill(rgb_t::black); @@ -1377,11 +1377,11 @@ void sms_state::screen_vblank_sms1(screen_device &screen, bool state) } -UINT32 sms_state::screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sms_state::screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 sscope = 0; - UINT8 sscope_binocular_hack; - UINT8 occluded_view = 0; + uint8_t sscope = 0; + uint8_t sscope_binocular_hack; + uint8_t occluded_view = 0; if (&screen != m_main_scr) { @@ -1458,7 +1458,7 @@ UINT32 sms_state::screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap return 0; } -UINT32 sms_state::screen_update_sms(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sms_state::screen_update_sms(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_vdp->screen_update(screen, bitmap, cliprect); return 0; @@ -1542,7 +1542,7 @@ void sms_state::screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rgb32 & if (sms_y2 >= vdp_bitmap.cliprect().min_y && sms_y2 <= vdp_bitmap.cliprect().max_y) { - UINT32 *vdp_buffer = &vdp_bitmap.pix32(sms_y2); + uint32_t *vdp_buffer = &vdp_bitmap.pix32(sms_y2); int sms_x = sms_min_x; int x_min_i = plot_min_x - plot_x_first_group; @@ -1605,7 +1605,7 @@ void sms_state::screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rgb32 & line3 = m_line_buffer.get() + ((sms_y + y_i + 1) & 0x03) * 160; line4 = m_line_buffer.get() + ((sms_y + y_i + 2) & 0x03) * 160; - UINT32 *p_bitmap = &bitmap.pix32(visarea.min_y + plot_y_group + y_i, visarea.min_x); + uint32_t *p_bitmap = &bitmap.pix32(visarea.min_y + plot_y_group + y_i, visarea.min_x); for (int plot_x = plot_min_x; plot_x <= plot_max_x; plot_x++) { @@ -1629,7 +1629,7 @@ void sms_state::screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rgb32 & } -UINT32 sms_state::screen_update_gamegear(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sms_state::screen_update_gamegear(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap_rgb32 *source_bitmap; @@ -1664,22 +1664,22 @@ UINT32 sms_state::screen_update_gamegear(screen_device &screen, bitmap_rgb32 &bi // (it would be better to generalize this in the core, to be used for all LCD systems) for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - UINT32 *linedst = &bitmap.pix32(y); - UINT32 *line0 = &source_bitmap->pix32(y); - UINT32 *line1 = &m_prev_bitmap.pix32(y); + uint32_t *linedst = &bitmap.pix32(y); + uint32_t *line0 = &source_bitmap->pix32(y); + uint32_t *line1 = &m_prev_bitmap.pix32(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - UINT32 color0 = line0[x]; - UINT32 color1 = line1[x]; - UINT16 r0 = (color0 >> 16) & 0x000000ff; - UINT16 g0 = (color0 >> 8) & 0x000000ff; - UINT16 b0 = (color0 >> 0) & 0x000000ff; - UINT16 r1 = (color1 >> 16) & 0x000000ff; - UINT16 g1 = (color1 >> 8) & 0x000000ff; - UINT16 b1 = (color1 >> 0) & 0x000000ff; - UINT8 r = (UINT8)((r0 + r1) >> 1); - UINT8 g = (UINT8)((g0 + g1) >> 1); - UINT8 b = (UINT8)((b0 + b1) >> 1); + uint32_t color0 = line0[x]; + uint32_t color1 = line1[x]; + uint16_t r0 = (color0 >> 16) & 0x000000ff; + uint16_t g0 = (color0 >> 8) & 0x000000ff; + uint16_t b0 = (color0 >> 0) & 0x000000ff; + uint16_t r1 = (color1 >> 16) & 0x000000ff; + uint16_t g1 = (color1 >> 8) & 0x000000ff; + uint16_t b1 = (color1 >> 0) & 0x000000ff; + uint8_t r = (uint8_t)((r0 + r1) >> 1); + uint8_t g = (uint8_t)((g0 + g1) >> 1); + uint8_t b = (uint8_t)((b0 + b1) >> 1); linedst[x] = (r << 16) | (g << 8) | b; } } diff --git a/src/mame/machine/snes.cpp b/src/mame/machine/snes.cpp index da7f8dbd517..4c0030abf77 100644 --- a/src/mame/machine/snes.cpp +++ b/src/mame/machine/snes.cpp @@ -28,7 +28,7 @@ #define DMA_REG(a) m_dma_regs[a - 0x4300] // regs 0x4300-0x437f -UINT32 snes_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t snes_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { /* NTSC SNES draw range is 1-225. */ for (int y = cliprect.min_y; y <= cliprect.max_y; y++) @@ -262,8 +262,8 @@ TIMER_CALLBACK_MEMBER(snes_state::snes_hblank_tick) READ8_MEMBER( snes_state::snes_open_bus_r ) { - static UINT8 recurse = 0; - UINT16 result; + static uint8_t recurse = 0; + uint16_t result; /* prevent recursion */ if (recurse) @@ -388,7 +388,7 @@ WRITE8_MEMBER( snes_state::snes_io_dma_w ) */ READ8_MEMBER( snes_state::snes_r_io ) { - UINT8 value = 0; + uint8_t value = 0; // PPU accesses are from 2100 to 213f if (offset >= INIDISP && offset < APU00) @@ -594,7 +594,7 @@ WRITE8_MEMBER( snes_state::snes_w_io ) } -void snes_state::write_joy_latch(UINT8 data) +void snes_state::write_joy_latch(uint8_t data) { if (m_oldjoy1_latch == (data & 0x01)) return; @@ -607,7 +607,7 @@ void snes_state::write_joy_latch(UINT8 data) } -void snes_state::wrio_write(UINT8 data) +void snes_state::wrio_write(uint8_t data) { if (!(SNES_CPU_REG(WRIO) & 0x80) && (data & 0x80)) { @@ -696,11 +696,11 @@ address | | | | | | | */ -inline UINT8 snes_state::snes_rom_access(UINT32 offset) +inline uint8_t snes_state::snes_rom_access(uint32_t offset) { - UINT32 addr; - UINT8 value = 0xff; - UINT8 base_bank = (offset < 0x800000) ? 0x80 : 0x00; + uint32_t addr; + uint8_t value = 0xff; + uint8_t base_bank = (offset < 0x800000) ? 0x80 : 0x00; switch (m_cart.mode) { @@ -723,8 +723,8 @@ inline UINT8 snes_state::snes_rom_access(UINT32 offset) /* 0x000000 - 0x7dffff */ READ8_MEMBER(snes_state::snes_r_bank1) { - UINT8 value = 0xff; - UINT16 address = offset & 0xffff; + uint8_t value = 0xff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -787,8 +787,8 @@ READ8_MEMBER(snes_state::snes_r_bank1) /* 0x800000 - 0xffffff */ READ8_MEMBER(snes_state::snes_r_bank2) { - UINT8 value = 0; - UINT16 address = offset & 0xffff; + uint8_t value = 0; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -835,7 +835,7 @@ READ8_MEMBER(snes_state::snes_r_bank2) /* 0x000000 - 0x7dffff */ WRITE8_MEMBER(snes_state::snes_w_bank1) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -892,7 +892,7 @@ WRITE8_MEMBER(snes_state::snes_w_bank1) /* 0x800000 - 0xffffff */ WRITE8_MEMBER(snes_state::snes_w_bank2) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -988,7 +988,7 @@ WRITE8_MEMBER(snes_state::io_read) } -UINT8 snes_state::oldjoy1_read(int latched) +uint8_t snes_state::oldjoy1_read(int latched) { if (latched) return 0; @@ -999,7 +999,7 @@ UINT8 snes_state::oldjoy1_read(int latched) return (m_data1[0] >> (15 - m_read_idx[0]++)) & 0x01; } -UINT8 snes_state::oldjoy2_read(int latched) +uint8_t snes_state::oldjoy2_read(int latched) { if (latched) return 0; @@ -1147,7 +1147,7 @@ void snes_state::machine_reset() } -void snes_state::rom_map_setup(UINT32 size) +void snes_state::rom_map_setup(uint32_t size) { int i; // setup the rom_bank_map array to faster ROM read @@ -1177,11 +1177,11 @@ DRIVER_INIT_MEMBER(snes_state,snes) m_cart.m_nvram_size = 0; if (m_cart.m_rom[0x7fd8] > 0) { - UINT32 nvram_size = (1024 << m_cart.m_rom[0x7fd8]); + uint32_t nvram_size = (1024 << m_cart.m_rom[0x7fd8]); if (nvram_size > 0x40000) nvram_size = 0x40000; - m_cart.m_nvram = make_unique_clear(nvram_size); + m_cart.m_nvram = make_unique_clear(nvram_size); m_cart.m_nvram_size = nvram_size; } @@ -1198,11 +1198,11 @@ DRIVER_INIT_MEMBER(snes_state,snes_hirom) m_cart.m_nvram_size = 0; if (m_cart.m_rom[0xffd8] > 0) { - UINT32 nvram_size = (1024 << m_cart.m_rom[0xffd8]); + uint32_t nvram_size = (1024 << m_cart.m_rom[0xffd8]); if (nvram_size > 0x40000) nvram_size = 0x40000; - m_cart.m_nvram = make_unique_clear(nvram_size); + m_cart.m_nvram = make_unique_clear(nvram_size); m_cart.m_nvram_size = nvram_size; } @@ -1216,7 +1216,7 @@ DRIVER_INIT_MEMBER(snes_state,snes_hirom) *************************************/ -inline int snes_state::dma_abus_valid( UINT32 address ) +inline int snes_state::dma_abus_valid( uint32_t address ) { if((address & 0x40ff00) == 0x2100) return 0; //$[00-3f|80-bf]:[2100-21ff] if((address & 0x40fe00) == 0x4000) return 0; //$[00-3f|80-bf]:[4000-41ff] @@ -1226,7 +1226,7 @@ inline int snes_state::dma_abus_valid( UINT32 address ) return 1; } -inline UINT8 snes_state::abus_read( address_space &space, UINT32 abus ) +inline uint8_t snes_state::abus_read( address_space &space, uint32_t abus ) { if (!dma_abus_valid(abus)) return 0; @@ -1234,7 +1234,7 @@ inline UINT8 snes_state::abus_read( address_space &space, UINT32 abus ) return space.read_byte(abus); } -inline void snes_state::dma_transfer( address_space &space, UINT8 dma, UINT32 abus, UINT16 bbus ) +inline void snes_state::dma_transfer( address_space &space, uint8_t dma, uint32_t abus, uint16_t bbus ) { if (m_dma_channel[dma].dmap & 0x80) /* PPU->CPU */ { @@ -1273,12 +1273,12 @@ inline void snes_state::dma_transfer( address_space &space, UINT8 dma, UINT32 ab /* WIP: These have the advantage to automatically update the address, but then we would need to check again if the transfer is direct/indirect at each step... is it worth? */ -inline UINT32 snes_state::get_hdma_addr( int dma ) +inline uint32_t snes_state::get_hdma_addr( int dma ) { return (m_dma_channel[dma].bank << 16) | (m_dma_channel[dma].hdma_addr++); } -inline UINT32 snes_state::get_hdma_iaddr( int dma ) +inline uint32_t snes_state::get_hdma_iaddr( int dma ) { return (m_dma_channel[dma].ibank << 16) | (m_dma_channel[dma].trans_size++); } @@ -1297,7 +1297,7 @@ inline int snes_state::is_last_active_channel( int dma ) void snes_state::hdma_update( address_space &space, int dma ) { - UINT32 abus = get_hdma_addr(dma); + uint32_t abus = get_hdma_addr(dma); m_dma_channel[dma].hdma_line_counter = abus_read(space, abus); @@ -1340,8 +1340,8 @@ void snes_state::hdma_init( address_space &space ) void snes_state::hdma( address_space &space ) { - UINT16 bbus; - UINT32 abus; + uint16_t bbus; + uint32_t abus; for (int i = 0; i < 8; i++) { @@ -1420,12 +1420,12 @@ void snes_state::hdma( address_space &space ) } } -void snes_state::dma( address_space &space, UINT8 channels ) +void snes_state::dma( address_space &space, uint8_t channels ) { - INT8 increment; - UINT16 bbus; - UINT32 abus, abus_bank; - UINT16 length; + int8_t increment; + uint16_t bbus; + uint32_t abus, abus_bank; + uint16_t length; /* FIXME: we also need to round to the nearest 8 master cycles */ diff --git a/src/mame/machine/snescx4.cpp b/src/mame/machine/snescx4.cpp index a270a9fc8bd..f98b851bcf8 100644 --- a/src/mame/machine/snescx4.cpp +++ b/src/mame/machine/snescx4.cpp @@ -17,37 +17,37 @@ static CX4 cx4; -static UINT16 CX4_readw(UINT16 addr); -static UINT32 CX4_readl(UINT16 addr); +static uint16_t CX4_readw(uint16_t addr); +static uint32_t CX4_readl(uint16_t addr); -static void CX4_writew(running_machine &machine, UINT16 addr, UINT16 data); -//static void CX4_writel(running_machine &machine, UINT16 addr, UINT32 data); +static void CX4_writew(running_machine &machine, uint16_t addr, uint16_t data); +//static void CX4_writel(running_machine &machine, uint16_t addr, uint32_t data); -static void CX4_C4DrawLine(INT32 X1, INT32 Y1, INT16 Z1, INT32 X2, INT32 Y2, INT16 Z2, UINT8 Color); +static void CX4_C4DrawLine(int32_t X1, int32_t Y1, int16_t Z1, int32_t X2, int32_t Y2, int16_t Z2, uint8_t Color); #include "machine/cx4data.hxx" #include "machine/cx4fn.hxx" -static UINT32 CX4_ldr(UINT8 r) +static uint32_t CX4_ldr(uint8_t r) { - UINT16 addr = 0x0080 + (r * 3); + uint16_t addr = 0x0080 + (r * 3); return (cx4.reg[addr + 0] << 0) | (cx4.reg[addr + 1] << 8) | (cx4.reg[addr + 2] << 16); } -static void CX4_str(UINT8 r, UINT32 data) +static void CX4_str(uint8_t r, uint32_t data) { - UINT16 addr = 0x0080 + (r * 3); + uint16_t addr = 0x0080 + (r * 3); cx4.reg[addr + 0] = (data >> 0); cx4.reg[addr + 1] = (data >> 8); cx4.reg[addr + 2] = (data >> 16); } -static void CX4_mul(UINT32 x, UINT32 y, UINT32 *rl, UINT32 *rh) +static void CX4_mul(uint32_t x, uint32_t y, uint32_t *rl, uint32_t *rh) { - INT64 rx = x & 0xffffff; - INT64 ry = y & 0xffffff; + int64_t rx = x & 0xffffff; + int64_t ry = y & 0xffffff; if(rx & 0x800000)rx |= ~0x7fffff; if(ry & 0x800000)ry |= ~0x7fffff; @@ -57,7 +57,7 @@ static void CX4_mul(UINT32 x, UINT32 y, UINT32 *rl, UINT32 *rh) *rh = (rx >> 24) & 0xffffff; } -static UINT32 CX4_sin(UINT32 rx) +static uint32_t CX4_sin(uint32_t rx) { cx4.r0 = rx & 0x1ff; if(cx4.r0 & 0x100) @@ -78,14 +78,14 @@ static UINT32 CX4_sin(UINT32 rx) } } -static UINT32 CX4_cos(UINT32 rx) +static uint32_t CX4_cos(uint32_t rx) { return CX4_sin(rx + 0x080); } -static void CX4_immediate_reg(UINT32 start) +static void CX4_immediate_reg(uint32_t start) { - UINT32 i = 0; + uint32_t i = 0; cx4.r0 = CX4_ldr(0); for(i = start; i < 48; i++) { @@ -100,9 +100,9 @@ static void CX4_immediate_reg(UINT32 start) static void CX4_transfer_data(running_machine &machine) { - UINT32 src; - UINT16 dest, count; - UINT32 i; + uint32_t src; + uint16_t dest, count; + uint32_t i; src = (cx4.reg[0x40]) | (cx4.reg[0x41] << 8) | (cx4.reg[0x42] << 16); count = (cx4.reg[0x43]) | (cx4.reg[0x44] << 8); @@ -118,7 +118,7 @@ static void CX4_transfer_data(running_machine &machine) #include "machine/cx4oam.hxx" #include "machine/cx4ops.hxx" -void CX4_write(running_machine &machine, UINT32 addr, UINT8 data) +void CX4_write(running_machine &machine, uint32_t addr, uint8_t data) { addr &= 0x1fff; @@ -193,20 +193,20 @@ void CX4_write(running_machine &machine, UINT32 addr, UINT8 data) } #ifdef UNUSED_FUNCTION -void CX4_writeb(running_machine &machine, UINT16 addr, UINT8 data) +void CX4_writeb(running_machine &machine, uint16_t addr, uint8_t data) { CX4_write(machine, addr, data); } #endif -static void CX4_writew(running_machine &machine, UINT16 addr, UINT16 data) +static void CX4_writew(running_machine &machine, uint16_t addr, uint16_t data) { CX4_write(machine, addr + 0, data >> 0); CX4_write(machine, addr + 1, data >> 8); } #ifdef UNUSED_FUNCTION -void CX4_writel(running_machine &machine, UINT16 addr, UINT32 data) +void CX4_writel(running_machine &machine, uint16_t addr, uint32_t data) { CX4_write(machine, addr + 0, data >> 0); CX4_write(machine, addr + 1, data >> 8); @@ -214,7 +214,7 @@ void CX4_writel(running_machine &machine, UINT16 addr, UINT32 data) } #endif -UINT8 CX4_read(UINT32 addr) +uint8_t CX4_read(uint32_t addr) { addr &= 0x1fff; @@ -232,18 +232,18 @@ UINT8 CX4_read(UINT32 addr) } #ifdef UNUSED_FUNCTION -UINT8 CX4_readb(UINT16 addr) +uint8_t CX4_readb(uint16_t addr) { return CX4_read(addr); } #endif -static UINT16 CX4_readw(UINT16 addr) +static uint16_t CX4_readw(uint16_t addr) { return CX4_read(addr) | (CX4_read(addr + 1) << 8); } -static UINT32 CX4_readl(UINT16 addr) +static uint32_t CX4_readl(uint16_t addr) { return CX4_read(addr) | (CX4_read(addr + 1) << 8) | (CX4_read(addr + 2) << 16); } diff --git a/src/mame/machine/snescx4.h b/src/mame/machine/snescx4.h index 1adca638a39..463030060a8 100644 --- a/src/mame/machine/snescx4.h +++ b/src/mame/machine/snescx4.h @@ -12,18 +12,18 @@ struct CX4 { - UINT8 ram[0x0c00]; - UINT8 reg[0x0100]; - UINT32 r0, r1, r2, r3, r4, r5, r6, r7, + uint8_t ram[0x0c00]; + uint8_t reg[0x0100]; + uint32_t r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15; - INT16 C4WFXVal, C4WFYVal, C4WFZVal, C4WFX2Val, C4WFY2Val, C4WFDist, C4WFScale; - INT16 C41FXVal, C41FYVal, C41FAngleRes, C41FDist, C41FDistVal; + int16_t C4WFXVal, C4WFYVal, C4WFZVal, C4WFX2Val, C4WFY2Val, C4WFDist, C4WFScale; + int16_t C41FXVal, C41FYVal, C41FAngleRes, C41FDist, C41FDistVal; double tanval; double c4x, c4y, c4z; double c4x2, c4y2, c4z2; }; -UINT8 CX4_read(UINT32 addr); -void CX4_write(running_machine &machine, UINT32 addr, UINT8 data); +uint8_t CX4_read(uint32_t addr); +void CX4_write(running_machine &machine, uint32_t addr, uint8_t data); diff --git a/src/mame/machine/sorcerer.cpp b/src/mame/machine/sorcerer.cpp index e58ebd0ccd5..9300588e6fb 100644 --- a/src/mame/machine/sorcerer.cpp +++ b/src/mame/machine/sorcerer.cpp @@ -50,7 +50,7 @@ void sorcerer_state::device_timer(emu_timer &timer, device_timer_id id, int para TIMER_CALLBACK_MEMBER(sorcerer_state::sorcerer_cassette_tc) { - UINT8 cass_ws = 0; + uint8_t cass_ws = 0; switch (m_fe & 0xc0) /*/ bit 7 low indicates cassette */ { case 0x00: /* Cassette 300 baud */ @@ -164,7 +164,7 @@ WRITE8_MEMBER(sorcerer_state::sorcerer_fd_w) WRITE8_MEMBER(sorcerer_state::sorcerer_fe_w) { - UINT8 changed_bits = (m_fe ^ data) & 0xf0; + uint8_t changed_bits = (m_fe ^ data) & 0xf0; m_fe = data; /* bits 0..3 */ @@ -246,7 +246,7 @@ WRITE8_MEMBER(sorcerer_state::sorcerer_ff_w) READ8_MEMBER(sorcerer_state::sorcerer_fc_r) { - UINT8 data = m_uart->get_received_data(); + uint8_t data = m_uart->get_received_data(); m_uart->set_input_pin(AY31015_RDAV, 0); m_uart->set_input_pin(AY31015_RDAV, 1); return data; @@ -255,7 +255,7 @@ READ8_MEMBER(sorcerer_state::sorcerer_fc_r) READ8_MEMBER(sorcerer_state::sorcerer_fd_r) { /* set unused bits high */ - UINT8 data = 0xe0; + uint8_t data = 0xe0; m_uart->set_input_pin(AY31015_SWE, 0); data |= m_uart->get_output_pin(AY31015_TBMT) ? 0x01 : 0; @@ -275,7 +275,7 @@ READ8_MEMBER(sorcerer_state::sorcerer_fe_r) - not emulated - tied high, allowing PARIN and PAROUT bios routines to run */ - UINT8 data = 0xc0; + uint8_t data = 0xc0; /* bit 5 - vsync */ data |= m_iop_vs->read(); @@ -292,9 +292,9 @@ READ8_MEMBER(sorcerer_state::sorcerer_fe_r) SNAPSHOT_LOAD_MEMBER( sorcerer_state,sorcerer) { - UINT8 *RAM = memregion(m_maincpu->tag())->base(); + uint8_t *RAM = memregion(m_maincpu->tag())->base(); address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 header[28]; + uint8_t header[28]; unsigned char s_byte; /* check size */ @@ -343,7 +343,7 @@ void sorcerer_state::machine_start() m_cassette_timer = timer_alloc(TIMER_CASSETTE); m_serial_timer = timer_alloc(TIMER_SERIAL); - UINT16 endmem = 0xbfff; + uint16_t endmem = 0xbfff; address_space &space = m_maincpu->space(AS_PROGRAM); /* configure RAM */ @@ -371,7 +371,7 @@ MACHINE_START_MEMBER(sorcerer_state,sorcererd) m_cassette_timer = timer_alloc(TIMER_CASSETTE); m_serial_timer = timer_alloc(TIMER_SERIAL); - UINT16 endmem = 0xbbff; + uint16_t endmem = 0xbbff; address_space &space = m_maincpu->space(AS_PROGRAM); /* configure RAM */ @@ -418,7 +418,7 @@ void sorcerer_state::machine_reset() QUICKLOAD_LOAD_MEMBER( sorcerer_state, sorcerer ) { - UINT16 execute_address, start_address, end_address; + uint16_t execute_address, start_address, end_address; int autorun; address_space &space = m_maincpu->space(AS_PROGRAM); @@ -445,8 +445,8 @@ QUICKLOAD_LOAD_MEMBER( sorcerer_state, sorcerer ) if (((start_address == 0x1d5) || (execute_address == 0xc858)) && (space.read_byte(0xdffa) == 0xc3)) { - UINT8 i; - static const UINT8 data[]={ + uint8_t i; + static const uint8_t data[]={ 0xcd, 0x26, 0xc4, // CALL C426 ;set up other pointers 0x21, 0xd4, 1, // LD HL,01D4 ;start of program address (used by C689) 0x36, 0, // LD (HL),00 ;make sure dummy end-of-line is there diff --git a/src/mame/machine/spec_snqk.cpp b/src/mame/machine/spec_snqk.cpp index 2ed7490c811..e92f6dd8e34 100644 --- a/src/mame/machine/spec_snqk.cpp +++ b/src/mame/machine/spec_snqk.cpp @@ -49,7 +49,7 @@ data for the end user -------------------------------------------------*/ -static void log_quickload(running_machine &machine, const char *type, UINT32 start, UINT32 length, UINT32 exec, const char *exec_format) +static void log_quickload(running_machine &machine, const char *type, uint32_t start, uint32_t length, uint32_t exec, const char *exec_format) { std::ostringstream tempstring; spectrum_state *state = machine.driver_data(); @@ -118,7 +118,7 @@ static void spectrum_page_basicrom(running_machine &machine) SNAPSHOT_LOAD_MEMBER( spectrum_state,spectrum) { - std::vector snapshot_data(snapshot_size); + std::vector snapshot_data(snapshot_size); image.fread(&snapshot_data[0], snapshot_size); @@ -313,11 +313,11 @@ static void spectrum_border_update(running_machine &machine, int data) #endif } -void spectrum_setup_sp(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_sp(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i, SP_OFFSET; - UINT8 intr; - UINT16 start, size, data, status; + uint8_t intr; + uint16_t start, size, data, status; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -395,7 +395,7 @@ void spectrum_setup_sp(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz break; case 2: // case 0: in version 0.99e of the emulator case 3: // case 1: in version 0.99e of the emulator - LOAD_REG(cpu, Z80_IM, (UINT64)0); + LOAD_REG(cpu, Z80_IM, (uint64_t)0); } data = BIT(status, 0); @@ -512,12 +512,12 @@ void spectrum_setup_sp(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz * in which case it is included twice. * *******************************************************************/ -void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_sna(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i, j, usedbanks[8]; long bank_offset; - UINT8 intr; - UINT16 data, addr; + uint8_t intr; + uint16_t data, addr; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -732,11 +732,11 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi * 16640 49152 RAM dump * *******************************************************************/ -void spectrum_setup_ach(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_ach(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i; - UINT8 intr; - UINT16 data; + uint8_t intr; + uint16_t data; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -865,11 +865,11 @@ void spectrum_setup_ach(running_machine &machine, UINT8 *snapdata, UINT32 snapsi * suffer from the same "top of the stack" bug as well as .SNA images. * *******************************************************************/ -void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_prg(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i; - UINT8 intr; - UINT16 addr, data; + uint8_t intr; + uint16_t addr, data; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -1035,11 +1035,11 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi * suffer from the same "top of the stack" bug as well as .SNA images. * *******************************************************************/ -void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_plusd(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i, j; - UINT8 intr; - UINT16 addr = 0, data; + uint8_t intr; + uint16_t addr = 0, data; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -1203,11 +1203,11 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap * Following these data, there are optional POKE blocks * *******************************************************************/ -void spectrum_setup_sem(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_sem(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i; - UINT8 intr; - UINT16 data; + uint8_t intr; + uint16_t data; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -1322,11 +1322,11 @@ void spectrum_setup_sem(running_machine &machine, UINT8 *snapdata, UINT32 snapsi * 16412 49152 RAM dump * *******************************************************************/ -void spectrum_setup_sit(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_sit(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i; - UINT8 intr; - UINT16 data; + uint8_t intr; + uint16_t data; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -1452,11 +1452,11 @@ void spectrum_setup_sit(running_machine &machine, UINT8 *snapdata, UINT32 snapsi * 49476 10 0x00 (reserved for future use) * *******************************************************************/ -void spectrum_setup_zx(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_zx(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i; - UINT8 intr; - UINT16 data, mode; + uint8_t intr; + uint16_t data, mode; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -1513,7 +1513,7 @@ void spectrum_setup_zx(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz switch (mode) { case 0xffff: - LOAD_REG(cpu, Z80_IM, (UINT64)0); + LOAD_REG(cpu, Z80_IM, (uint64_t)0); break; case 0x00: LOAD_REG(cpu, Z80_IM, 1); @@ -1584,11 +1584,11 @@ void spectrum_setup_zx(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz * 49181 2 HL' * *******************************************************************/ -void spectrum_setup_snp(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_snp(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i; - UINT8 intr; - UINT16 data; + uint8_t intr; + uint16_t data; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -1764,10 +1764,10 @@ void spectrum_setup_snp(running_machine &machine, UINT8 *snapdata, UINT32 snapsi * length of the block. * *******************************************************************/ -static void spectrum_snx_decompress_block(address_space &space, UINT8 *source, UINT16 dest, UINT16 size) +static void spectrum_snx_decompress_block(address_space &space, uint8_t *source, uint16_t dest, uint16_t size) { - UINT8 counthi, countlo, compress, fill; - UINT16 block = 0, count, i, j, numbytes; + uint8_t counthi, countlo, compress, fill; + uint16_t block = 0, count, i, j, numbytes; spectrum_state *state = space.machine().driver_data(); i = SNX_HDR - 1; numbytes = 0; @@ -1811,10 +1811,10 @@ static void spectrum_snx_decompress_block(address_space &space, UINT8 *source, U } } -void spectrum_setup_snx(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_snx(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { - UINT8 intr; - UINT16 data, addr; + uint8_t intr; + uint16_t data, addr; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -1964,11 +1964,11 @@ void spectrum_setup_snx(running_machine &machine, UINT8 *snapdata, UINT32 snapsi * The 8 16K banks are stored in the order 5, 2, 0, 1, 3, 4, 6, 7 * *******************************************************************/ -void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_frz(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { int i, j; - UINT8 intr; - UINT16 addr, data; + uint8_t intr; + uint16_t addr, data; spectrum_state *state = machine.driver_data(); cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -2039,7 +2039,7 @@ void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsi /* Memory dump */ addr = 0; - static const UINT8 banks[] = { 5, 2, 0, 1, 3, 4, 6, 7 }; + static const uint8_t banks[] = { 5, 2, 0, 1, 3, 4, 6, 7 }; state->logerror("Loading %05X bytes of RAM at %04X\n", 8*SPECTRUM_BANK, BASE_RAM); for (i = 0; i < 8; i++) { @@ -2078,9 +2078,9 @@ void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsi //state->logerror("Snapshot loaded.\nExecution resuming at bank:%d %s\n", state->m_port_7ffd_data & 0x07, cpu_get_reg_string(cpu, Z80_PC)); } -static void spectrum_z80_decompress_block(address_space &space, UINT8 *source, UINT16 dest, UINT16 size) +static void spectrum_z80_decompress_block(address_space &space, uint8_t *source, uint16_t dest, uint16_t size) { - UINT8 ch; + uint8_t ch; int i; do @@ -2094,8 +2094,8 @@ static void spectrum_z80_decompress_block(address_space &space, UINT8 *source, U if (source[1] == 0x0ed) { /* 0x0ed, 0x0ed, xx yy - repetition */ - UINT8 count; - UINT8 data; + uint8_t count; + uint8_t data; count = source[2]; @@ -2138,9 +2138,9 @@ static void spectrum_z80_decompress_block(address_space &space, UINT8 *source, U while (size > 0); } -static SPECTRUM_Z80_SNAPSHOT_TYPE spectrum_identify_z80 (UINT8 *snapdata, UINT32 snapsize) +static SPECTRUM_Z80_SNAPSHOT_TYPE spectrum_identify_z80 (uint8_t *snapdata, uint32_t snapsize) { - UINT8 lo, hi, data; + uint8_t lo, hi, data; if (snapsize < 30) return SPECTRUM_Z80_SNAPSHOT_INVALID; /* Invalid file */ @@ -2186,11 +2186,11 @@ static SPECTRUM_Z80_SNAPSHOT_TYPE spectrum_identify_z80 (UINT8 *snapdata, UINT32 } /* now supports 48k & 128k .Z80 files */ -void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsize) +void spectrum_setup_z80(running_machine &machine, uint8_t *snapdata, uint32_t snapsize) { spectrum_state *state = machine.driver_data(); int i; - UINT8 lo, hi, data; + uint8_t lo, hi, data; SPECTRUM_Z80_SNAPSHOT_TYPE z80_type; cpu_device *cpu = state->m_maincpu; address_space &space = cpu->space(AS_PROGRAM); @@ -2291,7 +2291,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi /* Interrupt Flip/Flop */ if (snapdata[27] == 0) { - cpu->set_state_int(Z80_IFF1, (UINT64)0); + cpu->set_state_int(Z80_IFF1, (uint64_t)0); /* cpu->set_state_int(Z80_IRQ_STATE, 0); */ } else @@ -2340,7 +2340,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi } else { - UINT8 *pSource; + uint8_t *pSource; int header_size; header_size = 30 + 2 + ((snapdata[30] & 0x0ff) | ((snapdata[31] & 0x0ff) << 8)); @@ -2371,7 +2371,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi do { unsigned short length; - UINT8 page; + uint8_t page; int Dest = 0; length = (pSource[0] & 0x0ff) | ((pSource[1] & 0x0ff) << 8); @@ -2450,7 +2450,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi QUICKLOAD_LOAD_MEMBER( spectrum_state,spectrum) { - std::vector quickload_data(quickload_size); + std::vector quickload_data(quickload_size); image.fread(&quickload_data[0], quickload_size); @@ -2508,7 +2508,7 @@ error: * SAVE "filename" CODE 16384,6144 * *******************************************************************/ -void spectrum_setup_scr(running_machine &machine, UINT8 *quickdata, UINT32 quicksize) +void spectrum_setup_scr(running_machine &machine, uint8_t *quickdata, uint32_t quicksize) { int i; address_space &space = machine.driver_data()->m_maincpu->space(AS_PROGRAM); @@ -2545,11 +2545,11 @@ void spectrum_setup_scr(running_machine &machine, UINT8 *quickdata, UINT32 quick * However, no image of such type has ever surfaced. * *******************************************************************/ -void spectrum_setup_raw(running_machine &machine, UINT8 *quickdata, UINT32 quicksize) +void spectrum_setup_raw(running_machine &machine, uint8_t *quickdata, uint32_t quicksize) { int i; - UINT8 data; - UINT16 start, len; + uint8_t data; + uint16_t start, len; spectrum_state *state = machine.driver_data(); address_space &space = state->m_maincpu->space(AS_PROGRAM); diff --git a/src/mame/machine/spec_snqk.h b/src/mame/machine/spec_snqk.h index 6eec8f90ade..963383fa648 100644 --- a/src/mame/machine/spec_snqk.h +++ b/src/mame/machine/spec_snqk.h @@ -11,21 +11,21 @@ #include "imagedev/snapquik.h" -void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_sp(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_ach(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_sem(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_sit(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_zx(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_snp(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_snx(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); -void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsize); - -void spectrum_setup_scr(running_machine &machine, UINT8 *quickdata, UINT32 quicksize); -void spectrum_setup_raw(running_machine &machine, UINT8 *quickdata, UINT32 quicksize); +void spectrum_setup_sna(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_z80(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_sp(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_ach(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_prg(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_plusd(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_sem(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_sit(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_zx(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_snp(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_snx(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); +void spectrum_setup_frz(running_machine &machine, uint8_t *snapdata, uint32_t snapsize); + +void spectrum_setup_scr(running_machine &machine, uint8_t *quickdata, uint32_t quicksize); +void spectrum_setup_raw(running_machine &machine, uint8_t *quickdata, uint32_t quicksize); #define BASE_RAM 0x4000 #define SPECTRUM_BANK 0x4000 diff --git a/src/mame/machine/special.cpp b/src/mame/machine/special.cpp index 23db4ddcd67..1bd7b492b7d 100644 --- a/src/mame/machine/special.cpp +++ b/src/mame/machine/special.cpp @@ -18,7 +18,7 @@ DRIVER_INIT_MEMBER(special_state,special) { /* set initialy ROM to be visible on first bank */ - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); memset(RAM,0x0000,0x3000); // make first page empty by default m_bank1->configure_entries(1, 2, RAM, 0x0000); m_bank1->configure_entries(0, 2, RAM, 0xc000); @@ -39,7 +39,7 @@ READ8_MEMBER( special_state::specialist_8255_porta_r ) READ8_MEMBER( special_state::specialist_8255_portb_r ) { - UINT8 dat = 0xff; + uint8_t dat = 0xff; if ((m_specialist_8255_porta & 0x01)==0) dat &= m_io_line0->read(); if ((m_specialist_8255_porta & 0x02)==0) dat &= m_io_line1->read(); @@ -70,7 +70,7 @@ READ8_MEMBER( special_state::specialist_8255_portb_r ) READ8_MEMBER( special_state::specimx_8255_portb_r ) { - UINT8 dat = 0xff; + uint8_t dat = 0xff; if ((m_specialist_8255_porta & 0x01)==0) dat &= m_io_line0->read(); if ((m_specialist_8255_porta & 0x02)==0) dat &= m_io_line1->read(); @@ -170,10 +170,10 @@ READ8_MEMBER( special_state::specimx_video_color_r ) return m_specimx_color; } -void special_state::specimx_set_bank(offs_t i, UINT8 data) +void special_state::specimx_set_bank(offs_t i, uint8_t data) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); space.install_write_bank(0xc000, 0xffbf, "bank3"); space.install_write_bank(0xffc0, 0xffdf, "bank4"); @@ -272,12 +272,12 @@ WRITE8_MEMBER( special_state::specimx_disk_ctrl_w ) void special_state::erik_set_bank() { - UINT8 bank1 = m_RR_register & 3; - UINT8 bank2 = (m_RR_register >> 2) & 3; - UINT8 bank3 = (m_RR_register >> 4) & 3; - UINT8 bank4 = (m_RR_register >> 6) & 3; - UINT8 *mem = m_region_maincpu->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t bank1 = m_RR_register & 3; + uint8_t bank2 = (m_RR_register >> 2) & 3; + uint8_t bank3 = (m_RR_register >> 4) & 3; + uint8_t bank4 = (m_RR_register >> 6) & 3; + uint8_t *mem = m_region_maincpu->base(); + uint8_t *ram = m_ram->pointer(); address_space &space = m_maincpu->space(AS_PROGRAM); space.install_write_bank(0x0000, 0x3fff, "bank1"); diff --git a/src/mame/machine/st0016.cpp b/src/mame/machine/st0016.cpp index 9c108ee1d59..58ab23b9f4c 100644 --- a/src/mame/machine/st0016.cpp +++ b/src/mame/machine/st0016.cpp @@ -26,7 +26,7 @@ ADDRESS_MAP_END // note: a lot of bits are left uninitialized by the games, the default values are uncertain -st0016_cpu_device::st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +st0016_cpu_device::st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, ST0016_CPU, "ST0016", tag, owner, clock, "st0016_cpu", __FILE__), device_gfx_interface(mconfig, *this, nullptr, "palette"), st0016_spr_bank(0), @@ -295,13 +295,13 @@ WRITE8_MEMBER(st0016_cpu_device::st0016_vregs_w) st0016_vregs[offset]=data; if(offset==0xa8 && (data&0x20)) { - 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; + uint32_t srcadr=(st0016_vregs[0xa0]|(st0016_vregs[0xa1]<<8)|(st0016_vregs[0xa2]<<16))<<1; + uint32_t dstadr=(st0016_vregs[0xa3]|(st0016_vregs[0xa4]<<8)|(st0016_vregs[0xa5]<<16))<<1; + uint32_t length=((st0016_vregs[0xa6]|(st0016_vregs[0xa7]<<8)|((st0016_vregs[0xa8]&0x1f)<<16))+1)<<1; - UINT32 srclen = (memregion(":maincpu")->bytes()); - UINT8 *mem = memregion(":maincpu")->base(); + uint32_t srclen = (memregion(":maincpu")->bytes()); + uint8_t *mem = memregion(":maincpu")->base(); int xfer_offs = m_dma_offset; if (!m_dma_offs_cb.isnull()) @@ -486,11 +486,11 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip for (y0 = (flipy ? ((1 << ly) - 1) : 0); y0 != (flipy ? -1 : (1 << ly)); y0 += (flipy ? -1 : 1)) { /* custom draw */ - UINT16 *destline; + uint16_t *destline; int yloop, xloop; int ypos, xpos; int tileno; - const UINT8 *srcgfx; + const uint8_t *srcgfx; int gfxoffs; ypos = sy + y0 * 8 + spr_dy; xpos = sx + x0 * 8 + spr_dx; @@ -501,7 +501,7 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip for (yloop = 0; yloop < 8; yloop++) { - UINT16 drawypos; + uint16_t drawypos; if (!flipy) { drawypos = ypos + yloop; } else { drawypos = (ypos + 8 - 1) - yloop; } @@ -509,7 +509,7 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip for (xloop = 0; xloop<8; xloop++) { - UINT16 drawxpos; + uint16_t drawxpos; int pixdata; pixdata = srcgfx[gfxoffs]; @@ -578,9 +578,9 @@ void st0016_cpu_device::startup() int gfx_index=0; m_dma_offset = 0; - m_charram=make_unique_clear(ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE); - st0016_spriteram=make_unique_clear(ST0016_MAX_SPR_BANK*ST0016_SPR_BANK_SIZE); - st0016_paletteram=make_unique_clear(ST0016_MAX_PAL_BANK*ST0016_PAL_BANK_SIZE); + m_charram=make_unique_clear(ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE); + st0016_spriteram=make_unique_clear(ST0016_MAX_SPR_BANK*ST0016_SPR_BANK_SIZE); + st0016_paletteram=make_unique_clear(ST0016_MAX_PAL_BANK*ST0016_PAL_BANK_SIZE); /* find first empty slot to decode gfx */ for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) @@ -632,10 +632,10 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap, const rectangle &clipre } else { - UINT16 *destline; + uint16_t *destline; int yloop, xloop; int ypos, xpos; - const UINT8 *srcgfx; + const uint8_t *srcgfx; int gfxoffs; ypos = y * 8 + spr_dy;//+((st0016_vregs[j+2]==0xaf)?0x50:0);//hack for mayjinsen title screen xpos = x * 8 + spr_dx; @@ -644,7 +644,7 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap, const rectangle &clipre for (yloop = 0; yloop < 8; yloop++) { - UINT16 drawypos; + uint16_t drawypos; if (!flipy) { drawypos = ypos + yloop; } else { drawypos = (ypos + 8 - 1) - yloop; } @@ -652,7 +652,7 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap, const rectangle &clipre for (xloop = 0; xloop<8; xloop++) { - UINT16 drawxpos; + uint16_t drawxpos; int pixdata; pixdata = srcgfx[gfxoffs]; @@ -706,7 +706,7 @@ void st0016_cpu_device::st0016_draw_screen(screen_device &screen, bitmap_ind16 & draw_bgmap(bitmap,cliprect,1); } -UINT32 st0016_cpu_device::update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t st0016_cpu_device::update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { #ifdef MAME_DEBUG if(machine().input().code_pressed_once(KEYCODE_Z)) diff --git a/src/mame/machine/st0016.h b/src/mame/machine/st0016.h index 39b449d9a40..75c61d4f68c 100644 --- a/src/mame/machine/st0016.h +++ b/src/mame/machine/st0016.h @@ -31,8 +31,8 @@ #define ST0016_PAL_BANK_MASK (ST0016_MAX_PAL_BANK-1) -typedef device_delegate st0016_dma_offs_delegate; -#define ST0016_DMA_OFFS_CB(name) UINT8 name(void) +typedef device_delegate st0016_dma_offs_delegate; +#define ST0016_DMA_OFFS_CB(name) uint8_t name(void) #define MCFG_ST0016_DMA_OFFS_CB(_class, _method) \ st0016_cpu_device::set_dma_offs_callback(*device, st0016_dma_offs_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); @@ -41,7 +41,7 @@ typedef device_delegate st0016_dma_offs_delegate; class st0016_cpu_device : public z80_device, public device_gfx_interface { public: - st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); static void set_dma_offs_callback(device_t &device, st0016_dma_offs_delegate callback) { downcast(device).m_dma_offs_cb = callback; } @@ -61,26 +61,26 @@ public: DECLARE_WRITE8_MEMBER(st0016_vregs_w); DECLARE_READ8_MEMBER(soundram_read); - void set_st0016_game_flag(UINT32 flag) { m_game_flag = flag; } + void set_st0016_game_flag(uint32_t flag) { m_game_flag = flag; } void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void st0016_save_init(); void draw_bgmap(bitmap_ind16 &bitmap,const rectangle &cliprect, int priority); void startup(); - UINT32 update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void st0016_draw_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - std::unique_ptr st0016_spriteram; - std::unique_ptr st0016_paletteram; + std::unique_ptr st0016_spriteram; + std::unique_ptr st0016_paletteram; - INT32 st0016_spr_bank,st0016_spr2_bank,st0016_pal_bank,st0016_char_bank; + int32_t st0016_spr_bank,st0016_spr2_bank,st0016_pal_bank,st0016_char_bank; int spr_dx,spr_dy; - UINT8 st0016_vregs[0xc0]; + uint8_t st0016_vregs[0xc0]; int st0016_ramgfx; - std::unique_ptr m_charram; + std::unique_ptr m_charram; protected: // device-level overrides @@ -104,9 +104,9 @@ protected: required_device m_screen; private: - UINT8 m_dma_offset; + uint8_t m_dma_offset; st0016_dma_offs_delegate m_dma_offs_cb; - UINT32 m_game_flag; + uint32_t m_game_flag; }; diff --git a/src/mame/machine/starwars.cpp b/src/mame/machine/starwars.cpp index ef6bb701f40..610f11df544 100644 --- a/src/mame/machine/starwars.cpp +++ b/src/mame/machine/starwars.cpp @@ -153,12 +153,12 @@ WRITE8_MEMBER(starwars_state::starwars_adc_select_w) void starwars_state::starwars_mproc_init() { - UINT8 *src = memregion("user2")->base(); + uint8_t *src = memregion("user2")->base(); int cnt, val; - m_PROM_STR = std::make_unique(1024); - m_PROM_MAS = std::make_unique(1024); - m_PROM_AM = std::make_unique(1024); + m_PROM_STR = std::make_unique(1024); + m_PROM_MAS = std::make_unique(1024); + m_PROM_AM = std::make_unique(1024); for (cnt = 0; cnt < 1024; cnt++) { @@ -318,7 +318,7 @@ void starwars_state::run_mproc() * takes 33 clock pulses to do a full rotation. */ - m_ACC += (((INT32)(m_A - m_B) << 1) * m_C) << 1; + m_ACC += (((int32_t)(m_A - m_B) << 1) * m_C) << 1; /* A and B are sign extended (requred by the ls384). After * multiplication they just contain the sign. @@ -445,7 +445,7 @@ WRITE8_MEMBER(starwars_state::starwars_math_w) for (i = 1; i < 16; i++) { m_quotient_shift <<= 1; - if (((INT32)m_dvd_shift + (m_divisor ^ 0xffff) + 1) & 0x10000) + if (((int32_t)m_dvd_shift + (m_divisor ^ 0xffff) + 1) & 0x10000) { m_quotient_shift |= 1; m_dvd_shift = (m_dvd_shift + (m_divisor ^ 0xffff) + 1) << 1; diff --git a/src/mame/machine/stfight.cpp b/src/mame/machine/stfight.cpp index 6e74dc39078..9ce6b1aee62 100644 --- a/src/mame/machine/stfight.cpp +++ b/src/mame/machine/stfight.cpp @@ -39,11 +39,11 @@ Encryption PAL 16R4 on CPU board DRIVER_INIT_MEMBER(stfight_state,empcity) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); - for (UINT32 A = 0; A < 0x8000; ++A) + for (uint32_t A = 0; A < 0x8000; ++A) { - UINT8 src = rom[A]; + uint8_t src = rom[A]; // decode opcode m_decrypted_opcodes[A] = @@ -111,7 +111,7 @@ void stfight_state::machine_reset() // - in fact I don't even know how/where it's switched in! WRITE8_MEMBER(stfight_state::stfight_bank_w) { - UINT8 bank_num = 0; + uint8_t bank_num = 0; if(data & 0x80) bank_num |= 2; @@ -188,8 +188,8 @@ WRITE_LINE_MEMBER(stfight_state::stfight_adpcm_int) if (!m_adpcm_reset) { - const UINT8 *samples = memregion("adpcm")->base(); - UINT8 adpcm_data = samples[m_adpcm_data_offs & 0x7fff]; + const uint8_t *samples = memregion("adpcm")->base(); + uint8_t adpcm_data = samples[m_adpcm_data_offs & 0x7fff]; if (m_adpcm_nibble == 0) adpcm_data >>= 4; @@ -214,7 +214,7 @@ WRITE8_MEMBER(stfight_state::stfight_fm_w) READ8_MEMBER(stfight_state::stfight_fm_r) { - UINT8 data = m_fm_data; + uint8_t data = m_fm_data; // Acknowledge the command m_fm_data &= ~0x80; diff --git a/src/mame/machine/stvprot.cpp b/src/mame/machine/stvprot.cpp index 26d48e8dfd8..02b110f33df 100644 --- a/src/mame/machine/stvprot.cpp +++ b/src/mame/machine/stvprot.cpp @@ -30,15 +30,15 @@ READ32_MEMBER( stv_state::common_prot_r ) { - UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base(); + uint32_t *ROM = (uint32_t *)space.machine().root_device().memregion("abus")->base(); if(m_abus_protenable & 0x00010000)//protection calculation is activated { if(offset == 3) { - UINT8* base; - UINT16 res = m_cryptdevice->do_decrypt(base); - UINT16 res2 = m_cryptdevice->do_decrypt(base); + uint8_t* base; + uint16_t res = m_cryptdevice->do_decrypt(base); + uint16_t res2 = m_cryptdevice->do_decrypt(base); res = ((res & 0xff00) >> 8) | ((res & 0x00ff) << 8); res2 = ((res2 & 0xff00) >> 8) | ((res2 & 0x00ff) << 8); @@ -54,9 +54,9 @@ READ32_MEMBER( stv_state::common_prot_r ) } -UINT16 stv_state::crypt_read_callback(UINT32 addr) +uint16_t stv_state::crypt_read_callback(uint32_t addr) { - UINT16 dat= m_maincpu->space().read_word((0x02000000+2*addr)); + uint16_t dat= m_maincpu->space().read_word((0x02000000+2*addr)); return ((dat&0xff00)>>8)|((dat&0x00ff)<<8); } diff --git a/src/mame/machine/subsino.cpp b/src/mame/machine/subsino.cpp index 1389058756f..06cf7901e95 100644 --- a/src/mame/machine/subsino.cpp +++ b/src/mame/machine/subsino.cpp @@ -11,14 +11,14 @@ by David Haywood // XORs: -extern const UINT8 crsbingo_xors[8] = { 0xbb, 0xcc, 0xcc, 0xdd, 0xaa, 0x11, 0x44, 0xee }; -extern const UINT8 sharkpy_xors [8] = { 0xcc, 0xaa, 0x66, 0xaa, 0xee, 0x33, 0xff, 0xff }; -extern const UINT8 victor5_xors [8] = { 0x99, 0x99, 0x33, 0x44, 0xbb, 0x88, 0x88, 0xbb }; -extern const UINT8 victor21_xors[8] = { 0x44, 0xbb, 0x66, 0x44, 0xaa, 0x55, 0x88, 0x22 }; +extern const uint8_t crsbingo_xors[8] = { 0xbb, 0xcc, 0xcc, 0xdd, 0xaa, 0x11, 0x44, 0xee }; +extern const uint8_t sharkpy_xors [8] = { 0xcc, 0xaa, 0x66, 0xaa, 0xee, 0x33, 0xff, 0xff }; +extern const uint8_t victor5_xors [8] = { 0x99, 0x99, 0x33, 0x44, 0xbb, 0x88, 0x88, 0xbb }; +extern const uint8_t victor21_xors[8] = { 0x44, 0xbb, 0x66, 0x44, 0xaa, 0x55, 0x88, 0x22 }; // Bitswaps: -void crsbingo_bitswaps(UINT8 *decrypt, int i) +void crsbingo_bitswaps(uint8_t *decrypt, int i) { if ((i&7) == 0) decrypt[i] = BITSWAP8(decrypt[i], 7,2,5,4,3,6,1,0 ); if ((i&7) == 1) decrypt[i] = BITSWAP8(decrypt[i], 7,2,1,0,3,6,5,4 ); @@ -30,7 +30,7 @@ void crsbingo_bitswaps(UINT8 *decrypt, int i) if ((i&7) == 7) decrypt[i] = BITSWAP8(decrypt[i], 3,2,1,0,7,6,5,4 ); } -void sharkpy_bitswaps(UINT8 *decrypt, int i) +void sharkpy_bitswaps(uint8_t *decrypt, int i) { if ((i&7) == 0) decrypt[i] = BITSWAP8(decrypt[i], 3,2,1,0,7,6,5,4 ); if ((i&7) == 1) decrypt[i] = BITSWAP8(decrypt[i], 7,2,5,4,3,6,1,0 ); @@ -42,7 +42,7 @@ void sharkpy_bitswaps(UINT8 *decrypt, int i) if ((i&7) == 7) decrypt[i] = BITSWAP8(decrypt[i], 3,6,1,4,7,2,5,0 ); } -void victor5_bitswaps(UINT8 *decrypt, int i) +void victor5_bitswaps(uint8_t *decrypt, int i) { if ((i&7) == 0) decrypt[i] = BITSWAP8(decrypt[i], 7,2,5,4,3,6,1,0 ); if ((i&7) == 1) decrypt[i] = BITSWAP8(decrypt[i], 7,6,5,0,3,2,1,4 ); @@ -54,7 +54,7 @@ void victor5_bitswaps(UINT8 *decrypt, int i) if ((i&7) == 7) decrypt[i] = BITSWAP8(decrypt[i], 7,2,1,4,3,6,5,0 ); } -void victor21_bitswaps(UINT8 *decrypt, int i) +void victor21_bitswaps(uint8_t *decrypt, int i) { if ((i&7) == 0) decrypt[i] = BITSWAP8(decrypt[i], 7,2,1,0,3,6,5,4 ); if ((i&7) == 1) decrypt[i] = BITSWAP8(decrypt[i], 3,6,1,4,7,2,5,0 ); @@ -69,7 +69,7 @@ void victor21_bitswaps(UINT8 *decrypt, int i) // Decrypt: #if 0 -void dump_decrypted(running_machine& machine, UINT8* decrypt) +void dump_decrypted(running_machine& machine, uint8_t* decrypt) { FILE *fp; char filename[256]; @@ -83,11 +83,11 @@ void dump_decrypted(running_machine& machine, UINT8* decrypt) } #endif -void subsino_decrypt(running_machine& machine, void (*bitswaps)(UINT8 *decrypt, int i), const UINT8 *xors, int size) +void subsino_decrypt(running_machine& machine, void (*bitswaps)(uint8_t *decrypt, int i), const uint8_t *xors, int size) { int i; - std::unique_ptr decrypt = std::make_unique(0x10000); - UINT8* region = machine.root_device().memregion("maincpu")->base(); + std::unique_ptr decrypt = std::make_unique(0x10000); + uint8_t* region = machine.root_device().memregion("maincpu")->base(); for (i=0;i<0x10000;i++) { diff --git a/src/mame/machine/subsino.h b/src/mame/machine/subsino.h index 671243317dd..23f97da0c4b 100644 --- a/src/mame/machine/subsino.h +++ b/src/mame/machine/subsino.h @@ -5,16 +5,16 @@ #include "emu.h" -extern const UINT8 crsbingo_xors[8]; -extern const UINT8 sharkpy_xors [8]; -extern const UINT8 victor5_xors [8]; -extern const UINT8 victor21_xors[8]; +extern const uint8_t crsbingo_xors[8]; +extern const uint8_t sharkpy_xors [8]; +extern const uint8_t victor5_xors [8]; +extern const uint8_t victor21_xors[8]; -void crsbingo_bitswaps(UINT8 *decrypt, int i); -void sharkpy_bitswaps (UINT8 *decrypt, int i); -void victor5_bitswaps (UINT8 *decrypt, int i); -void victor21_bitswaps(UINT8 *decrypt, int i); +void crsbingo_bitswaps(uint8_t *decrypt, int i); +void sharkpy_bitswaps (uint8_t *decrypt, int i); +void victor5_bitswaps (uint8_t *decrypt, int i); +void victor21_bitswaps(uint8_t *decrypt, int i); -void subsino_decrypt(running_machine& machine, void (*bitswaps)(UINT8 *decrypt, int i), const UINT8 *xors, int size); +void subsino_decrypt(running_machine& machine, void (*bitswaps)(uint8_t *decrypt, int i), const uint8_t *xors, int size); #endif diff --git a/src/mame/machine/super80.cpp b/src/mame/machine/super80.cpp index a4825f8f444..1c481e2191b 100644 --- a/src/mame/machine/super80.cpp +++ b/src/mame/machine/super80.cpp @@ -16,7 +16,7 @@ WRITE8_MEMBER( super80_state::pio_port_a_w ) READ8_MEMBER( super80_state::pio_port_b_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 8; i++) { @@ -74,7 +74,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( super80_state::timer_k ) bit 2 = CA3140 */ TIMER_DEVICE_CALLBACK_MEMBER( super80_state::timer_p ) { - UINT8 cass_ws=0; + uint8_t cass_ws=0; m_cass_data[1]++; cass_ws = ((m_cassette)->input() > +0.03) ? 4 : 0; @@ -96,7 +96,7 @@ TIMER_CALLBACK_MEMBER(super80_state::super80_reset) TIMER_DEVICE_CALLBACK_MEMBER( super80_state::timer_h ) { - UINT8 go_fast = 0; + uint8_t go_fast = 0; if ( (!BIT(m_portf0, 2)) | (!BIT(m_io_config->read(), 1)) ) /* bit 2 of port F0 is low, OR user turned on config switch */ go_fast++; // must be 1 at boot so banking works correctly @@ -166,7 +166,7 @@ WRITE8_MEMBER( super80_state::port3f_w ) READ8_MEMBER( super80_state::super80_f2_r ) { - UINT8 data = m_io_dsw->read() & 0xf0; // dip switches on pcb + uint8_t data = m_io_dsw->read() & 0xf0; // dip switches on pcb data |= m_cass_data[2]; // bit 0 = output of U1, bit 1 = MDS cass state, bit 2 = current wave_state data |= 0x08; // bit 3 - not used return data; @@ -183,7 +183,7 @@ WRITE8_MEMBER( super80_state::super80_dc_w ) WRITE8_MEMBER( super80_state::super80_f0_w ) { - UINT8 bits = data ^ m_last_data; + uint8_t bits = data ^ m_last_data; m_portf0 = data; m_speaker->level_w(BIT(data, 3)); /* bit 3 - speaker */ if (BIT(bits, 1)) super80_cassette_motor(BIT(data, 1)); /* bit 1 - cassette motor */ @@ -194,7 +194,7 @@ WRITE8_MEMBER( super80_state::super80_f0_w ) WRITE8_MEMBER( super80_state::super80r_f0_w ) { - UINT8 bits = data ^ m_last_data; + uint8_t bits = data ^ m_last_data; m_portf0 = data | 0x14; m_speaker->level_w(BIT(data, 3)); /* bit 3 - speaker */ if (BIT(bits, 1)) super80_cassette_motor(BIT(data, 1)); /* bit 1 - cassette motor */ @@ -227,7 +227,7 @@ MACHINE_RESET_MEMBER( super80_state, super80r ) DRIVER_INIT_MEMBER( super80_state,super80 ) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xc000); } @@ -238,7 +238,7 @@ DRIVER_INIT_MEMBER( super80_state,super80 ) QUICKLOAD_LOAD_MEMBER( super80_state, super80 ) { - UINT16 exec_addr, start_addr, end_addr; + uint16_t exec_addr, start_addr, end_addr; /* load the binary into memory */ if (z80bin_load_file(&image, m_maincpu->space(AS_PROGRAM), file_type, &exec_addr, &start_addr, &end_addr) != image_init_result::PASS) diff --git a/src/mame/machine/swim.cpp b/src/mame/machine/swim.cpp index 9e1506ad9ab..df9beec8afa 100644 --- a/src/mame/machine/swim.cpp +++ b/src/mame/machine/swim.cpp @@ -37,7 +37,7 @@ const device_type SWIM = &device_creator; // ctor //------------------------------------------------- -swim_device::swim_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +swim_device::swim_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : applefdc_base_device(APPLEFDC_SWIM, mconfig, SWIM, "Apple SWIM (Steve Woz Integrated Machine)", tag, owner, clock, "swim", __FILE__) { } @@ -71,7 +71,7 @@ void swim_device::device_reset() // call inherited version applefdc_base_device::device_reset(); - static UINT8 swim_default_parms[16] = + static uint8_t swim_default_parms[16] = { 0x38, 0x18, 0x41, 0x2e, 0x2e, 0x18, 0x18, 0x1b, 0x1b, 0x2f, 0x2f, 0x19, 0x19, 0x97, 0x1b, 0x57 @@ -93,9 +93,9 @@ void swim_device::device_reset() // read - reads a byte from the FDC //------------------------------------------------- -UINT8 swim_device::read(UINT8 offset) +uint8_t swim_device::read(uint8_t offset) { - UINT8 result = 0; + uint8_t result = 0; if (m_swim_mode == SWIM_MODE_IWM) { @@ -127,7 +127,7 @@ UINT8 swim_device::read(UINT8 offset) // write - write a byte to the FDC //------------------------------------------------- -void swim_device::write(UINT8 offset, UINT8 data) +void swim_device::write(uint8_t offset, uint8_t data) { if (m_swim_mode == SWIM_MODE_IWM) { @@ -179,7 +179,7 @@ void swim_device::write(UINT8 offset, UINT8 data) // iwm_modereg_w - changes the mode register //------------------------------------------------- -void swim_device::iwm_modereg_w(UINT8 data) +void swim_device::iwm_modereg_w(uint8_t data) { // SWIM mode is unlocked by writing 1/0/1/1 in a row to bit 6 (which is unused on IWM) // when SWIM mode engages, the IWM is disconnected from both the 68k and the drives, diff --git a/src/mame/machine/swim.h b/src/mame/machine/swim.h index f628f13dc2f..f15412e352e 100644 --- a/src/mame/machine/swim.h +++ b/src/mame/machine/swim.h @@ -24,11 +24,11 @@ extern const device_type SWIM; class swim_device : public applefdc_base_device { public: - swim_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + swim_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write - virtual UINT8 read(UINT8 offset) override; - virtual void write(UINT8 offset, UINT8 data) override; + virtual uint8_t read(uint8_t offset) override; + virtual void write(uint8_t offset, uint8_t data) override; protected: // device-level overrides @@ -36,14 +36,14 @@ protected: virtual void device_reset() override; // other overrides - virtual void iwm_modereg_w(UINT8 data) override; + virtual void iwm_modereg_w(uint8_t data) override; private: - UINT8 m_swim_mode; - UINT8 m_swim_magic_state; - UINT8 m_parm_offset; - UINT8 m_ism_regs[8]; - UINT8 m_parms[16]; + uint8_t m_swim_mode; + uint8_t m_swim_magic_state; + uint8_t m_parm_offset; + uint8_t m_ism_regs[8]; + uint8_t m_parms[16]; }; diff --git a/src/mame/machine/swtpc09.cpp b/src/mame/machine/swtpc09.cpp index d6dc045cb8d..e34554d64fa 100644 --- a/src/mame/machine/swtpc09.cpp +++ b/src/mame/machine/swtpc09.cpp @@ -150,8 +150,8 @@ WRITE8_MEMBER ( swtpc09_state::dmf2_control_reg_w ) /* FDC controller dma transfer */ void swtpc09_state::swtpc09_fdc_dma_transfer() { - UINT8 *RAM = memregion("maincpu")->base(); - UINT32 offset; + uint8_t *RAM = memregion("maincpu")->base(); + uint32_t offset; address_space &space = m_maincpu->space(AS_PROGRAM); offset = (m_fdc_dma_address_reg & 0x0f)<<16; @@ -160,14 +160,14 @@ void swtpc09_state::swtpc09_fdc_dma_transfer() { if (!(m_m6844_channel[0].control & 0x01)) // dma write to memory { - UINT8 data = m_fdc->data_r(space, 0); + uint8_t data = m_fdc->data_r(space, 0); LOG(("swtpc09_dma_write_mem %05X %02X\n", m_m6844_channel[0].address + offset, data)); RAM[m_m6844_channel[0].address + offset] = data; } else { - UINT8 data = RAM[m_m6844_channel[0].address + offset]; + uint8_t data = RAM[m_m6844_channel[0].address + offset]; m_fdc->data_w(space, 0, data); //LOG(("swtpc09_dma_read_mem %04X %02X\n", m_m6844_channel[0].address, data)); @@ -190,7 +190,7 @@ void swtpc09_state::swtpc09_fdc_dma_transfer() } /* common interrupt handler */ -void swtpc09_state::swtpc09_irq_handler(UINT8 peripheral, UINT8 state) +void swtpc09_state::swtpc09_irq_handler(uint8_t peripheral, uint8_t state) { LOG(("swtpc09_irq_handler peripheral:%02X state:%02X\n", peripheral, state)); @@ -455,9 +455,9 @@ WRITE8_MEMBER( swtpc09_state::piaide_b_w ) WRITE8_MEMBER(swtpc09_state::dat_w) { - UINT8 a16_to_a19, a12_to_a15; - UINT8 *RAM = memregion("maincpu")->base(); - UINT32 physical_address, logical_address; + uint8_t a16_to_a19, a12_to_a15; + uint8_t *RAM = memregion("maincpu")->base(); + uint32_t physical_address, logical_address; address_space &mem = m_maincpu->space(AS_PROGRAM); @@ -581,7 +581,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w) READ8_MEMBER( swtpc09_state::m6844_r ) { - UINT8 result = 0; + uint8_t result = 0; /* switch off the offset we were given */ diff --git a/src/mame/machine/tait8741.cpp b/src/mame/machine/tait8741.cpp index 5e568fbd6f1..612831749f7 100644 --- a/src/mame/machine/tait8741.cpp +++ b/src/mame/machine/tait8741.cpp @@ -35,7 +35,7 @@ gladiatr and Great Swordsman set. const device_type TAITO8741_4PACK = &device_creator; -taito8741_4pack_device::taito8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +taito8741_4pack_device::taito8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TAITO8741_4PACK, "I8741 MCU Simulation (Taito 4Pack)", tag, owner, clock, "taito8741_4pack", __FILE__), m_port_handler_0_r(*this), m_port_handler_1_r(*this), @@ -70,7 +70,7 @@ int taito8741_4pack_device::hostcmd_r(I8741 *st) /* TAITO8741 I8741 emulation */ -void taito8741_4pack_device::serial_rx(I8741 *st,UINT8 *data) +void taito8741_4pack_device::serial_rx(I8741 *st,uint8_t *data) { memcpy(st->rxd,data,8); } @@ -321,7 +321,7 @@ void taito8741_4pack_device::command_w(int num, int data) update(num); } -UINT8 taito8741_4pack_device::port_read(int num, int offset) +uint8_t taito8741_4pack_device::port_read(int num, int offset) { switch(num) { @@ -347,7 +347,7 @@ joshi Vollyball set. const device_type JOSVOLLY8741_4PACK = &device_creator; -josvolly8741_4pack_device::josvolly8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +josvolly8741_4pack_device::josvolly8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JOSVOLLY8741_4PACK, "I8741 MCU Simulation (Joshi Volleyball)", tag, owner, clock, "josvolly8741_4pack", __FILE__), m_port_handler_0_r(*this), m_port_handler_1_r(*this), @@ -478,7 +478,7 @@ void josvolly8741_4pack_device::write(int num, int offset, int data) update(num); } -UINT8 josvolly8741_4pack_device::read(int num,int offset) +uint8_t josvolly8741_4pack_device::read(int num,int offset) { JV8741 *mcu = &m_i8741[num]; int ret; @@ -501,7 +501,7 @@ UINT8 josvolly8741_4pack_device::read(int num,int offset) return ret; } -UINT8 josvolly8741_4pack_device::port_read(int num) +uint8_t josvolly8741_4pack_device::port_read(int num) { switch(num) { diff --git a/src/mame/machine/tait8741.h b/src/mame/machine/tait8741.h index e0a5eb75c73..abf87272503 100644 --- a/src/mame/machine/tait8741.h +++ b/src/mame/machine/tait8741.h @@ -40,24 +40,24 @@ class taito8741_4pack_device : public device_t { struct I8741 { int number; - UINT8 toData; /* to host data */ - UINT8 fromData; /* from host data */ - UINT8 fromCmd; /* from host command */ - UINT8 status; /* b0 = rd ready,b1 = wd full,b2 = cmd ?? */ - UINT8 mode; - UINT8 phase; - UINT8 txd[8]; - UINT8 rxd[8]; - UINT8 parallelselect; - UINT8 txpoint; + uint8_t toData; /* to host data */ + uint8_t fromData; /* from host data */ + uint8_t fromCmd; /* from host command */ + uint8_t status; /* b0 = rd ready,b1 = wd full,b2 = cmd ?? */ + uint8_t mode; + uint8_t phase; + uint8_t txd[8]; + uint8_t rxd[8]; + uint8_t parallelselect; + uint8_t txpoint; int connect; - UINT8 pending4a; + uint8_t pending4a; int serial_out; int coins; }; public: - taito8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + taito8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~taito8741_4pack_device() {} template static devcb_base &set_port_handler_0_callback(device_t &device, _Object object) { return downcast(device).m_port_handler_0_r.set_callback(object); } @@ -65,7 +65,7 @@ public: template static devcb_base &set_port_handler_2_callback(device_t &device, _Object object) { return downcast(device).m_port_handler_2_r.set_callback(object); } template static devcb_base &set_port_handler_3_callback(device_t &device, _Object object) { return downcast(device).m_port_handler_3_r.set_callback(object); } - static void static_set_mode(device_t &device, int num, UINT8 mode) { downcast(device).m_taito8741[num].mode = mode; } + static void static_set_mode(device_t &device, int num, uint8_t mode) { downcast(device).m_taito8741[num].mode = mode; } static void static_set_connect(device_t &device, int num, int conn) { downcast(device).m_taito8741[num].connect = conn; } DECLARE_READ8_MEMBER( read_0 ) { if(offset&1) return status_r(0); else return data_r(0); } @@ -84,7 +84,7 @@ public: void data_w(int num, int data); void command_w(int num, int data); - UINT8 port_read(int num, int offset); + uint8_t port_read(int num, int offset); protected: // device-level overrides @@ -95,7 +95,7 @@ private: void hostdata_w(I8741 *st,int data); int hostdata_r(I8741 *st); int hostcmd_r(I8741 *st); - void serial_rx(I8741 *st,UINT8 *data); + void serial_rx(I8741 *st,uint8_t *data); // internal state I8741 m_taito8741[4]; @@ -133,17 +133,17 @@ extern const device_type TAITO8741_4PACK; class josvolly8741_4pack_device : public device_t { struct JV8741 { - UINT8 cmd; - UINT8 sts; - UINT8 txd; - UINT8 outport; - UINT8 rxd; - UINT8 connect; - UINT8 rst; + uint8_t cmd; + uint8_t sts; + uint8_t txd; + uint8_t outport; + uint8_t rxd; + uint8_t connect; + uint8_t rst; }; public: - josvolly8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + josvolly8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~josvolly8741_4pack_device() {} template static devcb_base &set_port_handler_0_callback(device_t &device, _Object object) { return downcast(device).m_port_handler_0_r.set_callback(object); } @@ -169,8 +169,8 @@ protected: private: void update(int num); void write(int num, int offset, int data); - UINT8 read(int num,int offset); - UINT8 port_read(int num); + uint8_t read(int num,int offset); + uint8_t port_read(int num); // internal state JV8741 m_i8741[4]; diff --git a/src/mame/machine/taitoio.cpp b/src/mame/machine/taitoio.cpp index b13a09511d1..c19e1ffd02b 100644 --- a/src/mame/machine/taitoio.cpp +++ b/src/mame/machine/taitoio.cpp @@ -61,7 +61,7 @@ MACHINE_CONFIG_END const device_type TC0220IOC = &device_creator; -tc0220ioc_device::tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tc0220ioc_device::tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0220IOC, "Taito TC0220IOC", tag, owner, clock, "tc0220ioc", __FILE__), m_watchdog(*this, "watchdog"), m_read_0_cb(*this), @@ -198,7 +198,7 @@ WRITE8_MEMBER( tc0220ioc_device::portreg_w ) const device_type TC0510NIO = &device_creator; -tc0510nio_device::tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tc0510nio_device::tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0510NIO, "Taito TC0510NIO", tag, owner, clock, "tc0510nio", __FILE__), m_watchdog(*this, "watchdog"), m_read_0_cb(*this), @@ -336,7 +336,7 @@ WRITE16_MEMBER( tc0510nio_device::halfword_wordswap_w ) const device_type TC0640FIO = &device_creator; -tc0640fio_device::tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tc0640fio_device::tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0640FIO, "Taito TC0640FIO", tag, owner, clock, "tc0640fio", __FILE__), m_watchdog(*this, "watchdog"), m_read_0_cb(*this), diff --git a/src/mame/machine/taitoio.h b/src/mame/machine/taitoio.h index 2db29df5ff2..30bef9e7eae 100644 --- a/src/mame/machine/taitoio.h +++ b/src/mame/machine/taitoio.h @@ -17,7 +17,7 @@ class tc0220ioc_device : public device_t { public: - tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tc0220ioc_device() {} template static devcb_base &set_read_0_callback(device_t &device, _Object object) { return downcast(device).m_read_0_cb.set_callback(object); } @@ -41,8 +41,8 @@ protected: private: // internal state - UINT8 m_regs[8]; - UINT8 m_port; + uint8_t m_regs[8]; + uint8_t m_port; required_device m_watchdog; @@ -58,7 +58,7 @@ extern const device_type TC0220IOC; class tc0510nio_device : public device_t { public: - tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tc0510nio_device() {} template static devcb_base &set_read_0_callback(device_t &device, _Object object) { return downcast(device).m_read_0_cb.set_callback(object); } @@ -82,7 +82,7 @@ protected: private: // internal state - UINT8 m_regs[8]; + uint8_t m_regs[8]; required_device m_watchdog; @@ -98,7 +98,7 @@ extern const device_type TC0510NIO; class tc0640fio_device : public device_t { public: - tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tc0640fio_device() {} template static devcb_base &set_read_0_callback(device_t &device, _Object object) { return downcast(device).m_read_0_cb.set_callback(object); } @@ -123,7 +123,7 @@ protected: private: // internal state - UINT8 m_regs[8]; + uint8_t m_regs[8]; required_device m_watchdog; diff --git a/src/mame/machine/tandy2kb.cpp b/src/mame/machine/tandy2kb.cpp index 46e4bb1ddba..fd975ed3a84 100644 --- a/src/mame/machine/tandy2kb.cpp +++ b/src/mame/machine/tandy2kb.cpp @@ -225,7 +225,7 @@ ioport_constructor tandy2k_keyboard_device::device_input_ports() const // tandy2k_keyboard_device - constructor //------------------------------------------------- -tandy2k_keyboard_device::tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tandy2k_keyboard_device::tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TANDY2K_KEYBOARD, "Tandy 2000 Keyboard", tag, owner, clock, "tandy2kb", __FILE__), m_maincpu(*this, I8048_TAG), m_y(*this, "Y%u", 0), @@ -326,7 +326,7 @@ READ8_MEMBER( tandy2k_keyboard_device::kb_p1_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 12; i++) { diff --git a/src/mame/machine/tandy2kb.h b/src/mame/machine/tandy2kb.h index 8ce35e7d757..aa6befb3667 100644 --- a/src/mame/machine/tandy2kb.h +++ b/src/mame/machine/tandy2kb.h @@ -46,7 +46,7 @@ class tandy2k_keyboard_device : public device_t { public: // construction/destruction - tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_clock_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_clock.set_callback(object); } template static devcb_base &set_data_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_data.set_callback(object); } @@ -84,7 +84,7 @@ private: devcb_write_line m_write_clock; devcb_write_line m_write_data; - UINT16 m_keylatch; + uint16_t m_keylatch; int m_clock; int m_data; diff --git a/src/mame/machine/tatsumi.cpp b/src/mame/machine/tatsumi.cpp index a9282ed2c7b..25de2eca2e6 100644 --- a/src/mame/machine/tatsumi.cpp +++ b/src/mame/machine/tatsumi.cpp @@ -113,7 +113,7 @@ READ8_MEMBER(tatsumi_state::apache3_adc_r) case 1: return ioport("STICK_Y")->read(); case 2: return 0; // VSP1 case 3: return 0; - case 4: return (UINT8)((255./100) * (100 - ioport("VR1")->read())); + case 4: return (uint8_t)((255./100) * (100 - ioport("VR1")->read())); case 5: return ioport("THROTTLE")->read(); case 6: return 0; // RPSNC case 7: return 0; // LPSNC @@ -294,7 +294,7 @@ WRITE16_MEMBER(tatsumi_state::cyclwarr_control_w) READ16_MEMBER(tatsumi_state::tatsumi_v30_68000_r) { - const UINT16* rom=(UINT16*)memregion("sub")->base(); + const uint16_t* rom=(uint16_t*)memregion("sub")->base(); logerror("%05X:68000_r(%04X),cw=%04X\n", space.device().safe_pc(), offset*2, m_control_word); /* Read from 68k RAM */ @@ -303,7 +303,7 @@ logerror("%05X:68000_r(%04X),cw=%04X\n", space.device().safe_pc(), offset*2, m_c // hack to make roundup 5 boot if (space.device().safe_pc()==0xec575) { - UINT8 *dst = memregion("maincpu")->base(); + uint8_t *dst = memregion("maincpu")->base(); dst[BYTE_XOR_LE(0xec57a)]=0x46; dst[BYTE_XOR_LE(0xec57b)]=0x46; diff --git a/src/mame/machine/tecmosys.cpp b/src/mame/machine/tecmosys.cpp index 7f56a00b8c5..2b0553546b6 100644 --- a/src/mame/machine/tecmosys.cpp +++ b/src/mame/machine/tecmosys.cpp @@ -45,17 +45,17 @@ enum DEV_STATUS struct prot_data { - UINT8 passwd_len; - const UINT8* passwd; - const UINT8* code; - UINT8 checksum_ranges[17]; - UINT8 checksums[4]; + uint8_t passwd_len; + const uint8_t* passwd; + const uint8_t* code; + uint8_t checksum_ranges[17]; + uint8_t checksums[4]; }; // deroon prot data -static const UINT8 deroon_passwd[] = {'L','U','N','A',0}; -static const UINT8 deroon_upload[] = {0x02, 0x4e, 0x75, 0x00 }; // code length, code, 0x00 trailer +static const uint8_t deroon_passwd[] = {'L','U','N','A',0}; +static const uint8_t deroon_upload[] = {0x02, 0x4e, 0x75, 0x00 }; // code length, code, 0x00 trailer static const struct prot_data deroon_data = { 5, @@ -72,8 +72,8 @@ static const struct prot_data deroon_data = }; // tkdensho prot data -static const UINT8 tkdensho_passwd[] = {'A','G','E','P','R','O','T','E','C','T',' ','S','T','A','R','T',0}; -static const UINT8 tkdensho_upload[] = {0x06, 0x4e, 0xf9, 0x00, 0x00, 0x22, 0xc4,0x00}; +static const uint8_t tkdensho_passwd[] = {'A','G','E','P','R','O','T','E','C','T',' ','S','T','A','R','T',0}; +static const uint8_t tkdensho_upload[] = {0x06, 0x4e, 0xf9, 0x00, 0x00, 0x22, 0xc4,0x00}; static const struct prot_data tkdensho_data = { 0x11, @@ -146,7 +146,7 @@ READ16_MEMBER(tecmosys_state::prot_data_r) { // prot appears to be read-ready for two consecutive reads // but returns 0xff for subsequent reads. - UINT8 ret = m_device_value; + uint8_t ret = m_device_value; m_device_value = 0xff; //logerror("- prot_r = 0x%02x\n", ret ); return ret << 8; diff --git a/src/mame/machine/teleprinter.cpp b/src/mame/machine/teleprinter.cpp index 92ac0a9b526..658bdf691b6 100644 --- a/src/mame/machine/teleprinter.cpp +++ b/src/mame/machine/teleprinter.cpp @@ -4,7 +4,7 @@ #define KEYBOARD_TAG "keyboard" -static const UINT8 teleprinter_font[128*8] = +static const uint8_t teleprinter_font[128*8] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x07,0x07,0x07,0x07,0x00,0x00,0x00,0x00, @@ -136,7 +136,7 @@ static const UINT8 teleprinter_font[128*8] = 0x2a,0x15,0x2a,0x15,0x2a,0x15,0x2a,0x15 }; -teleprinter_device::teleprinter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +teleprinter_device::teleprinter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_terminal_device(mconfig, TELEPRINTER, "Teleprinter", tag, owner, clock, "teleprinter", __FILE__) { } @@ -147,7 +147,7 @@ void teleprinter_device::scroll_line() memset(m_buffer + TELEPRINTER_WIDTH*(TELEPRINTER_HEIGHT-1),0x20,TELEPRINTER_WIDTH); } -void teleprinter_device::write_char(UINT8 data) { +void teleprinter_device::write_char(uint8_t data) { m_buffer[(TELEPRINTER_HEIGHT-1)*TELEPRINTER_WIDTH+m_x_pos] = data; m_x_pos++; if (m_x_pos >= TELEPRINTER_WIDTH) @@ -162,7 +162,7 @@ void teleprinter_device::clear() { m_x_pos = 0; } -void teleprinter_device::term_write(UINT8 data) +void teleprinter_device::term_write(uint8_t data) { switch(data) { case 10: m_x_pos = 0; @@ -182,9 +182,9 @@ void teleprinter_device::term_write(UINT8 data) /*************************************************************************** VIDEO HARDWARE ***************************************************************************/ -UINT32 teleprinter_device::tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t teleprinter_device::tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 code; + uint8_t code; int y, c, x, b; for (y = 0; y < TELEPRINTER_HEIGHT; y++) diff --git a/src/mame/machine/teleprinter.h b/src/mame/machine/teleprinter.h index 918a2b3ec0c..f9f58130452 100644 --- a/src/mame/machine/teleprinter.h +++ b/src/mame/machine/teleprinter.h @@ -25,15 +25,15 @@ class teleprinter_device : public generic_terminal_device { public: - teleprinter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - UINT32 tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect); + teleprinter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + uint32_t tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: - virtual void term_write(UINT8 data) override; + virtual void term_write(uint8_t data) override; virtual void device_reset() override; virtual machine_config_constructor device_mconfig_additions() const override; private: void scroll_line(); - void write_char(UINT8 data); + void write_char(uint8_t data); void clear(); }; diff --git a/src/mame/machine/theglobp.cpp b/src/mame/machine/theglobp.cpp index 6b60bb1c945..8c153ecfa13 100644 --- a/src/mame/machine/theglobp.cpp +++ b/src/mame/machine/theglobp.cpp @@ -71,7 +71,7 @@ void pacman_state::theglobp_decrypt_rom_8() { int oldbyte,inverted_oldbyte,newbyte; int mem; - UINT8 *RAM; + uint8_t *RAM; RAM = memregion("maincpu")->base(); @@ -107,7 +107,7 @@ void pacman_state::theglobp_decrypt_rom_9() { int oldbyte,inverted_oldbyte,newbyte; int mem; - UINT8 *RAM; + uint8_t *RAM; RAM = memregion("maincpu")->base(); @@ -141,7 +141,7 @@ void pacman_state::theglobp_decrypt_rom_A() { int oldbyte,inverted_oldbyte,newbyte; int mem; - UINT8 *RAM; + uint8_t *RAM; RAM = memregion("maincpu")->base(); @@ -175,7 +175,7 @@ void pacman_state::theglobp_decrypt_rom_B() { int oldbyte,inverted_oldbyte,newbyte; int mem; - UINT8 *RAM; + uint8_t *RAM; RAM = memregion("maincpu")->base(); @@ -234,7 +234,7 @@ READ8_MEMBER(pacman_state::theglobp_decrypt_rom ) MACHINE_START_MEMBER(pacman_state,theglobp) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); /* While the PAL supports up to 16 decryption methods, only four are actually used in the PAL. Therefore, we'll take a little diff --git a/src/mame/machine/thomflop.cpp b/src/mame/machine/thomflop.cpp index 6252d2ec48a..864fd36c9c4 100644 --- a/src/mame/machine/thomflop.cpp +++ b/src/mame/machine/thomflop.cpp @@ -82,7 +82,7 @@ static int motor_on; /* build an identifier, with header & space */ -int thomson_state::thom_floppy_make_addr( chrn_id id, UINT8* dst, int sector_size ) +int thomson_state::thom_floppy_make_addr( chrn_id id, uint8_t* dst, int sector_size ) { if ( sector_size == 128 ) { @@ -117,7 +117,7 @@ int thomson_state::thom_floppy_make_addr( chrn_id id, UINT8* dst, int sector_siz /* build a sector, with header & space */ -int thomson_state::thom_floppy_make_sector( legacy_floppy_image_device* img, chrn_id id, UINT8* dst, int sector_size ) +int thomson_state::thom_floppy_make_sector( legacy_floppy_image_device* img, chrn_id id, uint8_t* dst, int sector_size ) { if ( sector_size == 128 ) { @@ -148,10 +148,10 @@ int thomson_state::thom_floppy_make_sector( legacy_floppy_image_device* img, chr /* build a whole track */ -int thomson_state::thom_floppy_make_track( legacy_floppy_image_device* img, UINT8* dst, int sector_size, int side ) +int thomson_state::thom_floppy_make_track( legacy_floppy_image_device* img, uint8_t* dst, int sector_size, int side ) { - UINT8 space = ( sector_size == 128 ) ? 0xff : 0; - UINT8* org = dst; + uint8_t space = ( sector_size == 128 ) ? 0xff : 0; + uint8_t* org = dst; chrn_id id; int nb; @@ -212,7 +212,7 @@ int thomson_state::thom_floppy_make_track( legacy_floppy_image_device* img, UINT /* build an identifier, with header */ -int thomson_state::thom_qdd_make_addr( int sector, UINT8* dst ) +int thomson_state::thom_qdd_make_addr( int sector, uint8_t* dst ) { dst[ 0 ] = 0xa5; dst[ 1 ] = sector >> 8; @@ -224,7 +224,7 @@ int thomson_state::thom_qdd_make_addr( int sector, UINT8* dst ) /* build a sector, with header */ -int thomson_state::thom_qdd_make_sector( legacy_floppy_image_device* img, int sector, UINT8* dst ) +int thomson_state::thom_qdd_make_sector( legacy_floppy_image_device* img, int sector, uint8_t* dst ) { int i; dst[ 0 ] = 0x5a; @@ -238,9 +238,9 @@ int thomson_state::thom_qdd_make_sector( legacy_floppy_image_device* img, int se /* build a whole disk */ -int thomson_state::thom_qdd_make_disk ( legacy_floppy_image_device* img, UINT8* dst ) +int thomson_state::thom_qdd_make_disk ( legacy_floppy_image_device* img, uint8_t* dst ) { - UINT8* org = dst; + uint8_t* org = dst; int i; memset( dst, 0x16, THOM_QDD_SYNCH_DISK ); dst += THOM_QDD_SYNCH_DISK; @@ -269,7 +269,7 @@ int thomson_state::thom_qdd_make_disk ( legacy_floppy_image_device* img, UINT8* -static UINT8 to7_5p14_select; +static uint8_t to7_5p14_select; @@ -344,7 +344,7 @@ void thomson_state::to7_5p14_init() -static UINT8 to7_5p14sd_select; +static uint8_t to7_5p14sd_select; @@ -482,21 +482,21 @@ void thomson_state::to7_5p14sd_init() struct to7qdd_t { /* MC6852 registers */ - UINT8 status; - UINT8 ctrl1; - UINT8 ctrl2; - UINT8 ctrl3; + uint8_t status; + uint8_t ctrl1; + uint8_t ctrl2; + uint8_t ctrl3; /* extra registers */ - UINT8 drive; + uint8_t drive; /* internal state */ - UINT8 data[QDD_MAXBUF]; /* enough for a whole track */ - UINT32 data_idx; /* byte position in track */ - UINT32 start_idx; /* start of write position */ - UINT32 data_size; /* track length */ - UINT8 data_crc; /* checksum when writing */ - UINT8 index_pulse; /* one pulse per track */ + uint8_t data[QDD_MAXBUF]; /* enough for a whole track */ + uint32_t data_idx; /* byte position in track */ + uint32_t start_idx; /* start of write position */ + uint32_t data_size; /* track length */ + uint8_t data_crc; /* checksum when writing */ + uint8_t index_pulse; /* one pulse per track */ }; @@ -561,9 +561,9 @@ void thomson_state::to7_qdd_stat_update() -UINT8 thomson_state::to7_qdd_read_byte() +uint8_t thomson_state::to7_qdd_read_byte() { - UINT8 data; + uint8_t data; /* rebuild disk if needed */ if ( !to7qdd->data_size ) @@ -594,7 +594,7 @@ UINT8 thomson_state::to7_qdd_read_byte() * CPU write id field and data field => format * CPU write data field after it has read an id field => sector write */ -void thomson_state::to7_qdd_write_byte( UINT8 data ) +void thomson_state::to7_qdd_write_byte( uint8_t data ) { int i; @@ -628,7 +628,7 @@ void thomson_state::to7_qdd_write_byte( UINT8 data ) { /* got an id field => format */ int sector = (int) to7qdd->data[ to7qdd->start_idx + 1 ] * 256 + (int) to7qdd->data[ to7qdd->start_idx + 2 ]; - UINT8 filler = 0xff; + uint8_t filler = 0xff; LOG(( "%f $%04x to7_qdd_write_byte: got id field for sector=%i\n", machine().time().as_double(), m_maincpu->pc(), sector )); @@ -699,7 +699,7 @@ READ8_MEMBER( thomson_state::to7_qdd_r ) case 8: /* floppy status */ { - UINT8 data = 0; + uint8_t data = 0; device_image_interface* img = dynamic_cast(to7_qdd_image()); if ( ! img->exists() ) data |= 0x40; /* disk present */ @@ -886,26 +886,26 @@ void thomson_state::to7_qdd_init() struct thmfc1_t { - UINT8 op; - UINT8 sector; /* target sector, in [1,16] */ - UINT32 sector_id; - UINT8 track; /* current track, in [0,79] */ - UINT8 side; /* current side, 0 or 1 */ - UINT8 drive; /* 0 to 3 */ - UINT16 sector_size; /* 128 or 256 (512, 1024 not supported) */ - UINT8 formatting; - UINT8 ipl; /* index pulse / QDD start */ - UINT8 wsync; /* synchronization word */ - - UINT8 data[THOM_MAXBUF]; /* enough for a whole track */ - UINT32 data_idx; /* reading / writing / formatting pos */ - UINT32 data_size; /* bytes to read / write */ - UINT32 data_finish; /* when to raise the finished flag */ - UINT32 data_raw_idx; /* byte index for raw track reading */ - UINT32 data_raw_size; /* size of track already cached in data */ - UINT8 data_crc; /* check-sum of written data */ - - UINT8 stat0; /* status register */ + uint8_t op; + uint8_t sector; /* target sector, in [1,16] */ + uint32_t sector_id; + uint8_t track; /* current track, in [0,79] */ + uint8_t side; /* current side, 0 or 1 */ + uint8_t drive; /* 0 to 3 */ + uint16_t sector_size; /* 128 or 256 (512, 1024 not supported) */ + uint8_t formatting; + uint8_t ipl; /* index pulse / QDD start */ + uint8_t wsync; /* synchronization word */ + + uint8_t data[THOM_MAXBUF]; /* enough for a whole track */ + uint32_t data_idx; /* reading / writing / formatting pos */ + uint32_t data_size; /* bytes to read / write */ + uint32_t data_finish; /* when to raise the finished flag */ + uint32_t data_raw_idx; /* byte index for raw track reading */ + uint32_t data_raw_size; /* size of track already cached in data */ + uint8_t data_crc; /* check-sum of written data */ + + uint8_t stat0; /* status register */ }; @@ -1027,9 +1027,9 @@ TIMER_CALLBACK_MEMBER( thomson_state::thmfc_floppy_cmd_complete_cb ) /* intelligent read: show just one field, skip header */ -UINT8 thomson_state::thmfc_floppy_read_byte() +uint8_t thomson_state::thmfc_floppy_read_byte() { - UINT8 data = thmfc1->data[ thmfc1->data_idx ]; + uint8_t data = thmfc1->data[ thmfc1->data_idx ]; VLOG(( "%f $%04x thmfc_floppy_read_byte: off=%i/%i/%i data=$%02X\n", machine().time().as_double(), m_maincpu->pc(), @@ -1050,9 +1050,9 @@ UINT8 thomson_state::thmfc_floppy_read_byte() /* dumb read: show whole track with field headers and gaps */ -UINT8 thomson_state::thmfc_floppy_raw_read_byte() +uint8_t thomson_state::thmfc_floppy_raw_read_byte() { - UINT8 data; + uint8_t data; /* rebuild track if needed */ if ( ! thmfc1->data_raw_size ) @@ -1086,7 +1086,7 @@ UINT8 thomson_state::thmfc_floppy_raw_read_byte() /* QDD writing / formating */ -void thomson_state::thmfc_floppy_qdd_write_byte( UINT8 data ) +void thomson_state::thmfc_floppy_qdd_write_byte( uint8_t data ) { int i; @@ -1121,7 +1121,7 @@ void thomson_state::thmfc_floppy_qdd_write_byte( UINT8 data ) { /* got an id field => format */ int sector = (int) thmfc1->data[ thmfc1->data_idx ] * 256 + (int) thmfc1->data[ thmfc1->data_idx + 1 ]; - UINT8 filler = 0xff; + uint8_t filler = 0xff; LOG(( "%f $%04x thmfc_floppy_qdd_write_byte: id field, sector=%i\n", machine().time().as_double(), m_maincpu->pc(), sector )); @@ -1175,7 +1175,7 @@ void thomson_state::thmfc_floppy_qdd_write_byte( UINT8 data ) /* intelligent writing */ -void thomson_state::thmfc_floppy_write_byte( UINT8 data ) +void thomson_state::thmfc_floppy_write_byte( uint8_t data ) { VLOG (( "%f $%04x thmfc_floppy_write_byte: off=%i/%i data=$%02X\n", machine().time().as_double(), m_maincpu->pc(), @@ -1190,7 +1190,7 @@ void thomson_state::thmfc_floppy_write_byte( UINT8 data ) } /* intelligent formatting */ -void thomson_state::thmfc_floppy_format_byte( UINT8 data ) +void thomson_state::thmfc_floppy_format_byte( uint8_t data ) { VLOG (( "%f $%04x thmfc_floppy_format_byte: $%02X\n", machine().time().as_double(), m_maincpu->pc(), data )); @@ -1199,7 +1199,7 @@ void thomson_state::thmfc_floppy_format_byte( UINT8 data ) /* accumulate bytes to form an id field */ if ( thmfc1->data_idx || data==0xA1 ) { - static const UINT8 header[] = { 0xa1, 0xa1, 0xa1, 0xfe }; + static const uint8_t header[] = { 0xa1, 0xa1, 0xa1, 0xfe }; thmfc1->data[ thmfc1->data_idx ] = data; thmfc1->data_idx++; if ( thmfc1->data_idx > 11 ) @@ -1208,11 +1208,11 @@ void thomson_state::thmfc_floppy_format_byte( UINT8 data ) { /* got id field => format */ legacy_floppy_image_device * img = thmfc_floppy_image(); - UINT8 track = thmfc1->data[4]; - UINT8 side = thmfc1->data[5]; - UINT8 sector = thmfc1->data[6]; - UINT8 length = thmfc1->data[7]; /* actually, log length */ - UINT8 filler = 0xe5; /* standard Thomson filler */ + uint8_t track = thmfc1->data[4]; + uint8_t side = thmfc1->data[5]; + uint8_t sector = thmfc1->data[6]; + uint8_t length = thmfc1->data[7]; /* actually, log length */ + uint8_t filler = 0xe5; /* standard Thomson filler */ chrn_id id; if ( thmfc_floppy_find_sector( &id ) ) { @@ -1240,7 +1240,7 @@ READ8_MEMBER( thomson_state::thmfc_floppy_r ) case 1: /* STAT1 */ { - UINT8 data = 0; + uint8_t data = 0; legacy_floppy_image_device * img = thmfc_floppy_image(); int flags = img->floppy_drive_get_flag_state(-1 ); if ( thmfc_floppy_is_qdd(img) ) @@ -1284,7 +1284,7 @@ READ8_MEMBER( thomson_state::thmfc_floppy_r ) case 8: { /* undocumented => emulate TO7 QDD controller ? */ - UINT8 data = thmfc1->ipl << 7; + uint8_t data = thmfc1->ipl << 7; VLOG(( "%f $%04x thmfc_floppy_r: STAT8=$%02X\n", machine().time().as_double(), m_maincpu->pc(), data )); return data; } @@ -1683,7 +1683,7 @@ READ8_MEMBER( thomson_state::to7_network_r ) if ( offset == 8 ) { /* network ID of the computer */ - UINT8 id = m_io_fconfig->read() >> 3; + uint8_t id = m_io_fconfig->read() >> 3; VLOG(( "%f $%04x to7_network_r: read id $%02X\n", machine().time().as_double(), m_maincpu->pc(), id )); return id; } @@ -1721,8 +1721,8 @@ WRITE8_MEMBER( thomson_state::to7_network_w ) -UINT8 to7_controller_type; -UINT8 to7_floppy_bank; +uint8_t to7_controller_type; +uint8_t to7_floppy_bank; void thomson_state::to7_floppy_init( void* base ) diff --git a/src/mame/machine/thomflop.h b/src/mame/machine/thomflop.h index 5c85f9e0d43..72e9663d7c8 100644 --- a/src/mame/machine/thomflop.h +++ b/src/mame/machine/thomflop.h @@ -16,8 +16,8 @@ #include "machine/mc6843.h" #include "machine/mc6854.h" -extern UINT8 to7_controller_type; /* set during init */ -extern UINT8 to7_floppy_bank; +extern uint8_t to7_controller_type; /* set during init */ +extern uint8_t to7_floppy_bank; /* number of external floppy controller ROM banks */ #define TO7_NB_FLOP_BANK 9 diff --git a/src/mame/machine/thomson.cpp b/src/mame/machine/thomson.cpp index 1dae4a1b972..95387a7668a 100644 --- a/src/mame/machine/thomson.cpp +++ b/src/mame/machine/thomson.cpp @@ -95,7 +95,7 @@ int thomson_state::to7_get_cassette() /* demodulate wave signal on-the-fly */ /* we simply count sign changes... */ int k, chg; - INT8 data[40]; + int8_t data[40]; cassette_get_samples( cass, 0, pos, TO7_BIT_LENGTH * 15. / 14., 40, 1, data, 0 ); for ( k = 1, chg = 0; k < 40; k++ ) @@ -172,7 +172,7 @@ int thomson_state::mo5_get_cassette() cassette_image* cass = m_cassette->get_image(); cassette_state state = m_cassette->get_state(); double pos = m_cassette->get_position(); - INT32 hbit; + int32_t hbit; if ( (state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED ) return 1; @@ -359,7 +359,7 @@ void thomson_state::thom_set_caps_led( int led ) DEVICE_IMAGE_LOAD_MEMBER( thomson_state, to7_cartridge ) { int i,j; - UINT8* pos = memregion("maincpu" )->base() + 0x10000; + uint8_t* pos = memregion("maincpu" )->base() + 0x10000; offs_t size; char name[129]; @@ -460,8 +460,8 @@ WRITE8_MEMBER( thomson_state::to7_cartridge_w ) /* read signal to 0000-0003 generates a bank switch */ READ8_MEMBER( thomson_state::to7_cartridge_r ) { - UINT8* pos = memregion( "maincpu" )->base() + 0x10000; - UINT8 data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; + uint8_t* pos = memregion( "maincpu" )->base() + 0x10000; + uint8_t data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; if ( !space.debugger_access() ) { m_thom_cart_bank = offset & 3; @@ -559,7 +559,7 @@ READ8_MEMBER( thomson_state::to7_sys_porta_in ) { /* keyboard */ int keyline = m_pia_sys->b_output(); - UINT8 val = 0xff; + uint8_t val = 0xff; int i; for ( i = 0; i < 8; i++ ) @@ -599,7 +599,7 @@ const device_type TO7_IO_LINE = &device_creator; // to7_io_line_device - constructor //------------------------------------------------- -to7_io_line_device::to7_io_line_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +to7_io_line_device::to7_io_line_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TO7_IO_LINE, "T07 Serial source", tag, owner, clock, "to7_io_line", __FILE__), m_pia_io(*this, THOM_PIA_IO), m_rs232(*this, "rs232"), @@ -833,11 +833,11 @@ WRITE8_MEMBER( thomson_state::to7_modem_mea8000_w ) This is similar Atari & Amiga mouses. Returns: 0 0 0 0 0 0 YB XB YA XA */ -UINT8 thomson_state::to7_get_mouse_signal() +uint8_t thomson_state::to7_get_mouse_signal() { - UINT8 xa, xb, ya, yb; - UINT16 dx = m_io_mouse_x->read(); /* x axis */ - UINT16 dy = m_io_mouse_y->read(); /* y axis */ + uint8_t xa, xb, ya, yb; + uint16_t dx = m_io_mouse_x->read(); /* x axis */ + uint16_t dy = m_io_mouse_y->read(); /* y axis */ xa = ((dx + 1) & 3) <= 1; xb = (dx & 3) <= 1; ya = ((dy + 1) & 3) <= 1; @@ -856,7 +856,7 @@ void thomson_state::to7_game_sound_update() READ8_MEMBER( thomson_state::to7_game_porta_in ) { - UINT8 data; + uint8_t data; if ( m_io_config->read() & 1 ) { /* mouse */ @@ -897,11 +897,11 @@ READ8_MEMBER( thomson_state::to7_game_porta_in ) READ8_MEMBER( thomson_state::to7_game_portb_in ) { - UINT8 data; + uint8_t data; if ( m_io_config->read() & 1 ) { /* mouse */ - UINT8 mouse = to7_get_mouse_signal(); + uint8_t mouse = to7_get_mouse_signal(); data = 0; if ( mouse & 1 ) data |= 0x04; /* XA */ @@ -945,14 +945,14 @@ TIMER_CALLBACK_MEMBER(thomson_state::to7_game_update_cb) if ( m_io_config->read() & 1 ) { /* mouse */ - UINT8 mouse = to7_get_mouse_signal(); + uint8_t mouse = to7_get_mouse_signal(); m_pia_game->ca1_w( (mouse & 1) ? 1 : 0 ); /* XA */ m_pia_game->ca2_w( (mouse & 2) ? 1 : 0 ); /* YA */ } else { /* joystick */ - UINT8 in = m_io_game_port_buttons->read(); + uint8_t in = m_io_game_port_buttons->read(); m_pia_game->cb2_w( (in & 0x80) ? 1 : 0 ); /* P2 action A */ m_pia_game->ca2_w( (in & 0x40) ? 1 : 0 ); /* P1 action A */ m_pia_game->cb1_w( (in & 0x08) ? 1 : 0 ); /* P2 action B */ @@ -1085,8 +1085,8 @@ MACHINE_RESET_MEMBER( thomson_state, to7 ) MACHINE_START_MEMBER( thomson_state, to7 ) { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8* mem = memregion("maincpu")->base(); - UINT8* ram = m_ram->pointer(); + uint8_t* mem = memregion("maincpu")->base(); + uint8_t* ram = m_ram->pointer(); LOG (( "to7: machine start called\n" )); @@ -1163,7 +1163,7 @@ READ8_MEMBER( thomson_state::to770_sys_porta_in ) void thomson_state::to770_update_ram_bank() { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8 portb = m_pia_sys->port_b_z_mask(); + uint8_t portb = m_pia_sys->port_b_z_mask(); int bank; switch (portb & 0xf8) @@ -1309,8 +1309,8 @@ MACHINE_RESET_MEMBER( thomson_state, to770 ) MACHINE_START_MEMBER( thomson_state, to770 ) { - UINT8* mem = memregion("maincpu")->base(); - UINT8* ram = m_ram->pointer(); + uint8_t* mem = memregion("maincpu")->base(); + uint8_t* ram = m_ram->pointer(); LOG (( "to770: machine start called\n" )); @@ -1414,7 +1414,7 @@ READ8_MEMBER( thomson_state::mo5_sys_porta_in ) READ8_MEMBER( thomson_state::mo5_sys_portb_in ) { - UINT8 portb = m_pia_sys->b_output(); + uint8_t portb = m_pia_sys->b_output(); int col = (portb >> 1) & 7; /* key column */ int lin = 7 - ((portb >> 4) & 7); /* key line */ @@ -1468,8 +1468,8 @@ WRITE8_MEMBER( thomson_state::mo5_gatearray_w ) DEVICE_IMAGE_LOAD_MEMBER( thomson_state, mo5_cartridge ) { - UINT8* pos = memregion("maincpu")->base() + 0x10000; - UINT64 size, i; + uint8_t* pos = memregion("maincpu")->base() + 0x10000; + uint64_t size, i; int j; char name[129]; @@ -1630,8 +1630,8 @@ WRITE8_MEMBER( thomson_state::mo5_cartridge_w ) /* read signal to bffc-bfff generates a bank switch */ READ8_MEMBER( thomson_state::mo5_cartridge_r ) { - UINT8* pos = memregion( "maincpu" )->base() + 0x10000; - UINT8 data = pos[offset + 0xbffc + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; + uint8_t* pos = memregion( "maincpu" )->base() + 0x10000; + uint8_t data = pos[offset + 0xbffc + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; if ( !space.debugger_access() ) { m_thom_cart_bank = offset & 3; @@ -1690,8 +1690,8 @@ MACHINE_RESET_MEMBER( thomson_state, mo5 ) MACHINE_START_MEMBER( thomson_state, mo5 ) { - UINT8* mem = memregion("maincpu")->base(); - UINT8* ram = m_ram->pointer(); + uint8_t* mem = memregion("maincpu")->base(); + uint8_t* ram = m_ram->pointer(); LOG (( "mo5: machine start called\n" )); @@ -1799,7 +1799,7 @@ WRITE8_MEMBER( thomson_state::to9_gatearray_w ) /* style: 0 => TO9, 1 => TO8/TO9, 2 => MO6 */ -void thomson_state::to9_set_video_mode( UINT8 data, int style ) +void thomson_state::to9_set_video_mode( uint8_t data, int style ) { switch ( data & 0x7f ) { @@ -1855,7 +1855,7 @@ READ8_MEMBER( thomson_state::to9_vreg_r ) { case 0: /* palette data */ { - UINT8 c = m_to9_palette_data[ m_to9_palette_idx ]; + uint8_t c = m_to9_palette_data[ m_to9_palette_idx ]; if ( !space.debugger_access() ) { m_to9_palette_idx = ( m_to9_palette_idx + 1 ) & 31; @@ -1886,7 +1886,7 @@ WRITE8_MEMBER( thomson_state::to9_vreg_w ) { case 0: /* palette data */ { - UINT16 color, idx; + uint16_t color, idx; m_to9_palette_data[ m_to9_palette_idx ] = data; idx = m_to9_palette_idx / 2; color = m_to9_palette_data[ 2 * idx + 1 ]; @@ -2034,8 +2034,8 @@ WRITE8_MEMBER( thomson_state::to9_cartridge_w ) /* read signal to 0000-0003 generates a bank switch */ READ8_MEMBER( thomson_state::to9_cartridge_r ) { - UINT8* pos = memregion( "maincpu" )->base() + 0x10000; - UINT8 data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; + uint8_t* pos = memregion( "maincpu" )->base() + 0x10000; + uint8_t data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; if ( !space.debugger_access() ) { m_thom_cart_bank = offset & 3; @@ -2049,9 +2049,9 @@ READ8_MEMBER( thomson_state::to9_cartridge_r ) void thomson_state::to9_update_ram_bank() { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8 port = m_mc6846->get_output_port(); - UINT8 portb = m_pia_sys->port_b_z_mask(); - UINT8 disk = ((port >> 2) & 1) | ((port >> 5) & 2); /* bits 6,2: RAM bank */ + uint8_t port = m_mc6846->get_output_port(); + uint8_t portb = m_pia_sys->port_b_z_mask(); + uint8_t disk = ((port >> 2) & 1) | ((port >> 5) & 2); /* bits 6,2: RAM bank */ int bank; switch ( portb & 0xf8 ) @@ -2128,7 +2128,7 @@ void thomson_state::to9_update_ram_bank_postload() int thomson_state::to9_kbd_ktest() { int line, bit; - UINT8 port; + uint8_t port; for ( line = 0; line < 10; line++ ) { @@ -2292,7 +2292,7 @@ WRITE8_MEMBER( thomson_state::to9_kbd_w ) note: parity is not used as a checksum but to actually transmit a 9-th bit of information! */ -void thomson_state::to9_kbd_send( UINT8 data, int parity ) +void thomson_state::to9_kbd_send( uint8_t data, int parity ) { if ( m_to9_kbd_status & ACIA_6850_RDRF ) { @@ -2361,7 +2361,7 @@ int thomson_state::to9_kbd_get_key() int control = ! (m_io_keyboard[7]->read() & 1); int shift = ! (m_io_keyboard[9]->read() & 1); int key = -1, line, bit; - UINT8 port; + uint8_t port; for ( line = 0; line < 10; line++ ) { @@ -2457,7 +2457,7 @@ TIMER_CALLBACK_MEMBER(thomson_state::to9_kbd_timer_cb) case 1: /* x axis */ { int newx = m_io_mouse_x->read(); - UINT8 data = ( (newx - m_to9_mouse_x) & 0xf ) - 8; + uint8_t data = ( (newx - m_to9_mouse_x) & 0xf ) - 8; to9_kbd_send( data, 1 ); m_to9_mouse_x = newx; break; @@ -2466,7 +2466,7 @@ TIMER_CALLBACK_MEMBER(thomson_state::to9_kbd_timer_cb) case 2: /* y axis */ { int newy = m_io_mouse_y->read(); - UINT8 data = ( (newy - m_to9_mouse_y) & 0xf ) - 8; + uint8_t data = ( (newy - m_to9_mouse_y) & 0xf ) - 8; to9_kbd_send( data, 1 ); m_to9_mouse_y = newy; break; @@ -2475,7 +2475,7 @@ TIMER_CALLBACK_MEMBER(thomson_state::to9_kbd_timer_cb) case 3: /* axis overflow & buttons */ { int b = m_io_mouse_button->read(); - UINT8 data = 0; + uint8_t data = 0; if ( b & 1 ) data |= 1; if ( b & 2 ) data |= 4; to9_kbd_send( data, 1 ); @@ -2545,7 +2545,7 @@ void thomson_state::to9_kbd_init() READ8_MEMBER( thomson_state::to9_sys_porta_in ) { - UINT8 ktest = to9_kbd_ktest(); + uint8_t ktest = to9_kbd_ktest(); LOG_KBD(( "to9_sys_porta_in: ktest=%i\n", ktest )); @@ -2633,8 +2633,8 @@ MACHINE_RESET_MEMBER( thomson_state, to9 ) MACHINE_START_MEMBER( thomson_state, to9 ) { - UINT8* mem = memregion("maincpu")->base(); - UINT8* ram = m_ram->pointer(); + uint8_t* mem = memregion("maincpu")->base(); + uint8_t* ram = m_ram->pointer(); LOG (( "to9: machine start called\n" )); @@ -2712,7 +2712,7 @@ MACHINE_START_MEMBER( thomson_state, to9 ) int thomson_state::to8_kbd_ktest() { int line, bit; - UINT8 port; + uint8_t port; if ( m_io_config->read() & 2 ) return 0; /* disabled */ @@ -2742,7 +2742,7 @@ int thomson_state::to8_kbd_get_key() int control = (m_io_keyboard[7]->read() & 1) ? 0 : 0x100; int shift = (m_io_keyboard[9]->read() & 1) ? 0 : 0x080; int key = -1, line, bit; - UINT8 port; + uint8_t port; if ( m_io_config->read() & 2 ) return -1; /* disabled */ @@ -3015,7 +3015,7 @@ void thomson_state::to8_update_floppy_bank_postload() void thomson_state::to8_update_ram_bank() { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT8 bank = 0; + uint8_t bank = 0; if ( m_to8_reg_sys1 & 0x10 ) { @@ -3023,7 +3023,7 @@ void thomson_state::to8_update_ram_bank() } else { - UINT8 portb = m_pia_sys->port_b_z_mask(); + uint8_t portb = m_pia_sys->port_b_z_mask(); switch ( portb & 0xf8 ) { @@ -3239,8 +3239,8 @@ WRITE8_MEMBER( thomson_state::to8_cartridge_w ) /* read signal to 0000-0003 generates a bank switch */ READ8_MEMBER( thomson_state::to8_cartridge_r ) { - UINT8* pos = memregion( "maincpu" )->base() + 0x10000; - UINT8 data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; + uint8_t* pos = memregion( "maincpu" )->base() + 0x10000; + uint8_t data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; if ( !space.debugger_access() ) { m_thom_cart_bank = offset & 3; @@ -3256,7 +3256,7 @@ READ8_MEMBER( thomson_state::to8_cartridge_r ) void thomson_state::to8_floppy_init() { - UINT8* mem = memregion("maincpu")->base(); + uint8_t* mem = memregion("maincpu")->base(); to7_floppy_init( mem + 0x34000 ); } @@ -3264,7 +3264,7 @@ void thomson_state::to8_floppy_init() void thomson_state::to8_floppy_reset() { - UINT8* mem = memregion("maincpu")->base(); + uint8_t* mem = memregion("maincpu")->base(); to7_floppy_reset(); if ( THOM_FLOPPY_INT ) thmfc_floppy_reset(); @@ -3316,7 +3316,7 @@ READ8_MEMBER( thomson_state::to8_gatearray_r ) struct thom_vsignal v = thom_get_vsignal(); struct thom_vsignal l = thom_get_lightpen_vsignal( TO8_LIGHTPEN_DECAL, m_to7_lightpen_step - 1, 6 ); int count, inil, init, lt3; - UINT8 res; + uint8_t res; count = m_to7_lightpen ? l.count : v.count; inil = m_to7_lightpen ? l.inil : v.inil; init = m_to7_lightpen ? l.init : v.init; @@ -3432,7 +3432,7 @@ READ8_MEMBER( thomson_state::to8_vreg_r ) { case 0: /* palette data */ { - UINT8 c = m_to9_palette_data[ m_to9_palette_idx ]; + uint8_t c = m_to9_palette_data[ m_to9_palette_idx ]; if ( !space.debugger_access() ) { m_to9_palette_idx = ( m_to9_palette_idx + 1 ) & 31; @@ -3465,7 +3465,7 @@ WRITE8_MEMBER( thomson_state::to8_vreg_w ) { case 0: /* palette data */ { - UINT16 color, idx; + uint16_t color, idx; m_to9_palette_data[ m_to9_palette_idx ] = data; idx = m_to9_palette_idx / 2; color = m_to9_palette_data[ 2 * idx + 1 ]; @@ -3644,8 +3644,8 @@ MACHINE_RESET_MEMBER( thomson_state, to8 ) MACHINE_START_MEMBER( thomson_state, to8 ) { - UINT8* mem = memregion("maincpu")->base(); - UINT8* ram = m_ram->pointer(); + uint8_t* mem = memregion("maincpu")->base(); + uint8_t* ram = m_ram->pointer(); LOG (( "to8: machine start called\n" )); @@ -3795,8 +3795,8 @@ MACHINE_RESET_MEMBER( thomson_state, to9p ) MACHINE_START_MEMBER( thomson_state, to9p ) { - UINT8* mem = memregion("maincpu")->base(); - UINT8* ram = m_ram->pointer(); + uint8_t* mem = memregion("maincpu")->base(); + uint8_t* ram = m_ram->pointer(); LOG (( "to9p: machine start called\n" )); @@ -3861,7 +3861,7 @@ MACHINE_START_MEMBER( thomson_state, to9p ) void thomson_state::mo6_update_ram_bank() { - UINT8 bank = 0; + uint8_t bank = 0; if ( m_to8_reg_sys1 & 0x10 ) { @@ -4113,8 +4113,8 @@ WRITE8_MEMBER( thomson_state::mo6_cartridge_w ) /* read signal generates a bank switch */ READ8_MEMBER( thomson_state::mo6_cartridge_r ) { - UINT8* pos = memregion( "maincpu" )->base() + 0x10000; - UINT8 data = pos[offset + 0xbffc + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; + uint8_t* pos = memregion( "maincpu" )->base() + 0x10000; + uint8_t data = pos[offset + 0xbffc + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000]; if ( !space.debugger_access() ) { m_thom_cart_bank = offset & 3; @@ -4170,14 +4170,14 @@ TIMER_CALLBACK_MEMBER(thomson_state::mo6_game_update_cb) /* unlike the TO8, CB1 & CB2 are not connected to buttons */ if ( m_io_config->read() & 1 ) { - UINT8 mouse = to7_get_mouse_signal(); + uint8_t mouse = to7_get_mouse_signal(); m_pia_game->ca1_w( BIT(mouse, 0) ); /* XA */ m_pia_game->ca2_w( BIT(mouse, 1) ); /* YA */ } else { /* joystick */ - UINT8 in = m_io_game_port_buttons->read(); + uint8_t in = m_io_game_port_buttons->read(); m_pia_game->ca1_w( BIT(in, 2) ); /* P1 action B */ m_pia_game->ca2_w( BIT(in, 6) ); /* P1 action A */ } @@ -4225,8 +4225,8 @@ READ8_MEMBER( thomson_state::mo6_sys_porta_in ) READ8_MEMBER( thomson_state::mo6_sys_portb_in ) { /* keyboard: 9 lines of 8 keys */ - UINT8 porta = m_pia_sys->a_output(); - UINT8 portb = m_pia_sys->b_output(); + uint8_t porta = m_pia_sys->a_output(); + uint8_t portb = m_pia_sys->b_output(); int col = (portb >> 4) & 7; /* B bits 4-6: kbd column */ int lin = (portb >> 1) & 7; /* B bits 1-3: kbd line */ @@ -4271,7 +4271,7 @@ READ8_MEMBER( thomson_state::mo6_gatearray_r ) struct thom_vsignal v = thom_get_vsignal(); struct thom_vsignal l = thom_get_lightpen_vsignal( MO6_LIGHTPEN_DECAL, m_to7_lightpen_step - 1, 6 ); int count, inil, init, lt3; - UINT8 res; + uint8_t res; count = m_to7_lightpen ? l.count : v.count; inil = m_to7_lightpen ? l.inil : v.inil; init = m_to7_lightpen ? l.init : v.init; @@ -4481,8 +4481,8 @@ MACHINE_RESET_MEMBER( thomson_state, mo6 ) MACHINE_START_MEMBER( thomson_state, mo6 ) { - UINT8* mem = memregion("maincpu")->base(); - UINT8* ram = m_ram->pointer(); + uint8_t* mem = memregion("maincpu")->base(); + uint8_t* ram = m_ram->pointer(); LOG (( "mo6: machine start called\n" )); @@ -4584,7 +4584,7 @@ WRITE8_MEMBER( thomson_state::mo5nr_net_w ) READ8_MEMBER( thomson_state::mo5nr_prn_r ) { - UINT8 result = 0; + uint8_t result = 0; result |= m_centronics_busy << 7; @@ -4607,7 +4607,7 @@ WRITE8_MEMBER( thomson_state::mo5nr_prn_w ) READ8_MEMBER( thomson_state::mo5nr_sys_portb_in ) { /* keyboard: only 8 lines of 8 keys (MO6 has 9 lines) */ - UINT8 portb = m_pia_sys->b_output(); + uint8_t portb = m_pia_sys->b_output(); int col = (portb >> 4) & 7; /* B bits 4-6: kbd column */ int lin = (portb >> 1) & 7; /* B bits 1-3: kbd line */ @@ -4705,8 +4705,8 @@ MACHINE_RESET_MEMBER( thomson_state, mo5nr ) MACHINE_START_MEMBER( thomson_state, mo5nr ) { - UINT8* mem = memregion("maincpu")->base(); - UINT8* ram = m_ram->pointer(); + uint8_t* mem = memregion("maincpu")->base(); + uint8_t* ram = m_ram->pointer(); LOG (( "mo5nr: machine start called\n" )); diff --git a/src/mame/machine/ti85.cpp b/src/mame/machine/ti85.cpp index fdda0145f5d..4ae8d786174 100644 --- a/src/mame/machine/ti85.cpp +++ b/src/mame/machine/ti85.cpp @@ -134,7 +134,7 @@ void ti85_state::device_timer(emu_timer &timer, device_timer_id id, int param, v } } -inline void ti8x_update_bank(address_space &space, UINT8 bank, UINT8 *base, UINT8 page, bool is_ram) +inline void ti8x_update_bank(address_space &space, uint8_t bank, uint8_t *base, uint8_t page, bool is_ram) { ti85_state *state = space.machine().driver_data(); static const char *const tag[] = {"bank1", "bank2", "bank3", "bank4"}; @@ -438,8 +438,8 @@ MACHINE_START_MEMBER(ti85_state,ti86) m_interrupt_speed = 0; m_port4_bit0 = 0; - m_ti8x_ram = std::make_unique(128*1024); - memset(m_ti8x_ram.get(), 0, sizeof(UINT8)*128*1024); + m_ti8x_ram = std::make_unique(128*1024); + memset(m_ti8x_ram.get(), 0, sizeof(uint8_t)*128*1024); space.unmap_write(0x0000, 0x3fff); @@ -447,7 +447,7 @@ MACHINE_START_MEMBER(ti85_state,ti86) membank("bank2")->set_base(m_bios + 0x04000); membank("bank4")->set_base(m_ti8x_ram.get()); - machine().device("nvram")->set_base(m_ti8x_ram.get(), sizeof(UINT8)*128*1024); + machine().device("nvram")->set_base(m_ti8x_ram.get(), sizeof(uint8_t)*128*1024); machine().scheduler().timer_pulse(attotime::from_hz(256), timer_expired_delegate(FUNC(ti85_state::ti85_timer_callback),this)); } @@ -864,7 +864,7 @@ READ8_MEMBER(ti85_state::ti84pse_port_0056_r) //timer ports -void ti85_state::ti83pse_count( UINT8 timer, UINT8 data) +void ti85_state::ti83pse_count( uint8_t timer, uint8_t data) { m_ctimer[timer].max = m_ctimer[timer].count = data; @@ -1026,7 +1026,7 @@ WRITE8_MEMBER(ti85_state::ti83pse_ctimer3_count_w) TI calculators snapshot files (SAV) ***************************************************************************/ -void ti85_state::ti8x_snapshot_setup_registers (UINT8 * data) +void ti85_state::ti8x_snapshot_setup_registers (uint8_t * data) { unsigned char lo,hi; unsigned char * reg = data + 0x40; @@ -1081,7 +1081,7 @@ void ti85_state::ti8x_snapshot_setup_registers (UINT8 * data) m_maincpu->set_input_line(INPUT_LINE_HALT, 0); } -void ti85_state::ti85_setup_snapshot (UINT8 * data) +void ti85_state::ti85_setup_snapshot (uint8_t * data) { address_space &space = m_maincpu->space(AS_PROGRAM); int i; @@ -1121,7 +1121,7 @@ void ti85_state::ti85_setup_snapshot (UINT8 * data) m_interrupt_speed = 0x03; } -void ti85_state::ti86_setup_snapshot (UINT8 * data) +void ti85_state::ti86_setup_snapshot (uint8_t * data) { unsigned char lo,hi; unsigned char * hdw = data + 0x20000 + 0x94; @@ -1164,7 +1164,7 @@ void ti85_state::ti86_setup_snapshot (UINT8 * data) SNAPSHOT_LOAD_MEMBER( ti85_state, ti8x ) { int expected_snapshot_size = 0; - std::vector ti8x_snapshot_data; + std::vector ti8x_snapshot_data; if (!strncmp(machine().system().name, "ti85", 4)) expected_snapshot_size = TI85_SNAPSHOT_SIZE; diff --git a/src/mame/machine/ticket.cpp b/src/mame/machine/ticket.cpp index 551afdfa04d..133f01a5e89 100644 --- a/src/mame/machine/ticket.cpp +++ b/src/mame/machine/ticket.cpp @@ -38,7 +38,7 @@ const device_type TICKET_DISPENSER = &device_creator; // ticket_dispenser_device - constructor //------------------------------------------------- -ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TICKET_DISPENSER, "Ticket Dispenser", tag, owner, clock, "ticket_dispenser", __FILE__), m_motor_sense(TICKET_MOTOR_ACTIVE_LOW), m_status_sense(TICKET_STATUS_ACTIVE_LOW), @@ -83,7 +83,7 @@ void ticket_dispenser_device::static_set_period(device_t &device, const attotime // the motor and status bits //------------------------------------------------- -void ticket_dispenser_device::static_set_senses(device_t &device, UINT8 motor_sense, UINT8 status_sense) +void ticket_dispenser_device::static_set_senses(device_t &device, uint8_t motor_sense, uint8_t status_sense) { ticket_dispenser_device &ticket = downcast(device); ticket.m_motor_sense = motor_sense; diff --git a/src/mame/machine/ticket.h b/src/mame/machine/ticket.h index 629d215355f..18ed3901bdd 100644 --- a/src/mame/machine/ticket.h +++ b/src/mame/machine/ticket.h @@ -35,11 +35,11 @@ extern const device_type TICKET_DISPENSER; // CONSTANTS //************************************************************************** -const UINT8 TICKET_MOTOR_ACTIVE_LOW = 0; /* Ticket motor is triggered by D7=0 */ -const UINT8 TICKET_MOTOR_ACTIVE_HIGH = 1; /* Ticket motor is triggered by D7=1 */ +const uint8_t TICKET_MOTOR_ACTIVE_LOW = 0; /* Ticket motor is triggered by D7=0 */ +const uint8_t TICKET_MOTOR_ACTIVE_HIGH = 1; /* Ticket motor is triggered by D7=1 */ -const UINT8 TICKET_STATUS_ACTIVE_LOW = 0; /* Ticket is done dispensing when D7=0 */ -const UINT8 TICKET_STATUS_ACTIVE_HIGH = 1; /* Ticket is done dispensing when D7=1 */ +const uint8_t TICKET_STATUS_ACTIVE_LOW = 0; /* Ticket is done dispensing when D7=0 */ +const uint8_t TICKET_STATUS_ACTIVE_HIGH = 1; /* Ticket is done dispensing when D7=1 */ @@ -53,12 +53,12 @@ class ticket_dispenser_device : public device_t { public: // construction/destruction - ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~ticket_dispenser_device(); // inline configuration helpers static void static_set_period(device_t &device, const attotime &period); - static void static_set_senses(device_t &device, UINT8 motor_sense, UINT8 status_sense); + static void static_set_senses(device_t &device, uint8_t motor_sense, uint8_t status_sense); // read/write handlers DECLARE_READ8_MEMBER( read ); @@ -73,17 +73,17 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // configuration state - UINT8 m_motor_sense; - UINT8 m_status_sense; + uint8_t m_motor_sense; + uint8_t m_status_sense; attotime m_period; // active state - UINT8 m_active_bit; - UINT8 m_motoron; - UINT8 m_ticketdispensed; - UINT8 m_ticketnotdispensed; + uint8_t m_active_bit; + uint8_t m_motoron; + uint8_t m_ticketdispensed; + uint8_t m_ticketnotdispensed; - UINT8 m_status; - UINT8 m_power; + uint8_t m_status; + uint8_t m_power; emu_timer *m_timer; }; diff --git a/src/mame/machine/tnzs.cpp b/src/mame/machine/tnzs.cpp index e3892a657b4..5359a4d0458 100644 --- a/src/mame/machine/tnzs.cpp +++ b/src/mame/machine/tnzs.cpp @@ -22,7 +22,7 @@ READ8_MEMBER(tnzs_state::mcu_tnzs_r) { - UINT8 data; + uint8_t data; data = m_mcu->upi41_master_r(space, offset & 1); space.device().execute().yield(); @@ -525,7 +525,7 @@ DRIVER_INIT_MEMBER(tnzs_state,tnzsb) DRIVER_INIT_MEMBER(tnzs_state,kabukiz) { - UINT8 *SOUND = memregion("audiocpu")->base(); + uint8_t *SOUND = memregion("audiocpu")->base(); m_mcu_type = MCU_NONE_KABUKIZ; m_audiobank->configure_entries(0, 8, &SOUND[0x00000], 0x4000); @@ -639,7 +639,7 @@ MACHINE_RESET_MEMBER(tnzs_state,jpopnics) MACHINE_START_MEMBER(tnzs_state,tnzs_common) { - UINT8 *SUB = memregion("sub")->base(); + uint8_t *SUB = memregion("sub")->base(); m_subbank->configure_entries(0, 4, &SUB[0x08000], 0x2000); m_subbank->set_entry(m_bank2); diff --git a/src/mame/machine/toaplan1.cpp b/src/mame/machine/toaplan1.cpp index ef87079267d..3ecf716ce63 100644 --- a/src/mame/machine/toaplan1.cpp +++ b/src/mame/machine/toaplan1.cpp @@ -21,7 +21,7 @@ enum { TOAPLAN1_REGION_OTHER }; -static const UINT8 toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER+1][2][4] = +static const uint8_t toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER+1][2][4] = { { { 1, 1, 2, 2 }, { 1, 1, 2, 2 } }, /* TOAPLAN1_REGION_JAPAN */ { { 1, 1, 2, 2 }, { 1, 1, 2, 2 } }, /* TOAPLAN1_REGION_US */ @@ -29,7 +29,7 @@ static const UINT8 toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER+1][2][4] = { { 1, 1, 1, 1 }, { 1, 1, 1, 1 } } /* TOAPLAN1_REGION_OTHER */ }; -static const UINT8 toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER+1][2][4] = +static const uint8_t toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER+1][2][4] = { { { 1, 2, 1, 3 }, { 1, 2, 1, 3 } }, /* TOAPLAN1_REGION_JAPAN */ { { 1, 2, 1, 3 }, { 1, 2, 1, 3 } }, /* TOAPLAN1_REGION_US */ @@ -72,7 +72,7 @@ READ16_MEMBER(toaplan1_state::demonwld_dsp_r) { /* DSP can read data from main CPU RAM via DSP IO port 1 */ - UINT16 input_data = 0; + uint16_t input_data = 0; switch (m_main_ram_seg) { case 0xc00000: {address_space &mainspace = m_maincpu->space(AS_PROGRAM); @@ -181,7 +181,7 @@ READ16_MEMBER(toaplan1_state::samesame_port_6_word_r) READ16_MEMBER(toaplan1_state::vimana_system_port_r) { - static const UINT8 vimana_region[16] = + static const uint8_t vimana_region[16] = { TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_US , TOAPLAN1_REGION_WORLD, TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_US , diff --git a/src/mame/machine/trs80.cpp b/src/mame/machine/trs80.cpp index 7a3c8b3bedf..1d9a77d0e90 100644 --- a/src/mame/machine/trs80.cpp +++ b/src/mame/machine/trs80.cpp @@ -124,7 +124,7 @@ READ8_MEMBER( trs80_state::trs80m4_ea_r ) d3 Parity Error ('1'=condition true) d2..d0 Not used */ - UINT8 data=7; + uint8_t data=7; m_ay31015->set_input_pin(AY31015_SWE, 0); data |= m_ay31015->get_output_pin(AY31015_TBMT) ? 0x40 : 0; data |= m_ay31015->get_output_pin(AY31015_DAV ) ? 0x80 : 0; @@ -139,7 +139,7 @@ READ8_MEMBER( trs80_state::trs80m4_ea_r ) READ8_MEMBER( trs80_state::trs80m4_eb_r ) { /* UART received data */ - UINT8 data = m_ay31015->get_received_data(); + uint8_t data = m_ay31015->get_received_data(); m_ay31015->set_input_pin(AY31015_RDAV, 0); m_ay31015->set_input_pin(AY31015_RDAV, 1); return data; @@ -164,7 +164,7 @@ READ8_MEMBER( trs80_state::sys80_f9_r ) d1 Overrun d0 Data Available */ - UINT8 data = 70; + uint8_t data = 70; m_ay31015->set_input_pin(AY31015_SWE, 0); data |= m_ay31015->get_output_pin(AY31015_TBMT) ? 0 : 0x80; data |= m_ay31015->get_output_pin(AY31015_DAV ) ? 0x01 : 0; @@ -187,7 +187,7 @@ READ8_MEMBER( trs80_state::trs80_ff_r ) d7 cassette data from tape d2 modesel setting */ - UINT8 data = (~m_mode & 1) << 5; + uint8_t data = (~m_mode & 1) << 5; return data | m_cassette_data; } @@ -218,7 +218,7 @@ WRITE8_MEMBER( trs80_state::trs80m4_84_w ) /* get address space instead of io space */ address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT8 *base = m_region_maincpu->base(); + uint8_t *base = m_region_maincpu->base(); m_mode = (m_mode & 0x73) | (data & 0x8c); @@ -594,7 +594,7 @@ WRITE8_MEMBER( trs80_state::trs80_ff_w ) if (!init) { init = 1; - static INT16 speaker_levels[4] = { 0, -32768, 0, 32767 }; + static int16_t speaker_levels[4] = { 0, -32768, 0, 32767 }; m_speaker->static_set_levels(*m_speaker, 4, speaker_levels); } @@ -687,7 +687,7 @@ WRITE_LINE_MEMBER(trs80_state::trs80_fdc_intrq_w) READ8_MEMBER( trs80_state::trs80_wd179x_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (BIT(m_io_config->read(), 7)) data = m_fdc->status_r(space, offset); @@ -757,7 +757,7 @@ WRITE8_MEMBER( trs80_state::trs80_motor_w ) *************************************/ READ8_MEMBER( trs80_state::trs80_keyboard_r ) { - UINT8 result = 0; + uint8_t result = 0; if (offset & 1) result |= m_io_line0->read(); @@ -881,9 +881,9 @@ QUICKLOAD_LOAD_MEMBER( trs80_state, trs80_cmd ) { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 type, length; - UINT8 data[0x100]; - UINT8 addr[2]; + uint8_t type, length; + uint8_t data[0x100]; + uint8_t addr[2]; void *ptr; while (!image.image_feof()) @@ -899,7 +899,7 @@ QUICKLOAD_LOAD_MEMBER( trs80_state, trs80_cmd ) case CMD_TYPE_OBJECT_CODE: { image.fread( &addr, 2); - UINT16 address = (addr[1] << 8) | addr[0]; + uint16_t address = (addr[1] << 8) | addr[0]; if (LOG) logerror("/CMD object code block: address %04x length %u\n", address, block_length); ptr = program.get_write_ptr(address); image.fread( ptr, block_length); @@ -909,7 +909,7 @@ QUICKLOAD_LOAD_MEMBER( trs80_state, trs80_cmd ) case CMD_TYPE_TRANSFER_ADDRESS: { image.fread( &addr, 2); - UINT16 address = (addr[1] << 8) | addr[0]; + uint16_t address = (addr[1] << 8) | addr[0]; if (LOG) logerror("/CMD transfer address %04x\n", address); m_maincpu->set_state_int(Z80_PC, address); } diff --git a/src/mame/machine/trs80m2kb.cpp b/src/mame/machine/trs80m2kb.cpp index 85dac930e37..761d6c5d35e 100644 --- a/src/mame/machine/trs80m2kb.cpp +++ b/src/mame/machine/trs80m2kb.cpp @@ -226,7 +226,7 @@ ioport_constructor trs80m2_keyboard_device::device_input_ports() const // trs80m2_keyboard_device - constructor //------------------------------------------------- -trs80m2_keyboard_device::trs80m2_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +trs80m2_keyboard_device::trs80m2_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TRS80M2_KEYBOARD, "TRS-80 Model II Keyboard", tag, owner, clock, "trs80m2kb", __FILE__), m_maincpu(*this, I8021_TAG), m_y(*this, "Y%u", 0), @@ -299,7 +299,7 @@ READ8_MEMBER( trs80m2_keyboard_device::kb_t1_r ) READ8_MEMBER( trs80m2_keyboard_device::kb_p0_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_keylatch < 12) { diff --git a/src/mame/machine/trs80m2kb.h b/src/mame/machine/trs80m2kb.h index f0bbf4b9df1..f41a3f0a666 100644 --- a/src/mame/machine/trs80m2kb.h +++ b/src/mame/machine/trs80m2kb.h @@ -44,7 +44,7 @@ class trs80m2_keyboard_device : public device_t { public: // construction/destruction - trs80m2_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + trs80m2_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_clock_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_clock.set_callback(object); } @@ -83,7 +83,7 @@ private: int m_data; int m_clk; - UINT8 m_keylatch; + uint8_t m_keylatch; }; diff --git a/src/mame/machine/twincobr.cpp b/src/mame/machine/twincobr.cpp index c6c0bbdac10..8f8c9ae783e 100644 --- a/src/mame/machine/twincobr.cpp +++ b/src/mame/machine/twincobr.cpp @@ -53,7 +53,7 @@ READ16_MEMBER(twincobr_state::twincobr_dsp_r) { /* DSP can read data from main CPU RAM via DSP IO port 1 */ - UINT16 input_data = 0; + uint16_t input_data = 0; switch (m_main_ram_seg) { case 0x30000: case 0x40000: @@ -100,7 +100,7 @@ READ16_MEMBER(twincobr_state::wardner_dsp_r) { /* DSP can read data from main CPU RAM via DSP IO port 1 */ - UINT16 input_data = 0; + uint16_t input_data = 0; switch (m_main_ram_seg) { case 0x7000: case 0x8000: diff --git a/src/mame/machine/tx1.cpp b/src/mame/machine/tx1.cpp index 2366136bb30..c297b741fa4 100644 --- a/src/mame/machine/tx1.cpp +++ b/src/mame/machine/tx1.cpp @@ -16,11 +16,11 @@ Helper functions */ #define INC_PROM_ADDR ( math.promaddr = (math.promaddr + 1) & 0x1ff ) -#define ROR16(val, shift) ( ((UINT16)val >> shift) | ((UINT16)val << (16 - shift)) ) -#define ROL16(val, shift) ( ((UINT16)val << shift) | ((UINT16)val >> (16 - shift)) ) -#define SWAP16(val) ( (((UINT16)val << 8) & 0xff00) | ((UINT16)val >> 8) ) +#define ROR16(val, shift) ( ((uint16_t)val >> shift) | ((uint16_t)val << (16 - shift)) ) +#define ROL16(val, shift) ( ((uint16_t)val << shift) | ((uint16_t)val >> (16 - shift)) ) +#define SWAP16(val) ( (((uint16_t)val << 8) & 0xff00) | ((uint16_t)val >> 8) ) -static inline UINT8 reverse_nibble(UINT8 nibble) +static inline uint8_t reverse_nibble(uint8_t nibble) { return (nibble & 1) << 3 | (nibble & 2) << 1 | @@ -36,7 +36,7 @@ static inline UINT8 reverse_nibble(UINT8 nibble) there are no states between final input and multiplication/division. */ -static const UINT8 state_table[16][8] = +static const uint8_t state_table[16][8] = { { 4, 4, 4, 4, 5, 1, 1, 0 }, { 4, 4, 4, 4, 5, 5, 3, 0 }, @@ -132,13 +132,13 @@ static void sn_divide(running_machine &machine) { tx1_state *state = machine.driver_data(); sn74s516_t &SN74S516 = state->m_sn74s516; - INT32 Z = 0; - INT32 W = 0; + int32_t Z = 0; + int32_t W = 0; if (SN74S516.X == 0) { osd_printf_debug("%s:SN74S516 tried to divide by zero\n", machine.describe_context()); - SN74S516.ZW.as16bit.Z = (INT16)0xffff; + SN74S516.ZW.as16bit.Z = (int16_t)0xffff; SN74S516.ZW.as16bit.W = 0xffff; SN74S516.ZWfl = 0; return; @@ -197,7 +197,7 @@ static void sn74s516_update(running_machine &machine, int ins) } } -static void kick_sn74s516(running_machine &machine, UINT16 *data, const int ins) +static void kick_sn74s516(running_machine &machine, uint16_t *data, const int ins) { tx1_state *state = machine.driver_data(); sn74s516_t &SN74S516 = state->m_sn74s516; @@ -402,9 +402,9 @@ enum #define TX1_SET_INS0_BIT do { if (!(ins & 0x4) && math.i0ff) ins |= math.i0ff; } while(0) -static inline UINT16 get_tx1_datarom_addr(math_t &math) +static inline uint16_t get_tx1_datarom_addr(math_t &math) { - UINT16 addr; + uint16_t addr; addr = ((math.inslatch & 0x1c00) << 1) | (math.ppshift & 0xff); @@ -424,7 +424,7 @@ static void tx1_update_state(running_machine &machine) tx1_state *state = machine.driver_data(); math_t &math = state->m_math; - const UINT16 *prom = (UINT16*)state->memregion("au_data")->base() + (0x8000 >> 1); + const uint16_t *prom = (uint16_t*)state->memregion("au_data")->base() + (0x8000 >> 1); for (;;) { @@ -467,7 +467,7 @@ static void tx1_update_state(running_machine &machine) int tfad = (math.inslatch & 0x1c00) << 1; int sd = math.ppshift; int o4; - UINT16 data; + uint16_t data; o4 = (!BIT(sd, 9) && !BIT(sd,10)) || @@ -482,8 +482,8 @@ static void tx1_update_state(running_machine &machine) data = math.muxlatch; else if (dsel == 1) { - UINT16 *romdata = (UINT16*)machine.root_device().memregion("au_data")->base(); - UINT16 addr = get_tx1_datarom_addr(math); + uint16_t *romdata = (uint16_t*)machine.root_device().memregion("au_data")->base(); + uint16_t addr = get_tx1_datarom_addr(math); data = romdata[addr]; } else if (dsel == 2) @@ -505,7 +505,7 @@ static void tx1_update_state(running_machine &machine) */ else if (LHIEN(math.inslatch) || LLOEN(math.inslatch)) { - UINT16 data; + uint16_t data; kick_sn74s516(machine, &data, ins); @@ -586,7 +586,7 @@ static void tx1_update_state(running_machine &machine) else { /* Bus pullups give 0xffff */ - UINT16 data = 0xffff; + uint16_t data = 0xffff; kick_sn74s516(machine, &data, ins); } } @@ -659,8 +659,8 @@ READ16_MEMBER(tx1_state::tx1_math_r) TODO make this constant somewhere e.g. math.retval = math.romptr[ get_tx1_datarom_addr() ]; */ - UINT16 *romdata = (UINT16*)memregion("au_data")->base(); - UINT16 addr = get_tx1_datarom_addr(math); + uint16_t *romdata = (uint16_t*)memregion("au_data")->base(); + uint16_t addr = get_tx1_datarom_addr(math); math.retval = romdata[addr]; } else if (dsel == 2) @@ -753,7 +753,7 @@ WRITE16_MEMBER(tx1_state::tx1_math_w) //if (((math.inslatch >> 8) & TX1_DSEL) == 3 ) { int shift; - UINT16 val = math.ppshift; + uint16_t val = math.ppshift; if (math.cpulatch & 0x3800) { @@ -806,7 +806,7 @@ WRITE16_MEMBER(tx1_state::tx1_math_w) READ16_MEMBER(tx1_state::tx1_spcs_rom_r) { math_t &math = m_math; - math.cpulatch = *(UINT16*)((UINT8*)memregion("math_cpu")->base() + 0x04000 + 0x1000 + offset*2); + math.cpulatch = *(uint16_t*)((uint8_t*)memregion("math_cpu")->base() + 0x04000 + 0x1000 + offset*2); if (math.mux == TX1_SEL_ILDEN) { @@ -828,7 +828,7 @@ READ16_MEMBER(tx1_state::tx1_spcs_rom_r) //if ( ((math.inslatch >> 8) & TX1_DSEL) == 3 ) { int shift; - UINT16 val = math.ppshift; + uint16_t val = math.ppshift; if (math.cpulatch & 0x3800) { @@ -892,7 +892,7 @@ READ16_MEMBER(tx1_state::tx1_spcs_ram_r) else if (math.mux == TX1_SEL_PSSEN) { int shift; - UINT16 val = math.ppshift; + uint16_t val = math.ppshift; if (math.cpulatch & 0x3800) { @@ -960,9 +960,9 @@ enum #define BB_SET_INS0_BIT do { if (!(ins & 0x4) && math.i0ff) ins |= math.i0ff;} while(0) -static inline UINT16 get_bb_datarom_addr(math_t &math) +static inline uint16_t get_bb_datarom_addr(math_t &math) { - UINT16 addr; + uint16_t addr; addr = ((math.inslatch & 0x1c00) << 1) | (math.ppshift & 0xff); @@ -986,7 +986,7 @@ static void buggyboy_update_state(running_machine &machine) tx1_state *state = machine.driver_data(); math_t &math = state->m_math; - const UINT16 *prom = (UINT16*)state->memregion("au_data")->base() + (0x8000 >> 1); + const uint16_t *prom = (uint16_t*)state->memregion("au_data")->base() + (0x8000 >> 1); for (;;) { @@ -1019,8 +1019,8 @@ static void buggyboy_update_state(running_machine &machine) if (math.mux == BB_MUX_DPROE) { - UINT16 *romdata = (UINT16*)machine.root_device().memregion("au_data")->base(); - UINT16 addr = get_bb_datarom_addr(math); + uint16_t *romdata = (uint16_t*)machine.root_device().memregion("au_data")->base(); + uint16_t addr = get_bb_datarom_addr(math); kick_sn74s516(machine, &romdata[addr], ins); } else if (math.mux == BB_MUX_PPOE) @@ -1032,7 +1032,7 @@ static void buggyboy_update_state(running_machine &machine) /* What if /LHIEN and /LLOEN? */ else if (LHIEN(math.inslatch) || LLOEN(math.inslatch)) { - UINT16 data; + uint16_t data; kick_sn74s516(machine, &data, ins); @@ -1076,7 +1076,7 @@ static void buggyboy_update_state(running_machine &machine) else { /* Bus pullups give 0xffff */ - UINT16 data = 0xffff; + uint16_t data = 0xffff; kick_sn74s516(machine, &data, ins); } } @@ -1135,8 +1135,8 @@ READ16_MEMBER(tx1_state::buggyboy_math_r) /* /DPROE */ else if ((offset & 0xc00) == 0xc00) { - UINT16 *romdata = (UINT16*)memregion("au_data")->base(); - UINT16 addr = get_bb_datarom_addr(math); + uint16_t *romdata = (uint16_t*)memregion("au_data")->base(); + uint16_t addr = get_bb_datarom_addr(math); math.retval = romdata[addr]; @@ -1212,7 +1212,7 @@ WRITE16_MEMBER(tx1_state::buggyboy_math_w) if (((math.inslatch >> 8) & BB_DSEL) == 3) { int shift; - UINT16 val = math.ppshift; + uint16_t val = math.ppshift; if (math.cpulatch & 0x3800) { @@ -1268,7 +1268,7 @@ WRITE16_MEMBER(tx1_state::buggyboy_math_w) READ16_MEMBER(tx1_state::buggyboy_spcs_rom_r) { math_t &math = m_math; - math.cpulatch = *(UINT16*)((UINT8*)memregion("math_cpu")->base() + 0x04000 + 0x1000 + offset*2); + math.cpulatch = *(uint16_t*)((uint8_t*)memregion("math_cpu")->base() + 0x04000 + 0x1000 + offset*2); if (math.mux == BB_MUX_ILDEN) { @@ -1290,7 +1290,7 @@ READ16_MEMBER(tx1_state::buggyboy_spcs_rom_r) if (((math.inslatch >> 8) & BB_DSEL) == 3) { int shift; - UINT16 val = math.ppshift; + uint16_t val = math.ppshift; if (math.cpulatch & 0x3800) { @@ -1359,7 +1359,7 @@ READ16_MEMBER(tx1_state::buggyboy_spcs_ram_r) if (((math.inslatch >> 8) & BB_DSEL) == 3) { int shift; - UINT16 val = math.ppshift; + uint16_t val = math.ppshift; if (math.cpulatch & 0x3800) { diff --git a/src/mame/machine/upd65031.cpp b/src/mame/machine/upd65031.cpp index 86d9ff5e093..0e54f374bac 100644 --- a/src/mame/machine/upd65031.cpp +++ b/src/mame/machine/upd65031.cpp @@ -195,7 +195,7 @@ inline void upd65031_device::set_mode(int mode) // upd65031_device - constructor //------------------------------------------------- -upd65031_device::upd65031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd65031_device::upd65031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD65031, "NEC uPD65031", tag, owner, clock, "upd65031", __FILE__), m_read_kb(*this), m_write_int(*this), @@ -386,7 +386,7 @@ void upd65031_device::device_timer(emu_timer &timer, device_timer_id id, int par // screen_update //------------------------------------------------- -UINT32 upd65031_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t upd65031_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (!m_screen_update_cb.isnull() && (m_com & COM_LCDON)) m_screen_update_cb(bitmap, m_lcd_regs[4], m_lcd_regs[2], m_lcd_regs[3], m_lcd_regs[0], m_lcd_regs[1], m_flash); @@ -402,7 +402,7 @@ UINT32 upd65031_device::screen_update(screen_device &screen, bitmap_ind16 &bitma READ8_MEMBER( upd65031_device::read ) { - UINT8 port = offset & 0xff; + uint8_t port = offset & 0xff; switch (port) { @@ -419,7 +419,7 @@ READ8_MEMBER( upd65031_device::read ) if (LOG) logerror("uPD65031 '%s': entering snooze!\n", tag()); } - UINT8 data = m_read_kb(offset>>8); + uint8_t data = m_read_kb(offset>>8); if (LOG) logerror("uPD65031 '%s': key r %02x: %02x\n", tag(), offset>>8, data); @@ -468,7 +468,7 @@ READ8_MEMBER( upd65031_device::read ) WRITE8_MEMBER( upd65031_device::write ) { - UINT8 port = offset & 0xff; + uint8_t port = offset & 0xff; switch (port) { diff --git a/src/mame/machine/upd65031.h b/src/mame/machine/upd65031.h index d8ca35211d5..ce13ad05942 100644 --- a/src/mame/machine/upd65031.h +++ b/src/mame/machine/upd65031.h @@ -42,11 +42,11 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate upd65031_screen_update_delegate; -typedef device_delegate upd65031_memory_update_delegate; +typedef device_delegate upd65031_screen_update_delegate; +typedef device_delegate upd65031_memory_update_delegate; -#define UPD65031_SCREEN_UPDATE(_name) void _name(bitmap_ind16 &bitmap, UINT16 sbf, UINT16 hires0, UINT16 hires1, UINT16 lores0, UINT16 lores1, int flash) -#define UPD65031_MEMORY_UPDATE(_name) void _name(int bank, UINT16 page, int rams) +#define UPD65031_SCREEN_UPDATE(_name) void _name(bitmap_ind16 &bitmap, uint16_t sbf, uint16_t hires0, uint16_t hires1, uint16_t lores0, uint16_t lores1, int flash) +#define UPD65031_MEMORY_UPDATE(_name) void _name(int bank, uint16_t page, int rams) // ======================> upd65031_device @@ -55,7 +55,7 @@ class upd65031_device : public device_t { public: // construction/destruction - upd65031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd65031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_kb_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_kb.set_callback(object); } template static devcb_base &set_int_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_int.set_callback(object); } @@ -69,7 +69,7 @@ public: DECLARE_WRITE8_MEMBER( write ); DECLARE_WRITE_LINE_MEMBER( flp_w ); DECLARE_WRITE_LINE_MEMBER( btl_w ); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -94,16 +94,16 @@ private: upd65031_memory_update_delegate m_out_mem_cb; // callback for update bankswitch int m_mode; - UINT16 m_lcd_regs[5]; // LCD registers - UINT8 m_tim[5]; // RTC registers - UINT8 m_sr[4]; // segment registers - UINT8 m_sta; // interrupt status - UINT8 m_int; // interrupts mask - UINT8 m_ack; // interrupts acknowledge - UINT8 m_tsta; // timer interrupt status - UINT8 m_tmk; // timer interrupt mask - UINT8 m_tack; // timer interrupts acknowledge - UINT8 m_com; // command register + uint16_t m_lcd_regs[5]; // LCD registers + uint8_t m_tim[5]; // RTC registers + uint8_t m_sr[4]; // segment registers + uint8_t m_sta; // interrupt status + uint8_t m_int; // interrupts mask + uint8_t m_ack; // interrupts acknowledge + uint8_t m_tsta; // timer interrupt status + uint8_t m_tmk; // timer interrupt mask + uint8_t m_tack; // timer interrupts acknowledge + uint8_t m_com; // command register int m_flash; // cursor flash int m_speaker_state; // spkr line diff --git a/src/mame/machine/ut88.cpp b/src/mame/machine/ut88.cpp index ee30eced952..b9307a8fe1e 100644 --- a/src/mame/machine/ut88.cpp +++ b/src/mame/machine/ut88.cpp @@ -15,7 +15,7 @@ #include "machine/i8255.h" #include "includes/ut88.h" -static const UINT8 hex_to_7seg[16] = +static const uint8_t hex_to_7seg[16] = { 0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, @@ -28,7 +28,7 @@ static const UINT8 hex_to_7seg[16] = DRIVER_INIT_MEMBER(ut88_state,ut88) { /* set initially ROM to be visible on first bank */ - UINT8 *RAM = m_region_maincpu->base(); + uint8_t *RAM = m_region_maincpu->base(); memset(RAM,0x0000,0x0800); // make first page empty by default m_bank1->configure_entries(1, 2, RAM, 0x0000); m_bank1->configure_entries(0, 2, RAM, 0xf800); @@ -55,7 +55,7 @@ void ut88_state::device_timer(emu_timer &timer, device_timer_id id, int param, v READ8_MEMBER( ut88_state::ut88_8255_portb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if ( m_keyboard_mask & 0x01 ) data &= m_io_line0->read(); @@ -122,10 +122,10 @@ READ8_MEMBER( ut88_state::ut88_tape_r ) READ8_MEMBER( ut88_state::ut88mini_keyboard_r ) { // This is real keyboard implementation - UINT8 *keyrom1 = m_region_proms->base(); - UINT8 *keyrom2 = m_region_proms->base()+100; + uint8_t *keyrom1 = m_region_proms->base(); + uint8_t *keyrom2 = m_region_proms->base()+100; - UINT8 key = keyrom2[m_io_line1->read()]; + uint8_t key = keyrom2[m_io_line1->read()]; // if keyboard 2nd part returned 0 on 4th bit, output from // first part is used diff --git a/src/mame/machine/v1050kb.cpp b/src/mame/machine/v1050kb.cpp index 31f3b053c09..977c85ba29a 100644 --- a/src/mame/machine/v1050kb.cpp +++ b/src/mame/machine/v1050kb.cpp @@ -301,7 +301,7 @@ ioport_constructor v1050_keyboard_device::device_input_ports() const // v1050_keyboard_device - constructor //------------------------------------------------- -v1050_keyboard_device::v1050_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +v1050_keyboard_device::v1050_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, V1050_KEYBOARD, "Visual 1050 Keyboard", tag, owner, clock, "v1050kb", __FILE__), m_maincpu(*this, I8049_TAG), m_discrete(*this, DISCRETE_TAG), @@ -350,7 +350,7 @@ WRITE_LINE_MEMBER( v1050_keyboard_device::si_w ) READ8_MEMBER( v1050_keyboard_device::kb_p1_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_keylatch < 12) { diff --git a/src/mame/machine/v1050kb.h b/src/mame/machine/v1050kb.h index 177568843b2..3fb1cb9da3d 100644 --- a/src/mame/machine/v1050kb.h +++ b/src/mame/machine/v1050kb.h @@ -36,7 +36,7 @@ class v1050_keyboard_device : public device_t { public: // construction/destruction - v1050_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v1050_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_tx_handler(device_t &device, _Object object) { return downcast(device).m_out_tx_handler.set_callback(object); } @@ -63,7 +63,7 @@ private: required_ioport_array<12> m_y; devcb_write_line m_out_tx_handler; - UINT8 m_keylatch; + uint8_t m_keylatch; }; diff --git a/src/mame/machine/vector06.cpp b/src/mame/machine/vector06.cpp index 7383f1506c0..7f6165d7cf6 100644 --- a/src/mame/machine/vector06.cpp +++ b/src/mame/machine/vector06.cpp @@ -14,7 +14,7 @@ READ8_MEMBER( vector06_state::vector06_8255_portb_r ) { - UINT8 key = 0xff; + uint8_t key = 0xff; if (BIT(m_keyboard_mask, 0)) key &= m_line[0]->read(); if (BIT(m_keyboard_mask, 1)) key &= m_line[1]->read(); if (BIT(m_keyboard_mask, 2)) key &= m_line[2]->read(); @@ -28,7 +28,7 @@ READ8_MEMBER( vector06_state::vector06_8255_portb_r ) READ8_MEMBER( vector06_state::vector06_8255_portc_r ) { - UINT8 ret = m_line[8]->read(); + uint8_t ret = m_line[8]->read(); if (m_cassette->input() > 0) ret |= 0x10; @@ -59,16 +59,16 @@ WRITE8_MEMBER( vector06_state::vector06_8255_portb_w ) WRITE8_MEMBER( vector06_state::vector06_color_set ) { - UINT8 r = (data & 7) << 5; - UINT8 g = ((data >> 3) & 7) << 5; - UINT8 b = ((data >>6) & 3) << 6; + uint8_t r = (data & 7) << 5; + uint8_t g = ((data >> 3) & 7) << 5; + uint8_t b = ((data >>6) & 3) << 6; m_palette->set_pen_color( m_color_index, rgb_t(r,g,b) ); } READ8_MEMBER( vector06_state::vector06_romdisk_portb_r ) { - UINT16 addr = ((m_romdisk_msb & 0x7f) << 8) | m_romdisk_lsb; + uint16_t addr = ((m_romdisk_msb & 0x7f) << 8) | m_romdisk_lsb; if ((m_romdisk_msb & 0x80) && m_cart->exists() && addr < m_cart->get_rom_size()) return m_cart->read_rom(space, addr); else @@ -125,7 +125,7 @@ IRQ_CALLBACK_MEMBER(vector06_state::vector06_irq_callback) TIMER_CALLBACK_MEMBER(vector06_state::reset_check_callback) { - UINT8 val = m_reset->read(); + uint8_t val = m_reset->read(); if (BIT(val, 0)) { @@ -185,7 +185,7 @@ void vector06_state::update_mem() WRITE8_MEMBER(vector06_state::vector06_ramdisk_w) { - UINT8 oldbank = m_rambank; + uint8_t oldbank = m_rambank; m_rambank = data; if (oldbank != m_rambank) update_mem(); diff --git a/src/mame/machine/vectrex.cpp b/src/mame/machine/vectrex.cpp index 9a9cdaf66b9..1c6a7f72dee 100644 --- a/src/mame/machine/vectrex.cpp +++ b/src/mame/machine/vectrex.cpp @@ -227,7 +227,7 @@ TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_imager_change_color) TIMER_CALLBACK_MEMBER(vectrex_state::update_level) { if (ptr) - * (UINT8 *) ptr = param; + * (uint8_t *) ptr = param; } diff --git a/src/mame/machine/victor9k_fdc.cpp b/src/mame/machine/victor9k_fdc.cpp index 2e2affd9bcb..fcc1b262d1e 100644 --- a/src/mame/machine/victor9k_fdc.cpp +++ b/src/mame/machine/victor9k_fdc.cpp @@ -221,7 +221,7 @@ machine_config_constructor victor_9000_fdc_t::device_mconfig_additions() const // victor_9000_fdc_t - constructor //------------------------------------------------- -victor_9000_fdc_t::victor_9000_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +victor_9000_fdc_t::victor_9000_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VICTOR_9000_FDC, "Victor 9000 FDC", tag, owner, clock, "victor9k_fdc", __FILE__), m_irq_cb(*this), m_syn_cb(*this), @@ -449,7 +449,7 @@ READ8_MEMBER( victor_9000_fdc_t::floppy_p2_r ) */ - UINT8 data = m_p2 & 0x3f; + uint8_t data = m_p2 & 0x3f; data |= m_via_rdy0 << 6; data |= m_via_rdy1 << 7; @@ -590,7 +590,7 @@ void victor_9000_fdc_t::update_stepper_motor(floppy_image_device *floppy, int st floppy->set_rpm(victor9k_format::get_rpm(m_side, floppy->get_cyl())); } -void victor_9000_fdc_t::update_spindle_motor(floppy_image_device *floppy, emu_timer *t_tach, bool start, bool stop, bool sel, UINT8 &da) +void victor_9000_fdc_t::update_spindle_motor(floppy_image_device *floppy, emu_timer *t_tach, bool start, bool stop, bool sel, uint8_t &da) { #ifdef USE_SCP if (start && !stop && floppy->mon_r()) { @@ -605,7 +605,7 @@ void victor_9000_fdc_t::update_spindle_motor(floppy_image_device *floppy, emu_ti #endif } -void victor_9000_fdc_t::update_rpm(floppy_image_device *floppy, emu_timer *t_tach, bool sel, UINT8 &da) +void victor_9000_fdc_t::update_rpm(floppy_image_device *floppy, emu_timer *t_tach, bool sel, uint8_t &da) { #ifdef USE_SCP if (sel) { @@ -698,7 +698,7 @@ WRITE8_MEMBER( victor_9000_fdc_t::via4_pa_w ) } #endif - UINT8 st0 = data >> 4; + uint8_t st0 = data >> 4; if (LOG_VIA) logerror("%s %s L0MS %01x ST0 %01x\n", machine().time().as_string(), machine().describe_context(), m_via_l0ms, st0); @@ -763,7 +763,7 @@ WRITE8_MEMBER( victor_9000_fdc_t::via4_pb_w ) } #endif - UINT8 st1 = data >> 4; + uint8_t st1 = data >> 4; if (LOG_VIA) logerror("%s %s L1MS %01x ST1 %01x\n", machine().time().as_string(), machine().describe_context(), m_via_l1ms, st1); @@ -874,7 +874,7 @@ READ8_MEMBER( victor_9000_fdc_t::via6_pa_r ) if (LOG_VIA) logerror("%s %s TRK0D0 %u TRK0D1 %u SYNC %u\n", machine().time().as_string(), machine().describe_context(), m_floppy0->get_device() ? m_floppy0->get_device()->trk00_r() : 0, m_floppy1->get_device() ? m_floppy1->get_device()->trk00_r() : 0, checkpoint_live.sync); - UINT8 data = 0; + uint8_t data = 0; // track 0 drive A sense data |= (m_floppy0->get_device() ? m_floppy0->get_device()->trk00_r() : 0) << 1; @@ -960,7 +960,7 @@ READ8_MEMBER( victor_9000_fdc_t::via6_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // motor speed status, drive A data |= (m_via_rdy0 && m_via_rdy1) ? m_rdy0 : m_scp_rdy0; diff --git a/src/mame/machine/victor9k_fdc.h b/src/mame/machine/victor9k_fdc.h index 1d23c015be5..98e1d491507 100644 --- a/src/mame/machine/victor9k_fdc.h +++ b/src/mame/machine/victor9k_fdc.h @@ -45,7 +45,7 @@ class victor_9000_fdc_t : public device_t { public: // construction/destruction - victor_9000_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + victor_9000_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } template static devcb_base &set_syn_wr_callback(device_t &device, _Object object) { return downcast(device).m_syn_cb.set_callback(object); } @@ -129,10 +129,10 @@ private: // common offs_t i; - UINT8 e; + uint8_t e; // read - UINT16 shift_reg; + uint16_t shift_reg; int bit_counter; int sync_bit_counter; int sync_byte_counter; @@ -144,8 +144,8 @@ private: int gcr_err; // write - UINT16 shift_reg_write; - UINT8 wd; + uint16_t shift_reg_write; + uint8_t wd; int wrsync; int gcr_data; int erase; @@ -164,8 +164,8 @@ private: required_memory_region m_gcr_rom; void update_stepper_motor(floppy_image_device *floppy, int stp, int old_st, int st); - void update_spindle_motor(floppy_image_device *floppy, emu_timer *t_tach, bool start, bool stop, bool sel, UINT8 &da); - void update_rpm(floppy_image_device *floppy, emu_timer *t_tach, bool sel, UINT8 &da); + void update_spindle_motor(floppy_image_device *floppy, emu_timer *t_tach, bool start, bool stop, bool sel, uint8_t &da); + void update_rpm(floppy_image_device *floppy, emu_timer *t_tach, bool sel, uint8_t &da); void update_rdy(); image_init_result load0_cb(floppy_image_device *device); @@ -174,12 +174,12 @@ private: image_init_result load1_cb(floppy_image_device *device); void unload1_cb(floppy_image_device *device); - UINT8 m_p2; + uint8_t m_p2; /* floppy state */ - UINT8 m_da; - UINT8 m_da0; - UINT8 m_da1; + uint8_t m_da; + uint8_t m_da0; + uint8_t m_da1; int m_start0; int m_stop0; int m_start1; @@ -194,10 +194,10 @@ private: int m_scp_rdy1; int m_via_rdy0; int m_via_rdy1; - UINT8 m_scp_l0ms; - UINT8 m_scp_l1ms; - UINT8 m_via_l0ms; - UINT8 m_via_l1ms; + uint8_t m_scp_l0ms; + uint8_t m_scp_l1ms; + uint8_t m_via_l0ms; + uint8_t m_via_l1ms; int m_st0; int m_st1; int m_stp0; @@ -206,7 +206,7 @@ private: int m_side; int m_drw; int m_erase; - UINT8 m_wd; + uint8_t m_wd; int m_wrsync; int m_via4_irq; diff --git a/src/mame/machine/victor9kb.cpp b/src/mame/machine/victor9kb.cpp index 04a269dd687..a683a51295f 100644 --- a/src/mame/machine/victor9kb.cpp +++ b/src/mame/machine/victor9kb.cpp @@ -564,7 +564,7 @@ ioport_constructor victor_9000_keyboard_t::device_input_ports() const // victor_9000_keyboard_t - constructor //------------------------------------------------- -victor_9000_keyboard_t::victor_9000_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +victor_9000_keyboard_t::victor_9000_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VICTOR9K_KEYBOARD, "Victor 9000 Keyboard", tag, owner, clock, "victor9kb", __FILE__), m_maincpu(*this, I8021_TAG), m_y(*this, "Y%u", 0), @@ -617,7 +617,7 @@ WRITE_LINE_MEMBER( victor_9000_keyboard_t::kback_w ) READ8_MEMBER( victor_9000_keyboard_t::kb_p1_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_keylatch < 12) { diff --git a/src/mame/machine/victor9kb.h b/src/mame/machine/victor9kb.h index 138f37da739..53e51b0d608 100644 --- a/src/mame/machine/victor9kb.h +++ b/src/mame/machine/victor9kb.h @@ -38,7 +38,7 @@ class victor_9000_keyboard_t : public device_t { public: // construction/destruction - victor_9000_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + victor_9000_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_kbrdy_cb(device_t &device, _Object object) { return downcast(device).m_kbrdy_cb.set_callback(object); } template static devcb_base &set_kbdata_cb(device_t &device, _Object object) { return downcast(device).m_kbdata_cb.set_callback(object); } @@ -67,8 +67,8 @@ private: devcb_write_line m_kbrdy_cb; devcb_write_line m_kbdata_cb; - UINT8 m_p1; - UINT8 m_keylatch; + uint8_t m_p1; + uint8_t m_keylatch; int m_stb; int m_y12; int m_kbrdy; diff --git a/src/mame/machine/volfied.cpp b/src/mame/machine/volfied.cpp index e6c42f13bfc..e324c186123 100644 --- a/src/mame/machine/volfied.cpp +++ b/src/mame/machine/volfied.cpp @@ -19,7 +19,7 @@ #include "emu.h" #include "includes/volfied.h" -static const UINT16 palette_data_01[0x50] = +static const uint16_t palette_data_01[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -33,7 +33,7 @@ static const UINT16 palette_data_01[0x50] = 0x1e00, 0x1000, 0x9e01, 0x1e02, 0xde02, 0x0038, 0x0e38, 0x0000 }; -static const UINT16 palette_data_02[0x50] = +static const uint16_t palette_data_02[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -47,7 +47,7 @@ static const UINT16 palette_data_02[0x50] = 0x187b, 0x947a, 0x0821, 0x9e79, 0x1040, 0x8079, 0xc07a, 0x0000 }; -static const UINT16 palette_data_03[0x50] = +static const uint16_t palette_data_03[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -61,7 +61,7 @@ static const UINT16 palette_data_03[0x50] = 0x9201, 0xc002, 0xc003, 0x0003, 0x8002, 0x4001, 0xc002, 0x4003 }; -static const UINT16 palette_data_04[0x50] = +static const uint16_t palette_data_04[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -75,7 +75,7 @@ static const UINT16 palette_data_04[0x50] = 0x1e00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; -static const UINT16 palette_data_05[0x50] = +static const uint16_t palette_data_05[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -89,7 +89,7 @@ static const UINT16 palette_data_05[0x50] = 0x803a, 0x4208, 0x0821, 0x1042, 0xd65a, 0x9c73, 0xde03, 0x5c02 }; -static const UINT16 palette_data_06[0x50] = +static const uint16_t palette_data_06[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -103,7 +103,7 @@ static const UINT16 palette_data_06[0x50] = 0xde01, 0x1e01, 0xc03a, 0x0063, 0x586b, 0x9252, 0x8a31, 0x527a }; -static const UINT16 palette_data_07[0x50] = +static const uint16_t palette_data_07[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -117,7 +117,7 @@ static const UINT16 palette_data_07[0x50] = 0x8c31, 0x1042, 0x9c73, 0x1e00, 0x5c02, 0x0c00, 0x1860, 0x1e78 }; -static const UINT16 palette_data_08[0x50] = +static const uint16_t palette_data_08[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -131,7 +131,7 @@ static const UINT16 palette_data_08[0x50] = 0x1e00, 0x1000, 0x9e01, 0x5e02, 0x5e03, 0x0038, 0x0e38, 0x0000 }; -static const UINT16 palette_data_09[0x50] = +static const uint16_t palette_data_09[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -145,7 +145,7 @@ static const UINT16 palette_data_09[0x50] = 0x4208, 0x4a29, 0x8c31, 0x1042, 0x1e42, 0x186b, 0x9210, 0x9e31 }; -static const UINT16 palette_data_0a[0x50] = +static const uint16_t palette_data_0a[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -159,7 +159,7 @@ static const UINT16 palette_data_0a[0x50] = 0x0003, 0xc003, 0x5e02, 0xde01, 0x5201, 0xd200, 0x0668, 0x4672 }; -static const UINT16 palette_data_0b[0x50] = +static const uint16_t palette_data_0b[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -173,7 +173,7 @@ static const UINT16 palette_data_0b[0x50] = 0xce01, 0x8c01, 0x4208, 0xde03, 0x9c02, 0x1e60, 0x1a00, 0x1000 }; -static const UINT16 palette_data_0c[0x50] = +static const uint16_t palette_data_0c[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -187,7 +187,7 @@ static const UINT16 palette_data_0c[0x50] = 0xc001, 0xc003, 0xde03, 0x1403, 0xcc01, 0x4a01, 0x0668, 0x4672 }; -static const UINT16 palette_data_0d[0x50] = +static const uint16_t palette_data_0d[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -201,7 +201,7 @@ static const UINT16 palette_data_0d[0x50] = 0xde4b, 0x8e39, 0x0821, 0x1600, 0x1000, 0xd201, 0x1e00, 0x0a42 }; -static const UINT16 palette_data_0e[0x50] = +static const uint16_t palette_data_0e[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -215,7 +215,7 @@ static const UINT16 palette_data_0e[0x50] = 0x4208, 0x0821, 0x8c31, 0x1042, 0x5a6b, 0x8001, 0x0002, 0x545b }; -static const UINT16 palette_data_0f[0x50] = +static const uint16_t palette_data_0f[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -229,7 +229,7 @@ static const UINT16 palette_data_0f[0x50] = 0x8c31, 0x1042, 0x9c73, 0x1e03, 0x1a02, 0x0c00, 0x9e01, 0x0e00 }; -static const UINT16 palette_data_10[0x50] = +static const uint16_t palette_data_10[0x50] = { 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, @@ -243,7 +243,7 @@ static const UINT16 palette_data_10[0x50] = 0x524a, 0xce39, 0x0821, 0x1600, 0x1000, 0xd201, 0xde03, 0x0a42 }; -static const UINT16 palette_data_11[0x50] = +static const uint16_t palette_data_11[0x50] = { 0x0000, 0x4a29, 0x8c31, 0xce39, 0x1042, 0x524a, 0x9452, 0xd65a, 0x1863, 0x0000, 0xde39, 0xde7b, 0xc001, 0x8002, 0x1800, 0x1e00, @@ -257,7 +257,7 @@ static const UINT16 palette_data_11[0x50] = 0xce39, 0x1c02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; -static const UINT16 *const palette_data_lookup[] = +static const uint16_t *const palette_data_lookup[] = { nullptr, palette_data_01, @@ -296,7 +296,7 @@ TIMER_CALLBACK_MEMBER(volfied_state::volfied_timer_callback) // Palette commands - palette data written to bank 0: $10 - $af if (m_current_cmd >= 0x1 && m_current_cmd < 0x12) { - const UINT16* palette_data = palette_data_lookup[m_current_cmd]; + const uint16_t* palette_data = palette_data_lookup[m_current_cmd]; int i; for (i = 0; i < 0x50; i++) { @@ -493,7 +493,7 @@ READ16_MEMBER(volfied_state::volfied_cchip_ram_r) void volfied_state::volfied_cchip_init( ) { - m_cchip_ram = make_unique_clear(0x400 * 8); + m_cchip_ram = make_unique_clear(0x400 * 8); save_item(NAME(m_current_bank)); save_item(NAME(m_current_cmd)); diff --git a/src/mame/machine/vsnes.cpp b/src/mame/machine/vsnes.cpp index 2bd62bce753..666f5319d2d 100644 --- a/src/mame/machine/vsnes.cpp +++ b/src/mame/machine/vsnes.cpp @@ -188,7 +188,7 @@ MACHINE_START_MEMBER(vsnes_state,vsnes) int i; /* establish nametable ram */ - m_nt_ram[0] = std::make_unique(0x1000); + m_nt_ram[0] = std::make_unique(0x1000); /* set mirroring */ m_nt_page[0][0] = m_nt_ram[0].get(); m_nt_page[0][1] = m_nt_ram[0].get() + 0x400; @@ -236,8 +236,8 @@ MACHINE_START_MEMBER(vsnes_state,vsdual) m_vrom_size[1] = memregion("gfx2")->bytes(); /* establish nametable ram */ - m_nt_ram[0] = std::make_unique(0x1000); - m_nt_ram[1] = std::make_unique(0x1000); + m_nt_ram[0] = std::make_unique(0x1000); + m_nt_ram[1] = std::make_unique(0x1000); /* set mirroring */ m_nt_page[0][0] = m_nt_ram[0].get(); m_nt_page[0][1] = m_nt_ram[0].get() + 0x400; @@ -369,24 +369,24 @@ WRITE8_MEMBER(vsnes_state::gun_in0_w) /* do the gun thing */ int x = ioport("GUNX")->read(); float y = ioport("GUNY")->read(); - UINT8 pix; + uint8_t pix; y = y * 0.9375f; // scale 256 (our gun input range is 0 - 255) to 240 (screen visible area / bitmap we're using is 0 - 239) - UINT8 realy = (int)y; + uint8_t realy = (int)y; /* get the pixel at the gun position */ pix = m_ppu1->get_pixel(x, realy); rgb_t col = m_palette->pen_color(pix); - UINT8 bright = col.brightness(); + uint8_t bright = col.brightness(); // todo, calculate how bright it is with pix.r * 0.3 + pix.g * 0.59 + pix.b * 0.11 ? - // the mame calc above is UINT8 brightness() const { return (r() * 222 + g() * 707 + b() * 71) / 1000; } (from lib/util/palette.h) + // the mame calc above is uint8_t brightness() const { return (r() * 222 + g() * 707 + b() * 71) / 1000; } (from lib/util/palette.h) #if 0 - UINT8 r = col.r(); - UINT8 g = col.g(); - UINT8 b = col.b(); + uint8_t r = col.r(); + uint8_t g = col.g(); + uint8_t b = col.b(); printf("pix is %02x | %02x %02x %02x | %02x\n", pix, r,g,b,bright); #endif if (bright == 0xff) @@ -398,7 +398,7 @@ WRITE8_MEMBER(vsnes_state::gun_in0_w) #if 0 // this is junk code, only works for NES palette.. /* get the color base from the ppu */ - UINT32 color_base = m_ppu1->get_colorbase(); + uint32_t color_base = m_ppu1->get_colorbase(); /* look at the screen and see if the cursor is over a bright pixel */ if ((pix == color_base + 0x20 ) || (pix == color_base + 0x30) || @@ -441,7 +441,7 @@ WRITE8_MEMBER(vsnes_state::vskonami_rom_banking) case 2: /* code bank 1 */ case 4: /* code bank 2 */ { - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); memcpy(&prg[0x08000 + reg * 0x1000], &prg[bankoffset], 0x2000); } break; @@ -460,7 +460,7 @@ DRIVER_INIT_MEMBER(vsnes_state,vskonami) { /* We do manual banking, in case the code falls through */ /* Copy the initial banks */ - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); memcpy(&prg[0x08000], &prg[0x18000], 0x8000); /* banking is done with writes to the $8000-$ffff area */ @@ -475,7 +475,7 @@ WRITE8_MEMBER(vsnes_state::vsgshoe_gun_in0_w) int addr; if((data & 0x04) != m_old_bank) { - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); m_old_bank = data & 0x04; addr = m_old_bank ? 0x12000: 0x10000; memcpy(&prg[0x08000], &prg[addr], 0x2000); @@ -487,7 +487,7 @@ WRITE8_MEMBER(vsnes_state::vsgshoe_gun_in0_w) DRIVER_INIT_MEMBER(vsnes_state,vsgshoe) { /* set up the default bank */ - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); memcpy (&prg[0x08000], &prg[0x12000], 0x2000); /* vrom switching is enabled with bit 2 of $4016 */ @@ -582,7 +582,7 @@ WRITE8_MEMBER(vsnes_state::drmario_rom_banking) case 3: /* program banking */ { int bank = (m_drmario_shiftreg & 0x03) * 0x4000; - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); if (!m_size16k) { @@ -615,7 +615,7 @@ DRIVER_INIT_MEMBER(vsnes_state,drmario) { /* We do manual banking, in case the code falls through */ /* Copy the initial banks */ - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); memcpy(&prg[0x08000], &prg[0x10000], 0x4000); memcpy(&prg[0x0c000], &prg[0x1c000], 0x4000); @@ -632,7 +632,7 @@ DRIVER_INIT_MEMBER(vsnes_state,drmario) WRITE8_MEMBER(vsnes_state::vsvram_rom_banking) { int rombank = 0x10000 + (data & 7) * 0x4000; - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); memcpy(&prg[0x08000], &prg[rombank], 0x4000); } @@ -640,14 +640,14 @@ WRITE8_MEMBER(vsnes_state::vsvram_rom_banking) DRIVER_INIT_MEMBER(vsnes_state,vsvram) { /* when starting the game, the 1st 16k and the last 16k are loaded into the 2 banks */ - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); memcpy(&prg[0x08000], &prg[0x28000], 0x8000); /* banking is done with writes to the $8000-$ffff area */ m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(vsnes_state::vsvram_rom_banking),this)); /* allocate m_vram */ - m_vram = std::make_unique(0x2000); + m_vram = std::make_unique(0x2000); } /**********************************************************************************/ @@ -655,8 +655,8 @@ DRIVER_INIT_MEMBER(vsnes_state,vsvram) void vsnes_state::mapper4_set_prg( ) { - UINT8 *prg = memregion("maincpu")->base(); - UINT8 prg_flip = (m_MMC3_cmd & 0x40) ? 2 : 0; + uint8_t *prg = memregion("maincpu")->base(); + uint8_t prg_flip = (m_MMC3_cmd & 0x40) ? 2 : 0; memcpy(&prg[0x8000], &prg[0x2000 * (m_MMC3_prg_bank[0 ^ prg_flip] & m_MMC3_prg_mask) + 0x10000], 0x2000); memcpy(&prg[0xa000], &prg[0x2000 * (m_MMC3_prg_bank[1] & m_MMC3_prg_mask) + 0x10000], 0x2000); @@ -666,7 +666,7 @@ void vsnes_state::mapper4_set_prg( ) void vsnes_state::mapper4_set_chr( ) { - UINT8 chr_page = (m_MMC3_cmd & 0x80) >> 5; + uint8_t chr_page = (m_MMC3_cmd & 0x80) >> 5; v_set_videorom_bank(chr_page ^ 0, 1, m_MMC3_chr_bank[0] & ~0x01); v_set_videorom_bank(chr_page ^ 1, 1, m_MMC3_chr_bank[0] | 0x01); @@ -702,7 +702,7 @@ void vsnes_state::mapper4_irq( int scanline, int vblank, int blanked ) WRITE8_MEMBER(vsnes_state::mapper4_w) { - UINT8 MMC3_helper, cmd; + uint8_t MMC3_helper, cmd; switch (offset & 0x6001) { @@ -781,7 +781,7 @@ WRITE8_MEMBER(vsnes_state::mapper4_w) DRIVER_INIT_MEMBER(vsnes_state,MMC3) { - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); m_IRQ_enable = m_IRQ_count = m_IRQ_count_latch = 0; int MMC3_prg_chunks = (memregion("maincpu")->bytes() - 0x10000) / 0x4000; @@ -894,7 +894,7 @@ DRIVER_INIT_MEMBER(vsnes_state,supxevs) READ8_MEMBER(vsnes_state::tko_security_r) { - static const UINT8 security_data[] = { + static const uint8_t security_data[] = { 0xff, 0xbf, 0xb7, 0x97, 0x97, 0x17, 0x57, 0x4f, 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, 0x94, 0x14, 0x56, 0x4e, 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, @@ -956,7 +956,7 @@ WRITE8_MEMBER(vsnes_state::mapper68_rom_banking) case 0x7000: { - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); memcpy(&prg[0x08000], &prg[0x10000 + data * 0x4000], 0x4000); } break; @@ -970,7 +970,7 @@ DRIVER_INIT_MEMBER(vsnes_state,platoon) /* when starting a mapper 68 game the first 16K ROM bank in the cart is loaded into $8000 the LAST 16K ROM bank is loaded into $C000. The last 16K of ROM cannot be swapped. */ - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); memcpy(&prg[0x08000], &prg[0x10000], 0x4000); memcpy(&prg[0x0c000], &prg[0x2c000], 0x4000); @@ -1035,7 +1035,7 @@ WRITE8_MEMBER(vsnes_state::vsdual_vrom_banking_sub) DRIVER_INIT_MEMBER(vsnes_state,vsdual) { - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); /* vrom switching is enabled with bit 2 of $4016 */ m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking_main),this)); diff --git a/src/mame/machine/vtech2.cpp b/src/mame/machine/vtech2.cpp index bbc7d427cad..4d1fcefdf96 100644 --- a/src/mame/machine/vtech2.cpp +++ b/src/mame/machine/vtech2.cpp @@ -27,7 +27,7 @@ #define TRKSIZE_VZ 0x9a0 /* arbitrary (actually from analyzing format) */ -static const UINT8 laser_fdc_wrprot[2] = {0x80, 0x80}; +static const uint8_t laser_fdc_wrprot[2] = {0x80, 0x80}; /* wrappers for bank #1 to #4 */ WRITE8_MEMBER(vtech2_state::mwa_bank1 ) { mwa_bank(0,offset,data); } @@ -61,7 +61,7 @@ static const char *const mwa_bank_hard[4] = DRIVER_INIT_MEMBER(vtech2_state,laser) { - UINT8 *gfx = memregion("gfx2")->base(); + uint8_t *gfx = memregion("gfx2")->base(); int i; m_laser_track_x2[0] = m_laser_track_x2[1] = 80; @@ -195,7 +195,7 @@ WRITE8_MEMBER(vtech2_state::laser_bank_select_w) ************************************************/ int vtech2_state::mra_bank(int bank, int offs) { - UINT8 data = 0x7f; + uint8_t data = 0x7f; /* Laser 500/700 only: keyboard rows A through D */ if( (offs & 0x00ff) == 0x00ff ) @@ -444,7 +444,7 @@ WRITE8_MEMBER(vtech2_state::laser_fdc_w) { if( --m_laser_fdc_bits == 0 ) { - UINT8 value = 0; + uint8_t value = 0; m_laser_data &= 0xffff; if( m_laser_data & 0x4000 ) value |= 0x80; if( m_laser_data & 0x1000 ) value |= 0x40; diff --git a/src/mame/machine/wangpckb.cpp b/src/mame/machine/wangpckb.cpp index 5268163aba9..9f272fd2652 100644 --- a/src/mame/machine/wangpckb.cpp +++ b/src/mame/machine/wangpckb.cpp @@ -372,7 +372,7 @@ ioport_constructor wangpc_keyboard_t::device_input_ports() const // wangpc_keyboard_t - constructor //------------------------------------------------- -wangpc_keyboard_t::wangpc_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_keyboard_t::wangpc_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_KEYBOARD, "Wang PC Keyboard", tag, owner, clock, "wangpckb", __FILE__), device_serial_interface(mconfig, *this), m_maincpu(*this, I8051_TAG), diff --git a/src/mame/machine/wangpckb.h b/src/mame/machine/wangpckb.h index d2bfbeb8c71..1b357341a61 100644 --- a/src/mame/machine/wangpckb.h +++ b/src/mame/machine/wangpckb.h @@ -48,7 +48,7 @@ class wangpc_keyboard_t : public device_t, { public: // construction/destruction - wangpc_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_txd_handler(device_t &device, _Object object) { return downcast(device).m_txd_handler.set_callback(object); } @@ -85,7 +85,7 @@ private: required_ioport_array<16> m_y; devcb_write_line m_txd_handler; - UINT8 m_keylatch; + uint8_t m_keylatch; int m_rxd; }; diff --git a/src/mame/machine/williams.cpp b/src/mame/machine/williams.cpp index 2572f99f0a2..4bcc94211a2 100644 --- a/src/mame/machine/williams.cpp +++ b/src/mame/machine/williams.cpp @@ -372,7 +372,7 @@ CUSTOM_INPUT_MEMBER(williams_state::williams_mux_r) READ8_MEMBER(williams_state::williams_49way_port_0_r) { - static const UINT8 translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 }; + static const uint8_t translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 }; return (translate49[ioport("49WAYX")->read() >> 4] << 4) | translate49[ioport("49WAYY")->read() >> 4]; } @@ -600,8 +600,8 @@ TIMER_CALLBACK_MEMBER(blaster_state::blaster_deferred_snd_cmd_w) { pia6821_device *pia_2l = machine().device("pia_2"); pia6821_device *pia_2r = machine().device("pia_2b"); - UINT8 l_data = param | 0x80; - UINT8 r_data = (param >> 1 & 0x40) | (param & 0x3f) | 0x80; + uint8_t l_data = param | 0x80; + uint8_t r_data = (param >> 1 & 0x40) | (param & 0x3f) | 0x80; pia_2l->portb_w(l_data); pia_2l->cb1_w((l_data == 0xff) ? 0 : 1); pia_2r->portb_w(r_data); pia_2r->cb1_w((r_data == 0xff) ? 0 : 1); diff --git a/src/mame/machine/wpc.cpp b/src/mame/machine/wpc.cpp index 49608b7075f..f2e184bb060 100644 --- a/src/mame/machine/wpc.cpp +++ b/src/mame/machine/wpc.cpp @@ -12,7 +12,7 @@ const device_type WPCASIC = &device_creator; -wpc_device::wpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wpc_device::wpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig,WPCASIC,"Williams WPC ASIC",tag,owner,clock, "wpc", __FILE__), m_dmd_visiblepage(0), m_irq_cb(*this), @@ -65,7 +65,7 @@ void wpc_device::device_timer(emu_timer &timer, device_timer_id id, int param, v READ8_MEMBER(wpc_device::read) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; char kbdrow[8]; switch(offset) diff --git a/src/mame/machine/wpc.h b/src/mame/machine/wpc.h index 6d4a4e38406..3ed3151659e 100644 --- a/src/mame/machine/wpc.h +++ b/src/mame/machine/wpc.h @@ -102,17 +102,17 @@ class wpc_device : public device_t { public: - wpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); - UINT16 get_memprotect_mask() { return m_memprotect_mask; } + uint16_t get_memprotect_mask() { return m_memprotect_mask; } bool memprotect_active() { if(m_memprotect == 0xb4) return false; else return true; } - UINT16 get_alphanumeric(UINT8 offset) { if(offset < 40) return m_alpha_data[offset]; else return 0; } + uint16_t get_alphanumeric(uint8_t offset) { if(offset < 40) return m_alpha_data[offset]; else return 0; } void reset_alphanumeric() { memset(m_alpha_data,0,40*2); } - UINT8 get_visible_page() { return m_dmd_visiblepage; } - UINT8 get_dmd_firq_line() { return m_dmd_irqline; } + uint8_t get_visible_page() { return m_dmd_visiblepage; } + uint8_t get_dmd_firq_line() { return m_dmd_irqline; } void set_dmd_firq() { m_dmd_irqsrc = true; } void set_snd_firq() { m_snd_irqsrc = true; } @@ -136,21 +136,21 @@ protected: virtual void device_reset() override; private: - UINT8 m_shift_addr_high; - UINT8 m_shift_addr_low; - UINT8 m_shift_bit1; - UINT8 m_shift_bit2; - UINT8 m_memprotect; - UINT16 m_memprotect_mask; - UINT8 m_switch_col; // select switch column - UINT8 m_alpha_pos; // selected LED position - UINT16 m_alpha_data[40]; + uint8_t m_shift_addr_high; + uint8_t m_shift_addr_low; + uint8_t m_shift_bit1; + uint8_t m_shift_bit2; + uint8_t m_memprotect; + uint16_t m_memprotect_mask; + uint8_t m_switch_col; // select switch column + uint8_t m_alpha_pos; // selected LED position + uint16_t m_alpha_data[40]; bool m_zerocross; - UINT32 m_irq_count; - UINT8 m_dmd_visiblepage; + uint32_t m_irq_count; + uint8_t m_dmd_visiblepage; bool m_dmd_irqsrc; bool m_snd_irqsrc; - UINT8 m_dmd_irqline; + uint8_t m_dmd_irqline; emu_timer* m_zc_timer; devcb_write_line m_irq_cb; diff --git a/src/mame/machine/wpc_lamp.cpp b/src/mame/machine/wpc_lamp.cpp index eba57bb6ced..a2d7a4713fa 100644 --- a/src/mame/machine/wpc_lamp.cpp +++ b/src/mame/machine/wpc_lamp.cpp @@ -6,7 +6,7 @@ const device_type WPC_LAMP = &device_creator; -wpc_lamp_device::wpc_lamp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wpc_lamp_device::wpc_lamp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WPC_LAMP, "Williams Pinball Controller Lamp Control", tag, owner, clock, "wpc_lamp", __FILE__) { names = nullptr; @@ -60,7 +60,7 @@ void wpc_lamp_device::device_reset() void wpc_lamp_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { for(int i=0; i<64; i++) { - UINT8 s = state[i]; + uint8_t s = state[i]; state[i] = s >> 1; if((s & 0xc0) == 0x40 || (s & 0xc0) == 0x80) { char buffer[256]; diff --git a/src/mame/machine/wpc_lamp.h b/src/mame/machine/wpc_lamp.h index bc057ead3f4..c1e7de09620 100644 --- a/src/mame/machine/wpc_lamp.h +++ b/src/mame/machine/wpc_lamp.h @@ -12,7 +12,7 @@ class wpc_lamp_device : public device_t { public: - wpc_lamp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wpc_lamp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~wpc_lamp_device(); DECLARE_WRITE8_MEMBER(row_w); @@ -21,8 +21,8 @@ public: void set_names(const char *const *lamp_names); protected: - UINT8 state[64]; - UINT8 col, row; + uint8_t state[64]; + uint8_t col, row; emu_timer *timer; const char *const *names; diff --git a/src/mame/machine/wpc_out.cpp b/src/mame/machine/wpc_out.cpp index 7268eeeed09..67e02e1768e 100644 --- a/src/mame/machine/wpc_out.cpp +++ b/src/mame/machine/wpc_out.cpp @@ -6,7 +6,7 @@ const device_type WPC_OUT = &device_creator; -wpc_out_device::wpc_out_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wpc_out_device::wpc_out_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WPC_OUT, "Williams Pinball Controller Output Control", tag, owner, clock, "wpc_out", __FILE__) { names = nullptr; @@ -35,7 +35,7 @@ void wpc_out_device::gi_update() { attotime now = machine().time(); attotime delta = now - previous_gi_update; - UINT32 delta_us = delta.as_ticks(1e6); + uint32_t delta_us = delta.as_ticks(1e6); for(int i=0; i handler_t; - wpc_out_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wpc_out_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~wpc_out_device(); DECLARE_WRITE8_MEMBER(out_w); @@ -28,11 +28,11 @@ public: void set_gi_count(int _count); protected: - UINT8 state[6], gi; + uint8_t state[6], gi; bool first_after_led; attotime previous_gi_update; int gi_count; - UINT32 gi_time[5]; + uint32_t gi_time[5]; emu_timer *timer; const char *const *names; handler_t handler_cb; diff --git a/src/mame/machine/wpc_pic.cpp b/src/mame/machine/wpc_pic.cpp index 9fdd0404684..c61d0b5213b 100644 --- a/src/mame/machine/wpc_pic.cpp +++ b/src/mame/machine/wpc_pic.cpp @@ -6,7 +6,7 @@ const device_type WPC_PIC = &device_creator; -wpc_pic_device::wpc_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wpc_pic_device::wpc_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WPC_PIC, "Williams Pinball Controller PIC Security", tag, owner, clock, "wpc_pic", __FILE__), swarray(*this, ":SW.%u", 0) { @@ -24,7 +24,7 @@ void wpc_pic_device::set_serial(const char *_serial) READ8_MEMBER(wpc_pic_device::read) { - UINT8 data = 0x00; + uint8_t data = 0x00; if(curcmd == 0x0d) data = count; @@ -45,9 +45,9 @@ READ8_MEMBER(wpc_pic_device::read) void wpc_pic_device::check_game_id() { - UINT32 cmp = (cmpchk[0] << 16) | (cmpchk[1] << 8) | cmpchk[2]; + uint32_t cmp = (cmpchk[0] << 16) | (cmpchk[1] << 8) | cmpchk[2]; for(int i=0; i<1000; i++) { - UINT32 v = (i >> 8) * 0x3133 + (i & 0xff) * 0x3231; + uint32_t v = (i >> 8) * 0x3133 + (i & 0xff) * 0x3231; v = v & 0xffffff; if(v == cmp) logerror("%s: Detected game id %03d\n", tag(), i); @@ -86,10 +86,10 @@ WRITE8_MEMBER(wpc_pic_device::write) void wpc_pic_device::serial_to_pic() { - UINT32 no[20]; + uint32_t no[20]; for(int i=0; i<20; i++) no[i] = serial[i] - '0'; - UINT32 v; + uint32_t v; mem[10] = 0x12; // Random? mem[ 2] = 0x34; // Random? diff --git a/src/mame/machine/wpc_pic.h b/src/mame/machine/wpc_pic.h index 793dec9c05e..c1f7690f039 100644 --- a/src/mame/machine/wpc_pic.h +++ b/src/mame/machine/wpc_pic.h @@ -12,7 +12,7 @@ class wpc_pic_device : public device_t { public: - wpc_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wpc_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~wpc_pic_device(); DECLARE_READ8_MEMBER(read); @@ -23,7 +23,7 @@ public: protected: required_ioport_array<8> swarray; - UINT8 mem[16], chk[3], curcmd, scrambler, count, chk_count, cmpchk[3]; + uint8_t mem[16], chk[3], curcmd, scrambler, count, chk_count, cmpchk[3]; const char *serial; virtual void device_start() override; diff --git a/src/mame/machine/wpc_shift.cpp b/src/mame/machine/wpc_shift.cpp index 8022f14a26a..cbd534dc12a 100644 --- a/src/mame/machine/wpc_shift.cpp +++ b/src/mame/machine/wpc_shift.cpp @@ -6,7 +6,7 @@ const device_type WPC_SHIFT = &device_creator; -wpc_shift_device::wpc_shift_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wpc_shift_device::wpc_shift_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WPC_SHIFT, "Williams Pinball Controller Shifter", tag, owner, clock, "wpc_shift", __FILE__) { } diff --git a/src/mame/machine/wpc_shift.h b/src/mame/machine/wpc_shift.h index 70fc487c3ea..0870588c530 100644 --- a/src/mame/machine/wpc_shift.h +++ b/src/mame/machine/wpc_shift.h @@ -12,7 +12,7 @@ class wpc_shift_device : public device_t { public: - wpc_shift_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wpc_shift_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~wpc_shift_device(); DECLARE_ADDRESS_MAP(registers, 8); @@ -27,8 +27,8 @@ public: DECLARE_WRITE8_MEMBER(val2_w); protected: - UINT16 adr; - UINT8 val1, val2; + uint16_t adr; + uint8_t val1, val2; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/machine/wswan.cpp b/src/mame/machine/wswan.cpp index b249befd784..65d88be4235 100644 --- a/src/mame/machine/wswan.cpp +++ b/src/mame/machine/wswan.cpp @@ -25,7 +25,7 @@ TODO: enum enum_system { TYPE_WSWAN=0, TYPE_WSC }; -static const UINT8 ws_portram_init[256] = +static const uint8_t ws_portram_init[256] = { 0x00, 0x00, 0x00/*?*/, 0xbb, 0x00, 0x00, 0x00, 0x26, 0xfe, 0xde, 0xf9, 0xfb, 0xdb, 0xd7, 0x7f, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x9e, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x99, 0xfd, 0xb7, 0xdf, @@ -74,7 +74,7 @@ static const UINT8 ws_portram_init[256] = EA 00 00 FF FF jmp FFFFh:0000h */ -static const UINT8 ws_fake_bios_code[] = { +static const uint8_t ws_fake_bios_code[] = { 0xfc, 0xbc, 0x00, 0x20, 0x68, 0x00, 0x00, 0x07, 0x68, 0x00, 0xf0, 0x1f, 0xbf, 0x00, 0x04, 0xbe, 0xe0, 0xff, 0xb9, 0x10, 0x00, 0xf3, 0xa4, 0xb0, 0x2f, 0xe6, 0xc0, 0xea, 0x00, 0x04, 0x00, 0x00, 0xe4, 0xa0, 0x0c, 0x01, 0xe6, 0xa0, 0xea, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -169,7 +169,7 @@ void wswan_state::register_save() void wswan_state::common_start() { - m_ws_bios_bank = std::make_unique(0x10000); + m_ws_bios_bank = std::make_unique(0x10000); memcpy(m_ws_bios_bank.get() + 0xffc0, ws_fake_bios_code, 0x40); register_save(); @@ -233,7 +233,7 @@ READ8_MEMBER( wswan_state::bios_r ) READ8_MEMBER( wswan_state::port_r ) { - UINT8 value = m_ws_portram[offset]; + uint8_t value = m_ws_portram[offset]; if (offset != 2) logerror("PC=%X: port read %02X\n", m_maincpu->pc(), offset); @@ -298,7 +298,7 @@ READ8_MEMBER( wswan_state::port_r ) WRITE8_MEMBER( wswan_state::port_w ) { address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT8 input; + uint8_t input; logerror("PC=%X: port write %02X <- %02X\n", m_maincpu->pc(), offset, data); if (offset < 0x40 || (offset >= 0xa1 && offset < 0xb0)) @@ -340,8 +340,8 @@ WRITE8_MEMBER( wswan_state::port_w ) */ if (data & 0x80) { - UINT32 src, dst; - UINT16 length; + uint32_t src, dst; + uint16_t length; src = m_ws_portram[0x40] + (m_ws_portram[0x41] << 8) + (m_ws_portram[0x42] << 16); dst = m_ws_portram[0x44] + (m_ws_portram[0x45] << 8) + (m_ws_portram[0x43] << 16); @@ -618,14 +618,14 @@ WRITE8_MEMBER( wswan_state::port_w ) */ if (data & 0x20) { - UINT16 addr = ( ( ( m_ws_portram[0xbd] << 8 ) | m_ws_portram[0xbc] ) << 1 ) & 0x1FF; + uint16_t addr = ( ( ( m_ws_portram[0xbd] << 8 ) | m_ws_portram[0xbc] ) << 1 ) & 0x1FF; m_internal_eeprom[ addr ] = m_ws_portram[0xba]; m_internal_eeprom[ addr + 1 ] = m_ws_portram[0xbb]; data |= 0x02; } else if ( data & 0x10 ) { - UINT16 addr = ( ( ( m_ws_portram[0xbd] << 8 ) | m_ws_portram[0xbc] ) << 1 ) & 0x1FF; + uint16_t addr = ( ( ( m_ws_portram[0xbd] << 8 ) | m_ws_portram[0xbc] ) << 1 ) & 0x1FF; m_ws_portram[0xba] = m_internal_eeprom[ addr ]; m_ws_portram[0xbb] = m_internal_eeprom[ addr + 1]; data |= 0x01; diff --git a/src/mame/machine/x1.cpp b/src/mame/machine/x1.cpp index f9c40398f20..c50ed99e3ef 100644 --- a/src/mame/machine/x1.cpp +++ b/src/mame/machine/x1.cpp @@ -14,7 +14,7 @@ const device_type X1_KEYBOARD = &device_creator; // z80ctc_device - constructor //------------------------------------------------- -x1_keyboard_device::x1_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +x1_keyboard_device::x1_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, X1_KEYBOARD, "X1 Keyboard", tag, owner, clock, "x1_keyboard", __FILE__), device_z80daisy_interface(mconfig, *this) { diff --git a/src/mame/machine/x68k_hdc.cpp b/src/mame/machine/x68k_hdc.cpp index 57baeaf1f5a..e6005313056 100644 --- a/src/mame/machine/x68k_hdc.cpp +++ b/src/mame/machine/x68k_hdc.cpp @@ -23,7 +23,7 @@ const device_type X68KHDC = &device_creator; -x68k_hdc_image_device::x68k_hdc_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +x68k_hdc_image_device::x68k_hdc_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, X68KHDC, "SASI Hard Disk", tag, owner, clock, "x68k_hdc_image", __FILE__), device_image_interface(mconfig, *this) { diff --git a/src/mame/machine/x68k_hdc.h b/src/mame/machine/x68k_hdc.h index f8aa541d7e8..3f5677790c8 100644 --- a/src/mame/machine/x68k_hdc.h +++ b/src/mame/machine/x68k_hdc.h @@ -82,7 +82,7 @@ class x68k_hdc_image_device : public device_t, { public: // construction/destruction - x68k_hdc_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + x68k_hdc_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // image-level overrides virtual iodevice_t image_type() const override { return IO_HARDDISK; } diff --git a/src/mame/machine/x68k_kbd.cpp b/src/mame/machine/x68k_kbd.cpp index b9cba301c3f..6c42692d512 100644 --- a/src/mame/machine/x68k_kbd.cpp +++ b/src/mame/machine/x68k_kbd.cpp @@ -5,14 +5,14 @@ #include "machine/keyboard.ipp" -x68k_keyboard_device::x68k_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) +x68k_keyboard_device::x68k_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : buffered_rs232_device(mconfig, X68K_KEYBOARD, "X68k Keyboard", tag, owner, 0, "x68k_keyboard", __FILE__) , device_matrix_keyboard_interface(mconfig, *this, "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9", "LINEA", "LINEB", "LINEC", "LINED", "LINEE") { } -void x68k_keyboard_device::received_byte(UINT8 data) +void x68k_keyboard_device::received_byte(uint8_t data) { /* Keyboard control commands: 00xxxxxx - TV Control @@ -84,7 +84,7 @@ void x68k_keyboard_device::received_byte(UINT8 data) } } -void x68k_keyboard_device::key_make(UINT8 row, UINT8 column) +void x68k_keyboard_device::key_make(uint8_t row, uint8_t column) { // TODO: work out which keys actually repeat (this assumes it's anything other than ctrl/opt/shift) if (row != 0x0eU) @@ -95,12 +95,12 @@ void x68k_keyboard_device::key_make(UINT8 row, UINT8 column) transmit_byte((row << 3) | column); } -void x68k_keyboard_device::key_repeat(UINT8 row, UINT8 column) +void x68k_keyboard_device::key_repeat(uint8_t row, uint8_t column) { transmit_byte((row << 3) | column); } -void x68k_keyboard_device::key_break(UINT8 row, UINT8 column) +void x68k_keyboard_device::key_break(uint8_t row, uint8_t column) { device_matrix_keyboard_interface::key_break(row, column); diff --git a/src/mame/machine/x68k_kbd.h b/src/mame/machine/x68k_kbd.h index 5540be8f151..f856a68efb2 100644 --- a/src/mame/machine/x68k_kbd.h +++ b/src/mame/machine/x68k_kbd.h @@ -8,23 +8,23 @@ class x68k_keyboard_device : public buffered_rs232_device<16U>, protected device_matrix_keyboard_interface<15U> { public: - x68k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + x68k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; protected: virtual void device_start() override; virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void key_make(UINT8 row, UINT8 column) override; - virtual void key_repeat(UINT8 row, UINT8 column) override; - virtual void key_break(UINT8 row, UINT8 column) override; + virtual void key_make(uint8_t row, uint8_t column) override; + virtual void key_repeat(uint8_t row, uint8_t column) override; + virtual void key_break(uint8_t row, uint8_t column) override; private: - virtual void received_byte(UINT8 data) override; + virtual void received_byte(uint8_t data) override; int m_delay; // keypress delay after initial press int m_repeat; // keypress repeat rate - UINT8 m_enabled; // keyboard enabled? + uint8_t m_enabled; // keyboard enabled? }; extern const device_type X68K_KEYBOARD; diff --git a/src/mame/machine/x820kb.cpp b/src/mame/machine/x820kb.cpp index b567c7090f9..aa235fc9b27 100644 --- a/src/mame/machine/x820kb.cpp +++ b/src/mame/machine/x820kb.cpp @@ -257,7 +257,7 @@ ioport_constructor xerox_820_keyboard_t::device_input_ports() const // xerox_820_keyboard_t - constructor //------------------------------------------------- -xerox_820_keyboard_t::xerox_820_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +xerox_820_keyboard_t::xerox_820_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, XEROX_820_KEYBOARD, "Xerox 820 Keyboard", tag, owner, clock, "x820kb", __FILE__), m_maincpu(*this, I8748_TAG), m_y(*this, "Y%u", 0), @@ -348,7 +348,7 @@ READ8_MEMBER( xerox_820_keyboard_t::kb_p2_r ) READ8_MEMBER( xerox_820_keyboard_t::kb_t0_r ) { - UINT8 data = 1; + uint8_t data = 1; switch (m_p1 & 0x0f) { diff --git a/src/mame/machine/x820kb.h b/src/mame/machine/x820kb.h index e84cfa23ad3..cea0e009e9e 100644 --- a/src/mame/machine/x820kb.h +++ b/src/mame/machine/x820kb.h @@ -35,7 +35,7 @@ class xerox_820_keyboard_t : public device_t { public: // construction/destruction - xerox_820_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + xerox_820_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_kbstb_wr_callback(device_t &device, _Object object) { return downcast(device).m_kbstb_cb.set_callback(object); } @@ -44,7 +44,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const override; virtual ioport_constructor device_input_ports() const override; - UINT8 read() { return m_bus; } + uint8_t read() { return m_bus; } DECLARE_READ8_MEMBER( kb_p1_r ); DECLARE_WRITE8_MEMBER( kb_p1_w ); @@ -65,8 +65,8 @@ private: devcb_write_line m_kbstb_cb; - UINT8 m_p1; - UINT8 m_bus; + uint8_t m_p1; + uint8_t m_bus; }; diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp index 77523ea6a7c..d0ce516e8f3 100644 --- a/src/mame/machine/xbox.cpp +++ b/src/mame/machine/xbox.cpp @@ -26,7 +26,7 @@ void xbox_base_state::dump_string_command(int ref, int params, const char **para debugger_cpu &cpu = machine().debugger().cpu(); debugger_console &con = machine().debugger().console(); address_space &space = m_maincpu->space(); - UINT64 addr; + uint64_t addr; offs_t address; if (params < 1) @@ -43,8 +43,8 @@ void xbox_base_state::dump_string_command(int ref, int params, const char **para } address = (offs_t)addr; - UINT32 length = cpu.read_word(space, address, true); - UINT32 maximumlength = cpu.read_word(space, address + 2, true); + uint32_t length = cpu.read_word(space, address, true); + uint32_t maximumlength = cpu.read_word(space, address + 2, true); offs_t buffer = cpu.read_dword(space, address + 4, true); con.printf("Length %d word\n", length); con.printf("MaximumLength %d word\n", maximumlength); @@ -55,7 +55,7 @@ void xbox_base_state::dump_string_command(int ref, int params, const char **para for (int a = 0; a < length; a++) { - UINT8 c = cpu.read_byte(space, buffer + a, true); + uint8_t c = cpu.read_byte(space, buffer + a, true); con.printf("%c", c); } con.printf("\n"); @@ -66,7 +66,7 @@ void xbox_base_state::dump_process_command(int ref, int params, const char **par debugger_cpu &cpu = machine().debugger().cpu(); debugger_console &con = machine().debugger().console(); address_space &space = m_maincpu->space(); - UINT64 addr; + uint64_t addr; offs_t address; if (params < 1) @@ -98,7 +98,7 @@ void xbox_base_state::dump_list_command(int ref, int params, const char **param) debugger_cpu &cpu = machine().debugger().cpu(); debugger_console &con = machine().debugger().console(); address_space &space = m_maincpu->space(); - UINT64 addr; + uint64_t addr; offs_t address; if (params < 1) @@ -107,7 +107,7 @@ void xbox_base_state::dump_list_command(int ref, int params, const char **param) if (!machine().debugger().commands().validate_number_parameter(param[0], &addr)) return; - UINT64 offs = 0; + uint64_t offs = 0; offs_t offset = 0; if (params >= 2) { @@ -116,7 +116,7 @@ void xbox_base_state::dump_list_command(int ref, int params, const char **param) offset = (offs_t)offs; } - UINT64 start = addr; + uint64_t start = addr; address = (offs_t)addr; if (!m_maincpu->translate(AS_PROGRAM, TRANSLATE_READ_DEBUG, address)) { @@ -129,13 +129,13 @@ void xbox_base_state::dump_list_command(int ref, int params, const char **param) else con.printf("Entry\n"); - UINT64 old; + uint64_t old; for (int num = 0; num < 32; num++) { if (params >= 2) - con.printf("%08X %08X\n", (UINT32)addr, (offs_t)addr - offset); + con.printf("%08X %08X\n", (uint32_t)addr, (offs_t)addr - offset); else - con.printf("%08X\n", (UINT32)addr); + con.printf("%08X\n", (uint32_t)addr); old = addr; addr = cpu.read_dword(space, address, true); if (addr == start) @@ -154,7 +154,7 @@ void xbox_base_state::dump_dpc_command(int ref, int params, const char **param) debugger_cpu &cpu = machine().debugger().cpu(); debugger_console &con = machine().debugger().console(); address_space &space = m_maincpu->space(); - UINT64 addr; + uint64_t addr; offs_t address; if (params < 1) @@ -185,7 +185,7 @@ void xbox_base_state::dump_timer_command(int ref, int params, const char **param debugger_cpu &cpu = machine().debugger().cpu(); debugger_console &con = machine().debugger().console(); address_space &space = m_maincpu->space(); - UINT64 addr; + uint64_t addr; offs_t address; if (params < 1) @@ -207,7 +207,7 @@ void xbox_base_state::dump_timer_command(int ref, int params, const char **param con.printf("Header.Inserted %d byte\n", cpu.read_byte(space, address + 3, true)); con.printf("Header.SignalState %08X dword\n", cpu.read_dword(space, address + 4, true)); con.printf("Header.WaitListEntry {%08X,%08X} _LIST_ENTRY\n", cpu.read_dword(space, address + 8, true), cpu.read_dword(space, address + 12, true)); - con.printf("%s", string_format("DueTime %I64x qword\n", (INT64)cpu.read_qword(space, address + 16, true)).c_str()); + con.printf("%s", string_format("DueTime %I64x qword\n", (int64_t)cpu.read_qword(space, address + 16, true)).c_str()); con.printf("TimerListEntry {%08X,%08X} _LIST_ENTRY\n", cpu.read_dword(space, address + 24, true), cpu.read_dword(space, address + 28, true)); con.printf("Dpc %08X dword\n", cpu.read_dword(space, address + 32, true)); con.printf("Period %d dword\n", cpu.read_dword(space, address + 36, true)); @@ -220,7 +220,7 @@ void xbox_base_state::curthread_command(int ref, int params, const char **param) address_space &space = m_maincpu->space(); offs_t address; - UINT64 fsbase = m_maincpu->state_int(44); // base of FS register + uint64_t fsbase = m_maincpu->state_int(44); // base of FS register address = (offs_t)fsbase + 0x28; if (!m_maincpu->translate(AS_PROGRAM, TRANSLATE_READ_DEBUG, address)) { @@ -229,13 +229,13 @@ void xbox_base_state::curthread_command(int ref, int params, const char **param) } address = (offs_t)fsbase + 0x28; - UINT32 kthrd = cpu.read_dword(space, address, true); + uint32_t kthrd = cpu.read_dword(space, address, true); con.printf("Current thread is %08X\n", kthrd); address = (offs_t)kthrd + 0x1c; - UINT32 topstack = cpu.read_dword(space, address, true); + uint32_t topstack = cpu.read_dword(space, address, true); con.printf("Current thread stack top is %08X\n", topstack); address = (offs_t)kthrd + 0x28; - UINT32 tlsdata = cpu.read_dword(space, address, true); + uint32_t tlsdata = cpu.read_dword(space, address, true); if (tlsdata == 0) address = (offs_t)topstack - 0x210 - 8; else @@ -245,7 +245,7 @@ void xbox_base_state::curthread_command(int ref, int params, const char **param) void xbox_base_state::generate_irq_command(int ref, int params, const char **param) { - UINT64 irq; + uint64_t irq; if (params < 1) return; @@ -280,7 +280,7 @@ void xbox_base_state::waitvblank_command(int ref, int params, const char **param void xbox_base_state::grab_texture_command(int ref, int params, const char **param) { - UINT64 type; + uint64_t type; if (params < 2) return; @@ -293,7 +293,7 @@ void xbox_base_state::grab_texture_command(int ref, int params, const char **par void xbox_base_state::grab_vprog_command(int ref, int params, const char **param) { - UINT32 instruction[4]; + uint32_t instruction[4]; FILE *fil; if (params < 1) @@ -304,7 +304,7 @@ void xbox_base_state::grab_vprog_command(int ref, int params, const char **param return; for (int n = 0; n < 136; n++) { nvidia_nv2a->debug_grab_vertex_program_slot(n, instruction); - fwrite(instruction, sizeof(UINT32), 4, fil); + fwrite(instruction, sizeof(uint32_t), 4, fil); } fclose(fil); } @@ -316,15 +316,15 @@ void xbox_base_state::vprogdis_command(int ref, int params, const char **param) if (params < 2) return; - UINT64 address; + uint64_t address; if (!machine().debugger().commands().validate_number_parameter(param[0], &address)) return; - UINT64 length; + uint64_t length; if (!machine().debugger().commands().validate_number_parameter(param[1], &length)) return; - UINT64 type = 0; + uint64_t type = 0; if (params > 2) if (!machine().debugger().commands().validate_number_parameter(param[2], &type)) return; @@ -332,7 +332,7 @@ void xbox_base_state::vprogdis_command(int ref, int params, const char **param) vertex_program_disassembler vd; while (length > 0) { - UINT32 instruction[4]; + uint32_t instruction[4]; if (type == 1) { offs_t addr = (offs_t)address; @@ -483,7 +483,7 @@ void xbox_base_state::vblank_callback(screen_device &screen, bool state) nvidia_nv2a->vblank_callback(screen, state); } -UINT32 xbox_base_state::screen_update_callback(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t xbox_base_state::screen_update_callback(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return nvidia_nv2a->screen_update_callback(screen, bitmap, cliprect); } @@ -498,7 +498,7 @@ WRITE32_MEMBER(xbox_base_state::geforce_w) nvidia_nv2a->geforce_w(space, offset, data, mem_mask); } -static UINT32 geforce_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t geforce_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { #ifdef LOG_PCI busdevice->logerror(" bus:1 device:NV_2A function:%d register:%d mask:%08X\n",function,reg,mem_mask); @@ -506,7 +506,7 @@ static UINT32 geforce_pci_r(device_t *busdevice, device_t *device, int function, return 0; } -static void geforce_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void geforce_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { #ifdef LOG_PCI busdevice->logerror(" bus:1 device:NV_2A function:%d register:%d data:%08X mask:%08X\n",function,reg,data,mem_mask); @@ -529,8 +529,8 @@ READ32_MEMBER(xbox_base_state::audio_apu_r) WRITE32_MEMBER(xbox_base_state::audio_apu_w) { - //UINT32 old; - UINT32 v; + //uint32_t old; + uint32_t v; #ifdef LOG_AUDIO logerror("Audio_APU: write at %08X mask %08X value %08X\n", 0xfe800000 + offset * 4, mem_mask, data); @@ -597,7 +597,7 @@ WRITE32_MEMBER(xbox_base_state::audio_apu_w) return; } if (offset == 0x2037c / 4) { // value related to sample rate - INT16 v0 = (INT16)(data >> 16); // upper 16 bits as a signed 16 bit value + int16_t v0 = (int16_t)(data >> 16); // upper 16 bits as a signed 16 bit value float vv = ((float)v0) / 4096.0f; // divide by 4096 float vvv = powf(2, vv); // two to the vv int f = vvv*48000.0f; // sample rate @@ -618,7 +618,7 @@ WRITE32_MEMBER(xbox_base_state::audio_apu_w) return; if (offset == 0x20124 / 4) { // voice number to activate ? v = apust.voice_number; - apust.voices_active[v >> 6] |= ((UINT64)1 << (v & 63)); + apust.voices_active[v >> 6] |= ((uint64_t)1 << (v & 63)); apust.voices_position[v] = apust.voices_position_start[apust.voice_number]; apust.voices_position_increment[apust.voice_number] = apust.voices_frequency[apust.voice_number]; return; @@ -638,7 +638,7 @@ WRITE32_MEMBER(xbox_base_state::audio_apu_w) READ32_MEMBER(xbox_base_state::audio_ac93_r) { - UINT32 ret = 0; + uint32_t ret = 0; #ifdef LOG_AUDIO logerror("Audio_AC3: read from %08X mask %08X\n", 0xfec00000 + offset * 4, mem_mask); @@ -687,8 +687,8 @@ TIMER_CALLBACK_MEMBER(xbox_base_state::audio_apu_timer) { int cmd; int bb, b, v; - UINT64 bv; - UINT32 phys; + uint64_t bv; + uint32_t phys; cmd = apust.space->read_dword(apust.gpdsp_address + 0x800 + 0x10); if (cmd == 3) @@ -711,7 +711,7 @@ TIMER_CALLBACK_MEMBER(xbox_base_state::audio_apu_timer) } } -static UINT32 pcibridghostbridg_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t pcibridghostbridg_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { #ifdef LOG_PCI busdevice->logerror(" bus:0 function:%d register:%d mask:%08X\n",function,reg,mem_mask); @@ -721,14 +721,14 @@ static UINT32 pcibridghostbridg_pci_r(device_t *busdevice, device_t *device, int return 0; } -static void pcibridghostbridg_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void pcibridghostbridg_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { #ifdef LOG_PCI busdevice->logerror(" bus:0 function:%d register:%d data:%08X mask:%08X\n", function, reg, data, mem_mask); #endif } -static UINT32 hubintisabridg_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t hubintisabridg_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { #ifdef LOG_PCI busdevice->logerror(" bus:0 function:%d register:%d mask:%08X\n",function,reg,mem_mask); @@ -738,7 +738,7 @@ static UINT32 hubintisabridg_pci_r(device_t *busdevice, device_t *device, int fu return 0; } -static void hubintisabridg_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void hubintisabridg_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { #ifdef LOG_PCI busdevice->logerror(" bus:0 function:%d register:%d data:%08X mask:%08X\n", function, reg, data, mem_mask); @@ -749,7 +749,7 @@ static void hubintisabridg_pci_w(device_t *busdevice, device_t *device, int func * dummy for non connected devices */ -static UINT32 dummy_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t dummy_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { #ifdef LOG_PCI busdevice->logerror(" bus:0 function:%d register:%d mask:%08X\n",function,reg,mem_mask); @@ -757,7 +757,7 @@ static UINT32 dummy_pci_r(device_t *busdevice, device_t *device, int function, i return 0; } -static void dummy_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void dummy_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { #ifdef LOG_PCI busdevice->logerror(" bus:0 function:%d register:%d data:%08X mask:%08X\n", function, reg, data, mem_mask); @@ -839,7 +839,7 @@ int xbox_base_state::smbus_pic16lc(int command, int rw, int data) if (command == 0) pic16lc_buffer[0] = 'B'; else - pic16lc_buffer[command] = (UINT8)data; + pic16lc_buffer[command] = (uint8_t)data; logerror("pic16lc: %d %d %d\n", command, rw, data); return 0; } diff --git a/src/mame/machine/xbox_usb.cpp b/src/mame/machine/xbox_usb.cpp index f7b4914c62a..a8388467930 100644 --- a/src/mame/machine/xbox_usb.cpp +++ b/src/mame/machine/xbox_usb.cpp @@ -45,7 +45,7 @@ static const char *const usbregnames[] = { const device_type OHCI_USB_CONTROLLER = &device_creator; -ohci_usb_controller::ohci_usb_controller(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ohci_usb_controller::ohci_usb_controller(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OHCI_USB_CONTROLLER, "OHCI USB CONTROLLER", tag, owner, clock, "ohciusb", __FILE__), m_interrupt_handler(*this) { @@ -79,7 +79,7 @@ void ohci_usb_controller::device_reset() READ32_MEMBER(ohci_usb_controller::read) { - UINT32 ret; + uint32_t ret; #ifdef LOG_OHCI if (offset >= 0x54 / 4) @@ -93,7 +93,7 @@ READ32_MEMBER(ohci_usb_controller::read) WRITE32_MEMBER(ohci_usb_controller::write) { - UINT32 old = ohcist.hc_regs[offset]; + uint32_t old = ohcist.hc_regs[offset]; #ifdef LOG_OHCI if (offset >= 0x54 / 4) @@ -226,8 +226,8 @@ WRITE32_MEMBER(ohci_usb_controller::write) void ohci_usb_controller::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - UINT32 hcca; - UINT32 plh; + uint32_t hcca; + uint32_t plh; int changed = 0; int list = 1; bool cont = false; @@ -278,7 +278,7 @@ void ohci_usb_controller::device_timer(emu_timer &timer, device_timer_id id, int if (!(ohcist.endpoint_descriptor.h | ohcist.endpoint_descriptor.k)) { // compare the Endpoint Descriptor TailPointer and NextTransferDescriptor fields. if (ohcist.endpoint_descriptor.headp != ohcist.endpoint_descriptor.tailp) { - UINT32 a, b; + uint32_t a, b; int R = 0; // service transfer descriptor @@ -455,7 +455,7 @@ void ohci_usb_controller::device_timer(emu_timer &timer, device_timer_id id, int if (!(ohcist.endpoint_descriptor.h | ohcist.endpoint_descriptor.k)) { // compare the Endpoint Descriptor TailPointer and NextTransferDescriptor fields. if (ohcist.endpoint_descriptor.headp != ohcist.endpoint_descriptor.tailp) { - UINT32 a, b; + uint32_t a, b; // set CLF (ControlListFilled) ohcist.hc_regs[HcCommandStatus] |= CLF; // service transfer descriptor @@ -591,7 +591,7 @@ void ohci_usb_controller::device_timer(emu_timer &timer, device_timer_id id, int if (!(ohcist.endpoint_descriptor.h | ohcist.endpoint_descriptor.k)) { // compare the Endpoint Descriptor TailPointer and NextTransferDescriptor fields. if (ohcist.endpoint_descriptor.headp != ohcist.endpoint_descriptor.tailp) { - UINT32 a, b; + uint32_t a, b; // set BLF (BulkListFilled) ohcist.hc_regs[HcCommandStatus] |= BLF; // service transfer descriptor @@ -697,7 +697,7 @@ void ohci_usb_controller::device_timer(emu_timer &timer, device_timer_id id, int if ((ohcist.writebackdonehadcounter != 0) && (ohcist.writebackdonehadcounter != 7)) ohcist.writebackdonehadcounter--; if ((ohcist.writebackdonehadcounter == 0) && ((ohcist.hc_regs[HcInterruptStatus] & WritebackDoneHead) == 0)) { - UINT32 b = 0; + uint32_t b = 0; if ((ohcist.hc_regs[HcInterruptStatus] & ohcist.hc_regs[HcInterruptEnable]) != WritebackDoneHead) b = 1; @@ -740,9 +740,9 @@ void ohci_usb_controller::usb_ohci_interrupts() } } -void ohci_usb_controller::usb_ohci_read_endpoint_descriptor(UINT32 address) +void ohci_usb_controller::usb_ohci_read_endpoint_descriptor(uint32_t address) { - UINT32 w; + uint32_t w; w = ohcist.space->read_dword(address); ohcist.endpoint_descriptor.word0 = w; @@ -761,9 +761,9 @@ void ohci_usb_controller::usb_ohci_read_endpoint_descriptor(UINT32 address) ohcist.endpoint_descriptor.nexted = ohcist.space->read_dword(address + 12); } -void ohci_usb_controller::usb_ohci_writeback_endpoint_descriptor(UINT32 address) +void ohci_usb_controller::usb_ohci_writeback_endpoint_descriptor(uint32_t address) { - UINT32 w; + uint32_t w; w = ohcist.endpoint_descriptor.word0 & 0xf8000000; w = w | (ohcist.endpoint_descriptor.mps << 16) | (ohcist.endpoint_descriptor.f << 15) | (ohcist.endpoint_descriptor.k << 14) | (ohcist.endpoint_descriptor.s << 13) | (ohcist.endpoint_descriptor.d << 11) | (ohcist.endpoint_descriptor.en << 7) | ohcist.endpoint_descriptor.fa; @@ -772,9 +772,9 @@ void ohci_usb_controller::usb_ohci_writeback_endpoint_descriptor(UINT32 address) ohcist.space->write_dword(address + 8, w); } -void ohci_usb_controller::usb_ohci_read_transfer_descriptor(UINT32 address) +void ohci_usb_controller::usb_ohci_read_transfer_descriptor(uint32_t address) { - UINT32 w; + uint32_t w; w = ohcist.space->read_dword(address); ohcist.transfer_descriptor.word0 = w; @@ -789,9 +789,9 @@ void ohci_usb_controller::usb_ohci_read_transfer_descriptor(UINT32 address) ohcist.transfer_descriptor.be = ohcist.space->read_dword(address + 12); } -void ohci_usb_controller::usb_ohci_writeback_transfer_descriptor(UINT32 address) +void ohci_usb_controller::usb_ohci_writeback_transfer_descriptor(uint32_t address) { - UINT32 w; + uint32_t w; w = ohcist.transfer_descriptor.word0 & 0x0003ffff; w = w | (ohcist.transfer_descriptor.cc << 28) | (ohcist.transfer_descriptor.ec << 26) | (ohcist.transfer_descriptor.t << 24) | (ohcist.transfer_descriptor.di << 21) | (ohcist.transfer_descriptor.dp << 19) | (ohcist.transfer_descriptor.r << 18); @@ -800,9 +800,9 @@ void ohci_usb_controller::usb_ohci_writeback_transfer_descriptor(UINT32 address) ohcist.space->write_dword(address + 8, ohcist.transfer_descriptor.nexttd); } -void ohci_usb_controller::usb_ohci_read_isochronous_transfer_descriptor(UINT32 address) +void ohci_usb_controller::usb_ohci_read_isochronous_transfer_descriptor(uint32_t address) { - UINT32 w; + uint32_t w; w = ohcist.space->read_dword(address); ohcist.isochronous_transfer_descriptor.word0 = w; @@ -829,9 +829,9 @@ void ohci_usb_controller::usb_ohci_read_isochronous_transfer_descriptor(UINT32 a ohcist.isochronous_transfer_descriptor.offset[7] = (w >> 16) & 0xffff; } -void ohci_usb_controller::usb_ohci_writeback_isochronous_transfer_descriptor(UINT32 address) +void ohci_usb_controller::usb_ohci_writeback_isochronous_transfer_descriptor(uint32_t address) { - UINT32 w; + uint32_t w; w = ohcist.isochronous_transfer_descriptor.word0 & 0x1f0000; w = w | (ohcist.isochronous_transfer_descriptor.cc << 28) | (ohcist.isochronous_transfer_descriptor.fc << 24) | (ohcist.isochronous_transfer_descriptor.di << 21) | ohcist.isochronous_transfer_descriptor.sf; @@ -870,7 +870,7 @@ void ohci_function_device::initialize(running_machine &machine, ohci_usb_control { busmanager = usb_bus_manager; state = DefaultState; - descriptors = auto_alloc_array(machine, UINT8, 1024); + descriptors = auto_alloc_array(machine, uint8_t, 1024); descriptors_pos = 0; address = 0; newaddress = 0; @@ -893,7 +893,7 @@ void ohci_function_device::initialize(running_machine &machine, ohci_usb_control void ohci_function_device::add_device_descriptor(const USBStandardDeviceDescriptor &descriptor) { - UINT8 *p = descriptors + descriptors_pos; + uint8_t *p = descriptors + descriptors_pos; p[0] = descriptor.bLength; p[1] = descriptor.bDescriptorType; @@ -920,7 +920,7 @@ void ohci_function_device::add_device_descriptor(const USBStandardDeviceDescript void ohci_function_device::add_configuration_descriptor(const USBStandardConfigurationDescriptor &descriptor) { usb_device_configuration *c = new usb_device_configuration; - UINT8 *p = descriptors + descriptors_pos; + uint8_t *p = descriptors + descriptors_pos; p[0] = descriptor.bLength; p[1] = descriptor.bDescriptorType; @@ -944,7 +944,7 @@ void ohci_function_device::add_interface_descriptor(const USBStandardInterfaceDe { usb_device_interface *ii; usb_device_interface_alternate *aa; - UINT8 *p = descriptors + descriptors_pos; + uint8_t *p = descriptors + descriptors_pos; if (latest_configuration == nullptr) return; @@ -989,7 +989,7 @@ void ohci_function_device::add_interface_descriptor(const USBStandardInterfaceDe void ohci_function_device::add_endpoint_descriptor(const USBStandardEndpointDescriptor &descriptor) { - UINT8 *p = descriptors + descriptors_pos; + uint8_t *p = descriptors + descriptors_pos; if (latest_alternate == nullptr) return; @@ -1007,11 +1007,11 @@ void ohci_function_device::add_endpoint_descriptor(const USBStandardEndpointDesc latest_configuration->size += descriptor.bLength; } -void ohci_function_device::add_string_descriptor(const UINT8 *descriptor) +void ohci_function_device::add_string_descriptor(const uint8_t *descriptor) { usb_device_string *ss; int len = descriptor[0]; - UINT8 *p = descriptors + descriptors_pos; + uint8_t *p = descriptors + descriptors_pos; ss = new usb_device_string; @@ -1104,13 +1104,13 @@ int ohci_function_device::find_alternate(int interfacei) return 0; } -UINT8 *ohci_function_device::position_device_descriptor(int &size) +uint8_t *ohci_function_device::position_device_descriptor(int &size) { size = descriptors_pos; // descriptors[0]; return descriptors; } -UINT8 *ohci_function_device::position_configuration_descriptor(int index, int &size) +uint8_t *ohci_function_device::position_configuration_descriptor(int index, int &size) { for (auto c = configurations.begin(); c != configurations.end(); ++c) { @@ -1124,7 +1124,7 @@ UINT8 *ohci_function_device::position_configuration_descriptor(int index, int &s return nullptr; } -UINT8 *ohci_function_device::position_string_descriptor(int index, int &size) +uint8_t *ohci_function_device::position_string_descriptor(int index, int &size) { int i = 0; @@ -1147,7 +1147,7 @@ void ohci_function_device::execute_reset() newaddress = 0; } -int ohci_function_device::execute_transfer(int endpoint, int pid, UINT8 *buffer, int size) +int ohci_function_device::execute_transfer(int endpoint, int pid, uint8_t *buffer, int size) { int descriptortype, descriptorindex; @@ -1222,14 +1222,14 @@ int ohci_function_device::execute_transfer(int endpoint, int pid, UINT8 *buffer, return handle_set_descriptor_request(endpoint, p); break; case GET_CONFIGURATION: - endpoints[endpoint].buffer[0] = (UINT8)configurationvalue; + endpoints[endpoint].buffer[0] = (uint8_t)configurationvalue; endpoints[endpoint].position = endpoints[endpoint].buffer; endpoints[endpoint].remain = 1; if (p->wLength == 0) endpoints[endpoint].remain = 0; break; case GET_INTERFACE: - endpoints[endpoint].buffer[0] = (UINT8)find_alternate(p->wIndex); + endpoints[endpoint].buffer[0] = (uint8_t)find_alternate(p->wIndex); endpoints[endpoint].position = endpoints[endpoint].buffer; endpoints[endpoint].remain = 1; if (p->wLength == 0) @@ -1393,7 +1393,7 @@ const USBStandardEndpointDescriptor ohci_game_controller_device::enddesc02 = { 7 const device_type OHCI_GAME_CONTROLLER = &device_creator; -ohci_game_controller_device::ohci_game_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ohci_game_controller_device::ohci_game_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OHCI_GAME_CONTROLLER, "OHCI Game Controller", tag, owner, clock, "ohci_gc", __FILE__), ohci_function_device(), m_ThumbstickLh(*this, "ThumbstickLh"), @@ -1426,7 +1426,7 @@ void ohci_game_controller_device::initialize(running_machine &machine, ohci_usb_ int ohci_game_controller_device::handle_nonstandard_request(int endpoint, USBSetupPacket *setup) { // >=8 ==42 !=0 !=0 1,3 2<20 <=20 - static const UINT8 reportinfo[16] = { 0x10,0x42 ,0x32,0x43,1 ,0x65,0x14,0x20,0x98,0xa9,0xba,0xcb,0xdc,0xed,0xfe }; + static const uint8_t reportinfo[16] = { 0x10,0x42 ,0x32,0x43,1 ,0x65,0x14,0x20,0x98,0xa9,0xba,0xcb,0xdc,0xed,0xfe }; if (endpoint != 0) return -1; @@ -1434,7 +1434,7 @@ int ohci_game_controller_device::handle_nonstandard_request(int endpoint, USBSet { if ((setup->bRequest == GET_DESCRIPTOR) && (setup->wValue == 0x4200)) { - endpoints[endpoint].position = (UINT8 *)reportinfo; + endpoints[endpoint].position = (uint8_t *)reportinfo; endpoints[endpoint].remain = 16; return 0; } @@ -1476,7 +1476,7 @@ int ohci_game_controller_device::handle_nonstandard_request(int endpoint, USBSet return -1; } -int ohci_game_controller_device::handle_interrupt_pid(int endpoint, int pid, UINT8 *buffer, int size) +int ohci_game_controller_device::handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size) { if ((endpoint == 2) && (pid == InPid)) { int v; @@ -1485,7 +1485,7 @@ int ohci_game_controller_device::handle_interrupt_pid(int endpoint, int pid, UIN buffer[1] = 20; v = m_DPad->read(); v = v | (m_Buttons->read() << 4); - buffer[2] = (UINT8)v; + buffer[2] = (uint8_t)v; buffer[3] = 0; buffer[4] = m_AGreen->read(); buffer[5] = m_BRed->read(); @@ -1497,20 +1497,20 @@ int ohci_game_controller_device::handle_interrupt_pid(int endpoint, int pid, UIN buffer[11] = m_TriggerR->read(); v = m_ThumbstickLh->read(); v = (v - 128) * 256; - buffer[12] = (UINT16)v & 255; - buffer[13] = (UINT16)v >> 8; + buffer[12] = (uint16_t)v & 255; + buffer[13] = (uint16_t)v >> 8; v = m_ThumbstickLv->read(); v = (v - 128) * 256; - buffer[14] = (UINT16)v & 255; - buffer[15] = (UINT16)v >> 8; + buffer[14] = (uint16_t)v & 255; + buffer[15] = (uint16_t)v >> 8; v = m_ThumbstickRh->read(); v = (v - 128) * 256; - buffer[16] = (UINT16)v & 255; - buffer[17] = (UINT16)v >> 8; + buffer[16] = (uint16_t)v & 255; + buffer[17] = (uint16_t)v >> 8; v = m_ThumbstickRv->read(); v = (v - 128) * 256; - buffer[18] = (UINT16)v & 255; - buffer[19] = (UINT16)v >> 8; + buffer[18] = (uint16_t)v & 255; + buffer[19] = (uint16_t)v >> 8; return size; } return -1; diff --git a/src/mame/machine/z80bin.cpp b/src/mame/machine/z80bin.cpp index e2b263aab45..5a683273881 100644 --- a/src/mame/machine/z80bin.cpp +++ b/src/mame/machine/z80bin.cpp @@ -8,12 +8,12 @@ memory -------------------------------------------------*/ -image_init_result z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr ) +image_init_result z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, uint16_t *exec_addr, uint16_t *start_addr, uint16_t *end_addr ) { int ch; - UINT16 args[3]; - UINT16 i=0, j, size; - UINT8 data; + uint16_t args[3]; + uint16_t i=0, j, size; + uint8_t data; char pgmname[256]; char message[256]; diff --git a/src/mame/machine/z80bin.h b/src/mame/machine/z80bin.h index e1951358c5f..b47aa9fa76c 100644 --- a/src/mame/machine/z80bin.h +++ b/src/mame/machine/z80bin.h @@ -13,6 +13,6 @@ #ifndef __Z80_BIN__ #define __Z80_BIN__ -image_init_result z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr ); +image_init_result z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, uint16_t *exec_addr, uint16_t *start_addr, uint16_t *end_addr ); #endif diff --git a/src/mame/machine/z80ne.cpp b/src/mame/machine/z80ne.cpp index 8cf642848e0..b77d7a2f986 100644 --- a/src/mame/machine/z80ne.cpp +++ b/src/mame/machine/z80ne.cpp @@ -38,7 +38,7 @@ cassette_image_device* z80ne_state::cassette_device_image() TIMER_CALLBACK_MEMBER(z80ne_state::z80ne_cassette_tc) { - UINT8 cass_ws = 0; + uint8_t cass_ws = 0; m_cass_data.input.length++; cass_ws = ((cassette_device_image())->input() > +0.02) ? 1 : 0; @@ -75,7 +75,7 @@ TIMER_CALLBACK_MEMBER(z80ne_state::z80ne_cassette_tc) DRIVER_INIT_MEMBER(z80ne_state,z80ne) { /* first two entries point to rom on reset */ - UINT8 *RAM = m_region_z80ne->base(); + uint8_t *RAM = m_region_z80ne->base(); m_bank1->configure_entry(0, &RAM[0x00000]); /* RAM at 0x0000 */ m_bank1->configure_entry(1, &RAM[0x14000]); /* ep382 at 0x0000 */ m_bank2->configure_entry(0, &RAM[0x14000]); /* ep382 at 0x8000 */ @@ -93,7 +93,7 @@ DRIVER_INIT_MEMBER(z80ne_state,z80netb) DRIVER_INIT_MEMBER(z80ne_state,z80netf) { /* first two entries point to rom on reset */ - UINT8 *RAM = m_region_z80ne->base(); + uint8_t *RAM = m_region_z80ne->base(); m_bank1->configure_entry(0, &RAM[0x00000]); /* RAM at 0x0000-0x03FF */ m_bank1->configure_entries(1, 3, &RAM[0x14400], 0x0400); /* ep390, ep1390, ep2390 at 0x0000-0x03FF */ m_bank1->configure_entry(4, &RAM[0x14000]); /* ep382 at 0x0000-0x03FF */ @@ -131,9 +131,9 @@ TIMER_CALLBACK_MEMBER(z80ne_state::z80ne_kbd_scan) * */ - UINT16 key_bits; - UINT8 ctrl; //, rst; - UINT8 i; + uint16_t key_bits; + uint8_t ctrl; //, rst; + uint8_t i; /* 4-bit counter */ --m_lx383_scan_counter; @@ -357,7 +357,7 @@ MACHINE_RESET_MEMBER(z80ne_state,z80netf) INPUT_CHANGED_MEMBER(z80ne_state::z80ne_reset) { - UINT8 rst; + uint8_t rst; rst = m_io_rst->read(); if ( ! BIT(rst, 0)) @@ -368,7 +368,7 @@ INPUT_CHANGED_MEMBER(z80ne_state::z80ne_reset) INPUT_CHANGED_MEMBER(z80ne_state::z80ne_nmi) { - UINT8 nmi; + uint8_t nmi; nmi = m_io_lx388_brk->read(); if ( ! BIT(nmi, 0)) @@ -523,7 +523,7 @@ READ8_MEMBER(z80ne_state::lx385_data_r) READ8_MEMBER(z80ne_state::lx385_ctrl_r) { /* set unused bits high */ - UINT8 data = 0xc0; + uint8_t data = 0xc0; m_ay31015->set_input_pin(AY31015_SWE, 0); data |= (m_ay31015->get_output_pin(AY31015_OR ) ? 0x01 : 0); @@ -553,9 +553,9 @@ WRITE8_MEMBER(z80ne_state::lx385_ctrl_w) * 3 *TAPEA Enable (active low) (at reset: low) * 4 *TAPEB Enable (active low) (at reset: low) */ - UINT8 uart_reset, uart_rdav, uart_tx_clock; - UINT8 motor_a, motor_b; - UINT8 changed_bits = (m_lx385_ctrl ^ data) & 0x1C; + uint8_t uart_reset, uart_rdav, uart_tx_clock; + uint8_t motor_a, motor_b; + uint8_t changed_bits = (m_lx385_ctrl ^ data) & 0x1C; m_lx385_ctrl = data; uart_reset = ((data & 0x03) == 0x00); @@ -603,7 +603,7 @@ READ8_MEMBER(z80ne_state::lx388_mc6847_videoram_r) { if (offset == ~0) return 0xff; - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int d6 = BIT(videoram[offset], 6); int d7 = BIT(videoram[offset], 7); @@ -616,7 +616,7 @@ READ8_MEMBER(z80ne_state::lx388_mc6847_videoram_r) READ8_MEMBER(z80ne_state::lx388_data_r) { - UINT8 data; + uint8_t data; data = m_lx388_kr2376->data_r(space, 0) & 0x7f; data |= m_lx388_kr2376->get_output_pin(KR2376_SO) << 7; @@ -697,7 +697,7 @@ READ8_MEMBER(z80ne_state::lx390_reset_bank) READ8_MEMBER(z80ne_state::lx390_fdc_r) { - UINT8 d; + uint8_t d; switch(offset) { @@ -733,7 +733,7 @@ READ8_MEMBER(z80ne_state::lx390_fdc_r) WRITE8_MEMBER(z80ne_state::lx390_fdc_w) { - UINT8 d; + uint8_t d; d = data; switch(offset) diff --git a/src/mame/machine/zndip.cpp b/src/mame/machine/zndip.cpp index f5e1d618604..7f27b157aaa 100644 --- a/src/mame/machine/zndip.cpp +++ b/src/mame/machine/zndip.cpp @@ -4,7 +4,7 @@ const device_type ZNDIP = &device_creator; -zndip_device::zndip_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +zndip_device::zndip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ZNDIP, "Sony ZNDIP", tag, owner, clock, "zndip", __FILE__), m_data_handler(*this), m_dataout_handler(*this), diff --git a/src/mame/machine/zndip.h b/src/mame/machine/zndip.h index 405ee496fda..75cb607f5f3 100644 --- a/src/mame/machine/zndip.h +++ b/src/mame/machine/zndip.h @@ -21,7 +21,7 @@ extern const device_type ZNDIP; class zndip_device : public device_t { public: - zndip_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + zndip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_data_handler(device_t &device, _Object object) { return downcast(device).m_data_handler.set_callback(object); } @@ -43,7 +43,7 @@ private: int m_select; int m_clock; - UINT8 m_bit; + uint8_t m_bit; emu_timer *m_dip_timer; }; diff --git a/src/mame/machine/zs01.cpp b/src/mame/machine/zs01.cpp index 2816d865ee0..c112f208ab2 100644 --- a/src/mame/machine/zs01.cpp +++ b/src/mame/machine/zs01.cpp @@ -29,7 +29,7 @@ inline void ATTR_PRINTF( 3, 4 ) zs01_device::verboselog( int n_level, const char // device type definition const device_type ZS01 = &device_creator; -zs01_device::zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +zs01_device::zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t( mconfig, ZS01, "Konami ZS01 PIC", tag, owner, clock, "zs01", __FILE__ ), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -117,14 +117,14 @@ WRITE_LINE_MEMBER( zs01_device::write_cs ) m_cs = state; } -void zs01_device::decrypt( UINT8 *destination, UINT8 *source, int length, UINT8 *key, UINT8 previous_byte ) +void zs01_device::decrypt( uint8_t *destination, uint8_t *source, int length, uint8_t *key, uint8_t previous_byte ) { - UINT32 a0; - UINT32 v1; - UINT32 v0; - UINT32 a1; - UINT32 t1; - UINT32 t0; + uint32_t a0; + uint32_t v1; + uint32_t v0; + uint32_t a1; + uint32_t t1; + uint32_t t0; length--; if( length >= 0 ) @@ -164,15 +164,15 @@ void zs01_device::decrypt( UINT8 *destination, UINT8 *source, int length, UINT8 } } -void zs01_device::decrypt2( UINT8 *destination, UINT8 *source, int length, UINT8 *key, UINT8 previous_byte ) +void zs01_device::decrypt2( uint8_t *destination, uint8_t *source, int length, uint8_t *key, uint8_t previous_byte ) { - UINT32 a0; - UINT32 v1; - UINT32 v0; - UINT32 a1; - UINT32 t2; - UINT32 t1; - UINT32 t0; + uint32_t a0; + uint32_t v1; + uint32_t v0; + uint32_t a1; + uint32_t t2; + uint32_t t1; + uint32_t t0; t2 = 0; if( length >= 0 ) @@ -212,13 +212,13 @@ void zs01_device::decrypt2( UINT8 *destination, UINT8 *source, int length, UINT8 } } -void zs01_device::encrypt( UINT8 *destination, UINT8 *source, int length, UINT8 *key, UINT32 previous_byte ) +void zs01_device::encrypt( uint8_t *destination, uint8_t *source, int length, uint8_t *key, uint32_t previous_byte ) { - UINT32 t0; - UINT32 v0; - UINT32 v1; - UINT32 a0; - UINT32 a1; + uint32_t t0; + uint32_t v0; + uint32_t v1; + uint32_t a0; + uint32_t a1; length--; if( length >= 0 ) @@ -260,12 +260,12 @@ void zs01_device::encrypt( UINT8 *destination, UINT8 *source, int length, UINT8 } } -UINT16 zs01_device::calc_crc( UINT8 *buffer, UINT32 length ) +uint16_t zs01_device::calc_crc( uint8_t *buffer, uint32_t length ) { - UINT32 v1; - UINT32 a3; - UINT32 v0; - UINT32 a2; + uint32_t v1; + uint32_t a3; + uint32_t v0; + uint32_t a2; v1 = 0xffff; a3 = 0; @@ -392,7 +392,7 @@ WRITE_LINE_MEMBER( zs01_device::write_scl ) decrypt2( &m_write_buffer[ 2 ], &m_write_buffer[ 2 ], SIZE_DATA_BUFFER, m_data_key, 0x00 ); } - UINT16 crc = calc_crc( m_write_buffer, 10 ); + uint16_t crc = calc_crc( m_write_buffer, 10 ); if( crc == ( ( m_write_buffer[ 10 ] << 8 ) | m_write_buffer[ 11 ] ) ) { @@ -592,7 +592,7 @@ void zs01_device::nvram_default() } else { - UINT8 *region = m_region->base(); + uint8_t *region = m_region->base(); memcpy( m_response_to_reset, region, sizeof( m_response_to_reset ) ); region += sizeof( m_response_to_reset ); memcpy( m_command_key, region, sizeof( m_command_key ) ); region += sizeof( m_command_key ); diff --git a/src/mame/machine/zs01.h b/src/mame/machine/zs01.h index b7266a20cbd..2eb0dca8049 100644 --- a/src/mame/machine/zs01.h +++ b/src/mame/machine/zs01.h @@ -24,7 +24,7 @@ class zs01_device : public device_t, { public: // construction/destruction - zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ); + zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); // inline configuration helpers static void static_set_ds2401_tag( device_t &device, const char *ds2401_tag ) { downcast( device ).m_ds2401_tag = ds2401_tag; } @@ -47,10 +47,10 @@ protected: private: inline void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, const char *s_fmt, ... ); - void decrypt( UINT8 *destination, UINT8 *source, int length, UINT8 *key, UINT8 previous_byte ); - void decrypt2( UINT8 *destination, UINT8 *source, int length, UINT8 *key, UINT8 previous_byte ); - void encrypt( UINT8 *destination, UINT8 *source, int length, UINT8 *key, UINT32 previous_byte ); - UINT16 calc_crc( UINT8 *buffer, UINT32 length ); + void decrypt( uint8_t *destination, uint8_t *source, int length, uint8_t *key, uint8_t previous_byte ); + void decrypt2( uint8_t *destination, uint8_t *source, int length, uint8_t *key, uint8_t previous_byte ); + void encrypt( uint8_t *destination, uint8_t *source, int length, uint8_t *key, uint32_t previous_byte ); + uint16_t calc_crc( uint8_t *buffer, uint32_t length ); int data_offset(); enum size_t @@ -85,13 +85,13 @@ private: int m_shift; int m_bit; int m_byte; - UINT8 m_write_buffer[ 12 ]; - UINT8 m_read_buffer[ 12 ]; - UINT8 m_response_key[ 8 ]; - UINT8 m_response_to_reset[ 4 ]; - UINT8 m_command_key[ 8 ]; - UINT8 m_data_key[ 8 ]; - UINT8 m_data[ 4096 ]; + uint8_t m_write_buffer[ 12 ]; + uint8_t m_read_buffer[ 12 ]; + uint8_t m_response_key[ 8 ]; + uint8_t m_response_to_reset[ 4 ]; + uint8_t m_command_key[ 8 ]; + uint8_t m_data_key[ 8 ]; + uint8_t m_data[ 4096 ]; ds2401_device *m_ds2401; }; diff --git a/src/mame/machine/zx.cpp b/src/mame/machine/zx.cpp index f68494b8c9e..3876cd5de4c 100644 --- a/src/mame/machine/zx.cpp +++ b/src/mame/machine/zx.cpp @@ -47,7 +47,7 @@ void zx_state::zx_tape_input() void zx_state::drop_sync() { if (m_vsync_active) { - UINT64 time = m_maincpu->total_cycles(); + uint64_t time = m_maincpu->total_cycles(); m_vsync_active = false; m_cassette->output(-1.0); @@ -69,11 +69,11 @@ void zx_state::drop_sync() xe = 0; } if(ys == ye) { - UINT16 *dest = &m_bitmap_render->pix16(ys, xs); + uint16_t *dest = &m_bitmap_render->pix16(ys, xs); for(int x = xs; x < xe; x++) *dest++ = 1; } else { - UINT16 *dest = &m_bitmap_render->pix16(ys, xs); + uint16_t *dest = &m_bitmap_render->pix16(ys, xs); for(int x = xs; x < 384; x++) *dest++ = 1; for(int y = ys+1; y < ye; y++) { @@ -113,7 +113,7 @@ READ8_MEMBER( zx_state::zx80_io_r ) /* port FE = read keyboard, NTSC/PAL diode, and cass bit; turn off HSYNC-generator/cass-out The upper 8 bits are used to select a keyboard scan line */ - UINT8 data = 0xff; + uint8_t data = 0xff; if (!(offset & 0x01)) { @@ -157,7 +157,7 @@ READ8_MEMBER( zx_state::zx81_io_r ) FE = read keyboard, NTSC/PAL diode, and cass bit; turn off HSYNC-generator/cass-out The upper 8 bits are used to select a keyboard scan line */ - UINT8 data = 0xff; + uint8_t data = 0xff; if (!(offset & 0x01)) { @@ -204,8 +204,8 @@ READ8_MEMBER( zx_state::pc8300_io_r ) The upper 8 bits are used to select a keyboard scan line. No TV diode */ - UINT8 data = 0xff; - UINT8 offs = offset & 0xff; + uint8_t data = 0xff; + uint8_t offs = offset & 0xff; if (offs == 0xf5) { @@ -249,8 +249,8 @@ READ8_MEMBER( zx_state::pow3000_io_r ) FE = read keyboard and cass bit; turn off HSYNC-generator/cass-out The upper 8 bits are used to select a keyboard scan line */ - UINT8 data = 0xff; - UINT8 offs = offset & 0xff; + uint8_t data = 0xff; + uint8_t offs = offset & 0xff; if (offs == 0x7e) { @@ -294,7 +294,7 @@ WRITE8_MEMBER( zx_state::zx80_io_w ) { /* port FF = write HSYNC and cass data */ - UINT8 offs = offset & 0xff; + uint8_t offs = offset & 0xff; if (offs == 0xff) m_cassette->output(-1.0); diff --git a/src/mame/machine/zx8302.cpp b/src/mame/machine/zx8302.cpp index 16e06522aa0..d7ae084ce7f 100644 --- a/src/mame/machine/zx8302.cpp +++ b/src/mame/machine/zx8302.cpp @@ -51,7 +51,7 @@ const device_type ZX8302 = &device_creator; // trigger_interrupt - //------------------------------------------------- -inline void zx8302_device::trigger_interrupt(UINT8 line) +inline void zx8302_device::trigger_interrupt(uint8_t line) { m_irq |= line; @@ -127,7 +127,7 @@ inline void zx8302_device::transmit_ipc_data() // zx8302_device - constructor //------------------------------------------------- -zx8302_device::zx8302_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +zx8302_device::zx8302_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ZX8302, "Sinclair ZX8302", tag, owner, clock, "zx8302", __FILE__), device_serial_interface(mconfig, *this), m_rtc_clock(0), @@ -312,7 +312,7 @@ void zx8302_device::rcv_complete() READ8_MEMBER( zx8302_device::rtc_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -372,7 +372,7 @@ READ8_MEMBER( zx8302_device::mdv_track_r ) { if (LOG) logerror("ZX8302 '%s' Microdrive Track %u: %02x\n", tag(), m_track, m_mdv_data[m_track]); - UINT8 data = m_mdv_data[m_track]; + uint8_t data = m_mdv_data[m_track]; m_track = !m_track; @@ -401,7 +401,7 @@ READ8_MEMBER( zx8302_device::status_r ) */ - UINT8 data = 0; + uint8_t data = 0; // TODO network port diff --git a/src/mame/machine/zx8302.h b/src/mame/machine/zx8302.h index 0d4a223946f..515e2dce2ef 100644 --- a/src/mame/machine/zx8302.h +++ b/src/mame/machine/zx8302.h @@ -98,7 +98,7 @@ class zx8302_device : public device_t, { public: // construction/destruction - zx8302_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + zx8302_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_rtc_clock(device_t &device, int rtc_clock) { downcast(device).m_rtc_clock = rtc_clock; } template static devcb_base &set_out_ipl1l_callback(device_t &device, _Object object) { return downcast(device).m_out_ipl1l_cb.set_callback(object); } @@ -146,7 +146,7 @@ protected: virtual void rcv_callback() override; virtual void rcv_complete() override; - inline void trigger_interrupt(UINT8 line); + inline void trigger_interrupt(uint8_t line); inline void transmit_ipc_data(); private: @@ -228,12 +228,12 @@ private: int m_cts2; // registers - UINT8 m_idr; // IPC data register - UINT8 m_tcr; // transfer control register - UINT8 m_tdr; // transfer data register - UINT8 m_irq; // interrupt register - UINT32 m_ctr; // counter register - UINT8 m_status; // status register + uint8_t m_idr; // IPC data register + uint8_t m_tcr; // transfer control register + uint8_t m_tdr; // transfer data register + uint8_t m_irq; // interrupt register + uint32_t m_ctr; // counter register + uint8_t m_status; // status register // IPC communication state int m_comdata_from_ipc; // pending data from IPC->68000 @@ -245,7 +245,7 @@ private: int m_baudx4; // IPC baud x4 // microdrive state - UINT8 m_mdv_data[2]; // track data register + uint8_t m_mdv_data[2]; // track data register int m_track; // current track // timers -- cgit v1.2.3